ソースを参照

[FE]修改假勤管理对话框显示问题,修改用户管理页面路由逻辑

luoxu5 4 年 前
コミット
d26fb8227b

security-protection-platform/.aid/mock/userRights.js → security-protection-platform/.aid/mock/usermana.js


security-protection-platform/src/api/userRights/index.js → security-protection-platform/src/api/usermana/index.js


+ 0 - 12
security-protection-platform/src/modules/userRights/organizationmana/index.vue

@ -1,12 +0,0 @@
1
<template>
2
  <div>组织管理页面</div>
3
</template>
4
5
<script>
6
export default {
7
8
}
9
</script>
10
11
<style>
12
</style>

+ 0 - 12
security-protection-platform/src/modules/userRights/usermana/index.vue

@ -1,12 +0,0 @@
1
<template>
2
  <div>123</div>
3
</template>
4
5
<script>
6
export default {
7
8
}
9
</script>
10
11
<style>
12
</style>

+ 279 - 0
security-protection-platform/src/modules/usermana/index.vue

@ -0,0 +1,279 @@
1
<template>
2
  <div class="usermana-page">
3
    <t-card class="page-card">
4
      <div class="select-confidtion-box row">
5
        <div class="col-3">公司:
6
          <t-select v-model="companyTypeId" width="200px">
7
            <t-option v-for="item in companyTypesList" :key="item.id" :value="item.id">{{ item.name }}</t-option>
8
          </t-select>
9
        </div>
10
        <div class="col-3">部门:
11
          <t-select v-model="departmentTypeId" width="200px">
12
            <t-option v-for="item in departmentTypesList" :key="item.id" :value="item.id">{{ item.name }}</t-option>
13
          </t-select>
14
        </div>
15
        <div class="col-3">姓名:
16
          <t-select v-model="staffTypeId" width="200px">
17
            <t-option v-for="item in staffTypesList" :key="item.id" :value="item.id">{{ item.name }}</t-option>
18
          </t-select>
19
        </div>
20
        <div class="col-2 offset-1 select-button-box" align="end">
21
          <t-button color="primary" @click="selectHandle">查询</t-button>
22
          <t-button @click="resetData">重置</t-button>
23
        </div>
24
      </div>
25
      <div class="function-button-box">
26
        <t-button color="primary" @click="showAddDeviceModal">
27
          <t-icon icon="plus-circle-outline" size="16"></t-icon>新增
28
        </t-button>
29
        <t-button @click="multDeleteDeviceData">
30
          <t-icon icon="trash" size="16"></t-icon>删除
31
        </t-button>
32
      </div>
33
      <div class="table-box">
34
        <t-table :data="userDataList" line @selection-change="selectChange">
35
          <t-table-column type="selection" width="70"></t-table-column>
36
          <t-table-column prop="name" label="姓名" width="100"></t-table-column>
37
          <t-table-column prop="userId" label="员工编号" width="120"></t-table-column>
38
          <t-table-column prop="companyName" label="公司" width="150"></t-table-column>
39
          <t-table-column prop="departmentName" label="部门" width="150"></t-table-column>
40
          <t-table-column prop="post" label="职务" width="100"></t-table-column>
41
          <t-table-column prop="age" label="年龄" width="80"></t-table-column>
42
          <t-table-column prop="telephone" label="手机" width="120"></t-table-column>
43
          <t-table-column prop="status" label="人脸状态" width="120">
44
            <template v-slot="{row}">
45
              <t-tag v-if="row.status=== 'xxx'" state="primary">待审核</t-tag>
46
              <t-tag v-else state="success">已生效</t-tag>
47
            </template>
48
          </t-table-column>
49
          <t-table-column label="操作">
50
            <template v-slot="{row}">
51
              <a href="javascript:;" style="color:#0089D4;" @click="editDeviceData(row.resourceToolId)">编辑</a>
52
              <a href="javascript:;" style="color:#0089D4;" @click="deleteDeviceData(row)">删除</a>
53
              <a href="javascript:;" style="color:#0089D4;" @click="deleteDeviceData(row)">人脸审核</a>
54
            </template>
55
          </t-table-column>
56
        </t-table>
57
      </div>
58
      <div class="table-pager">
59
        <t-pager :current.sync="page" :total="total" :page-size="limit" :sizer-range="[10,20,50,100]" show-elevator show-sizer @on-size-change="onSizeChange" @on-change="onChange">>
60
        </t-pager>
61
      </div>
62
    </t-card>
63
  </div>
