|
|
@@ -13,12 +13,9 @@
|
|
|
:show-all-levels="false"
|
|
|
class="org-cascader"
|
|
|
popper-class="board-org-popper"
|
|
|
+ @change="handOrgChange"
|
|
|
+ ref="orgCascader"
|
|
|
></el-cascader>
|
|
|
- <!-- <orgDropDown
|
|
|
- v-model="selectedOrg.orgId"
|
|
|
- style="width: 250px"
|
|
|
- @nodeChanged="handleOrgNodeClick"
|
|
|
- ></orgDropDown> -->
|
|
|
</div>
|
|
|
<div class="title">
|
|
|
<span>移动安全保卫管理平台项目</span>
|
|
|
@@ -31,36 +28,36 @@
|
|
|
<div class="main">
|
|
|
<div>
|
|
|
<div>
|
|
|
- <resumptionReport :orgId="selectedOrg.id" title="日常安全履职"/>
|
|
|
+ <resumptionReport :orgId="selectedOrg.id" :api="api.resumption" title="日常安全履职" />
|
|
|
</div>
|
|
|
- <!-- <div>
|
|
|
- <otherTask :orgId="selectedOrg.id" />
|
|
|
- </div> -->
|
|
|
<div>
|
|
|
- <resumptionReport :orgId="selectedOrg.id" title="监控调阅"/>
|
|
|
+ <resumptionReport :orgId="selectedOrg.id" :api="api.monitor" title="监控调阅" />
|
|
|
</div>
|
|
|
<div>
|
|
|
- <resumptionReport :orgId="selectedOrg.id" title="日常安全检查"/>
|
|
|
+ <resumptionReport :orgId="selectedOrg.id" :api="api.safetyCheck" title="日常安全检查" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <div class="box">
|
|
|
- <mapChart :orgId="selectedOrg.id" />
|
|
|
- </div>
|
|
|
<div>
|
|
|
- <orgStatis :orgId="selectedOrg.id" />
|
|
|
+ <div>
|
|
|
+ <mapChart :orgId="selectedOrg.id" :orgName="selectedOrg.name" />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <orgStatis :orgId="selectedOrg.id" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
<div>
|
|
|
- <resumptionReport :orgId="selectedOrg.id" title="预案演练"/>
|
|
|
+ <question :orgId="selectedOrg.id" />
|
|
|
</div>
|
|
|
<div>
|
|
|
- <resumptionReport :orgId="selectedOrg.id" title="教育培训"/>
|
|
|
+ <resumptionReport :orgId="selectedOrg.id" :api="api.drill" title="预案演练" />
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <question :orgId="selectedOrg.id" />
|
|
|
+ <div>
|
|
|
+ <resumptionReport :orgId="selectedOrg.id" :api="api.edu" title="教育培训" />
|
|
|
</div>
|
|
|
+
|
|
|
<!-- <div>
|
|
|
<div>
|
|
|
<safetyIndex :orgId="selectedOrg.id" />
|
|
|
@@ -73,14 +70,12 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
|
-import resumptionReport from "./charts/resumption/report.vue";
|
|
|
-import otherTask from "./charts/otherTask/report.vue";
|
|
|
+import resumptionReport from "./charts/resumption/report_bar.vue";
|
|
|
import question from "./charts/question/report.vue";
|
|
|
-import safetyIndex from "./charts/safetyIndex/report.vue";
|
|
|
import mapChart from "./charts/map/report.vue";
|
|
|
import orgStatis from "./charts/org/report.vue";
|
|
|
-import orgDropDown from "@/components/orgTree/orgDropDown.vue";
|
|
|
import dayjs from "dayjs";
|
|
|
+import * as api from '@/api/board/cockpit.js'
|
|
|
|
|
|
import "./board.scss";
|
|
|
export default {
|
|
|
@@ -93,23 +88,22 @@ export default {
|
|
|
activeIndex: "0",
|
|
|
selectedOrg: {
|
|
|
id: null,
|
|
|
+ name: null,
|
|
|
},
|
|
|
electricHost: undefined,
|
|
|
+ api
|
|
|
};
|
|
|
},
|
|
|
|
|
|
components: {
|
|
|
- orgDropDown,
|
|
|
resumptionReport,
|
|
|
- otherTask,
|
|
|
question,
|
|
|
- safetyIndex,
|
|
|
mapChart,
|
|
|
orgStatis,
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
- ...mapGetters(["orgId", "depTree"]),
|
|
|
+ ...mapGetters(["orgId", "depTree", "orgName"]),
|
|
|
orgOptions() {
|
|
|
let deps = this.depTree;
|
|
|
let recursion = (deps) => {
|
|
|
@@ -127,7 +121,7 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
recursion(deps);
|
|
|
- console.info(deps);
|
|
|
+ // console.info(deps);
|
|
|
return deps;
|
|
|
},
|
|
|
},
|
|
|
@@ -169,7 +163,10 @@ export default {
|
|
|
// }, 1 * 60 * 60 * 1000);
|
|
|
// });
|
|
|
// });
|
|
|
- this.selectedOrg.id = this.orgId;
|
|
|
+ this.selectedOrg = {
|
|
|
+ id: this.orgId,
|
|
|
+ name: this.orgName,
|
|
|
+ };
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.orgtimer);
|
|
|
@@ -195,148 +192,153 @@ export default {
|
|
|
return "星期日";
|
|
|
}
|
|
|
},
|
|
|
- handleOrgNodeClick(org) {
|
|
|
- this.selectedOrg = { ...org };
|
|
|
+ handOrgChange(id, m, n) {
|
|
|
+ let checked = this.$refs["orgCascader"].getCheckedNodes(true);
|
|
|
+ if (!checked || checked.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectedOrg = { ...checked[0].data };
|
|
|
},
|
|
|
// handleSelect(e) {
|
|
|
// var item = this.branchlist.find((o) => o.orgId === parseInt(e));
|
|
|
// this.activeIndex = e;
|
|
|
// this.selectedOrg = { ...item };
|
|
|
// },
|
|
|
- async getOrgList(currentUserOrgId) {
|
|
|
- let r = await getOrgList();
|
|
|
- if (r.ret === 2) {
|
|
|
- this.exitSys();
|
|
|
- } else if (r.ret != 1) {
|
|
|
- this.$notify.error({
|
|
|
- message: `获取机构列表错误:${r.errorMsg}`,
|
|
|
- duration: 20 * 1000,
|
|
|
- });
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
+ // async getOrgList(currentUserOrgId) {
|
|
|
+ // let r = await getOrgList();
|
|
|
+ // if (r.ret === 2) {
|
|
|
+ // this.exitSys();
|
|
|
+ // } else if (r.ret != 1) {
|
|
|
+ // this.$notify.error({
|
|
|
+ // message: `获取机构列表错误:${r.errorMsg}`,
|
|
|
+ // duration: 20 * 1000,
|
|
|
+ // });
|
|
|
+
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
- let { data } = r;
|
|
|
- Vue.prototype.$treeList = data;
|
|
|
- const tree = this.genDropdownTree(data, currentUserOrgId);
|
|
|
- if (tree && tree.length > 0) {
|
|
|
- this.selectedOrg = {
|
|
|
- orgId: tree[0].id,
|
|
|
- name: tree[0].label,
|
|
|
- };
|
|
|
- }
|
|
|
- this.orgTree = tree;
|
|
|
-
|
|
|
- let top = data.find((d) => !data.find((d2) => d2.orgId == d.parentId));
|
|
|
- if (!top) {
|
|
|
- this.$$notify.error({
|
|
|
- message: "未找到顶级机构",
|
|
|
- duration: 20 * 1000,
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ // let { data } = r;
|
|
|
+ // Vue.prototype.$treeList = data;
|
|
|
+ // const tree = this.genDropdownTree(data, currentUserOrgId);
|
|
|
+ // if (tree && tree.length > 0) {
|
|
|
+ // this.selectedOrg = {
|
|
|
+ // orgId: tree[0].id,
|
|
|
+ // name: tree[0].label,
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // this.orgTree = tree;
|
|
|
+
|
|
|
+ // let top = data.find((d) => !data.find((d2) => d2.orgId == d.parentId));
|
|
|
+ // if (!top) {
|
|
|
+ // this.$$notify.error({
|
|
|
+ // message: "未找到顶级机构",
|
|
|
+ // duration: 20 * 1000,
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
- let branchlist = [];
|
|
|
- if (
|
|
|
- top.orgType != dictionary.orgType.firstLevelBranchType &&
|
|
|
- top.orgType != dictionary.orgType.secondLevelBranchType &&
|
|
|
- top.orgType != dictionary.orgType.subBranchType
|
|
|
- ) {
|
|
|
- this.$$notify.error({
|
|
|
- message: "不支持机构类型" + top.orgType,
|
|
|
- duration: 20 * 1000,
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ // let branchlist = [];
|
|
|
+ // if (
|
|
|
+ // top.orgType != dictionary.orgType.firstLevelBranchType &&
|
|
|
+ // top.orgType != dictionary.orgType.secondLevelBranchType &&
|
|
|
+ // top.orgType != dictionary.orgType.subBranchType
|
|
|
+ // ) {
|
|
|
+ // this.$$notify.error({
|
|
|
+ // message: "不支持机构类型" + top.orgType,
|
|
|
+ // duration: 20 * 1000,
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
- branchlist.push(top);
|
|
|
- var subOrgType =
|
|
|
- top.orgType == dictionary.orgType.firstLevelBranchType
|
|
|
- ? dictionary.orgType.secondLevelBranchType
|
|
|
- : top.orgType == dictionary.orgType.secondLevelBranchType
|
|
|
- ? dictionary.orgType.subBranchType
|
|
|
- : undefined;
|
|
|
- let subs = data.filter(
|
|
|
- (d) => d.orgId != top.orgId && d.orgType == subOrgType
|
|
|
- );
|
|
|
-
|
|
|
- this.branchlist = branchlist.concat(subs);
|
|
|
- if (!this.branchlist || this.branchlist.length === 0) {
|
|
|
- this.$notify.error({
|
|
|
- message: "机构列表为空",
|
|
|
- duration: 20 * 1000,
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (!this.selectedOrg) {
|
|
|
- this.selectedOrg = {
|
|
|
- ...this.branchlist[0],
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ // branchlist.push(top);
|
|
|
+ // var subOrgType =
|
|
|
+ // top.orgType == dictionary.orgType.firstLevelBranchType
|
|
|
+ // ? dictionary.orgType.secondLevelBranchType
|
|
|
+ // : top.orgType == dictionary.orgType.secondLevelBranchType
|
|
|
+ // ? dictionary.orgType.subBranchType
|
|
|
+ // : undefined;
|
|
|
+ // let subs = data.filter(
|
|
|
+ // (d) => d.orgId != top.orgId && d.orgType == subOrgType
|
|
|
+ // );
|
|
|
+
|
|
|
+ // this.branchlist = branchlist.concat(subs);
|
|
|
+ // if (!this.branchlist || this.branchlist.length === 0) {
|
|
|
+ // this.$notify.error({
|
|
|
+ // message: "机构列表为空",
|
|
|
+ // duration: 20 * 1000,
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // if (!this.selectedOrg) {
|
|
|
+ // this.selectedOrg = {
|
|
|
+ // ...this.branchlist[0],
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
- /**生成下拉树 */
|
|
|
- genDropdownTree(orgList, topOrgId) {
|
|
|
- const orgTypeConst = dictionary.orgType;
|
|
|
- const needOrgTypes = [
|
|
|
- orgTypeConst.firstLevelBranchType,
|
|
|
- orgTypeConst.secondLevelBranchType,
|
|
|
- orgTypeConst.subBranchType,
|
|
|
- ];
|
|
|
- const topOrg = orgList.find((org) => org.orgId == topOrgId);
|
|
|
- var top = { id: topOrg.orgId, label: topOrg.orgName, path: topOrg.path };
|
|
|
- var topTypeIndex = needOrgTypes.indexOf(topOrg.orgType);
|
|
|
- if (topTypeIndex < 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
+ // /**生成下拉树 */
|
|
|
+ // genDropdownTree(orgList, topOrgId) {
|
|
|
+ // const orgTypeConst = dictionary.orgType;
|
|
|
+ // const needOrgTypes = [
|
|
|
+ // orgTypeConst.firstLevelBranchType,
|
|
|
+ // orgTypeConst.secondLevelBranchType,
|
|
|
+ // orgTypeConst.subBranchType,
|
|
|
+ // ];
|
|
|
+ // const topOrg = orgList.find((org) => org.orgId == topOrgId);
|
|
|
+ // var top = { id: topOrg.orgId, label: topOrg.orgName, path: topOrg.path };
|
|
|
+ // var topTypeIndex = needOrgTypes.indexOf(topOrg.orgType);
|
|
|
+ // if (topTypeIndex < 0) {
|
|
|
+ // return [];
|
|
|
+ // }
|
|
|
|
|
|
- var nodes = [top];
|
|
|
- if (topTypeIndex == needOrgTypes.length - 1) {
|
|
|
- return [top];
|
|
|
- }
|
|
|
+ // var nodes = [top];
|
|
|
+ // if (topTypeIndex == needOrgTypes.length - 1) {
|
|
|
+ // return [top];
|
|
|
+ // }
|
|
|
|
|
|
- for (var i = topTypeIndex + 1; i < needOrgTypes.length; i++) {
|
|
|
- let tmpNodes = [];
|
|
|
- nodes.forEach((item) => {
|
|
|
- var children = orgList.filter(
|
|
|
- (org) =>
|
|
|
- org.path.startsWith(item.path) && org.orgType == needOrgTypes[i]
|
|
|
- );
|
|
|
- children = children.map((c) => ({
|
|
|
- id: c.orgId,
|
|
|
- label: c.orgName,
|
|
|
- path: c.path,
|
|
|
- }));
|
|
|
-
|
|
|
- tmpNodes = tmpNodes.concat(children);
|
|
|
- item.children = children;
|
|
|
- });
|
|
|
- nodes = tmpNodes;
|
|
|
- }
|
|
|
+ // for (var i = topTypeIndex + 1; i < needOrgTypes.length; i++) {
|
|
|
+ // let tmpNodes = [];
|
|
|
+ // nodes.forEach((item) => {
|
|
|
+ // var children = orgList.filter(
|
|
|
+ // (org) =>
|
|
|
+ // org.path.startsWith(item.path) && org.orgType == needOrgTypes[i]
|
|
|
+ // );
|
|
|
+ // children = children.map((c) => ({
|
|
|
+ // id: c.orgId,
|
|
|
+ // label: c.orgName,
|
|
|
+ // path: c.path,
|
|
|
+ // }));
|
|
|
+
|
|
|
+ // tmpNodes = tmpNodes.concat(children);
|
|
|
+ // item.children = children;
|
|
|
+ // });
|
|
|
+ // nodes = tmpNodes;
|
|
|
+ // }
|
|
|
|
|
|
- return [top];
|
|
|
- },
|
|
|
+ // return [top];
|
|
|
+ // },
|
|
|
|
|
|
- exitSys() {
|
|
|
- this.$alert("确定退出系统吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- showCancelButton: true,
|
|
|
- callback: (r) => {
|
|
|
- if (r === "confirm") {
|
|
|
- logout()
|
|
|
- .then((r) => {
|
|
|
- location.href =
|
|
|
- Vue.$electricHost + "/security/login/sysCenterMain.html";
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- location.href =
|
|
|
- Vue.$electricHost + "/security/login/sysCenterMain.html";
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
+ // exitSys() {
|
|
|
+ // this.$alert("确定退出系统吗?", "提示", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // showCancelButton: true,
|
|
|
+ // callback: (r) => {
|
|
|
+ // if (r === "confirm") {
|
|
|
+ // logout()
|
|
|
+ // .then((r) => {
|
|
|
+ // location.href =
|
|
|
+ // Vue.$electricHost + "/security/login/sysCenterMain.html";
|
|
|
+ // })
|
|
|
+ // .catch((e) => {
|
|
|
+ // location.href =
|
|
|
+ // Vue.$electricHost + "/security/login/sysCenterMain.html";
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -566,21 +568,19 @@ export default {
|
|
|
}
|
|
|
|
|
|
& > div:first-child {
|
|
|
- height: calc(67% - 16px);
|
|
|
+ height: calc(100%);
|
|
|
display: flex;
|
|
|
- background-image: none;
|
|
|
flex-direction: column;
|
|
|
// padding: 0.5rem 1rem;
|
|
|
overflow: hidden;
|
|
|
|
|
|
- .box {
|
|
|
+ & > div:first-child {
|
|
|
width: 100%;
|
|
|
- height: 58%;
|
|
|
+ height: 80%;
|
|
|
+ }
|
|
|
+ & > div:nth-child(2) {
|
|
|
+ height: calc(20%);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- & > div:nth-child(2) {
|
|
|
- height: calc(33% - 16px);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -625,7 +625,7 @@ export default {
|
|
|
}
|
|
|
.org-cascader {
|
|
|
margin-top: -5px;
|
|
|
- width:180px;
|
|
|
+ width: 180px;
|
|
|
|
|
|
::v-deep .el-input__inner {
|
|
|
background-color: transparent !important;
|