Quellcode durchsuchen

[FE]整合人脸审核页面到用户管理

liuwenxun vor 4 Jahren
Ursprung
Commit
c9eab34458

+ 11 - 0
security-protection-platform/src/api/usermana/index.js

@ -49,7 +49,18 @@ const api = {
49 49
    } else {
50 50
      return $default.delete(`/sp/employeeManagement/deleteEmployee?employeeId=${data.employeeId}`).catch((err) => { return err })
51 51
    }
52
  },
53
54
  // 获取单个用户信息
55
  getOneEmployee (params) {
56
    return $default.get('/sp/employeeManagement/queryOneEmployee', params)
57
  },
58
59
  // 审核用户照片
60
  auditEmployeePicture (params) {
61
    return $default.post('/sp/employeeManagement/auditEmployeePicture', params)
52 62
  }
63
53 64
}
54 65
function nest (items, code = '-1', link = 'parentCode') {
55 66
  return items.filter(item => item[link] === code).map(item => ({ ...item, departments: nest(items, item.code) }))

+ 12 - 8
security-protection-platform/src/modules/aialarm/index.vue

@ -177,7 +177,7 @@
177 177

178 178
          <div>
179 179
            <t-button @click="details_modal=false">取消</t-button>
180
            <t-button color="primary" @click="confimclick">确认</t-button>
180
            <t-button :loading="loading" color="primary" @click="confimclick">确认</t-button>
181 181

182 182
          </div>
183 183
        </div>
@ -252,6 +252,7 @@ export default {
252 252
      limit: 10,
253 253

254 254
      total: 0,
255
      loading: false,
255 256
      playerOptions: {
256 257
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
257 258
        autoplay: false, // 如果true,浏览器准备好时开始回放。
@ -323,6 +324,7 @@ export default {
323 324

324 325
    // 未确认状态的模态框的确认按钮 || 处理中状态的模态框的确认按钮
325 326
    confimclick () {
327
      this.loading = true
326 328
      // 获取单选框中的值
327 329
      // console.log(this.msg)
328 330
      // 判断是否选择了单选框
@ -330,8 +332,6 @@ export default {
330 332
        // 向后端发送数据
331 333
        this.alarmdispose(this.alarmDetailData.workTaskId, this.status)
332 334
        // console.log(this.status)
333
        // 关闭模态框
334
        this.details_modal = false
335 335
      } else {
336 336
        this.$Message.warning('请选择按钮')
337 337
      }
@ -340,16 +340,20 @@ export default {
340 340
    async alarmdispose (id, status, processMemo) {
341 341
      const dict = { 'END': '已解决', 'RUN': '处理中', 'FAL': '误报' }
342 342

343
      console.log(id, status, dict[status])
343
      // console.log(id, status, dict[status])
344 344

345 345
      var res = await aialarmapi.dispose({ 'workTaskId': id, 'status': status, 'processMemo': dict.status })
346 346

347 347
      if (res.status === 200) {
348 348
        this.$Message.success('操作成功')
349
        this.data[this.currentdata.index].status = res.data.data.status
350
        if (res.data.data.status === 'END') {
351
          this.data[this.currentdata.index].processTime = res.data.data.doneDate
352
        }
349
        this.search()
350
        this.loading = false
351
        // 关闭模态框
352
        this.details_modal = false
353
        // this.data[this.currentdata.index].status = res.data.data.status
354
        // if (res.data.data.status === 'END') {
355
        //   this.data[this.currentdata.index].processTime = res.data.data.doneDate
356
        // }
353 357
      } else {
354 358
        this.$Message.danger('处理失败')
355 359
      }

+ 56 - 16
security-protection-platform/src/modules/usermana/components/modal/audit.vue

@ -10,36 +10,36 @@
10 10

11 11
          <div>
12 12
            <span>姓名 :</span>
13
            <span>张三</span>
13
            <span>{{ auditdata.employeeName }}</span>
14 14
          </div>
15 15
          <div>
16 16
            <span>员工编号 :</span>
17
            <span>zhangsan</span>
17
            <span>{{ auditdata.employeeCode }}</span>
18 18
          </div>
19 19
          <div>
20 20
            <span>公司 :</span>
21
            <span>xx风场</span>
21
            <span>{{ companyName }}</span>
22 22
          </div>
23 23
          <div>
24 24
            <span>部门 :</span>
25
            <span>设备管理处</span>
25
            <span>{{ auditdata.organizationName }}</span>
26 26
          </div>
27 27
          <div>
28 28
            <span>职务 :</span>
29
            <span>运维人员</span>
29
            <span>{{ auditdata.employeePositionZh }}</span>
30 30
          </div>
31 31
          <div>
32 32
            <span>年龄 :</span>
33
            <span>28</span>
33
            <span>{{ auditdata.age }}</span>
34 34
          </div>
35 35
          <div style="width:100%">
36 36
            <span>手机 :</span>
37
            <span>188888888</span>
37
            <span>{{ auditdata.mainWirelessCall }}</span>
38 38
          </div>
39 39
          <div style="height:160px">
40 40
            <div>人脸照片 :</div>
41 41
            <div>
42
              <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
42
              <img :src="auditdata.pictureUrl" alt="" srcset="">
43 43
            </div>
44 44
          </div>
45 45

@ -49,8 +49,8 @@
49 49
            <t-form-item label="人脸审核" prop="audit">
50 50

51 51
              <t-radio-group v-model="formItem.audit" class="col-5">
52
                <t-radio label="yes">通过</t-radio>
53
                <t-radio label="no">不通过</t-radio>
52
                <t-radio label="5">通过</t-radio>
53
                <t-radio label="3">不通过</t-radio>
54 54
              </t-radio-group>
55 55
            </t-form-item>
56 56

@ -73,7 +73,7 @@
73 73
      </div>
74 74
      <div slot="footer">
75 75
        <t-button long @click="visibled=false">取消</t-button>
76
        <t-button color="primary" long @click="submit">提交</t-button>
76
        <t-button :loading="loading" color="primary" long @click="submit">提交</t-button>
77 77

78 78
      </div>
79 79
    </t-modal>
@ -81,12 +81,21 @@
81 81
</template>
82 82

83 83
<script>
84
import useapi from '@/api/usermana'
84 85
export default {
85 86
  props: {
86 87
    // 显示 / 隐藏导入工单对话框
87 88
    auditshow: {
88 89
      type: Boolean,
89 90
      default: false
91
    },
92
    auditid: {
93
      type: Number,
94
      default: 0
95
    },
96
    companyName: {
97
      type: String,
98
      default: ''
90 99
    }
91 100
  },
92 101
  data () {
@ -97,7 +106,9 @@ export default {
97 106
      },
98 107
      ruleValidate: {
99 108
        audit: [{ required: true, message: '请选择操作', trigger: 'change' }]
100
      }
109
      },
110
      auditdata: {},
111
      loading: false
101 112
    }
102 113
  },
103 114
  computed: {
@ -121,17 +132,46 @@ export default {
121 132
         *向后端获取modal数据
122 133
         *
123 134
         */
135
        console.log('发送数据', this.auditid)
136
        // useapi.getOneEmployee({
137
        //   params: { employeeId: this.auditid }
138
        // })
139
        this.search()
124 140
      }
125 141
    }
126 142
  },
127 143
  methods: {
128
    submit () {
129
      console.log(this.formItem)
144
    async submit () {
145
      this.loading = true
146
      // console.log('向后端发送的数据是', this.formItem.audit)
147
      var params = {}
148
      params.id = this.auditid
149
      params.field2 = this.formItem.audit
150
      params.field3 = this.formItem.opinion
151
      console.log('向后端发送的数据是', params)
152

153
      const res = await useapi.auditEmployeePicture(params)
154
      console.log(res)
155
      if (res.data.success === true) {
156
        this.loading = false
157
        this.$emit('refeshUserList')
158
        this.visibled = false
159
      }
160

130 161
      /*
131 162
        向后端发送post请求
132 163
     */
133

134
      this.visibled = false
164
    },
165
    async search () {
166
      const res = await useapi.getOneEmployee({
167
        params: { employeeId: this.auditid }
168
      })
169

170
      console.log(res)
171
      if (res.status === 200) {
172
        console.log(res.data.data)
173
        this.auditdata = res.data.data
174
      }
135 175
    }
136 176
  }
137 177


+ 19 - 3
security-protection-platform/src/modules/usermana/index.vue

@ -54,7 +54,7 @@
54 54
            <template v-slot="{row}">
55 55
              <a href="javascript:;" style="color:#0089D4;" @click="editDeviceData(row.resourceToolId)">编辑</a>
56 56
              <a href="javascript:;" style="color:#0089D4;" @click="deleteUserData(row)">删除</a>
57
              <a href="javascript:;" style="color:#0089D4;" @click="deleteDeviceData(row)">人脸审核</a>
57
              <a v-if="row.field2!='5'" href="javascript:;" style="color:#0089D4;" @click="auditdata(row.id,row.companyName)">人脸审核</a>
58 58
            </template>
59 59
          </t-table-column>
60 60
        </t-table>
@ -65,15 +65,18 @@
65 65
      </div>
66 66
    </t-card>
67 67
    <add-user-modal :visible="addDeviceModal"></add-user-modal>
68
    <auditModal :auditshow.sync="auditshow" :auditid="auditid" :company-name="companyName" @refeshUserList="getUserList"></auditModal>
68 69
  </div>
69 70
</template>
70 71
71 72
<script>
72 73
import sysapi from '@/api/usermana'
73 74
import addUserModal from './components/modal/addUser'
75
import auditModal from './components/modal/audit'
74 76
export default {
75 77
  components: {
76
    addUserModal
78
    addUserModal,
79
    auditModal
77 80
  },
78 81
  data () {
79 82
    return {
@ -103,7 +106,14 @@ export default {
103 106
      currentDeviceData: {},
104 107
      // 显示/隐藏新增设备对话框
105 108
      addDeviceModal: false,
106
      currentEditDevice: {}
109
      currentEditDevice: {},
110
      // 人脸审核模态框显示
111
      auditshow: false,
112
      // 人脸审核选择id
113
      auditid: 0,
114
      // 人脸审核的公司名称
115
      companyName: ''
116
107 117
    }
108 118
  },
109 119
  watch: {
@ -305,6 +315,12 @@ export default {
305 315
        this.$Message.danger('设备数据获取失败!')
306 316
      }
307 317
      this.addDeviceModal = true
318
    },
319
    // 人脸审核
320
    auditdata (id, companyName) {
321
      this.companyName = companyName
322
      this.auditid = id
323
      this.auditshow = true
308 324
    }
309 325
  }
310 326
}