From a2f072bd02216e6e4c0402c68aad302e37a0ac61 Mon Sep 17 00:00:00 2001 From: aaron <462826@qq.com> Date: Thu, 27 Apr 2023 14:55:22 +0800 Subject: [PATCH] fix issues --- ui/src/components/FieldRefer.vue | 38 +++++++++++++++++++++++--------- ui/src/locales/lang/en-US.js | 3 ++- ui/src/locales/lang/zh-CN.js | 3 ++- users/test.yaml | 9 +++++--- users/test/01.yaml | 8 +++---- users/test/dir/content.yaml | 6 ++--- 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/ui/src/components/FieldRefer.vue b/ui/src/components/FieldRefer.vue index 2fd62718..67e59100 100644 --- a/ui/src/components/FieldRefer.vue +++ b/ui/src/components/FieldRefer.vue @@ -54,13 +54,28 @@ + - + {{ f.name }} + + + + {{ f.name }} + + + + + + + + + + @@ -211,7 +226,7 @@ export default { return col.split(':')[0] }) - this.removeSheet() + this.convertExcelFileColToPath() this.listReferFileForSelection(this.refer.type, true) }) }, @@ -224,7 +239,7 @@ export default { this.listReferFileForSelection(this.refer.type, false) }, onReferFileChanged() { - console.log("onReferFileChanged", this.referFiles, this.refer.file) + console.log("onReferFileChanged") if (this.refer.type == 'excel') { this.listReferSheetForSelection(false) @@ -258,24 +273,27 @@ export default { this.refer.file = this.referFiles } else if (this.refer.type === 'excel') { - console.log('use this.refer.file') - this.refer.colName = this.referColNames + if (this.refer.file.lastIndexOf('.xlsx') > 0) { + this.refer.file = this.refer.file.substring(0, this.refer.file.lastIndexOf('.xlsx')) + } + } else { this.refer.file = this.referFiles this.refer.colName = this.referColNames } - console.log('###') - console.log(this.refer.file) - let data = JSON.parse(JSON.stringify(this.refer)) if (data.type === 'excel') data.file = data.file + '.' + data.sheet data.count = parseInt(data.count) data.step = parseInt(data.step) + + console.log('###', data) + updateRefer(data, this.type).then(json => { console.log('updateRefer', json) if (json.code == 1) { + this.loadData() this.$notification['success']({ message: this.$i18n.t('tips.success.to.submit'), duration: 3, @@ -356,9 +374,9 @@ export default { }) } }, - removeSheet() { + convertExcelFileColToPath() { if (this.refer.type == 'excel') { - this.refer.file = this.refer.file.substring(0, this.refer.file.lastIndexOf('.')) + this.refer.file = this.refer.file.substring(0, this.refer.file.lastIndexOf('.')) + '.xlsx' } } } diff --git a/ui/src/locales/lang/en-US.js b/ui/src/locales/lang/en-US.js index 9350421a..7ecd70de 100644 --- a/ui/src/locales/lang/en-US.js +++ b/ui/src/locales/lang/en-US.js @@ -146,6 +146,7 @@ const locale = { 'form.reset': 'Reset', 'form.cancel': 'Cancel', 'form.close': 'Close', + 'form.where': 'Where', 'valid.required': 'Can not be empty.', 'valid.type.empty': 'Type cannot be empty.', @@ -176,7 +177,7 @@ const locale = { 'copy.success': 'Copy Success', 'copy.title': 'Copy Link', - + 'preview.title': 'Refresh Data', } diff --git a/ui/src/locales/lang/zh-CN.js b/ui/src/locales/lang/zh-CN.js index 55a96c5f..65867b9f 100644 --- a/ui/src/locales/lang/zh-CN.js +++ b/ui/src/locales/lang/zh-CN.js @@ -146,6 +146,7 @@ const locale = { 'form.reset': '重置', 'form.cancel': '取消', 'form.close': '关闭', + 'form.where': 'Where条件', 'valid.required': '该字段不能为空。', 'valid.type.empty': '类型不能为空', @@ -176,7 +177,7 @@ const locale = { 'copy.success': '复制成功', 'copy.title': '复制链接', - + 'preview.title': '刷新数据', } diff --git a/users/test.yaml b/users/test.yaml index 51352433..4798f0e6 100644 --- a/users/test.yaml +++ b/users/test.yaml @@ -1,9 +1,12 @@ title: 测试 desc: "" fields: -- field: 新字段 +- field: 新字段222 range: 1-9 prefix: = postfix: '-' - from: color.v1.xlsx.color - select: english + from: city.v1.city + select: name + where: state like '%山东%' +- field: 新字段333 + range: 1-3 diff --git a/users/test/01.yaml b/users/test/01.yaml index 70752f02..cac1cb9f 100644 --- a/users/test/01.yaml +++ b/users/test/01.yaml @@ -1,7 +1,7 @@ title: 测试 desc: "" fields: - - field: 新字段 - range: 1-9 - prefix: "=" - postfix: "-" +- field: 新字段1111 + range: 1-9 + prefix: = + postfix: '-' diff --git a/users/test/dir/content.yaml b/users/test/dir/content.yaml index 7ebb062d..49cee8ac 100644 --- a/users/test/dir/content.yaml +++ b/users/test/dir/content.yaml @@ -44,11 +44,11 @@ fields: postfix: "\t" from: ip.v1.yaml use: privateC{1} -- field: field_use_excel +- field: field_use_excel666 postfix: "\t" rand: true - from: city.v1.city - select: name + from: xiehouyu.v1.xiehouyu + select: riddle where: state like '%山东%' - field: field_with_children fields: -- GitLab