64
</template>
65
66
<script>
67
import sysapi from '@/api/system'
68
export default {
69
70
  data () {
71
    return {
72
      // 公司类型id
73
      companyTypeId: '',
74
      // 公司类型列表
75
      companyTypesList: [],
76
      // 部门类型id
77
      departmentTypeId: '',
78
      // 部门类型列表
79
      departmentTypesList: [],
80
      // 员工类型id
81
      staffTypeId: '',
82
      // 员工类型列表
83
      staffTypesList: [],
84
      // 用户数据列表
85
      userDataList: [],
86
      // 当前页
87
      page: 1,
88
      // 当前页的数据个数
89
      limit: 10,
90
      // 数据总数
91
      total: 100,
92
      // 批量删除的设备id
93
      deleteResourceToolId: [],
94
      // 当前设备数据
95
      currentDeviceData: {},
96
      // 显示/隐藏新增设备对话框
97
      addDeviceModal: false,
98
      currentEditDevice: {}
99
    }
100
  },
101
  created () {
102
    this.getDeviceData()
103
    this.getDeviceTypes()
104
  },
105
  methods: {
106
    // 获取设备列表数据
107
    async getDeviceData () {
108
109
    },
110
    // 向服务器发送请求获取设备类型列表数据
111
    async getDeviceTypes () {
112
      const res = await sysapi.getDeviceTypes()
113
      if (res.status === 200) {
114
        this.companyTypesList = res.data.data
115
      } else {
116
        this.$Message.danger('设备类型列表数据获取失败!')
117
      }
118
    },
119
    // 查询数据
120
    selectHandle () {
121
      this.page = 1
122
      this.getDeviceData()
123
    },
124
    // 重置查询数据
125
    resetData () {
126
      this.page = 1
127
      this.companyTypeId = ''
128
      this.staffTypeId = ''
129
      this.departmentTypeId = ''
130
      this.getDeviceData()
131
    },
132
    // 当前页改变 触发事件
133
    onChange (page) {
134
      this.page = page
135
      this.getDeviceData()
136
    },
137
    // 当前页数据总数改变 触发事件
138
    onSizeChange (pageSize) {
139
      this.limit = pageSize
140
      this.getDeviceData()
141
    },
142
    // 删除数据
143
    deleteDeviceData (row) {
144
      this.$Confirm.confirm({
145
        title: '正在准备删除...',
146
        content: '<p>确定要删除?</p><p>删除后将无法还原!</p>',
147
        ok: async () => {
148
          const res = await sysapi.deleteDeviceData({ resourceToolId: row.resourceToolId })
149
          if (res.status === 200) {
150
            this.getDeviceData()
151
            this.$Message.success('删除成功!')
152
          } else {
153
            this.$Message.danger('删除失败!')
154
          }
155
        },
156
        cancel: () => {
157
          this.$Message.info('已取消删除!')
158
        }
159
      })
160
    },
161
    // 当复选框发生改变时 触发事件
162
    selectChange (data) {
163
      const arr = []
164
      data.forEach(item => arr.push(item.resourceToolId))
165
      this.deleteResourceToolId = arr
166
    },
167
    // 批量删除数据
168
    multDeleteDeviceData () {
169
      if (this.deleteResourceToolId.length === 0) {
170
        return this.$Message.warning('请选择要删除的数据!')
171
      }
172
      this.$Confirm.confirm({
173
        title: '正在准备删除...',
174
        content: '<p>确定要删除?</p><p>删除后将无法还原!</p>',
175
        ok: async () => {
176
          const res = await sysapi.deleteDeviceData({ resourceToolId: this.deleteResourceToolId })
177
          if (res.status === 200) {
178
            this.getDeviceData()
179
            this.$Message.success('删除成功!')
180
          } else {
181
            this.$Message.danger('删除失败!')
182
          }
183
        },
184
        cancel: () => {
185
          this.$Message.info('已取消删除!')
186
        }
187
      })
188
    },
189
    // 获取设备详情数据
190
    async getDeviceInfo (id) {
191
      const res = await sysapi.getDeviceInfo(id)
192
      if (res.status === 200) {
193
        this.currentDeviceData = res.data
194
      } else {
195
        this.$Message.danger('设备详情数据获取失败!')
196
      }
197
    },
198
    // 显示新增设备对话框
199
    showAddDeviceModal () {
200
      this.addDeviceModal = true
201
    },
202
    async editDeviceData (id) {
203
      const res = await sysapi.getDeviceInfo(id)
204
      if (res.status === 200) {
205
        this.currentEditDevice = res.data
206
      } else {
207
        this.$Message.danger('设备数据获取失败!')
208
      }
209
      this.addDeviceModal = true
210
    }
211
  }
212
}
213
</script>
214
215
<style lang="scss">
216
.usermana-page {
217
  .card-block {
218
    padding: 0px 24px !important;
219
  }
220
  .tabs {
221
    overflow: inherit;
222
  }
223
  .tabs-list {
224
    .tabs-list__content {
225
      display: flex;
226
      justify-content: flex-end;
227
      margin-top: -10px;
228
      .tabs-list__nav {
229
        height: 32px;
230
        line-height: 16px;
231
      }
232
    }
233
    .tabs-tab {
234
      margin: 0;
235
      padding: 0 25px;
236
      font-size: 14px;
237
    }
238
    .tabs-tab.checked {
239
      border-bottom: 3px solid #2d98ff;
240
    }
241
  }
242
  .select-button-box {
243
    padding: 0;
244
    button {
245
      margin-left: 5px;
246
    }
247
  }
248
  .select-confidtion-box {
249
    margin: 24px 0;
250
    .col-3 {
251
      padding: 0;
252
    }
253
  }
254
  .function-button-box {
255
    line-height: 32px;
256
    button {
257
      margin-right: 12px;
258
      i {
259
        line-height: 32px;
260
        margin-right: 8px;
261
      }
262
    }
263
    a {
264
      color: #0089d4;
265
      i {
266
        line-height: 32px !important;
267
        margin-left: 4px;
268
      }
269
    }
270
  }
271
  .table-box {
272
    margin: 20px 0;
273
  }
274
  .table-pager {
275
    display: flex;
276
    justify-content: flex-end;
277
  }
278
}
279
</style>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/approvalmodal.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <t-modal :visibled.sync="visibled" :mask-closable="false" width="600px" height="500px">
2
  <t-modal :closable="false" :visibled.sync="visibled" :mask-closable="false" width="600px" height="500px">
