vue2-client 1.7.0 → 1.7.2
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 +15 -15
- package/CHANGELOG.md +661 -628
- package/Components.md +60 -0
- package/index.js +31 -30
- package/package.json +83 -81
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +369 -279
- package/src/base-client/components/common/XAddNativeForm/index.md +107 -17
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
- package/src/base-client/components/common/XDataDrawer/index.js +3 -0
- package/src/base-client/components/common/XDataDrawer/index.md +41 -0
- package/src/base-client/components/common/XForm/XForm.vue +178 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +519 -506
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/index.js +41 -0
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +75 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +4 -2
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/lib.js +1 -0
- package/src/mock/goods/index.js +108 -108
- package/src/pages/CreateQueryPage.vue +84 -84
- package/src/pages/login/Login.vue +369 -369
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +66 -66
- package/src/router/guards.js +52 -12
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +137 -137
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/login.js +138 -0
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,146 +1,144 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
title="选择参数组"
|
|
4
|
-
placement="right"
|
|
5
|
-
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
-
:visible="visible"
|
|
7
|
-
@close="onClose"
|
|
8
|
-
>
|
|
9
|
-
<x-add-form
|
|
10
|
-
ref="xAddForm"
|
|
11
|
-
@onSubmit="onAddOrEditSubmit"/>
|
|
12
|
-
<a-list
|
|
13
|
-
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
14
|
-
:dataSource="columnJson.groups"
|
|
15
|
-
>
|
|
16
|
-
<a-list-item slot="renderItem" slot-scope="item">
|
|
17
|
-
<a-card :hoverable="true" @click="toEdit(item)">
|
|
18
|
-
<a-card-meta >
|
|
19
|
-
<div style="margin-bottom: 3px" slot="title">{{ item.group }}</div>
|
|
20
|
-
<a-icon type="tags" slot="avatar" :style="{ fontSize:'2em' }"/>
|
|
21
|
-
<div class="meta-content" slot="description">{{ item.describe }}</div>
|
|
22
|
-
</a-card-meta>
|
|
23
|
-
</a-card>
|
|
24
|
-
</a-list-item>
|
|
25
|
-
</a-list>
|
|
26
|
-
</a-drawer>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
import { mapState } from 'vuex'
|
|
31
|
-
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
32
|
-
import { post } from '@vue2-client/services/api'
|
|
33
|
-
import { getConfigUrl } from '@vue2-client/services/api/common'
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
name: 'FormGroupEdit',
|
|
37
|
-
components: {
|
|
38
|
-
XAddForm
|
|
39
|
-
},
|
|
40
|
-
data () {
|
|
41
|
-
return {
|
|
42
|
-
// 页面宽度
|
|
43
|
-
screenWidth: document.documentElement.clientWidth,
|
|
44
|
-
columnJson: {},
|
|
45
|
-
formObj: {
|
|
46
|
-
groupName: '',
|
|
47
|
-
formJson: []
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
mounted () {
|
|
52
|
-
this.initView()
|
|
53
|
-
},
|
|
54
|
-
computed: {
|
|
55
|
-
...mapState('setting', ['isMobile'])
|
|
56
|
-
},
|
|
57
|
-
props: {
|
|
58
|
-
visible: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false
|
|
61
|
-
},
|
|
62
|
-
serviceName: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: undefined
|
|
65
|
-
},
|
|
66
|
-
modifyModelData: {
|
|
67
|
-
type: Object,
|
|
68
|
-
default: () => {
|
|
69
|
-
return {}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
watch: {
|
|
74
|
-
visible (rel) {
|
|
75
|
-
if (rel) {
|
|
76
|
-
this.initView()
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
methods: {
|
|
81
|
-
// 初始化组件
|
|
82
|
-
initView () {
|
|
83
|
-
this.$emit('getColumnJson', val => {
|
|
84
|
-
this.columnJson = val
|
|
85
|
-
})
|
|
86
|
-
},
|
|
87
|
-
toEdit (item) {
|
|
88
|
-
const url = getConfigUrl(this.serviceName)
|
|
89
|
-
post(url, { queryObject: item }).then(res => {
|
|
90
|
-
this.formObj = res
|
|
91
|
-
this
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.$message.
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
title="选择参数组"
|
|
4
|
+
placement="right"
|
|
5
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
+
:visible="visible"
|
|
7
|
+
@close="onClose"
|
|
8
|
+
>
|
|
9
|
+
<x-add-form
|
|
10
|
+
ref="xAddForm"
|
|
11
|
+
@onSubmit="onAddOrEditSubmit"/>
|
|
12
|
+
<a-list
|
|
13
|
+
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
14
|
+
:dataSource="columnJson.groups"
|
|
15
|
+
>
|
|
16
|
+
<a-list-item slot="renderItem" slot-scope="item">
|
|
17
|
+
<a-card :hoverable="true" @click="toEdit(item)">
|
|
18
|
+
<a-card-meta >
|
|
19
|
+
<div style="margin-bottom: 3px" slot="title">{{ item.group }}</div>
|
|
20
|
+
<a-icon type="tags" slot="avatar" :style="{ fontSize:'2em' }"/>
|
|
21
|
+
<div class="meta-content" slot="description">{{ item.describe }}</div>
|
|
22
|
+
</a-card-meta>
|
|
23
|
+
</a-card>
|
|
24
|
+
</a-list-item>
|
|
25
|
+
</a-list>
|
|
26
|
+
</a-drawer>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import { mapState } from 'vuex'
|
|
31
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
32
|
+
import { post } from '@vue2-client/services/api'
|
|
33
|
+
import { getConfigUrl } from '@vue2-client/services/api/common'
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'FormGroupEdit',
|
|
37
|
+
components: {
|
|
38
|
+
XAddForm
|
|
39
|
+
},
|
|
40
|
+
data () {
|
|
41
|
+
return {
|
|
42
|
+
// 页面宽度
|
|
43
|
+
screenWidth: document.documentElement.clientWidth,
|
|
44
|
+
columnJson: {},
|
|
45
|
+
formObj: {
|
|
46
|
+
groupName: '',
|
|
47
|
+
formJson: []
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
mounted () {
|
|
52
|
+
this.initView()
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
...mapState('setting', ['isMobile'])
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
visible: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
serviceName: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: undefined
|
|
65
|
+
},
|
|
66
|
+
modifyModelData: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => {
|
|
69
|
+
return {}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
visible (rel) {
|
|
75
|
+
if (rel) {
|
|
76
|
+
this.initView()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
// 初始化组件
|
|
82
|
+
initView () {
|
|
83
|
+
this.$emit('getColumnJson', val => {
|
|
84
|
+
this.columnJson = val
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
toEdit (item) {
|
|
88
|
+
const url = getConfigUrl(this.serviceName)
|
|
89
|
+
post(url, { queryObject: item }).then(res => {
|
|
90
|
+
this.formObj = res
|
|
91
|
+
const modifyModelData = { data: this.modifyModelData[res.groupName] }
|
|
92
|
+
this.$refs.xAddForm.init({
|
|
93
|
+
businessType: '修改',
|
|
94
|
+
title: '参数项',
|
|
95
|
+
formItems: res.formJson,
|
|
96
|
+
serviceName: res.serviceName,
|
|
97
|
+
modifyModelData: modifyModelData
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
onClose () {
|
|
102
|
+
this.$emit('update:visible', false)
|
|
103
|
+
},
|
|
104
|
+
onAddOrEditSubmit (res, callback) {
|
|
105
|
+
const requestParameters = {
|
|
106
|
+
paramsJson: {}
|
|
107
|
+
}
|
|
108
|
+
requestParameters.paramsJson[this.formObj.groupName] = {}
|
|
109
|
+
for (const key of Object.keys(res.realForm)) {
|
|
110
|
+
requestParameters.paramsJson[this.formObj.groupName][key] = res.realForm[key]
|
|
111
|
+
}
|
|
112
|
+
this.$emit('onSubmit', requestParameters, result => {
|
|
113
|
+
if (result) {
|
|
114
|
+
this.$message.success('提交成功!')
|
|
115
|
+
} else {
|
|
116
|
+
this.$message.error('提交失败!')
|
|
117
|
+
}
|
|
118
|
+
callback()
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
<style lang="less" scoped>
|
|
125
|
+
.card-avatar {
|
|
126
|
+
width: 48px;
|
|
127
|
+
height: 48px;
|
|
128
|
+
border-radius: 48px;
|
|
129
|
+
}
|
|
130
|
+
.new-btn{
|
|
131
|
+
border-radius: 2px;
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 187px;
|
|
134
|
+
}
|
|
135
|
+
.meta-content{
|
|
136
|
+
position: relative;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
display: -webkit-box;
|
|
140
|
+
height: 64px;
|
|
141
|
+
-webkit-line-clamp: 3;
|
|
142
|
+
-webkit-box-orient: vertical;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
:visible="visible"
|
|
4
|
-
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
5
|
-
placement="right"
|
|
6
|
-
title="表单参数组配置"
|
|
7
|
-
@close="onClose"
|
|
8
|
-
>
|
|
9
|
-
<create-simple-form-query
|
|
10
|
-
:to-edit-json="editItem()"
|
|
11
|
-
:visible.sync="createQueryVisible"
|
|
12
|
-
@saveSimpleFormQueryParams="saveQueryParams"
|
|
13
|
-
/>
|
|
14
|
-
<a-list
|
|
15
|
-
:dataSource="columnJsonCopy()"
|
|
16
|
-
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
17
|
-
>
|
|
18
|
-
<a-list-item slot="renderItem" slot-scope="item, index">
|
|
19
|
-
<template v-if="item.type">
|
|
20
|
-
<a-button class="new-btn" type="dashed" @click="toCreateQuery">
|
|
21
|
-
<a-icon type="plus" />新增参数组
|
|
22
|
-
</a-button>
|
|
23
|
-
</template>
|
|
24
|
-
<template v-else>
|
|
25
|
-
<a-card :hoverable="true">
|
|
26
|
-
<a-card-meta >
|
|
27
|
-
<div slot="title" style="margin-bottom: 3px">{{ item.group }}</div>
|
|
28
|
-
<a-icon slot="avatar" :style="{ fontSize:'2em' }" type="tags"/>
|
|
29
|
-
<div slot="description" class="meta-content">{{ item.describe }}</div>
|
|
30
|
-
</a-card-meta>
|
|
31
|
-
<a slot="actions" @click="toEditQuery(index)">编辑</a>
|
|
32
|
-
<a slot="actions" @click="toDelete(index)">删除</a>
|
|
33
|
-
</a-card>
|
|
34
|
-
</template>
|
|
35
|
-
</a-list-item>
|
|
36
|
-
</a-list>
|
|
37
|
-
</a-drawer>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import { mapState } from 'vuex'
|
|
42
|
-
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
name: 'FormGroupQuery',
|
|
46
|
-
components: {
|
|
47
|
-
CreateSimpleFormQuery
|
|
48
|
-
},
|
|
49
|
-
data () {
|
|
50
|
-
return {
|
|
51
|
-
// 页面宽度
|
|
52
|
-
screenWidth: document.documentElement.clientWidth,
|
|
53
|
-
// 是否显示生成查询配置抽屉
|
|
54
|
-
createQueryVisible: false,
|
|
55
|
-
targetIndex: 0,
|
|
56
|
-
columnJson: {},
|
|
57
|
-
editIndex: -1
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
mounted () {
|
|
61
|
-
this.initView()
|
|
62
|
-
},
|
|
63
|
-
computed: {
|
|
64
|
-
...mapState('setting', ['isMobile'])
|
|
65
|
-
},
|
|
66
|
-
props: {
|
|
67
|
-
visible: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
watch: {
|
|
73
|
-
visible (rel) {
|
|
74
|
-
if (rel) {
|
|
75
|
-
this.initView()
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
// 初始化组件
|
|
81
|
-
initView () {
|
|
82
|
-
this.editIndex = -1
|
|
83
|
-
this.$emit('getColumnJson', val => {
|
|
84
|
-
this.columnJson = val
|
|
85
|
-
})
|
|
86
|
-
},
|
|
87
|
-
toCreateQuery () {
|
|
88
|
-
this.editIndex = -1
|
|
89
|
-
this.createQueryVisible = true
|
|
90
|
-
},
|
|
91
|
-
toEditQuery (index) {
|
|
92
|
-
this.editIndex = index
|
|
93
|
-
this.createQueryVisible = true
|
|
94
|
-
},
|
|
95
|
-
toDelete (index) {
|
|
96
|
-
const _this = this
|
|
97
|
-
this.$confirm({
|
|
98
|
-
title: '您确定要删除该参数组?',
|
|
99
|
-
content: '删除的参数组无法恢复',
|
|
100
|
-
okText: '确定',
|
|
101
|
-
okType: 'danger',
|
|
102
|
-
cancelText: '取消',
|
|
103
|
-
onOk () {
|
|
104
|
-
_this.columnJson.groups.splice(index, 1)
|
|
105
|
-
_this.$emit('saveQueryParams', _this.columnJson)
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
},
|
|
109
|
-
onClose () {
|
|
110
|
-
this.$emit('update:visible', false)
|
|
111
|
-
},
|
|
112
|
-
// 存储查询配置信息
|
|
113
|
-
saveQueryParams (source) {
|
|
114
|
-
if (!this.columnJson.groups) {
|
|
115
|
-
this.columnJson.groups = []
|
|
116
|
-
}
|
|
117
|
-
if (this.editIndex !== -1) {
|
|
118
|
-
this.columnJson.groups[this.editIndex] = source
|
|
119
|
-
} else {
|
|
120
|
-
this.columnJson.groups.push(source)
|
|
121
|
-
}
|
|
122
|
-
this.$emit('saveQueryParams', this.columnJson)
|
|
123
|
-
this.createQueryVisible = false
|
|
124
|
-
},
|
|
125
|
-
columnJsonCopy () {
|
|
126
|
-
let groups
|
|
127
|
-
if (this.columnJson.groups) {
|
|
128
|
-
groups = JSON.parse(JSON.stringify(this.columnJson.groups))
|
|
129
|
-
} else {
|
|
130
|
-
groups = []
|
|
131
|
-
}
|
|
132
|
-
groups.push({ type: 'add' })
|
|
133
|
-
return groups
|
|
134
|
-
},
|
|
135
|
-
editItem () {
|
|
136
|
-
if (this.editIndex !== -1) {
|
|
137
|
-
return JSON.parse(JSON.stringify(this.columnJson.groups[this.editIndex]))
|
|
138
|
-
} else {
|
|
139
|
-
return {}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
</script>
|
|
145
|
-
<style lang="less" scoped>
|
|
146
|
-
.card-avatar {
|
|
147
|
-
width: 48px;
|
|
148
|
-
height: 48px;
|
|
149
|
-
border-radius: 48px;
|
|
150
|
-
}
|
|
151
|
-
.new-btn{
|
|
152
|
-
border-radius: 2px;
|
|
153
|
-
width: 100%;
|
|
154
|
-
height: 187px;
|
|
155
|
-
}
|
|
156
|
-
.meta-content{
|
|
157
|
-
position: relative;
|
|
158
|
-
overflow: hidden;
|
|
159
|
-
text-overflow: ellipsis;
|
|
160
|
-
display: -webkit-box;
|
|
161
|
-
height: 64px;
|
|
162
|
-
-webkit-line-clamp: 3;
|
|
163
|
-
-webkit-box-orient: vertical;
|
|
164
|
-
}
|
|
165
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
:visible="visible"
|
|
4
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
5
|
+
placement="right"
|
|
6
|
+
title="表单参数组配置"
|
|
7
|
+
@close="onClose"
|
|
8
|
+
>
|
|
9
|
+
<create-simple-form-query
|
|
10
|
+
:to-edit-json="editItem()"
|
|
11
|
+
:visible.sync="createQueryVisible"
|
|
12
|
+
@saveSimpleFormQueryParams="saveQueryParams"
|
|
13
|
+
/>
|
|
14
|
+
<a-list
|
|
15
|
+
:dataSource="columnJsonCopy()"
|
|
16
|
+
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
17
|
+
>
|
|
18
|
+
<a-list-item slot="renderItem" slot-scope="item, index">
|
|
19
|
+
<template v-if="item.type">
|
|
20
|
+
<a-button class="new-btn" type="dashed" @click="toCreateQuery">
|
|
21
|
+
<a-icon type="plus" />新增参数组
|
|
22
|
+
</a-button>
|
|
23
|
+
</template>
|
|
24
|
+
<template v-else>
|
|
25
|
+
<a-card :hoverable="true">
|
|
26
|
+
<a-card-meta >
|
|
27
|
+
<div slot="title" style="margin-bottom: 3px">{{ item.group }}</div>
|
|
28
|
+
<a-icon slot="avatar" :style="{ fontSize:'2em' }" type="tags"/>
|
|
29
|
+
<div slot="description" class="meta-content">{{ item.describe }}</div>
|
|
30
|
+
</a-card-meta>
|
|
31
|
+
<a slot="actions" @click="toEditQuery(index)">编辑</a>
|
|
32
|
+
<a slot="actions" @click="toDelete(index)">删除</a>
|
|
33
|
+
</a-card>
|
|
34
|
+
</template>
|
|
35
|
+
</a-list-item>
|
|
36
|
+
</a-list>
|
|
37
|
+
</a-drawer>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { mapState } from 'vuex'
|
|
42
|
+
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'FormGroupQuery',
|
|
46
|
+
components: {
|
|
47
|
+
CreateSimpleFormQuery
|
|
48
|
+
},
|
|
49
|
+
data () {
|
|
50
|
+
return {
|
|
51
|
+
// 页面宽度
|
|
52
|
+
screenWidth: document.documentElement.clientWidth,
|
|
53
|
+
// 是否显示生成查询配置抽屉
|
|
54
|
+
createQueryVisible: false,
|
|
55
|
+
targetIndex: 0,
|
|
56
|
+
columnJson: {},
|
|
57
|
+
editIndex: -1
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
mounted () {
|
|
61
|
+
this.initView()
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
...mapState('setting', ['isMobile'])
|
|
65
|
+
},
|
|
66
|
+
props: {
|
|
67
|
+
visible: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
watch: {
|
|
73
|
+
visible (rel) {
|
|
74
|
+
if (rel) {
|
|
75
|
+
this.initView()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
// 初始化组件
|
|
81
|
+
initView () {
|
|
82
|
+
this.editIndex = -1
|
|
83
|
+
this.$emit('getColumnJson', val => {
|
|
84
|
+
this.columnJson = val
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
toCreateQuery () {
|
|
88
|
+
this.editIndex = -1
|
|
89
|
+
this.createQueryVisible = true
|
|
90
|
+
},
|
|
91
|
+
toEditQuery (index) {
|
|
92
|
+
this.editIndex = index
|
|
93
|
+
this.createQueryVisible = true
|
|
94
|
+
},
|
|
95
|
+
toDelete (index) {
|
|
96
|
+
const _this = this
|
|
97
|
+
this.$confirm({
|
|
98
|
+
title: '您确定要删除该参数组?',
|
|
99
|
+
content: '删除的参数组无法恢复',
|
|
100
|
+
okText: '确定',
|
|
101
|
+
okType: 'danger',
|
|
102
|
+
cancelText: '取消',
|
|
103
|
+
onOk () {
|
|
104
|
+
_this.columnJson.groups.splice(index, 1)
|
|
105
|
+
_this.$emit('saveQueryParams', _this.columnJson)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
},
|
|
109
|
+
onClose () {
|
|
110
|
+
this.$emit('update:visible', false)
|
|
111
|
+
},
|
|
112
|
+
// 存储查询配置信息
|
|
113
|
+
saveQueryParams (source) {
|
|
114
|
+
if (!this.columnJson.groups) {
|
|
115
|
+
this.columnJson.groups = []
|
|
116
|
+
}
|
|
117
|
+
if (this.editIndex !== -1) {
|
|
118
|
+
this.columnJson.groups[this.editIndex] = source
|
|
119
|
+
} else {
|
|
120
|
+
this.columnJson.groups.push(source)
|
|
121
|
+
}
|
|
122
|
+
this.$emit('saveQueryParams', this.columnJson)
|
|
123
|
+
this.createQueryVisible = false
|
|
124
|
+
},
|
|
125
|
+
columnJsonCopy () {
|
|
126
|
+
let groups
|
|
127
|
+
if (this.columnJson.groups) {
|
|
128
|
+
groups = JSON.parse(JSON.stringify(this.columnJson.groups))
|
|
129
|
+
} else {
|
|
130
|
+
groups = []
|
|
131
|
+
}
|
|
132
|
+
groups.push({ type: 'add' })
|
|
133
|
+
return groups
|
|
134
|
+
},
|
|
135
|
+
editItem () {
|
|
136
|
+
if (this.editIndex !== -1) {
|
|
137
|
+
return JSON.parse(JSON.stringify(this.columnJson.groups[this.editIndex]))
|
|
138
|
+
} else {
|
|
139
|
+
return {}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</script>
|
|
145
|
+
<style lang="less" scoped>
|
|
146
|
+
.card-avatar {
|
|
147
|
+
width: 48px;
|
|
148
|
+
height: 48px;
|
|
149
|
+
border-radius: 48px;
|
|
150
|
+
}
|
|
151
|
+
.new-btn{
|
|
152
|
+
border-radius: 2px;
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 187px;
|
|
155
|
+
}
|
|
156
|
+
.meta-content{
|
|
157
|
+
position: relative;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
text-overflow: ellipsis;
|
|
160
|
+
display: -webkit-box;
|
|
161
|
+
height: 64px;
|
|
162
|
+
-webkit-line-clamp: 3;
|
|
163
|
+
-webkit-box-orient: vertical;
|
|
164
|
+
}
|
|
165
|
+
</style>
|