vue2-client 1.8.32 → 1.8.33
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/.env +1 -0
- package/.eslintrc.js +22 -14
- package/CHANGELOG.md +55 -0
- package/babel.config.js +8 -2
- package/docs/index.md +2 -1
- package/index.js +1 -1
- package/jest-transform-stub.js +8 -0
- package/jest.config.js +20 -2
- package/jest.setup.js +7 -0
- package/package.json +36 -27
- package/src/App.vue +33 -7
- package/src/base-client/components/common/AMisRender/index.js +3 -0
- package/src/base-client/components/common/AMisRender/index.vue +257 -0
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +2 -2
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +3 -3
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +32 -37
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +80 -12
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +53 -70
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +5 -5
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +19 -18
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +4 -8
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +4 -6
- package/src/base-client/components/common/Tree/Tree.vue +149 -0
- package/src/base-client/components/common/Tree/index.js +2 -0
- package/src/base-client/components/common/Upload/Upload.vue +1 -1
- package/src/base-client/components/common/XAddForm/XAddForm.vue +21 -5
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +88 -53
- package/src/base-client/components/common/XCard/XCard.vue +1 -1
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +2 -2
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +117 -0
- package/src/base-client/components/common/XDescriptions/index.js +3 -0
- package/src/base-client/components/common/XDescriptions/index.md +83 -0
- package/src/base-client/components/common/XForm/XForm.vue +2 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +49 -24
- package/src/base-client/components/common/XFormTable/index.md +1 -0
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +131 -132
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -0
- package/src/base-client/components/common/XStepView/index.js +3 -0
- package/src/base-client/components/common/XStepView/index.md +31 -0
- package/src/base-client/components/common/XTable/XTable.vue +16 -8
- package/src/base-client/components/index.js +11 -5
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +4 -3
- package/src/base-client/plugins/AppData.js +1 -2
- package/src/base-client/plugins/Config.js +0 -1
- package/src/base-client/plugins/GetLoginInfoService.js +6 -3
- package/src/base-client/plugins/tabs-page-plugin.js +5 -4
- package/src/bootstrap.js +2 -2
- package/src/components/FilePreview/FilePreview.vue +2 -2
- package/src/components/NumberInfo/NumberInfo.vue +1 -1
- package/src/components/checkbox/ColorCheckbox.vue +1 -1
- package/src/components/checkbox/ImgCheckbox.vue +2 -2
- package/src/components/menu/SideMenu.vue +2 -2
- package/src/components/menu/menu.js +1 -1
- package/src/components/tool/AStepItem.vue +1 -1
- package/src/config/CreateQueryConfig.js +12 -2
- package/src/config/default/antd.config.js +11 -6
- package/src/config/default/setting.config.js +7 -4
- package/src/layouts/PageLayout.vue +1 -1
- package/src/layouts/SinglePageView.vue +24 -2
- package/src/layouts/header/AdminHeader.vue +4 -4
- package/src/layouts/header/HeaderNotice.vue +3 -2
- package/src/layouts/tabs/TabsHead.vue +1 -2
- package/src/layouts/tabs/TabsView.vue +18 -10
- package/src/main.js +40 -12
- package/src/mock/extend/index.js +2 -1
- package/src/mock/goods/index.js +6 -6
- package/src/pages/AMisDemo/AMisDemo.vue +223 -0
- package/src/pages/AMisDemo/AMisDemo2.vue +74 -0
- package/src/pages/CreateQueryPage.vue +11 -3
- package/src/pages/login/Login.vue +2 -2
- package/src/pages/resourceManage/orgListManage.vue +2 -2
- package/src/pages/system/dictionary/index.vue +1 -0
- package/src/pages/system/monitor/loginInfor/index.vue +2 -1
- package/src/pages/system/monitor/operLog/index.vue +2 -1
- package/src/pages/system/settings/modifyPassword.vue +1 -1
- package/src/pages/system/ticket/index.vue +3 -2
- package/src/pages/system/ticket/submitTicketSuccess.vue +8 -2
- package/src/router/async/router.map.js +2 -0
- package/src/router/guards.js +29 -0
- package/src/router.js +15 -0
- package/src/services/api/cas.js +1 -1
- package/src/services/api/common.js +39 -23
- package/src/services/apiService.js +2 -2
- package/src/theme/default/style.less +2 -2
- package/src/utils/authority-utils.js +12 -12
- package/src/utils/errorCode.js +4 -4
- package/src/utils/login.js +8 -5
- package/src/utils/map-utils.js +20 -12
- package/src/utils/request.js +15 -5
- package/src/utils/routerUtil.js +12 -8
- package/src/utils/util.js +3 -2
- package/test/Amis.spec.js +163 -0
- package/test/Tree.spec.js +167 -0
- package/test/myDialog.spec.js +46 -0
- package/vue.config.js +66 -24
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -0
- package/webpack.config.js +0 -12
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<a-icon type="bank" /> {{ group.title }}
|
|
26
26
|
</span>
|
|
27
27
|
<a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
|
|
28
|
-
<p class="addressName"><a-icon type="environment"
|
|
28
|
+
<p class="addressName"><a-icon type="environment" /><span v-html="highLight(address.label, address.word)"></span></p>
|
|
29
29
|
<p v-if="address.address !== '[]'" class="addressRemark">
|
|
30
30
|
{{ address.address }}
|
|
31
31
|
</p>
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
169
169
|
const addressMap = {}
|
|
170
170
|
result.tips.forEach((res) => {
|
|
171
171
|
if (res.location) {
|
|
172
|
-
if (!
|
|
172
|
+
if (!Object.prototype.hasOwnProperty.call(addressMap, res.district)) {
|
|
173
173
|
addressMap[res.district] = []
|
|
174
174
|
}
|
|
175
175
|
addressMap[res.district].push({
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
describeList: {
|
|
20
20
|
type: Array,
|
|
21
21
|
// eslint-disable-next-line vue/require-valid-default-prop
|
|
22
|
-
default: () => { return [
|
|
22
|
+
default: () => { return [] } // lng:描述信息 lat:描述信息对应的值的字段名 { describe: '用户名称', field: 'name' }
|
|
23
23
|
},
|
|
24
24
|
// 需要渲染的点位数据
|
|
25
25
|
markers: {
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
imgurl: {
|
|
31
31
|
type: String,
|
|
32
32
|
default: () => {
|
|
33
|
-
return
|
|
33
|
+
return 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png'
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
mapStyle: {
|
|
@@ -105,7 +105,7 @@ export default {
|
|
|
105
105
|
extData: this.markers
|
|
106
106
|
})
|
|
107
107
|
marker.on('click', (e) => {
|
|
108
|
-
if(e.target.getExtData() && e.target.getExtData().lng){
|
|
108
|
+
if (e.target.getExtData() && e.target.getExtData().lng) {
|
|
109
109
|
this.infoWindow.setContent(document.getElementById('amap_point_rendering_template'))
|
|
110
110
|
this.infoWindow.open(this.map, [e.target.getExtData().lng, e.target.getExtData().lat])
|
|
111
111
|
}
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
:rules="rules"
|
|
16
16
|
:wrapper-col="wrapperCol"
|
|
17
17
|
>
|
|
18
|
-
<a-form-model-item label="服务名称" prop="serviceName">
|
|
19
|
-
<a-input v-model="form.serviceName" placeholder="查询接口所在的服务名称,默认system"/>
|
|
20
|
-
</a-form-model-item>
|
|
21
18
|
<a-form-model-item label="查询主表名" prop="tableName">
|
|
22
19
|
<a-input v-model="form.tableName" placeholder="查询用的主表+别名,用空格隔开,如:t_userfiles u"/>
|
|
23
20
|
</a-form-model-item>
|
|
@@ -71,17 +68,17 @@
|
|
|
71
68
|
<a-button icon="import" @click="$message.warn('从创意库中选择并引用高质量的通用表单项配置,敬请期待')">从创意库引入</a-button>
|
|
72
69
|
</a-space>
|
|
73
70
|
<a-row :gutter="24">
|
|
74
|
-
<a-col :span="
|
|
71
|
+
<a-col :span="6">
|
|
75
72
|
<span style="font-weight: bold">
|
|
76
73
|
标签名
|
|
77
74
|
</span>
|
|
78
75
|
</a-col>
|
|
79
|
-
<a-col :span="
|
|
76
|
+
<a-col :span="6">
|
|
80
77
|
<span style="font-weight: bold">
|
|
81
78
|
字段名
|
|
82
79
|
</span>
|
|
83
80
|
</a-col>
|
|
84
|
-
<a-col :span="
|
|
81
|
+
<a-col :span="10">
|
|
85
82
|
<span style="font-weight: bold">
|
|
86
83
|
数据模式
|
|
87
84
|
</span>
|
|
@@ -105,17 +102,17 @@
|
|
|
105
102
|
<span class="dragTips">拖到此处放置</span>
|
|
106
103
|
</a-row>
|
|
107
104
|
<a-row :gutter="24" class="column_item">
|
|
108
|
-
<a-col :span="
|
|
105
|
+
<a-col :span="6">
|
|
109
106
|
<span style="font-weight: bold">
|
|
110
107
|
{{ columnItem.title }}
|
|
111
108
|
</span>
|
|
112
109
|
</a-col>
|
|
113
|
-
<a-col :span="
|
|
110
|
+
<a-col :span="6">
|
|
114
111
|
<span style="font-weight: bold">
|
|
115
112
|
{{ columnItem.key }}
|
|
116
113
|
</span>
|
|
117
114
|
</a-col>
|
|
118
|
-
<a-col :span="
|
|
115
|
+
<a-col :span="10">
|
|
119
116
|
<a-tooltip>
|
|
120
117
|
<template slot="title">
|
|
121
118
|
查询表单项
|
|
@@ -148,7 +145,13 @@
|
|
|
148
145
|
</a-tooltip>
|
|
149
146
|
<a-tooltip>
|
|
150
147
|
<template slot="title">
|
|
151
|
-
|
|
148
|
+
Excel导入项
|
|
149
|
+
</template>
|
|
150
|
+
<a-tag :color="columnItem.dataModeArray.includes('excelImportItem') ? '#107C41' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-excel" /></a-tag>
|
|
151
|
+
</a-tooltip>
|
|
152
|
+
<a-tooltip>
|
|
153
|
+
<template slot="title">
|
|
154
|
+
数据组
|
|
152
155
|
</template>
|
|
153
156
|
<a-tag :color="columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
|
154
157
|
</a-tooltip>
|
|
@@ -225,14 +228,14 @@
|
|
|
225
228
|
</template>
|
|
226
229
|
<x-form-table
|
|
227
230
|
:queryParamsJson="result"
|
|
228
|
-
:view-mode="true"
|
|
231
|
+
:view-mode="true"
|
|
232
|
+
:service-name="serviceName">
|
|
229
233
|
</x-form-table>
|
|
230
234
|
</a-modal>
|
|
231
235
|
</a-drawer>
|
|
232
236
|
</template>
|
|
233
237
|
|
|
234
238
|
<script>
|
|
235
|
-
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
|
|
236
239
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
237
240
|
import JsonViewer from 'vue-json-viewer'
|
|
238
241
|
import FileSaver from 'file-saver'
|
|
@@ -244,8 +247,7 @@ export default {
|
|
|
244
247
|
components: {
|
|
245
248
|
CreateQueryItem,
|
|
246
249
|
JsonViewer,
|
|
247
|
-
XFormTable
|
|
248
|
-
XFormItem
|
|
250
|
+
XFormTable
|
|
249
251
|
},
|
|
250
252
|
data () {
|
|
251
253
|
return {
|
|
@@ -266,7 +268,6 @@ export default {
|
|
|
266
268
|
labelCol: { span: 3 },
|
|
267
269
|
wrapperCol: { span: 18 },
|
|
268
270
|
form: {
|
|
269
|
-
serviceName: '',
|
|
270
271
|
tableName: '',
|
|
271
272
|
joinArray: {},
|
|
272
273
|
condition: {},
|
|
@@ -343,6 +344,14 @@ export default {
|
|
|
343
344
|
toEditJson: {
|
|
344
345
|
type: Object,
|
|
345
346
|
default: () => {}
|
|
347
|
+
},
|
|
348
|
+
saveExportJson: {
|
|
349
|
+
type: Boolean,
|
|
350
|
+
default: false
|
|
351
|
+
},
|
|
352
|
+
serviceName: {
|
|
353
|
+
type: String,
|
|
354
|
+
default: undefined
|
|
346
355
|
}
|
|
347
356
|
},
|
|
348
357
|
watch: {
|
|
@@ -380,27 +389,8 @@ export default {
|
|
|
380
389
|
}, this.toEditJson
|
|
381
390
|
)
|
|
382
391
|
for (const columnItem of this.form.column) {
|
|
383
|
-
// 数据模式兼容性处理
|
|
384
392
|
if (!(columnItem.dataMode || columnItem.dataModeArray)) {
|
|
385
393
|
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
386
|
-
} else if (columnItem.dataMode) {
|
|
387
|
-
if (columnItem.dataMode === 'all') {
|
|
388
|
-
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
389
|
-
} else if (columnItem.dataMode === 'form') {
|
|
390
|
-
columnItem.dataModeArray = ['queryForm', 'addOrEditForm', 'sqlQueryCondition']
|
|
391
|
-
} else if (columnItem.dataMode === 'table') {
|
|
392
|
-
columnItem.dataModeArray = ['table', 'sqlQueryItem']
|
|
393
|
-
} else if (columnItem.dataMode === 'table_form') {
|
|
394
|
-
columnItem.dataModeArray = ['table', 'sqlQueryItem', 'sqlQueryCondition']
|
|
395
|
-
} else if (columnItem.dataMode === 'only_form') {
|
|
396
|
-
columnItem.dataModeArray = ['queryForm']
|
|
397
|
-
} else if (columnItem.dataMode === 'only_table') {
|
|
398
|
-
columnItem.dataModeArray = ['table']
|
|
399
|
-
} else if (columnItem.dataMode === 'clear') {
|
|
400
|
-
columnItem.dataModeArray = ['sqlQueryItem', 'sqlQueryCondition']
|
|
401
|
-
} else if (columnItem.dataMode === 'only_add_modify') {
|
|
402
|
-
columnItem.dataModeArray = ['addOrEditForm', 'sqlQueryItem']
|
|
403
|
-
}
|
|
404
394
|
}
|
|
405
395
|
delete columnItem.dataMode
|
|
406
396
|
// 插槽兼容处理
|
|
@@ -484,6 +474,7 @@ export default {
|
|
|
484
474
|
this.result = {}
|
|
485
475
|
},
|
|
486
476
|
onClose () {
|
|
477
|
+
this.$emit('close')
|
|
487
478
|
this.$emit('update:visible', false)
|
|
488
479
|
},
|
|
489
480
|
onModelClose () {
|
|
@@ -502,7 +493,7 @@ export default {
|
|
|
502
493
|
},
|
|
503
494
|
itemHandle (item, type) {
|
|
504
495
|
this.itemMap[item.key] = item
|
|
505
|
-
if (type === '新增') {
|
|
496
|
+
if (this.type === '新增') {
|
|
506
497
|
this.form.column.push(item)
|
|
507
498
|
} else {
|
|
508
499
|
this.$set(this.form.column, this.selectIndex, item)
|
|
@@ -518,6 +509,7 @@ export default {
|
|
|
518
509
|
this.$refs.queryItem.addColumnItemExecute()
|
|
519
510
|
},
|
|
520
511
|
editColumnItem (key, index) {
|
|
512
|
+
this.type = '修改'
|
|
521
513
|
if (this.itemMap[key]) {
|
|
522
514
|
this.$refs.queryItem.editColumnItemExecute(this.itemMap[key])
|
|
523
515
|
this.selectIndex = index
|
|
@@ -608,8 +600,11 @@ export default {
|
|
|
608
600
|
this.$refs.businessCreateForm.validate(valid => {
|
|
609
601
|
if (valid) {
|
|
610
602
|
this.viewHandle(() => {
|
|
611
|
-
|
|
612
|
-
|
|
603
|
+
if (this.saveExportJson) {
|
|
604
|
+
this.exportJson()
|
|
605
|
+
} else {
|
|
606
|
+
this.$emit('saveQueryParams', this.result)
|
|
607
|
+
}
|
|
613
608
|
})
|
|
614
609
|
}
|
|
615
610
|
})
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
<a-card :bodyStyle="bodyStyle" title="数据字段">
|
|
312
312
|
<a-button type="primary" slot="extra" @click="addColumnItem()">增加</a-button>
|
|
313
313
|
<a-row :gutter="24">
|
|
314
|
-
<a-col :span="
|
|
314
|
+
<a-col :span="7">
|
|
315
315
|
<span style="font-weight: bold">
|
|
316
316
|
标签名
|
|
317
317
|
</span>
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
字段名
|
|
322
322
|
</span>
|
|
323
323
|
</a-col>
|
|
324
|
-
<a-col :span="
|
|
324
|
+
<a-col :span="8">
|
|
325
325
|
<span style="font-weight: bold">
|
|
326
326
|
数据模式
|
|
327
327
|
</span>
|
|
@@ -388,7 +388,13 @@
|
|
|
388
388
|
</a-tooltip>
|
|
389
389
|
<a-tooltip>
|
|
390
390
|
<template slot="title">
|
|
391
|
-
|
|
391
|
+
Excel导入项
|
|
392
|
+
</template>
|
|
393
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('excelImportItem') ? '#107C41' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-excel" /></a-tag>
|
|
394
|
+
</a-tooltip>
|
|
395
|
+
<a-tooltip>
|
|
396
|
+
<template slot="title">
|
|
397
|
+
数据组
|
|
392
398
|
</template>
|
|
393
399
|
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
|
394
400
|
</a-tooltip>
|
|
@@ -428,6 +434,12 @@
|
|
|
428
434
|
show-icon
|
|
429
435
|
style="margin-top: 5px"
|
|
430
436
|
type="info"/>
|
|
437
|
+
<a-alert
|
|
438
|
+
v-if="item.title.length > 8"
|
|
439
|
+
message="提示:标签名称过长可能会影响表格列展示效果,建议不超过8个字符"
|
|
440
|
+
show-icon
|
|
441
|
+
style="margin-top: 5px"
|
|
442
|
+
type="warning"/>
|
|
431
443
|
</a-form-model>
|
|
432
444
|
<create-query-item ref="queryItem" @getColumn="getColumnItem" @itemHandle="itemHandleItem"/>
|
|
433
445
|
</a-modal>
|
|
@@ -471,7 +483,7 @@ export default {
|
|
|
471
483
|
},
|
|
472
484
|
// 字段名称是否禁用
|
|
473
485
|
keyDisabled () {
|
|
474
|
-
return this.item.formType === 'file' || this.item.formType === 'image'
|
|
486
|
+
return this.item.formType === 'file' || this.item.formType === 'image' || this.dataMode.mixinTableName
|
|
475
487
|
},
|
|
476
488
|
// 数据模式是否禁用
|
|
477
489
|
dataModeDisabled () {
|
|
@@ -483,7 +495,10 @@ export default {
|
|
|
483
495
|
table: false,
|
|
484
496
|
addOrEditForm: false,
|
|
485
497
|
sqlQueryItem: false,
|
|
486
|
-
sqlQueryCondition: false
|
|
498
|
+
sqlQueryCondition: false,
|
|
499
|
+
excelImportItem: false,
|
|
500
|
+
group: false,
|
|
501
|
+
mixinTableName: false
|
|
487
502
|
}
|
|
488
503
|
for (const item of this.dataModeArrayData) {
|
|
489
504
|
result[item] = true
|
|
@@ -502,11 +517,25 @@ export default {
|
|
|
502
517
|
value: 'sqlQueryItem',
|
|
503
518
|
noMatch: ['file', 'personSetting']
|
|
504
519
|
}, {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
520
|
+
label: '字段组存储',
|
|
521
|
+
value: 'group',
|
|
522
|
+
noMatch: []
|
|
508
523
|
}]
|
|
509
524
|
}
|
|
525
|
+
if (this.dataModeArrayData.includes('mixinTableName')) {
|
|
526
|
+
return [
|
|
527
|
+
{
|
|
528
|
+
label: '渲染查询表单项',
|
|
529
|
+
value: 'queryForm',
|
|
530
|
+
noMatch: ['file', 'image', 'textarea', 'personSetting']
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
label: '动态表名参数',
|
|
534
|
+
value: 'mixinTableName',
|
|
535
|
+
noMatch: []
|
|
536
|
+
}
|
|
537
|
+
]
|
|
538
|
+
}
|
|
510
539
|
if (this.item.formType) {
|
|
511
540
|
return dataModeType.filter(item => {
|
|
512
541
|
return item.noMatch.findIndex(type => type === this.item.formType) === -1
|
|
@@ -581,8 +610,40 @@ export default {
|
|
|
581
610
|
// 必填控制
|
|
582
611
|
itemRules: {
|
|
583
612
|
formType: [{ required: true, message: '请输入表单类型', trigger: 'change' }],
|
|
584
|
-
key: [{
|
|
585
|
-
|
|
613
|
+
key: [{
|
|
614
|
+
required: true,
|
|
615
|
+
validator: (rule, value, callback) => {
|
|
616
|
+
// 判断必填
|
|
617
|
+
if (!value) {
|
|
618
|
+
callback(new Error('请输入字段名称'))
|
|
619
|
+
} else {
|
|
620
|
+
// 判断必须全部小写 并且不能包含空格
|
|
621
|
+
if (value !== value.toLowerCase() || value.indexOf(' ') !== -1 && !value === '_mixinTableName_') {
|
|
622
|
+
callback(new Error('字段名称必须全部小写,且不能包含空格'))
|
|
623
|
+
} else {
|
|
624
|
+
callback()
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
trigger: 'blur'
|
|
629
|
+
}],
|
|
630
|
+
title: [{
|
|
631
|
+
required: true,
|
|
632
|
+
validator: (rule, value, callback) => {
|
|
633
|
+
// 判断必填
|
|
634
|
+
if (!value) {
|
|
635
|
+
callback(new Error('请输入标签名称'))
|
|
636
|
+
} else {
|
|
637
|
+
// // 大于8个字符给提示
|
|
638
|
+
// if (value.length > 8) {
|
|
639
|
+
// callback(new Error('标签名称过长,建议不超过8个字符,可能会影响展示效果'))
|
|
640
|
+
// } else {
|
|
641
|
+
callback()
|
|
642
|
+
// }
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
trigger: 'blur'
|
|
646
|
+
}],
|
|
586
647
|
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
|
587
648
|
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }],
|
|
588
649
|
'slot.value': [{ required: true, message: '请输入文本溢出上限长度', trigger: 'blur' }],
|
|
@@ -615,6 +676,7 @@ export default {
|
|
|
615
676
|
rule: {
|
|
616
677
|
required: 'false'
|
|
617
678
|
},
|
|
679
|
+
column: [],
|
|
618
680
|
selectKey: undefined,
|
|
619
681
|
queryType: '=',
|
|
620
682
|
formType: 'input',
|
|
@@ -642,7 +704,7 @@ export default {
|
|
|
642
704
|
// 编辑数据字段前准备数据
|
|
643
705
|
editColumnItemExecute (_item) {
|
|
644
706
|
this.type = '修改'
|
|
645
|
-
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {} }
|
|
707
|
+
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {}, column: [] }
|
|
646
708
|
if (!_item.queryType) {
|
|
647
709
|
defaultValue.queryType = '='
|
|
648
710
|
}
|
|
@@ -766,6 +828,12 @@ export default {
|
|
|
766
828
|
},
|
|
767
829
|
// 数据模式改变
|
|
768
830
|
dataModeArrayDataChange (newVal) {
|
|
831
|
+
if (newVal.includes('mixinTableName')) {
|
|
832
|
+
this.item.key = '_mixinTableName_'
|
|
833
|
+
this.dataModeArrayData = ['queryForm', 'mixinTableName']
|
|
834
|
+
} else if (this.item.key === '_mixinTableName_') {
|
|
835
|
+
this.item.key = ''
|
|
836
|
+
}
|
|
769
837
|
if (newVal.includes('group')) {
|
|
770
838
|
this.dataModeArrayData = ['sqlQueryItem', 'group']
|
|
771
839
|
}
|
|
@@ -915,7 +983,7 @@ export default {
|
|
|
915
983
|
},
|
|
916
984
|
itemHandleItem (item, type) {
|
|
917
985
|
this.itemMap[item.key] = item
|
|
918
|
-
if (type === '新增') {
|
|
986
|
+
if (this.type === '新增') {
|
|
919
987
|
this.item.column.push(item)
|
|
920
988
|
} else {
|
|
921
989
|
this.$set(this.item.column, this.selectIndex, item)
|
|
@@ -15,14 +15,19 @@
|
|
|
15
15
|
:rules="rules"
|
|
16
16
|
:wrapper-col="wrapperCol"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<a-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a-
|
|
23
|
-
|
|
18
|
+
<template v-if="asAParamsGroup">
|
|
19
|
+
<a-form-model-item label="参数组名称" prop="group">
|
|
20
|
+
<a-input v-model="form.group" placeholder="设置表单项的组名,如:设置上报参数" />
|
|
21
|
+
</a-form-model-item>
|
|
22
|
+
<a-form-model-item label="参数组描述" prop="describe">
|
|
23
|
+
<a-input v-model="form.describe" placeholder="简单描述参数组,如:用于配置物联网设备的上报参数" />
|
|
24
|
+
</a-form-model-item>
|
|
25
|
+
</template>
|
|
24
26
|
<a-form-model-item label="数据字段" prop="column">
|
|
25
|
-
<a-
|
|
27
|
+
<a-space>
|
|
28
|
+
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
29
|
+
<a-button icon="import" @click="$message.warn('从创意库中选择并引用高质量的通用表单项配置,敬请期待')">从创意库引入</a-button>
|
|
30
|
+
</a-space>
|
|
26
31
|
<a-row :gutter="24">
|
|
27
32
|
<a-col :span="11">
|
|
28
33
|
<span style="font-weight: bold">
|
|
@@ -44,7 +49,6 @@
|
|
|
44
49
|
<div
|
|
45
50
|
v-for="(columnItem, index) in form.column"
|
|
46
51
|
:key="index"
|
|
47
|
-
class="column_item"
|
|
48
52
|
draggable="true"
|
|
49
53
|
@dragend="handleDragEnd($event, columnItem)"
|
|
50
54
|
@dragenter="handleDragEnter($event, columnItem)"
|
|
@@ -53,7 +57,7 @@
|
|
|
53
57
|
<a-row v-if="ending && dragging && columnItem.key === ending.key && dragging.key !== ending.key" class="dragTipsWarp">
|
|
54
58
|
<span class="dragTips">拖到此处放置</span>
|
|
55
59
|
</a-row>
|
|
56
|
-
<a-row :gutter="24">
|
|
60
|
+
<a-row :gutter="24" class="column_item">
|
|
57
61
|
<a-col :span="11">
|
|
58
62
|
<span style="font-weight: bold">
|
|
59
63
|
{{ columnItem.title }}
|
|
@@ -73,41 +77,9 @@
|
|
|
73
77
|
</a-row>
|
|
74
78
|
</div>
|
|
75
79
|
</a-form-model-item>
|
|
76
|
-
<!-- 暂时不需要 -->
|
|
77
|
-
<!-- <a-form-model-item label="接口插槽" prop="apiSlot">
|
|
78
|
-
<a-popover placement="right" title="说明">
|
|
79
|
-
<template slot="content">
|
|
80
|
-
<p>通过插槽,你可以轻松扩展查询配置的默认业务,配置的插槽会根据类型在默认业务的前后执行,类似于切面</p>
|
|
81
|
-
<p><span style="color: #FF0000">注意:插槽不应改变默认的业务行为</span></p>
|
|
82
|
-
<p>如果配置了业务执行前插槽,<br/>执行默认业务前会先执行设置的插槽logic,传给插槽的参数为data本身</p>
|
|
83
|
-
<p>如果配置了业务执行后插槽,<br/>执行默认业务后会执行设置的插槽logic,传给插槽的参数为默认业务的返回值</p>
|
|
84
|
-
<img src="@vue2-client/assets/img/querySlotDemo.svg" style="zoom:0.5">
|
|
85
|
-
</template>
|
|
86
|
-
<a-button type="primary" @click="addApiSlot()">增加</a-button>
|
|
87
|
-
</a-popover>
|
|
88
|
-
<div
|
|
89
|
-
v-for="(columnItem, index) in form.apiSlotView"
|
|
90
|
-
:key="index"
|
|
91
|
-
>
|
|
92
|
-
<a-input v-model="columnItem.slotName" placeholder="插槽logic名称">
|
|
93
|
-
<a-select slot="addonBefore" v-model="columnItem.slotType" style="width: 10rem" placeholder="选择插槽类型">
|
|
94
|
-
<a-select-option
|
|
95
|
-
v-for="item in apiSlotData"
|
|
96
|
-
:key="item.value"
|
|
97
|
-
:value="item.value">
|
|
98
|
-
{{ item.label }}
|
|
99
|
-
</a-select-option>
|
|
100
|
-
</a-select>
|
|
101
|
-
<a-icon slot="addonAfter" type="close" @click="removeApiSlotItem(index)"/>
|
|
102
|
-
</a-input>
|
|
103
|
-
</div>
|
|
104
|
-
</a-form-model-item> -->
|
|
105
80
|
</a-form-model>
|
|
106
81
|
<create-simple-form-query-item ref="queryItem" @getColumn="getColumn" @itemHandle="itemHandle"/>
|
|
107
|
-
<a-
|
|
108
|
-
<a-button type="default" @click="view">预览</a-button>
|
|
109
|
-
<a-button type="primary" @click="submit">保存</a-button>
|
|
110
|
-
</a-space>
|
|
82
|
+
<a-button type="primary" @click="view">操作</a-button>
|
|
111
83
|
</a-col>
|
|
112
84
|
<a-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
|
|
113
85
|
<a-card :bordered="false" size="small" style="overflow: auto" title="预览">
|
|
@@ -119,18 +91,18 @@
|
|
|
119
91
|
</a-card>
|
|
120
92
|
</a-col>
|
|
121
93
|
</a-row>
|
|
122
|
-
<x-add-form ref="xAddForm"/>
|
|
94
|
+
<x-add-form ref="xAddForm" @onSubmit="submit"/>
|
|
123
95
|
</a-drawer>
|
|
124
96
|
</template>
|
|
125
97
|
|
|
126
98
|
<script>
|
|
127
|
-
import
|
|
128
|
-
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
99
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
129
100
|
import JsonViewer from 'vue-json-viewer'
|
|
130
101
|
import FileSaver from 'file-saver'
|
|
131
102
|
import { mapState } from 'vuex'
|
|
132
|
-
import
|
|
103
|
+
import CreateSimpleFormQueryItem from './CreateSimpleFormQueryItem'
|
|
133
104
|
import { parseConfigUrl } from '@vue2-client/services/api/common'
|
|
105
|
+
import { post } from '@vue2-client/services/api'
|
|
134
106
|
|
|
135
107
|
export default {
|
|
136
108
|
name: 'CreateSimpleFormQuery',
|
|
@@ -148,8 +120,8 @@ export default {
|
|
|
148
120
|
labelCol: { span: 3 },
|
|
149
121
|
wrapperCol: { span: 18 },
|
|
150
122
|
form: {
|
|
151
|
-
group:
|
|
152
|
-
describe:
|
|
123
|
+
group: undefined,
|
|
124
|
+
describe: undefined,
|
|
153
125
|
column: [],
|
|
154
126
|
apiSlotView: [],
|
|
155
127
|
apiSlot: {},
|
|
@@ -159,10 +131,6 @@ export default {
|
|
|
159
131
|
selectIndex: null,
|
|
160
132
|
selectType: undefined,
|
|
161
133
|
joinArray: [],
|
|
162
|
-
rules: {
|
|
163
|
-
group: [{ required: true, message: '请输入参数组名称', trigger: 'blur' }],
|
|
164
|
-
describe: [{ required: true, message: '请输入参数组描述', trigger: 'blur' }]
|
|
165
|
-
},
|
|
166
134
|
ending: null,
|
|
167
135
|
dragging: null,
|
|
168
136
|
// 操作按钮状态集合
|
|
@@ -182,20 +150,34 @@ export default {
|
|
|
182
150
|
this.initView()
|
|
183
151
|
},
|
|
184
152
|
computed: {
|
|
185
|
-
...mapState('setting', ['isMobile'])
|
|
153
|
+
...mapState('setting', ['isMobile']),
|
|
154
|
+
rules () {
|
|
155
|
+
return this.asAParamsGroup ? {
|
|
156
|
+
group: [{ required: true, message: '请输入参数组名称', trigger: 'blur' }],
|
|
157
|
+
describe: [{ required: true, message: '请输入参数组描述', trigger: 'blur' }]
|
|
158
|
+
} : {}
|
|
159
|
+
},
|
|
186
160
|
},
|
|
187
161
|
props: {
|
|
188
162
|
visible: {
|
|
189
163
|
type: Boolean,
|
|
190
164
|
default: false
|
|
191
165
|
},
|
|
192
|
-
|
|
193
|
-
type:
|
|
194
|
-
default:
|
|
166
|
+
asAParamsGroup: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: false
|
|
195
169
|
},
|
|
196
170
|
toEditJson: {
|
|
197
171
|
type: Object,
|
|
198
172
|
default: () => {}
|
|
173
|
+
},
|
|
174
|
+
saveExportJson: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: false
|
|
177
|
+
},
|
|
178
|
+
serviceName: {
|
|
179
|
+
type: String,
|
|
180
|
+
default: undefined
|
|
199
181
|
}
|
|
200
182
|
},
|
|
201
183
|
watch: {
|
|
@@ -214,8 +196,6 @@ export default {
|
|
|
214
196
|
// 处理具体表单项
|
|
215
197
|
this.form = Object.assign(
|
|
216
198
|
{
|
|
217
|
-
group: '',
|
|
218
|
-
describe: '',
|
|
219
199
|
apiSlotView: [],
|
|
220
200
|
apiSlot: {},
|
|
221
201
|
column: []
|
|
@@ -290,6 +270,7 @@ export default {
|
|
|
290
270
|
this.result = {}
|
|
291
271
|
},
|
|
292
272
|
onClose () {
|
|
273
|
+
this.$emit('close')
|
|
293
274
|
this.$emit('update:visible', false)
|
|
294
275
|
},
|
|
295
276
|
addJoinItem () {
|
|
@@ -298,7 +279,7 @@ export default {
|
|
|
298
279
|
},
|
|
299
280
|
itemHandle (item, type) {
|
|
300
281
|
this.itemMap[item.key] = item
|
|
301
|
-
if (type === '新增') {
|
|
282
|
+
if (this.type === '新增') {
|
|
302
283
|
this.form.column.push(item)
|
|
303
284
|
} else {
|
|
304
285
|
this.$set(this.form.column, this.selectIndex, item)
|
|
@@ -314,6 +295,7 @@ export default {
|
|
|
314
295
|
this.$refs.queryItem.addColumnItemExecute()
|
|
315
296
|
},
|
|
316
297
|
editColumnItem (key, index) {
|
|
298
|
+
this.type = '修改'
|
|
317
299
|
if (this.itemMap[key]) {
|
|
318
300
|
this.$refs.queryItem.editColumnItemExecute(this.itemMap[key])
|
|
319
301
|
this.selectIndex = index
|
|
@@ -349,8 +331,6 @@ export default {
|
|
|
349
331
|
this.form.column.splice(index, 1, itemA)
|
|
350
332
|
this.form.column.splice(newIndex, 1, itemB)
|
|
351
333
|
},
|
|
352
|
-
changeJoinArray () {
|
|
353
|
-
},
|
|
354
334
|
exportJson () {
|
|
355
335
|
const data = JSON.stringify(this.result, null, 2)
|
|
356
336
|
const blob = new Blob([data], { type: 'application/json' })
|
|
@@ -391,22 +371,25 @@ export default {
|
|
|
391
371
|
businessType: '新增',
|
|
392
372
|
title: '效果预览',
|
|
393
373
|
formItems: res.formJson,
|
|
394
|
-
serviceName: this.serviceName
|
|
395
|
-
viewMode: true
|
|
374
|
+
serviceName: this.serviceName
|
|
396
375
|
})
|
|
397
376
|
})
|
|
398
377
|
})
|
|
399
378
|
}
|
|
400
379
|
})
|
|
401
380
|
},
|
|
402
|
-
submit () {
|
|
381
|
+
submit (params, callback) {
|
|
403
382
|
this.$refs.businessCreateForm.validate(valid => {
|
|
404
|
-
|
|
405
|
-
this.
|
|
406
|
-
// saveQueryParams
|
|
383
|
+
this.viewHandle(() => {
|
|
384
|
+
if (this.saveExportJson) {
|
|
407
385
|
this.exportJson()
|
|
408
|
-
}
|
|
409
|
-
|
|
386
|
+
} else {
|
|
387
|
+
this.$emit('saveQueryParams', this.result)
|
|
388
|
+
if (callback) {
|
|
389
|
+
callback()
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
})
|
|
410
393
|
})
|
|
411
394
|
},
|
|
412
395
|
// 判断是否为json字符串
|
|
@@ -455,7 +438,7 @@ export default {
|
|
|
455
438
|
}
|
|
456
439
|
</script>
|
|
457
440
|
<style lang="less" scoped>
|
|
458
|
-
.column_item
|
|
441
|
+
.column_item:hover {
|
|
459
442
|
background-color:rgba(64, 169, 255,0.25);
|
|
460
443
|
}
|
|
461
444
|
.dragTips{
|