ui-process-h5 0.1.33 → 0.1.40

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 (98) hide show
  1. package/build/configure/README.md +171 -0
  2. package/build/configure/package.json +27 -0
  3. package/build/scripts/postinstall.mjs +14 -0
  4. package/build/scripts/switch-cli.mjs +4 -0
  5. package/build/scripts/utils.mjs +60 -0
  6. package/index.html +12 -0
  7. package/package.json +43 -58
  8. package/src/App.vue +151 -0
  9. package/src/assets/font-icon/iconfont.scss +57 -0
  10. package/src/assets/font-icon/iconfont.ttf +0 -0
  11. package/src/assets/img/add-file.png +0 -0
  12. package/src/assets/img/arrow-right.png +0 -0
  13. package/src/assets/img/arrow.png +0 -0
  14. package/src/assets/img/check.png +0 -0
  15. package/src/assets/img/del.png +0 -0
  16. package/src/assets/img/doc.png +0 -0
  17. package/src/assets/img/file.png +0 -0
  18. package/src/assets/img/image.png +0 -0
  19. package/src/assets/img/pdf.png +0 -0
  20. package/src/assets/img/xls.png +0 -0
  21. package/src/assets/img/zip.png +0 -0
  22. package/src/assets/js/auth.js +41 -0
  23. package/src/assets/js/errorCode.js +6 -0
  24. package/src/assets/js/message.js +352 -0
  25. package/src/assets/js/request.js +90 -0
  26. package/src/assets/js/toast.js +239 -0
  27. package/src/assets/js/top.js +229 -0
  28. package/src/assets/js/utils.js +82 -0
  29. package/src/assets/js/vuePopper.js +123 -0
  30. package/src/assets/query.png +0 -0
  31. package/src/assets/status/error.png +0 -0
  32. package/src/assets/status/loading.png +0 -0
  33. package/src/assets/status/success.png +0 -0
  34. package/src/main.js +15 -0
  35. package/src/packages/attchUpload/index.js +371 -0
  36. package/src/packages/attchUpload/index.scss +136 -0
  37. package/src/packages/attchUpload/index.vue +173 -0
  38. package/src/packages/downSelect/index.js +81 -0
  39. package/src/packages/downSelect/index.scss +82 -0
  40. package/src/packages/downSelect/index.vue +54 -0
  41. package/src/packages/index.js +6 -0
  42. package/src/packages/popup/index.js +61 -0
  43. package/src/packages/popup/index.scss +174 -0
  44. package/src/packages/popup/index.vue +79 -0
  45. package/src/packages/preview/index.js +36 -0
  46. package/src/packages/preview/index.vue +15 -0
  47. package/src/packages/previewImage/index.js +158 -0
  48. package/src/packages/previewImage/index.scss +59 -0
  49. package/src/packages/previewImage/index.vue +32 -0
  50. package/src/packages/process/index.js +679 -0
  51. package/src/packages/process/index.scss +164 -0
  52. package/src/packages/process/index.vue +189 -0
  53. package/src/packages/process/operation/backNode.vue +393 -0
  54. package/src/packages/process/operation/cancel.vue +399 -0
  55. package/src/packages/process/operation/ccTask.vue +461 -0
  56. package/src/packages/process/operation/complete.vue +488 -0
  57. package/src/packages/process/operation/counterSign.vue +485 -0
  58. package/src/packages/process/operation/delegateTask.vue +480 -0
  59. package/src/packages/process/operation/index.js +9 -0
  60. package/src/packages/process/operation/restart.vue +305 -0
  61. package/src/packages/submitPopup/index.js +296 -0
  62. package/src/packages/submitPopup/index.scss +83 -0
  63. package/src/packages/submitPopup/index.vue +138 -0
  64. package/src/packages/tab/index.js +207 -0
  65. package/src/packages/tab/index.scss +176 -0
  66. package/src/packages/tab/index.vue +155 -0
  67. package/src/packages/tip/index.js +74 -0
  68. package/src/packages/tip/index.scss +82 -0
  69. package/src/packages/tip/index.vue +57 -0
  70. package/src/packages/viewAttchList/index.js +132 -0
  71. package/src/packages/viewAttchList/index.scss +76 -0
  72. package/src/packages/viewAttchList/index.vue +112 -0
  73. package/src/style.css +80 -0
  74. package/ui-process-h5/README.md +171 -0
  75. package/ui-process-h5/package.json +27 -0
  76. package/ui-process-h5/scripts/postinstall.mjs +14 -0
  77. package/ui-process-h5/scripts/switch-cli.mjs +4 -0
  78. package/ui-process-h5/scripts/utils.mjs +60 -0
  79. package/ui-process-h5/v2/style.css +1 -0
  80. package/ui-process-h5/v2/ui-process-h5.js +13467 -0
  81. package/ui-process-h5/v2/ui-process-h5.umd.cjs +67 -0
  82. package/ui-process-h5/v2.7/style.css +1 -0
  83. package/ui-process-h5/v2.7/ui-process-h5.js +12844 -0
  84. package/ui-process-h5/v2.7/ui-process-h5.umd.cjs +67 -0
  85. package/ui-process-h5/v3/style.css +1 -0
  86. package/ui-process-h5/v3/ui-process-h5.js +10336 -0
  87. package/ui-process-h5/v3/ui-process-h5.umd.cjs +55 -0
  88. package/vite.config.ts +78 -0
  89. package/packages/components/process/index.js +0 -8
  90. package/packages/components/process/src/button.vue +0 -55
  91. package/packages/components/process/src/index.vue +0 -447
  92. package/packages/components/process/src/popup.vue +0 -128
  93. package/packages/components/process/src/tab.vue +0 -467
  94. package/packages/components/utils/request/api.ts +0 -11
  95. package/packages/components/utils/request/cache.d.ts +0 -52
  96. package/packages/components/utils/request/cache.js +0 -99
  97. package/packages/components/utils/request/request.ts +0 -62
  98. package/packages/index.js +0 -4
