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.
Files changed (115) hide show
  1. package/README.md +73 -0
  2. package/build/favicon.ico +0 -0
  3. package/build/style.css +763 -0
  4. package/build/widget.qw.es.js +20653 -0
  5. package/build/widget.qw.umd.js +20660 -0
  6. package/index.html +17 -0
  7. package/package.json +47 -0
  8. package/public/favicon.ico +0 -0
  9. package/src/App.vue +26 -0
  10. package/src/api/index.js +126 -0
  11. package/src/assets/avatar.png +0 -0
  12. package/src/assets/banner_handle.png +0 -0
  13. package/src/assets/bg_blue.png +0 -0
  14. package/src/assets/bg_white.png +0 -0
  15. package/src/assets/down.png +0 -0
  16. package/src/assets/home.jpg +0 -0
  17. package/src/assets/icon_box.png +0 -0
  18. package/src/assets/icon_dot.png +0 -0
  19. package/src/assets/icon_draw.png +0 -0
  20. package/src/assets/icon_file.png +0 -0
  21. package/src/assets/icon_fold.png +0 -0
  22. package/src/assets/icon_shield.png +0 -0
  23. package/src/assets/logo.png +0 -0
  24. package/src/components/AuditBar.vue +341 -0
  25. package/src/components/BillCard.vue +156 -0
  26. package/src/components/CheckGroup.vue +114 -0
  27. package/src/components/DatetimePicker/DatetimePop.vue +343 -0
  28. package/src/components/DatetimePicker/index.vue +113 -0
  29. package/src/components/DayDropdown.vue +57 -0
  30. package/src/components/FilePicker.vue +114 -0
  31. package/src/components/Input.vue +72 -0
  32. package/src/components/MonthDropdown.vue +52 -0
  33. package/src/components/MultiPicker.vue +124 -0
  34. package/src/components/ProjectDropdown.vue +62 -0
  35. package/src/components/ProjectPicker.vue +111 -0
  36. package/src/components/SecretNotify.js +6 -0
  37. package/src/components/Sheet.vue +93 -0
  38. package/src/components/SinglePicker.vue +103 -0
  39. package/src/components/SingleUserSelector.vue +425 -0
  40. package/src/components/Switch.vue +65 -0
  41. package/src/components/TreePicker.vue +113 -0
  42. package/src/components/UserPicker.vue +107 -0
  43. package/src/components/UserProfile.vue +128 -0
  44. package/src/components/UsersPicker.vue +118 -0
  45. package/src/components/YearDropdown.vue +60 -0
  46. package/src/components/data_selector.vue +281 -0
  47. package/src/components/image_picker.vue +115 -0
  48. package/src/components/images_picker.vue +140 -0
  49. package/src/components/index.js +157 -0
  50. package/src/components/mult_list_selector.vue +156 -0
  51. package/src/components/product_selector.vue +186 -0
  52. package/src/components/subdepartment_selector.vue +481 -0
  53. package/src/components/user_selector.vue +639 -0
  54. package/src/components/widget/DataPop.vue +96 -0
  55. package/src/components/widget/TreePop.vue +89 -0
  56. package/src/components/widget/UserPop.vue +347 -0
  57. package/src/env.d.ts +8 -0
  58. package/src/main.js +111 -0
  59. package/src/router/index.ts +165 -0
  60. package/src/util/array_util.js +32 -0
  61. package/src/util/auth_util.js +73 -0
  62. package/src/util/bool_util.js +6 -0
  63. package/src/util/bus.js +2 -0
  64. package/src/util/cache_util.js +19 -0
  65. package/src/util/errer_code.js +7 -0
  66. package/src/util/eval_util.js +20 -0
  67. package/src/util/icon_util.js +37 -0
  68. package/src/util/image_util.js +28 -0
  69. package/src/util/index.js +56 -0
  70. package/src/util/num_util.js +71 -0
  71. package/src/util/obj_util.js +29 -0
  72. package/src/util/request.js +74 -0
  73. package/src/util/request_json.js +72 -0
  74. package/src/util/request_json_mute.js +66 -0
  75. package/src/util/request_upload.js +79 -0
  76. package/src/util/route_util.js +32 -0
  77. package/src/util/str_util.js +144 -0
  78. package/src/util/time_util.js +407 -0
  79. package/src/util/toast_util.js +25 -0
  80. package/src/util/tree_util.js +120 -0
  81. package/src/util/validate.js +183 -0
  82. package/src/util/vue_filter.js +223 -0
  83. package/src/views/auditbar/index.vue +66 -0
  84. package/src/views/billcard/index.vue +46 -0
  85. package/src/views/checkgroup/index.vue +36 -0
  86. package/src/views/dataSelector/index.vue +49 -0
  87. package/src/views/datetimepicker/index.vue +35 -0
  88. package/src/views/daydropdown/index.vue +31 -0
  89. package/src/views/filepicker/index.vue +32 -0
  90. package/src/views/home/index.vue +64 -0
  91. package/src/views/imagepicker/index.vue +32 -0
  92. package/src/views/imagespicker/index.vue +32 -0
  93. package/src/views/input/index.vue +35 -0
  94. package/src/views/monthdropdown/index.vue +31 -0
  95. package/src/views/multListSelector/index.vue +61 -0
  96. package/src/views/multipicker/index.vue +37 -0
  97. package/src/views/productSelector/index.vue +35 -0
  98. package/src/views/projectdropdown/index.vue +31 -0
  99. package/src/views/projectpicker/index.vue +42 -0
  100. package/src/views/secretnotify/index.vue +28 -0
  101. package/src/views/sheet/index.vue +46 -0
  102. package/src/views/singlepicker/index.vue +36 -0
  103. package/src/views/subdepartmentSelector/index.vue +41 -0
  104. package/src/views/switch/index.vue +35 -0
  105. package/src/views/treepicker/index.vue +42 -0
  106. package/src/views/userSelector/index.vue +54 -0
  107. package/src/views/userSelectorNew/index.vue +45 -0
  108. package/src/views/userpicker/index.vue +43 -0
  109. package/src/views/userprofile/index.vue +30 -0
  110. package/src/views/userspicker/index.vue +43 -0
  111. package/src/views/yeardropdown/index.vue +32 -0
  112. package/src/vm/index.js +6 -0
  113. package/tsconfig.json +19 -0
  114. package/tsconfig.node.json +8 -0
  115. package/vite.config.ts +73 -0
