vue2-client 1.15.13 → 1.15.15

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 (34) hide show
  1. package/jest.config.js +22 -22
  2. package/package.json +2 -2
  3. package/src/ReportView.js +0 -6
  4. package/src/base-client/components/common/XForm/XForm.vue +419 -419
  5. package/src/base-client/components/common/XForm/demo.vue +105 -105
  6. package/src/base-client/components/common/XFormTable/demo.vue +0 -1
  7. package/src/base-client/components/common/XPrint/PrintBill.vue +3 -1
  8. package/src/base-client/components/common/XRate/demo.vue +102 -102
  9. package/src/base-client/components/common/XTable/XTableWrapper.vue +166 -1
  10. package/src/base-client/components/common/XUploadFilesView/index.vue +485 -485
  11. package/src/base-client/components/layout/XPageView/RenderRow.vue +88 -88
  12. package/src/base-client/components/layout/XPageView/XPageView.vue +223 -223
  13. package/src/base-client/components/layout/XPageView/XTab/XTab.vue +96 -96
  14. package/src/base-client/components/layout/XPageView/componentTypes.js +22 -22
  15. package/src/main.js +3 -4
  16. package/src/pages/WorkflowDetail/WorkFlowDemo2.vue +2 -1
  17. package/src/pages/WorkflowDetail/WorkflowDetail.vue +20 -4
  18. package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +388 -388
  19. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +475 -148
  20. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +677 -188
  21. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowLog.vue +1 -1
  22. package/src/pages/WorkflowDetail/WorkflowPageDetail/components/WorkflowPersonSelector.vue +25 -23
  23. package/src/pages/XPageViewExample/index.vue +149 -149
  24. package/src/router/async/router.map.js +3 -5
  25. package/src/router/index.js +27 -27
  26. package/src/router.js +0 -2
  27. package/src/services/api/workFlow.js +0 -4
  28. package/test/request.test.js +17 -17
  29. package/vue.config.js +2 -5
  30. package/src/base-client/components/common/AMisRender/index.js +0 -3
  31. package/src/base-client/components/common/AMisRender/index.vue +0 -263
  32. package/src/pages/AMisDemo/AMisDemo.vue +0 -325
  33. package/src/pages/AMisDemo/AMisDemo2.vue +0 -74
  34. package/test/Amis.spec.js +0 -164
