update 数据源

qianlishi 3 years ago
parent a00d023caf
commit 60f02dcf5f

@ -1,25 +1,48 @@
<template>
<anji-crud ref="listPage" :option="crudOption">
<template v-slot:buttonLeftOnTable>
<el-button type="primary" icon="el-icon-plus" @click="operateDatasource('add')" v-permission="'datasourceManage:insert'"></el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="operateDatasource('add')"
v-permission="'datasourceManage:insert'"
>新增</el-button
>
</template>
<template slot="rowButton" slot-scope="props">
<el-button type="text" @click="operateDatasource('edit',props)" v-permission="'datasourceManage:update'"></el-button>
<template slot="edit" slot-scope="props">
<el-button
type="text"
@click="operateDatasource('edit', props)"
v-permission="'datasourceManage:update'"
>编辑</el-button
>
</template>
<!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片-->
<!--这里可以将自定义的弹出框代码放入到page中
-->
<template v-slot:pageSection>
<EditDataSource ref="EditDataSource" :dataSource="dataSource" :visib="dialogVisibleSetDataSource" @handleClose="dialogVisibleSetDataSource = false" @refreshList="refreshList" />
<EditDataSource
ref="EditDataSource"
:dataSource="dataSource"
:visib="dialogVisibleSetDataSource"
@handleClose="dialogVisibleSetDataSource = false"
@refreshList="refreshList"
/>
</template>
</anji-crud>
</template>
<script>
import { reportDataSourceList, reportDataSourceAdd, reportDataSourceDeleteBatch, reportDataSourceUpdate, reportDataSourceDetail } from '@/api/reportDataSource'
import EditDataSource from '@/views/report/datasource/components/EditDataSource'
import {
reportDataSourceList,
reportDataSourceAdd,
reportDataSourceDeleteBatch,
reportDataSourceUpdate,
reportDataSourceDetail
} from "@/api/reportDataSource";
import EditDataSource from "@/views/report/datasource/components/EditDataSource";
export default {
name: 'ReportDataSource',
name: "ReportDataSource",
components: {
EditDataSource: EditDataSource
},
@ -29,173 +52,178 @@ export default {
dataSource: {},
crudOption: {
// 使
title: '数据源',
title: "数据源",
//
labelWidth: '120px',
labelWidth: "120px",
//
queryFormFields: [
{
inputType: 'input',
label: '数据源编码',
field: 'sourceCode'
inputType: "input",
label: "数据源编码",
field: "sourceCode"
},
{
inputType: 'input',
label: '数据源名称',
field: 'sourceName'
inputType: "input",
label: "数据源名称",
field: "sourceName"
},
{
inputType: 'anji-select', //form input|input-number|anji-select(urldictCode)|anji-tree()|date|datetime|datetimerange
inputType: "anji-select", //form input|input-number|anji-select(urldictCode)|anji-tree()|date|datetime|datetimerange
anjiSelectOption: {
dictCode: 'SOURCE_TYPE',
},
label: '数据源类型',
field: 'sourceType'
dictCode: "SOURCE_TYPE"
},
label: "数据源类型",
field: "sourceType"
}
],
//
buttons: {
customButton: {
operationWidth: 150
},
query: {
api: reportDataSourceList,
permission: 'datasourceManage:query',
sort: 'update_time',
order: 'DESC'
permission: "datasourceManage:query",
sort: "update_time",
order: "DESC"
},
queryByPrimarykey: {
api: reportDataSourceDetail,
permission: 'datasourceManage:detail'
permission: "datasourceManage:detail"
},
add: {
api: reportDataSourceAdd,
permission: 'datasourceManage:insert',
permission: "datasourceManage:insert",
isShow: false
},
delete: {
api: reportDataSourceDeleteBatch,
permission: 'datasourceManage:delete'
permission: "datasourceManage:delete"
},
edit: {
api: reportDataSourceUpdate,
permission: 'datasourceManage:update',
permission: "datasourceManage:update",
isShow: false
},
}
},
//
columns: [
{
label: '',
field: 'id',
label: "",
field: "id",
primaryKey: true, // ,
tableHide: true, //
editHide: true, //
editHide: true //
},
{
label: '数据源编码',//
placeholder: '',
field: 'sourceCode',
editField: 'sourceCode',
inputType: 'input',
label: "数据源编码", //
placeholder: "",
field: "sourceCode",
editField: "sourceCode",
inputType: "input",
rules: [
{ min: 1, max: 100, message: '不超过100个字符', trigger: 'blur' }
{ min: 1, max: 100, message: "不超过100个字符", trigger: "blur" }
],
disabled: false,
disabled: false
},
{
label: '数据源名称',//
placeholder: '',
field: 'sourceName',
editField: 'sourceName',
inputType: 'input',
label: "数据源名称", //
placeholder: "",
field: "sourceName",
editField: "sourceName",
inputType: "input",
rules: [
{ min: 1, max: 100, message: '不超过100个字符', trigger: 'blur' }
{ min: 1, max: 100, message: "不超过100个字符", trigger: "blur" }
],
disabled: false,
disabled: false
},
{
label: '数据源描述',//
placeholder: '',
field: 'sourceDesc',
editField: 'sourceDesc',
inputType: 'input',
label: "数据源描述", //
placeholder: "",
field: "sourceDesc",
editField: "sourceDesc",
inputType: "input",
rules: [
{ min: 1, max: 255, message: '不超过255个字符', trigger: 'blur' }
{ min: 1, max: 255, message: "不超过255个字符", trigger: "blur" }
],
disabled: false,
disabled: false
},
{
label: '数据源类型',// DIC_NAME=SOURCE_TYPE; mysqloracesqlserverelasticsearchjavaBeanitem-extend
placeholder: '',
field: 'sourceType',
fieldTableRowRenderer: (row) => {
return this.getDictLabelByCode('SOURCE_TYPE', row['sourceType'])
},
editField: 'sourceType',
inputType: 'input',
label: "数据源类型", // DIC_NAME=SOURCE_TYPE; mysqloracesqlserverelasticsearchjavaBeanitem-extend
placeholder: "",
field: "sourceType",
fieldTableRowRenderer: row => {
return this.getDictLabelByCode("SOURCE_TYPE", row["sourceType"]);
},
editField: "sourceType",
inputType: "input",
rules: [
{ min: 1, max: 50, message: '不超过50个字符', trigger: 'blur' }
{ min: 1, max: 50, message: "不超过50个字符", trigger: "blur" }
],
disabled: false,
disabled: false
},
{
label: '数据源连接配置json',//json{ jdbcUrl:'', username:'', password:'' } ES{ hostList:'ip1:9300,ip2:9300,ip3:9300', clusterName:'elasticsearch_cluster' } { apiUrl:'http://ip:port/url', method:'' } javaBean{ beanNamw:'xxx' }
placeholder: '',
field: 'sourceConfig',
editField: 'sourceConfig',
label: "数据源连接配置json", //json{ jdbcUrl:'', username:'', password:'' } ES{ hostList:'ip1:9300,ip2:9300,ip3:9300', clusterName:'elasticsearch_cluster' } { apiUrl:'http://ip:port/url', method:'' } javaBean{ beanNamw:'xxx' }
placeholder: "",
field: "sourceConfig",
editField: "sourceConfig",
tableHide: true,
inputType: 'input',
inputType: "input",
rules: [
{ min: 1, max: 2048, message: '不超过2048个字符', trigger: 'blur' }
{
min: 1,
max: 2048,
message: "不超过2048个字符",
trigger: "blur"
}
],
disabled: false,
disabled: false
},
{
label: '状态',//0-- 1-- DIC_NAME=ENABLE_FLAG
placeholder: '',
field: 'enableFlag',
fieldTableRowRenderer: (row) => {
return this.getDictLabelByCode('ENABLE_FLAG', row['enableFlag'])
label: "状态", //0-- 1-- DIC_NAME=ENABLE_FLAG
placeholder: "",
field: "enableFlag",
fieldTableRowRenderer: row => {
return this.getDictLabelByCode("ENABLE_FLAG", row["enableFlag"]);
},
colorStyle: {
0: 'table-danger', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: 'table-success',
0: "table-danger", //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: "table-success"
},
editField: 'enableFlag',
inputType: 'input',
rules: [
],
disabled: false,
editField: "enableFlag",
inputType: "input",
rules: [],
disabled: false
},
{
label: '删除标记',//0-- 1-- DIC_NAME=DELETE_FLAG
placeholder: '',
field: 'deleteFlag',
editField: 'deleteFlag',
label: "删除标记", //0-- 1-- DIC_NAME=DELETE_FLAG
placeholder: "",
field: "deleteFlag",
editField: "deleteFlag",
tableHide: true,
inputType: 'input',
rules: [
],
disabled: false,
},
],
},
inputType: "input",
rules: [],
disabled: false
}
]
}
};
},
created() {},
methods: {
operateDatasource(type, prop) {
this.dialogVisibleSetDataSource = true
this.dialogVisibleSetDataSource = true;
if (prop) {
this.dataSource = prop.msg;
} else {
this.dataSource = {}
this.dataSource = {};
}
this.$refs.EditDataSource.getSystem()
this.$refs.EditDataSource.getSystem();
},
refreshList() {
this.$refs.listPage.handleQueryForm('query')
}
this.$refs.listPage.handleQueryForm("query");
}
}
};
</script>

Loading…
Cancel
Save