feat(): 新增资产结构详情父子组件传值
parent
6d7f9915ed
commit
866eaa1ba2
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div>
|
||||
<div v-if="tableParams != null">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>资产模型基本信息</span>
|
||||
</div>
|
||||
<el-descriptions border :column="2">
|
||||
<el-descriptions-item label="表名称">sys_user</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">用户表</el-descriptions-item>
|
||||
<el-descriptions-item label="表名称">{{tableParams.tableName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">{{tableParams.tableAsName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据量">12536</el-descriptions-item>
|
||||
<el-descriptions-item label="是否核心">
|
||||
<el-tag size="small">是</el-tag>
|
||||
|
@ -174,6 +174,23 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'OverallAssetStructure',
|
||||
props: {
|
||||
tableParams: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableParams: {
|
||||
handler(val) {
|
||||
if (val != null){
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
|
@ -259,6 +276,9 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
init(){
|
||||
console.log("查询")
|
||||
},
|
||||
update(row) {
|
||||
this.form = row;
|
||||
this.formStatus = true;
|
||||
|
|
|
@ -105,11 +105,11 @@
|
|||
|
||||
</el-col>
|
||||
<el-col :span="24" style="margin-top: 20px">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="sys_user(用户表)" name="first">
|
||||
<overall-asset-structure/>
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="checkTableName">
|
||||
<el-tab-pane v-for="table in tableList" :label="table.tableName+'('+table.tableAsName+')'"
|
||||
:name="table.tableName">
|
||||
<overall-asset-structure v-if="table.tableName === tableParams.tableName" :table-params="tableParams"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="sys_dept(部门表)" name="second">sys_dept(部门表)</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -129,7 +129,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
activeName: null,
|
||||
dictAddName: null,
|
||||
dictMap: {
|
||||
"性别(system_sex)": [
|
||||
|
@ -141,14 +141,37 @@ export default {
|
|||
{ label: '是', val: '1', isEdit: false },
|
||||
{ label: '否', val: '0', isEdit: false }
|
||||
],
|
||||
}
|
||||
},
|
||||
tableList: [],
|
||||
tableParams: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
OverallAssetStructure,
|
||||
CountTo
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
checkTableName(checkTab){
|
||||
this.tableParams = this.tableList.findLast(item => item.tableName === checkTab.name)
|
||||
},
|
||||
init(){
|
||||
let rows = [
|
||||
{
|
||||
tableName: "sys_user",
|
||||
tableAsName: "用户表"
|
||||
},
|
||||
{
|
||||
tableName: "sys_dept",
|
||||
tableAsName: "部门表"
|
||||
},
|
||||
];
|
||||
this.tableList = rows;
|
||||
this.activeName = rows[0].tableName;
|
||||
this.tableParams = rows[0]
|
||||
},
|
||||
editConfirm(row){
|
||||
if (!row.label || !row.val) {
|
||||
this.$message.error('字典标签或字典值,不可为空');
|
||||
|
|
Loading…
Reference in New Issue