vue2-client 1.5.10 → 1.5.12
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/CHANGELOG.md +4 -1
- package/package.json +1 -1
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +74 -9
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +43 -22
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +4 -4
- package/src/base-client/components/common/XForm/XForm.vue +1 -1
- package/src/base-client/components/common/XFormTable/XFormTable.vue +46 -37
- package/src/base-client/components/common/XTable/XTable.vue +4 -2
- package/src/base-client/plugins/AppData.js +1 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@close="onClose"
|
|
8
8
|
>
|
|
9
9
|
<a-row :gutter="24">
|
|
10
|
-
<a-col :lg="12" :md="12" :sm="24" :xl="
|
|
10
|
+
<a-col :lg="12" :md="12" :sm="24" :xl="18" :xs="24">
|
|
11
11
|
<a-form-model
|
|
12
12
|
ref="businessCreateForm"
|
|
13
13
|
:label-col="labelCol"
|
|
@@ -66,7 +66,33 @@
|
|
|
66
66
|
<a-input v-model="form.orderBy" placeholder="排序字段,用别名+字段名+排序方式(可选)表示,如:u.id desc"/>
|
|
67
67
|
</a-form-model-item>
|
|
68
68
|
<a-form-model-item label="数据字段" prop="column">
|
|
69
|
-
<a-
|
|
69
|
+
<a-space>
|
|
70
|
+
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
71
|
+
<a-button icon="import" @click="$message.warn('从创意库中选择并引用高质量的通用表单项配置,敬请期待')">从创意库引入</a-button>
|
|
72
|
+
</a-space>
|
|
73
|
+
<a-row :gutter="24">
|
|
74
|
+
<a-col :span="8">
|
|
75
|
+
<span style="font-weight: bold">
|
|
76
|
+
标签名
|
|
77
|
+
</span>
|
|
78
|
+
</a-col>
|
|
79
|
+
<a-col :span="7">
|
|
80
|
+
<span style="font-weight: bold">
|
|
81
|
+
字段名
|
|
82
|
+
</span>
|
|
83
|
+
</a-col>
|
|
84
|
+
<a-col :span="7">
|
|
85
|
+
<span style="font-weight: bold">
|
|
86
|
+
数据模式
|
|
87
|
+
</span>
|
|
88
|
+
</a-col>
|
|
89
|
+
<a-col :span="2">
|
|
90
|
+
<span style="font-weight: bold">
|
|
91
|
+
操作
|
|
92
|
+
</span>
|
|
93
|
+
</a-col>
|
|
94
|
+
</a-row>
|
|
95
|
+
<a-divider style="margin: 6px 0" />
|
|
70
96
|
<div
|
|
71
97
|
v-for="(columnItem, index) in form.column"
|
|
72
98
|
:key="index"
|
|
@@ -80,13 +106,52 @@
|
|
|
80
106
|
<span class="dragTips">拖到此处放置</span>
|
|
81
107
|
</a-row>
|
|
82
108
|
<a-row :gutter="24">
|
|
83
|
-
<a-col :span="
|
|
84
|
-
<span style="font-weight: bold">
|
|
109
|
+
<a-col :span="8">
|
|
110
|
+
<span style="font-weight: bold">
|
|
111
|
+
{{ columnItem.title }}
|
|
112
|
+
</span>
|
|
85
113
|
</a-col>
|
|
86
|
-
<a-col :span="
|
|
114
|
+
<a-col :span="7">
|
|
115
|
+
<span style="font-weight: bold">
|
|
116
|
+
{{ columnItem.key }}
|
|
117
|
+
</span>
|
|
118
|
+
</a-col>
|
|
119
|
+
<a-col :span="7">
|
|
120
|
+
<a-tooltip>
|
|
121
|
+
<template slot="title">
|
|
122
|
+
查询表单项
|
|
123
|
+
</template>
|
|
124
|
+
<a-tag :color="columnItem.dataModeArray.includes('queryForm') ? 'blue' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-search" /></a-tag>
|
|
125
|
+
</a-tooltip>
|
|
126
|
+
<a-tooltip>
|
|
127
|
+
<template slot="title">
|
|
128
|
+
表格列
|
|
129
|
+
</template>
|
|
130
|
+
<a-tag :color="columnItem.dataModeArray.includes('table') ? 'orange' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="table" /></a-tag>
|
|
131
|
+
</a-tooltip>
|
|
132
|
+
<a-tooltip>
|
|
133
|
+
<template slot="title">
|
|
134
|
+
新增/修改表单项
|
|
135
|
+
</template>
|
|
136
|
+
<a-tag :color="columnItem.dataModeArray.includes('addOrEditForm') ? 'green' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="form" /></a-tag>
|
|
137
|
+
</a-tooltip>
|
|
138
|
+
<a-tooltip>
|
|
139
|
+
<template slot="title">
|
|
140
|
+
SQL查询项
|
|
141
|
+
</template>
|
|
142
|
+
<a-tag :color="columnItem.dataModeArray.includes('sqlQueryItem') ? 'cyan' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="bars" /></a-tag>
|
|
143
|
+
</a-tooltip>
|
|
144
|
+
<a-tooltip>
|
|
145
|
+
<template slot="title">
|
|
146
|
+
SQL查询表达式
|
|
147
|
+
</template>
|
|
148
|
+
<a-tag :color="columnItem.dataModeArray.includes('sqlQueryCondition') ? 'purple' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="search" /></a-tag>
|
|
149
|
+
</a-tooltip>
|
|
150
|
+
</a-col>
|
|
151
|
+
<a-col :span="1">
|
|
87
152
|
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
|
88
153
|
</a-col>
|
|
89
|
-
<a-col :span="
|
|
154
|
+
<a-col :span="1">
|
|
90
155
|
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
|
91
156
|
</a-col>
|
|
92
157
|
</a-row>
|
|
@@ -127,7 +192,7 @@
|
|
|
127
192
|
<create-query-item ref="queryItem" @getColumn="getColumn" @itemHandle="itemHandle"/>
|
|
128
193
|
<a-button type="primary" @click="view">操作</a-button>
|
|
129
194
|
</a-col>
|
|
130
|
-
<a-col :lg="12" :md="12" :sm="24" :xl="
|
|
195
|
+
<a-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
|
|
131
196
|
<a-card :bordered="false" size="small" style="overflow: auto" title="预览">
|
|
132
197
|
<json-viewer
|
|
133
198
|
:copyable="{copyText: '复制', copiedText: '已复制'}"
|
|
@@ -193,8 +258,8 @@ export default {
|
|
|
193
258
|
],
|
|
194
259
|
// 操作按钮状态集合值
|
|
195
260
|
buttonStateData: ['add', 'edit', 'delete', 'import', 'export'],
|
|
196
|
-
labelCol: { span:
|
|
197
|
-
wrapperCol: { span:
|
|
261
|
+
labelCol: { span: 3 },
|
|
262
|
+
wrapperCol: { span: 18 },
|
|
198
263
|
form: {
|
|
199
264
|
serviceName: '',
|
|
200
265
|
tableName: '',
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@close="onClose"
|
|
8
8
|
>
|
|
9
9
|
<a-row :gutter="24">
|
|
10
|
-
<a-col :lg="12" :md="12" :sm="24" :xl="
|
|
10
|
+
<a-col :lg="12" :md="12" :sm="24" :xl="18" :xs="24">
|
|
11
11
|
<a-form-model
|
|
12
12
|
ref="businessCreateForm"
|
|
13
13
|
:label-col="labelCol"
|
|
@@ -23,6 +23,24 @@
|
|
|
23
23
|
</a-form-model-item>
|
|
24
24
|
<a-form-model-item label="数据字段" prop="column">
|
|
25
25
|
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
26
|
+
<a-row :gutter="24">
|
|
27
|
+
<a-col :span="11">
|
|
28
|
+
<span style="font-weight: bold">
|
|
29
|
+
标签名
|
|
30
|
+
</span>
|
|
31
|
+
</a-col>
|
|
32
|
+
<a-col :span="11">
|
|
33
|
+
<span style="font-weight: bold">
|
|
34
|
+
字段名
|
|
35
|
+
</span>
|
|
36
|
+
</a-col>
|
|
37
|
+
<a-col :span="2">
|
|
38
|
+
<span style="font-weight: bold">
|
|
39
|
+
操作
|
|
40
|
+
</span>
|
|
41
|
+
</a-col>
|
|
42
|
+
</a-row>
|
|
43
|
+
<a-divider style="margin: 6px 0" />
|
|
26
44
|
<div
|
|
27
45
|
v-for="(columnItem, index) in form.column"
|
|
28
46
|
:key="index"
|
|
@@ -36,13 +54,20 @@
|
|
|
36
54
|
<span class="dragTips">拖到此处放置</span>
|
|
37
55
|
</a-row>
|
|
38
56
|
<a-row :gutter="24">
|
|
39
|
-
<a-col :span="
|
|
40
|
-
<span style="font-weight: bold">
|
|
57
|
+
<a-col :span="11">
|
|
58
|
+
<span style="font-weight: bold">
|
|
59
|
+
{{ columnItem.title }}
|
|
60
|
+
</span>
|
|
41
61
|
</a-col>
|
|
42
|
-
<a-col :span="
|
|
62
|
+
<a-col :span="11">
|
|
63
|
+
<span style="font-weight: bold">
|
|
64
|
+
{{ columnItem.key }}
|
|
65
|
+
</span>
|
|
66
|
+
</a-col>
|
|
67
|
+
<a-col :span="1">
|
|
43
68
|
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
|
44
69
|
</a-col>
|
|
45
|
-
<a-col :span="
|
|
70
|
+
<a-col :span="1">
|
|
46
71
|
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
|
47
72
|
</a-col>
|
|
48
73
|
</a-row>
|
|
@@ -80,7 +105,7 @@
|
|
|
80
105
|
<create-simple-form-query-item ref="queryItem" @getColumn="getColumn" @itemHandle="itemHandle"/>
|
|
81
106
|
<a-button type="primary" @click="view">操作</a-button>
|
|
82
107
|
</a-col>
|
|
83
|
-
<a-col :lg="12" :md="12" :sm="24" :xl="
|
|
108
|
+
<a-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
|
|
84
109
|
<a-card :bordered="false" size="small" style="overflow: auto" title="预览">
|
|
85
110
|
<json-viewer
|
|
86
111
|
:copyable="{copyText: '复制', copiedText: '已复制'}"
|
|
@@ -91,10 +116,7 @@
|
|
|
91
116
|
</a-col>
|
|
92
117
|
</a-row>
|
|
93
118
|
<x-add-form
|
|
94
|
-
|
|
95
|
-
business-type="新增"
|
|
96
|
-
:visible.sync="modelVisible"
|
|
97
|
-
:json-data="formItems"
|
|
119
|
+
ref="xAddForm"
|
|
98
120
|
@onSubmit="submit"/>
|
|
99
121
|
</a-drawer>
|
|
100
122
|
</template>
|
|
@@ -118,12 +140,10 @@ export default {
|
|
|
118
140
|
return {
|
|
119
141
|
// 页面宽度
|
|
120
142
|
screenWidth: document.documentElement.clientWidth,
|
|
121
|
-
// 效果预览模态框是否展示
|
|
122
|
-
modelVisible: false,
|
|
123
143
|
// 数据列操作类型:新增,修改
|
|
124
144
|
type: '新增',
|
|
125
|
-
labelCol: { span:
|
|
126
|
-
wrapperCol: { span:
|
|
145
|
+
labelCol: { span: 3 },
|
|
146
|
+
wrapperCol: { span: 18 },
|
|
127
147
|
form: {
|
|
128
148
|
group: '',
|
|
129
149
|
describe: '',
|
|
@@ -152,8 +172,7 @@ export default {
|
|
|
152
172
|
{ label: '获取行信息后插槽', value: 'editQueryAfter' },
|
|
153
173
|
{ label: '新增/修改保存前插槽', value: 'addOrEditSaveBefore' },
|
|
154
174
|
{ label: '新增/修改保存后插槽', value: 'addOrEditSaveAfter' },
|
|
155
|
-
]
|
|
156
|
-
formItems: []
|
|
175
|
+
]
|
|
157
176
|
}
|
|
158
177
|
},
|
|
159
178
|
mounted () {
|
|
@@ -266,9 +285,6 @@ export default {
|
|
|
266
285
|
onClose () {
|
|
267
286
|
this.$emit('update:visible', false)
|
|
268
287
|
},
|
|
269
|
-
onModelClose () {
|
|
270
|
-
this.modelVisible = false
|
|
271
|
-
},
|
|
272
288
|
addJoinItem () {
|
|
273
289
|
},
|
|
274
290
|
removeJoinItem (index) {
|
|
@@ -358,15 +374,20 @@ export default {
|
|
|
358
374
|
if (valid) {
|
|
359
375
|
this.viewHandle(() => {
|
|
360
376
|
post(commonApi.getColumnsJson, { queryObject: this.result }).then(res => {
|
|
361
|
-
this.
|
|
362
|
-
|
|
377
|
+
this.$refs.xAddForm.init({
|
|
378
|
+
formItems: res.formJson,
|
|
379
|
+
serviceName: res.serviceName
|
|
380
|
+
})
|
|
381
|
+
this.$refs.xAddForm.open({
|
|
382
|
+
businessType: '新增',
|
|
383
|
+
title: '效果预览'
|
|
384
|
+
})
|
|
363
385
|
})
|
|
364
386
|
})
|
|
365
387
|
}
|
|
366
388
|
})
|
|
367
389
|
},
|
|
368
390
|
submit () {
|
|
369
|
-
this.onModelClose()
|
|
370
391
|
this.$refs.businessCreateForm.validate(valid => {
|
|
371
392
|
if (valid) {
|
|
372
393
|
this.viewHandle(() => {
|
|
@@ -83,14 +83,14 @@ export default {
|
|
|
83
83
|
post(commonApi.getColumnsJson, { queryObject: item }).then(res => {
|
|
84
84
|
this.formObj = res
|
|
85
85
|
this.$refs.xAddForm.init({
|
|
86
|
-
formItems:
|
|
87
|
-
serviceName:
|
|
86
|
+
formItems: res.formJson,
|
|
87
|
+
serviceName: res.serviceName
|
|
88
88
|
})
|
|
89
|
-
const modifyModelData = { data: this.modifyModelData[
|
|
89
|
+
const modifyModelData = { data: this.modifyModelData[res.groupName] }
|
|
90
90
|
this.$refs.xAddForm.open({
|
|
91
91
|
businessType: '修改',
|
|
92
92
|
modifyModelData: modifyModelData,
|
|
93
|
-
title:
|
|
93
|
+
title: '参数项'
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
96
|
},
|
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
3
|
+
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
|
+
<div v-show="!loading">
|
|
5
|
+
<x-add-form
|
|
6
|
+
ref="xAddForm"
|
|
7
|
+
@onSubmit="onAddOrEditSubmit"
|
|
8
|
+
/>
|
|
9
|
+
<x-form
|
|
10
|
+
ref="xForm"
|
|
11
|
+
style="margin-bottom: 14px;"
|
|
12
|
+
@onSubmit="onSearchSubmit">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</x-form>
|
|
15
|
+
<x-table
|
|
16
|
+
ref="xTable"
|
|
17
|
+
:fixedQueryForm="fixedQueryForm"
|
|
18
|
+
:queryParamsName="queryParamsName"
|
|
19
|
+
:query-params-json="queryParamsJson"
|
|
20
|
+
:show-pagination="showPagination"
|
|
21
|
+
@add="add"
|
|
22
|
+
@edit="edit"
|
|
23
|
+
@afterDelete="afterDelete"
|
|
24
|
+
@action="action"
|
|
25
|
+
@selectRow="selectRow"
|
|
26
|
+
@afterQuery="afterQuery"
|
|
27
|
+
@tempTableEdit="tempTableEdit">
|
|
28
|
+
<template slot="button">
|
|
29
|
+
<slot name="button"></slot>
|
|
30
|
+
</template>
|
|
31
|
+
<template slot="rightBtnExpand">
|
|
32
|
+
<slot name="rightBtnExpand"></slot>
|
|
33
|
+
<a-button @click="toggleIsFormShow">
|
|
34
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
35
|
+
</a-button>
|
|
36
|
+
</template>
|
|
37
|
+
<!-- 底部插槽 -->
|
|
38
|
+
<template slot="footer">
|
|
39
|
+
<slot name="footer"></slot>
|
|
40
|
+
</template>
|
|
41
|
+
</x-table>
|
|
42
|
+
</div>
|
|
40
43
|
</div>
|
|
41
44
|
</template>
|
|
42
45
|
<script>
|
|
@@ -59,6 +62,8 @@ export default {
|
|
|
59
62
|
},
|
|
60
63
|
data () {
|
|
61
64
|
return {
|
|
65
|
+
// 加载状态
|
|
66
|
+
loading: false,
|
|
62
67
|
// 图标样式
|
|
63
68
|
iconStyle: {
|
|
64
69
|
position: 'relative',
|
|
@@ -156,16 +161,19 @@ export default {
|
|
|
156
161
|
},
|
|
157
162
|
methods: {
|
|
158
163
|
getColumnsJson () {
|
|
164
|
+
this.loading = true
|
|
159
165
|
indexedDB.getByWeb(this.queryParamsName, commonApi.getColumnsJson, { str: this.queryParamsName }, (res) => {
|
|
160
166
|
this.updateComponents(res)
|
|
161
167
|
})
|
|
162
168
|
},
|
|
163
169
|
getColumnsJsonBySource () {
|
|
170
|
+
this.loading = true
|
|
164
171
|
post(commonApi.getColumnsJson, { queryObject: this.queryParamsJson }).then(res => {
|
|
165
172
|
this.updateComponents(res, true)
|
|
166
173
|
})
|
|
167
174
|
},
|
|
168
175
|
getColumnJsonByLogic () {
|
|
176
|
+
this.loading = true
|
|
169
177
|
indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, commonApi.getColumnsJson, { logic: this.logicName, logicParam: this.logicParam }, (res) => {
|
|
170
178
|
this.updateComponents(res, true)
|
|
171
179
|
})
|
|
@@ -196,6 +204,7 @@ export default {
|
|
|
196
204
|
isTableTemp: this.isTableTemp,
|
|
197
205
|
serviceName: res.serviceName
|
|
198
206
|
})
|
|
207
|
+
this.loading = false
|
|
199
208
|
},
|
|
200
209
|
/**
|
|
201
210
|
* 提交查询表单事件
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div v-show="tableColumns.length > 0">
|
|
3
3
|
<a-row :gutter="48">
|
|
4
4
|
<a-col>
|
|
5
5
|
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
</a-dropdown>
|
|
33
33
|
<slot :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows" name="button"></slot>
|
|
34
34
|
</a-space>
|
|
35
|
-
<slot name="expand"></slot>
|
|
36
35
|
</span>
|
|
37
36
|
</a-col>
|
|
38
37
|
<a-col>
|
|
@@ -230,6 +229,9 @@ export default {
|
|
|
230
229
|
} = params
|
|
231
230
|
this.queryParams = queryParams
|
|
232
231
|
this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
|
|
232
|
+
if (this.tableColumns.length === 0) {
|
|
233
|
+
return
|
|
234
|
+
}
|
|
233
235
|
this.buttonState = buttonState
|
|
234
236
|
this.title = title
|
|
235
237
|
this.serviceName = serviceName
|
|
@@ -31,10 +31,7 @@ const GetAppDataService = {
|
|
|
31
31
|
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
32
32
|
})
|
|
33
33
|
// 获取省市区数据
|
|
34
|
-
|
|
35
|
-
// 追加参数
|
|
36
|
-
localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
|
|
37
|
-
})
|
|
34
|
+
localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify([]))
|
|
38
35
|
},
|
|
39
36
|
// 返回树形省市区
|
|
40
37
|
getDivisionsOhChinaForTree () {
|