vue2-client 1.8.11 → 1.8.13

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.
@@ -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, download } from '@vue2-client/services/api/common'
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: 'system'
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
- const params = {
90
- queryParamsName: this.queryParamsName,
91
- type: 'template'
92
- }
93
- download(params, this.title + `数据模板_${new Date().toLocaleString()}.xlsx`, this.serviceName)
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('updateSupport', this.updateSupport)
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
@@ -1,252 +1,252 @@
1
- <template>
2
- <div>
3
- <a-row type="flex">
4
- <a-col :span="stepStyle.flex">
5
- <a-steps
6
- :type="stepStyle.type"
7
- :current="current"
8
- :direction="stepStyle.direction"
9
- :labelPlacement="stepStyle.labelPlacement"
10
- :progressDot="stepStyle.false"
11
- :size="stepStyle.size"
12
- :initial="initial"
13
- :status="status"
14
- @chaneg="onChange"
15
- >
16
- <a-step
17
- v-for="(item, index) in this.configContent.step.steps"
18
- :key="'step-'+item.name"
19
- :title="item.title"
20
- :description="item.description"
21
- :sub-title="item.subTitle"
22
- :disabled="item.disabled">
23
- <a-icon v-if="current === index" slot="icon" :type="iconType" />
24
- </a-step>
25
- </a-steps>
26
- </a-col>
27
- <a-col :span="panelStyle.flex">
28
- <template v-for="(item, index) in this.configContent.step.steps">
29
- <a-card
30
- v-if="current === index"
31
- :bordered="false"
32
- :key="'stepCard-'+item.name">
33
- <template v-if="item.content.card.type === 'text'">
34
- <p>{{ item.content.card.value }}</p>
35
- </template>
36
- <x-add-native-form v-else-if="item.content.card.type === 'form'" :ref="'XAddNativeForm'+ item.name" @onSubmit="submit"/>
37
- <x-table v-else-if="item.content.card.type === 'table'" :fixed-query-form="item.content.card.queryFrom" @action="action" :query-params-name="item.content.card.queryParamsName" :ref="'XAddNativeForm'+item.name" />
38
- <a-button v-if="status === 'error'" @click="success" style="color: v-bind()">下一步</a-button>
39
- </a-card>
40
- </template>
41
- </a-col>
42
- </a-row>
43
- </div>
44
- </template>
45
-
46
- <script>
47
- import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
48
- import { post } from '@vue2-client/services/api'
49
- import XTable from '@vue2-client/base-client/components/common/XTable/XTable.vue'
50
-
51
- export default {
52
- name: 'XStepView',
53
- components: { XTable, XAddNativeForm },
54
- computed: {
55
- stepStyle () {
56
- const style = this.configContent.step.style
57
- if (style) {
58
- return style
59
- } else {
60
- return {
61
- flex: 5,
62
- type: 'default',
63
- progressDot: 'false',
64
- direction: 'horizontal',
65
- labelPlacement: 'horizontal',
66
- size: 'default',
67
- }
68
- }
69
- },
70
- panelStyle () {
71
- const style = this.configContent.panelStyle
72
- if (style) {
73
- return style
74
- } else {
75
- return {
76
- flex: 19
77
- }
78
- }
79
- }
80
-
81
- },
82
- props: {
83
- params: {
84
- type: Object,
85
- required: true,
86
- },
87
- configContent: {
88
- type: Object,
89
- required: true,
90
- }
91
- },
92
- data () {
93
- return {
94
- current: -1,
95
- initial: 0,
96
- status: 'wait',
97
- iconType: 'loading',
98
- timeOut: undefined
99
- }
100
- },
101
- watch: {
102
- async current (newValue) {
103
- this.changeIcon()
104
- if (this.timeOut !== undefined) { window.clearTimeout(this.timeOut) }
105
-
106
- const setpes = this.configContent.step.steps[newValue]
107
- const type = setpes.content.card.type
108
- const formValue = setpes.content.card.value
109
- console.warn('formValue = ', formValue)
110
- if (setpes.before) {
111
- const postName = setpes.before.name.split('@')
112
- this.timeOut = window.setTimeout(() => {
113
- post('/api/af-system/' + postName[0] + '/' + postName[1], setpes.before.params).then(res => {
114
- console.warn(setpes.before.name + '执行结果', res)
115
- if (res.code === 200) {
116
- window.clearInterval(this.timeOut)
117
- this.success()
118
- } else {
119
- setpes.content.card.value = res.msg
120
- }
121
- }).catch(e => {
122
- console.warn(setpes.before.name + '执行结果', e)
123
- window.clearInterval(this.timeOut)
124
- this.error()
125
- })
126
- }, 10 * 1000)
127
- }
128
- if (type === 'form') {
129
- this.$nextTick(() => {
130
- const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
131
- stepsss.init({
132
- formItems: formValue
133
- })
134
- })
135
- } else if (type === 'table') {
136
- console.warn('formValue = ', formValue)
137
- this.$nextTick(() => {
138
- const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
139
- stepsss.init({
140
- tableColumns: formValue,
141
- buttonState: {
142
- add: false,
143
- edit: true,
144
- delete: false,
145
- import: false,
146
- export: false
147
- }
148
- })
149
- })
150
- } else {
151
- if (setpes.run) {
152
- post('/api/af-system/logic/' + setpes.run.name, setpes.run.params).then(t => {
153
- console.warn(setpes.run.name + '执行结果', t)
154
- if (t.code === 200) {
155
- this.success()
156
- } else {
157
- setpes.content.card.value = t.msg
158
- }
159
- }).catch(e => {
160
- console.warn(setpes.run.name + '执行结果', e)
161
- this.error()
162
- })
163
- }
164
- }
165
- }
166
- },
167
- mounted () {
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++
176
- },
177
- methods: {
178
- init (params) {
179
- const {
180
- style,
181
- panel,
182
- step
183
- } = params
184
- if (style) {
185
- this.stepStyle = style
186
- }
187
- if (panel) {
188
- this.panelStyle = panel
189
- }
190
- if (step) {
191
- this.configContent.step = step
192
- }
193
- },
194
- steps () {
195
- return this.steps
196
- },
197
- onChange (current) {
198
- this.current = current
199
- },
200
- submit (res) {
201
- console.warn('res', res)
202
- const setpes = this.configContent.step.steps[this.current]
203
- if (setpes.run) {
204
- post('/api/af-system/logic/' + setpes.run.name, res.realForm).then(t => {
205
- console.warn(setpes.run.name + '执行结果', t)
206
- if (t.code === 200) {
207
- this.success()
208
- }
209
- }).catch(e => {
210
- console.warn(setpes.run.name + '执行结果', e)
211
- this.error()
212
- })
213
- }
214
- },
215
- error () {
216
- this.status = 'error'
217
- this.iconType = 'close-circle'
218
- },
219
- success () {
220
- this.changeIcon()
221
-
222
- this.current++
223
- },
224
- changeIcon () {
225
- this.status = 'wait'
226
- this.iconType = 'loading'
227
- },
228
- previous () {
229
- this.current--
230
- },
231
- action (record, id, actionType) {
232
- console.warn('record', record)
233
- console.warn('id', id)
234
- console.warn('actionType', actionType)
235
- const setpes = this.configContent.step.steps[this.current]
236
- if (setpes.run) {
237
- post('/api/af-system/logic/' + setpes.run.name, { data: record }).then(t => {
238
- console.warn(setpes.run.name + '执行结果', t)
239
- if (t.code === 200) {
240
- this.success()
241
- }
242
- }).catch(e => {
243
- console.warn(setpes.run.name + '执行结果', e)
244
- this.error()
245
- })
246
- }
247
- }
248
- },
249
- }
250
- </script>
251
-
252
- <style lang="less" scoped></style>
1
+ <template>
2
+ <div>
3
+ <a-row type="flex">
4
+ <a-col :span="stepStyle.flex">
5
+ <a-steps
6
+ :type="stepStyle.type"
7
+ :current="current"
8
+ :direction="stepStyle.direction"
9
+ :labelPlacement="stepStyle.labelPlacement"
10
+ :progressDot="stepStyle.false"
11
+ :size="stepStyle.size"
12
+ :initial="initial"
13
+ :status="status"
14
+ @chaneg="onChange"
15
+ >
16
+ <a-step
17
+ v-for="(item, index) in this.configContent.step.steps"
18
+ :key="'step-'+item.name"
19
+ :title="item.title"
20
+ :description="item.description"
21
+ :sub-title="item.subTitle"
22
+ :disabled="item.disabled">
23
+ <a-icon v-if="current === index" slot="icon" :type="iconType" />
24
+ </a-step>
25
+ </a-steps>
26
+ </a-col>
27
+ <a-col :span="panelStyle.flex">
28
+ <template v-for="(item, index) in this.configContent.step.steps">
29
+ <a-card
30
+ v-if="current === index"
31
+ :bordered="false"
32
+ :key="'stepCard-'+item.name">
33
+ <template v-if="item.content.card.type === 'text'">
34
+ <p>{{ item.content.card.value }}</p>
35
+ </template>
36
+ <x-add-native-form v-else-if="item.content.card.type === 'form'" :ref="'XAddNativeForm'+ item.name" @onSubmit="submit"/>
37
+ <x-table v-else-if="item.content.card.type === 'table'" :fixed-query-form="item.content.card.queryFrom" @action="action" :query-params-name="item.content.card.queryParamsName" :ref="'XAddNativeForm'+item.name" />
38
+ <a-button v-if="status === 'error'" @click="success" style="color: v-bind()">下一步</a-button>
39
+ </a-card>
40
+ </template>
41
+ </a-col>
42
+ </a-row>
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
48
+ import { post } from '@vue2-client/services/api'
49
+ import XTable from '@vue2-client/base-client/components/common/XTable/XTable.vue'
50
+
51
+ export default {
52
+ name: 'XStepView',
53
+ components: { XTable, XAddNativeForm },
54
+ computed: {
55
+ stepStyle () {
56
+ const style = this.configContent.step.style
57
+ if (style) {
58
+ return style
59
+ } else {
60
+ return {
61
+ flex: 5,
62
+ type: 'default',
63
+ progressDot: 'false',
64
+ direction: 'horizontal',
65
+ labelPlacement: 'horizontal',
66
+ size: 'default',
67
+ }
68
+ }
69
+ },
70
+ panelStyle () {
71
+ const style = this.configContent.panelStyle
72
+ if (style) {
73
+ return style
74
+ } else {
75
+ return {
76
+ flex: 19
77
+ }
78
+ }
79
+ }
80
+
81
+ },
82
+ props: {
83
+ params: {
84
+ type: Object,
85
+ required: true,
86
+ },
87
+ configContent: {
88
+ type: Object,
89
+ required: true,
90
+ }
91
+ },
92
+ data () {
93
+ return {
94
+ current: -1,
95
+ initial: 0,
96
+ status: 'wait',
97
+ iconType: 'loading',
98
+ timeOut: undefined
99
+ }
100
+ },
101
+ watch: {
102
+ async current (newValue) {
103
+ this.changeIcon()
104
+ if (this.timeOut !== undefined) { window.clearTimeout(this.timeOut) }
105
+
106
+ const setpes = this.configContent.step.steps[newValue]
107
+ const type = setpes.content.card.type
108
+ const formValue = setpes.content.card.value
109
+ console.warn('formValue = ', formValue)
110
+ if (setpes.before) {
111
+ const postName = setpes.before.name.split('@')
112
+ this.timeOut = window.setTimeout(() => {
113
+ post('/api/af-system/' + postName[0] + '/' + postName[1], setpes.before.params).then(res => {
114
+ console.warn(setpes.before.name + '执行结果', res)
115
+ if (res.code === 200) {
116
+ window.clearInterval(this.timeOut)
117
+ this.success()
118
+ } else {
119
+ setpes.content.card.value = res.msg
120
+ }
121
+ }).catch(e => {
122
+ console.warn(setpes.before.name + '执行结果', e)
123
+ window.clearInterval(this.timeOut)
124
+ this.error()
125
+ })
126
+ }, 10 * 1000)
127
+ }
128
+ if (type === 'form') {
129
+ this.$nextTick(() => {
130
+ const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
131
+ stepsss.init({
132
+ formItems: formValue
133
+ })
134
+ })
135
+ } else if (type === 'table') {
136
+ console.warn('formValue = ', formValue)
137
+ this.$nextTick(() => {
138
+ const stepsss = this.$refs['XAddNativeForm' + setpes.name][0]
139
+ stepsss.init({
140
+ tableColumns: formValue,
141
+ buttonState: {
142
+ add: false,
143
+ edit: true,
144
+ delete: false,
145
+ import: false,
146
+ export: false
147
+ }
148
+ })
149
+ })
150
+ } else {
151
+ if (setpes.run) {
152
+ post('/api/af-system/logic/' + setpes.run.name, setpes.run.params).then(t => {
153
+ console.warn(setpes.run.name + '执行结果', t)
154
+ if (t.code === 200) {
155
+ this.success()
156
+ } else {
157
+ setpes.content.card.value = t.msg
158
+ }
159
+ }).catch(e => {
160
+ console.warn(setpes.run.name + '执行结果', e)
161
+ this.error()
162
+ })
163
+ }
164
+ }
165
+ }
166
+ },
167
+ mounted () {
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++
176
+ },
177
+ methods: {
178
+ init (params) {
179
+ const {
180
+ style,
181
+ panel,
182
+ step
183
+ } = params
184
+ if (style) {
185
+ this.stepStyle = style
186
+ }
187
+ if (panel) {
188
+ this.panelStyle = panel
189
+ }
190
+ if (step) {
191
+ this.configContent.step = step
192
+ }
193
+ },
194
+ steps () {
195
+ return this.steps
196
+ },
197
+ onChange (current) {
198
+ this.current = current
199
+ },
200
+ submit (res) {
201
+ console.warn('res', res)
202
+ const setpes = this.configContent.step.steps[this.current]
203
+ if (setpes.run) {
204
+ post('/api/af-system/logic/' + setpes.run.name, res.realForm).then(t => {
205
+ console.warn(setpes.run.name + '执行结果', t)
206
+ if (t.code === 200) {
207
+ this.success()
208
+ }
209
+ }).catch(e => {
210
+ console.warn(setpes.run.name + '执行结果', e)
211
+ this.error()
212
+ })
213
+ }
214
+ },
215
+ error () {
216
+ this.status = 'error'
217
+ this.iconType = 'close-circle'
218
+ },
219
+ success () {
220
+ this.changeIcon()
221
+
222
+ this.current++
223
+ },
224
+ changeIcon () {
225
+ this.status = 'wait'
226
+ this.iconType = 'loading'
227
+ },
228
+ previous () {
229
+ this.current--
230
+ },
231
+ action (record, id, actionType) {
232
+ console.warn('record', record)
233
+ console.warn('id', id)
234
+ console.warn('actionType', actionType)
235
+ const setpes = this.configContent.step.steps[this.current]
236
+ if (setpes.run) {
237
+ post('/api/af-system/logic/' + setpes.run.name, { data: record }).then(t => {
238
+ console.warn(setpes.run.name + '执行结果', t)
239
+ if (t.code === 200) {
240
+ this.success()
241
+ }
242
+ }).catch(e => {
243
+ console.warn(setpes.run.name + '执行结果', e)
244
+ this.error()
245
+ })
246
+ }
247
+ }
248
+ },
249
+ }
250
+ </script>
251
+
252
+ <style lang="less" scoped></style>
@@ -27,9 +27,19 @@ 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: []
38
+ },
39
+ {
40
+ label: '动态表名参数',
41
+ value: 'mixinTableName',
42
+ noMatch: []
33
43
  }
34
44
  ],
35
45
  // 表单类型