ui-process-h5 3.3.5 → 3.3.7

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 CHANGED
@@ -1,211 +1,211 @@
1
- # ui-process-h5
2
-
3
- > App 端 流程、附件上传、附件列表、送审插件
4
-
5
- ## 安装
6
-
7
- > vue2.7 以上版本安装指令
8
- >
9
- > > ```bash
10
- > > npm i ui-process-h5 -D
11
- > > ```
12
-
13
- > vue2.7 以下版本安装指令
14
- >
15
- > > ```bash
16
- > > npm i @vue/composition-api -D
17
- > > npm i ui-process-h5 -D
18
- > > ```
19
-
20
- ## 使用
21
-
22
- 在需要使用的组件内引入
23
-
24
- ```js
25
- import {
26
- TopProcess,
27
- attchViews,
28
- TopSumbitPopup,
29
- ViewAttchList,
30
- } from "ui-process-h5";
31
- export default {
32
- components: { TopProcess, attchViews, TopSumbitPopup, ViewAttchList },
33
- };
34
- ```
35
-
36
- ```html
37
- <template>
38
- <TopProcess
39
- :processInstId="processInstId"
40
- :processDefId="processDefId"
41
- :formData="formData"
42
- :isView="isView"
43
- :userId="userId"
44
- :request="request"
45
- :tapList="tapList"
46
- :selfTapList="selfTapList"
47
- :endFunction="endFunction"
48
- :isDocument="isDocument"
49
- >
50
- <slot></slot>
51
- </TopProcess>
52
- <attchViews
53
- v-if="labels == '1'"
54
- :limit="limit ? limit : -1"
55
- :requires="requires"
56
- :request="param.request"
57
- :linkUrl="param.linkUrl"
58
- @getValue="getValues"
59
- />
60
- <ViewAttchList :inList="inList"></ViewAttchList>
61
- <TopSumbitPopup
62
- :visible="visible"
63
- :request="request"
64
- :appId="appId"
65
- :resubmit="resubmit"
66
- :id="businessKey"
67
- :businessType="businessType"
68
- :todoParameter="todoParameter"
69
- :title="title"
70
- @successFn="successFn"
71
- :beforeFunction="beforeFunction"
72
- ></TopSumbitPopup>
73
- </template>
74
- <script>
75
- import "ui-process-h5/style.css";
76
- import {
77
- TopProcess,
78
- attchViews,
79
- TopSumbitPopup,
80
- ViewAttchList,
81
- } from "ui-process-h5";
82
- export default {
83
- components: { TopProcess, attchViews, TopSumbitPopup, ViewAttchList },
84
- data() {
85
- return {
86
- formData: {
87
- businessKey: businessKey,
88
- processInstId: processInstId,
89
- processDefId: processDefId,
90
- title: title,
91
- subjectId: subjectId,
92
- userId: userId,
93
- userName: userName,
94
- reason: reason,
95
- meetingTheme: meetingTheme,
96
- },
97
- selfBtn: [
98
- {
99
- name: "测试",
100
- type: "danger",
101
- click: () => {
102
- console.log("当前::");
103
- },
104
- },
105
- {
106
- name: "测试2",
107
- type: "default",
108
- click: () => {
109
- console.log("当前::");
110
- },
111
- },
112
- ],
113
- };
114
- },
115
- methods: {
116
- endFunction() {
117
- console.log("endFunction");
118
- },
119
- beforeFunction() {
120
- console.log("beforeFunction");
121
- },
122
- },
123
- };
124
- </script>
125
- ```
126
-
127
- ## 属性-Attributes (TopProcess)
128
-
129
- | 参数 | 类型 | 默认值 | 说明 |
130
- | -------------- | -------- | ----------------- | --------------------------------------------------- |
131
- | tapList | Array | [] | tab 节点插入、自定义附件等信息 |
132
- | selfTapList | Array | [] | 自定义 tab 节点,传入后覆盖原本参数 |
133
- | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
134
- | processInstId | String | '' | 流程实例 ID [必填] |
135
- | formData | Object | {} | 集合数据 内部存储流程相关信息 businessKey[必填] |
136
- | isAdditional | boolean | false | 自定义按钮开关 开启后可使用按钮插槽 |
137
- | getVars | Function | null | 业务方法 |
138
- | endFunction | Function | null | 弹窗结束后执行方法 |
139
- | beforeFunction | Function | null | 弹窗开启前执行方法 |
140
- | restartData | Object | null | 重新提交参数 |
141
- | isDocument | Boolean | false | 公文独立配置 |
142
- | selfList | Array | {id,name} | 自定义流程列表 |
143
- | selfBtn | Array | {name,type,click} | 自定义流程按钮(查看案例 data) |
144
- | uid | String | "" | 炎黄 uid 若业务流程不需要催办,撤回,可以不使用该参数 |
145
- | isCheckType | String | "0" | 选人类型 传入后默认所有选人都为该类型 |
146
- | isMsg | Boolean | false | 意见是否展示 |
147
-
148
- ## 属性-Attributes (attchViews)
149
-
150
- | 参数 | 类型 | 默认值 | 说明 |
151
- | -------- | ---------------- | ------ | ----------------------------------------------- |
152
- | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
153
- | limit | [String, Number] | 4 | 最大上传数 |
154
- | getValue | Function | null | 返回上传数据 url |
155
- | requires | Boolean | false | 必填 |
156
- | inComing | Array | Array | 回显已上传列表 |
157
- | deletFn | Function | null | 组件本身提供静态删除功能,动态删除需传入相应方法 |
158
-
159
- ## 属性-Attributes (ViewAttchList)
160
-
161
- | 参数 | 类型 | 默认值 | 说明 |
162
- | ------ | ----- | ------ | ------------ |
163
- | inList | Array | [] | 附件列表展示 |
164
-
165
- ## 属性-Attributes (TopSumbitPopup)
166
-
167
- | 参数 | 类型 | 默认值 | 说明 |
168
- | -------------- | ---------------- | --------- | ----------------------------------------------- |
169
- | visible | Boolean | false | 展示参数 | |
170
- | title | String | "" | 送审提交标题参数 |
171
- | todoParameter | Object | {} | 发起流程时的其他参数 |
172
- | businessType | [String, Number] | null | 业务类型 |
173
- | id | String | "" | 业务 Id |
174
- | resubmit | Boolean | false | 是否为重新提交 |
175
- | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
176
- | appId | String | '' | appId |
177
- | beforeFunction | Function | null | 提交前执行事件 |
178
- | successFn | Function | null | 成功后回调 |
179
- | manual | Boolean | false | 手动执行启动(ref 绑定后执行 handleSongshen()) |
180
- | selfList | Array | {id,name} | 自定义流程列表 |
181
- | isCheckType | String | "0" | 选人类型 uid |
182
-
183
- ### tapList-对象说明
184
-
185
- | 属性名 | 类型 | 说明 |
186
- | ------ | ------ | ---------------------------------------------------------------------------- |
187
- | label | String | 选项卡 title |
188
- | key | String | 选项卡 ID 请勿重复 defaultTabList 内已拥有的默认 key(a、b、c 为默认节点 key) |
189
- | type | String | 插槽类型 默认 default 插槽 slot |
190
- | slot | String | 插槽名 |
191
- | sort | Number | 排序参数,无参数默认插入末尾 |
192
-
193
- ### selfTapList-对象说明 同上
194
-
195
- ### formData-对象说明
196
-
197
- | 属性名 | 类型 | 说明 |
198
- | ------------------------- | ------ | ------- |
199
- | businessKey | String | 业务 ID [必填] |
200
- | title reason meetingTheme | String | 标题 |
201
- | uid | String | 角色 id |
202
-
203
- 附件相关列表,参考 getValue 回调参数
204
-
205
- ### restartData-对象说明
206
-
207
- | 属性名 | 类型 | 说明 |
208
- | ------------ | ------ | -------------------- |
209
- | businessType | String | 业务 类型 |
210
- | showType | String | 流程类型(all,pc,app) |
211
- | processName | String | 流程查询字段 |
1
+ # ui-process-h5
2
+
3
+ > App 端 流程、附件上传、附件列表、送审插件
4
+
5
+ ## 安装
6
+
7
+ > vue2.7 以上版本安装指令
8
+ >
9
+ > > ```bash
10
+ > > npm i ui-process-h5 -D
11
+ > > ```
12
+
13
+ > vue2.7 以下版本安装指令
14
+ >
15
+ > > ```bash
16
+ > > npm i @vue/composition-api -D
17
+ > > npm i ui-process-h5 -D
18
+ > > ```
19
+
20
+ ## 使用
21
+
22
+ 在需要使用的组件内引入
23
+
24
+ ```js
25
+ import {
26
+ TopProcess,
27
+ attchViews,
28
+ TopSumbitPopup,
29
+ ViewAttchList,
30
+ } from "ui-process-h5";
31
+ export default {
32
+ components: { TopProcess, attchViews, TopSumbitPopup, ViewAttchList },
33
+ };
34
+ ```
35
+
36
+ ```html
37
+ <template>
38
+ <TopProcess
39
+ :processInstId="processInstId"
40
+ :processDefId="processDefId"
41
+ :formData="formData"
42
+ :isView="isView"
43
+ :userId="userId"
44
+ :request="request"
45
+ :tapList="tapList"
46
+ :selfTapList="selfTapList"
47
+ :endFunction="endFunction"
48
+ :isDocument="isDocument"
49
+ >
50
+ <slot></slot>
51
+ </TopProcess>
52
+ <attchViews
53
+ v-if="labels == '1'"
54
+ :limit="limit ? limit : -1"
55
+ :requires="requires"
56
+ :request="param.request"
57
+ :linkUrl="param.linkUrl"
58
+ @getValue="getValues"
59
+ />
60
+ <ViewAttchList :inList="inList"></ViewAttchList>
61
+ <TopSumbitPopup
62
+ :visible="visible"
63
+ :request="request"
64
+ :appId="appId"
65
+ :resubmit="resubmit"
66
+ :id="businessKey"
67
+ :businessType="businessType"
68
+ :todoParameter="todoParameter"
69
+ :title="title"
70
+ @successFn="successFn"
71
+ :beforeFunction="beforeFunction"
72
+ ></TopSumbitPopup>
73
+ </template>
74
+ <script>
75
+ import "ui-process-h5/style.css";
76
+ import {
77
+ TopProcess,
78
+ attchViews,
79
+ TopSumbitPopup,
80
+ ViewAttchList,
81
+ } from "ui-process-h5";
82
+ export default {
83
+ components: { TopProcess, attchViews, TopSumbitPopup, ViewAttchList },
84
+ data() {
85
+ return {
86
+ formData: {
87
+ businessKey: businessKey,
88
+ processInstId: processInstId,
89
+ processDefId: processDefId,
90
+ title: title,
91
+ subjectId: subjectId,
92
+ userId: userId,
93
+ userName: userName,
94
+ reason: reason,
95
+ meetingTheme: meetingTheme,
96
+ },
97
+ selfBtn: [
98
+ {
99
+ name: "测试",
100
+ type: "danger",
101
+ click: () => {
102
+ console.log("当前::");
103
+ },
104
+ },
105
+ {
106
+ name: "测试2",
107
+ type: "default",
108
+ click: () => {
109
+ console.log("当前::");
110
+ },
111
+ },
112
+ ],
113
+ };
114
+ },
115
+ methods: {
116
+ endFunction() {
117
+ console.log("endFunction");
118
+ },
119
+ beforeFunction() {
120
+ console.log("beforeFunction");
121
+ },
122
+ },
123
+ };
124
+ </script>
125
+ ```
126
+
127
+ ## 属性-Attributes (TopProcess)
128
+
129
+ | 参数 | 类型 | 默认值 | 说明 |
130
+ | -------------- | -------- | ----------------- | --------------------------------------------------- |
131
+ | tapList | Array | [] | tab 节点插入、自定义附件等信息 |
132
+ | selfTapList | Array | [] | 自定义 tab 节点,传入后覆盖原本参数 |
133
+ | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
134
+ | processInstId | String | '' | 流程实例 ID [必填] |
135
+ | formData | Object | {} | 集合数据 内部存储流程相关信息 businessKey[必填] |
136
+ | isAdditional | boolean | false | 自定义按钮开关 开启后可使用按钮插槽 |
137
+ | getVars | Function | null | 业务方法 |
138
+ | endFunction | Function | null | 弹窗结束后执行方法 |
139
+ | beforeFunction | Function | null | 弹窗开启前执行方法 |
140
+ | restartData | Object | null | 重新提交参数 |
141
+ | isDocument | Boolean | false | 公文独立配置 |
142
+ | selfList | Array | {id,name} | 自定义流程列表 |
143
+ | selfBtn | Array | {name,type,click} | 自定义流程按钮(查看案例 data) |
144
+ | uid | String | "" | 炎黄 uid 若业务流程不需要催办,撤回,可以不使用该参数 |
145
+ | isCheckType | String | "0" | 选人类型 传入后默认所有选人都为该类型 |
146
+ | isMsg | Boolean | false | 意见是否展示 |
147
+
148
+ ## 属性-Attributes (attchViews)
149
+
150
+ | 参数 | 类型 | 默认值 | 说明 |
151
+ | -------- | ---------------- | ------ | ----------------------------------------------- |
152
+ | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
153
+ | limit | [String, Number] | 4 | 最大上传数 |
154
+ | getValue | Function | null | 返回上传数据 url |
155
+ | requires | Boolean | false | 必填 |
156
+ | inComing | Array | Array | 回显已上传列表 |
157
+ | deletFn | Function | null | 组件本身提供静态删除功能,动态删除需传入相应方法 |
158
+
159
+ ## 属性-Attributes (ViewAttchList)
160
+
161
+ | 参数 | 类型 | 默认值 | 说明 |
162
+ | ------ | ----- | ------ | ------------ |
163
+ | inList | Array | [] | 附件列表展示 |
164
+
165
+ ## 属性-Attributes (TopSumbitPopup)
166
+
167
+ | 参数 | 类型 | 默认值 | 说明 |
168
+ | -------------- | ---------------- | --------- | ----------------------------------------------- |
169
+ | visible | Boolean | false | 展示参数 | |
170
+ | title | String | "" | 送审提交标题参数 |
171
+ | todoParameter | Object | {} | 发起流程时的其他参数 |
172
+ | businessType | [String, Number] | null | 业务类型 |
173
+ | id | String | "" | 业务 Id |
174
+ | resubmit | Boolean | false | 是否为重新提交 |
175
+ | request | Object | null | axios 接口请求方法 [需要包含 get post 请求方式] |
176
+ | appId | String | '' | appId |
177
+ | beforeFunction | Function | null | 提交前执行事件 |
178
+ | successFn | Function | null | 成功后回调 |
179
+ | manual | Boolean | false | 手动执行启动(ref 绑定后执行 handleSongshen()) |
180
+ | selfList | Array | {id,name} | 自定义流程列表 |
181
+ | isCheckType | String | "0" | 选人类型 uid |
182
+
183
+ ### tapList-对象说明
184
+
185
+ | 属性名 | 类型 | 说明 |
186
+ | ------ | ------ | ---------------------------------------------------------------------------- |
187
+ | label | String | 选项卡 title |
188
+ | key | String | 选项卡 ID 请勿重复 defaultTabList 内已拥有的默认 key(a、b、c 为默认节点 key) |
189
+ | type | String | 插槽类型 默认 default 插槽 slot |
190
+ | slot | String | 插槽名 |
191
+ | sort | Number | 排序参数,无参数默认插入末尾 |
192
+
193
+ ### selfTapList-对象说明 同上
194
+
195
+ ### formData-对象说明
196
+
197
+ | 属性名 | 类型 | 说明 |
198
+ | ------------------------- | ------ | ------- |
199
+ | businessKey | String | 业务 ID [必填] |
200
+ | title reason meetingTheme | String | 标题 |
201
+ | uid | String | 角色 id |
202
+
203
+ 附件相关列表,参考 getValue 回调参数
204
+
205
+ ### restartData-对象说明
206
+
207
+ | 属性名 | 类型 | 说明 |
208
+ | ------------ | ------ | -------------------- |
209
+ | businessType | String | 业务 类型 |
210
+ | showType | String | 流程类型(all,pc,app) |
211
+ | processName | String | 流程查询字段 |
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
- {
2
- "name": "ui-process-h5",
3
- "version": "3.3.5",
4
- "description": "> app端 流程插件",
5
- "main": "./ui-process-h5.umd.cjs",
6
- "style": "./style.css",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "import": "./ui-process-h5.js",
11
- "require": "./ui-process-h5.umd.cjs"
12
- },
13
- "./style.css": {
14
- "import": "./style.css",
15
- "require": "./style.css"
16
- }
17
- },
18
- "scripts": {
19
- "test": "echo \"Error: no test specified\" && exit 1",
20
- "postinstall": "node scripts/postinstall.mjs"
21
- },
22
- "devDependencies": {
23
- "checked-pick-app": "1.6.7",
24
- "dsbridge": "^3.1.4"
25
- },
26
- "dependencies": {
27
- "checked-pick-app": "1.6.7",
28
- "dsbridge": "^3.1.4"
29
- },
30
- "author": "",
31
- "license": "ISC"
1
+ {
2
+ "name": "ui-process-h5",
3
+ "version": "3.3.7",
4
+ "description": "> app端 流程插件",
5
+ "main": "./ui-process-h5.umd.cjs",
6
+ "style": "./style.css",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./ui-process-h5.js",
11
+ "require": "./ui-process-h5.umd.cjs"
12
+ },
13
+ "./style.css": {
14
+ "import": "./style.css",
15
+ "require": "./style.css"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "test": "echo \"Error: no test specified\" && exit 1",
20
+ "postinstall": "node scripts/postinstall.mjs"
21
+ },
22
+ "devDependencies": {
23
+ "checked-pick-app": "1.6.7",
24
+ "dsbridge": "^3.1.4"
25
+ },
26
+ "dependencies": {
27
+ "checked-pick-app": "1.6.7",
28
+ "dsbridge": "^3.1.4"
29
+ },
30
+ "author": "",
31
+ "license": "ISC"
32
32
  }
