Commit 0a8dd46d by liuyong

修改三个架构资产

1 parent 1dd4058d
...@@ -427,7 +427,7 @@ export function queryLogManageAllLog(params) { ...@@ -427,7 +427,7 @@ export function queryLogManageAllLog(params) {
export function getCurrentZiChanJiaGouTable(params) { export function getCurrentZiChanJiaGouTable(params) {
return post('/network/arc-ast-now/', params); return post('/network/arc-ast-now/', params);
} }
// 现状资产架构,表格 // 系统资产架构,表格
export function getTotalZiChanJiaGouTable(params) { export function getTotalZiChanJiaGouTable(params) {
return post('/network/arc-ast-tot/', params); return post('/network/arc-ast-tot/', params);
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="search_menu_item"> <div class="search_menu_item">
<span class="search_title">组件类型</span> <span class="search_title">组件类型</span>
<el-select filterable remote :remote-method="queryZuJianLeiXingSelect" v-model="searchParams.archiEleId" clearable placeholder="请选择" class="search_item"> <el-select filterable remote :remote-method="queryZuJianLeiXingSelect" v-model="searchParams.archiEleId" clearable placeholder="请选择" class="search_item">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> </el-select>
</div> </div>
...@@ -112,9 +112,9 @@ ...@@ -112,9 +112,9 @@
<el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let3"> <el-form-item label="关联资产:" prop="let6">
<el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3"> <el-select clearable @change="guanLianZiChanChange" filterable remote :remote-method="queryGuanLianZiChan" placeholder="请选择" multiple v-model="ruleForm.let6">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in guanLianZiChanSelect" :key="String(item.assetId)" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="排序:" prop="let4"> <el-form-item label="排序:" prop="let4">
...@@ -126,10 +126,13 @@ ...@@ -126,10 +126,13 @@
<el-radio label="隐藏"></el-radio> <el-radio label="隐藏"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="关联资产:" prop="let6"> <el-form-item label="组件类型:" prop="let3">
<!-- <el-select clearable placeholder="请选择" v-model="ruleForm.let6"> <el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3">
<el-option v-for="item in guanLianZiChanSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> --> </el-select>
</el-form-item>
<el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm0_" :key="index" :label="item.assetName+':'">
<el-input placeholder="请输入内容" v-no-backslash v-model="item.relaName" maxlength="100"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm_" :key="index" :label="item.cnName+':'"> <el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm_" :key="index" :label="item.cnName+':'">
<template v-if="item.controlType == 0"> <template v-if="item.controlType == 0">
...@@ -167,7 +170,7 @@ ...@@ -167,7 +170,7 @@
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let2"> <el-form-item label="组件类型:" prop="let2">
<el-select v-model="ruleForm2.let2" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择"> <el-select v-model="ruleForm2.let2" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
...@@ -219,8 +222,8 @@ ...@@ -219,8 +222,8 @@
let4: 0, let4: 0,
let5: '显示', let5: '显示',
let6: '', let6: '',
dynamicForm0_: [],
dynamicForm_: [], dynamicForm_: [],
archiBelongId: null,
}, },
rules: { rules: {
let1: [ let1: [
...@@ -239,6 +242,8 @@ ...@@ -239,6 +242,8 @@
], ],
}, },
searchParams: { searchParams: {
archiAssetState: 2,
archiStage: 2,
assetName: null, assetName: null,
createMan: null, createMan: null,
archiEleId: null, archiEleId: null,
...@@ -280,6 +285,32 @@ ...@@ -280,6 +285,32 @@
this.set_table_height(); this.set_table_height();
}, },
methods: { methods: {
queryGuanLianZiChan(data){
if (data !== '') {
setTimeout(() => {
this.getGuanLianZiChanSelectData(data);
}, 200);
}else {
this.getGuanLianZiChanSelectData(null);
}
},
guanLianZiChanChange(data){//关联资产选择后
let dynamicForm0_Array = [];
if(data.length == 0) {
this.ruleForm.dynamicForm0_ = [];
}else {
data.forEach(item => {
const items = this.guanLianZiChanSelect.find(item2 => item2.assetId == item);
dynamicForm0_Array.push({
assetName: items.assetName,
assetId: items.assetId,
relaName: ''
})
})
this.ruleForm.dynamicForm0_ = dynamicForm0_Array;
}
},
getGuanLianZiChanSelectData(assetName) {//关联资产下拉菜单 getGuanLianZiChanSelectData(assetName) {//关联资产下拉菜单
const params = { const params = {
assetName: assetName, assetName: assetName,
...@@ -287,13 +318,15 @@ ...@@ -287,13 +318,15 @@
} }
queryGuanLianZiChanSelect(params).then(res => { queryGuanLianZiChanSelect(params).then(res => {
console.log(res) console.log(res)
this.guanLianZiChanSelect = res.data;
}); });
}, },
saveDialog() {//弹框保存 saveDialog() {//弹框保存
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if(valid) { if(valid) {
// console.log(this.ruleForm); // console.log(this.ruleForm);
let parentAssetName, assetCode, fieldsValue = [], eleName; let parentAssetName, assetCode, fieldsValue = [], eleName, targetAsset = [];
if(this.ruleForm.let2 && this.shangJiJieDianSelect.length > 0) { if(this.ruleForm.let2 && this.shangJiJieDianSelect.length > 0) {
const items = this.shangJiJieDianSelect.find(item => item.assetId == this.ruleForm.let2); const items = this.shangJiJieDianSelect.find(item => item.assetId == this.ruleForm.let2);
...@@ -301,7 +334,7 @@ ...@@ -301,7 +334,7 @@
assetCode = items.parentCode; assetCode = items.parentCode;
} }
const items2 = this.zuJianLeiXingSelect.find(item => item.elementId == this.ruleForm.let3); const items2 = this.zuJianLeiXingSelect.find(item => item.typeId == this.ruleForm.let3);
eleName = items2.elementName; eleName = items2.elementName;
if(this.ruleForm.dynamicForm_.length > 0) { if(this.ruleForm.dynamicForm_.length > 0) {
...@@ -316,19 +349,34 @@ ...@@ -316,19 +349,34 @@
}else { }else {
fieldsValue = [{}]; fieldsValue = [{}];
} }
if(this.ruleForm.dynamicForm0_.length > 0) {
this.ruleForm.dynamicForm0_.forEach(item => {
targetAsset.push({
assetName: item.assetName,
assetId: item.assetId,
relaName: item.relaName,
})
})
}else {
targetAsset = [{}];
}
console.log(targetAsset)
const params = { const params = {
archiAssetState: 1, archiAssetState: 2,
archiStage: 2, archiStage: 2,
archiBelongId: this.ruleForm.archiBelongId, archiBelongId: this.archiBelongId,
assetConstant: this.searchParams.assetConstant, assetConstant: this.searchParams.assetConstant,
archiAssetTypeId: this.searchParams.archiAssetTypeId, archiAssetTypeId: this.searchParams.archiAssetTypeId,
archiEleId: this.ruleForm.let3, archiEleId: this.ruleForm.let3,
assetName: this.ruleForm.let1, assetName: this.ruleForm.let1,
sort: this.ruleForm.let4,
assetId: this.is_add_edit == 'add' ? null : this.editId, assetId: this.is_add_edit == 'add' ? null : this.editId,
parentAssetId: this.ruleForm.let2, parentAssetId: this.ruleForm.let2,
parentAssetName: parentAssetName, parentAssetName: parentAssetName,
isShow: this.ruleForm.let5 == '显示' ? 1 : 0, isShow: this.ruleForm.let5 == '显示' ? 1 : 0,
fieldsValue: fieldsValue, fieldsValue: fieldsValue,
targetAsset: targetAsset,
assetCode: assetCode, assetCode: assetCode,
eleName: eleName eleName: eleName
} }
...@@ -400,6 +448,8 @@ ...@@ -400,6 +448,8 @@
}, },
get_table() {//查询表格数据 get_table() {//查询表格数据
const params = { const params = {
"archiAssetState": this.searchParams.archiAssetState,
"archiStage": this.searchParams.archiStage,
"assetName": this.searchParams.assetName, "assetName": this.searchParams.assetName,
"createMan": this.searchParams.createMan, "createMan": this.searchParams.createMan,
"archiEleId": this.searchParams.archiEleId, "archiEleId": this.searchParams.archiEleId,
...@@ -434,7 +484,9 @@ ...@@ -434,7 +484,9 @@
this.ruleForm.let3 = null; this.ruleForm.let3 = null;
this.ruleForm.let4 = 0; this.ruleForm.let4 = 0;
this.ruleForm.let5 = '显示'; this.ruleForm.let5 = '显示';
this.ruleForm.let6 = null;
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
this.ruleForm.dynamicForm0_ = [];
}); });
}, },
editItem(row){//编辑 editItem(row){//编辑
...@@ -447,7 +499,23 @@ ...@@ -447,7 +499,23 @@
this.ruleForm.let5 = row.isShow == 1 ? '显示' : '隐藏'; this.ruleForm.let5 = row.isShow == 1 ? '显示' : '隐藏';
this.editId = row.assetId; this.editId = row.assetId;
let fieldsValue = row.fieldsValue; let fieldsValue = row.fieldsValue;
let targetAsset = row.targetAsset;
let targetAsset_id = [];
if(targetAsset.length == 4) {
this.ruleForm.dynamicForm0_ = [];
}else {
let targetAsset_ = JSON.parse(targetAsset);
this.ruleForm.dynamicForm0_ = targetAsset_;
targetAsset_.forEach(item => {
targetAsset_id.push(
item.assetId
)
})
console.log(targetAsset_id)
}
this.ruleForm.let6 = targetAsset_id;
if(fieldsValue.length == 4) { if(fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
}else { }else {
...@@ -462,10 +530,10 @@ ...@@ -462,10 +530,10 @@
this.ruleForm.dynamicForm_ = fieldsValue_; this.ruleForm.dynamicForm_ = fieldsValue_;
} }
}, },
getShangJiJieDianSelect(assetConstant, archiBelongId) {//上级节点下拉框值 getShangJiJieDianSelect(assetConstant) {//上级节点下拉框值
const params = { const params = {
archiType: assetConstant, archiType: assetConstant,
parentAssetId: archiBelongId, parentAssetId: this.archiBelongId,
}; };
queryZiChanJiaGouShangJiJieDian(params).then(res => { queryZiChanJiaGouShangJiJieDian(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -488,6 +556,7 @@ ...@@ -488,6 +556,7 @@
}) })
}, },
zuJianLeiXingSelectChange(data) {//组件类型选择后 zuJianLeiXingSelectChange(data) {//组件类型选择后
if(data) {
const params = { const params = {
type: '1', type: '1',
typeId: data, typeId: data,
...@@ -503,13 +572,15 @@ ...@@ -503,13 +572,15 @@
} }
item['value_'] = ''; item['value_'] = '';
}); });
console.log(res.data)
this.ruleForm.dynamicForm_ = res.data; this.ruleForm.dynamicForm_ = res.data;
}else { }else {
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
} }
} }
}) })
}else {
this.ruleForm.dynamicForm_ = [];
}
}, },
queryZuJianLeiXingSelect(data) {//组件类型搜索 queryZuJianLeiXingSelect(data) {//组件类型搜索
if (data !== '') { if (data !== '') {
...@@ -520,12 +591,12 @@ ...@@ -520,12 +591,12 @@
this.getZuJianLeiXingSelect(null); this.getZuJianLeiXingSelect(null);
} }
}, },
getZuJianLeiXingSelect(elementName, archiBelongId) {//组件类型下拉框值 getZuJianLeiXingSelect(elementName) {//组件类型下拉框值
const params = { const params = {
state: '1', state: '1',
type: '1', type: '1',
elementName: elementName, elementName: elementName,
archiBelongId: archiBelongId archiBelongId: this.archiBelongId
}; };
queryZiChanJiaGouZuJianLeiXing(params).then(res => { queryZiChanJiaGouZuJianLeiXing(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -747,11 +818,11 @@ ...@@ -747,11 +818,11 @@
} }
}) })
this.treeData[0].subList = res.data; this.treeData[0].subList = res.data;
this.ruleForm.archiBelongId = res.data[0].subList[0].archiBelongId; this.archiBelongId = res.data[0].subList[0].archiBelongId;
this.searchParams.assetConstant = res.data[0].subList[0].assetConstant; this.searchParams.assetConstant = res.data[0].subList[0].assetConstant;
this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId; this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId;
this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId); this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId);
this.getZuJianLeiXingSelect(null, this.ruleForm.archiBelongId); this.getZuJianLeiXingSelect(null, this.archiBelongId);
this.getGuanLianZiChanSelectData(null); this.getGuanLianZiChanSelectData(null);
this.get_table(); this.get_table();
......
...@@ -128,11 +128,11 @@ ...@@ -128,11 +128,11 @@
</el-form-item> </el-form-item>
<el-form-item label="元素层级:" prop="let5"> <el-form-item label="元素层级:" prop="let5">
<el-select clearable placeholder="请选择" v-model="ruleForm.let5" style="width: 200px;"> <el-select clearable placeholder="请选择" v-model="ruleForm.let5" style="width: 200px;">
<el-option label="1" :value="1"></el-option> <el-option label="L1" :value="1"></el-option>
<el-option label="2" :value="2"></el-option> <el-option label="L2" :value="2"></el-option>
<el-option label="3" :value="3"></el-option> <el-option label="L3" :value="3"></el-option>
<el-option label="4" :value="4"></el-option> <el-option label="L4" :value="4"></el-option>
<el-option label="5" :value="5"></el-option> <el-option label="L5" :value="5"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="cross1" label="描述:" prop="let4"> <el-form-item class="cross1" label="描述:" prop="let4">
......
...@@ -112,9 +112,9 @@ ...@@ -112,9 +112,9 @@
<el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let3"> <el-form-item label="关联资产:" prop="let6">
<el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3"> <el-select clearable @change="guanLianZiChanChange" filterable remote :remote-method="queryGuanLianZiChan" placeholder="请选择" multiple v-model="ruleForm.let6">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option> <el-option v-for="item in guanLianZiChanSelect" :key="String(item.assetId)" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="排序:" prop="let4"> <el-form-item label="排序:" prop="let4">
...@@ -126,9 +126,9 @@ ...@@ -126,9 +126,9 @@
<el-radio label="隐藏"></el-radio> <el-radio label="隐藏"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="关联资产:" prop="let6"> <el-form-item label="组件类型:" prop="let3">
<el-select clearable @change="guanLianZiChanChange" filterable remote :remote-method="queryGuanLianZiChan" placeholder="请选择" multiple v-model="ruleForm.let6"> <el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3">
<el-option v-for="item in guanLianZiChanSelect" :key="String(item.assetId)" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm0_" :key="index" :label="item.assetName+':'"> <el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm0_" :key="index" :label="item.assetName+':'">
...@@ -224,7 +224,6 @@ ...@@ -224,7 +224,6 @@
let6: '', let6: '',
dynamicForm0_: [], dynamicForm0_: [],
dynamicForm_: [], dynamicForm_: [],
archiBelongId: null,
}, },
rules: { rules: {
let1: [ let1: [
...@@ -243,6 +242,8 @@ ...@@ -243,6 +242,8 @@
], ],
}, },
searchParams: { searchParams: {
archiAssetState: 2,
archiStage: 1,
assetName: null, assetName: null,
createMan: null, createMan: null,
archiEleId: null, archiEleId: null,
...@@ -364,11 +365,12 @@ ...@@ -364,11 +365,12 @@
const params = { const params = {
archiAssetState: 2, archiAssetState: 2,
archiStage: 1, archiStage: 1,
archiBelongId: this.ruleForm.archiBelongId, archiBelongId: this.archiBelongId,
assetConstant: this.searchParams.assetConstant, assetConstant: this.searchParams.assetConstant,
archiAssetTypeId: this.searchParams.archiAssetTypeId, archiAssetTypeId: this.searchParams.archiAssetTypeId,
archiEleId: this.ruleForm.let3, archiEleId: this.ruleForm.let3,
assetName: this.ruleForm.let1, assetName: this.ruleForm.let1,
sort: this.ruleForm.let4,
assetId: this.is_add_edit == 'add' ? null : this.editId, assetId: this.is_add_edit == 'add' ? null : this.editId,
parentAssetId: this.ruleForm.let2, parentAssetId: this.ruleForm.let2,
parentAssetName: parentAssetName, parentAssetName: parentAssetName,
...@@ -446,6 +448,8 @@ ...@@ -446,6 +448,8 @@
}, },
get_table() {//查询表格数据 get_table() {//查询表格数据
const params = { const params = {
"archiAssetState": this.searchParams.archiAssetState,
"archiStage": this.searchParams.archiStage,
"assetName": this.searchParams.assetName, "assetName": this.searchParams.assetName,
"createMan": this.searchParams.createMan, "createMan": this.searchParams.createMan,
"archiEleId": this.searchParams.archiEleId, "archiEleId": this.searchParams.archiEleId,
...@@ -526,10 +530,10 @@ ...@@ -526,10 +530,10 @@
this.ruleForm.dynamicForm_ = fieldsValue_; this.ruleForm.dynamicForm_ = fieldsValue_;
} }
}, },
getShangJiJieDianSelect(assetConstant, archiBelongId) {//上级节点下拉框值 getShangJiJieDianSelect(assetConstant) {//上级节点下拉框值
const params = { const params = {
archiType: assetConstant, archiType: assetConstant,
parentAssetId: archiBelongId, parentAssetId: this.archiBelongId,
}; };
queryZiChanJiaGouShangJiJieDian(params).then(res => { queryZiChanJiaGouShangJiJieDian(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -552,6 +556,7 @@ ...@@ -552,6 +556,7 @@
}) })
}, },
zuJianLeiXingSelectChange(data) {//组件类型选择后 zuJianLeiXingSelectChange(data) {//组件类型选择后
if(data) {
const params = { const params = {
type: '1', type: '1',
typeId: data, typeId: data,
...@@ -567,13 +572,15 @@ ...@@ -567,13 +572,15 @@
} }
item['value_'] = ''; item['value_'] = '';
}); });
console.log(res.data)
this.ruleForm.dynamicForm_ = res.data; this.ruleForm.dynamicForm_ = res.data;
}else { }else {
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
} }
} }
}) })
}else {
this.ruleForm.dynamicForm_ = [];
}
}, },
queryZuJianLeiXingSelect(data) {//组件类型搜索 queryZuJianLeiXingSelect(data) {//组件类型搜索
if (data !== '') { if (data !== '') {
...@@ -584,12 +591,12 @@ ...@@ -584,12 +591,12 @@
this.getZuJianLeiXingSelect(null); this.getZuJianLeiXingSelect(null);
} }
}, },
getZuJianLeiXingSelect(elementName, archiBelongId) {//组件类型下拉框值 getZuJianLeiXingSelect(elementName) {//组件类型下拉框值
const params = { const params = {
state: '1', state: '1',
type: '1', type: '1',
elementName: elementName, elementName: elementName,
archiBelongId: archiBelongId archiBelongId: this.archiBelongId
}; };
queryZiChanJiaGouZuJianLeiXing(params).then(res => { queryZiChanJiaGouZuJianLeiXing(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -811,11 +818,11 @@ ...@@ -811,11 +818,11 @@
} }
}) })
this.treeData[0].subList = res.data; this.treeData[0].subList = res.data;
this.ruleForm.archiBelongId = res.data[0].subList[0].archiBelongId; this.archiBelongId = res.data[0].subList[0].archiBelongId;
this.searchParams.assetConstant = res.data[0].subList[0].assetConstant; this.searchParams.assetConstant = res.data[0].subList[0].assetConstant;
this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId; this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId;
this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId); this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId);
this.getZuJianLeiXingSelect(null, this.ruleForm.archiBelongId); this.getZuJianLeiXingSelect(null, this.archiBelongId);
this.getGuanLianZiChanSelectData(null); this.getGuanLianZiChanSelectData(null);
this.get_table(); this.get_table();
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="search_menu_item"> <div class="search_menu_item">
<span class="search_title">组件类型</span> <span class="search_title">组件类型</span>
<el-select filterable remote :remote-method="queryZuJianLeiXingSelect" v-model="searchParams.archiEleId" clearable placeholder="请选择" class="search_item"> <el-select filterable remote :remote-method="queryZuJianLeiXingSelect" v-model="searchParams.archiEleId" clearable placeholder="请选择" class="search_item">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> </el-select>
</div> </div>
...@@ -112,9 +112,9 @@ ...@@ -112,9 +112,9 @@
<el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in shangJiJieDianSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let3"> <el-form-item label="关联资产:" prop="let6">
<el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3"> <el-select clearable @change="guanLianZiChanChange" filterable remote :remote-method="queryGuanLianZiChan" placeholder="请选择" multiple v-model="ruleForm.let6">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in guanLianZiChanSelect" :key="String(item.assetId)" :label="item.assetName" :value="item.assetId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="排序:" prop="let4"> <el-form-item label="排序:" prop="let4">
...@@ -126,10 +126,13 @@ ...@@ -126,10 +126,13 @@
<el-radio label="隐藏"></el-radio> <el-radio label="隐藏"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="关联资产:" prop="let6"> <el-form-item label="组件类型:" prop="let3">
<!-- <el-select clearable placeholder="请选择" v-model="ruleForm.let6"> <el-select @change="zuJianLeiXingSelectChange" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择" v-model="ruleForm.let3">
<el-option v-for="item in guanLianZiChanSelect" :key="item.assetId" :label="item.assetName" :value="item.assetId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> --> </el-select>
</el-form-item>
<el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm0_" :key="index" :label="item.assetName+':'">
<el-input placeholder="请输入内容" v-no-backslash v-model="item.relaName" maxlength="100"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm_" :key="index" :label="item.cnName+':'"> <el-form-item class="dynamicFormClass" v-for="(item, index) in ruleForm.dynamicForm_" :key="index" :label="item.cnName+':'">
<template v-if="item.controlType == 0"> <template v-if="item.controlType == 0">
...@@ -167,7 +170,7 @@ ...@@ -167,7 +170,7 @@
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let2"> <el-form-item label="组件类型:" prop="let2">
<el-select v-model="ruleForm2.let2" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择"> <el-select v-model="ruleForm2.let2" filterable remote :remote-method="queryZuJianLeiXingSelect" clearable placeholder="请选择">
<el-option v-for="item in zuJianLeiXingSelect" :key="item.elementId" :label="item.elementName" :value="item.elementId"></el-option> <el-option v-for="item in zuJianLeiXingSelect" :key="item.typeId" :label="item.elementName" :value="item.typeId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
...@@ -219,8 +222,8 @@ ...@@ -219,8 +222,8 @@
let4: 0, let4: 0,
let5: '显示', let5: '显示',
let6: '', let6: '',
dynamicForm0_: [],
dynamicForm_: [], dynamicForm_: [],
archiBelongId: null,
}, },
rules: { rules: {
let1: [ let1: [
...@@ -239,6 +242,8 @@ ...@@ -239,6 +242,8 @@
], ],
}, },
searchParams: { searchParams: {
archiAssetState: 1,
archiStage: 1,
assetName: null, assetName: null,
createMan: null, createMan: null,
archiEleId: null, archiEleId: null,
...@@ -280,6 +285,32 @@ ...@@ -280,6 +285,32 @@
this.set_table_height(); this.set_table_height();
}, },
methods: { methods: {
queryGuanLianZiChan(data){
if (data !== '') {
setTimeout(() => {
this.getGuanLianZiChanSelectData(data);
}, 200);
}else {
this.getGuanLianZiChanSelectData(null);
}
},
guanLianZiChanChange(data){//关联资产选择后
let dynamicForm0_Array = [];
if(data.length == 0) {
this.ruleForm.dynamicForm0_ = [];
}else {
data.forEach(item => {
const items = this.guanLianZiChanSelect.find(item2 => item2.assetId == item);
dynamicForm0_Array.push({
assetName: items.assetName,
assetId: items.assetId,
relaName: ''
})
})
this.ruleForm.dynamicForm0_ = dynamicForm0_Array;
}
},
getGuanLianZiChanSelectData(assetName) {//关联资产下拉菜单 getGuanLianZiChanSelectData(assetName) {//关联资产下拉菜单
const params = { const params = {
assetName: assetName, assetName: assetName,
...@@ -287,13 +318,15 @@ ...@@ -287,13 +318,15 @@
} }
queryGuanLianZiChanSelect(params).then(res => { queryGuanLianZiChanSelect(params).then(res => {
console.log(res) console.log(res)
this.guanLianZiChanSelect = res.data;
}); });
}, },
saveDialog() {//弹框保存 saveDialog() {//弹框保存
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if(valid) { if(valid) {
// console.log(this.ruleForm); // console.log(this.ruleForm);
let parentAssetName, assetCode, fieldsValue = [], eleName; let parentAssetName, assetCode, fieldsValue = [], eleName, targetAsset = [];
if(this.ruleForm.let2 && this.shangJiJieDianSelect.length > 0) { if(this.ruleForm.let2 && this.shangJiJieDianSelect.length > 0) {
const items = this.shangJiJieDianSelect.find(item => item.assetId == this.ruleForm.let2); const items = this.shangJiJieDianSelect.find(item => item.assetId == this.ruleForm.let2);
...@@ -301,7 +334,7 @@ ...@@ -301,7 +334,7 @@
assetCode = items.parentCode; assetCode = items.parentCode;
} }
const items2 = this.zuJianLeiXingSelect.find(item => item.elementId == this.ruleForm.let3); const items2 = this.zuJianLeiXingSelect.find(item => item.typeId == this.ruleForm.let3);
eleName = items2.elementName; eleName = items2.elementName;
if(this.ruleForm.dynamicForm_.length > 0) { if(this.ruleForm.dynamicForm_.length > 0) {
...@@ -316,19 +349,34 @@ ...@@ -316,19 +349,34 @@
}else { }else {
fieldsValue = [{}]; fieldsValue = [{}];
} }
if(this.ruleForm.dynamicForm0_.length > 0) {
this.ruleForm.dynamicForm0_.forEach(item => {
targetAsset.push({
assetName: item.assetName,
assetId: item.assetId,
relaName: item.relaName,
})
})
}else {
targetAsset = [{}];
}
console.log(targetAsset)
const params = { const params = {
archiAssetState: 1, archiAssetState: 1,
archiStage: 1, archiStage: 1,
archiBelongId: this.ruleForm.archiBelongId, archiBelongId: this.archiBelongId,
assetConstant: this.searchParams.assetConstant, assetConstant: this.searchParams.assetConstant,
archiAssetTypeId: this.searchParams.archiAssetTypeId, archiAssetTypeId: this.searchParams.archiAssetTypeId,
archiEleId: this.ruleForm.let3, archiEleId: this.ruleForm.let3,
assetName: this.ruleForm.let1, assetName: this.ruleForm.let1,
sort: this.ruleForm.let4,
assetId: this.is_add_edit == 'add' ? null : this.editId, assetId: this.is_add_edit == 'add' ? null : this.editId,
parentAssetId: this.ruleForm.let2, parentAssetId: this.ruleForm.let2,
parentAssetName: parentAssetName, parentAssetName: parentAssetName,
isShow: this.ruleForm.let5 == '显示' ? 1 : 0, isShow: this.ruleForm.let5 == '显示' ? 1 : 0,
fieldsValue: fieldsValue, fieldsValue: fieldsValue,
targetAsset: targetAsset,
assetCode: assetCode, assetCode: assetCode,
eleName: eleName eleName: eleName
} }
...@@ -400,6 +448,8 @@ ...@@ -400,6 +448,8 @@
}, },
get_table() {//查询表格数据 get_table() {//查询表格数据
const params = { const params = {
"archiAssetState": this.searchParams.archiAssetState,
"archiStage": this.searchParams.archiStage,
"assetName": this.searchParams.assetName, "assetName": this.searchParams.assetName,
"createMan": this.searchParams.createMan, "createMan": this.searchParams.createMan,
"archiEleId": this.searchParams.archiEleId, "archiEleId": this.searchParams.archiEleId,
...@@ -434,7 +484,9 @@ ...@@ -434,7 +484,9 @@
this.ruleForm.let3 = null; this.ruleForm.let3 = null;
this.ruleForm.let4 = 0; this.ruleForm.let4 = 0;
this.ruleForm.let5 = '显示'; this.ruleForm.let5 = '显示';
this.ruleForm.let6 = null;
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
this.ruleForm.dynamicForm0_ = [];
}); });
}, },
editItem(row){//编辑 editItem(row){//编辑
...@@ -447,7 +499,23 @@ ...@@ -447,7 +499,23 @@
this.ruleForm.let5 = row.isShow == 1 ? '显示' : '隐藏'; this.ruleForm.let5 = row.isShow == 1 ? '显示' : '隐藏';
this.editId = row.assetId; this.editId = row.assetId;
let fieldsValue = row.fieldsValue; let fieldsValue = row.fieldsValue;
let targetAsset = row.targetAsset;
let targetAsset_id = [];
if(targetAsset.length == 4) {
this.ruleForm.dynamicForm0_ = [];
}else {
let targetAsset_ = JSON.parse(targetAsset);
this.ruleForm.dynamicForm0_ = targetAsset_;
targetAsset_.forEach(item => {
targetAsset_id.push(
item.assetId
)
})
console.log(targetAsset_id)
}
this.ruleForm.let6 = targetAsset_id;
if(fieldsValue.length == 4) { if(fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
}else { }else {
...@@ -462,10 +530,10 @@ ...@@ -462,10 +530,10 @@
this.ruleForm.dynamicForm_ = fieldsValue_; this.ruleForm.dynamicForm_ = fieldsValue_;
} }
}, },
getShangJiJieDianSelect(assetConstant, archiBelongId) {//上级节点下拉框值 getShangJiJieDianSelect(assetConstant) {//上级节点下拉框值
const params = { const params = {
archiType: assetConstant, archiType: assetConstant,
parentAssetId: archiBelongId, parentAssetId: this.archiBelongId,
}; };
queryZiChanJiaGouShangJiJieDian(params).then(res => { queryZiChanJiaGouShangJiJieDian(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -488,6 +556,7 @@ ...@@ -488,6 +556,7 @@
}) })
}, },
zuJianLeiXingSelectChange(data) {//组件类型选择后 zuJianLeiXingSelectChange(data) {//组件类型选择后
if(data) {
const params = { const params = {
type: '1', type: '1',
typeId: data, typeId: data,
...@@ -503,13 +572,15 @@ ...@@ -503,13 +572,15 @@
} }
item['value_'] = ''; item['value_'] = '';
}); });
console.log(res.data)
this.ruleForm.dynamicForm_ = res.data; this.ruleForm.dynamicForm_ = res.data;
}else { }else {
this.ruleForm.dynamicForm_ = []; this.ruleForm.dynamicForm_ = [];
} }
} }
}) })
}else {
this.ruleForm.dynamicForm_ = [];
}
}, },
queryZuJianLeiXingSelect(data) {//组件类型搜索 queryZuJianLeiXingSelect(data) {//组件类型搜索
if (data !== '') { if (data !== '') {
...@@ -520,12 +591,12 @@ ...@@ -520,12 +591,12 @@
this.getZuJianLeiXingSelect(null); this.getZuJianLeiXingSelect(null);
} }
}, },
getZuJianLeiXingSelect(elementName, archiBelongId) {//组件类型下拉框值 getZuJianLeiXingSelect(elementName) {//组件类型下拉框值
const params = { const params = {
state: '1', state: '1',
type: '1', type: '1',
elementName: elementName, elementName: elementName,
archiBelongId: archiBelongId archiBelongId: this.archiBelongId
}; };
queryZiChanJiaGouZuJianLeiXing(params).then(res => { queryZiChanJiaGouZuJianLeiXing(params).then(res => {
if(res.code == 200) { if(res.code == 200) {
...@@ -747,11 +818,11 @@ ...@@ -747,11 +818,11 @@
} }
}) })
this.treeData[0].subList = res.data; this.treeData[0].subList = res.data;
this.ruleForm.archiBelongId = res.data[0].subList[0].archiBelongId; this.archiBelongId = res.data[0].subList[0].archiBelongId;
this.searchParams.assetConstant = res.data[0].subList[0].assetConstant; this.searchParams.assetConstant = res.data[0].subList[0].assetConstant;
this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId; this.searchParams.archiAssetTypeId = res.data[0].subList[0].viewId;
this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId); this.getShangJiJieDianSelect(res.data[0].subList[0].assetConstant, res.data[0].subList[0].archiBelongId);
this.getZuJianLeiXingSelect(null, this.ruleForm.archiBelongId); this.getZuJianLeiXingSelect(null, this.archiBelongId);
this.getGuanLianZiChanSelectData(null); this.getGuanLianZiChanSelectData(null);
this.get_table(); this.get_table();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!