feat() 规则维护页面,选择数据接入 选择资产结构 选择资产模型

chao
chao 2024-05-08 21:47:10 +08:00
parent 0207d7766c
commit fa31eccae0
1 changed files with 20 additions and 106 deletions

View File

@ -232,7 +232,7 @@
<div slot="header" class="clearfix">
<span>选择资产结构</span>
</div>
<el-select v-model="assets" style="width: 100%;">
<el-select v-model="assets" style="width: 100%;" @change="changeAssets">
<el-option v-for="_assets in assetsList"
:key="_assets.id"
:value="_assets.id"
@ -248,9 +248,9 @@
</div>
<el-descriptions direction="vertical" :column="3" border>
<el-descriptions-item v-for="_dataModel in dataModelList"
:label='_dataModel.name + "("+_dataModel.comment+")"'>
<el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">
{{ dataModeMap[_dataModel.name] }}
:label='_dataModel.name + "("+_dataModel.annotation+")"'>
<el-radio v-for="(value , key) in dataSourceValueMap" v-if="key === _dataModel.name" v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">
{{ value }}
</el-radio>
</el-descriptions-item>
</el-descriptions>
@ -270,7 +270,7 @@
import Encoding from "@/components/Encoding/index.vue";
import {getEngineAndEngineVersion, updateEngineActivatedOrNot, updateEngineStatus} from "@/api/data/engine";
import {addEngineVersion, updateEngine} from "@/api/data/engineVersion";
import {listAssetStructure, selectAssetSouructureTableList} from "@/api/data/structure";
import {listAssetStructure, selectAssetSouructureTableList, tableDetailsValue} from "@/api/data/structure";
export default {
name: "EngineVersion",
@ -297,109 +297,15 @@ export default {
//
assetStructure: null,
//
assetsList: [
{
name: "sys_user",
as: "用户表",
dataTotal: 635847,
type: "dataTable",
childrenList: []
},
{
name: "sys_dept",
as: "部门表",
dataTotal: 362548,
type: "dataTable",
childrenList: []
},
{
name: "sys_notice",
as: "通知公告",
dataTotal: 6347,
type: "dataTable",
childrenList: []
}
],
assetsList: [],
//
assets: null,
tableId: null,
dataSourceValueMap: null,
//
dataModelList: [
{
id: 1,
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: "-",
},],
dataModelList: [],
//
dataMode: null,
//
dataModeMap: {
id: 1,
name: "张三",
sex: 1,
price: "653.69",
create_time: "2024-5-7 16:37:16",
},
testResult: "",
//
assetStructureDataCount: {
@ -419,6 +325,17 @@ export default {
this.initRuleEngine();
},
methods: {
changeAssets(row) {
this.tableId = row;
this.assetsList.forEach(item => {
if (item.id === row){
this.dataModelList = item.assetTableDetailsList
}
})
tableDetailsValue(row).then(response => {
this.dataSourceValueMap = response.data
})
},
changeAssetStructure(row) {
this.assets = null;
this.assetsList = [];
@ -428,7 +345,6 @@ export default {
// API data this.childrenList
this.assetsList = response.data.tableDetailsRespList;
// this.childrenList type "dataTable"
this.assetsList.forEach((item) => {
item.type = "dataTable";
@ -436,8 +352,6 @@ export default {
this.structureTableDataCount.tableCount = response.data.tableCount
this.structureTableDataCount.tableDataCount = response.data.tableDataCount
this.structureTableDataCount.childrenList = this.childrenList
console.log("aaaaaaaaa")
console.log(this.assetsList)
})
},
saveCoding() {