leadal-auth 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/babel.config.js +5 -0
- package/jsconfig.json +19 -0
- package/ld-auth/demo.html +1 -0
- package/ld-auth/ld-auth.common.js +44730 -0
- package/ld-auth/ld-auth.css +1 -0
- package/ld-auth/ld-auth.umd.js +44730 -0
- package/ld-auth/ld-auth.umd.min.js +55 -0
- package/package.json +58 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/public/models/age_gender_model-shard1 +0 -0
- package/public/models/age_gender_model-weights_manifest.json +1 -0
- package/public/models/face_expression_model-shard1 +0 -0
- package/public/models/face_expression_model-weights_manifest.json +1 -0
- package/public/models/face_landmark_68_model-shard1 +0 -0
- package/public/models/face_landmark_68_model-weights_manifest.json +1 -0
- package/public/models/face_landmark_68_tiny_model-shard1 +0 -0
- package/public/models/face_landmark_68_tiny_model-weights_manifest.json +1 -0
- package/public/models/face_recognition_model-shard1 +0 -0
- package/public/models/face_recognition_model-shard2 +6 -0
- package/public/models/face_recognition_model-weights_manifest.json +1 -0
- package/public/models/mtcnn_model-shard1 +0 -0
- package/public/models/mtcnn_model-weights_manifest.json +1 -0
- package/public/models/ssd_mobilenetv1_model-shard1 +0 -0
- package/public/models/ssd_mobilenetv1_model-shard2 +145 -0
- package/public/models/ssd_mobilenetv1_model-weights_manifest.json +1 -0
- package/public/models/tiny_face_detector_model-shard1 +0 -0
- package/public/models/tiny_face_detector_model-weights_manifest.json +1 -0
- package/src/App.vue +19 -0
- package/src/api/card.js +58 -0
- package/src/api/face.js +37 -0
- package/src/api/finger.js +64 -0
- package/src/api/index.js +100 -0
- package/src/assets/BIN.png +0 -0
- package/src/assets/CLOSE.svg +11 -0
- package/src/assets/blue-left.png +0 -0
- package/src/assets/blue-right.png +0 -0
- package/src/assets/finger-ready.png +0 -0
- package/src/assets/finger-select.png +0 -0
- package/src/assets/finger-status-1-last.png +0 -0
- package/src/assets/finger-status-1.gif +0 -0
- package/src/assets/finger-status-2-last.png +0 -0
- package/src/assets/finger-status-2.gif +0 -0
- package/src/assets/finger-status-3-last.png +0 -0
- package/src/assets/finger-status-3.gif +0 -0
- package/src/assets/finger-status-compeleted.png +0 -0
- package/src/assets/finger-status-start.png +0 -0
- package/src/assets/icon-camera.png +0 -0
- package/src/assets/icon-picture.png +0 -0
- package/src/assets/icon-success.png +0 -0
- package/src/assets/img-camera.png +0 -0
- package/src/assets/img-card.png +0 -0
- package/src/assets/img-loading.png +0 -0
- package/src/assets/left.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/right.png +0 -0
- package/src/assets/ukey1.png +0 -0
- package/src/assets/ukey2.png +0 -0
- package/src/assets//346/214/207/347/272/271/350/257/206/345/210/2531.png +0 -0
- package/src/assets//346/214/207/347/272/271/350/257/206/345/210/2532.png +0 -0
- package/src/components/auth-com.vue +100 -0
- package/src/components/card-register/components/CardTable.vue +94 -0
- package/src/components/card-register/components/RegisterDialog.vue +137 -0
- package/src/components/card-register/index.vue +110 -0
- package/src/components/edit-user-dialog.vue +141 -0
- package/src/components/empty.vue +13 -0
- package/src/components/face-register/components/ChooseCameraOrPicture.vue +59 -0
- package/src/components/face-register/components/FaceDetected.vue +543 -0
- package/src/components/face-register/components/FaceInfo.vue +171 -0
- package/src/components/face-register/components/FacePicture.vue +85 -0
- package/src/components/face-register/components/UploadPicture.vue +336 -0
- package/src/components/face-register/index.vue +242 -0
- package/src/components/finger-register/index.vue +685 -0
- package/src/components/organ-tree.vue +211 -0
- package/src/components/tree-select.vue +131 -0
- package/src/components/user-drawer.vue +147 -0
- package/src/components/user-info.vue +272 -0
- package/src/components/user-table.vue +405 -0
- package/src/main.js +26 -0
- package/src/package/auth-manage/index.vue +461 -0
- package/src/package/index.js +22 -0
- package/src/store/index.js +39 -0
- package/src/styles/common.scss +183 -0
- package/src/styles/index.scss +38 -0
- package/src/utils/dict.js +47 -0
- package/src/utils/event-bus.js +6 -0
- package/src/utils/request-auth.js +64 -0
- package/src/utils/request.js +64 -0
- package/src/utils/websocket.js +282 -0
- package/vue.config.js +43 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="loading">
|
|
3
|
+
<el-table
|
|
4
|
+
:data="tableData"
|
|
5
|
+
stripe
|
|
6
|
+
ref="table"
|
|
7
|
+
:header-cell-style="{ background: '#f7f8fa' }"
|
|
8
|
+
@selection-change="h_selectionChange"
|
|
9
|
+
@row-click="h_rowClick"
|
|
10
|
+
>
|
|
11
|
+
<el-table-column type="selection" width="75" />
|
|
12
|
+
<el-table-column type="index" label="序号" width="80" />
|
|
13
|
+
<el-table-column prop="icCard" label="IC卡号" />
|
|
14
|
+
<el-table-column prop="createdTime" label="录入时间" />
|
|
15
|
+
</el-table>
|
|
16
|
+
<!-- 分页 -->
|
|
17
|
+
<div class="flex-end mt-12" v-if="false">
|
|
18
|
+
<el-pagination
|
|
19
|
+
background
|
|
20
|
+
layout="prev, pager, next"
|
|
21
|
+
:current-page="pagination.current"
|
|
22
|
+
:page-size="pagination.size"
|
|
23
|
+
:total="pagination.total"
|
|
24
|
+
@current-change="h_currentChange"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<!-- 返回 确定 按钮 -->
|
|
28
|
+
<div class="flex-center mt-42">
|
|
29
|
+
<el-button @click="h_back">返回</el-button>
|
|
30
|
+
<el-button type="primary" @click="h_submit">确定</el-button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import { findNoBindICCardApi } from "@/api/card";
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
name: "CardTable",
|
|
40
|
+
props: {
|
|
41
|
+
loading: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
tableData: [],
|
|
49
|
+
selection: [],
|
|
50
|
+
pagination: {
|
|
51
|
+
current: 1,
|
|
52
|
+
size: 5,
|
|
53
|
+
total: 0,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
created() {
|
|
58
|
+
this.f_loadData();
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
h_rowClick(row) {
|
|
62
|
+
this.$refs.table.toggleRowSelection(row);
|
|
63
|
+
},
|
|
64
|
+
h_currentChange(current) {
|
|
65
|
+
this.table.pagination.current = current;
|
|
66
|
+
this.f_loadData();
|
|
67
|
+
},
|
|
68
|
+
h_back() {
|
|
69
|
+
this.$emit("back");
|
|
70
|
+
},
|
|
71
|
+
h_submit() {
|
|
72
|
+
if (this.selection.length === 0) {
|
|
73
|
+
this.$message.warning("请选择要添加的IC卡");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this.selection.length > 1) {
|
|
77
|
+
this.$message.warning("请选择一张IC卡");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.$emit("submit", this.selection[0]);
|
|
81
|
+
},
|
|
82
|
+
f_loadData() {
|
|
83
|
+
findNoBindICCardApi({ keyword: null }).then((res) => {
|
|
84
|
+
this.tableData = res.data;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
h_selectionChange(selection) {
|
|
88
|
+
this.selection = selection;
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:visible="visible"
|
|
4
|
+
width="580px"
|
|
5
|
+
title="新增身份卡"
|
|
6
|
+
@closed="closed"
|
|
7
|
+
append-to-body
|
|
8
|
+
@close="h_close"
|
|
9
|
+
>
|
|
10
|
+
<div v-if="component === 'normal'">
|
|
11
|
+
<div class="p-12 pr-32">
|
|
12
|
+
<el-form :model="form" label-width="100px">
|
|
13
|
+
<el-form-item label="身份卡号">
|
|
14
|
+
<el-input
|
|
15
|
+
v-model="form.cardNo"
|
|
16
|
+
placeholder="请输入或者使用刷卡器刷卡"
|
|
17
|
+
/>
|
|
18
|
+
</el-form-item>
|
|
19
|
+
</el-form>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="select-section">
|
|
22
|
+
<el-button type="text" class="select-button" @click="h_selectCard">
|
|
23
|
+
选择已录入身份卡 >>
|
|
24
|
+
</el-button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="dialog-footer f_center" style="margin-top: 100px">
|
|
27
|
+
<el-button @click="h_close" :loading="loading">取消</el-button>
|
|
28
|
+
<el-button type="primary" @click="h_submit" :loading="loading"
|
|
29
|
+
>确定</el-button
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div v-if="component === 'table'">
|
|
34
|
+
<card-table @back="h_back" @submit="h_submit" :loading="loading" />
|
|
35
|
+
</div>
|
|
36
|
+
</el-dialog>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { addUserICCardApi } from "@/api/card";
|
|
41
|
+
import CardTable from "./CardTable.vue";
|
|
42
|
+
export default {
|
|
43
|
+
name: "RegisterDialog",
|
|
44
|
+
components: {
|
|
45
|
+
CardTable,
|
|
46
|
+
},
|
|
47
|
+
props: {
|
|
48
|
+
row: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => {},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
loading: false,
|
|
56
|
+
component: "normal",
|
|
57
|
+
visible: false,
|
|
58
|
+
form: {
|
|
59
|
+
cardNo: "",
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
created() {},
|
|
64
|
+
mounted() {
|
|
65
|
+
this.visible = true;
|
|
66
|
+
this.$authEventBus.$on("card", this.h_card);
|
|
67
|
+
},
|
|
68
|
+
beforeDestroy() {
|
|
69
|
+
this.$authEventBus.$off("card", this.h_card);
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
h_card(data) {
|
|
73
|
+
// console.log(data);
|
|
74
|
+
if (data.result === 0 || data.status === 200) {
|
|
75
|
+
this.form.cardNo = data.data;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
h_back() {
|
|
79
|
+
this.component = "normal";
|
|
80
|
+
},
|
|
81
|
+
h_submit(cardInfo) {
|
|
82
|
+
// this.component = "normal";
|
|
83
|
+
this.loading = true;
|
|
84
|
+
|
|
85
|
+
let params = {
|
|
86
|
+
userId: this.row.userId,
|
|
87
|
+
userName: this.row.row.name,
|
|
88
|
+
icCard: this.form.cardNo,
|
|
89
|
+
tenantId: "",
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (cardInfo && cardInfo.icCard) {
|
|
93
|
+
params = {
|
|
94
|
+
userId: this.row.userId,
|
|
95
|
+
userName: this.row.row.name,
|
|
96
|
+
icCard: cardInfo.icCard,
|
|
97
|
+
tenantId: "",
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
addUserICCardApi(params)
|
|
102
|
+
.then(() => {
|
|
103
|
+
this.$message.success("新增成功");
|
|
104
|
+
this.visible = false;
|
|
105
|
+
this.$emit("refresh");
|
|
106
|
+
})
|
|
107
|
+
.finally(() => {
|
|
108
|
+
this.loading = false;
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
h_close() {
|
|
112
|
+
this.visible = false;
|
|
113
|
+
},
|
|
114
|
+
closed() {
|
|
115
|
+
this.$emit("closed");
|
|
116
|
+
},
|
|
117
|
+
h_selectCard() {
|
|
118
|
+
// this.$emit("selectCard");
|
|
119
|
+
this.component = "table";
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="scss" scoped>
|
|
126
|
+
.select-section {
|
|
127
|
+
margin-bottom: 52px;
|
|
128
|
+
text-align: left;
|
|
129
|
+
margin-left: 100px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.select-button {
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
color: #8a97bb;
|
|
135
|
+
padding: 0;
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="p-12" v-loading="loading">
|
|
3
|
+
<!-- el-table 列 选择项 序号 身份卡号 -->
|
|
4
|
+
<el-table
|
|
5
|
+
:data="tableData"
|
|
6
|
+
stripe
|
|
7
|
+
ref="table"
|
|
8
|
+
:header-cell-style="{ background: '#f7f8fa' }"
|
|
9
|
+
@selection-change="h_selectionChange"
|
|
10
|
+
@row-click="h_rowClick"
|
|
11
|
+
>
|
|
12
|
+
<el-table-column type="selection" width="75" />
|
|
13
|
+
<el-table-column type="index" label="序号" width="80" />
|
|
14
|
+
<el-table-column prop="icCard" label="身份卡号" />
|
|
15
|
+
</el-table>
|
|
16
|
+
<!-- 按钮 添加 移除-->
|
|
17
|
+
<div class="flex-center mt-12">
|
|
18
|
+
<el-button
|
|
19
|
+
type="primary"
|
|
20
|
+
icon="el-icon-circle-plus-outline"
|
|
21
|
+
@click="h_add"
|
|
22
|
+
>添加</el-button
|
|
23
|
+
>
|
|
24
|
+
<el-button icon="el-icon-delete" type="danger" @click="h_remove"
|
|
25
|
+
>移除</el-button
|
|
26
|
+
>
|
|
27
|
+
</div>
|
|
28
|
+
<register-dialog
|
|
29
|
+
v-if="visible"
|
|
30
|
+
:row="row"
|
|
31
|
+
@closed="visible = false"
|
|
32
|
+
@refresh="h_loadData"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { deleteByIcCardApi, findByUserIdApi } from "@/api/card";
|
|
39
|
+
import RegisterDialog from "./components/RegisterDialog.vue";
|
|
40
|
+
export default {
|
|
41
|
+
name: "CardRegister",
|
|
42
|
+
components: {
|
|
43
|
+
RegisterDialog,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
row: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => {},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
tableData: [],
|
|
54
|
+
selection: [],
|
|
55
|
+
visible: false,
|
|
56
|
+
loading: false,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
created() {
|
|
60
|
+
this.h_loadData();
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
h_rowClick(row) {
|
|
64
|
+
this.$refs.table.toggleRowSelection(row);
|
|
65
|
+
},
|
|
66
|
+
h_loadData() {
|
|
67
|
+
this.loading = true;
|
|
68
|
+
findByUserIdApi({ userId: this.row.userId })
|
|
69
|
+
.then((res) => {
|
|
70
|
+
this.tableData = res.data;
|
|
71
|
+
})
|
|
72
|
+
.finally(() => {
|
|
73
|
+
this.loading = false;
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
h_add() {
|
|
77
|
+
this.visible = true;
|
|
78
|
+
},
|
|
79
|
+
h_remove() {
|
|
80
|
+
// this.$emit("remove");
|
|
81
|
+
this.$confirm("确定移除选中的身份卡吗?", "提示", {
|
|
82
|
+
confirmButtonText: "确定",
|
|
83
|
+
cancelButtonText: "取消",
|
|
84
|
+
type: "warning",
|
|
85
|
+
})
|
|
86
|
+
.then(() => {
|
|
87
|
+
this.loading = true;
|
|
88
|
+
deleteByIcCardApi(this.selection.map((item) => item.icCardId))
|
|
89
|
+
.then(() => {
|
|
90
|
+
this.$message.success("移除成功");
|
|
91
|
+
this.h_loadData();
|
|
92
|
+
})
|
|
93
|
+
.finally(() => {
|
|
94
|
+
this.loading = false;
|
|
95
|
+
});
|
|
96
|
+
})
|
|
97
|
+
.catch(() => {});
|
|
98
|
+
},
|
|
99
|
+
h_selectionChange(selection) {
|
|
100
|
+
this.selection = selection;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style lang="scss" scoped>
|
|
107
|
+
::v-deep .el-button {
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:visible="visible"
|
|
4
|
+
:title="edit && edit.id ? '修改机构' : '新增机构'"
|
|
5
|
+
width="540px"
|
|
6
|
+
:destroy-on-close="true"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
:before-close="h_close"
|
|
9
|
+
:append-to-body="true"
|
|
10
|
+
@closed="closed"
|
|
11
|
+
>
|
|
12
|
+
<el-form
|
|
13
|
+
ref="form"
|
|
14
|
+
:model="form"
|
|
15
|
+
:rules="rules"
|
|
16
|
+
label-width="120px"
|
|
17
|
+
size="small"
|
|
18
|
+
>
|
|
19
|
+
<el-form-item label="父级节点" prop="parentId">
|
|
20
|
+
<tree-select
|
|
21
|
+
:value.sync="form.parentId"
|
|
22
|
+
:defaultLabel="form.parentName"
|
|
23
|
+
:defaultProps="{
|
|
24
|
+
label: 'caption',
|
|
25
|
+
value: 'id',
|
|
26
|
+
children: 'children',
|
|
27
|
+
isLeaf: (data) => {
|
|
28
|
+
return data.hasChild === false;
|
|
29
|
+
},
|
|
30
|
+
}"
|
|
31
|
+
:load="f_loadNode"
|
|
32
|
+
@setNode="h_setNode"
|
|
33
|
+
/>
|
|
34
|
+
</el-form-item>
|
|
35
|
+
<el-form-item label="机构名称" prop="name">
|
|
36
|
+
<el-input v-model="form.name" />
|
|
37
|
+
</el-form-item>
|
|
38
|
+
<!-- <el-form-item label="排序" prop="sequence">-->
|
|
39
|
+
<!-- <el-input-number v-model="form.sequence" :min="1" :max="9999" />-->
|
|
40
|
+
<!-- </el-form-item>-->
|
|
41
|
+
</el-form>
|
|
42
|
+
<div slot="footer" class="dialog-footer f_center">
|
|
43
|
+
<el-button @click="h_close" :loading="loading"> 取消 </el-button>
|
|
44
|
+
<el-button type="primary" @click="h_submit" :loading="loading">
|
|
45
|
+
确定
|
|
46
|
+
</el-button>
|
|
47
|
+
</div>
|
|
48
|
+
</el-dialog>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import { apiOrganSave, apiOrganTree } from "@/api";
|
|
53
|
+
import TreeSelect from "@/components/tree-select.vue";
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
components: {
|
|
57
|
+
TreeSelect,
|
|
58
|
+
},
|
|
59
|
+
props: {
|
|
60
|
+
edit: {
|
|
61
|
+
type: Object,
|
|
62
|
+
default: () => {},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
data() {
|
|
66
|
+
return {
|
|
67
|
+
visible: false,
|
|
68
|
+
form: {
|
|
69
|
+
sequence: 1,
|
|
70
|
+
},
|
|
71
|
+
rules: {},
|
|
72
|
+
loading: false,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
mounted() {
|
|
76
|
+
this.visible = true;
|
|
77
|
+
if (this.edit) {
|
|
78
|
+
console.log("this.edit", this.edit);
|
|
79
|
+
|
|
80
|
+
this.form = { ...this.edit, name: this.edit.caption };
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
methods: {
|
|
84
|
+
async f_loadNode(node, resolve) {
|
|
85
|
+
console.log("node", node);
|
|
86
|
+
if (node.level === 0) {
|
|
87
|
+
const res = await apiOrganTree();
|
|
88
|
+
resolve(res.data || []);
|
|
89
|
+
} else {
|
|
90
|
+
const res = await apiOrganTree({ parentId: node.data.id });
|
|
91
|
+
res.data.forEach((item) => {
|
|
92
|
+
item.parentId = node.data.id;
|
|
93
|
+
item.parentName = node.data.caption;
|
|
94
|
+
});
|
|
95
|
+
resolve(res.data || []);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
h_setNode(val) {
|
|
99
|
+
this.$set(this.form, "parentId", val?.id);
|
|
100
|
+
this.$set(this.form, "parentName", val?.caption);
|
|
101
|
+
this.$forceUpdate();
|
|
102
|
+
},
|
|
103
|
+
h_close() {
|
|
104
|
+
this.visible = false;
|
|
105
|
+
},
|
|
106
|
+
closed() {
|
|
107
|
+
this.$emit("closed");
|
|
108
|
+
},
|
|
109
|
+
h_submit() {
|
|
110
|
+
this.loading = true;
|
|
111
|
+
this.$refs.form.validate(async (valid) => {
|
|
112
|
+
if (valid) {
|
|
113
|
+
if (!this.form.id) {
|
|
114
|
+
this.$set(this.form, "sequence", 1);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
await apiOrganSave({ ...this.form });
|
|
118
|
+
if (this.form.parentId) {
|
|
119
|
+
const res = await apiOrganTree({ parentId: this.form.parentId });
|
|
120
|
+
res.data.forEach((item) => {
|
|
121
|
+
item.parentId = this.form.parentId;
|
|
122
|
+
item.parentName = this.form.parentName;
|
|
123
|
+
});
|
|
124
|
+
this.$emit("refresh", "current", this.form.parentId, res.data);
|
|
125
|
+
} else {
|
|
126
|
+
const res = await apiOrganTree();
|
|
127
|
+
this.$emit("refresh", "all", null, res.data);
|
|
128
|
+
}
|
|
129
|
+
this.h_close();
|
|
130
|
+
this.$message.success(this.form.id ? "修改成功!" : "新增成功!");
|
|
131
|
+
} finally {
|
|
132
|
+
this.loading = false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-center align-center h100">
|
|
3
|
+
<el-empty description="请先保存用户信息" style="font-size: 20px"></el-empty>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: "empty-view",
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="choose-camera-or-picture flex-center align-center">
|
|
3
|
+
<div>
|
|
4
|
+
<div
|
|
5
|
+
class="flex-start align-center"
|
|
6
|
+
style="cursor: pointer"
|
|
7
|
+
@click="handleCamera"
|
|
8
|
+
>
|
|
9
|
+
<img src="@/assets/icon-camera.png" height="40px" />
|
|
10
|
+
<div class="choose-camera-or-picture-title ml-12">从摄像头采集</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div
|
|
13
|
+
class="flex-start align-center mt-32"
|
|
14
|
+
style="cursor: pointer"
|
|
15
|
+
@click="handlePicture"
|
|
16
|
+
>
|
|
17
|
+
<img src="@/assets/icon-picture.png" height="40px" />
|
|
18
|
+
<div class="choose-camera-or-picture-title ml-12">本地照片上传</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: "ChooseCameraOrPicture",
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
isCamera: false,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
handleCamera() {
|
|
34
|
+
this.$emit("choose", "camera");
|
|
35
|
+
},
|
|
36
|
+
handlePicture() {
|
|
37
|
+
this.$emit("choose", "picture");
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
.choose-camera-or-picture {
|
|
45
|
+
width: 240px;
|
|
46
|
+
height: 240px;
|
|
47
|
+
background: #ffffff;
|
|
48
|
+
border: 1px dashed #bfbfbf;
|
|
49
|
+
border-radius: 10px;
|
|
50
|
+
}
|
|
51
|
+
.choose-camera-or-picture-title {
|
|
52
|
+
color: #333333;
|
|
53
|
+
font-size: 16px;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
color: #008cd2;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</style>
|