提交 05b14fa6 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-mvp-20200331' of...

Merge branch 'dev-mvp-20200331' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-mvp-20200331

* 'dev-mvp-20200331' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin:
  解决秀米图片403,发送请求时去掉referrer
  修改模板查看详情的显示
  优化代码逻辑
  修改 设定机构的设定行政范围
  增加选择范围的项目id
......@@ -10,6 +10,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="referrer" content="no-referrer" />
<title>云鹊医工作站</title>
</head>
<body id="appBody">
......
......@@ -80,25 +80,25 @@ export default {
},
created() {
vm = this;
this.initRange();
vm.initRange();
},
methods: {
//选择范围 初始化
initRange() {
console.log('====================initRange')
let projectId = this.projectId;
let projectId = vm.projectId;
if (projectId == null) {
//新建
} else {
//编辑
this.getAdministrative();
vm.getAdministrative();
}
},
//查询行政范围(树)
getAdministrative() {
console.log('=========================getAdministrative')
let req = {
projectId: this.projectId
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/scope/v1/administrative", req).then(res => {
......@@ -107,22 +107,22 @@ export default {
//console.log(res.data);
let administrativeAll = res.data.administrativeAll;
let administrative = res.data.administrative;
this.treeData = [];
this.treeData[0] = administrativeAll;
this.setTreeData(administrative);
// this.getCheckedTree();
vm.treeData = [];
vm.treeData[0] = administrativeAll;
vm.setTreeData(administrative);
// vm.getCheckedTree();
}
});
},
//获取勾选树
getCheckedTree() {
console.log('=========================getCheckedTree')
if (this.idType != 2) {
let allTree = JSON.parse(JSON.stringify(this.treeData[0].children));
let changedTags = JSON.parse(JSON.stringify(this.tagsRegion));
if (vm.idType != 2) {
let allTree = JSON.parse(JSON.stringify(vm.treeData[0].children));
let changedTags = JSON.parse(JSON.stringify(vm.tagsRegion));
let organizationArea = operationData.treeHandler(allTree, changedTags);
console.log("多级树:", organizationArea);
this.organizationRegion = organizationArea;
vm.organizationRegion = organizationArea;
}
},
//初始化范围树
......@@ -137,8 +137,8 @@ export default {
checkList[i].key = administrative[i].id;
}
//console.log(treeIdList);
this.$refs.tree.setCheckedKeys(treeIdList);
this.tagsRegion = checkList;
vm.$refs.tree.setCheckedKeys(treeIdList);
vm.tagsRegion = checkList;
},
// 选择行政范围
onChecked(node, data) {
......@@ -146,20 +146,20 @@ export default {
vm.checkUpdate(node, data);
//重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(
this.$refs.tree.store
vm.$refs.tree.store
);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let halfCheckedTree = vm.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
//重构内容
this.allSelectedKeys = allSelectedKeys;
this.initCheckList(allSelectedKeys);
vm.allSelectedKeys = allSelectedKeys;
vm.initCheckList(allSelectedKeys);
//console.log("allSelectedKeys", allSelectedKeys);
//改变行政范围后,更新设定机构和设定人员
// this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true;
// vm.updateOrganizationAndPerson(allSelectedKeys);
vm.updatedTree = true;
},
//v2.2教培更新
checkUpdate(node, data) {
......@@ -171,16 +171,16 @@ export default {
vm.nowCheck = node;
vm.warnType = 0;
vm.dialogWarn = true;
// this.$refs.tree.setChecked(data,false)
// vm.$refs.tree.setChecked(data,false)
}
},
//列举选中地区
initCheckList(allSelectedKeys) {
console.log('=========================initCheckList')
this.tagsRegion = [];
vm.tagsRegion = [];
// console.log(allSelectedKeys);
// console.log(this.$refs.tree.getCheckedNodes());
let nodeData = this.$refs.tree.getCheckedNodes();
// console.log(vm.$refs.tree.getCheckedNodes());
let nodeData = vm.$refs.tree.getCheckedNodes();
for (let i = 0; i < nodeData.length; i++) {
for (let j = 0; j < allSelectedKeys.length; j++) {
if (
......@@ -190,7 +190,7 @@ export default {
let tagObj = {};
tagObj.name = nodeData[i].label;
tagObj.key = nodeData[i].id;
this.tagsRegion.push(tagObj);
vm.tagsRegion.push(tagObj);
}
}
}
......@@ -216,7 +216,7 @@ export default {
let administrative = res.data.administrative;
//console.log(administrative);
data.children = administrative;
this.appendCheck(administrative, node.checked);
vm.appendCheck(administrative, node.checked);
}
});
}
......@@ -226,23 +226,23 @@ export default {
console.log('====================appendCheck')
//console.log(checked,administrative)
let checkList = [];
checkList = this.$refs.tree.getCheckedKeys();
checkList = vm.$refs.tree.getCheckedKeys();
if (checked) {
for (let i = 0; i < administrative.length; i++) {
checkList.push(administrative[i].id);
// console.log(checkList);
}
}
this.$nextTick(function() {
this.$refs.tree.setCheckedKeys(checkList);
vm.$nextTick(function() {
vm.$refs.tree.setCheckedKeys(checkList);
});
},
//删除label节点 同步树结构
handleCloseTree(tag) {
console.log('=========================handleCloseTree')
if (this.status4Flag != 1) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion);
if (vm.status4Flag != 1) {
vm.tagsRegion.splice(vm.tagsRegion.indexOf(tag), 1);
vm.setCheckedKeys(vm.tagsRegion);
}
},
//通过key设置tree
......@@ -254,14 +254,14 @@ export default {
treeKeyList[index] = tagsRegion[index].key;
}
console.log(treeKeyList);
this.$refs.tree.setCheckedKeys(treeKeyList);
vm.$refs.tree.setCheckedKeys(treeKeyList);
},
//设定的行政范围内容(传给设定机构的范围)
getScope(type) {
let scope = "";
for (let i = 0; i < this.tagsRegion.length; i++) {
scope += this.tagsRegion[i].key;
if (i < this.tagsRegion.length - 1) {
for (let i = 0; i < vm.tagsRegion.length; i++) {
scope += vm.tagsRegion[i].key;
if (i < vm.tagsRegion.length - 1) {
scope += "|";
}
}
......@@ -272,18 +272,18 @@ export default {
},
//设定的行政范围内容(完成或是暂存时传给后台的数据格式)
setScope(type) {
let noChangeTree = this.getTreeCheck();
let noChangeTree = vm.getTreeCheck();
let scope = "";
if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) {
if (vm.allSelectedKeys.length > 0) {
for (let i = 0; i < vm.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
vm.allSelectedKeys[i].key + ":" + vm.allSelectedKeys[i].type;
if (i < vm.allSelectedKeys.length - 1) {
scope += "|";
}
}
} else {
// let noChangeTree = this.getTreeCheck();
// let noChangeTree = vm.getTreeCheck();
console.log('noChangeTree值',noChangeTree);
if(noChangeTree.length > 0) {
for (let i = 0; i < noChangeTree.length; i++) {
......@@ -294,9 +294,9 @@ export default {
}
} else {
//选全国项目
if(this.tagsRegion.length > 0 && this.tagsRegion[0].key == '000') {
if(vm.tagsRegion.length > 0 && vm.tagsRegion[0].key == '000') {
scope = '000:1';
console.log(this.tagsRegion,'scope',scope);
console.log(vm.tagsRegion,'scope',scope);
}
}
}
......@@ -308,8 +308,8 @@ export default {
},
getTreeCheck() {
//重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(this.$refs.tree.store);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys()
let checkedTree = operationData.getSimpleCheckedNodes(vm.$refs.tree.store);
let halfCheckedTree = vm.$refs.tree.getHalfCheckedKeys()
let allSelectedKeys = operationData.setSelectedKeys(checkedTree,halfCheckedTree);
vm.allSelectedKeys = allSelectedKeys;
//重构内容
......
......@@ -65,9 +65,9 @@
<div class="dm-name">项目学科:</div>
<div class="dm-nr">{{detailObj.subjectName}}</div>
</div>
<div class="mian-list" v-if="detailObj.organizationName">
<div class="mian-list" v-if="detailObj.organizationNameList && detailObj.organizationNameList.length>1">
<div class="dm-name">已参加的机构:</div>
<div class="dm-nr">{{detailObj.organizationName}}</div>
<div class="dm-nr">{{detailObj.organizationNameList.join(', ')}}</div>
</div>
</div>
</div>
......
......@@ -45,7 +45,7 @@
<select-region ref="selectRegion" :projectId="projectId"></select-region>
</el-tab-pane>
<el-tab-pane label="设定机构" name="second">
<set-organization ref="setOrganization"></set-organization>
<set-organization ref="setOrganization" :projectId="projectId"></set-organization>
</el-tab-pane>
</el-tabs>
</div>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册