代码调整
This commit is contained in:
parent
2cb2247d7e
commit
a9a08c74d3
@ -36,15 +36,16 @@
|
||||
<el-button :disabled="!form.code" type="danger" size="mini" @click="deleteCompose">删除</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="allowModifyList.length>0" id="modelModifyPane" label="模型修改" name="modelModify">
|
||||
<el-tabs v-model="modifyElementTab" class="eachElementPane">
|
||||
<!-- styleList -->
|
||||
<!-- shapeList -->
|
||||
<!-- model 修改 -->
|
||||
<!-- <el-tab-pane v-if="allowModifyList.length>0" id="modelModifyPane" label="模型修改" name="modelModify">
|
||||
<el-tabs v-model="modifyElementTab" class="eachElementPane" @tab-click="handleTabClick">
|
||||
<el-tab-pane v-for="(allowModify,index) in allowModifyList" :key="index" :label="allowModify.name" :name="allowModify.code">
|
||||
<!-- {{ allowModify.name }} -->
|
||||
<data-form ref="dataform" :form="element" :form-model="modifyElementForm" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- {{}} -->
|
||||
<!-- allowModifyList -->
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
@ -66,7 +67,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
enabledTab:'drawSetting',
|
||||
modifyElementTab:'',
|
||||
// modifyElementTab:'',
|
||||
form: {
|
||||
code: '',
|
||||
type: '',
|
||||
@ -74,35 +75,46 @@ export default {
|
||||
position: [0, 0],
|
||||
rotation: 0,
|
||||
scale: [1, 1]
|
||||
},
|
||||
allowModifyList:[],
|
||||
modifyElementForm:{
|
||||
shape:{},
|
||||
style:{}
|
||||
}
|
||||
// allowModifyList:[],
|
||||
// modifyElementForm:{
|
||||
// code:'',
|
||||
// shape:{},
|
||||
// style:{}
|
||||
// }
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
selectChange({code, type, name, position, rotation, scale, shapeList}) {
|
||||
this.form = {code, type, name, position, rotation, scale};
|
||||
this.allowModifyList = [];
|
||||
shapeList.forEach(shape=>{
|
||||
if (shape.editAttrList && shape.editAttrList.length > 0) {
|
||||
this.allowModifyList.push({code:shape.code, editAttrList:shape.editAttrList, name:shape.name});
|
||||
// style
|
||||
// shape
|
||||
// code: (...)
|
||||
// editAttrList: (...)
|
||||
// name: "Polyline_0_0.78816"
|
||||
}
|
||||
});
|
||||
if (this.allowModifyList.length > 0) {
|
||||
const currentModify = this.allowModifyList[0];
|
||||
this.modifyElementTab = currentModify.code;
|
||||
// currentModify.editAttrList.forEach(each=>{
|
||||
// this.modifyElementForm[each.attrType][each.attrName] = '';
|
||||
// this.allowModifyList = [];
|
||||
// shapeList.forEach(shape=>{
|
||||
// if (shape.editAttrList && shape.editAttrList.length > 0) {
|
||||
// const formGroup = [];
|
||||
// const list = [{name:'绘图配置', type:'shape'}, {name:'样式配置', type:'style'}];
|
||||
// list.forEach(eachType=>{
|
||||
// // const styleList = elementConst[eachType.type]['formList'][eachType.type];
|
||||
// formGroup.push({name:eachType.name, type: eachType.type});
|
||||
// });
|
||||
}
|
||||
// // styleList:
|
||||
// // const styleList = [];
|
||||
// // const shapeList = [];
|
||||
// // shape.editAttrList.forEach(each=>{
|
||||
// // if (each.attrType == 'style') { styleList.push(each); } else { shapeList.push(each); }
|
||||
// // });
|
||||
// // styleList:styleList, shapeList:shapeList,
|
||||
// // this.allowModifyList.push({code:shape.code, editAttrList:shape.editAttrList, formGroup:formGroup, name:shape.name});
|
||||
// // name: "Polyline_0_0.78816"
|
||||
// }
|
||||
// });
|
||||
// if (this.allowModifyList.length > 0) {
|
||||
// const currentModify = this.allowModifyList[0];
|
||||
// this.modifyElementTab = currentModify.code;
|
||||
// this.modifyElementForm.code = currentModify.code;
|
||||
// currentModify.editAttrList.forEach(editAttr=>{
|
||||
// this.modifyElementForm[editAttr.attrType][editAttr.attrName] = '';
|
||||
// });
|
||||
// }
|
||||
},
|
||||
modelChange(code) {
|
||||
const compose = this.model.find(item => item.code === code);
|
||||
@ -127,6 +139,9 @@ export default {
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
handleTabClick() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user