package/index.html ADDED
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
8
+ <link rel="icon" href="/favicon.ico" />
9
+ <title>访客预约管理</title>
10
+ </head>
11
+
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.js"></script>
15
+ </body>
16
+
17
+ </html>
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "widget.qw",
3
+ "private": false,
4
+ "version": "0.0.1",
5
+ "description": "marqstree Vue3组件库",
6
+ "main": "build/widget.qw.es.js",
7
+ "keywords": [
8
+ "widget.qw"
9
+ ],
10
+ "author": "marqstree",
11
+ "license": "ISC",
12
+ "scripts": {
13
+ "dev": "vite",
14
+ "build": "vue-tsc --noEmit && vite build",
15
+ "preview": "vite preview"
16
+ },
17
+ "dependencies": {
18
+ "@vueuse/core": "^10.11.0",
19
+ "axios": "^0.27.2",
20
+ "compressorjs": "^1.2.1",
21
+ "dayjs": "^1.11.13",
22
+ "echarts": "^5.4.1",
23
+ "lodash": "^4.17.21",
24
+ "mitt": "^3.0.0",
25
+ "moment": "^2.30.1",
26
+ "vant": "^4.9.21",
27
+ "vite-plugin-require-transform": "^1.0.3",
28
+ "vue": "^3.2.25",
29
+ "vue-router": "^4.0.15",
30
+ "vuex": "^4.0.2"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^17.0.42",
34
+ "@types/qs": "^6.9.7",
35
+ "@vitejs/plugin-vue": "^2.3.3",
36
+ "qs": "^6.10.5",
37
+ "sass": "^1.52.3",
38
+ "sass-loader": "^13.0.0",
39
+ "typescript": "^4.5.4",
40
+ "vite": "^2.9.9",
41
+ "vite-plugin-style-import": "^1.4.1",
42
+ "vue-tsc": "^0.34.7"
43
+ },
44
+ "publishConfig": {
45
+ "registry": "https://registry.npmjs.org/"
46
+ }
47
+ }
Binary file
package/src/App.vue ADDED
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <div id="app-wrapper">
3
+ <router-view />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+
9
+ import { onMounted } from 'vue';
10
+
11
+ onMounted(() => {
12
+
13
+ })
14
+ </script>
15
+
16
+ <style lang="scss">
17
+ body {
18
+ font-size: 12px;
19
+ margin: 0 0 !important;
20
+ background-color: #f3f6fb;
21
+ }
22
+
23
+ #app {
24
+ width: 100vw;
25
+ }
26
+ </style>
@@ -0,0 +1,126 @@
1
+ import request_json from "../util/request_json";
2
+ import request_json_mute from "../util/request_json_mute";
3
+ import request_upload from "../util/request_upload";
4
+ import request from "../util/request";
5
+ import vm from "../vm";
6
+
7
+
8
+ export const process_can_apply = (data) => {
9
+ return request_json_mute({
10
+ url: vm.urlCallback() + "/qw-api/server-gstep/process/can_apply",
11
+ method: "POST",
12
+ data,
13
+ });
14
+ };
15
+
16
+ export const process_detail = (data) => {
17
+ return request_json({
18
+ url: vm.urlCallback() + "/qw-api/server-gstep/process/detail",
19
+ method: "POST",
20
+ data,
21
+ })
22
+ }
23
+
24
+ export const process_step_auth = (data) => {
25
+ return request_json_mute({
26
+ url: vm.urlCallback() + "/qw-api/server-gstep/process/step_auth",
27
+ method: "POST",
28
+ data,
29
+ });
30
+ };
31
+
32
+ export const dictionary_dict = (data) => {
33
+ return request_json({
34
+ url: vm.urlCallback() + "/qw-api/server-dictionary/dictionary/dict",
35
+ method: "POST",
36
+ data,
37
+ });
38
+ };
39
+
40
+ // 获取产品列表
41
+ export const project_list = (data) => {
42
+ return request_json({
43
+ url: vm.urlCallback() + "/qw-api/server-crm/project/list",
44
+ method: "POST",
45
+ data,
46
+ });
47
+ };
48
+
49
+ // 获取子部门列表
50
+ export const get_subdepartments = (data) => {
51
+ return request({
52
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_subdepartments",
53
+ method: "POST",
54
+ data,
55
+ });
56
+ };
57
+
58
+ // 获取部门列表
59
+ export const get_departments_by_ids = (data) => {
60
+ return request({
61
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_departments_by_ids",
62
+ method: "POST",
63
+ data,
64
+ })
65
+ }
66
+
67
+ // 根据id获取部门
68
+ export const get_subdepartments_byId = (data) => {
69
+ return request_json({
70
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_subdepartments",
71
+ method: "POST",
72
+ data,
73
+ });
74
+ };
75
+
76
+ // 获取部门和用户列表
77
+ export const get_subdepartments_users = (data) => {
78
+ return request({
79
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_subdepartments_users",
80
+ method: "POST",
81
+ data: data,
82
+ });
83
+ };
84
+
85
+ // 通过工号查询授权用户
86
+ export const get_user_by_id = (data) => {
87
+ return request_json({
88
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_user_by_id",
89
+ method: "POST",
90
+ data: data,
91
+ });
92
+ };
93
+
94
+ // 通过工号查询用户(不限制)
95
+ export const get_wxuser_by_id = (data) => {
96
+ return request({
97
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_wxuser_by_id",
98
+ method: "POST",
99
+ data: data,
100
+ });
101
+ };
102
+
103
+ // 关键字查询用户列表
104
+ export const wx_user_list = (data) => {
105
+ return request({
106
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/wx_user_list",
107
+ method: "POST",
108
+ data: data,
109
+ });
110
+ };
111
+
112
+ export const file_upload = (data) => {
113
+ return request_upload({
114
+ url: vm.urlCallback() + "/qw-api/server-file/file/upload",
115
+ method: "POST",
116
+ data: data,
117
+ })
118
+ }
119
+
120
+ export const auth_get_user_info = (data) => {
121
+ return request({
122
+ url: vm.urlCallback() + "/qw-api/server-auth/auth/get_user_info",
123
+ method: "POST",
124
+ data: data,
125
+ })
126
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,341 @@
1
+ <template>
2
+ <div class="widget">
3
+ <van-field v-if="canPass || canRefuse" v-model="data.memo" class="memo" label="审批意见" placeholder="请输入审批意见" />
4
+
5
+ <van-popover v-if="canRefuse" placement="top-start" v-model:show="data.isShowPop" :actions="formatPrevSteps"
6
+ actions-direction="vertical" @select="onSelectRefuse">
7
+ <template #reference>
8
+ <van-button class="refuse-btn" type="danger" @click="onRefuse">驳回</van-button>
9
+ </template>
10
+ </van-popover>
11
+
12
+ <van-button v-if="canPass" class="pass-btn" type="primary" native-type="submit" @click="onPass">同意</van-button>
13
+
14
+ <van-button class="apply-btn" v-if="data.canApply" type="primary" native-type="submit" @click="onApply">申请</van-button>
15
+
16
+ <div class="audit-title" v-if="data.process && data.process.id">{{ formatProcessTitle }}</div>
17
+
18
+ <van-steps class="task-list" direction="vertical" :active="data.process.startedTaskIndex"
19
+ v-if="data.process && data.process.id">
20
+ <van-step v-for="(task, i) in data.process.tasks" :key="i">
21
+ <div class="task-title">{{ formatTitle(task) }}</div>
22
+ <div class="task-user" v-if="task.executors" v-for="(executor, j) in task.executors" :key="j">
23
+ {{ formatExecutor(executor, task) }}
24
+ </div>
25
+ </van-step>
26
+ </van-steps>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup>
31
+ import { ref, reactive, computed, onMounted, defineProps, defineEmits, watch } from "vue"
32
+ import util from '../util'
33
+ import lodash from 'lodash'
34
+
35
+ const props = defineProps({
36
+ processId: Number,
37
+ mouldId: Number,
38
+ userId: String,
39
+ form: Object,
40
+ })
41
+ const emit = defineEmits(['pass', 'refuse', 'apply', 'auth'])
42
+ const data = reactive({
43
+ isShowPop: false,
44
+ process: {},
45
+ memo: '',
46
+ stepAuth: {},
47
+ canApply: false
48
+ })
49
+ const formatPrevSteps = computed(() => {
50
+ if (!data.process || !data.process.prevSteps || data.process.prevSteps.length < 1) {
51
+ return []
52
+ }
53
+
54
+ return data.process.prevSteps.map((item) => {
55
+ return {
56
+ stepId: item.id,
57
+ text: item.title
58
+ }
59
+ })
60
+ })
61
+ const canPass = computed(() => {
62
+ return data.process && data.process.id && data.process.canPass
63
+ })
64
+ const canRefuse = computed(() => {
65
+ return data.process && data.process.id && data.process.canRefuse
66
+ })
67
+
68
+ onMounted(() => {
69
+
70
+ })
71
+
72
+ const onPass = () => {
73
+ // 1秒节流
74
+ lodash.throttle(() => {
75
+ emit('pass', {
76
+ memo: data.memo
77
+ })
78
+ }, 5000)()
79
+ }
80
+ const onRefuse = () => {
81
+
82
+ }
83
+ const onSelectRefuse = (action) => {
84
+ emit('refuse',
85
+ {
86
+ memo: data.memo,
87
+ action: action
88
+ }
89
+ )
90
+ }
91
+
92
+ const onApply = () => {
93
+ // 1秒节流
94
+ lodash.throttle(() => {
95
+ emit('apply', {
96
+ memo: data.memo
97
+ })
98
+ }, 5000)()
99
+ }
100
+
101
+ const queryDetail = async () => {
102
+ if (!props.processId)
103
+ return
104
+
105
+ const params = {
106
+ id: props.processId
107
+ }
108
+ const res = await util.process_detail(params)
109
+ data.process = res.data
110
+ }
111
+
112
+ const queryStepAuth = async () => {
113
+ if(!props.processId && !props.mouldId)
114
+ return
115
+
116
+ const params = {
117
+ processId: props.processId,
118
+ mouldId: props.mouldId,
119
+ userId: props.userId,
120
+ form: props.form
121
+ }
122
+ const res = await util.process_step_auth(params)
123
+ data.stepAuth = res.data
124
+ }
125
+
126
+ const updateAuth = () => {
127
+ let res = {}
128
+ for (const key in data.stepAuth) {
129
+ const fieldAuth = data.stepAuth[key]
130
+ let authValue = getAuth(fieldAuth)
131
+ res[key] = authValue
132
+ }
133
+
134
+ emit('auth', res)
135
+ }
136
+
137
+ // 根据条件列表获取权限
138
+ const getAuth = (fieldAuth) => {
139
+ // 默认权限: 只读
140
+ let defaultCondition = 'readonly'
141
+
142
+ if (!fieldAuth) {
143
+ return defaultCondition
144
+ }
145
+
146
+ const conditions = fieldAuth.conditions
147
+ if (!conditions || conditions.length < 1) {
148
+ return defaultCondition
149
+ }
150
+
151
+ for (const i in conditions) {
152
+ const condition = conditions[i]
153
+ // 有条件的权限,根据条件表达式计算匹配的权限
154
+ if (condition.condition) {
155
+ const result = util.executeExpress(condition.condition, props.form)
156
+ if (result === true) {
157
+ return condition.value
158
+ }
159
+ } else {
160
+ // 无条件的权限
161
+ defaultCondition = condition.value
162
+ }
163
+ }
164
+
165
+ return defaultCondition
166
+ }
167
+
168
+ const updateCanApply = async () => {
169
+ if (props.processId)
170
+ return data.canApply = false
171
+
172
+ let res = await util.process_can_apply({
173
+ mouldId: props.mouldId,
174
+ userId: props.userId,
175
+ form: props.form
176
+ })
177
+
178
+ data.canApply = res.data
179
+ }
180
+
181
+ const formatTitle = (task) => {
182
+ let title = task.title
183
+ if (task.category == 'start') {
184
+ if (task.state == 'pass') {
185
+ title = title + ' / ' + '已申请'
186
+ } else if (task.state == 'refuse') {
187
+ title = title + ' / ' + '已驳回'
188
+ } else {
189
+ title = title + ' / ' + '申请中'
190
+ }
191
+ } else if (task.category == 'audit') {
192
+ if (task.auditMethod == 'or') {
193
+ title = title + '(或签)'
194
+ } else {
195
+ title = title + '(会签)'
196
+ }
197
+ if (task.state == 'pass') {
198
+ title = title + ' / ' + '已审核'
199
+ } else if (task.state == 'refuse') {
200
+ title = title + ' / ' + '已驳回'
201
+ } else if (task.state == 'started') {
202
+ title = title + ' / ' + '审核中'
203
+ } else {
204
+ title = title + ''
205
+ }
206
+ } else if (task.category == 'notify') {
207
+ if (task.state == 'pass') {
208
+ title = title + ' / ' + '已抄送'
209
+ } else {
210
+ title = title + ''
211
+ }
212
+ }
213
+ return title
214
+ }
215
+
216
+ const formatExecutor = (executor, task) => {
217
+ let action = ''
218
+ let username =''
219
+ let memo = executor.memo
220
+ if (executor.state == 'pass') {
221
+ if (task.category == 'notify')
222
+ action = `已抄送 ${executor.updatedAt}`
223
+ else
224
+ action = `已审核 ${executor.updatedAt}`
225
+ }else if(data.process.state == 'finish_refuse'){
226
+ action = `已撤销 ${executor.updatedAt}`
227
+ } else if (executor.state == 'refuse') {
228
+ action = `已驳回 ${executor.updatedAt}`
229
+ }
230
+
231
+ if(executor.user.name!=executor.submiterName && executor.submiterName)
232
+ username =`${executor.user.name}/${executor.submiterName}`
233
+ else
234
+ username = `${executor.user.name}`
235
+
236
+ return `${username} ${action} ${memo}`
237
+ }
238
+
239
+ const formatProcessTitle = computed(() => {
240
+ if (data.process.state == 'started') {
241
+ return '审批流程: 审核中'
242
+ } else if (data.process.state == 'finish_pass') {
243
+ return '审批流程: 审批通过'
244
+ } else if (data.process.state == 'finish_refuse') {
245
+ return '审批流程: 已撤销'
246
+ } else {
247
+ return '审批流程:'
248
+ }
249
+ })
250
+
251
+ watch(() => props.userId, () => {
252
+ if (!props.userId)
253
+ return
254
+
255
+ queryDetail()
256
+ queryStepAuth()
257
+ updateCanApply()
258
+ }, { immediate: true })
259
+
260
+ watch(() => props.processId, () => {
261
+ queryDetail()
262
+ queryStepAuth()
263
+ updateCanApply()
264
+ }, { immediate: true })
265
+
266
+ watch(() => props.mouldId, async () => {
267
+ if (!props.processId && !props.mouldId)
268
+ return
269
+
270
+ queryDetail()
271
+ await queryStepAuth()
272
+ updateAuth()
273
+ updateCanApply()
274
+ }, { immediate: true })
275
+
276
+ watch(() => JSON.stringify(props.form), async () => {
277
+ if (!data.stepAuth)
278
+ return
279
+
280
+ queryDetail()
281
+ await queryStepAuth()
282
+ updateAuth()
283
+ updateCanApply()
284
+ }, { immediate: true })
285
+ </script>
286
+
287
+ <style lang="scss" scoped>
288
+ .widget {
289
+ text-align: center;
290
+ padding: 15px 15px;
291
+ }
292
+
293
+ .memo {
294
+ margin-bottom: 15px;
295
+ }
296
+
297
+ .refuse-btn {
298
+ width: 120px;
299
+ margin-right: 15px;
300
+ }
301
+
302
+ .pass-btn {
303
+ width: 120px;
304
+ }
305
+
306
+ .apply-btn {
307
+ width: 60vw;
308
+ }
309
+
310
+ .task-list {
311
+ margin-top: 15px;
312
+ }
313
+
314
+ .task-title {
315
+ font-size: 14px;
316
+ font-weight: bold;
317
+ color: #333;
318
+ text-align: left;
319
+ }
320
+
321
+ .task-user {
322
+ font-size: 13px;
323
+ color: #666;
324
+ text-align: left;
325
+ margin-top: 5px;
326
+ }
327
+
328
+ .audit-title {
329
+ padding: 25px 15px 0 15px;
330
+ font-size: 16px;
331
+ font-weight: bold;
332
+ color: #666;
333
+ text-align: left;
334
+ }
335
+ </style>
336
+
337
+ <style>
338
+ :root:root {
339
+ --van-popover-action-width: 70vw;
340
+ }
341
+ </style>