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,263 +0,0 @@
1
- <template><div ref="domRef">Loading...</div></template>
2
-
3
- <script>
4
- // // import 'amis/sdk/sdk.js'
5
- // // import 'amis/sdk/sdk.css'
6
- // // import 'amis/sdk/iconfont.css'
7
- //
8
- // // 可以不引用, 如果你不想要任何辅助类样式的话 (比如 `m-t-xs` 这种)
9
- // // https://aisuda.bce.baidu.com/amis/zh-CN/style/index
10
- // // import 'amis/sdk/helper.css'
11
- // import qs from 'qs'
12
- // import Vue from 'vue'
13
- // import Index from '@vue2-client/base-client/components/index.js'
14
- // import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
15
- //
16
- // let React
17
- // let amisLib
18
- // let scoped
19
- // const apps = {}
20
- // function loadScript (src, callback) {
21
- // const script = document.createElement('script')
22
- // script.setAttribute('type', 'text/javascript')
23
- // script.setAttribute('src', src)
24
- // script.onload = () => callback()
25
- // script.onerror = () => callback(new Error(`Failed to load ${src}`))
26
- // document.body.appendChild(script)
27
- // }
28
- // const vueList = {}
29
- //
30
- // // eslint-disable-next-line no-unused-vars
31
- // function CustomComponent (props, dom) {
32
- // const store = Vue.$store
33
- // const router = Vue.$router
34
- // const i18n = Vue.$i18n
35
- // console.log('props', props)
36
- // React.useEffect(function () {
37
- // vueList[props.$schema.name] = new Vue({
38
- // router,
39
- // store,
40
- // i18n,
41
- // render: h => h(Index[props.$schema.type], {
42
- // props: props.$schema
43
- // })
44
- // }).$mount(dom.current)
45
- // }, [])
46
- // const app = React.createElement('div', {
47
- // ref: dom
48
- // })
49
- // if (apps[props.name] !== undefined) {
50
- // const vue = vueList[props.$schema.name]
51
- // vue.$children[0].active(props.data)
52
- // } else {
53
- // apps[props.name] = app
54
- // }
55
- // return app
56
- // }
57
- //
58
- // function loadStyles (styles) {
59
- // for (const path of styles) {
60
- // const style = document.createElement('link')
61
- // style.setAttribute('rel', 'stylesheet')
62
- // style.setAttribute('type', 'text/css')
63
- // style.setAttribute('href', path)
64
- // document.head.appendChild(style)
65
- // }
66
- // }
67
- // // eslint-disable-next-line no-unused-vars
68
- // function appstyle (data) {
69
- // console.log('111111111111')
70
- // }
71
- // // 动态导入组件
72
- //
73
- // function loadSDK () {
74
- // return new Promise((resolve, reject) => {
75
- // if (window.amisRequire) {
76
- // resolve()
77
- // return
78
- // }
79
- // loadStyles([
80
- // '/amis/sdk/sdk.css',
81
- // '/amis/sdk/helper.css',
82
- // '/amis/sdk/iconfont.css',
83
- // ])
84
- // loadScript('/amis/sdk/sdk.js', (err) => {
85
- // if (err) {
86
- // reject(err)
87
- // return
88
- // }
89
- // resolve()
90
- // })
91
- // })
92
- // }
93
- //
94
- // export default {
95
- // name: 'AMISRenderer',
96
- // components: {},
97
- // props: {
98
- // schema: {
99
- // type: Object,
100
- // default: {
101
- // type: 'page',
102
- // body: 'Hello World!',
103
- // },
104
- // },
105
- // locals: {
106
- // type: Object,
107
- // default: () => ({}),
108
- // },
109
- // props: {
110
- // type: Object,
111
- // default: () => ({}),
112
- // },
113
- // env: {
114
- // type: Object,
115
- // default: () => ({}),
116
- // },
117
- // },
118
- // data () {
119
- // const router = this.$router
120
- // return {
121
- // // 这里面的数据所有 amis 页面都可以获取到
122
- // // 可以用来放一下公共数据,比如用户信息等
123
- // // 不要放受控数据,受控数据应该通过 data 下发
124
- // context: {
125
- // siteName: 'AMIS DEMO',
126
- // },
127
- // get location () {
128
- // const current = router.history.current
129
- // return {
130
- // pathname: current.path,
131
- // hash: current.hash,
132
- // query: current.query,
133
- // search: `?${qs.stringify(current.query)}`,
134
- // }
135
- // },
136
- // loading: false,
137
- // amisInstance: null,
138
- // unmounted: false,
139
- // applist: {}
140
- // }
141
- // },
142
- //
143
- // watch: {
144
- // locals: function () {
145
- // this.updateProps()
146
- // },
147
- // props: function () {
148
- // this.updateProps()
149
- // },
150
- // $route: function () {
151
- // this.updateProps()
152
- // },
153
- // },
154
- // async mounted () {
155
- // try {
156
- // this.loading = true
157
- // await loadSDK()
158
- // } finally {
159
- // this.loading = false
160
- // }
161
- // if (this.unmounted) {
162
- // return
163
- // }
164
- // React = window.amisRequire('react')
165
- // amisLib = window.amisRequire('amis')
166
- // scoped = window.amisRequire('amis/embed')
167
- // const { normalizeLink } = amisLib
168
- // const router = this.$router
169
- // // eslint-disable-next-line no-prototype-builtins
170
- // // console.log('this.schema.type', this.schema.type)
171
- //
172
- // amisLib.Renderer({
173
- // test: new RegExp(`(^|\/)${this.schema.type}`)
174
- // })(props => CustomComponent(props, this.$el))
175
- //
176
- // const instance = scoped.embed(
177
- // this.$el,
178
- // this.schema,
179
- // {
180
- // data: {
181
- // ...this.locals,
182
- // },
183
- // context: this.context,
184
- // location: this.location,
185
- //
186
- // // todo 下发 location 对象
187
- // ...this.props,
188
- // },
189
- // {
190
- // requestAdaptor (api) {
191
- // api.headers.Authorization = localStorage.getItem(ACCESS_TOKEN)
192
- // return api
193
- // },
194
- // // 覆盖 amis env
195
- // // 参考 https://aisuda.bce.baidu.com/amis/zh-CN/docs/start/getting-started#sdk
196
- // jumpTo: (to, action) => {
197
- // if (to === 'goBack') {
198
- // return router.go(-1)
199
- // }
200
- //
201
- // to = normalizeLink(to, this.location)
202
- //
203
- // if (action?.actionType === 'url') {
204
- // action.blank === false ? router.push(to) : window.open(to)
205
- // return
206
- // }
207
- //
208
- // // 主要是支持 nav 中的跳转
209
- // if (action && to && action.target) {
210
- // window.open(to, action.target)
211
- // return
212
- // }
213
- //
214
- // if (/^https?:\/\//.test(to)) {
215
- // window.location.replace(to)
216
- // } else {
217
- // router.push(to)
218
- // }
219
- // },
220
- //
221
- // updateLocation: (location, replace) => {
222
- // if (location === 'goBack') {
223
- // return router.go(-1)
224
- // }
225
- //
226
- // location = normalizeLink(location, this.location)
227
- // replace ? router.replace(location) : router.replace(location)
228
- // },
229
- //
230
- // ...this.env,
231
- // },
232
- // () => {
233
- // this.$emit('ready', {
234
- // instance,
235
- // })
236
- // }
237
- // )
238
- // this.amisInstance = instance
239
- // },
240
- //
241
- // methods: {
242
- // updateProps () {
243
- // // eslint-disable-next-line no-unused-expressions
244
- // this.amisInstance?.updateProps({
245
- // data: {
246
- // ...this.locals,
247
- // },
248
- // context: this.context,
249
- // ...this.props,
250
- // })
251
- // },
252
- // initConfig () {
253
- // console.warn('initConfig')
254
- // }
255
- // },
256
- //
257
- // destroyed () {
258
- // this.unmounted = true
259
- // // eslint-disable-next-line no-unused-expressions
260
- // this.amisInstance?.unmount()
261
- // },
262
- // }
263
- </script>
@@ -1,325 +0,0 @@
1
- <template>
2
- <amis-renderer :schema="schema" :locals="locals" />
3
- </template>
4
- <script>
5
- import AMISRenderer from '@vue2-client/base-client/components/common/AMisRender'
6
- import Vue from 'vue'
7
- import Index from '@vue2-client/base-client/components/index.js'
8
-
9
- const vms = {}
10
- const store = Vue.$store
11
- const router = Vue.$router
12
- const i18n = Vue.$i18n
13
-
14
- // const schema = {
15
- // // 原生与自定义组件混用
16
- // type: 'page',
17
- // css: {
18
- // },
19
- // body: [
20
- // // {
21
- // // type: 'grid',
22
- // // columns: [
23
- // // {
24
- // // mode: 'horizontal',
25
- // // body: {
26
- // // name: 'queryParams',
27
- // // type: 'input-text',
28
- // // label: '查询值'
29
- // // },
30
- // // md: 4
31
- // // }
32
- // // ]
33
- // // },
34
- // {
35
- // type: 'grid',
36
- // columns: [
37
- // {
38
- // body: [
39
- // {
40
- // type: 'input-tree',
41
- // name: 'test_tree',
42
- // label: '树选择框',
43
- // options: [
44
- // {
45
- // label: '查询配置',
46
- // children: [
47
- // {
48
- // label: '字典管理',
49
- // value: 'crud_dictionary_manage'
50
- // },
51
- // {
52
- // label: '操作日志',
53
- // value: 'crud_oper_log_manage'
54
- // }
55
- // ]
56
- // }
57
- // ]
58
- // // source: {
59
- // // method: 'post',
60
- // // url: '/api/af-system/logic/get_root_nodes'
61
- // // },
62
- // }
63
- // ],
64
- // id: 'u:b1d2075dc231',
65
- // md: 1.5
66
- // },
67
- // {
68
- // body: [
69
- // // {
70
- // // type: 'table-view',
71
- // // name: 'table-view1',
72
- // // api: '',
73
- // // trs: [
74
- // // {
75
- // // background: '#F7F7F7',
76
- // // tds: [
77
- // // {
78
- // // align: 'center',
79
- // // body: {
80
- // // type: 'tpl',
81
- // // tpl: '地区'
82
- // // }
83
- // // },
84
- // // {
85
- // // align: 'center',
86
- // // body: {
87
- // // type: 'tpl',
88
- // // tpl: '城市'
89
- // // }
90
- // // },
91
- // // {
92
- // // align: 'center',
93
- // // body: {
94
- // // type: 'tpl',
95
- // // tpl: '销量'
96
- // // }
97
- // // }
98
- // // ]
99
- // // },
100
- // // {
101
- // // tds: [
102
- // // {
103
- // // align: 'center',
104
- // // colspan: 2,
105
- // // rowspan: 2,
106
- // // body: {
107
- // // type: 'tpl',
108
- // // tpl: '${queryParams}'
109
- // // }
110
- // // },
111
- // // {
112
- // // body: {
113
- // // type: 'tpl',
114
- // // tpl: '北京'
115
- // // },
116
- // // }
117
- // // ]
118
- // // },
119
- // // {
120
- // // tds: [
121
- // // {
122
- // // body: {
123
- // // type: 'tpl',
124
- // // tpl: '上京'
125
- // // },
126
- // // }
127
- // // ]
128
- // // }
129
- // // ]
130
- // // },
131
- // // {
132
- // //
133
- // // },
134
- // // {
135
- // // type: 'table-view',
136
- // // trs: [
137
- // // {
138
- // // background: '#F7F7F7',
139
- // // tds: [
140
- // // {
141
- // // align: 'center',
142
- // // body: {
143
- // // type: 'tpl',
144
- // // tpl: '地区'
145
- // // }
146
- // // },
147
- // // {
148
- // // align: 'center',
149
- // // body: {
150
- // // type: 'tpl',
151
- // // tpl: '城市'
152
- // // }
153
- // // },
154
- // // {
155
- // // align: 'center',
156
- // // body: {
157
- // // type: 'tpl',
158
- // // tpl: '销量'
159
- // // }
160
- // // }
161
- // // ]
162
- // // },
163
- // // {
164
- // // tds: [
165
- // // {
166
- // // align: 'center',
167
- // // colspan: 3,
168
- // // body: {
169
- // // type: 'tpl',
170
- // // tpl: '北京'
171
- // // }
172
- // // },
173
- // //
174
- // // ]
175
- // // }
176
- // // ]
177
- // // },
178
- // {
179
- // name: 'xTable', // 如果要放在 form 中,需要设置 name,onChange 将会设置这个值
180
- // type: 'custom',
181
- // // onMount 将会在组件创建时执行,默认会创建一个空 div 标签,也可以设置 inline: true 来创建 span 标签
182
- // // dom 是 dom 节点,value 是初始数据,比如表单 name 初始拿到的数据,onChange 只有在表单下才会有
183
- // onMount: (dom, value, onChange) => {
184
- // const vm = new Vue({
185
- // router,
186
- // store,
187
- // i18n,
188
- // render: h => h(Index.XFormTable, {
189
- // props: {
190
- // queryParamsName: `crud_dictionary_manage`
191
- // }
192
- // })
193
- // })
194
- // vms.XFormTable = vm
195
- // dom.appendChild(vm.$mount().$el)
196
- // },
197
- // // onUpdate 将会在数据更新时被调用
198
- // // dom 是 dom 节点、data 将包含表单所有数据,prevData 是之前表单的所有数据
199
- // onUpdate: (dom, data, prevData) => {
200
- // console.log('数据有变化', data)
201
- // const vm = vms.XFormTable
202
- // vm.$children[0].active(data)
203
- // },
204
- // // onUnmount 将会在组件被销毁的时候调用,用于清理资源
205
- // onUnmount: () => {
206
- // console.log('组件被销毁')
207
- // },
208
- // },
209
- // ],
210
- // id: 'u:e4e49c147c06'
211
- // }
212
- // ],
213
- // }
214
- // ]
215
- // }
216
-
217
- const schema2 = {
218
- // 原生与自定义组件混用
219
- type: 'page',
220
- css: {
221
- },
222
- body: [
223
- {
224
- type: 'grid',
225
- columns: [
226
- {
227
- md: 3,
228
- body: [
229
- {
230
- type: 'input-tree',
231
- name: 'test_tree2',
232
- label: '树选择框',
233
- options: [
234
- {
235
- label: '查询配置',
236
- icon: 'fa fa-cogs',
237
- children: [
238
- {
239
- label: '字典管理',
240
- value: 'crud_dictionary_manage',
241
- icon: 'fa fa-cog'
242
- },
243
- {
244
- label: '字典值管理',
245
- value: 'crud_dictionary_value_manage',
246
- icon: 'fa fa-cog'
247
- }
248
- ]
249
- }
250
- ],
251
- value: 'crud_dictionary_manage'
252
- }
253
- ]
254
- },
255
- {
256
- md: 9,
257
- body: [
258
- {
259
- name: 'xTable',
260
- type: 'custom',
261
- onMount: (dom, value, onChange, props) => {
262
- console.warn('value', value)
263
- console.warn('props', props)
264
- const vm = new Vue({
265
- router,
266
- store,
267
- i18n,
268
- data: {
269
- queryParamsNameFather: 'crud_dictionary_manage'
270
- },
271
- render: function (createElement) {
272
- return createElement(
273
- 'div',
274
- [
275
- createElement(Index.XFormTable, {
276
- props: {
277
- queryParamsName: this.queryParamsNameFather
278
- },
279
- on: {
280
- action: function (record, id, actionType) {
281
- console.warn('action触发', record, id, actionType)
282
- }
283
- }
284
- })
285
- ]
286
- )
287
- }
288
- })
289
- vms.XFormTable = vm
290
- dom.appendChild(vm.$mount().$el)
291
- },
292
- onUpdate: (dom, data, prevData, props) => {
293
- console.warn('AAA', vms)
294
- Vue.set(vms.XFormTable, 'queryParamsNameFather', data.test_tree2)
295
- },
296
- onUnmount: () => {
297
- console.log('组件被销毁')
298
- },
299
- },
300
- ]
301
- }
302
- ],
303
- }
304
- ]
305
- }
306
-
307
- export default {
308
- name: 'AMisDemo',
309
- components: {
310
- 'amis-renderer': AMISRenderer,
311
- },
312
- computed: {
313
- },
314
- mounted () {
315
-
316
- },
317
- data: () => ({
318
- outerVue: this,
319
- schema: schema2,
320
- locals: { fixedQueryForm: {} },
321
- vms: {},
322
- queryParamsName: 'crud_dictionary_manage'
323
- }),
324
- }
325
- </script>
@@ -1,74 +0,0 @@
1
- <template>
2
- <amis-renderer :schema="schemaJson" :locals="locals" />
3
- </template>
4
- <script>
5
- import AMISRenderer from '@vue2-client/base-client/components/common/AMisRender'
6
-
7
- const schema = {
8
- // 原生与自定义组件混用
9
- type: 'page',
10
- data: {
11
- queryParamsName: 'crud_dictionary_manage',
12
- fixedQueryForm: '{}'
13
- },
14
- body: [
15
- {
16
- type: 'tabs',
17
- tabsMode: 'chrome',
18
- name: 'fixedQueryForm',
19
- id: 'username',
20
- tabs: [
21
- {
22
- title: '测试1',
23
- value: '{"d_f_name":"设备异常处理方式"}',
24
- body: {
25
- name: 'username',
26
- id: 'XFormTable1',
27
- type: 'XFormTable',
28
- }
29
- },
30
- {
31
- title: '选项卡3',
32
- value: '{"d_f_name":"二级用气性质"}',
33
- body: {
34
- name: 'username2',
35
- id: 'XFormTable2',
36
- type: 'XFormTable',
37
- }
38
- },
39
- ],
40
- },
41
- ]
42
- }
43
-
44
- export default {
45
- name: 'AMisDemo',
46
- components: {
47
- 'amis-renderer': AMISRenderer,
48
- },
49
- computed: {
50
- },
51
- props: {
52
- queryParamsName: {
53
- type: String,
54
- default: () => {
55
- return 'crud_dictionary_manage'
56
- }
57
- },
58
- schemaJson: {
59
- type: Object,
60
- default: () => {
61
- return schema
62
- }
63
- }
64
- },
65
- mounted () {
66
- },
67
- data: () => ({
68
- locals: {},
69
- vms: {},
70
- }),
71
- methods: {
72
- }
73
- }
74
- </script>