vue2-client 1.8.12 → 1.8.14

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.14 -2023-11-23 @江超**
5
+ - 完善导入功能的返回值
6
+
7
+ **1.8.13 -2023-11-21 @张振宇**
8
+ - 配置中心增加动态表名功能
9
+
4
10
  **1.8.12 -2023-11-20 @江超**
5
11
  - 完成查询配置通用导入和模板下载功能
6
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.12",
3
+ "version": "1.8.14",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -73,12 +73,12 @@
73
73
  标签名
74
74
  </span>
75
75
  </a-col>
76
- <a-col :span="7">
76
+ <a-col :span="6">
77
77
  <span style="font-weight: bold">
78
78
  字段名
79
79
  </span>
80
80
  </a-col>
81
- <a-col :span="9">
81
+ <a-col :span="10">
82
82
  <span style="font-weight: bold">
83
83
  数据模式
84
84
  </span>
@@ -107,12 +107,12 @@
107
107
  {{ columnItem.title }}
108
108
  </span>
109
109
  </a-col>
110
- <a-col :span="7">
110
+ <a-col :span="6">
111
111
  <span style="font-weight: bold">
112
112
  {{ columnItem.key }}
113
113
  </span>
114
114
  </a-col>
115
- <a-col :span="9">
115
+ <a-col :span="10">
116
116
  <a-tooltip>
117
117
  <template slot="title">
118
118
  查询表单项
@@ -483,7 +483,7 @@ export default {
483
483
  },
484
484
  // 字段名称是否禁用
485
485
  keyDisabled () {
486
- return this.item.formType === 'file' || this.item.formType === 'image'
486
+ return this.item.formType === 'file' || this.item.formType === 'image' || this.dataMode.mixinTableName
487
487
  },
488
488
  // 数据模式是否禁用
