feat:(还差数据字典映射)数据结构已完成百分之90
parent
6c92193ba3
commit
ac0da3ae3e
|
@ -124,6 +124,17 @@ export function statistics() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 修改字段数据
|
||||||
|
export function updateAssetModel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/model/UpdateAssetModel',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
|
import {listDept} from "@/api/system/dept";
|
||||||
|
import {listUser} from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props:{
|
props:{
|
||||||
|
@ -105,6 +107,13 @@ export default {
|
||||||
systemName: "云计算系统",
|
systemName: "云计算系统",
|
||||||
databaseName: "yunjisuan",
|
databaseName: "yunjisuan",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 用户查询参数
|
||||||
|
userQueryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// 用户列表
|
// 用户列表
|
||||||
|
@ -115,8 +124,30 @@ export default {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
setTimeout(() => this.loading = false, 200)
|
setTimeout(() => this.loading = false, 200)
|
||||||
this.init()
|
this.init()
|
||||||
|
this.getList()
|
||||||
|
this.getUserList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
/** 查询部门列表 */
|
||||||
|
getList() {
|
||||||
|
listDept(this.queryParams).then(response => {
|
||||||
|
console.log(response.data)
|
||||||
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
|
console.log(this.deptList)
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 查询用户列表 */
|
||||||
|
getUserList() {
|
||||||
|
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||||
|
this.userList = response.data.rows;
|
||||||
|
this.userQueryParams.total = response.data.total;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
parseTime,
|
parseTime,
|
||||||
init(){
|
init(){
|
||||||
let response = {
|
let response = {
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="deptList"
|
:data="deptList"
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="true"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
row-key="deptId"
|
row-key="deptId"
|
||||||
>
|
>
|
||||||
|
@ -67,8 +67,16 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
<!-- <el-pagination-->
|
||||||
</el-tab-pane>
|
<!-- @size-change="handleSizeChange"-->
|
||||||
|
<!-- @current-change="handleCurrentChange"-->
|
||||||
|
<!-- :current-page="queryParams.pageNum"-->
|
||||||
|
<!-- :page-sizes="[10, 20, 30, 40]"-->
|
||||||
|
<!-- :page-size="queryParams.pageSize"-->
|
||||||
|
<!-- :total="total"-->
|
||||||
|
<!-- layout="total, sizes, prev, pager, next, jumper"-->
|
||||||
|
<!-- />-->
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="用户授权" name="user">
|
<el-tab-pane label="用户授权" name="user">
|
||||||
<el-table ref="table" v-loading="loading" :data="userList">
|
<el-table ref="table" v-loading="loading" :data="userList">
|
||||||
<el-table-column align="center" label="用户名称" prop="userName"/>
|
<el-table-column align="center" label="用户名称" prop="userName"/>
|
||||||
|
@ -90,7 +98,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
<pagination v-show="userQueryParams.total> 0" :limit.sync="userQueryParams.pageSize" :page.sync="userQueryParams.pageNum" :total="userQueryParams.total"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,6 +108,7 @@
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
import {listDept} from "@/api/system/dept";
|
import {listDept} from "@/api/system/dept";
|
||||||
|
import {listUser} from "@/api/system/user";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -120,13 +129,20 @@ export default {
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// 用户列表
|
// 用户列表
|
||||||
userList: []
|
userList: [],
|
||||||
|
// 用户查询参数
|
||||||
|
userQueryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
setTimeout(() => this.loading = false, 200)
|
setTimeout(() => this.loading = false, 200)
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.getUserList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询部门列表 */
|
/** 查询部门列表 */
|
||||||
|
@ -138,6 +154,16 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 查询用户列表 */
|
||||||
|
getUserList() {
|
||||||
|
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||||
|
this.userList = response.data.rows;
|
||||||
|
this.userQueryParams.total = response.data.total;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
parseTime,
|
parseTime,
|
||||||
init(){
|
init(){
|
||||||
// this.deptList = this.handleTree(response.data, "deptId");
|
// this.deptList = this.handleTree(response.data, "deptId");
|
||||||
|
|
|
@ -131,7 +131,7 @@ export default {
|
||||||
dataModuleSum: 0,
|
dataModuleSum: 0,
|
||||||
dataSourceSum: 0
|
dataSourceSum: 0
|
||||||
}
|
}
|
||||||
listSource(this.queryParams).then(response => {
|
listSource({}).then(response => {
|
||||||
this.sourceList = response.data.rows;
|
this.sourceList = response.data.rows;
|
||||||
console.log(this.sourceList)
|
console.log(this.sourceList)
|
||||||
this.sourceList.forEach(source => {
|
this.sourceList.forEach(source => {
|
||||||
|
|
|
@ -1,174 +1,244 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>资产模型基本信息</span>
|
<span>资产模型基本信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-descriptions border :column="2">
|
<el-descriptions border :column="2">
|
||||||
<el-descriptions-item label="表名称">{{title.tableName}}</el-descriptions-item>
|
<el-descriptions-item label="表名称">{{title.tableName}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="表备注">{{title.tableComment}}</el-descriptions-item>
|
<el-descriptions-item label="表备注">{{title.tableComment}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="数据量">{{title.tableCount}}</el-descriptions-item>
|
<el-descriptions-item label="数据量">{{title.tableCount}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否核心">
|
<el-descriptions-item label="是否核心">
|
||||||
<el-tag size="small">是</el-tag>
|
<el-tag size="small">是</el-tag>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style=" margin-top: 20px;">
|
<el-card style=" margin-top: 20px;">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>资产模型详细信息</span>
|
<span>资产模型详细信息</span>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column prop="name" label="名称" />
|
<el-table-column prop="name" label="名称" />
|
||||||
<el-table-column prop="comment" label="注释" />
|
<el-table-column prop="comment" label="注释" />
|
||||||
<el-table-column prop="isPrimaryKey" label="是否主键" >
|
<el-table-column prop="isPrimaryKey" label="是否主键" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="small" :type="scope.row.isPrimaryKey === 'Y' ? 'success' : ''">
|
<el-tag size="small" :type="scope.row.isPrimaryKey === 'Y' ? 'success' : ''">
|
||||||
{{scope.row.isPrimaryKey}}
|
{{scope.row.isPrimaryKey}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="type" label="类型" />
|
<el-table-column prop="type" label="类型" />
|
||||||
<el-table-column prop="mappingType" label="映射类型" />
|
<el-table-column prop="mappingType" label="映射类型" />
|
||||||
<el-table-column prop="length" label="长度" />
|
<el-table-column prop="length" label="长度" />
|
||||||
<el-table-column prop="decimalPlaces" label="小数位" />
|
<el-table-column prop="decimalPlaces" label="小数位" />
|
||||||
<el-table-column prop="isNull" label="是否为空" >
|
<el-table-column prop="isNull" label="是否为空" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="small" :type="scope.row.isNull === 'Y' ? 'success' : 'danger'">
|
<el-tag size="small" :type="scope.row.isNull === 'Y' ? 'success' : 'danger'">
|
||||||
{{scope.row.isNull}}
|
{{scope.row.isNull}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="defaultValue" label="默认值" />
|
<el-table-column prop="defaultValue" label="默认值" />
|
||||||
<el-table-column prop="isDict" label="是否字典" >
|
<el-table-column prop="isDict" label="是否字典" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
|
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
|
||||||
{{scope.row.isDict}}
|
{{scope.row.isDict}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="dictKey" label="映射字典" >
|
<el-table-column prop="dictKey" label="映射字典" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="scope.row.isDict === 'Y'"
|
v-if="scope.row.isDict === 'Y'"
|
||||||
placement="left"
|
placement="left"
|
||||||
width="200"
|
width="200"
|
||||||
trigger="hover">
|
trigger="hover">
|
||||||
<el-table :data="[
|
<el-table :data="scope.row.dictionaryDatas">
|
||||||
{ label: '男', value: '1' },
|
<el-table-column property="label" label="字典标签"/>
|
||||||
{ label: '女', value: '2' },
|
<el-table-column property="val" label="字典值"/>
|
||||||
{ label: '未知', value: '0' },
|
</el-table>
|
||||||
]">
|
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
||||||
<el-table-column property="label" label="字典标签"/>
|
</el-popover>
|
||||||
<el-table-column property="value" label="字典值"/>
|
</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
<el-table-column prop="id" label="操作" >
|
||||||
</el-popover>
|
<template slot-scope="scope">
|
||||||
</template>
|
<el-button type="text" @click="update(scope.row)">编辑</el-button>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="id" label="操作" >
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
</el-table>
|
||||||
<el-button type="text">编辑</el-button>
|
</el-card>
|
||||||
</template>
|
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus">
|
||||||
</el-table-column>
|
<el-form :model="form" label-width="120px">
|
||||||
</el-table>
|
<el-row>
|
||||||
</el-card>
|
<el-col :span="12">
|
||||||
</div>
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="form.name" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="注释">
|
||||||
|
<el-input v-model="form.comment" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否主键">
|
||||||
|
<el-tag size="small" :type="form.isPrimaryKey === 'Y' ? 'success' : 'danger'">
|
||||||
|
{{form.isPrimaryKey}}
|
||||||
|
</el-tag>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="数据类型">
|
||||||
|
<el-input v-model="form.type" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="数据长度">
|
||||||
|
<el-input v-model="form.length" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="小数位">
|
||||||
|
<el-input v-model="form.decimalPlaces" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否为空">
|
||||||
|
<el-tag size="small" :type="form.isNull === 'Y' ? 'success' : 'danger'">
|
||||||
|
{{form.isNull}}
|
||||||
|
</el-tag>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="默认值">
|
||||||
|
<el-input v-model="form.defaultValue" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="映射字段">
|
||||||
|
<el-input v-model="form.mappingType" readonly autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否字典">
|
||||||
|
<el-switch
|
||||||
|
v-model="form.isDict"
|
||||||
|
active-value="Y"
|
||||||
|
inactive-value="N"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="form.isDict === 'Y'">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="字典">
|
||||||
|
<el-select v-model="form.dictKey">
|
||||||
|
<el-option v-for="dict in dictMap" :key="dict.id" :label="dict.dictionaryName+'('+dict.dictionaryKey+')'" :value="dict.dictionaryKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item>
|
||||||
|
<el-table :data="dictionaryDataList" striped border>
|
||||||
|
<el-table-column property="label" label="字典标签"/>
|
||||||
|
<el-table-column property="val" label="字典值"/>
|
||||||
|
</el-table>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="formStatus = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="updDict(row)">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {assetModelList } from "@/api/kvt/jdbc";
|
||||||
|
import {getDictionaryList} from "@/api/kvt/dictionary";
|
||||||
|
import {updateAccredit} from "@/api/kvt/assetAccerdit";
|
||||||
|
|
||||||
|
|
||||||
import {assetModelList} from "@/api/kvt/jdbc";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'overallAssetStructure',
|
name: 'overallAssetStructure',
|
||||||
watch:{
|
watch:{
|
||||||
'title': {
|
'title': {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
console.log(val)
|
this.getDictionaryList()
|
||||||
assetModelList(val).then(res => {
|
this.assetModelList()
|
||||||
this.tableData = res.data
|
},
|
||||||
})
|
immediate: true
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
props: {
|
'form.dictKey':{
|
||||||
title: {
|
handler(val) {
|
||||||
}
|
this.dictMap.forEach(dict => {
|
||||||
|
if (dict.dictionaryKey === val){
|
||||||
|
console.log(val)
|
||||||
|
this.dictionaryDataList = dict.dictionaryDataList
|
||||||
|
this.form.dictionaryId = dict.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dictionaryDataList:[],
|
||||||
|
form:{},
|
||||||
|
formStatus: false,
|
||||||
|
tableData: [],
|
||||||
|
dictMap: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
assetModelList(){
|
||||||
|
assetModelList(this.title).then(res => {
|
||||||
|
this.tableData = res.data
|
||||||
|
this.formStatus = false
|
||||||
|
console.log(this.tableData)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
data() {
|
updDict(){
|
||||||
return {
|
console.log(this.form)
|
||||||
tableData: [
|
updateAccredit(this.form).then(res => {
|
||||||
{
|
console.log(res)
|
||||||
id: 1,
|
this.assetModelList()
|
||||||
name: "id",
|
})
|
||||||
comment: "主键",
|
|
||||||
isPrimaryKey: "Y",
|
|
||||||
type: "bigint",
|
|
||||||
mappingType: "Long",
|
|
||||||
length: "-",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 2,
|
|
||||||
name: "name",
|
|
||||||
comment: "姓名",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "varchar",
|
|
||||||
mappingType: "String",
|
|
||||||
length: "64",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 3,
|
|
||||||
name: "sex",
|
|
||||||
comment: "性别",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "char",
|
|
||||||
mappingType: "String",
|
|
||||||
length: "1",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "Y",
|
|
||||||
dictKey: "system_sex",
|
|
||||||
}, {
|
|
||||||
id: 4,
|
|
||||||
name: "price",
|
|
||||||
comment: "金额",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "double",
|
|
||||||
mappingType: "BigDecimal",
|
|
||||||
length: "10",
|
|
||||||
decimalPlaces: "2",
|
|
||||||
isNull: "N",
|
|
||||||
defaultValue: "0.00",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, {
|
|
||||||
id: 5,
|
|
||||||
name: "create_time",
|
|
||||||
comment: "创建时间",
|
|
||||||
isPrimaryKey: "N",
|
|
||||||
type: "datetime",
|
|
||||||
mappingType: "Date",
|
|
||||||
length: "-",
|
|
||||||
decimalPlaces: "-",
|
|
||||||
isNull: "Y",
|
|
||||||
defaultValue: "-",
|
|
||||||
isDict: "N",
|
|
||||||
dictKey: "-",
|
|
||||||
}, ]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
getDictionaryList() {
|
||||||
|
getDictionaryList(this.title.dataSourceId).then(res => {
|
||||||
|
this.dictMap = res.data
|
||||||
|
console.log(this.dictMap)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async update(row) {
|
||||||
|
await this.getDictionaryList()
|
||||||
|
this.form = row;
|
||||||
|
this.formStatus = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
@ -1,42 +1,114 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row :gutter="40" class="panel-group">
|
<el-row :gutter="40" class="panel-group">
|
||||||
<div class="title-header">
|
<div class="title-header">
|
||||||
{{title.dataSourceName+'('+title.databaseName+'-'+title.systemName+')'}} - 资产结构概述
|
{{title.dataSourceName+'('+title.databaseName+'-'+title.systemName+')'}} - 资产结构概述
|
||||||
|
</div>
|
||||||
|
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||||
|
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
||||||
|
<div class="card-panel-icon-wrapper icon-message">
|
||||||
|
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||||
</div>
|
</div>
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
<div class="card-panel-text">
|
||||||
<div class="card-panel-icon-wrapper icon-message">
|
资产模型
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
</div>
|
||||||
</div>
|
<count-to :duration="3000" :end-val="assetModel" :start-val="0" class="card-panel-num"/>
|
||||||
<div class="card-panel-description">
|
</div>
|
||||||
<div class="card-panel-text">
|
</div>
|
||||||
资产模型
|
</el-col>
|
||||||
</div>
|
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||||
<count-to :duration="3000" :end-val="assetModel" :start-val="0" class="card-panel-num"/>
|
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
||||||
</div>
|
<div class="card-panel-icon-wrapper icon-money">
|
||||||
</div>
|
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
<div class="card-panel-text">
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
数据模型
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
</div>
|
||||||
</div>
|
<count-to :duration="3200" :end-val="dataModel" :start-val="0" class="card-panel-num"/>
|
||||||
<div class="card-panel-description">
|
</div>
|
||||||
<div class="card-panel-text">
|
</div>
|
||||||
数据模型
|
</el-col>
|
||||||
</div>
|
<el-col :span="24">
|
||||||
<count-to :duration="3200" :end-val="dataModel" :start-val="0" class="card-panel-num"/>
|
<el-card class="box-card">
|
||||||
</div>
|
<div slot="header" class="clearfix">
|
||||||
</div>
|
<span>基础字典</span>
|
||||||
</el-col>
|
<el-popover
|
||||||
<el-col :span="24">
|
placement="top-start"
|
||||||
<el-tabs v-model="activeName" type="border-card">
|
title="基础字典"
|
||||||
<el-tab-pane v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
width="200"
|
||||||
<overall-asset-structure v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
trigger="hover"
|
||||||
</el-tab-pane>
|
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
||||||
</el-tabs>
|
<i class="el-icon-question" slot="reference"></i>
|
||||||
</el-col>
|
</el-popover>
|
||||||
</el-row>
|
<el-popover
|
||||||
|
placement="right"
|
||||||
|
width="200px"
|
||||||
|
trigger="click">
|
||||||
|
|
||||||
|
<el-form :inline="true" :model="dictInfo" class="demo-form-inline">
|
||||||
|
<el-form-item label="字典名称:">
|
||||||
|
<el-input v-model="dictInfo.dictionaryName" style="width: 150px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="字典Key:">
|
||||||
|
<el-input v-model="dictInfo.dictionaryKey" style="width: 150px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="addDict">确定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col v-for="dict in dictMap" :md="8" :sm="24" :xs="12">
|
||||||
|
<el-card class="box-card" style="height: 300px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{dict.dictionaryName+'('+dict.dictionaryKey+')'}}</span>
|
||||||
|
<el-button style="float: right; padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
@click="deleteDictionary(dict.id)"
|
||||||
|
>删除</el-button>
|
||||||
|
<el-button style="float: right; padding: 3px 0;margin-right: 8px"
|
||||||
|
type="text"
|
||||||
|
@click="dict.dictionaryDataList.push({ label: null, val: null, edit: true })"
|
||||||
|
>新增</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="dict.dictionaryDataList" style="width: 100%" height="280px">
|
||||||
|
<el-table-column prop="label" label="标签">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="!scope.row.edit">{{scope.row.label}}</span>
|
||||||
|
<el-input v-if="scope.row.edit" v-model="scope.row.label" size="mini"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="值">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="!scope.row.edit">{{scope.row.val}}</span>
|
||||||
|
<el-input v-if="scope.row.edit" v-model="scope.row.val" size="mini"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-if="!scope.row.edit" size="mini" type="text" icon="el-icon-edit" @click="scope.row.edit = true">修改</el-button>
|
||||||
|
<el-button v-if="scope.row.edit" @click="editConfirm(dict,scope.row)" size="mini" type="text" icon="el-icon-finished">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-tabs v-model="activeName" type="border-card">
|
||||||
|
<el-tab-pane v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||||
|
<overall-asset-structure ref="assetStru" v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -44,46 +116,110 @@
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
import overallAssetStructure from "@/views/kvt/assets/overallAssetStructure.vue";
|
import overallAssetStructure from "@/views/kvt/assets/overallAssetStructure.vue";
|
||||||
|
|
||||||
|
import {addDictionary, deleteDictionary, getDictionaryList} from "@/api/kvt/dictionary";
|
||||||
|
import {addData, updateData} from "@/api/kvt/data";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
watch:{
|
watch:{
|
||||||
'title':{
|
'title':{
|
||||||
handler(val){
|
handler(val){
|
||||||
console.log(val)
|
this.getDictionaryList()
|
||||||
this.activeName = val.tableList[0].tableName
|
this.activeName = val.tableList[0].tableName
|
||||||
this.assetModel = 0
|
this.assetModel = 0
|
||||||
this.dataModel = 0
|
this.dataModel = 0
|
||||||
val.tableList.forEach(table => {
|
val.tableList.forEach(table => {
|
||||||
if (table.tableCount!=null){
|
if (table.tableCount!=null){
|
||||||
this.dataModel = parseInt(this.dataModel) + parseInt(table.tableCount);
|
this.dataModel = parseInt(this.dataModel) + parseInt(table.tableCount);
|
||||||
}
|
}
|
||||||
if (table.fields!=null){
|
if (table.fields!=null){
|
||||||
this.assetModel = parseInt(this.assetModel) + parseInt(table.fields);
|
this.assetModel = parseInt(this.assetModel) + parseInt(table.fields);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
props: {
|
|
||||||
title:{
|
|
||||||
tableName: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
activeName: '',
|
|
||||||
assetModel: 0,
|
|
||||||
dataModel: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
overallAssetStructure,
|
|
||||||
CountTo
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleSetLineChartData(type) {
|
|
||||||
this.$emit('handleSetLineChartData', type)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title:{}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dictInfo: {
|
||||||
|
dictionaryName: null,
|
||||||
|
dictionaryKey: null,
|
||||||
|
dataSourceId: null
|
||||||
|
},
|
||||||
|
dictMap: {},
|
||||||
|
activeName: '',
|
||||||
|
assetModel: 0,
|
||||||
|
dataModel: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
overallAssetStructure,
|
||||||
|
CountTo
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
deleteDictionary(id) {
|
||||||
|
deleteDictionary(id).then(res => {
|
||||||
|
this.getDictionaryList()
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
getDictionaryList() {
|
||||||
|
getDictionaryList(this.title.id).then(res => {
|
||||||
|
this.dictMap = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
editConfirm(dict,row){
|
||||||
|
console.log(row)
|
||||||
|
if (!row.label || !row.val) {
|
||||||
|
this.$message.error('字典标签或字典值,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (row.id) {
|
||||||
|
console.log('修改')
|
||||||
|
updateData(row).then(res => {
|
||||||
|
row.edit = false;
|
||||||
|
this.getDictionaryList()
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
console.log('添加')
|
||||||
|
row.dictionaryId=dict.id
|
||||||
|
addData(row).then(res => {
|
||||||
|
row.edit = false;
|
||||||
|
this.getDictionaryList()
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
addDict(){
|
||||||
|
if (!this.dictInfo.dictionaryName){
|
||||||
|
this.$message.error('字典名称,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.dictInfo.dictionaryKey){
|
||||||
|
this.$message.error('字典Key,不可为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.dictInfo.dataSourceId = this.title.id
|
||||||
|
addDictionary(this.dictInfo).then(res => {
|
||||||
|
this.dictInfo = {
|
||||||
|
dictionaryName: null,
|
||||||
|
dictionaryKey: null,
|
||||||
|
dataSourceId: null
|
||||||
|
}
|
||||||
|
this.getDictionaryList()
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleSetLineChartData(type) {
|
||||||
|
this.$emit('handleSetLineChartData', type)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue