feat: 字典表
parent
053b05b38f
commit
5e596c844f
|
@ -128,3 +128,41 @@ export function selectDept() {
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//查询字典
|
||||||
|
export function selectDictionaryy(id) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/selectDictionaryy?id=' + id,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典添加
|
||||||
|
export function dictionaryTypeAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/dictionaryTypeAdd',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典添加类型
|
||||||
|
export function dictionTypeAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/dictionTypeAdd',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//查询字典类型
|
||||||
|
export function selectDictionaryType() {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/selectDictionaryType',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//查询字典类型
|
||||||
|
export function selectDictionaryTypeId(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/selectDictionaryTypeId',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -185,7 +185,8 @@ export default {
|
||||||
props: [
|
props: [
|
||||||
'selectData',
|
'selectData',
|
||||||
'childrenMess',
|
'childrenMess',
|
||||||
'selectAll'
|
'selectAll',
|
||||||
|
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -277,6 +278,11 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.ENEN()
|
this.ENEN()
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.$off();
|
||||||
|
this.$off('send',this.childrenMess );
|
||||||
|
this.$off('大头小头',this.selectData);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendSelectAll(){
|
sendSelectAll(){
|
||||||
bus.$emit("sendSelecr", this. selectAll)
|
bus.$emit("sendSelecr", this. selectAll)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<el-row :gutter="40" class="panel-group">
|
<el-row :gutter="40" class="panel-group">
|
||||||
<div class="title-header">
|
<div class="title-header">
|
||||||
整体数据资产结构概述
|
整体数据资产结构概述
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
数据接入
|
数据接入
|
||||||
</div>
|
</div>
|
||||||
<count-to :duration="2600" :end-val="4" :start-val="0" class="card-panel-num"/>
|
<count-to :duration="2600" :end-val="2" :start-val="0" class="card-panel-num"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -49,6 +50,7 @@
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>基础字典</span>
|
<span> <span>{{dictAddName}}</span>基础字典</span>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
title="基础字典"
|
title="基础字典"
|
||||||
|
@ -41,38 +41,59 @@
|
||||||
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
||||||
<i class="el-icon-question" slot="reference"></i>
|
<i class="el-icon-question" slot="reference"></i>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
<el-popover
|
||||||
|
placement="right"
|
||||||
|
width="400"
|
||||||
|
trigger="click">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
|
<el-col :span="18">
|
||||||
|
<el-input v-model="dictAddName"></el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-button @click="addDict(dictAddName)">确定</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-button style="float: right; padding: 3px 0" type="text" slot="reference" >新增字典</el-button>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
{{dictName}}
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :key="index" v-for="(item ,index) in dictName" :md="8" :sm="24" :xs="12">
|
||||||
<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>{{key}}</span>
|
<span>{{item.name}}({{item.type}})</span>
|
||||||
|
<el-button style="float: right; padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
@click="item.dictionaryTypes.push( {dictionaryName: null, dictionaryValue: null, dictionStatus :1 })"
|
||||||
|
>新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="val" style="width: 100%" height="280px">
|
|
||||||
<el-table-column prop="label" label="标签">
|
<el-table :data="item.dictionaryTypes" style="width: 100%" height="280px">
|
||||||
|
|
||||||
|
<el-table-column prop="dictionaryName" label="标签">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
<span v-if="scope.row.dictionStatus === 0">{{scope.row.dictionaryName}}</span>
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
<el-input v-if="scope.row.dictionStatus ===1" v-model="scope.row.dictionaryName" size="mini"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="val" label="值">
|
<el-table-column prop="dictionaryValue" label="值">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
<span v-if="scope.row.dictionStatus === 0">{{scope.row.dictionaryValue}}</span>
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.val" size="mini"></el-input>
|
<el-input v-if="scope.row.dictionStatus === 1" v-model="scope.row.dictionaryValue" size="mini"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="val" label="操作">
|
<el-table-column prop="val" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!scope.row.isEdit"
|
v-if="scope.row.dictionStatus === 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="scope.row.isEdit = true"
|
@click="scope.row.dictionStatus =1"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.dictionStatus === 1"
|
||||||
@click="scope.row.isEdit = false"
|
@click="editConfirm(item,scope.row)"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-finished"
|
icon="el-icon-finished"
|
||||||
|
@ -84,7 +105,6 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
{{selectAll}}
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" style="margin-top: 20px">
|
<el-col :span="24" style="margin-top: 20px">
|
||||||
|
@ -112,11 +132,12 @@ import OverallAssetStructure from './OverallAssetStructure.vue'
|
||||||
import bus from '@/api/bus'
|
import bus from '@/api/bus'
|
||||||
import bues from '@/api/bues'
|
import bues from '@/api/bues'
|
||||||
import buss from '@/api/buss'
|
import buss from '@/api/buss'
|
||||||
import { selectChild, selectDataStur } from '@/api/kvt/kvt'
|
import { dictionaryTypeAdd, dictionTypeAdd, selectChild, selectDataStur, selectDictionaryTypeId } from '@/api/kvt/kvt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: [
|
props: [
|
||||||
'selectAll'
|
'selectAll',
|
||||||
|
'dictName'
|
||||||
],
|
],
|
||||||
// watch:{
|
// watch:{
|
||||||
// activeTab(newVal,oldVal){
|
// activeTab(newVal,oldVal){
|
||||||
|
@ -126,19 +147,25 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeTab: 'someDefaultValue',
|
activeTab: 'someDefaultValue',
|
||||||
|
title:null,
|
||||||
|
dictAddName: [],
|
||||||
dictMap: {
|
dictMap: {
|
||||||
"性别(system_sex)": [
|
|
||||||
{ label: '男', val: '1', isEdit: false },
|
// "性别(system_sex)": [
|
||||||
{ label: '女', val: '2', isEdit: false },
|
// { label: '男', val: '1', isEdit: false },
|
||||||
{ label: '未知', val: '0', isEdit: false },
|
// { label: '女', val: '2', isEdit: false },
|
||||||
],
|
// { label: '未知', val: '0', isEdit: false },
|
||||||
"开关(system_y_n)": [
|
// ],
|
||||||
{ label: '是', val: '1', isEdit: false },
|
|
||||||
{ label: '否', val: '0', isEdit: false }
|
// "开关(system_y_n)": [
|
||||||
],
|
// // this.dictAddName
|
||||||
|
// { label: '是', val: '1', isEdit: false },
|
||||||
|
// { label: '否', val: '0', isEdit: false }
|
||||||
|
// ],
|
||||||
},
|
},
|
||||||
selectData: [],
|
selectData: [],
|
||||||
chirien: []
|
chirien: [],
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -166,11 +193,66 @@ export default {
|
||||||
bues.$emit("大头小头",this.selectData)
|
bues.$emit("大头小头",this.selectData)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//添加修改
|
||||||
|
editConfirm(item,row){
|
||||||
|
console.log(item)
|
||||||
|
if (!row.dictionaryName || !row.dictionaryValue) {
|
||||||
|
this.$message.error('字典标签或字典值,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
row.dictionStatus = 0
|
||||||
|
|
||||||
|
console.log(this.selectAll.dataAccess)
|
||||||
|
let dictionaryy ={}
|
||||||
|
const id =row.id
|
||||||
|
const type = item.type
|
||||||
|
const dictionaryName = row.dictionaryName
|
||||||
|
const dictionaryValue =row.dictionaryValue
|
||||||
|
const status =row.dictionStatus
|
||||||
|
dictionaryy = {
|
||||||
|
id: id,
|
||||||
|
type: type,
|
||||||
|
dictionaryName: dictionaryName,
|
||||||
|
dictionaryValue: dictionaryValue,
|
||||||
|
dictionStatus: status
|
||||||
|
}
|
||||||
|
selectDictionaryTypeId(dictionaryy).then(res =>{
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
addDict(dictAddName){
|
||||||
|
if (dictAddName == null || dictAddName ==''){
|
||||||
|
this.$message.error('数据字典,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts=this.dictAddName.split(',');
|
||||||
|
let dictionaryType = {}
|
||||||
|
const name =parts[0]
|
||||||
|
const type =parts[1]
|
||||||
|
const dictionaryName = dictAddName
|
||||||
|
dictionaryType = {
|
||||||
|
name,type,dictionaryName
|
||||||
|
}
|
||||||
|
dictionTypeAdd(dictionaryType).then(res =>{
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
console.log("parts",parts)
|
||||||
|
this.dictName[this.dictName.dictionaryTypes] = []
|
||||||
|
this.dictName.dictionaryTypes = null
|
||||||
|
|
||||||
|
},
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
util(row){
|
||||||
|
console.log(row)
|
||||||
|
},
|
||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
this.selectDataStur(tab)
|
this.selectDataStur(tab)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container :style="{height: mainHeight + 'px'}">
|
<el-container :style="{height: mainHeight + 'px'}">
|
||||||
<el-aside>
|
<el-aside>
|
||||||
|
{{assetStructureList}}
|
||||||
<el-tree :data="assetStructureList"
|
<el-tree :data="assetStructureList"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
:load="expandTable"
|
:load="expandTable"
|
||||||
lazy
|
lazy
|
||||||
@node-click="showAssetsFun"
|
@node-click="showAssetsFun"
|
||||||
:props="defaultProps">
|
:props="defaultProps">
|
||||||
<div class="custom-tree-node" @click="selectDepartment(data.databaseName)" slot-scope="{ node, data }">
|
<div class="custom-tree-node" @click="selectDepartment(data.id,data.databaseName)" slot-scope="{ node, data }">
|
||||||
<div v-if="data.type == 1" @click="selctChild(data.name)">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
<div v-if="data.type == 1" @click="selctChild(data.name)">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
||||||
<div v-if="data.type == 2" @click="selctChild(data.name)">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
<div v-if="data.type == 2" @click="selctChild(data.name)">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,8 +17,8 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main>
|
<el-main>
|
||||||
<OverallAssets v-if="showAssets == null"/>
|
<OverallAssets v-if="showAssets == null"/>
|
||||||
<overall-specific-assets v-if="showAssets == 1" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
|
<overall-specific-assets v-if="showAssets == 1" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
|
||||||
<overall-asset-structure v-if="showAssets == 2" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
|
<overall-asset-structure v-if="showAssets == 2" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ import {
|
||||||
selectDataSource,
|
selectDataSource,
|
||||||
selectDataStructure,
|
selectDataStructure,
|
||||||
selectDataStur,
|
selectDataStur,
|
||||||
selectDepartmen
|
selectDepartmen, selectDictionaryy
|
||||||
} from '@/api/kvt/kvt'
|
} from '@/api/kvt/kvt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -76,7 +77,8 @@ export default {
|
||||||
databaseNam: null,
|
databaseNam: null,
|
||||||
dataStructure:[],
|
dataStructure:[],
|
||||||
childr:[],
|
childr:[],
|
||||||
chir: []
|
chir: [],
|
||||||
|
dictAddName: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -91,15 +93,20 @@ export default {
|
||||||
this.childr=res.data
|
this.childr=res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectDepartment(selectDepartment){
|
selectDepartment(id,selectDepartment){
|
||||||
selectDepartmen(selectDepartment).then(res=>{
|
selectDepartmen(selectDepartment).then(res=>{
|
||||||
console.log("res",res)
|
console.log("res",res)
|
||||||
this.childrenList = res.data
|
this.childrenList = res.data
|
||||||
})
|
})
|
||||||
|
selectDictionaryy(id).then(res => {
|
||||||
|
console.log("rrrr",res)
|
||||||
|
this.dictAddName = res.data
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
selectDataSource(){
|
selectDataSource(){
|
||||||
selectDataSource().then(res=>{
|
selectDataSource().then(res=>{
|
||||||
console.log(res)
|
console.log("ressss",res)
|
||||||
this.assetStructureList = res.data
|
this.assetStructureList = res.data
|
||||||
console.log("wdesf",this.assetStructureList)
|
console.log("wdesf",this.assetStructureList)
|
||||||
})
|
})
|
||||||
|
|
|
@ -458,7 +458,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//同步
|
//同步
|
||||||
synchronizationAdd(row){
|
synchronizationAdd(row){
|
||||||
synchronizationAdd(row).then(res=>{})
|
synchronizationAdd(row).then(res=>{
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
dataTypeList(){
|
dataTypeList(){
|
||||||
dataTypeList().then(res=> {
|
dataTypeList().then(res=> {
|
||||||
|
|
Loading…
Reference in New Issue