489
489
  dataModeDisabled () {
@@ -497,7 +497,8 @@ export default {
497
497
  sqlQueryItem: false,
498
498
  sqlQueryCondition: false,
499
499
  excelImportItem: false,
500
- group: false
500
+ group: false,
501
+ mixinTableName: false
501
502
  }
502
503
  for (const item of this.dataModeArrayData) {
503
504
  result[item] = true
@@ -516,11 +517,25 @@ export default {
516
517
  value: 'sqlQueryItem',
517
518
  noMatch: ['file', 'personSetting']
518
519
  }, {
519
- label: '字段组存储',
520
- value: 'group',
521
- noMatch: []
520
+ label: '字段组存储',
521
+ value: 'group',
522
+ noMatch: []
522
523
  }]
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',
535
+ noMatch: []
536
+ }
537
+ ]
538
+ }
524
539
  if (this.item.formType) {
525
540
  return dataModeType.filter(item => {
526
541
  return item.noMatch.findIndex(type => type === this.item.formType) === -1
@@ -603,7 +618,7 @@ export default {
603
618
  callback(new Error('请输入字段名称'))
604
619
  } else {
605
620
  // 判断必须全部小写 并且不能包含空格
606
- if (value !== value.toLowerCase() || value.indexOf(' ') !== -1) {
621
+ if (value !== value.toLowerCase() || value.indexOf(' ') !== -1 && !value === '_mixinTableName_') {
607
622
  callback(new Error('字段名称必须全部小写,且不能包含空格'))
608
623
  } else {
609
624
  callback()
@@ -813,6 +828,12 @@ export default {
813
828
  },
814
829
  // 数据模式改变
815
830
  dataModeArrayDataChange (newVal) {
831
+ if (newVal.includes('mixinTableName')) {
832
+ this.item.key = '_mixinTableName_'
833
+ this.dataModeArrayData = ['queryForm', 'mixinTableName']
834
+ } else {
835
+ this.item.key = ''
836
+ }
816
837
  if (newVal.includes('group')) {
817
838
  this.dataModeArrayData = ['sqlQueryItem', 'group']
818
839
  }
@@ -1,131 +1,131 @@
1
- <template>
2
- <a-modal
3
- title="数据导入"
4
- :visible="open"
5
- :zIndex="1001"
6
- :confirm-loading="uploading"
7
- @cancel="importExcelHandleCancel"
8
- @ok="importExcelHandleChange"
9
- >
10
- <a-spin tip="上传中..." :spinning="uploading">
11
- <a-upload-dragger
12
- name="file"
13
- accept=".xlsx, .xls"
14
- :file-list="fileList"
15
- :multiple="false"
16
- :remove="handleRemove"
17
- :before-upload="beforeUpload"
18
- >
19
- <p class="ant-upload-drag-icon">
20
- <a-icon type="inbox" />
21
- </p>
22
- <p class="ant-upload-text">
23
- 请将文件拖拽到此处上传
24
- </p>
25
- <p class="ant-upload-hint">
26
- 支持单个上传,也可以点击后选择文件上传
27
- </p>
28
- </a-upload-dragger>
29
- <a-divider/>
30
- <a v-if="queryParamsName !== 'none'" @click="importTemplate">下载导入模板</a>
31
- </a-spin>
32
- </a-modal>
33
- </template>
34
-
35
- <script>
36
-
37
- import { importData, downloadImportExcel } from '@vue2-client/services/api/common'
38
-
39
- export default {
40
- name: 'XImportExcel',
41
- props: {
42
- serviceName: {
43
- type: String,
44
- default: undefined
45
- },
46
- queryParamsName: {
47
- type: String,
48
- default: 'none'
49
- },
50
- // 业务名称
51
- title: {
52
- type: String,
53
- default: ''
54
- }
55
- },
56
- components: {
57
- },
58
- data () {
59
- return {
60
- open: false,
61
- uploadStatus: '',
62
- fileList: [],
63
- // 是否禁用上传
64
- uploading: false
65
- }
66
- },
67
- filters: {
68
- },
69
- created () {
70
- },
71
- computed: {
72
- },
73
- watch: {
74
- },
75
- methods: {
76
- /** 导入excel窗体关闭 */
77
- importExcelHandleCancel (e) {
78
- this.open = false
79
- this.fileList = []
80
- // 关闭后刷新列表
81
- this.$emit('ok')
82
- },
83
- /** 下载模板操作 */
84
- importTemplate () {
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
- },
95
- /** 导入excel窗体开启 */
96
- importExcelHandleOpen (e) {
97
- this.open = true
98
- },
99
- beforeUpload (file) {
100
- this.fileList = [file]
101
- return false
102
- },
103
- /** 导入excel */
104
- importExcelHandleChange () {
105
- const { fileList } = this
106
- const formData = new FormData()
107
- if (!fileList[0]) {
108
- this.$message.warn('请选择需要上传的文件')
109
- return
110
- }
111
- this.uploading = true
112
- formData.append('file', fileList[0])
113
- formData.append('queryParamsName', this.queryParamsName)
114
- importData(formData).then(response => {
115
- this.fileList = []
116
- this.$message.success(response.msg)
117
- this.open = false
118
- this.$emit('ok')
119
- }).catch(e => {
120
- this.$message.error(e)
121
- }).finally(() => {
122
- this.uploading = false
123
- })
124
- },
125
- handleRemove () {
126
- this.fileList = []
127
- this.uploading = false
128
- }
129
- }
130
- }
131
- </script>
1
+ <template>
2
+ <a-modal
3
+ title="数据导入"
4
+ :visible="open"
5
+ :zIndex="1001"
6
+ :confirm-loading="uploading"
7
+ @cancel="importExcelHandleCancel"
8
+ @ok="importExcelHandleChange"
9
+ >
10
+ <a-spin tip="上传中..." :spinning="uploading">
11
+ <a-upload-dragger
12
+ name="file"
13
+ accept=".xlsx, .xls"
14
+ :file-list="fileList"
15
+ :multiple="false"
16
+ :remove="handleRemove"
17
+ :before-upload="beforeUpload"
18
+ >
19
+ <p class="ant-upload-drag-icon">
20
+ <a-icon type="inbox" />
21
+ </p>
22
+ <p class="ant-upload-text">
23
+ 请将文件拖拽到此处上传
24
+ </p>
25
+ <p class="ant-upload-hint">
26
+ 支持单个上传,也可以点击后选择文件上传
27
+ </p>
28
+ </a-upload-dragger>
29
+ <a-divider/>
30
+ <a v-if="queryParamsName !== 'none'" @click="importTemplate">下载导入模板</a>
31
+ </a-spin>
32
+ </a-modal>
33
+ </template>
34
+
35
+ <script>
36
+
37
+ import { importData, downloadImportExcel } from '@vue2-client/services/api/common'
38
+
39
+ export default {
40
+ name: 'XImportExcel',
41
+ props: {
42
+ serviceName: {
43
+ type: String,
44
+ default: undefined
45
+ },
46
+ queryParamsName: {
47
+ type: String,
48
+ default: 'none'
49
+ },
50
+ // 业务名称
51
+ title: {
52
+ type: String,
53
+ default: ''
54
+ }
55
+ },
56
+ components: {
57
+ },
58
+ data () {
59
+ return {
60
+ open: false,
61
+ uploadStatus: '',
62
+ fileList: [],
63
+ // 是否禁用上传
64
+ uploading: false
65
+ }
66
+ },
67
+ filters: {
68
+ },
69
+ created () {
70
+ },
71
+ computed: {
72
+ },
73
+ watch: {
74
+ },
75
+ methods: {
76
+ /** 导入excel窗体关闭 */
77
+ importExcelHandleCancel (e) {
78
+ this.open = false
79
+ this.fileList = []
80
+ // 关闭后刷新列表
81
+ this.$emit('ok')
82
+ },
83
+ /** 下载模板操作 */
84
+ importTemplate () {
85
+ downloadImportExcel({
86
+ queryParamsName: this.queryParamsName
87
+ }, this.serviceName).then(res => {
88
+ if (!res || !res.value) {
89
+ this.$message.warn('导入模板不存在,请检查配置')
90
+ return
91
+ }
92
+ window.open('/res/excel/export/' + res.value)
93
+ })
94
+ },
95
+ /** 导入excel窗体开启 */
96
+ importExcelHandleOpen (e) {
97
+ this.open = true
98
+ },
99
+ beforeUpload (file) {
100
+ this.fileList = [file]
101
+ return false
102
+ },
103
+ /** 导入excel */
104
+ importExcelHandleChange () {
105
+ const { fileList } = this
106
+ const formData = new FormData()
107
+ if (!fileList[0]) {
108
+ this.$message.warn('请选择需要上传的文件')
109
+ return
110
+ }
111
+ this.uploading = true
112
+ formData.append('file', fileList[0])
113
+ formData.append('queryParamsName', this.queryParamsName)
114
+ importData(formData).then(res => {
115
+ this.fileList = []
116
+ this.$message.success(res.value)
117
+ this.open = false
118
+ this.$emit('ok')
119
+ }).catch(e => {
120
+ this.$message.error(e)
121
+ }).finally(() => {
122
+ this.uploading = false
123
+ })
124
+ },
125
+ handleRemove () {
126
+ this.fileList = []
127
+ this.uploading = false
128
+ }
129
+ }
130
+ }
131
+ </script>
@@ -35,6 +35,11 @@ module.exports = {
35
35
  label: '数据组',
36
36
  value: 'group',
37
37
  noMatch: []
38
+ },
39
+ {
40
+ label: '动态表名参数',
41
+ value: 'mixinTableName',
42
+ noMatch: []
38
43
  }
39
44
  ],
40
45
  // 表单类型