widget.qw 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 +73 -0
- package/build/favicon.ico +0 -0
- package/build/style.css +763 -0
- package/build/widget.qw.es.js +20653 -0
- package/build/widget.qw.umd.js +20660 -0
- package/index.html +17 -0
- package/package.json +47 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +26 -0
- package/src/api/index.js +126 -0
- package/src/assets/avatar.png +0 -0
- package/src/assets/banner_handle.png +0 -0
- package/src/assets/bg_blue.png +0 -0
- package/src/assets/bg_white.png +0 -0
- package/src/assets/down.png +0 -0
- package/src/assets/home.jpg +0 -0
- package/src/assets/icon_box.png +0 -0
- package/src/assets/icon_dot.png +0 -0
- package/src/assets/icon_draw.png +0 -0
- package/src/assets/icon_file.png +0 -0
- package/src/assets/icon_fold.png +0 -0
- package/src/assets/icon_shield.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/AuditBar.vue +341 -0
- package/src/components/BillCard.vue +156 -0
- package/src/components/CheckGroup.vue +114 -0
- package/src/components/DatetimePicker/DatetimePop.vue +343 -0
- package/src/components/DatetimePicker/index.vue +113 -0
- package/src/components/DayDropdown.vue +57 -0
- package/src/components/FilePicker.vue +114 -0
- package/src/components/Input.vue +72 -0
- package/src/components/MonthDropdown.vue +52 -0
- package/src/components/MultiPicker.vue +124 -0
- package/src/components/ProjectDropdown.vue +62 -0
- package/src/components/ProjectPicker.vue +111 -0
- package/src/components/SecretNotify.js +6 -0
- package/src/components/Sheet.vue +93 -0
- package/src/components/SinglePicker.vue +103 -0
- package/src/components/SingleUserSelector.vue +425 -0
- package/src/components/Switch.vue +65 -0
- package/src/components/TreePicker.vue +113 -0
- package/src/components/UserPicker.vue +107 -0
- package/src/components/UserProfile.vue +128 -0
- package/src/components/UsersPicker.vue +118 -0
- package/src/components/YearDropdown.vue +60 -0
- package/src/components/data_selector.vue +281 -0
- package/src/components/image_picker.vue +115 -0
- package/src/components/images_picker.vue +140 -0
- package/src/components/index.js +157 -0
- package/src/components/mult_list_selector.vue +156 -0
- package/src/components/product_selector.vue +186 -0
- package/src/components/subdepartment_selector.vue +481 -0
- package/src/components/user_selector.vue +639 -0
- package/src/components/widget/DataPop.vue +96 -0
- package/src/components/widget/TreePop.vue +89 -0
- package/src/components/widget/UserPop.vue +347 -0
- package/src/env.d.ts +8 -0
- package/src/main.js +111 -0
- package/src/router/index.ts +165 -0
- package/src/util/array_util.js +32 -0
- package/src/util/auth_util.js +73 -0
- package/src/util/bool_util.js +6 -0
- package/src/util/bus.js +2 -0
- package/src/util/cache_util.js +19 -0
- package/src/util/errer_code.js +7 -0
- package/src/util/eval_util.js +20 -0
- package/src/util/icon_util.js +37 -0
- package/src/util/image_util.js +28 -0
- package/src/util/index.js +56 -0
- package/src/util/num_util.js +71 -0
- package/src/util/obj_util.js +29 -0
- package/src/util/request.js +74 -0
- package/src/util/request_json.js +72 -0
- package/src/util/request_json_mute.js +66 -0
- package/src/util/request_upload.js +79 -0
- package/src/util/route_util.js +32 -0
- package/src/util/str_util.js +144 -0
- package/src/util/time_util.js +407 -0
- package/src/util/toast_util.js +25 -0
- package/src/util/tree_util.js +120 -0
- package/src/util/validate.js +183 -0
- package/src/util/vue_filter.js +223 -0
- package/src/views/auditbar/index.vue +66 -0
- package/src/views/billcard/index.vue +46 -0
- package/src/views/checkgroup/index.vue +36 -0
- package/src/views/dataSelector/index.vue +49 -0
- package/src/views/datetimepicker/index.vue +35 -0
- package/src/views/daydropdown/index.vue +31 -0
- package/src/views/filepicker/index.vue +32 -0
- package/src/views/home/index.vue +64 -0
- package/src/views/imagepicker/index.vue +32 -0
- package/src/views/imagespicker/index.vue +32 -0
- package/src/views/input/index.vue +35 -0
- package/src/views/monthdropdown/index.vue +31 -0
- package/src/views/multListSelector/index.vue +61 -0
- package/src/views/multipicker/index.vue +37 -0
- package/src/views/productSelector/index.vue +35 -0
- package/src/views/projectdropdown/index.vue +31 -0
- package/src/views/projectpicker/index.vue +42 -0
- package/src/views/secretnotify/index.vue +28 -0
- package/src/views/sheet/index.vue +46 -0
- package/src/views/singlepicker/index.vue +36 -0
- package/src/views/subdepartmentSelector/index.vue +41 -0
- package/src/views/switch/index.vue +35 -0
- package/src/views/treepicker/index.vue +42 -0
- package/src/views/userSelector/index.vue +54 -0
- package/src/views/userSelectorNew/index.vue +45 -0
- package/src/views/userpicker/index.vue +43 -0
- package/src/views/userprofile/index.vue +30 -0
- package/src/views/userspicker/index.vue +43 -0
- package/src/views/yeardropdown/index.vue +32 -0
- package/src/vm/index.js +6 -0
- package/tsconfig.json +19 -0
- package/tsconfig.node.json +8 -0
- package/vite.config.ts +73 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 数据选择弹出层 -->
|
|
3
|
+
<van-popup v-model:show="show" position="bottom" class="popup-box">
|
|
4
|
+
<!-- 全选 -->
|
|
5
|
+
<div class="select-all-container">
|
|
6
|
+
<van-checkbox shape="square" v-model="data.isAllChecked" @click="onToggleAll"
|
|
7
|
+
label-position="left">全选</van-checkbox>
|
|
8
|
+
</div>
|
|
9
|
+
<!-- 数据列表 -->
|
|
10
|
+
<div class="checkbox-list">
|
|
11
|
+
<van-checkbox-group v-model="modelValue" direction="vertical">
|
|
12
|
+
<van-checkbox style="padding:5px 0;" v-for="(option, i) in props.options" :key="i" :name="option.code"
|
|
13
|
+
shape="square">{{ option.title }}</van-checkbox>
|
|
14
|
+
</van-checkbox-group>
|
|
15
|
+
</div>
|
|
16
|
+
</van-popup>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { onMounted, ref, reactive, onBeforeUpdate, computed, nextTick, watch } from "vue"
|
|
21
|
+
import { useVModel } from "@vueuse/core";
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
show: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
options: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: []
|
|
31
|
+
},
|
|
32
|
+
modelValue: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default: []
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const data = reactive({
|
|
39
|
+
isAllChecked: false,
|
|
40
|
+
})
|
|
41
|
+
// 定义emit
|
|
42
|
+
const emit = defineEmits(["update:show", "update:modelValue"]);
|
|
43
|
+
// 弹出?
|
|
44
|
+
const show = useVModel(props, 'show', emit)
|
|
45
|
+
// 选中的code列表
|
|
46
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
47
|
+
|
|
48
|
+
onMounted(async () => {
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const onToggleAll = () => {
|
|
53
|
+
if (data.isAllChecked) {
|
|
54
|
+
modelValue.value = props.options.map(item => {
|
|
55
|
+
return item.code
|
|
56
|
+
})
|
|
57
|
+
} else {
|
|
58
|
+
modelValue.value = [];
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
.popup-box {
|
|
65
|
+
min-height: 20vh;
|
|
66
|
+
max-height: 40vh;
|
|
67
|
+
overflow-y: auto;
|
|
68
|
+
|
|
69
|
+
.checkbox-list {
|
|
70
|
+
padding: 15px 25px;
|
|
71
|
+
|
|
72
|
+
:deep(.van-checkbox__label) {
|
|
73
|
+
flex: 1;
|
|
74
|
+
text-align: right;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.select-all-container {
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
padding: 15px 25px 0 15px;
|
|
82
|
+
margin: 10px 0;
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: flex-end;
|
|
85
|
+
align-items: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.select-all-container .van-checkbox {
|
|
89
|
+
margin-left: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* 新增:调整方形复选框的边距 */
|
|
93
|
+
.van-checkbox--square {
|
|
94
|
+
margin-left: 8px;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 数据选择弹出层 -->
|
|
3
|
+
<van-popup v-model:show="show" position="bottom" class="popup-box">
|
|
4
|
+
<van-tree-select
|
|
5
|
+
v-model:active-id="modelValue"
|
|
6
|
+
v-model:main-active-index="data.activeIndex"
|
|
7
|
+
:items="options"
|
|
8
|
+
/>
|
|
9
|
+
</van-popup>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { onMounted, ref, reactive, onBeforeUpdate, computed, nextTick, watch } from "vue"
|
|
14
|
+
import { useVModel } from "@vueuse/core";
|
|
15
|
+
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
show: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
options: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: []
|
|
24
|
+
},
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: []
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const data = reactive({
|
|
32
|
+
activeIndex: 0,
|
|
33
|
+
})
|
|
34
|
+
// 定义emit
|
|
35
|
+
const emit = defineEmits(["update:show", "update:modelValue"]);
|
|
36
|
+
// 弹出?
|
|
37
|
+
const show = useVModel(props, 'show', emit)
|
|
38
|
+
// 选中的code列表
|
|
39
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
40
|
+
|
|
41
|
+
onMounted(async () => {
|
|
42
|
+
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const onToggleAll = () => {
|
|
46
|
+
if (data.isAllChecked) {
|
|
47
|
+
modelValue.value = props.options.map(item => {
|
|
48
|
+
return item.code
|
|
49
|
+
})
|
|
50
|
+
} else {
|
|
51
|
+
modelValue.value = [];
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.popup-box {
|
|
58
|
+
min-height: 20vh;
|
|
59
|
+
max-height: 40vh;
|
|
60
|
+
overflow-y: auto;
|
|
61
|
+
|
|
62
|
+
.checkbox-list {
|
|
63
|
+
padding: 15px 25px;
|
|
64
|
+
|
|
65
|
+
:deep(.van-checkbox__label) {
|
|
66
|
+
flex: 1;
|
|
67
|
+
text-align: right;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.select-all-container {
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
padding: 15px 25px 0 15px;
|
|
75
|
+
margin: 10px 0;
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
align-items: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.select-all-container .van-checkbox {
|
|
82
|
+
margin-left: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* 新增:调整方形复选框的边距 */
|
|
86
|
+
.van-checkbox--square {
|
|
87
|
+
margin-left: 8px;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<van-popup v-model:show="show" round position="bottom" class="user-popup">
|
|
3
|
+
<div class="department-selector">
|
|
4
|
+
<div class="picker-header">
|
|
5
|
+
<div class="header-left">
|
|
6
|
+
<van-button @click="onBack" icon="arrow-left" size="small" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<!-- 移除header-center包装,直接使用current-path -->
|
|
10
|
+
<div class="current-path">{{ pathsLabel }}</div>
|
|
11
|
+
|
|
12
|
+
<div class="header-right">
|
|
13
|
+
<van-button size="small" @click="onCancel" class="cancel-btn">取消</van-button>
|
|
14
|
+
|
|
15
|
+
<van-button type="primary" size="small" @click="onSubmit" class="confirm-btn">确定</van-button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- 搜索框 -->
|
|
20
|
+
<van-search v-model="data.keyword" placeholder="输入工号查询" @clear="onClear" @search="onSearch" @cancel="onClear"
|
|
21
|
+
show-action>
|
|
22
|
+
<template #action>
|
|
23
|
+
<div @click="onSearch">搜索</div>
|
|
24
|
+
</template>
|
|
25
|
+
</van-search>
|
|
26
|
+
|
|
27
|
+
<div class="scroll-container">
|
|
28
|
+
<!-- 遍历部门列表 -->
|
|
29
|
+
<van-cell-group>
|
|
30
|
+
<van-cell v-for="dept in subDepts" :key="dept.id" :title="dept.name" is-link @click="onSelectDept(dept)" />
|
|
31
|
+
</van-cell-group>
|
|
32
|
+
|
|
33
|
+
<!-- 遍历人员列表 -->
|
|
34
|
+
<van-radio-group v-model="data.selectedUser">
|
|
35
|
+
<van-cell-group>
|
|
36
|
+
<van-cell v-for="user in subUsers" :key="user.id" :title="`${user.userid} ${user.name}`">
|
|
37
|
+
<template #right-icon>
|
|
38
|
+
<van-radio :name="user.userid" />
|
|
39
|
+
</template>
|
|
40
|
+
</van-cell>
|
|
41
|
+
</van-cell-group>
|
|
42
|
+
</van-radio-group>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</van-popup>
|
|
46
|
+
</template>
|
|
47
|
+
<script setup>
|
|
48
|
+
import { ref, onMounted, watch, reactive, computed } from "vue";
|
|
49
|
+
import util from "../../util"
|
|
50
|
+
import { useVModel } from '@vueuse/core'
|
|
51
|
+
|
|
52
|
+
const props = defineProps({
|
|
53
|
+
show: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
// 默认查询所有组织机构
|
|
58
|
+
rootDeptId: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "1", //组织机构id
|
|
61
|
+
},
|
|
62
|
+
// 二级部门取值范围字典id
|
|
63
|
+
// 取dictionary库.dict的配置id
|
|
64
|
+
deptRangeId: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ''
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// 定义emit
|
|
70
|
+
const emit = defineEmits(["update:show", "select"]);
|
|
71
|
+
// 弹出?
|
|
72
|
+
const show = useVModel(props, 'show', emit)
|
|
73
|
+
const data = reactive({
|
|
74
|
+
// 当前选中的机构
|
|
75
|
+
selectedDeptId: '',
|
|
76
|
+
// 所有的部门
|
|
77
|
+
totalDepts: [],
|
|
78
|
+
// 搜索关键字
|
|
79
|
+
keyword: "",
|
|
80
|
+
searchUsers: [],
|
|
81
|
+
selectedUser: null
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// 查找部门路径列表
|
|
86
|
+
function findDeptPaths(targetDept, tree, path = []) {
|
|
87
|
+
if (!tree || tree.length < 1 || !targetDept || !targetDept.id)
|
|
88
|
+
return []
|
|
89
|
+
|
|
90
|
+
for (const dept of tree) {
|
|
91
|
+
if (dept.id === targetDept.id) {
|
|
92
|
+
return [...path, dept];
|
|
93
|
+
}
|
|
94
|
+
if (dept.subDepartments?.length) {
|
|
95
|
+
const found = findDeptPaths(targetDept, dept.subDepartments, [...path, dept]);
|
|
96
|
+
if (found && found.length > 0) return found;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return []
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 选中的部门
|
|
104
|
+
const selectedDept = computed(()=>{
|
|
105
|
+
if(!data.selectedDeptId)
|
|
106
|
+
return null
|
|
107
|
+
|
|
108
|
+
let targetDept = findDept(data.selectedDeptId,data.totalDepts)
|
|
109
|
+
return targetDept
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
//选中部门的路径:部门/科室
|
|
113
|
+
const pathsLabel = computed(() => {
|
|
114
|
+
let paths = findDeptPaths(selectedDept.value, data.totalDepts)
|
|
115
|
+
console.log("paths", paths);
|
|
116
|
+
let res = ''
|
|
117
|
+
paths.forEach((dept) => {
|
|
118
|
+
res += dept.name + "/";
|
|
119
|
+
})
|
|
120
|
+
return res
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
const subDepts = computed(() => {
|
|
124
|
+
if (data.keyword)
|
|
125
|
+
return []
|
|
126
|
+
else if (selectedDept.value)
|
|
127
|
+
return selectedDept.value.subDepartments
|
|
128
|
+
else
|
|
129
|
+
return data.totalDepts
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const subUsers = computed(() => {
|
|
133
|
+
if (data.keyword)
|
|
134
|
+
return data.searchUsers
|
|
135
|
+
else if (selectedDept.value)
|
|
136
|
+
return selectedDept.value.users
|
|
137
|
+
else
|
|
138
|
+
return []
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// 获得部门列表
|
|
142
|
+
const queryTotalDepts = async () => {
|
|
143
|
+
// 查询所有部门
|
|
144
|
+
const response = await util.get_subdepartments_users({ departmentId: props.rootDeptId, hasGrandson:false })
|
|
145
|
+
let level2Depts = []
|
|
146
|
+
if(response.data)
|
|
147
|
+
level2Depts = response.data.subDepartments
|
|
148
|
+
|
|
149
|
+
// 取配置的二级部门取值范围
|
|
150
|
+
let level2DeptIds = []
|
|
151
|
+
if (props.deptRangeId) {
|
|
152
|
+
let res = await util.dictionary_dict({ id: props.deptRangeId })
|
|
153
|
+
if (res.data.parseValue && res.data.parseValue.length > 0) {
|
|
154
|
+
level2DeptIds = res.data.parseValue
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// 只保留指定二级部门列表
|
|
159
|
+
if (props.deptRangeId) {
|
|
160
|
+
if (level2DeptIds && level2DeptIds.length > 0) {
|
|
161
|
+
level2Depts = level2Depts.filter(item => {
|
|
162
|
+
return level2DeptIds.includes(item.id)
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
data.totalDepts = level2Depts || []
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 查找机构
|
|
171
|
+
function findDept(deptId, tree) {
|
|
172
|
+
if (!tree || tree.length < 1)
|
|
173
|
+
return null
|
|
174
|
+
|
|
175
|
+
for (const dept of tree) {
|
|
176
|
+
if (dept.id === deptId) {
|
|
177
|
+
return dept
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const found = findDept(deptId, dept.subDepartments);
|
|
181
|
+
if (found) return found
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return null
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 查找父机构
|
|
188
|
+
function findParentDept(deptId, tree) {
|
|
189
|
+
if (!tree || tree.length < 1)
|
|
190
|
+
return null
|
|
191
|
+
|
|
192
|
+
for (const dept of tree) {
|
|
193
|
+
if (!dept.subDepartments || dept.subDepartments.length < 1)
|
|
194
|
+
continue
|
|
195
|
+
|
|
196
|
+
let ary = dept.subDepartments.filter(item => item.id == deptId)
|
|
197
|
+
if (ary && ary.length > 0)
|
|
198
|
+
return dept
|
|
199
|
+
|
|
200
|
+
const found = findParentDept(deptId, dept.subDepartments);
|
|
201
|
+
if (found) return found
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return null
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// 搜索人员
|
|
208
|
+
const onSearch = async () => {
|
|
209
|
+
if (!data.keyword)
|
|
210
|
+
return
|
|
211
|
+
|
|
212
|
+
// 搜索用户
|
|
213
|
+
const res = await util.wx_user_list({ keyword: data.keyword, page: 1, limit: 10000 })
|
|
214
|
+
data.searchUsers = res.data.list
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// 切换部门
|
|
218
|
+
const onSelectDept = async(department) => {
|
|
219
|
+
const res = await util.get_subdepartments_users({ departmentId: department.id, hasGrandson:false })
|
|
220
|
+
let targetDept = findDept(department.id, data.totalDepts)
|
|
221
|
+
targetDept.subDepartments = res.data.subDepartments
|
|
222
|
+
targetDept.users = res.data.users
|
|
223
|
+
data.selectedDeptId = department.id
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// 返回上一级部门
|
|
227
|
+
const onBack = () => {
|
|
228
|
+
data.keyword = ""
|
|
229
|
+
|
|
230
|
+
let paths = findDeptPaths(selectedDept.value, data.totalDepts)
|
|
231
|
+
console.log('22222222', paths)
|
|
232
|
+
if (!paths || paths.length <= 1){
|
|
233
|
+
data.selectedDeptId = ''
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
data.selectedDeptId = paths[paths.length - 2].id
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// 清除掉选中部门及人
|
|
241
|
+
const reset = () => {
|
|
242
|
+
// 当前选中的机构
|
|
243
|
+
data.selectedDeptId = ''
|
|
244
|
+
// 搜索关键字
|
|
245
|
+
data.keyword = ""
|
|
246
|
+
data.searchUsers = []
|
|
247
|
+
data.selectedUser = {}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// 确认按钮
|
|
251
|
+
const onSubmit = () => {
|
|
252
|
+
if (!data.selectedUser) {
|
|
253
|
+
util.warnToast("请选择用户")
|
|
254
|
+
return
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
emit('select', data.selectedUser)
|
|
258
|
+
show.value = false
|
|
259
|
+
|
|
260
|
+
reset()
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 取消按钮
|
|
264
|
+
const onCancel = () => {
|
|
265
|
+
show.value = false
|
|
266
|
+
reset()
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
//首页加载
|
|
270
|
+
onMounted(async () => {
|
|
271
|
+
await queryTotalDepts()
|
|
272
|
+
// 初始化当前父部门
|
|
273
|
+
data.selectedDept = findDept(props.rootDeptId, data.totalDepts)
|
|
274
|
+
})
|
|
275
|
+
</script>
|
|
276
|
+
|
|
277
|
+
<style scoped>
|
|
278
|
+
.user-popup {
|
|
279
|
+
width: 100%;
|
|
280
|
+
overflow: hidden;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.department-selector {
|
|
284
|
+
padding: 10px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.search-buttons {
|
|
288
|
+
display: flex;
|
|
289
|
+
gap: 10px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.clear-btn {
|
|
293
|
+
background-color: #f2f3f5;
|
|
294
|
+
border: none;
|
|
295
|
+
border-radius: 4px;
|
|
296
|
+
padding: 4px 8px;
|
|
297
|
+
font-size: 14px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.confirm-btn {
|
|
301
|
+
background-color: #1989fa;
|
|
302
|
+
color: white;
|
|
303
|
+
border: none;
|
|
304
|
+
border-radius: 4px;
|
|
305
|
+
padding: 4px 8px;
|
|
306
|
+
font-size: 14px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.no-results {
|
|
310
|
+
text-align: center;
|
|
311
|
+
padding: 20px;
|
|
312
|
+
color: #969799;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.picker-header {
|
|
316
|
+
padding: 10px;
|
|
317
|
+
border-bottom: 1px solid #ebedf0;
|
|
318
|
+
display: flex;
|
|
319
|
+
justify-content: space-between;
|
|
320
|
+
align-items: center;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.current-path {
|
|
324
|
+
flex: 1;
|
|
325
|
+
font-size: 14px;
|
|
326
|
+
color: #323233;
|
|
327
|
+
white-space: nowrap;
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
text-overflow: ellipsis;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.header-right {
|
|
333
|
+
display: flex;
|
|
334
|
+
gap: 8px;
|
|
335
|
+
margin-left: auto;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.cancel-btn {
|
|
339
|
+
color: #969799;
|
|
340
|
+
margin-right: 5px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.scroll-container {
|
|
344
|
+
height: calc(80vh - 150px);
|
|
345
|
+
overflow-y: auto;
|
|
346
|
+
}
|
|
347
|
+
</style>
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.vue' {
|
|
4
|
+
import type { DefineComponent } from 'vue'
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
6
|
+
const component: DefineComponent<{}, {}, any>
|
|
7
|
+
export default component
|
|
8
|
+
}
|
package/src/main.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createApp } from "vue";
|
|
2
|
+
import App from "./App.vue";
|
|
3
|
+
import router from "./router";
|
|
4
|
+
import util from "./util";
|
|
5
|
+
import {
|
|
6
|
+
Icon,
|
|
7
|
+
Image,
|
|
8
|
+
Button,
|
|
9
|
+
Toast,
|
|
10
|
+
Calendar,
|
|
11
|
+
Popup,
|
|
12
|
+
Cell,
|
|
13
|
+
CellGroup,
|
|
14
|
+
NavBar,
|
|
15
|
+
Field,
|
|
16
|
+
List,
|
|
17
|
+
PullRefresh,
|
|
18
|
+
Divider,
|
|
19
|
+
Loading,
|
|
20
|
+
Picker,
|
|
21
|
+
DropdownMenu,
|
|
22
|
+
DropdownItem,
|
|
23
|
+
Stepper,
|
|
24
|
+
Grid,
|
|
25
|
+
GridItem,
|
|
26
|
+
Form,
|
|
27
|
+
CheckboxGroup,
|
|
28
|
+
Checkbox,
|
|
29
|
+
RadioGroup,
|
|
30
|
+
Radio,
|
|
31
|
+
Uploader,
|
|
32
|
+
Notify,
|
|
33
|
+
Popover,
|
|
34
|
+
Tabbar,
|
|
35
|
+
TabbarItem,
|
|
36
|
+
Search,
|
|
37
|
+
Col,
|
|
38
|
+
Row,
|
|
39
|
+
Tab,
|
|
40
|
+
Tabs,
|
|
41
|
+
DatePicker,
|
|
42
|
+
TimePicker,
|
|
43
|
+
PickerGroup,
|
|
44
|
+
Step,
|
|
45
|
+
Steps,
|
|
46
|
+
Tag,
|
|
47
|
+
Switch,
|
|
48
|
+
TreeSelect
|
|
49
|
+
} from "vant";
|
|
50
|
+
import "vant/lib/index.css";
|
|
51
|
+
//本地测试 初始化组件
|
|
52
|
+
import { UIQW, setup } from "@/components";
|
|
53
|
+
setup({
|
|
54
|
+
urlCallback: () => {
|
|
55
|
+
return process.env.VUE_APP_DOMAIN;
|
|
56
|
+
},
|
|
57
|
+
tokenCallback: () => {
|
|
58
|
+
return util.getToken()
|
|
59
|
+
},
|
|
60
|
+
needLoginCallback: () => {
|
|
61
|
+
router.push({ path: "/login" });
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
createApp(App)
|
|
66
|
+
.use(router)
|
|
67
|
+
.use(Popover)
|
|
68
|
+
.use(Icon)
|
|
69
|
+
.use(Image)
|
|
70
|
+
.use(Button)
|
|
71
|
+
.use(Toast)
|
|
72
|
+
.use(Calendar)
|
|
73
|
+
.use(Popup)
|
|
74
|
+
.use(CellGroup)
|
|
75
|
+
.use(Cell)
|
|
76
|
+
.use(NavBar)
|
|
77
|
+
.use(Field)
|
|
78
|
+
.use(List)
|
|
79
|
+
.use(PullRefresh)
|
|
80
|
+
.use(Divider)
|
|
81
|
+
.use(Loading)
|
|
82
|
+
.use(Picker)
|
|
83
|
+
.use(DropdownMenu)
|
|
84
|
+
.use(DropdownItem)
|
|
85
|
+
.use(Stepper)
|
|
86
|
+
.use(Grid)
|
|
87
|
+
.use(GridItem)
|
|
88
|
+
.use(Form)
|
|
89
|
+
.use(CheckboxGroup)
|
|
90
|
+
.use(Checkbox)
|
|
91
|
+
.use(RadioGroup)
|
|
92
|
+
.use(Radio)
|
|
93
|
+
.use(Uploader)
|
|
94
|
+
.use(Notify)
|
|
95
|
+
.use(Tabbar)
|
|
96
|
+
.use(Col)
|
|
97
|
+
.use(Row)
|
|
98
|
+
.use(TabbarItem)
|
|
99
|
+
.use(Search)
|
|
100
|
+
.use(Tab)
|
|
101
|
+
.use(Tabs)
|
|
102
|
+
.use(DatePicker)
|
|
103
|
+
.use(TimePicker)
|
|
104
|
+
.use(PickerGroup)
|
|
105
|
+
.use(Step)
|
|
106
|
+
.use(Steps)
|
|
107
|
+
.use(Tag)
|
|
108
|
+
.use(Switch)
|
|
109
|
+
.use(TreeSelect)
|
|
110
|
+
.use(UIQW)
|
|
111
|
+
.mount("#app");
|