forked from github/dataease
feat: sql 数据集参数传递
This commit is contained in:
parent
9607973f82
commit
10d7bfa0db
@ -19,3 +19,17 @@ CREATE TABLE `chart_view_field`
|
||||
`last_sync_time` bigint(13) DEFAULT NULL COMMENT '同步时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `sql_variable`;
|
||||
CREATE TABLE `sql_variable`
|
||||
(
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`table_id` varchar(50) NOT NULL COMMENT '数据集ID',
|
||||
`variable_name` varchar(255) NOT NULL COMMENT '名称',
|
||||
`alias` varchar(255) NOT NULL COMMENT '别名',
|
||||
`type` varchar(50) NOT NULL COMMENT '类型',
|
||||
`details` longtext DEFAULT NULL COMMENT '明细',
|
||||
`default_value` longtext DEFAULT NULL COMMENT '默认值',
|
||||
`required` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否必填',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
|
@ -2080,5 +2080,8 @@ export default {
|
||||
},
|
||||
plugin_style: {
|
||||
border: '边框'
|
||||
},
|
||||
sql_variable: {
|
||||
variable_mgm: '参数设置'
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button v-if="mode === '1'" type="text" size="mini" style="float: left;" @click="variableMgm"> {{ $t('sql_variable.variable_mgm') }}</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col style="min-width: 200px;">
|
||||
@ -94,6 +95,20 @@
|
||||
</span>
|
||||
</el-card>
|
||||
</el-row>
|
||||
|
||||
<el-dialog :title="dialogTitle" :visible="showVariableMgm" :before-close="closeVariableMgm" width="60%" class="dialog-css" append-to-body>
|
||||
|
||||
<!-- <fu-table :data="VariableList">-->
|
||||
<!-- <el-table-column prop="authTargetName" :label="$t('dataset.row_permission.name')"/>-->
|
||||
<!-- <el-table-column prop="authTargetName" :label="$t('dataset.row_permission.name')"/>-->
|
||||
<!-- <el-table-column prop="authTargetName" :label="$t('dataset.row_permission.name')"/>-->
|
||||
<!-- </fu-table>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button size="mini" @click="closeVariableMgm">{{ $t('dataset.cancel') }}</el-button>-->
|
||||
<!-- <el-button type="primary" size="mini" @click="saveVariable()">{{ $t('dataset.confirm') }}</el-button>-->
|
||||
<!-- </div>-->
|
||||
</el-dialog>
|
||||
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
@ -161,6 +176,10 @@ export default {
|
||||
selectedDatasource: {},
|
||||
engineMode: 'local',
|
||||
disabledSync: true,
|
||||
showVariableMgm: false,
|
||||
dialogTitle: '',
|
||||
variables: [],
|
||||
variablesTmp: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -335,7 +354,18 @@ export default {
|
||||
this.fields = []
|
||||
this.mode = '0'
|
||||
this.syncType = 'sync_now'
|
||||
}
|
||||
},
|
||||
|
||||
variableMgm() {
|
||||
var reg = new RegExp("${(.*?)}", "gim");
|
||||
var match = this.sql.match(reg);
|
||||
console.log(match)
|
||||
this.dialogTitle = this.$t('sql_variable.variable_mgm')
|
||||
this.showVariableMgm = true
|
||||
},
|
||||
closeVariableMgm() {
|
||||
this.showVariableMgm = false
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user