vue2-client 1.8.11 → 1.8.13

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.
@@ -1,223 +1,67 @@
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',
42
- label: '树选择框',
43
- source: {
44
- method: 'post',
45
- url: '/api/af-system/logic/get_root_nodes'
46
- },
47
- // api: {
48
- // method: 'post',
49
- // url: '/api/af-system/logic/get_root_nodes'
50
- // }
51
- }
52
- ],
53
- id: 'u:b1d2075dc231',
54
- md: 1.5
55
- },
56
- {
57
- body: [
58
- {
59
- type: 'table-view',
60
- name: 'table-view1',
61
- api: '',
62
- trs: [
63
- {
64
- background: '#F7F7F7',
65
- tds: [
66
- {
67
- align: 'center',
68
- body: {
69
- type: 'tpl',
70
- tpl: '地区'
71
- }
72
- },
73
- {
74
- align: 'center',
75
- body: {
76
- type: 'tpl',
77
- tpl: '城市'
78
- }
79
- },
80
- {
81
- align: 'center',
82
- body: {
83
- type: 'tpl',
84
- tpl: '销量'
85
- }
86
- }
87
- ]
88
- },
89
- {
90
- tds: [
91
- {
92
- align: 'center',
93
- colspan: 2,
94
- rowspan: 2,
95
- body: {
96
- type: 'tpl',
97
- tpl: '${queryParams}'
98
- }
99
- },
100
- {
101
- body: {
102
- type: 'tpl',
103
- tpl: '北京'
104
- },
105
- }
106
- ]
107
- },
108
- {
109
- tds: [
110
- {
111
- body: {
112
- type: 'tpl',
113
- tpl: '上京'
114
- },
115
- }
116
- ]
117
- }
118
- ]
119
- },
120
- {
121
-
122
- },
123
- {
124
- type: 'table-view',
125
- trs: [
126
- {
127
- background: '#F7F7F7',
128
- tds: [
129
- {
130
- align: 'center',
131
- body: {
132
- type: 'tpl',
133
- tpl: '地区'
134
- }
135
- },
136
- {
137
- align: 'center',
138
- body: {
139
- type: 'tpl',
140
- tpl: '城市'
141
- }
142
- },
143
- {
144
- align: 'center',
145
- body: {
146
- type: 'tpl',
147
- tpl: '销量'
148
- }
149
- }
150
- ]
151
- },
152
- {
153
- tds: [
154
- {
155
- align: 'center',
156
- colspan: 3,
157
- body: {
158
- type: 'tpl',
159
- tpl: '北京'
160
- }
161
- },
162
-
163
- ]
164
- }
165
- ]
166
- },
167
- // {
168
- // name: 'username', // 如果要放在 form 中,需要设置 name,onChange 将会设置这个值
169
- // type: 'custom',
170
- // // onMount 将会在组件创建时执行,默认会创建一个空 div 标签,也可以设置 inline: true 来创建 span 标签
171
- // // dom 是 dom 节点,value 是初始数据,比如表单 name 初始拿到的数据,onChange 只有在表单下才会有
172
- // onMount: (dom, value, onChange) => {
173
- // const vm = new Vue({
174
- // router,
175
- // store,
176
- // i18n,
177
- // render: h => h(Index.XFormTable, {
178
- // props: {
179
- // queryParamsName: `crud_dictionary_manage`
180
- // }
181
- // })
182
- // })
183
- // vms.XFormTable = vm
184
- // dom.appendChild(vm.$mount().$el)
185
- // },
186
- // // onUpdate 将会在数据更新时被调用
187
- // // dom 是 dom 节点、data 将包含表单所有数据,prevData 是之前表单的所有数据
188
- // onUpdate: (dom, data, prevData) => {
189
- // console.log('数据有变化', data)
190
- // const vm = vms.XFormTable
191
- // vm.$children[0].active(data)
192
- // },
193
- // // onUnmount 将会在组件被销毁的时候调用,用于清理资源
194
- // onUnmount: () => {
195
- // console.log('组件被销毁')
196
- // },
197
- // }
198
- ],
199
- id: 'u:e4e49c147c06'
200
- }
201
- ],
202
- }
203
- ]
204
- }
205
-
206
- export default {
207
- name: 'AMisDemo',
208
- components: {
209
- 'amis-renderer': AMISRenderer,
210
- },
211
- computed: {
212
- },
213
- mounted () {
214
-
215
- },
216
- data: () => ({
217
- schema: schema,
218
- locals: { fixedQueryForm: {} },
219
- vms: {},
220
- queryParamsName: 'crud_dictionary_manage'
221
- }),
222
- }
223
- </script>
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
+
7
+ const schema = {
8
+ // 原生与自定义组件混用
9
+ type: 'page',
10
+ title: '页面主题',
11
+ body: [
12
+ {
13
+ // 自定义组件
14
+ type: 'XFormTable',
15
+ queryParamsName: 'crud_dictionary_manage'
16
+ }
17
+ ],
18
+ // 原生边栏组件
19
+ aside: [
20
+ {
21
+ type: 'panel',
22
+ title: '边栏',
23
+ body: [
24
+ {
25
+ type: 'input-tree',
26
+ label: '树选择框',
27
+ name: 'tree',
28
+ options: [
29
+ {
30
+ label: '选项A',
31
+ value: 'A',
32
+ children: [
33
+ {
34
+ label: '选项C',
35
+ value: 'C'
36
+ },
37
+ {
38
+ label: '选项D',
39
+ value: 'D'
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ label: '选项B',
45
+ value: 'B'
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ],
52
+ asideResizor: true,
53
+ asideSticky: false
54
+ }
55
+
56
+ export default {
57
+ name: 'AMisDemo',
58
+ components: {
59
+ 'amis-renderer': AMISRenderer,
60
+ },
61
+ computed: {},
62
+ data: () => ({
63
+ schema: schema,
64
+ locals: {},
65
+ }),
66
+ }
67
+ </script>
package/src/router.js CHANGED
@@ -1,15 +1,13 @@
1
- // 动态导入你的组件
2
- function loadView (view) {
3
- console.log('view', view)
4
- return () => import(/* webpackChunkName: "view-[request]" */ `@vue2-client/base-client/components/common/${view}`)
5
- }
6
-
7
- const routes = [
8
- // 对于每个路由,你都可以使用 'loadView' 方法动态加载对应的组件
9
- { path: '/Tree', component: loadView('Tree') },
10
- { path: '/XStepView', component: loadView('XStepView') },
11
- { path: '/Amis', component: () => import('@vue2-client/pages/AMisDemo/AMisDemo') },
12
- { path: '/Amis2', component: () => import('@vue2-client/pages/AMisDemo/AMisDemo2') },
13
- // ... 其他路由
14
- ]
15
- export default routes
1
+ // 动态导入你的组件
2
+ function loadView (view) {
3
+ console.log('view', view)
4
+ return () => import(/* webpackChunkName: "view-[request]" */ `@vue2-client/base-client/components/common/${view}`)
5
+ }
6
+
7
+ const routes = [
8
+ // 对于每个路由,你都可以使用 'loadView' 方法动态加载对应的组件
9
+ { path: '/Tree', component: loadView('Tree') },
10
+ { path: '/Amis', component: () => import('@vue2-client/pages/AMisDemo/AMisDemo') },
11
+ // ... 其他路由
12
+ ]
13
+ export default routes
@@ -22,9 +22,11 @@ const commonApi = {
22
22
  // 通用删除
23
23
  delete: 'logic/commonDelete',
24
24
  // 导入数据
25
- importData: 'logic/importData',
25
+ importData: 'crud/importDataByExcel',
26
26
  // 导出数据
27
27
  exportData: 'logic/commonExport',
28
+ // 导入模板下载
29
+ downloadImportTemplate: 'logic/commonDownloadImportTemplate',
28
30
  // 下载数据
29
31
  download: 'resource/download',
30
32
  // 通用上传
@@ -158,6 +160,13 @@ export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME
158
160
  return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
159
161
  }
160
162
 
163
+ /**
164
+ * 通用导入模板下载
165
+ */
166
+ export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
167
+ return post('/api/' + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
168
+ }
169
+
161
170
  // 通用下载
162
171
  export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
163
172
  const notificationKey = 'download'
@@ -1,24 +1,24 @@
1
- import { METHOD, request } from '@vue2-client/utils/request'
2
-
3
- /**
4
- * GET请求
5
- * @param url 请求地址
6
- * @param parameter 路径参数
7
- * @returns {Promise<AxiosResponse<T>>}
8
- */
9
- function get (url, parameter) {
10
- return request(url, METHOD.GET, parameter)
11
- }
12
-
13
- /**
14
- * POST请求
15
- * @param url 请求地址
16
- * @param parameter 请求参数
17
- * @param config
18
- * @returns {Promise<AxiosResponse<T>>}
19
- */
20
- function post (url, parameter, config = {}) {
21
- return request(url, METHOD.POST, parameter, config)
22
- }
23
-
24
- export { get, post }
1
+ import { METHOD, request } from '@vue2-client/utils/request'
2
+
3
+ /**
4
+ * GET请求
5
+ * @param url 请求地址
6
+ * @param parameter 路径参数
7
+ * @returns {Promise<AxiosResponse<T>>}
8
+ */
9
+ function get (url, parameter) {
10
+ return request(url, METHOD.GET, parameter)
11
+ }
12
+
13
+ /**
14
+ * POST请求
15
+ * @param url 请求地址
16
+ * @param parameter 请求参数
17
+ * @param config
18
+ * @returns {Promise<AxiosResponse<T>>}
19
+ */
20
+ function post (url, parameter, config = {}) {
21
+ return request(url, METHOD.POST, parameter, config)
22
+ }
23
+
24
+ export { get, post }
@@ -1,3 +0,0 @@
1
- import AMisRender from './index.vue'
2
-
3
- export default AMisRender
@@ -1,70 +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
-
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
- },
59
- mounted () {
60
-
61
- },
62
- data: () => ({
63
- schema: schema,
64
- locals: {},
65
- vms: {}
66
- }),
67
- methods: {
68
- }
69
- }
70
- </script>