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