parent
947401fd52
commit
ad3f4bd2fc
|
@ -17,7 +17,7 @@ export function insertDictionary(dictionary) {
|
||||||
|
|
||||||
export function insertDictionaryInfo(dictionaryInfo) {
|
export function insertDictionaryInfo(dictionaryInfo) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/dict/insertDictionaryInfo',
|
url: '/dataSource/dict/insertDictionarySelect',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: dictionaryInfo
|
data: dictionaryInfo
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row :gutter="40" class="panel-group">
|
<el-row :gutter="40" class="panel-group">
|
||||||
<div class="title-header">
|
<div class="title-header">
|
||||||
|
|
||||||
|
|
||||||
{{dataSourceObj.dataSource.fromSystem}} - 资产结构概述
|
{{dataSourceObj.dataSource.fromSystem}} - 资产结构概述
|
||||||
</div>
|
</div>
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||||
|
@ -47,7 +49,7 @@
|
||||||
trigger="click">
|
trigger="click">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-input v-model="dictionary.dictionaryName"></el-input>
|
<el-input v-model="dictionaryNameAndVue"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-button @click="addDict">确定</el-button>
|
<el-button @click="addDict">确定</el-button>
|
||||||
|
@ -57,10 +59,12 @@
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
|
||||||
<el-col v-for="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
|
<el-col v-for="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
|
||||||
|
{{dictionaryInfoResp.dictionaryList}}
|
||||||
<el-card class="box-card" style="height: 300px">
|
<el-card class="box-card" style="height: 300px">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{dictionaryInfoResp.dictionaryName}}</span>
|
<span>{{dictionaryInfoResp.dictionaryNameAndValue}}</span>
|
||||||
<el-button style="float: right; padding: 3px 0"
|
<el-button style="float: right; padding: 3px 0"
|
||||||
type="text"
|
type="text"
|
||||||
@click="dictionaryInfoResp.dictionaryList.push({ label: null, value: null, isEdit: true })"
|
@click="dictionaryInfoResp.dictionaryList.push({ label: null, value: null, isEdit: true })"
|
||||||
|
@ -92,7 +96,7 @@
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.isEdit"
|
||||||
@click="editConfirm(scope.row)"
|
@click="editConfirm(scope.row,dictionaryInfoResp.id)"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-finished"
|
icon="el-icon-finished"
|
||||||
|
@ -104,11 +108,10 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-tabs v-model="activeName" type="border-card" >
|
<el-tabs v-model="activeName" type="border-card" >
|
||||||
<el-tab-pane :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="assetsModelResp in assetsModelRespArrayList">
|
<el-tab-pane :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="(assetsModelResp , index) in assetsModelRespArrayList" :name="index">
|
||||||
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
|
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
@ -120,10 +123,11 @@
|
||||||
<script>
|
<script>
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
import OverallAssetStructure from './OverallAssetStructure.vue'
|
import OverallAssetStructure from './OverallAssetStructure.vue'
|
||||||
import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary";
|
import {getDictionaryRespByDataSourceId, insertDictionary, insertDictionaryInfo} from "@/api/dataSource/dictionary";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
dictionaryInfoRespList:{
|
dictionaryInfoRespList:{
|
||||||
type:Array,
|
type:Array,
|
||||||
|
@ -142,36 +146,60 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
originalString: "性别(system_sex)",
|
||||||
dictionaryInfoRespList: [],
|
dictionaryInfoRespList: [],
|
||||||
activeName: 'first',
|
activeName: '0',
|
||||||
// activeName: assetsModelRespArrayList[0].dataTableList.tableList.tableName,
|
// activeName: assetsModelRespArrayList[0].dataTableList.tableList.tableName,
|
||||||
dictionary: {}
|
dictionaryNameAndVue:"",
|
||||||
|
dictionary: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
OverallAssetStructure,
|
OverallAssetStructure,
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
updateEdit(){
|
||||||
|
|
||||||
|
},
|
||||||
editConfirm(row){
|
editConfirm(row,dictionaryId){
|
||||||
if (!row.label || !row.value) {
|
if (!row.label || !row.value) {
|
||||||
this.$message.error('字典标签或字典值,不可为空');
|
this.$message.error('字典标签或字典值,不可为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.isEdit = false;
|
row.isEdit = false;
|
||||||
|
row.dictionaryId=dictionaryId
|
||||||
|
insertDictionaryInfo(row).then(
|
||||||
|
res => {
|
||||||
|
console.log("插入字典",res)
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
},
|
},
|
||||||
addDict(){
|
addDict(){
|
||||||
if (!this.dictionary.dictionaryName){
|
if (!this.dictionaryNameAndVue){
|
||||||
this.$message.error('数据字典,不可为空');
|
this.$message.error('数据字典,不可为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(this.dictionary.dictionaryName)
|
this.dictionary.dictionaryName=this.dictionaryNameAndVue.split('(')[0].trim()
|
||||||
|
this.dictionary.dictionaryValue=this.dictionaryNameAndVue.match(/\(([^)]+)\)/)[1];
|
||||||
|
this.dictionary.dataSourceId=this.dataSourceId
|
||||||
|
console.log(this.dictionary)
|
||||||
|
insertDictionary(this.dictionary).then(
|
||||||
|
res=>{
|
||||||
|
console.log("插入字典",res)
|
||||||
|
this.$message.success("插入字典成功")
|
||||||
|
this.getBigStructure()
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,6 +180,18 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="用户名" prop="dataSourceUsername">
|
||||||
|
<el-input v-model="form.dataSourceUsername" placeholder="请输入用户名"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="密码" prop="dataSourcePassword">
|
||||||
|
<el-input v-model="form.dataSourcePassword" placeholder="请输入密码"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
|
@ -346,6 +358,12 @@ export default {
|
||||||
additionalConfiguration: [
|
additionalConfiguration: [
|
||||||
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
|
dataSourceUsername: [
|
||||||
|
{required: true, message: "用户名不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
dataSourcePassword: [
|
||||||
|
{required: true, message: "密码不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
initialNumberOfConnections: [
|
initialNumberOfConnections: [
|
||||||
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
|
@ -535,11 +553,7 @@ export default {
|
||||||
testConnect(row) {
|
testConnect(row) {
|
||||||
testConnect(row).then(
|
testConnect(row).then(
|
||||||
res => {
|
res => {
|
||||||
if (res.code ===200){
|
this.$message (res==true?"成功":"失败");
|
||||||
this.$message.success(res.msg)
|
|
||||||
}else {
|
|
||||||
this.$message.error(res.msg)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
console.log("test:",row)
|
console.log("test:",row)
|
||||||
|
|
Loading…
Reference in New Issue