|
@@ -201,6 +201,7 @@
|
|
|
<div class="title">
|
|
|
<span>参数设置</span>
|
|
|
<i
|
|
|
+ v-if="hasInit"
|
|
|
class="el-icon-close"
|
|
|
@click="dialogHide(1)"
|
|
|
/>
|
|
@@ -396,7 +397,8 @@ export default {
|
|
|
basicParamList: [],
|
|
|
basicParamForm: {},
|
|
|
dataContent: [],
|
|
|
- isBasic: false
|
|
|
+ isBasic: false,
|
|
|
+ hasInit: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -435,12 +437,12 @@ export default {
|
|
|
this.isBasic = true
|
|
|
this.basicParamList = Array.from({ length }).map((_, index) => {
|
|
|
this.$set(this.basicParamForm, `basicParam${index}`, '')
|
|
|
- this.dataContent.push(null)
|
|
|
return {
|
|
|
prop: `basicParam${index}`,
|
|
|
label: `基础参数${index + 1}`
|
|
|
}
|
|
|
})
|
|
|
+ this.dialogShow(1)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -449,13 +451,13 @@ export default {
|
|
|
case 1:
|
|
|
this.dialogBasicFlag = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs['dialogBasic'].focus()
|
|
|
+ this.$refs['dialogBasic']?.focus()
|
|
|
})
|
|
|
break
|
|
|
default:
|
|
|
this.dialogFlag = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs['dialog'].focus()
|
|
|
+ this.$refs['dialog']?.focus()
|
|
|
})
|
|
|
break
|
|
|
}
|
|
@@ -463,7 +465,11 @@ export default {
|
|
|
dialogHide(dialogIndex) {
|
|
|
switch (dialogIndex) {
|
|
|
case 1:
|
|
|
- this.dialogBasicFlag = false
|
|
|
+ if (this.hasInit) {
|
|
|
+ this.dialogBasicFlag = false
|
|
|
+ } else {
|
|
|
+ this.$message.warning('请设置参数进行查询')
|
|
|
+ }
|
|
|
break
|
|
|
default:
|
|
|
this.dialogFlag = false
|
|
@@ -569,6 +575,7 @@ export default {
|
|
|
},
|
|
|
basicQueryHandler() {
|
|
|
this.dataContent = Object.values(this.basicParamForm).map(value => value || null)
|
|
|
+ this.hasInit = true
|
|
|
this.dialogHide(1)
|
|
|
},
|
|
|
deleteParam(index) {
|
|
@@ -640,7 +647,8 @@ export default {
|
|
|
try {
|
|
|
const {
|
|
|
code,
|
|
|
- returnData: { columnSet, listValues }
|
|
|
+ returnData: { columnSet, listValues },
|
|
|
+ message
|
|
|
} = await Query({
|
|
|
id: this.queryTemplateID,
|
|
|
needPage: ++this.page,
|
|
@@ -656,7 +664,7 @@ export default {
|
|
|
this.tableData.push(...listValues)
|
|
|
} else {
|
|
|
this.page--
|
|
|
- throw new Error('获取表格数据失败')
|
|
|
+ throw new Error(message ?? '获取表格数据失败')
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.$message.error(error.message)
|