@@ -1,96 +1,96 @@
1
- <template>
2
- <a-card :bordered="false" :body-style="bodyStyle">
3
- <a-tabs
4
- :tabBarGutter="tabBarGutter"
5
- :activeKey="activeKey"
6
- @change="tabPaneChange"
7
- :hideAdd="true"
8
- :tabBarStyle="{ display: showTabBar ? 'block' : 'none' }"
9
- >
10
- <slot name="extraBeforeTabs"></slot>
11
- <a-tab-pane
12
- :forceRender="true"
13
- v-for="(tab, index) in data"
14
- :key="index"
15
- :tab="tab.title"
16
- >
17
- <component
18
- :is="resolveComponentType(tab.type)"
19
- :key="`xTabPaneComp${index}`"
20
- :ref="`tab_comp_${index}`"
21
- v-bind="tab.props || {}"
22
- />
23
- </a-tab-pane>
24
- </a-tabs>
25
- </a-card>
26
- </template>
27
-
28
- <script setup>
29
- import { ref, onMounted } from 'vue'
30
- import { resolveComponentType } from '../componentTypes'
31
-
32
- const props = defineProps({
33
- // 标签页数据
34
- data: {
35
- type: Array,
36
- required: true
37
- },
38
- // 是否显示标签栏
39
- showTabBar: {
40
- type: Boolean,
41
- default: true
42
- },
43
- // 标签页切换时的回调函数
44
- onChange: {
45
- type: [String, Function],
46
- default: null
47
- },
48
- // Tab间距
49
- tabBarGutter: {
50
- type: Number,
51
- default: 10
52
- },
53
- // 卡片样式
54
- bodyStyle: {
55
- type: Object,
56
- default: () => ({})
57
- },
58
- // 默认激活的标签页
59
- defaultActiveKey: {
60
- type: [String, Number],
61
- default: 0
62
- }
63
- })
64
-
65
- // 激活的标签页
66
- const activeKey = ref(0)
67
-
68
- // 切换标签页
69
- const tabPaneChange = (newKey) => {
70
- if (activeKey.value === newKey) return
71
-
72
- const oldKey = activeKey.value
73
- activeKey.value = newKey
74
-
75
- // 触发标签页切换事件
76
- if (props.onChange) {
77
- try {
78
- if (props.onChange instanceof Function) {
79
- props.onChange(oldKey, newKey, props.data[oldKey], props.data[newKey])
80
- } else {
81
- // 创建一个安全的函数执行环境
82
- // eslint-disable-next-line no-new-func
83
- const onChange = new Function('oldKey', 'newKey', 'oldTab', 'newTab', `return (${props.onChange})(oldKey, newKey, oldTab, newTab)`)
84
- onChange(oldKey, newKey, props.data[oldKey], props.data[newKey])
85
- }
86
- } catch (error) {
87
- console.error('执行标签页切换回调错误:', error)
88
- }
89
- }
90
- }
91
-
92
- // 生命周期
93
- onMounted(() => {
94
- activeKey.value = props.defaultActiveKey
95
- })
96
- </script>
1
+ <template>
2
+ <a-card :bordered="false" :body-style="bodyStyle">
3
+ <a-tabs
4
+ :tabBarGutter="tabBarGutter"
5
+ :activeKey="activeKey"
6
+ @change="tabPaneChange"
7
+ :hideAdd="true"
8
+ :tabBarStyle="{ display: showTabBar ? 'block' : 'none' }"
9
+ >
10
+ <slot name="extraBeforeTabs"></slot>
11
+ <a-tab-pane
12
+ :forceRender="true"
13
+ v-for="(tab, index) in data"
14
+ :key="index"
15
+ :tab="tab.title"
16
+ >
17
+ <component
18
+ :is="resolveComponentType(tab.type)"
19
+ :key="`xTabPaneComp${index}`"
20
+ :ref="`tab_comp_${index}`"
21
+ v-bind="tab.props || {}"
22
+ />
23
+ </a-tab-pane>
24
+ </a-tabs>
25
+ </a-card>
26
+ </template>
27
+
28
+ <script setup>
29
+ import { ref, onMounted } from 'vue'
30
+ import { resolveComponentType } from '../componentTypes'
31
+
32
+ const props = defineProps({
33
+ // 标签页数据
34
+ data: {
35
+ type: Array,
36
+ required: true
37
+ },
38
+ // 是否显示标签栏
39
+ showTabBar: {
40
+ type: Boolean,
41
+ default: true
42
+ },
43
+ // 标签页切换时的回调函数
44
+ onChange: {
45
+ type: [String, Function],
46
+ default: null
47
+ },
48
+ // Tab间距
49
+ tabBarGutter: {
50
+ type: Number,
51
+ default: 10
52
+ },
53
+ // 卡片样式
54
+ bodyStyle: {
55
+ type: Object,
56
+ default: () => ({})
57
+ },
58
+ // 默认激活的标签页
59
+ defaultActiveKey: {
60
+ type: [String, Number],
61
+ default: 0
62
+ }
63
+ })
64
+
65
+ // 激活的标签页
66
+ const activeKey = ref(0)
67
+
68
+ // 切换标签页
69
+ const tabPaneChange = (newKey) => {
70
+ if (activeKey.value === newKey) return
71
+
72
+ const oldKey = activeKey.value
73
+ activeKey.value = newKey
74
+
75
+ // 触发标签页切换事件
76
+ if (props.onChange) {
77
+ try {
78
+ if (props.onChange instanceof Function) {
79
+ props.onChange(oldKey, newKey, props.data[oldKey], props.data[newKey])
80
+ } else {
81
+ // 创建一个安全的函数执行环境
82
+ // eslint-disable-next-line no-new-func
83
+ const onChange = new Function('oldKey', 'newKey', 'oldTab', 'newTab', `return (${props.onChange})(oldKey, newKey, oldTab, newTab)`)
84
+ onChange(oldKey, newKey, props.data[oldKey], props.data[newKey])
85
+ }
86
+ } catch (error) {
87
+ console.error('执行标签页切换回调错误:', error)
88
+ }
89
+ }
90
+ }
91
+
92
+ // 生命周期
93
+ onMounted(() => {
94
+ activeKey.value = props.defaultActiveKey
95
+ })
96
+ </script>
@@ -1,22 +1,22 @@
1
- // 支持的组件类型映射
2
- export const components = {
3
- XTab: () => import('@vue2-client/base-client/components/layout/XPageView/XTab'),
4
- XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable'),
5
- XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm'),
6
- XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
7
- XErrorView: () => import('@vue2-client/base-client/components/layout/XPageView/XErrorView'),
8
- // 全局组件不需要导入,直接返回null,让Vue使用全局注册的组件
9
- }
10
-
11
- // 组件类型解析函数
12
- export const resolveComponentType = (type) => {
13
- if (!type) return components.XErrorView
14
-
15
- // 如果是Ant Design Vue组件(以'a-'开头),直接返回原名称
16
- if (type.startsWith('a-')) {
17
- return type
18
- }
19
-
20
- // 否则从已注册的组件集合中查找
21
- return components[type] || components.XErrorView
22
- }
1
+ // 支持的组件类型映射
2
+ export const components = {
3
+ XTab: () => import('@vue2-client/base-client/components/layout/XPageView/XTab'),
4
+ XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable'),
5
+ XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm'),
6
+ XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
7
+ XErrorView: () => import('@vue2-client/base-client/components/layout/XPageView/XErrorView'),
8
+ // 全局组件不需要导入,直接返回null,让Vue使用全局注册的组件
9
+ }
10
+
11
+ // 组件类型解析函数
12
+ export const resolveComponentType = (type) => {
13
+ if (!type) return components.XErrorView
14
+
15
+ // 如果是Ant Design Vue组件(以'a-'开头),直接返回原名称
16
+ if (type.startsWith('a-')) {
17
+ return type
18
+ }
19
+
20
+ // 否则从已注册的组件集合中查找
21
+ return components[type] || components.XErrorView
22
+ }
package/src/main.js CHANGED
@@ -7,6 +7,8 @@ import { routerOptions, modules, i18n, message, bootstrap } from '../index'
7
7
  import findParentData from '@/plugins/FindParentsData'