@@ -1,14 +1,14 @@
1
- import { isNull, switchVersion } from './utils.mjs'
2
- try {
3
- import('vue').then(res => {
4
- const version = isNull(res.version) ? res.default.version : res.version
5
- if (isNull(version))
6
- console.warn('[vue-demi-sfc-component-template] Vue is not found. Please run "npm install vue" to install.')
7
- else
8
- switchVersion(version)
9
- })
10
- } catch (error) {
11
- console.log('error', error)
12
- }
13
-
14
-
1
+ import { isNull, switchVersion } from './utils.mjs'
2
+ try {
3
+ import('vue').then(res => {
4
+ const version = isNull(res.version) ? res.default.version : res.version
5
+ if (isNull(version))
6
+ console.warn('[vue-demi-sfc-component-template] Vue is not found. Please run "npm install vue" to install.')
7
+ else
8
+ switchVersion(version)
9
+ })
10
+ } catch (error) {
11
+ console.log('error', error)
12
+ }
13
+
14
+
@@ -1,4 +1,4 @@
1
- import { switchVersion } from './utils.mjs'
2
-
3
- const version = process.argv[2]
4
- switchVersion(version)
1
+ import { switchVersion } from './utils.mjs'
2
+
3
+ const version = process.argv[2]
4
+ switchVersion(version)
package/scripts/utils.mjs CHANGED
@@ -1,60 +1,60 @@
1
- import path from 'path'
2
- import fs from 'fs'
3
- import { fileURLToPath } from 'url'
4
- const __filename = fileURLToPath(import.meta.url)
5
- const __dirname = path.dirname(__filename)
6
-
7
- function switchVersion(version) {
8
- const src = getLibDir(version)
9
- const dest = path.join(src, '..')
10
- console.log(`[frontend-shared] switch ui-process-h5 to vue version ${version}`)
11
- copyDir(src, dest)
12
- }
13
-
14
- function getLibDir(version) {
15
- const dirname = getDirName(version)
16
- return path.join(__dirname, `../../ui-process-h5/${dirname}`)
17
- }
18
-
19
- function getDirName(version) {
20
- return String(version).startsWith('2.7.') ? 'v2.7' : String(version).startsWith('2') ? 'v2' : 'v3'
21
- }
22
-
23
- function copyDir(src, dest) {
24
- console.log(`copying from ${src} to ${dest}`)
25
- // unlink for pnpm, #92
26
- try {
27
- fs.unlinkSync(dest)
28
- } catch (error) { }
29
- try {
30
- copyRecursiveSync(src, dest)
31
- } catch (error) {
32
- console.error(error)
33
- }
34
- }
35
-
36
- function copyRecursiveSync(src, dest) {
37
- const exists = fs.existsSync(src)
38
- const stats = exists && fs.statSync(src)
39
- const isDirectory = stats && stats.isDirectory()
40
- if (isDirectory) {
41
- !fs.existsSync(dest) && fs.mkdirSync(dest)
42
- fs.readdirSync(src).forEach((childItemName) => {
43
- copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))
44
- })
45
- } else {
46
- fs.copyFileSync(src, dest)
47
- }
48
- }
49
- // 判断是否为空
50
- function isNull(str) {
51
- if (str === null) return true;
52
- if (str === undefined) return true;
53
- if (str === "null") return true;
54
- if (str === "NaN") return true;
55
- if (str === "undefined") return true;
56
- if (str.length === 0) return true;
57
- // if (/^\s*$/i.test(str)) return true;
58
- return false;
59
- }
60
- export { getLibDir, copyDir, switchVersion, isNull }
1
+ import path from 'path'
2
+ import fs from 'fs'
3
+ import { fileURLToPath } from 'url'
4
+ const __filename = fileURLToPath(import.meta.url)
5
+ const __dirname = path.dirname(__filename)
6
+
7
+ function switchVersion(version) {
8
+ const src = getLibDir(version)
9
+ const dest = path.join(src, '..')
10
+ console.log(`[frontend-shared] switch ui-process-h5 to vue version ${version}`)
11
+ copyDir(src, dest)
12
+ }
13
+
14
+ function getLibDir(version) {
15
+ const dirname = getDirName(version)
16
+ return path.join(__dirname, `../../ui-process-h5/${dirname}`)
17
+ }
18
+
19
+ function getDirName(version) {
20
+ return String(version).startsWith('2.7.') ? 'v2.7' : String(version).startsWith('2') ? 'v2' : 'v3'
21
+ }
22
+
23
+ function copyDir(src, dest) {
24
+ console.log(`copying from ${src} to ${dest}`)
25
+ // unlink for pnpm, #92
26
+ try {
27
+ fs.unlinkSync(dest)
28
+ } catch (error) { }
29
+ try {
30
+ copyRecursiveSync(src, dest)
31
+ } catch (error) {
32
+ console.error(error)
33
+ }
34
+ }
35
+
36
+ function copyRecursiveSync(src, dest) {
37
+ const exists = fs.existsSync(src)
38
+ const stats = exists && fs.statSync(src)
39
+ const isDirectory = stats && stats.isDirectory()
40
+ if (isDirectory) {
41
+ !fs.existsSync(dest) && fs.mkdirSync(dest)
42
+ fs.readdirSync(src).forEach((childItemName) => {
43
+ copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))
44
+ })
45
+ } else {
46
+ fs.copyFileSync(src, dest)
47
+ }
48
+ }
49
+ // 判断是否为空
50
+ function isNull(str) {
51
+ if (str === null) return true;
52
+ if (str === undefined) return true;
53
+ if (str === "null") return true;
54
+ if (str === "NaN") return true;
55
+ if (str === "undefined") return true;
56
+ if (str.length === 0) return true;
57
+ // if (/^\s*$/i.test(str)) return true;
58
+ return false;
59
+ }
60
+ export { getLibDir, copyDir, switchVersion, isNull }