feat(数据集): 参数值只在编辑 sql 时生效

This commit is contained in:
taojinlong
2022-07-01 18:11:06 +08:00
parent 8d13c10d97
commit 969b3d2fcf
6 changed files with 43 additions and 18 deletions

View File

@@ -132,6 +132,7 @@ export default {
},
commons: {
default_value: 'Default Value',
params_value: 'Param Value',
publish: 'publish',
unpublished: 'unpublished',
default_pwd: 'Default Pwd',
@@ -1123,6 +1124,7 @@ export default {
max_more_than_mix: 'Max must more than Min'
},
dataset: {
params_work: 'Effective only when editing SQL',
sql_variable_limit_1: '1、SQL variables can only be used in where conditions',
sql_variable_limit_2: '2、Exampleselect * from table_name where column_name=${parm_name}',
select_year: 'Select Year',

View File

@@ -132,6 +132,7 @@ export default {
},
commons: {
default_value: '默認值',
params_value: '参数值',
publish: '發布',
unpublished: '取消發布',
default_pwd: '初始密碼',
@@ -1123,6 +1124,7 @@ export default {
max_more_than_mix: '最大值必須大於最小值'
},
dataset: {
params_work: '僅在編輯 sql 時生效',
sql_variable_limit_1: '1、SQL變數只能在WHERE條件中使用',
sql_variable_limit_2: '2、示例select * from table_name where column_name=${parm_name}',
select_year: '選擇年',

View File

@@ -132,6 +132,7 @@ export default {
},
commons: {
default_value: '默认值',
params_value: '参数值',
publish: '发布',
unpublished: '取消发布',
default_pwd: '初始密码',
@@ -1125,6 +1126,7 @@ export default {
max_more_than_mix: '最大值必须大于最小值'
},
dataset: {
params_work: '仅在编辑sql时生效',
select_year: '选择年',
sql_variable_limit_1: '1、SQL 变量只能在 WHERE 条件中使用',
sql_variable_limit_2: '2、示例select * from table_name where column_name=${parm_name}',

View File

@@ -128,7 +128,7 @@
</el-cascader>
</template>
</el-table-column>
<el-table-column prop="defaultValue" :label="$t('commons.default_value')">
<el-table-column prop="defaultValue" :label="$t('commons.params_value')" :render-header="renderPrice">
<template slot-scope="scope">
<el-input size="mini" v-if="scope.row.type[0] === 'TEXT'" type="text" v-model="scope.row.defaultValue" />
<el-input size="mini" v-if="scope.row.type[0] === 'LONG' || scope.row.type[0] === 'DOUBLE'" type="number" v-model="scope.row.defaultValue" />
@@ -495,7 +495,22 @@ export default {
},
variableTypeChange(row){
row.defaultValue = ''
}
},
renderPrice(h, { column, $index }) {
return [
column.label,
h(
'el-tooltip',
{
props: {
content: this.$t('dataset.params_work'),
placement: 'top'
}
},
[h('span', { class: { 'el-icon-info': true }})]
)
]
},
}
}
</script>