8
8
  import { Modal } from 'ant-design-vue'
9
9
 
10
+ import VueDraggableResizable from 'vue-draggable-resizable'
11
+
10
12
  Vue.use(Router)
11
13
  Vue.use(Vuex)
12
14
  // Vue.use(eventLogPlugin)
@@ -16,13 +18,10 @@ Vue.use(findParentData)
16
18
  const store = new Vuex.Store({ modules })
17
19
  const router = new Router(routerOptions)
18
20
 
19
- // 绑定原型,用于amis
20
- Vue.$store = store
21
- Vue.$router = router
22
- Vue.$i18n = i18n
23
21
  Vue.config.devtools = true
24
22
  // 绑定原型
25
23
  Vue.Modal = Modal
24
+ Vue.component('VueDraggableResizable', VueDraggableResizable)
26
25
 
27
26
  bootstrap({ router, store, i18n, message }).then(() => {
28
27
  new Vue({
@@ -121,7 +121,8 @@ export default {
121
121
  },
122
122
  toDetail (record, id) {
123
123
  this.$refs.workFlow.init({
124
- workflowId: record.ab_f_workflow_id
124
+ workflowId: record.ab_f_workflow_id,
125
+ stepId: record.ws_f_step_id
125
126
  })
126
127
  },
127
128
  handleFormItemEvent (func, data, value) {
@@ -43,6 +43,8 @@
43
43
  :visible="visible"
44
44
  :taskName="details.f_task_name"
45
45
  :details="details"
46
+ :renderCurrentNode="renderCurrentNode"
47
+ :initStepId="initStepId"
46
48
  @refresh="stepChanged"
47
49
  @success="success"
48
50
  @nextClick="nextClick"
@@ -123,6 +125,7 @@ export default {
123
125
  LeaveMessage,
124
126
  XUploadFilesView
125
127
  },
128
+ props: {},
126
129
  data () {
127
130
  return {
128
131
  // 页面宽度
@@ -142,7 +145,10 @@ export default {
142
145
  messageList: [],
143
146
  messageLoading: true,
144
147
  workflowId: '',
145
- visible: false
148
+ initStepId: null,
149
+ visible: false,
150
+ // 控制流程是否可操作
151
+ renderCurrentNode: true
146
152
  }
147
153
  },
148
154
  expose: ['setFormValue'],
@@ -157,13 +163,13 @@ export default {
157
163
  this.steps !== undefined
158
164
  }
159
165
  },
160
- props: {},
161
166
  mounted () {
162
167
  // this.init()
163
168
  },
164
169
  methods: {
165
170
  // 内部组件更新了当前步骤后的回调
166
171
  stepChanged () {
172
+ this.initStepId = null
167
173
  this.loading = true
168
174
  this.reload()
169
175
  },
@@ -190,6 +196,7 @@ export default {
190
196
  this.fixedQueryForm = {}
191
197
  this.steps = undefined
192
198
  this.messageList = []
199
+ this.currStepId = null
193
200
  },
194
201
  // 获取基础信息
195
202
  getBaseInfo () {
@@ -198,7 +205,12 @@ export default {
198
205
  workflowId: this.workflowId
199
206
  })
200
207
  .then(res => {
201
- res.f_sub_state = this.steps.find(item => item.id === res.f_step_id)?.name
208
+ // 主动传入得优先级较高
209
+ if (this.currStepId) {
210
+ res.f_sub_state = this.steps.find(item => item.id === this.currStepId)?.name
211
+ } else {
212
+ res.f_sub_state = this.steps.find(item => item.id === res.f_step_id)?.name
213
+ }
202
214
  this.details = res
203
215
  }, err => {
204
216
  console.log(err)
@@ -220,9 +232,13 @@ export default {
220
232
  this.fixedAddForm.a_f_workflow_id = this.workflowId
221
233
  },
222
234
  // 初始化两张固定表
223
- async init ({ workflowId, visible = true }) {
235
+ async init ({ workflowId, stepId, renderCurrentNode = true, visible = true }) {
224
236
  this.workflowId = workflowId
237
+ if (stepId) {
238
+ this.initStepId = stepId
239
+ }
225
240
  this.visible = visible
241
+ this.renderCurrentNode = renderCurrentNode
226
242
  await this.reload()
227
243
  },
228
244
  // 切换标签页