提交 a2f072bd 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix issues

上级 518e4fc5
......@@ -54,13 +54,28 @@
</a-form-model-item>
</a-row>
<!-- column list -->
<a-row v-if="showColSection" :gutter="colsFull">
<a-form-model-item :label="$t('form.col')" prop="colName" :labelCol="labelColFull" :wrapperCol="wrapperColFull">
<a-select v-model="referColNames" :mode="fieldMultiple">
<a-select v-if="fileMultiple === 'multiple'" v-model="referColNames" :mode="fieldMultiple">
<a-select-option v-for="f in fields" :key="f.name">
{{ f.name }}
</a-select-option>
</a-select>
<a-select v-if="fileMultiple !== 'multiple'" v-model="refer.colName">
<a-select-option v-for="f in fields" :key="f.name">
{{ f.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-row>
<!-- sql where -->
<a-row v-if="refer.type==='excel'" :gutter="colsFull">
<a-form-model-item :label="$t('form.where')" prop="colName" :labelCol="labelColFull" :wrapperCol="wrapperColFull">
<a-input v-model="refer.condition" />
</a-form-model-item>
</a-row>
......@@ -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'
}
}
}
......
......@@ -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',
}
......
......@@ -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': '刷新数据',
}
......
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
title: 测试
desc: ""
fields:
- field: 新字段
range: 1-9
prefix: "="
postfix: "-"
- field: 新字段1111
range: 1-9
prefix: =
postfix: '-'
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册