vue2-client 1.8.31 → 1.8.32
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 +0 -1
- package/.eslintrc.js +14 -22
- package/CHANGELOG.md +0 -52
- package/babel.config.js +2 -8
- package/docs/index.md +1 -2
- package/index.js +1 -1
- package/jest.config.js +2 -20
- package/package.json +27 -36
- package/src/App.vue +7 -33
- 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 +37 -32
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +12 -80
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +70 -53
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +5 -5
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +18 -19
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +8 -4
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +6 -4
- package/src/base-client/components/common/Upload/Upload.vue +1 -1
- package/src/base-client/components/common/XAddForm/XAddForm.vue +5 -21
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +53 -88
- 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/XForm/XForm.vue +0 -2
- package/src/base-client/components/common/XFormTable/XFormTable.vue +24 -49
- package/src/base-client/components/common/XFormTable/index.md +0 -1
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +18 -17
- package/src/base-client/components/common/XTable/XTable.vue +8 -16
- package/src/base-client/components/index.js +5 -11
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +3 -4
- package/src/base-client/plugins/AppData.js +2 -1
- package/src/base-client/plugins/Config.js +1 -0
- package/src/base-client/plugins/GetLoginInfoService.js +3 -6
- package/src/base-client/plugins/tabs-page-plugin.js +4 -5
- 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 +2 -12
- package/src/config/default/antd.config.js +6 -11
- package/src/config/default/setting.config.js +4 -7
- package/src/layouts/PageLayout.vue +1 -1
- package/src/layouts/SinglePageView.vue +2 -24
- package/src/layouts/header/AdminHeader.vue +4 -4
- package/src/layouts/header/HeaderNotice.vue +2 -3
- package/src/layouts/tabs/TabsHead.vue +2 -1
- package/src/layouts/tabs/TabsView.vue +10 -18
- package/src/main.js +12 -40
- package/src/mock/extend/index.js +1 -2
- package/src/mock/goods/index.js +6 -6
- package/src/pages/CreateQueryPage.vue +3 -11
- package/src/pages/login/Login.vue +2 -2
- package/src/pages/resourceManage/orgListManage.vue +2 -2
- package/src/pages/system/dictionary/index.vue +0 -1
- package/src/pages/system/monitor/loginInfor/index.vue +1 -2
- package/src/pages/system/monitor/operLog/index.vue +1 -2
- package/src/pages/system/settings/modifyPassword.vue +1 -1
- package/src/pages/system/ticket/index.vue +2 -3
- package/src/pages/system/ticket/submitTicketSuccess.vue +2 -8
- package/src/router/async/router.map.js +0 -2
- package/src/router/guards.js +0 -29
- package/src/services/api/common.js +21 -37
- 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 +5 -8
- package/src/utils/map-utils.js +12 -20
- package/src/utils/request.js +5 -15
- package/src/utils/routerUtil.js +8 -12
- package/src/utils/util.js +2 -3
- package/vue.config.js +24 -66
- package/webpack.config.js +12 -0
- package/jest-transform-stub.js +0 -8
- package/jest.setup.js +0 -7
- package/src/base-client/components/common/AMisRender/index.js +0 -3
- package/src/base-client/components/common/AMisRender/index.vue +0 -257
- package/src/base-client/components/common/Tree/Tree.vue +0 -149
- package/src/base-client/components/common/Tree/index.js +0 -2
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +0 -117
- package/src/base-client/components/common/XDescriptions/index.js +0 -3
- package/src/base-client/components/common/XDescriptions/index.md +0 -83
- package/src/base-client/components/common/XStepView/XStepView.vue +0 -252
- package/src/base-client/components/common/XStepView/index.js +0 -3
- package/src/base-client/components/common/XStepView/index.md +0 -31
- package/src/pages/AMisDemo/AMisDemo.vue +0 -223
- package/src/pages/AMisDemo/AMisDemo2.vue +0 -74
- package/src/router.js +0 -15
- package/test/Amis.spec.js +0 -163
- package/test/Tree.spec.js +0 -167
- package/test/myDialog.spec.js +0 -46
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +0 -15
|
@@ -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="8">
|
|
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="7">
|
|
325
325
|
<span style="font-weight: bold">
|
|
326
326
|
数据模式
|
|
327
327
|
</span>
|
|
@@ -388,13 +388,7 @@
|
|
|
388
388
|
</a-tooltip>
|
|
389
389
|
<a-tooltip>
|
|
390
390
|
<template slot="title">
|
|
391
|
-
|
|
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
|
-
数据组
|
|
391
|
+
字段JSON存储
|
|
398
392
|
</template>
|
|
399
393
|
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
|
400
394
|
</a-tooltip>
|
|
@@ -434,12 +428,6 @@
|
|
|
434
428
|
show-icon
|
|
435
429
|
style="margin-top: 5px"
|
|
436
430
|
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"/>
|
|
443
431
|
</a-form-model>
|
|
444
432
|
<create-query-item ref="queryItem" @getColumn="getColumnItem" @itemHandle="itemHandleItem"/>
|
|
445
433
|
</a-modal>
|
|
@@ -483,7 +471,7 @@ export default {
|
|
|
483
471
|
},
|
|
484
472
|
// 字段名称是否禁用
|
|
485
473
|
keyDisabled () {
|
|
486
|
-
return this.item.formType === 'file' || this.item.formType === 'image'
|
|
474
|
+
return this.item.formType === 'file' || this.item.formType === 'image'
|
|
487
475
|
},
|
|
488
476
|
// 数据模式是否禁用
|
|
489
477
|
dataModeDisabled () {
|
|
@@ -495,10 +483,7 @@ export default {
|
|
|
495
483
|
table: false,
|
|
496
484
|
addOrEditForm: false,
|
|
497
485
|
sqlQueryItem: false,
|
|
498
|
-
sqlQueryCondition: false
|
|
499
|
-
excelImportItem: false,
|
|
500
|
-
group: false,
|
|
501
|
-
mixinTableName: false
|
|
486
|
+
sqlQueryCondition: false
|
|
502
487
|
}
|
|
503
488
|
for (const item of this.dataModeArrayData) {
|
|
504
489
|
result[item] = true
|
|
@@ -517,24 +502,10 @@ export default {
|
|
|
517
502
|
value: 'sqlQueryItem',
|
|
518
503
|
noMatch: ['file', 'personSetting']
|
|
519
504
|
}, {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
noMatch: []
|
|
523
|
-
}]
|
|
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',
|
|
505
|
+
label: '字段组存储',
|
|
506
|
+
value: 'group',
|
|
535
507
|
noMatch: []
|
|
536
|
-
|
|
537
|
-
]
|
|
508
|
+
}]
|
|
538
509
|
}
|
|
539
510
|
if (this.item.formType) {
|
|
540
511
|
return dataModeType.filter(item => {
|
|
@@ -610,40 +581,8 @@ export default {
|
|
|
610
581
|
// 必填控制
|
|
611
582
|
itemRules: {
|
|
612
583
|
formType: [{ required: true, message: '请输入表单类型', trigger: 'change' }],
|
|
613
|
-
key: [{
|
|
614
|
-
|
|
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
|
-
}],
|
|
584
|
+
key: [{ required: true, message: '请输入字段名称', trigger: 'blur' }],
|
|
585
|
+
title: [{ required: true, message: '请输入标签名称', trigger: 'blur' }],
|
|
647
586
|
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
|
648
587
|
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }],
|
|
649
588
|
'slot.value': [{ required: true, message: '请输入文本溢出上限长度', trigger: 'blur' }],
|
|
@@ -676,7 +615,6 @@ export default {
|
|
|
676
615
|
rule: {
|
|
677
616
|
required: 'false'
|
|
678
617
|
},
|
|
679
|
-
column: [],
|
|
680
618
|
selectKey: undefined,
|
|
681
619
|
queryType: '=',
|
|
682
620
|
formType: 'input',
|
|
@@ -704,7 +642,7 @@ export default {
|
|
|
704
642
|
// 编辑数据字段前准备数据
|
|
705
643
|
editColumnItemExecute (_item) {
|
|
706
644
|
this.type = '修改'
|
|
707
|
-
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {}
|
|
645
|
+
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {} }
|
|
708
646
|
if (!_item.queryType) {
|
|
709
647
|
defaultValue.queryType = '='
|
|
710
648
|
}
|
|
@@ -828,12 +766,6 @@ export default {
|
|
|
828
766
|
},
|
|
829
767
|
// 数据模式改变
|
|
830
768
|
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
|
-
}
|
|
837
769
|
if (newVal.includes('group')) {
|
|
838
770
|
this.dataModeArrayData = ['sqlQueryItem', 'group']
|
|
839
771
|
}
|
|
@@ -983,7 +915,7 @@ export default {
|
|
|
983
915
|
},
|
|
984
916
|
itemHandleItem (item, type) {
|
|
985
917
|
this.itemMap[item.key] = item
|
|
986
|
-
if (
|
|
918
|
+
if (type === '新增') {
|
|
987
919
|
this.item.column.push(item)
|
|
988
920
|
} else {
|
|
989
921
|
this.$set(this.item.column, this.selectIndex, item)
|
|
@@ -15,19 +15,14 @@
|
|
|
15
15
|
:rules="rules"
|
|
16
16
|
:wrapper-col="wrapperCol"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<a-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<a-
|
|
23
|
-
|
|
24
|
-
</a-form-model-item>
|
|
25
|
-
</template>
|
|
18
|
+
<a-form-model-item label="参数组名称" prop="group">
|
|
19
|
+
<a-input v-model="form.group" placeholder="设置表单项的组名,如:设置上报参数" />
|
|
20
|
+
</a-form-model-item>
|
|
21
|
+
<a-form-model-item label="参数组描述" prop="describe">
|
|
22
|
+
<a-input v-model="form.describe" placeholder="简单描述参数组,如:用于配置物联网设备的上报参数" />
|
|
23
|
+
</a-form-model-item>
|
|
26
24
|
<a-form-model-item label="数据字段" prop="column">
|
|
27
|
-
<a-
|
|
28
|
-
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
29
|
-
<a-button icon="import" @click="$message.warn('从创意库中选择并引用高质量的通用表单项配置,敬请期待')">从创意库引入</a-button>
|
|
30
|
-
</a-space>
|
|
25
|
+
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
31
26
|
<a-row :gutter="24">
|
|
32
27
|
<a-col :span="11">
|
|
33
28
|
<span style="font-weight: bold">
|
|
@@ -49,6 +44,7 @@
|
|
|
49
44
|
<div
|
|
50
45
|
v-for="(columnItem, index) in form.column"
|
|
51
46
|
:key="index"
|
|
47
|
+
class="column_item"
|
|
52
48
|
draggable="true"
|
|
53
49
|
@dragend="handleDragEnd($event, columnItem)"
|
|
54
50
|
@dragenter="handleDragEnter($event, columnItem)"
|
|
@@ -57,7 +53,7 @@
|
|
|
57
53
|
<a-row v-if="ending && dragging && columnItem.key === ending.key && dragging.key !== ending.key" class="dragTipsWarp">
|
|
58
54
|
<span class="dragTips">拖到此处放置</span>
|
|
59
55
|
</a-row>
|
|
60
|
-
<a-row :gutter="24"
|
|
56
|
+
<a-row :gutter="24">
|
|
61
57
|
<a-col :span="11">
|
|
62
58
|
<span style="font-weight: bold">
|
|
63
59
|
{{ columnItem.title }}
|
|
@@ -77,9 +73,41 @@
|
|
|
77
73
|
</a-row>
|
|
78
74
|
</div>
|
|
79
75
|
</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> -->
|
|
80
105
|
</a-form-model>
|
|
81
106
|
<create-simple-form-query-item ref="queryItem" @getColumn="getColumn" @itemHandle="itemHandle"/>
|
|
82
|
-
<a-
|
|
107
|
+
<a-space>
|
|
108
|
+
<a-button type="default" @click="view">预览</a-button>
|
|
109
|
+
<a-button type="primary" @click="submit">保存</a-button>
|
|
110
|
+
</a-space>
|
|
83
111
|
</a-col>
|
|
84
112
|
<a-col :lg="12" :md="12" :sm="24" :xl="6" :xs="24">
|
|
85
113
|
<a-card :bordered="false" size="small" style="overflow: auto" title="预览">
|
|
@@ -91,18 +119,18 @@
|
|
|
91
119
|
</a-card>
|
|
92
120
|
</a-col>
|
|
93
121
|
</a-row>
|
|
94
|
-
<x-add-form ref="xAddForm"
|
|
122
|
+
<x-add-form ref="xAddForm"/>
|
|
95
123
|
</a-drawer>
|
|
96
124
|
</template>
|
|
97
125
|
|
|
98
126
|
<script>
|
|
99
|
-
import
|
|
127
|
+
import CreateSimpleFormQueryItem from './CreateSimpleFormQueryItem'
|
|
128
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
100
129
|
import JsonViewer from 'vue-json-viewer'
|
|
101
130
|
import FileSaver from 'file-saver'
|
|
102
131
|
import { mapState } from 'vuex'
|
|
103
|
-
import CreateSimpleFormQueryItem from './CreateSimpleFormQueryItem'
|
|
104
|
-
import { parseConfigUrl } from '@vue2-client/services/api/common'
|
|
105
132
|
import { post } from '@vue2-client/services/api'
|
|
133
|
+
import { parseConfigUrl } from '@vue2-client/services/api/common'
|
|
106
134
|
|
|
107
135
|
export default {
|
|
108
136
|
name: 'CreateSimpleFormQuery',
|
|
@@ -120,8 +148,8 @@ export default {
|
|
|
120
148
|
labelCol: { span: 3 },
|
|
121
149
|
wrapperCol: { span: 18 },
|
|
122
150
|
form: {
|
|
123
|
-
group:
|
|
124
|
-
describe:
|
|
151
|
+
group: '',
|
|
152
|
+
describe: '',
|
|
125
153
|
column: [],
|
|
126
154
|
apiSlotView: [],
|
|
127
155
|
apiSlot: {},
|
|
@@ -131,6 +159,10 @@ export default {
|
|
|
131
159
|
selectIndex: null,
|
|
132
160
|
selectType: undefined,
|
|
133
161
|
joinArray: [],
|
|
162
|
+
rules: {
|
|
163
|
+
group: [{ required: true, message: '请输入参数组名称', trigger: 'blur' }],
|
|
164
|
+
describe: [{ required: true, message: '请输入参数组描述', trigger: 'blur' }]
|
|
165
|
+
},
|
|
134
166
|
ending: null,
|
|
135
167
|
dragging: null,
|
|
136
168
|
// 操作按钮状态集合
|
|
@@ -150,34 +182,20 @@ export default {
|
|
|
150
182
|
this.initView()
|
|
151
183
|
},
|
|
152
184
|
computed: {
|
|
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
|
-
},
|
|
185
|
+
...mapState('setting', ['isMobile'])
|
|
160
186
|
},
|
|
161
187
|
props: {
|
|
162
188
|
visible: {
|
|
163
189
|
type: Boolean,
|
|
164
190
|
default: false
|
|
165
191
|
},
|
|
166
|
-
|
|
167
|
-
type:
|
|
168
|
-
default:
|
|
192
|
+
serviceName: {
|
|
193
|
+
type: String,
|
|
194
|
+
default: undefined
|
|
169
195
|
},
|
|
170
196
|
toEditJson: {
|
|
171
197
|
type: Object,
|
|
172
198
|
default: () => {}
|
|
173
|
-
},
|
|
174
|
-
saveExportJson: {
|
|
175
|
-
type: Boolean,
|
|
176
|
-
default: false
|
|
177
|
-
},
|
|
178
|
-
serviceName: {
|
|
179
|
-
type: String,
|
|
180
|
-
default: undefined
|
|
181
199
|
}
|
|
182
200
|
},
|
|
183
201
|
watch: {
|
|
@@ -196,6 +214,8 @@ export default {
|
|
|
196
214
|
// 处理具体表单项
|
|
197
215
|
this.form = Object.assign(
|
|
198
216
|
{
|
|
217
|
+
group: '',
|
|
218
|
+
describe: '',
|
|
199
219
|
apiSlotView: [],
|
|
200
220
|
apiSlot: {},
|
|
201
221
|
column: []
|
|
@@ -270,7 +290,6 @@ export default {
|
|
|
270
290
|
this.result = {}
|
|
271
291
|
},
|
|
272
292
|
onClose () {
|
|
273
|
-
this.$emit('close')
|
|
274
293
|
this.$emit('update:visible', false)
|
|
275
294
|
},
|
|
276
295
|
addJoinItem () {
|
|
@@ -279,7 +298,7 @@ export default {
|
|
|
279
298
|
},
|
|
280
299
|
itemHandle (item, type) {
|
|
281
300
|
this.itemMap[item.key] = item
|
|
282
|
-
if (
|
|
301
|
+
if (type === '新增') {
|
|
283
302
|
this.form.column.push(item)
|
|
284
303
|
} else {
|
|
285
304
|
this.$set(this.form.column, this.selectIndex, item)
|
|
@@ -295,7 +314,6 @@ export default {
|
|
|
295
314
|
this.$refs.queryItem.addColumnItemExecute()
|
|
296
315
|
},
|
|
297
316
|
editColumnItem (key, index) {
|
|
298
|
-
this.type = '修改'
|
|
299
317
|
if (this.itemMap[key]) {
|
|
300
318
|
this.$refs.queryItem.editColumnItemExecute(this.itemMap[key])
|
|
301
319
|
this.selectIndex = index
|
|
@@ -331,6 +349,8 @@ export default {
|
|
|
331
349
|
this.form.column.splice(index, 1, itemA)
|
|
332
350
|
this.form.column.splice(newIndex, 1, itemB)
|
|
333
351
|
},
|
|
352
|
+
changeJoinArray () {
|
|
353
|
+
},
|
|
334
354
|
exportJson () {
|
|
335
355
|
const data = JSON.stringify(this.result, null, 2)
|
|
336
356
|
const blob = new Blob([data], { type: 'application/json' })
|
|
@@ -371,25 +391,22 @@ export default {
|
|
|
371
391
|
businessType: '新增',
|
|
372
392
|
title: '效果预览',
|
|
373
393
|
formItems: res.formJson,
|
|
374
|
-
serviceName: this.serviceName
|
|
394
|
+
serviceName: this.serviceName,
|
|
395
|
+
viewMode: true
|
|
375
396
|
})
|
|
376
397
|
})
|
|
377
398
|
})
|
|
378
399
|
}
|
|
379
400
|
})
|
|
380
401
|
},
|
|
381
|
-
submit (
|
|
402
|
+
submit () {
|
|
382
403
|
this.$refs.businessCreateForm.validate(valid => {
|
|
383
|
-
|
|
384
|
-
|
|
404
|
+
if (valid) {
|
|
405
|
+
this.viewHandle(() => {
|
|
406
|
+
// saveQueryParams
|
|
385
407
|
this.exportJson()
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
if (callback) {
|
|
389
|
-
callback()
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
})
|
|
408
|
+
})
|
|
409
|
+
}
|
|
393
410
|
})
|
|
394
411
|
},
|
|
395
412
|
// 判断是否为json字符串
|
|
@@ -438,7 +455,7 @@ export default {
|
|
|
438
455
|
}
|
|
439
456
|
</script>
|
|
440
457
|
<style lang="less" scoped>
|
|
441
|
-
.column_item:hover {
|
|
458
|
+
.column_item :hover {
|
|
442
459
|
background-color:rgba(64, 169, 255,0.25);
|
|
443
460
|
}
|
|
444
461
|
.dragTips{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@onSubmit="onAddOrEditSubmit"/>
|
|
12
12
|
<a-list
|
|
13
13
|
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
14
|
-
:dataSource="
|
|
14
|
+
:dataSource="columnJson.groups"
|
|
15
15
|
>
|
|
16
16
|
<a-list-item slot="renderItem" slot-scope="item">
|
|
17
17
|
<a-card :hoverable="true" @click="toEdit(item)">
|
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
return {
|
|
41
41
|
// 页面宽度
|
|
42
42
|
screenWidth: document.documentElement.clientWidth,
|
|
43
|
+
columnJson: {},
|
|
43
44
|
formObj: {
|
|
44
45
|
groupName: '',
|
|
45
46
|
formJson: []
|
|
@@ -66,10 +67,6 @@ export default {
|
|
|
66
67
|
default: () => {
|
|
67
68
|
return {}
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
-
content: {
|
|
71
|
-
type: Object,
|
|
72
|
-
required: true
|
|
73
70
|
}
|
|
74
71
|
},
|
|
75
72
|
watch: {
|
|
@@ -82,6 +79,9 @@ export default {
|
|
|
82
79
|
methods: {
|
|
83
80
|
// 初始化组件
|
|
84
81
|
initView () {
|
|
82
|
+
this.$emit('getColumnJson', val => {
|
|
83
|
+
this.columnJson = val
|
|
84
|
+
})
|
|
85
85
|
},
|
|
86
86
|
toEdit (item) {
|
|
87
87
|
parseConfig(item, 'SIMPLE_FORM', this.serviceName).then(res => {
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
>
|
|
9
9
|
<create-simple-form-query
|
|
10
10
|
:to-edit-json="editItem()"
|
|
11
|
-
:as-a-params-group="true"
|
|
12
11
|
:visible.sync="createQueryVisible"
|
|
13
|
-
@
|
|
12
|
+
@saveSimpleFormQueryParams="saveQueryParams"
|
|
14
13
|
/>
|
|
15
14
|
<a-list
|
|
16
|
-
:dataSource="
|
|
15
|
+
:dataSource="columnJsonCopy()"
|
|
17
16
|
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
18
17
|
>
|
|
19
18
|
<a-list-item slot="renderItem" slot-scope="item, index">
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
|
|
41
40
|
<script>
|
|
42
41
|
import { mapState } from 'vuex'
|
|
43
|
-
import CreateSimpleFormQuery from '
|
|
42
|
+
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
44
43
|
|
|
45
44
|
export default {
|
|
46
45
|
name: 'FormGroupQuery',
|
|
@@ -54,6 +53,7 @@ export default {
|
|
|
54
53
|
// 是否显示生成查询配置抽屉
|
|
55
54
|
createQueryVisible: false,
|
|
56
55
|
targetIndex: 0,
|
|
56
|
+
columnJson: {},
|
|
57
57
|
editIndex: -1
|
|
58
58
|
}
|
|
59
59
|
},
|
|
@@ -67,10 +67,6 @@ export default {
|
|
|
67
67
|
visible: {
|
|
68
68
|
type: Boolean,
|
|
69
69
|
default: false
|
|
70
|
-
},
|
|
71
|
-
content: {
|
|
72
|
-
type: Object,
|
|
73
|
-
required: true
|
|
74
70
|
}
|
|
75
71
|
},
|
|
76
72
|
watch: {
|
|
@@ -84,6 +80,9 @@ export default {
|
|
|
84
80
|
// 初始化组件
|
|
85
81
|
initView () {
|
|
86
82
|
this.editIndex = -1
|
|
83
|
+
this.$emit('getColumnJson', val => {
|
|
84
|
+
this.columnJson = val
|
|
85
|
+
})
|
|
87
86
|
},
|
|
88
87
|
toCreateQuery () {
|
|
89
88
|
this.editIndex = -1
|
|
@@ -102,8 +101,8 @@ export default {
|
|
|
102
101
|
okType: 'danger',
|
|
103
102
|
cancelText: '取消',
|
|
104
103
|
onOk () {
|
|
105
|
-
_this.
|
|
106
|
-
_this.$emit('saveQueryParams', _this.
|
|
104
|
+
_this.columnJson.groups.splice(index, 1)
|
|
105
|
+
_this.$emit('saveQueryParams', _this.columnJson)
|
|
107
106
|
}
|
|
108
107
|
})
|
|
109
108
|
},
|
|
@@ -112,21 +111,21 @@ export default {
|
|
|
112
111
|
},
|
|
113
112
|
// 存储查询配置信息
|
|
114
113
|
saveQueryParams (source) {
|
|
115
|
-
if (!this.
|
|
116
|
-
this.
|
|
114
|
+
if (!this.columnJson.groups) {
|
|
115
|
+
this.columnJson.groups = []
|
|
117
116
|
}
|
|
118
117
|
if (this.editIndex !== -1) {
|
|
119
|
-
this.
|
|
118
|
+
this.columnJson.groups[this.editIndex] = source
|
|
120
119
|
} else {
|
|
121
|
-
this.
|
|
120
|
+
this.columnJson.groups.push(source)
|
|
122
121
|
}
|
|
123
|
-
this.$emit('saveQueryParams', this.
|
|
122
|
+
this.$emit('saveQueryParams', this.columnJson)
|
|
124
123
|
this.createQueryVisible = false
|
|
125
124
|
},
|
|
126
|
-
|
|
125
|
+
columnJsonCopy () {
|
|
127
126
|
let groups
|
|
128
|
-
if (this.
|
|
129
|
-
groups = JSON.parse(JSON.stringify(this.
|
|
127
|
+
if (this.columnJson.groups) {
|
|
128
|
+
groups = JSON.parse(JSON.stringify(this.columnJson.groups))
|
|
130
129
|
} else {
|
|
131
130
|
groups = []
|
|
132
131
|
}
|
|
@@ -135,7 +134,7 @@ export default {
|
|
|
135
134
|
},
|
|
136
135
|
editItem () {
|
|
137
136
|
if (this.editIndex !== -1) {
|
|
138
|
-
return JSON.parse(JSON.stringify(this.
|
|
137
|
+
return JSON.parse(JSON.stringify(this.columnJson.groups[this.editIndex]))
|
|
139
138
|
} else {
|
|
140
139
|
return {}
|
|
141
140
|
}
|
|
@@ -163,6 +163,8 @@ export default {
|
|
|
163
163
|
break
|
|
164
164
|
} else if (arr[s].children && arr[s].children.length > 0) { // 递归条件
|
|
165
165
|
this.searchitem(option, arr[s].children)
|
|
166
|
+
} else {
|
|
167
|
+
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
},
|
|
@@ -256,10 +258,12 @@ export default {
|
|
|
256
258
|
float: left;
|
|
257
259
|
}
|
|
258
260
|
.ant-card-body {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
:global {
|
|
262
|
+
.ant-tree {
|
|
263
|
+
line-height: 3;
|
|
264
|
+
li {
|
|
265
|
+
position: relative;
|
|
266
|
+
}
|
|
263
267
|
}
|
|
264
268
|
}
|
|
265
269
|
}
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
okText="提交"
|
|
10
10
|
@cancel="close"
|
|
11
11
|
@ok="$refs.nativeForm.onSubmit()">
|
|
12
|
-
<x-add-native-form
|
|
13
|
-
ref="nativeForm"
|
|
14
|
-
@afterSubmit="afterSubmit"
|
|
15
|
-
@onSubmit="onSubmit"
|
|
16
|
-
@tempTableModify="tempTableModify"/>
|
|
12
|
+
<x-add-native-form ref="nativeForm" @onSubmit="onSubmit" @tempTableModify="tempTableModify"/>
|
|
17
13
|
</a-modal>
|
|
18
14
|
</template>
|
|
19
15
|
<script>
|
|
@@ -47,7 +43,6 @@ export default {
|
|
|
47
43
|
},
|
|
48
44
|
methods: {
|
|
49
45
|
init (params) {
|
|
50
|
-
params.showSubmitBtn = false
|
|
51
46
|
const {
|
|
52
47
|
businessType, title
|
|
53
48
|
} = params
|
|
@@ -55,7 +50,7 @@ export default {
|
|
|
55
50
|
this.title = title
|
|
56
51
|
this.visible = true
|
|
57
52
|
const that = this
|
|
58
|
-
that.$nextTick(()
|
|
53
|
+
that.$nextTick(function () {
|
|
59
54
|
that.$refs.nativeForm.init(params)
|
|
60
55
|
})
|
|
61
56
|
},
|
|
@@ -65,20 +60,9 @@ export default {
|
|
|
65
60
|
},
|
|
66
61
|
onSubmit (params) {
|
|
67
62
|
this.loading = true
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.close()
|
|
72
|
-
})
|
|
73
|
-
} else {
|
|
74
|
-
// 触发默认提交事件
|
|
75
|
-
this.$refs.nativeForm.defaultSubmit(params.realForm, () => {
|
|
76
|
-
this.close()
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
afterSubmit (params) {
|
|
81
|
-
this.$emit('afterSubmit', params)
|
|
63
|
+
this.$emit('onSubmit', params, () => {
|
|
64
|
+
this.close()
|
|
65
|
+
})
|
|
82
66
|
},
|
|
83
67
|
tempTableModify (params) {
|
|
84
68
|
this.$emit('tempTableModify', params)
|