feat(): 增加资产接入基础字典、增加数据元标签修改功能
基础字典 是数据资产项目当中的字典内容,而不是本项目当中的字典内容,主要作用为数据清洗过程中数据字典映射作用master
parent
7a53ec1c48
commit
ff86aeee9a
|
@ -69,11 +69,106 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="id" label="操作" >
|
<el-table-column prop="id" label="操作" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text">编辑</el-button>
|
<el-button type="text" @click="update(scope.row)">编辑</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus">
|
||||||
|
<el-form :model="form" label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<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="(value, key) in dictMap" :key="key" :label="key" :value="key"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item>
|
||||||
|
<el-table :data="dictMap[form.dictKey]" 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="formStatus = false">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -147,9 +242,28 @@ export default {
|
||||||
defaultValue: "-",
|
defaultValue: "-",
|
||||||
isDict: "N",
|
isDict: "N",
|
||||||
dictKey: "-",
|
dictKey: "-",
|
||||||
}, ]
|
}, ],
|
||||||
|
form: {},
|
||||||
|
formStatus: false,
|
||||||
|
dictMap: {
|
||||||
|
"system_sex": [
|
||||||
|
{ label: '男', val: '1', 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 }
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
update(row) {
|
||||||
|
this.form = row;
|
||||||
|
this.formStatus = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
@ -30,6 +30,63 @@
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>基础字典</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
title="基础字典"
|
||||||
|
width="200"
|
||||||
|
trigger="hover"
|
||||||
|
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
||||||
|
<i class="el-icon-question" slot="reference"></i>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
|
||||||
|
<el-card class="box-card" style="height: 300px">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{key}}</span>
|
||||||
|
</div>
|
||||||
|
<el-table :data="val" style="width: 100%" height="280px">
|
||||||
|
<el-table-column prop="label" label="标签" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
||||||
|
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="值" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
||||||
|
<el-input v-if="scope.row.isEdit" 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.isEdit"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="scope.row.isEdit = true"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
@click="scope.row.isEdit = false"
|
||||||
|
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" style="margin-top: 20px">
|
||||||
<el-tabs v-model="activeName" type="border-card">
|
<el-tabs v-model="activeName" type="border-card">
|
||||||
<el-tab-pane label="sys_user(用户表)" name="first">
|
<el-tab-pane label="sys_user(用户表)" name="first">
|
||||||
<overall-asset-structure/>
|
<overall-asset-structure/>
|
||||||
|
@ -55,6 +112,17 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: 'first',
|
activeName: 'first',
|
||||||
|
dictMap: {
|
||||||
|
"性别(system_sex)": [
|
||||||
|
{ label: '男', val: '1', 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 }
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
:load="expandTable"
|
:load="expandTable"
|
||||||
lazy
|
lazy
|
||||||
@node-click="(data) => showAssets=data.type"
|
@node-click="showAssetsFun"
|
||||||
:props="defaultProps">
|
:props="defaultProps">
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
|
||||||
|
@ -98,10 +98,13 @@ export default {
|
||||||
if (data.type === 'dataTable') {
|
if (data.type === 'dataTable') {
|
||||||
return resolve([])
|
return resolve([])
|
||||||
}
|
}
|
||||||
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resolve(this.childrenList)
|
resolve(this.childrenList)
|
||||||
}, 500);
|
}, 500);
|
||||||
|
},
|
||||||
|
showAssetsFun(data){
|
||||||
|
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
||||||
|
this.showAssets = data.type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,13 @@
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-connection"
|
||||||
|
@click="testConnection(scope.row)"
|
||||||
|
v-hasPermi="['system:access:edit']"
|
||||||
|
>测试</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -224,6 +231,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="testConnection(null)">测 试</el-button>
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -449,6 +457,18 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 测试连接 */
|
||||||
|
testConnection(row) {
|
||||||
|
if (row){
|
||||||
|
this.$modal.msgSuccess("测试连接成功");
|
||||||
|
}else {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.$modal.msgSuccess("测试连接成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
|
|
Loading…
Reference in New Issue