package/vite.config.ts ADDED
@@ -0,0 +1,78 @@
1
+ import { defineConfig } from 'vite'
2
+ import { createVuePlugin } from 'vite-plugin-vue2'
3
+ import * as compiler from '@vue/compiler-sfc'
4
+ import vue3 from '@vitejs/plugin-vue'
5
+ import path from 'path'
6
+ import { getLibDir } from './build/scripts/utils.mjs'
7
+ import { isVue2, version } from 'vue-demi'
8
+ import { baseConfig } from './src/assets/js/utils.js'
9
+ import copy from 'rollup-plugin-copy'
10
+ import relaxedUnit from 'postcss-relaxed-unit'
11
+ console.log({ version })
12
+ const resolve = (str) => {
13
+ return path.resolve(__dirname, str)
14
+ }
15
+ let isVueCode = 1
16
+ if (version.startsWith('2.7.')) isVueCode = 2
17
+ else if (version.startsWith('2.')) isVueCode = 1
18
+ else isVueCode = 3
19
+
20
+ // https://vitejs.dev/config/
21
+ export default defineConfig({
22
+ resolve: {
23
+ alias: {
24
+ '@': resolve('src'),
25
+ vue: isVueCode === 1 ? path.resolve('./node_modules/vue2')
26
+ : isVueCode === 2 ? path.resolve('./node_modules/vue2.7')
27
+ : path.resolve('./node_modules/vue3'),
28
+ '@vue/composition-api': resolve('./node_modules/@vue/composition-api')
29
+ }
30
+ },
31
+ build: {
32
+ lib: {
33
+ entry: resolve('./src/packages/index.js'),
34
+ name: 'ui-process-h5',
35
+ fileName: 'ui-process-h5'
36
+ },
37
+ cssTarget: 'chrome61',
38
+ rollupOptions: {
39
+ // external: ['vue-demi', 'vue'],
40
+ external: ['vue'],
41
+ output: {
42
+ dir: getLibDir(version),
43
+ globals: {
44
+ vue: 'Vue',
45
+ // 'vue-demi': 'VueDemi'
46
+ }
47
+ }
48
+ }
49
+ },
50
+ optimizeDeps: {
51
+ // exclude: ['vue-demi']
52
+ },
53
+ plugins: [
54
+ isVue2 ? createVuePlugin() : vue3({ compiler: compiler }),
55
+ copy({
56
+ targets: [
57
+ { src: './build/configure/*', dest: './ui-process-h5' },
58
+ { src: './build/scripts/*', dest: './ui-process-h5/scripts' },
59
+ ]
60
+ })
61
+ ],
62
+ css: {
63
+ postcss: { // 配置自定义组件插件
64
+ plugins: [
65
+ relaxedUnit({ rules: { rpx: "div(2).unit(px)" } }),
66
+ ]
67
+ }
68
+ },
69
+ server: {
70
+ proxy: {
71
+ [baseConfig.apiUrl]: {
72
+ target: process.env.domain || `http://59.53.91.231:2100`,
73
+ changeOrigin: true,
74
+ //rewrite: (path) => path.replace(/^\/api/, ""),
75
+ },
76
+ },
77
+ },
78
+ })
@@ -1,8 +0,0 @@
1
- import TopProcess from "./src/index.vue";
2
-
3
- TopProcess.install = function (app) {
4
- // 组件注册,按需引入
5
- app.component(TopProcess.name, TopProcess);
6
- return app;
7
- };
8
- export default TopProcess;
@@ -1,55 +0,0 @@
1
- <template>
2
- <div
3
- class="top-button"
4
- :style="`background-color:${style.bckColor};color:${style.textColor}`"
5
- >
6
- <slot></slot>
7
- </div>
8
- </template>
9
- <script>
10
- import { defineComponent, ref, watch, computed, onMounted } from "vue-demi";
11
- export default defineComponent({
12
- name: "TopButton",
13
- props: {
14
- type: { default: "default", type: String },
15
- },
16
- setup(props) {
17
- const style = ref({
18
- textColor: "#fff",
19
- bckColor: "3c9cff",
20
- });
21
-
22
- switch (props.type) {
23
- case "primary":
24
- style.value.textColor = "#fff";
25
- style.value.bckColor = "#3c9cff";
26
- break;
27
- case "danger":
28
- style.value.textColor = "rgb(255, 96, 96)";
29
- style.value.bckColor = "rgb(255, 230, 230)";
30
- break;
31
- case "default":
32
- style.value.textColor = "rgb(51, 51, 51)";
33
- style.value.bckColor = "rgb(241, 241, 241)";
34
- break;
35
- }
36
-
37
- return {
38
- style,
39
- };
40
- },
41
- });
42
- </script>
43
- <style scoped>
44
- .top-button {
45
- width: 100%;
46
- border-radius: 20px;
47
- height: 36px;
48
- background-color: #3c9cff;
49
- color: #fff;
50
- font-size: 14px;
51
- justify-content: center;
52
- display: flex;
53
- align-items: center;
54
- }
55
- </style>
@@ -1,447 +0,0 @@
1
- <template>
2
- <div class="process-warp">
3
- <div class="process-main" v-if="processStatus.status">
4
- <div class="process-ml-item border">
5
- <div class="process-mli-name">流程状态</div>
6
- <div class="process-mli-value">
7
- <div
8
- class="process-mliv-dd"
9
- :style="{ background: getColor(processStatus.status) }"
10
- v-if="
11
- processStatus.status || processStatus.bizStatusName
12
- "
13
- >
14
- {{
15
- processStatus.bizStatusName
16
- ? processStatus.bizStatusName
17
- : processStatus.status
18
- }}
19
- </div>
20
- </div>
21
- </div>
22
- <div class="process-ml-item border">
23
- <div class="process-mli-name">流程发起时间</div>
24
- <div class="process-mli-value">
25
- <span>{{ processStatus.createTime }}</span>
26
- </div>
27
- </div>
28
-
29
- <div
30
- class="process-ml-item"
31
- v-if="
32
- processStatus.allUserNames &&
33
- processStatus.allUserNames.length
34
- "
35
- >
36
- <div class="process-mli-name">审批节点</div>
37
- <div class="process-mli-value">
38
- <span class="process-mliv-jd">{{
39
- `${
40
- processStatus.taskState == 4
41
- ? processStatus.currUserName
42
- : processStatus.allUserNames.toString()
43
- }审批中`
44
- }}</span>
45
- </div>
46
- </div>
47
- </div>
48
- <div class="process-card" :style="{ height: processCardHeight }">
49
- <TopTab :tapList="tapList">
50
- <template #default><slot></slot></template>
51
- </TopTab>
52
- </div>
53
- <div class="process-foot" v-if="isAdditional">
54
- <div class="footBtnRow">
55
- <slot name="btn"></slot>
56
- </div>
57
- </div>
58
- <div class="process-btn">
59
- <template v-if="processStatus.status != '已完成'">
60
- <template v-for="(item, index) in operBtn" :key="item.name">
61
- <TopButton
62
- v-if="index < 3"
63
- @click="handleTest"
64
- :type="item.btnProps.type.toString()"
65
- >
66
- {{ item.name }}
67
- </TopButton>
68
- </template>
69
- </template>
70
- <div class="elips" v-if="operBtn.length > 3">
71
- <div class="circle"></div>
72
- <div class="circle"></div>
73
- <div class="circle"></div>
74
- </div>
75
- <!-- <TopButton @click="handleTest">撤销</TopButton>
76
- <TopButton @click="handleTest" type="danger">拒绝</TopButton>
77
- <TopButton @click="handleTest" type="primary">同意</TopButton> -->
78
- </div>
79
- </div>
80
- <TopPopup ref="TopPopup1" :cancel="handleCancel" :comfig="handleComfig">
81
- csaasd1
82
- </TopPopup>
83
- </template>
84
-
85
- <script lang="ts">
86
- import { defineComponent, ref, watch, computed } from "vue-demi";
87
- import TopTab from "./tab.vue";
88
- import TopPopup from "./popup.vue";
89
- import TopButton from "./button.vue";
90
- // import { getProcessStatus } from "../../utils/request/api";
91
-
92
- export default defineComponent({
93
- name: "TopProcess",
94
- components: {
95
- TopTab,
96
- TopPopup,
97
- TopButton,
98
- },
99
- props: {
100
- tapList: { require: false, default: () => [], type: Array },
101
- processId: { require: true, default: "", type: String },
102
- processDefId: { require: true, default: "", type: String },
103
- taskId: { require: true, default: "", type: String },
104
- isAdditional: { require: false, default: false, type: Boolean },
105
- isView: { default: false, type: Boolean },
106
- userId: { default: "", type: String}
107
- },
108
- setup(props) {
109
- const processStatus = ref<any>({});
110
-
111
- const TopPopup1 = ref<any>();
112
-
113
- // 底部按钮
114
- const taskNode = ref<any>([
115
- {
116
- taskId: "ecd82a93-4a62-42a7-b7bd-df38d2f1609a",
117
- taskState: 1,
118
- nodeId: "obj_026aac284c1a4303854f978b674be4b9",
119
- customUniqueId: "",
120
- nodeName: "部门负责人",
121
- },
122
- ]);
123
-
124
- const taskObj = ref<any>({
125
- id: "obj_026aac284c1a4303854f978b674be4b9",
126
- name: "部门负责人",
127
- no: "1",
128
- buttons: [],
129
- ccTaskButtonLabel: "",
130
- ccTaskButtonAnnex: null,
131
- completeButtonLabel: "同意",
132
- completeButtonAnnex: null,
133
- delegateTaskButtonLabel: "转办",
134
- delegateTaskButtonAnnex: null,
135
- printFormButtonLabel: "",
136
- supplyUnusualTransferButtonLabel: "",
137
- readingOfficeLabel: "",
138
- readingOfficeButtonAnnex: null,
139
- jointlySignLabel: "",
140
- jointlySignButtonAnnex: null,
141
- counterSignLabel: "加签",
142
- counterSignButtonAnnex: null,
143
- coordinationLabel: "",
144
- coordinationButtonAnnex: null,
145
- otherButtonAnnexList: null,
146
- humanPerformer: {
147
- id: "obj_2bd3494ae5c54309b7f2ea452921790b",
148
- name: "任意指定",
149
- resourceAssignmentExpressionModel: {
150
- formalExpression: "",
151
- },
152
- },
153
- commentModels: [
154
- {
155
- actionName: "提交",
156
- isDefault: true,
157
- },
158
- {
159
- actionName: "作废",
160
- isDefault: false,
161
- },
162
- ],
163
- routeTxt: {
164
- departmentIds: null,
165
- companyIds: null,
166
- teamList: null,
167
- routeType: "DynamicUsers",
168
- },
169
- loopCardinality: 1,
170
- isHistoryRoute: false,
171
- participantList: null,
172
- historyRoute: false,
173
- });
174
-
175
- watch(
176
- () => props.processId,
177
- (val, preVal) => {
178
- if (val) {
179
- processStatus.value = {
180
- status: "审批中",
181
- createUid: "18ccbf63229f0c79f39940ae284c111e",
182
- createTopUserId: "128ec9c9b7f26135272596fe01c57690",
183
- createTime: "2023-04-20 15:01:48",
184
- currUserName: "朱鸿飞",
185
- allUserNames: ["朱鸿飞"],
186
- userNodeGroup: {
187
- 分管领导: ["朱鸿飞"],
188
- },
189
- appId: "com.awspaas.user.apps.top.study.project",
190
- statusCode: "1",
191
- statusName: "审批中",
192
- bizStatusName: "审批中",
193
- taskState: 1,
194
- };
195
- }
196
- },
197
- {
198
- //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
199
- //那么首次执行,val为默认值,preVal为undefined
200
- immediate: true,
201
- //这个参数代表监听对象时,可以监听深度嵌套的对象属性
202
- deep: true,
203
- }
204
- );
205
-
206
- /* getProcessStatus({
207
- processInstId: "4ac28800-7056-483b-8d38-a4932daf055b",
208
- }).then((res) => {
209
- console.log("res", res);
210
- }); */
211
-
212
- console.log("asd", taskNode.value[0].taskState);
213
- /* copmuted */
214
- // 按钮对象
215
- const operBtn = computed<any>(() => {
216
- let btnList = <any>[];
217
- let flag =
218
- taskNode.value &&
219
- taskNode.value[0] &&
220
- taskNode.value[0].taskState != 4;
221
-
222
- if (flag && !props.isView && taskObj.value.completeButtonLabel) {
223
- let obj = <any>{};
224
- obj.name = taskObj.value.completeButtonLabel;
225
- obj.btnProps = { type: "primary" };
226
- btnList.push(obj);
227
- }
228
-
229
- if (flag && !props.isView && processStatus.value.currUserName) {
230
- let obj = <any>{};
231
- obj.name = "拒绝";
232
- obj.btnProps = { type: "danger" };
233
- btnList.push(obj);
234
- }
235
-
236
- if (
237
- flag &&
238
- !props.isView &&
239
- taskObj.value.buttons &&
240
- taskObj.value.buttons.length
241
- ) {
242
- taskObj.value.buttons.forEach((s: any) => {
243
- if (s.label === "退回") {
244
- let obj = <any>{};
245
- obj.name = s.label;
246
- obj.btnProps = { type: "danger" };
247
- btnList.push(obj);
248
- }
249
- });
250
- }
251
-
252
- if (
253
- flag &&
254
- !props.isView &&
255
- taskObj.value.delegateTaskButtonLabel
256
- ) {
257
- let obj = <any>{};
258
- obj.name = taskObj.value.delegateTaskButtonLabel;
259
- obj.btnProps = { type: "default" };
260
- btnList.push(obj);
261
- }
262
- if (
263
- props.processId &&
264
- processStatus.value.createTopUserId == props.userId &&
265
- taskNode.value[0]?.taskState != 2 &&
266
- processStatus.value.status !== "已驳回" &&
267
- processStatus.value.status !== "已撤销"
268
- ) {
269
- let obj = <any>{};
270
- obj.name = "催办";
271
- obj.btnProps = { type: "default" };
272
- btnList.push(obj);
273
- }
274
- if (
275
- props.processId &&
276
- processStatus.value.createTopUserId == props.userId &&
277
- taskNode.value[0]?.taskState != 2 &&
278
- processStatus.value.status !== "已驳回" &&
279
- processStatus.value.status !== "已撤销"
280
- ) {
281
- let obj = <any>{};
282
- obj.name = "撤销";
283
- obj.btnProps = { type: "default" };
284
- btnList.push(obj);
285
- }
286
- if (flag && !props.isView && taskObj.value.counterSignLabel) {
287
- let obj = <any>{};
288
- obj.name = taskObj.value.counterSignLabel;
289
- obj.btnProps = { type: "primary" };
290
- btnList.push(obj);
291
- }
292
-
293
- return btnList;
294
- });
295
-
296
- //筛选
297
- const actionBtn = computed(() => {
298
- if (operBtn.value.length > 3) {
299
- return operBtn.value.slice(3);
300
- }
301
- return [];
302
- });
303
-
304
- const handleCancel = () => {
305
- console.log("handleCancel");
306
- };
307
-
308
- const handleComfig = () => {
309
- console.log("handleComfig", "确定按钮");
310
- TopPopup1.value.handleClose();
311
- };
312
-
313
- const processCardHeight = computed(() => {
314
- /* let num = 210;
315
- if (
316
- ProcessInsObj.value.end ||
317
- !operBtn.value ||
318
- operBtn.value?.length == 0
319
- ) {
320
- num -= 80;
321
- }
322
- if (!processStatus.value.status) num -= 140;
323
- else if (!processStatus.value.currUserName) num -= 40; */
324
- return `calc(100vh - ${205}px)`;
325
- });
326
-
327
- const handleTest = () => {
328
- TopPopup1.value.handleOpen();
329
- };
330
-
331
- return {
332
- processStatus,
333
- processCardHeight,
334
- handleTest,
335
- TopPopup1,
336
- handleCancel,
337
- handleComfig,
338
- operBtn,
339
- actionBtn,
340
- };
341
- },
342
- methods: {
343
- getColor(status: string) {
344
- if (status == "审核中") return "#FFA52D";
345
- if (status == "已驳回") return "#F14B4C";
346
- if (status == "已撤销") return "#CECECE";
347
- if (status == "已完成") return "#6DC743";
348
-
349
- return "#1389FF";
350
- },
351
- },
352
- });
353
- </script>
354
-
355
- <style scoped>
356
- .process-warp {
357
- overflow: hidden;
358
- height: 100vh;
359
- width: 100%;
360
- position: relative;
361
- background-color: #f3f3f7;
362
- }
363
- .process-main {
364
- display: flex;
365
- justify-content: space-between;
366
- flex-direction: column;
367
- align-items: center;
368
- padding: 0 17px;
369
- background: #fff;
370
- margin: 0 0 10px 0;
371
- }
372
-
373
- .process-main .border {
374
- border-bottom: #e8e8e8 1px solid;
375
- }
376
-
377
- .process-main .process-ml-item {
378
- display: flex;
379
- align-items: center;
380
- font-size: 15px;
381
- font-weight: 400;
382
- width: 100%;
383
- justify-content: space-between;
384
- height: 44px;
385
- }
386
-
387
- .process-main .process-ml-item .process-mli-name {
388
- color: #333333;
389
- }
390
-
391
- .process-main .process-ml-item .process-mli-value {
392
- color: #888888;
393
- }
394
-
395
- .process-main .process-ml-item .process-mli-value .process-mliv-dd {
396
- height: 26px;
397
- min-width: 30px;
398
- padding: 0 12px;
399
- border-radius: 20px;
400
- background: #1389ff;
401
- color: #fff;
402
- display: flex;
403
- align-items: center;
404
- justify-content: center;
405
- font-size: 12px;
406
- }
407
-
408
- .process-main .process-ml-item .process-mli-value .process-mliv-jd {
409
- color: #1389ff;
410
- }
411
-
412
- .process-btn {
413
- display: flex;
414
- min-height: 60px;
415
- padding-top: 5px;
416
- background: #fff;
417
- border-top: 1px solid #dddddf9e;
418
- box-sizing: border-box;
419
- justify-content: center;
420
- align-items: center;
421
- flex-direction: row-reverse;
422
- }
423
-
424
- .process-btn .top-button,
425
- .process-btn .elips {
426
- margin: 0 5px;
427
- }
428
- /* .process-btn .top-button:first-child{
429
- margin-left: 0;
430
- } */
431
-
432
- .elips {
433
- min-width: 60px;
434
- height: 100%;
435
- background-color: white;
436
- display: flex;
437
- justify-content: center;
438
- align-items: center;
439
- }
440
- .elips .circle {
441
- width: 6px;
442
- height: 6px;
443
- margin: 0 2px;
444
- background-color: #333333;
445
- border-radius: 50%;
446
- }
447
- </style>