vue2-client 1.8.10 → 1.8.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 +6 -0
- package/package.json +1 -1
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +11 -24
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +12 -4
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +15 -16
- package/src/base-client/components/common/XStepView/XStepView.vue +25 -28
- package/src/config/CreateQueryConfig.js +6 -1
- package/src/services/api/common.js +10 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<a-button icon="import" @click="$message.warn('从创意库中选择并引用高质量的通用表单项配置,敬请期待')">从创意库引入</a-button>
|
|
69
69
|
</a-space>
|
|
70
70
|
<a-row :gutter="24">
|
|
71
|
-
<a-col :span="
|
|
71
|
+
<a-col :span="6">
|
|
72
72
|
<span style="font-weight: bold">
|
|
73
73
|
标签名
|
|
74
74
|
</span>
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
字段名
|
|
79
79
|
</span>
|
|
80
80
|
</a-col>
|
|
81
|
-
<a-col :span="
|
|
81
|
+
<a-col :span="9">
|
|
82
82
|
<span style="font-weight: bold">
|
|
83
83
|
数据模式
|
|
84
84
|
</span>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<span class="dragTips">拖到此处放置</span>
|
|
103
103
|
</a-row>
|
|
104
104
|
<a-row :gutter="24" class="column_item">
|
|
105
|
-
<a-col :span="
|
|
105
|
+
<a-col :span="6">
|
|
106
106
|
<span style="font-weight: bold">
|
|
107
107
|
{{ columnItem.title }}
|
|
108
108
|
</span>
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
{{ columnItem.key }}
|
|
113
113
|
</span>
|
|
114
114
|
</a-col>
|
|
115
|
-
<a-col :span="
|
|
115
|
+
<a-col :span="9">
|
|
116
116
|
<a-tooltip>
|
|
117
117
|
<template slot="title">
|
|
118
118
|
查询表单项
|
|
@@ -145,7 +145,13 @@
|
|
|
145
145
|
</a-tooltip>
|
|
146
146
|
<a-tooltip>
|
|
147
147
|
<template slot="title">
|
|
148
|
-
|
|
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
|
+
数据组
|
|
149
155
|
</template>
|
|
150
156
|
<a-tag :color="columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
|
151
157
|
</a-tooltip>
|
|
@@ -385,27 +391,8 @@ export default {
|
|
|
385
391
|
}, this.toEditJson
|
|
386
392
|
)
|
|
387
393
|
for (const columnItem of this.form.column) {
|
|
388
|
-
// 数据模式兼容性处理
|
|
389
394
|
if (!(columnItem.dataMode || columnItem.dataModeArray)) {
|
|
390
395
|
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
391
|
-
} else if (columnItem.dataMode) {
|
|
392
|
-
if (columnItem.dataMode === 'all') {
|
|
393
|
-
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
394
|
-
} else if (columnItem.dataMode === 'form') {
|
|
395
|
-
columnItem.dataModeArray = ['queryForm', 'addOrEditForm', 'sqlQueryCondition']
|
|
396
|
-
} else if (columnItem.dataMode === 'table') {
|
|
397
|
-
columnItem.dataModeArray = ['table', 'sqlQueryItem']
|
|
398
|
-
} else if (columnItem.dataMode === 'table_form') {
|
|
399
|
-
columnItem.dataModeArray = ['table', 'sqlQueryItem', 'sqlQueryCondition']
|
|
400
|
-
} else if (columnItem.dataMode === 'only_form') {
|
|
401
|
-
columnItem.dataModeArray = ['queryForm']
|
|
402
|
-
} else if (columnItem.dataMode === 'only_table') {
|
|
403
|
-
columnItem.dataModeArray = ['table']
|
|
404
|
-
} else if (columnItem.dataMode === 'clear') {
|
|
405
|
-
columnItem.dataModeArray = ['sqlQueryItem', 'sqlQueryCondition']
|
|
406
|
-
} else if (columnItem.dataMode === 'only_add_modify') {
|
|
407
|
-
columnItem.dataModeArray = ['addOrEditForm', 'sqlQueryItem']
|
|
408
|
-
}
|
|
409
396
|
}
|
|
410
397
|
delete columnItem.dataMode
|
|
411
398
|
// 插槽兼容处理
|
|
@@ -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>
|
|
@@ -489,7 +495,9 @@ export default {
|
|
|
489
495
|
table: false,
|
|
490
496
|
addOrEditForm: false,
|
|
491
497
|
sqlQueryItem: false,
|
|
492
|
-
sqlQueryCondition: false
|
|
498
|
+
sqlQueryCondition: false,
|
|
499
|
+
excelImportItem: false,
|
|
500
|
+
group: false
|
|
493
501
|
}
|
|
494
502
|
for (const item of this.dataModeArrayData) {
|
|
495
503
|
result[item] = true
|
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
</p>
|
|
28
28
|
</a-upload-dragger>
|
|
29
29
|
<a-divider/>
|
|
30
|
-
<a-checkbox @change="handleCheckedUpdateSupport" :checked="updateSupport !== 0">
|
|
31
|
-
是否更新已经存在的数据
|
|
32
|
-
</a-checkbox>
|
|
33
30
|
<a v-if="queryParamsName !== 'none'" @click="importTemplate">下载导入模板</a>
|
|
34
31
|
</a-spin>
|
|
35
32
|
</a-modal>
|
|
@@ -37,14 +34,14 @@
|
|
|
37
34
|
|
|
38
35
|
<script>
|
|
39
36
|
|
|
40
|
-
import { importData,
|
|
37
|
+
import { importData, downloadImportExcel } from '@vue2-client/services/api/common'
|
|
41
38
|
|
|
42
39
|
export default {
|
|
43
40
|
name: 'XImportExcel',
|
|
44
41
|
props: {
|
|
45
42
|
serviceName: {
|
|
46
43
|
type: String,
|
|
47
|
-
default:
|
|
44
|
+
default: undefined
|
|
48
45
|
},
|
|
49
46
|
queryParamsName: {
|
|
50
47
|
type: String,
|
|
@@ -64,8 +61,7 @@ export default {
|
|
|
64
61
|
uploadStatus: '',
|
|
65
62
|
fileList: [],
|
|
66
63
|
// 是否禁用上传
|
|
67
|
-
uploading: false
|
|
68
|
-
updateSupport: 0
|
|
64
|
+
uploading: false
|
|
69
65
|
}
|
|
70
66
|
},
|
|
71
67
|
filters: {
|
|
@@ -86,11 +82,15 @@ export default {
|
|
|
86
82
|
},
|
|
87
83
|
/** 下载模板操作 */
|
|
88
84
|
importTemplate () {
|
|
89
|
-
|
|
90
|
-
queryParamsName: this.queryParamsName
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
downloadImportExcel({
|
|
86
|
+
queryParamsName: this.queryParamsName
|
|
87
|
+
}, this.serviceName).then(res => {
|
|
88
|
+
if (!res) {
|
|
89
|
+
this.$message.warn('导入模板不存在,请检查配置')
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
window.open('/res/excel/export/' + res)
|
|
93
|
+
})
|
|
94
94
|
},
|
|
95
95
|
/** 导入excel窗体开启 */
|
|
96
96
|
importExcelHandleOpen (e) {
|
|
@@ -110,19 +110,18 @@ export default {
|
|
|
110
110
|
}
|
|
111
111
|
this.uploading = true
|
|
112
112
|
formData.append('file', fileList[0])
|
|
113
|
-
formData.append('
|
|
113
|
+
formData.append('queryParamsName', this.queryParamsName)
|
|
114
114
|
importData(formData).then(response => {
|
|
115
115
|
this.fileList = []
|
|
116
116
|
this.$message.success(response.msg)
|
|
117
117
|
this.open = false
|
|
118
118
|
this.$emit('ok')
|
|
119
|
+
}).catch(e => {
|
|
120
|
+
this.$message.error(e)
|
|
119
121
|
}).finally(() => {
|
|
120
122
|
this.uploading = false
|
|
121
123
|
})
|
|
122
124
|
},
|
|
123
|
-
handleCheckedUpdateSupport () {
|
|
124
|
-
this.updateSupport = this.updateSupport === 0 ? 1 : 0
|
|
125
|
-
},
|
|
126
125
|
handleRemove () {
|
|
127
126
|
this.fileList = []
|
|
128
127
|
this.uploading = false
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:size="stepStyle.size"
|
|
12
12
|
:initial="initial"
|
|
13
13
|
:status="status"
|
|
14
|
-
@
|
|
14
|
+
@chaneg="onChange"
|
|
15
15
|
>
|
|
16
16
|
<a-step
|
|
17
17
|
v-for="(item, index) in this.configContent.step.steps"
|
|
@@ -82,11 +82,11 @@ export default {
|
|
|
82
82
|
props: {
|
|
83
83
|
params: {
|
|
84
84
|
type: Object,
|
|
85
|
-
required: true
|
|
85
|
+
required: true,
|
|
86
86
|
},
|
|
87
87
|
configContent: {
|
|
88
88
|
type: Object,
|
|
89
|
-
required: true
|
|
89
|
+
required: true,
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
data () {
|
|
@@ -94,49 +94,40 @@ export default {
|
|
|
94
94
|
current: -1,
|
|
95
95
|
initial: 0,
|
|
96
96
|
status: 'wait',
|
|
97
|
-
iconType: 'loading'
|
|
97
|
+
iconType: 'loading',
|
|
98
|
+
timeOut: undefined
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
101
|
watch: {
|
|
101
102
|
async current (newValue) {
|
|
102
103
|
this.changeIcon()
|
|
104
|
+
if (this.timeOut !== undefined) { window.clearTimeout(this.timeOut) }
|
|
105
|
+
|
|
103
106
|
const setpes = this.configContent.step.steps[newValue]
|
|
104
107
|
const type = setpes.content.card.type
|
|
105
108
|
const formValue = setpes.content.card.value
|
|
106
|
-
|
|
109
|
+
console.warn('formValue = ', formValue)
|
|
107
110
|
if (setpes.before) {
|
|
108
111
|
const postName = setpes.before.name.split('@')
|
|
109
|
-
|
|
110
|
-
timeOut = window.setInterval(() => {
|
|
111
|
-
times++
|
|
112
|
+
this.timeOut = window.setTimeout(() => {
|
|
112
113
|
post('/api/af-system/' + postName[0] + '/' + postName[1], setpes.before.params).then(res => {
|
|
113
114
|
console.warn(setpes.before.name + '执行结果', res)
|
|
114
115
|
if (res.code === 200) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.success()
|
|
118
|
-
}
|
|
116
|
+
window.clearInterval(this.timeOut)
|
|
117
|
+
this.success()
|
|
119
118
|
} else {
|
|
120
119
|
setpes.content.card.value = res.msg
|
|
121
120
|
}
|
|
122
121
|
}).catch(e => {
|
|
123
122
|
console.warn(setpes.before.name + '执行结果', e)
|
|
124
|
-
window.
|
|
125
|
-
|
|
123
|
+
window.clearInterval(this.timeOut)
|
|
126
124
|
this.error()
|
|
127
125
|
})
|
|
128
|
-
if (times > 12) {
|
|
129
|
-
window.clearTimeout(timeOut)
|
|
130
|
-
setpes.content.card.value = '未查询到开户信息,请确认'
|
|
131
|
-
this.error()
|
|
132
|
-
}
|
|
133
126
|
}, 10 * 1000)
|
|
134
127
|
}
|
|
135
128
|
if (type === 'form') {
|
|
136
|
-
console.warn('formValue = ', formValue)
|
|
137
129
|
this.$nextTick(() => {
|
|
138
130
|
const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
|
|
139
|
-
console.warn('stepsss', stepsss)
|
|
140
131
|
stepsss.init({
|
|
141
132
|
formItems: formValue
|
|
142
133
|
})
|
|
@@ -145,7 +136,6 @@ export default {
|
|
|
145
136
|
console.warn('formValue = ', formValue)
|
|
146
137
|
this.$nextTick(() => {
|
|
147
138
|
const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
|
|
148
|
-
console.warn('stepsss', stepsss)
|
|
149
139
|
stepsss.init({
|
|
150
140
|
tableColumns: formValue,
|
|
151
141
|
buttonState: {
|
|
@@ -175,14 +165,21 @@ export default {
|
|
|
175
165
|
}
|
|
176
166
|
},
|
|
177
167
|
mounted () {
|
|
178
|
-
|
|
168
|
+
let paramsStr = JSON.stringify(this.configContent.step)
|
|
169
|
+
for (const item in this.params) {
|
|
170
|
+
const regex = new RegExp('\\$\\{' + item + '\\}', 'g')
|
|
171
|
+
paramsStr = paramsStr.replace(regex, this.params[item])
|
|
172
|
+
}
|
|
173
|
+
const params = JSON.parse(paramsStr)
|
|
174
|
+
this.init({ step: params })
|
|
175
|
+
this.current++
|
|
179
176
|
},
|
|
180
177
|
methods: {
|
|
181
178
|
init (params) {
|
|
182
179
|
const {
|
|
183
180
|
style,
|
|
184
181
|
panel,
|
|
185
|
-
|
|
182
|
+
step
|
|
186
183
|
} = params
|
|
187
184
|
if (style) {
|
|
188
185
|
this.stepStyle = style
|
|
@@ -190,10 +187,9 @@ export default {
|
|
|
190
187
|
if (panel) {
|
|
191
188
|
this.panelStyle = panel
|
|
192
189
|
}
|
|
193
|
-
if (
|
|
194
|
-
this.configContent.step
|
|
190
|
+
if (step) {
|
|
191
|
+
this.configContent.step = step
|
|
195
192
|
}
|
|
196
|
-
this.current++
|
|
197
193
|
},
|
|
198
194
|
steps () {
|
|
199
195
|
return this.steps
|
|
@@ -208,7 +204,7 @@ export default {
|
|
|
208
204
|
post('/api/af-system/logic/' + setpes.run.name, res.realForm).then(t => {
|
|
209
205
|
console.warn(setpes.run.name + '执行结果', t)
|
|
210
206
|
if (t.code === 200) {
|
|
211
|
-
|
|
207
|
+
this.success()
|
|
212
208
|
}
|
|
213
209
|
}).catch(e => {
|
|
214
210
|
console.warn(setpes.run.name + '执行结果', e)
|
|
@@ -222,6 +218,7 @@ export default {
|
|
|
222
218
|
},
|
|
223
219
|
success () {
|
|
224
220
|
this.changeIcon()
|
|
221
|
+
|
|
225
222
|
this.current++
|
|
226
223
|
},
|
|
227
224
|
changeIcon () {
|
|
@@ -27,7 +27,12 @@ module.exports = {
|
|
|
27
27
|
noMatch: ['file', 'image', 'textarea', 'personSetting']
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
label: '
|
|
30
|
+
label: 'Excel导入项',
|
|
31
|
+
value: 'excelImportItem',
|
|
32
|
+
noMatch: ['file', 'image', 'personSetting']
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: '数据组',
|
|
31
36
|
value: 'group',
|
|
32
37
|
noMatch: []
|
|
33
38
|
}
|
|
@@ -22,9 +22,11 @@ const commonApi = {
|
|
|
22
22
|
// 通用删除
|
|
23
23
|
delete: 'logic/commonDelete',
|
|
24
24
|
// 导入数据
|
|
25
|
-
importData: '
|
|
25
|
+
importData: 'crud/importDataByExcel',
|
|
26
26
|
// 导出数据
|
|
27
27
|
exportData: 'logic/commonExport',
|
|
28
|
+
// 导入模板下载
|
|
29
|
+
downloadImportTemplate: 'logic/commonDownloadImportTemplate',
|
|
28
30
|
// 下载数据
|
|
29
31
|
download: 'resource/download',
|
|
30
32
|
// 通用上传
|
|
@@ -158,6 +160,13 @@ export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME
|
|
|
158
160
|
return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
|
|
159
161
|
}
|
|
160
162
|
|
|
163
|
+
/**
|
|
164
|
+
* 通用导入模板下载
|
|
165
|
+
*/
|
|
166
|
+
export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
167
|
+
return post('/api/' + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
|
|
168
|
+
}
|
|
169
|
+
|
|
161
170
|
// 通用下载
|
|
162
171
|
export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
163
172
|
const notificationKey = 'download'
|