求o2oa案例-左侧vue树与右侧内容区联动
开发过程中遇到了这样的需求,左侧是用户自助生成的树,右侧是三个写好的页面,树的每一级别对应一个页面样式,由于第一次用o2oa里的vue组件,真不知道咋写呀:dizzy:,试了好多例子都不太行,树和页面都实现了,就是动态点击切换实现不了,哪位大佬愿意分享自己的例子的谢谢:dizzy:请问解决了嘛
d0cter 发表于 2024-6-5 17:51
请问解决了嘛
debugger;
if(this.page.parameters === undefined){
return "没有传入参数"
}else{
var id = this.page.parameters.formobject.id;
var schoolcode = this.page.parameters.formobject.parentid;
var parentid = this.page.parameters.formobject.parentid;
var label = this.page.parameters.formobject.label;
var level = this.page.parameters.formobject.level;
//表示父节点
if (level == 1) {
this.form.get("schoolname").node.set("html",label);
var view = this.form.get("viewbuilding");
var filterList = [];
if (id != "") {
filterList.push({
"logic": "and",
"path": "parentschoolname",
"comparison": "like",
"value": id,
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": { "code": "return \"" + id + "\";", "html": "return \"" + id + "\";" },
"otherValue": ""
});
}
view.json.loadView = "yes";
view.json.filterList = filterList;
this.form.get("viewbuilding").reload();
document.getElementById('div_4').style.display = 'block';
document.getElementById('div_1').style.display = 'none';
} else if (level==2) {
//表示子节点
this.form.get("buildname").node.set("html",label);
this.data.parentdocid = id;
this.data.schoolcode = schoolcode;
this.data.fieldname = label;
var view = this.form.get("viewsite");
var filterList = [];
if (parentid != "") {
//过滤出对应学校的建筑信息
filterList.push({
"logic": "and",
"path": "schoolcode",
"comparison": "like",
"value": parentid,
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": { "code": "return \"" + parentid + "\";", "html": "return \"" + parentid + "\";" },
"otherValue": ""
});
//过滤出对应学校下建筑楼对应的信息
filterList.push({
"logic": "and",
"path": "parentdocid",
"comparison": "like",
"value": id,
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": { "code": "return \"" + id + "\";", "html": "return \"" + id + "\";" },
"otherValue": ""
});
view.json.loadView = "yes";
view.json.filterList = filterList;
this.form.get("viewsite").reload();
document.getElementById('div_4').style.display = 'none';
document.getElementById('div_1').style.display = 'block';
}
}
}
d0cter 发表于 2024-6-5 17:51
请问解决了嘛
是写在表单的afterLoad事件里,我是根据三级树每一级的level值来进行隐藏显示切换的,你可以先打印一下每级树通用的值,然后根据不同值进行切换 jie 发表于 2024-6-6 18:31
debugger;
if(this.page.parameters === undefined){
return "没有传 ...
<LvSe v-show="type=='ls'" ref="ls"></LvSe>
<LvSeHuiZong v-show="type=='lshz'" ref="lshz"></LvSeHuiZong>
<GongYingLian v-show="type=='gyl'" ref="gyl"></GongYingLian>
<KuangChan v-show="type=='kc'" ref="kc"></KuangChan>
<QiTa v-show="type=='qt'" ref="qt"></QiTa>
在引入的页面上加一个v-show属性,然后根据点击的树列表菜单修改type的值就好了啊
页:
[1]