3 3
    <template slot="header">
4 4
      <div class="approval-modal-title">工单审批</div>
5 5
    </template>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/cardreplacementmodal.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <t-modal :visibled.sync="cardReplacementModal" :mask-closable="false" width="600px" height="500px">
2
  <t-modal :closable="false" :visibled.sync="cardReplacementModal" :mask-closable="false" width="600px" height="500px">
3 3
    <template slot="header">
4 4
      <div class="card-modal-title">新增补卡</div>
5 5
    </template>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/fieldservicemodal.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <t-modal :visibled.sync="fieldServiceModal" :mask-closable="false" width="600px" height="500px">
2
  <t-modal :closable="false" :visibled.sync="fieldServiceModal" :mask-closable="false" width="600px" height="500px">
3 3
    <template slot="header">
4 4
      <div class="field-modal-title">新增外勤</div>
5 5
    </template>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/importworkordermodal.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <t-modal :visibled.sync="visibled" :mask-closable="false" width="600px" height="500px">
2
  <t-modal :closable="false" :visibled.sync="visibled" :mask-closable="false" width="600px" height="500px">
3 3
    <template slot="header">
4 4
      <div class="leave-modal-title">导入工单</div>
5 5
    </template>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/leavemodal.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <!-- 请假对话框 -->
3
  <t-modal :visibled.sync="visibled" :mask-closable="false" width="600px" height="500px">
3
  <t-modal :visibled.sync="visibled" :mask-closable="false" :closable="false" width="600px" height="500px">
4 4
    <template slot="header">
5 5
      <div class="leave-modal-title">新增请假</div>
6 6
    </template>

+ 1 - 1
security-protection-platform/src/modules/workorder/components/modal/overtimemodal.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <t-modal :visibled.sync="overtimeModal" :mask-closable="false" width="600px" height="500px">
2
  <t-modal :closable="false" :visibled.sync="overtimeModal" :mask-closable="false" width="600px" height="500px">
3 3
    <template slot="header">
4 4
      <div class="work-modal-title">新增加班</div>
5 5
    </template>

+ 5 - 12
security-protection-platform/src/routes.js

@ -133,22 +133,15 @@ export const constantRoutes = [
133 133
    ]
134 134
  },
135 135
  {
136
    path: '/userRights',
136
    path: '/usermana',
137 137
    component: Layout,
138
    meta: { title: '用户权限', icon: 'lock' },
139
    redirect: '/userRights/usermana',
138
    meta: { icon: 'lock' },
140 139
    children: [
141 140
      {
142
        name: 'organizationmana',
143
        path: 'organizationmana',
144
        component: () => import(/* webpackChunkName: "user_rights" */ './modules/userRights/organizationmana'),
145
        meta: { title: '组织管理' }
146
      },
147
      {
148 141
        name: 'usermana',
149
        path: 'usermana',
150
        component: () => import(/* webpackChunkName: "user_rights" */ './modules/userRights/usermana'),
151
        meta: { title: '用户管理' }
142
        path: '',
143
        component: () => import(/* webpackChunkName: "user_rights" */ './modules/usermana'),
144
        meta: { title: '用户管理', icon: 'lock' }
152 145
      }
153 146
154 147
    ]