|
@@ -14,7 +14,10 @@
|
|
|
<div class="status1"><span class="icon"></span>集团内</div>
|
|
|
<div class="status2"><span class="icon"></span>集团外</div>
|
|
|
</div>
|
|
|
- <Search @getSearchData="getSearchData" @clearSearchData="clearSearchData" />
|
|
|
+ <Search
|
|
|
+ @getSearchData="getSearchData"
|
|
|
+ @clearSearchData="clearSearchData"
|
|
|
+ />
|
|
|
</div>
|
|
|
<!--权限树-->
|
|
|
<div class="authority-content">
|
|
@@ -24,8 +27,23 @@
|
|
|
<div class="grid-content">
|
|
|
<div class="title">组织树</div>
|
|
|
<div class="contentTree">
|
|
|
- <el-tree ref="tree" :data="dataListTree" :props="defaultProps" node-key="OrganId" :filter-node-method="filterNode" highlight-current :default-expanded-keys="expandedKeys" @node-expand="handleExpand" @node-collapse="handleCollapse" @node-click="handleNodeClick">
|
|
|
- <span slot-scope="{ node }" :title="node.label" class="custom-tree-node">
|
|
|
+ <el-tree
|
|
|
+ ref="tree"
|
|
|
+ :data="dataListTree"
|
|
|
+ :props="defaultProps"
|
|
|
+ node-key="OrganId"
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ highlight-current
|
|
|
+ :default-expanded-keys="expandedKeys"
|
|
|
+ @node-expand="handleExpand"
|
|
|
+ @node-collapse="handleCollapse"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ slot-scope="{ node }"
|
|
|
+ :title="node.label"
|
|
|
+ class="custom-tree-node"
|
|
|
+ >
|
|
|
{{ node.label }}
|
|
|
</span>
|
|
|
</el-tree>
|
|
@@ -36,33 +54,79 @@
|
|
|
<div class="grid-contentTop">
|
|
|
<div class="title">当前组织</div>
|
|
|
<div class="content">
|
|
|
- <el-empty :image-size="100" style="padding:0" v-if="currDataArr.length<1"></el-empty>
|
|
|
+ <el-empty
|
|
|
+ :image-size="100"
|
|
|
+ style="padding: 0"
|
|
|
+ v-if="currDataArr.length < 1"
|
|
|
+ ></el-empty>
|
|
|
<el-row>
|
|
|
- <el-col :span="8" v-for="data in currDataArr" :key="data.OrganId">
|
|
|
+ <el-col
|
|
|
+ :span="8"
|
|
|
+ v-for="data in currDataArr"
|
|
|
+ :key="data.OrganId"
|
|
|
+ >
|
|
|
<div class="itemBox">
|
|
|
<div class="status" v-if="data.OrganType == 1"></div>
|
|
|
<div class="status2" v-if="data.OrganType != 1"></div>
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="12">
|
|
|
- <div :title="data.OrganName" class="itemTitle">{{ data.OrganName }}</div>
|
|
|
+ <div :title="data.OrganName" class="itemTitle">
|
|
|
+ {{ data.OrganName }}
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<div class="flex info">
|
|
|
<div class="icon">
|
|
|
- <el-tooltip v-if="doesJobShow" v-is="['organtree_btn_add_job']" effect="dark" content="新增职务" placement="bottom">
|
|
|
- <span class="cap cap-job" @click="renderJob(data)" v-if="data.OrganId != -1"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="doesJobShow"
|
|
|
+ v-is="['organtree_btn_add_job']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增职务"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-job"
|
|
|
+ @click="renderJob(data)"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_add_officer']" effect="dark" content="新增职员" placement="bottom">
|
|
|
- <span v-if="data.OrganId != -1" class="cap cap-member" @click="renderMember(data)"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_add_officer']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增职员"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ class="cap cap-member"
|
|
|
+ @click="renderMember(data)"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_update_organ']" effect="dark" content="编辑组织" placement="bottom">
|
|
|
- <span class="cap cap-edit" @click="renderEdit(data)" v-if="data.OrganId != -1"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_update_organ']"
|
|
|
+ effect="dark"
|
|
|
+ content="编辑组织"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-edit"
|
|
|
+ @click="renderEdit(data)"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_add_organ']" effect="dark" content="新增组织" placement="bottom">
|
|
|
- <span class="cap cap-sub" @click="renderAdd(data)"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_add_organ']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增组织"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-sub"
|
|
|
+ @click="renderAdd(data)"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -96,10 +160,20 @@
|
|
|
<el-col :span="12" v-if="data.OrganId != -1">
|
|
|
<span class="msg">状态:</span>
|
|
|
<span class="use" v-if="data.Status == '1'">启用</span>
|
|
|
- <span class="unUse" v-if="data.Status != '1'">禁用</span>
|
|
|
+ <span class="unUse" v-if="data.Status != '1'"
|
|
|
+ >禁用</span
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col v-is="['organtree_btn_state_switch']" :span="12" v-if="data.OrganId != -1">
|
|
|
- <el-switch active-color="#6F81BC" v-model="data.flag" @change="renderChange(data)"></el-switch>
|
|
|
+ <el-col
|
|
|
+ v-is="['organtree_btn_state_switch']"
|
|
|
+ :span="12"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ >
|
|
|
+ <el-switch
|
|
|
+ active-color="#6F81BC"
|
|
|
+ v-model="data.flag"
|
|
|
+ @change="renderChange(data)"
|
|
|
+ ></el-switch>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -110,10 +184,21 @@
|
|
|
<div class="grid-contentBottom">
|
|
|
<div class="title">下级组织</div>
|
|
|
<div class="content">
|
|
|
- <el-empty :image-size="150" v-if="childrenData.length<1"></el-empty>
|
|
|
+ <el-empty
|
|
|
+ :image-size="150"
|
|
|
+ v-if="childrenData.length < 1"
|
|
|
+ ></el-empty>
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col :span="8" v-for="(data, index) in childrenData" :key="data.OrganId">
|
|
|
- <div v-is="['organtree_btn_del_organ']" class="info-close" @click="onNodeClick(data)">
|
|
|
+ <el-col
|
|
|
+ :span="8"
|
|
|
+ v-for="(data, index) in childrenData"
|
|
|
+ :key="data.OrganId"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-is="['organtree_btn_del_organ']"
|
|
|
+ class="info-close"
|
|
|
+ @click="onNodeClick(data)"
|
|
|
+ >
|
|
|
<i class="el-icon-close"></i>
|
|
|
</div>
|
|
|
<div class="itemBox" @click.stop="childrenClick(data)">
|
|
@@ -121,25 +206,63 @@
|
|
|
<div class="status2" v-if="data.OrganType != 1"></div>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <div :title="data.OrganName" class="itemTitle">{{ data.OrganName }}</div>
|
|
|
+ <div :title="data.OrganName" class="itemTitle">
|
|
|
+ {{ data.OrganName }}
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<div class="flex info">
|
|
|
<div class="icon">
|
|
|
- <el-tooltip v-if="doesJobShow" v-is="['organtree_btn_add_job']" effect="dark" content="新增职务" placement="bottom">
|
|
|
- <span class="cap cap-job" @click.stop="renderJob(data)" v-if="data.OrganId != -1"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="doesJobShow"
|
|
|
+ v-is="['organtree_btn_add_job']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增职务"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-job"
|
|
|
+ @click.stop="renderJob(data)"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_add_officer']" effect="dark" content="新增职员" placement="bottom">
|
|
|
- <span v-if="data.OrganId != -1" class="cap cap-member" @click.stop="renderMember(data)"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_add_officer']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增职员"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ class="cap cap-member"
|
|
|
+ @click.stop="renderMember(data)"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_update_organ']" effect="dark" content="编辑组织" placement="bottom">
|
|
|
- <span class="cap cap-edit" @click.stop="renderEdit(data)" v-if="data.OrganId != -1"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_update_organ']"
|
|
|
+ effect="dark"
|
|
|
+ content="编辑组织"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-edit"
|
|
|
+ @click.stop="renderEdit(data)"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip v-is="['organtree_btn_add_organ']" effect="dark" content="新增组织" placement="bottom">
|
|
|
- <span class="cap cap-sub" @click.stop="renderAdd(data)"></span>
|
|
|
+ <el-tooltip
|
|
|
+ v-is="['organtree_btn_add_organ']"
|
|
|
+ effect="dark"
|
|
|
+ content="新增组织"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="cap cap-sub"
|
|
|
+ @click.stop="renderAdd(data)"
|
|
|
+ ></span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -173,10 +296,21 @@
|
|
|
<el-col :span="12" v-if="data.OrganId != -1">
|
|
|
<span class="msg">状态:</span>
|
|
|
<span class="use" v-if="data.Status == '1'">启用</span>
|
|
|
- <span class="unUse" v-if="data.Status != '1'">禁用</span>
|
|
|
+ <span class="unUse" v-if="data.Status != '1'"
|
|
|
+ >禁用</span
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col v-is="['organtree_btn_state_switch']" :span="12" v-if="data.OrganId != -1">
|
|
|
- <el-switch active-color="#6F81BC" v-model="data.flag" @click.stop.native @change="childrenRenderChange(data, index)"></el-switch>
|
|
|
+ <el-col
|
|
|
+ v-is="['organtree_btn_state_switch']"
|
|
|
+ :span="12"
|
|
|
+ v-if="data.OrganId != -1"
|
|
|
+ >
|
|
|
+ <el-switch
|
|
|
+ active-color="#6F81BC"
|
|
|
+ v-model="data.flag"
|
|
|
+ @click.stop.native
|
|
|
+ @change="childrenRenderChange(data, index)"
|
|
|
+ ></el-switch>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -193,7 +327,9 @@
|
|
|
<div class="title">删除组织</div>
|
|
|
<div class="content">是否确认删除{{ title }}?</div>
|
|
|
<div class="foot right t30">
|
|
|
- <el-button size="medium" class="r24" @click="remove" type="danger">删除</el-button>
|
|
|
+ <el-button size="medium" class="r24" @click="remove" type="danger"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
<el-button size="medium" @click="flag = false">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -211,7 +347,7 @@ export default {
|
|
|
name: "Authority",
|
|
|
components: { Search, Dialog },
|
|
|
mixins: [treeData],
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
dataIndex: 1,
|
|
|
dataNum: 0,
|
|
@@ -230,12 +366,12 @@ export default {
|
|
|
dataListTree: [],
|
|
|
currentKey: null,
|
|
|
expandedKeys: [-1],
|
|
|
- initCurrentKeyStep: [false, false]
|
|
|
+ initCurrentKeyStep: [false, false],
|
|
|
};
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
let keyWords = "";
|
|
|
- const treeEx = sessionStorage.getItem('orgExpandedKeys');
|
|
|
+ const treeEx = sessionStorage.getItem("orgExpandedKeys");
|
|
|
if (this.$route.query.keyWords) {
|
|
|
keyWords = this.$route.query.keyWords;
|
|
|
}
|
|
@@ -244,9 +380,8 @@ export default {
|
|
|
}
|
|
|
this.getOrganTree(keyWords);
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.initCurrentKeyStep.splice(1, 1, true)
|
|
|
-
|
|
|
+ mounted() {
|
|
|
+ this.initCurrentKeyStep.splice(1, 1, true);
|
|
|
},
|
|
|
watch: {
|
|
|
dataList: {
|
|
@@ -257,110 +392,119 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
currentKey: {
|
|
|
- handler (val) {
|
|
|
- if (typeof val === 'object' && !val) {
|
|
|
- return
|
|
|
+ handler(val) {
|
|
|
+ if (typeof val === "object" && !val) {
|
|
|
+ return;
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.tree.setCurrentKey(val)
|
|
|
- sessionStorage.setItem('orgCurrentKey', val)
|
|
|
- this.setCards()
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$refs.tree.setCurrentKey(val);
|
|
|
+ sessionStorage.setItem("orgCurrentKey", val);
|
|
|
+ this.setCards();
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
expandedKeys: {
|
|
|
handler(arr) {
|
|
|
- sessionStorage.setItem('orgExpandedKeys', JSON.stringify(arr))
|
|
|
+ sessionStorage.setItem("orgExpandedKeys", JSON.stringify(arr));
|
|
|
},
|
|
|
- deep: true
|
|
|
+ deep: true,
|
|
|
},
|
|
|
initCurrentKeyStep: {
|
|
|
handler(arr) {
|
|
|
- if (arr.every(item => item)) {
|
|
|
- this.currentKey = Number(sessionStorage.getItem('orgCurrentKey') ?? -1)
|
|
|
+ if (arr.every((item) => item)) {
|
|
|
+ this.currentKey = Number(
|
|
|
+ sessionStorage.getItem("orgCurrentKey") ?? -1
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
- filterNode (value, data) {
|
|
|
+ filterNode(value, data) {
|
|
|
if (!value) return true;
|
|
|
return data.OrganName.indexOf(value) !== -1;
|
|
|
},
|
|
|
// 添加组织
|
|
|
- renderAdd (data) {
|
|
|
+ renderAdd(data) {
|
|
|
this.$router.push({
|
|
|
path: "/organization/organizationAdd",
|
|
|
query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId },
|
|
|
});
|
|
|
},
|
|
|
// 新增职务
|
|
|
- renderJob (data) {
|
|
|
+ renderJob(data) {
|
|
|
this.$router.push({
|
|
|
path: "/jobs/add",
|
|
|
query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId },
|
|
|
});
|
|
|
},
|
|
|
// 新增职员
|
|
|
- renderMember (data) {
|
|
|
+ renderMember(data) {
|
|
|
this.$router.push({
|
|
|
path: "/staff/staffAdd",
|
|
|
- query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId, orgType: 'org' },
|
|
|
+ query: {
|
|
|
+ OrganUpid: data.OrganUpid,
|
|
|
+ OrganId: data.OrganId,
|
|
|
+ orgType: "org",
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
// 修改组织
|
|
|
- renderEdit (data) {
|
|
|
+ renderEdit(data) {
|
|
|
this.$router.push({
|
|
|
path: "/organization/organizationEdit",
|
|
|
query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId },
|
|
|
});
|
|
|
},
|
|
|
// 新增组织
|
|
|
- renderSub (data) {
|
|
|
+ renderSub(data) {
|
|
|
this.$router.push({
|
|
|
path: "/organization/organizationAdd",
|
|
|
query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId },
|
|
|
});
|
|
|
},
|
|
|
// 关闭开启
|
|
|
- renderChange (data) {
|
|
|
+ renderChange(data) {
|
|
|
const { OrganId, flag, OrganUpid } = data;
|
|
|
- this.dataUpId = OrganUpid
|
|
|
+ this.dataUpId = OrganUpid;
|
|
|
this.handleChange(OrganId, flag);
|
|
|
},
|
|
|
//下级关闭
|
|
|
- childrenRenderChange (data, index) {
|
|
|
+ childrenRenderChange(data, index) {
|
|
|
const { OrganId, flag, OrganUpid } = data;
|
|
|
- this.dataUpId = OrganUpid
|
|
|
- this.handleChange(OrganId, flag, index)
|
|
|
+ this.dataUpId = OrganUpid;
|
|
|
+ this.handleChange(OrganId, flag, index);
|
|
|
},
|
|
|
//删除组织
|
|
|
- remove () {
|
|
|
+ remove() {
|
|
|
this.deleteOrg(this.dataId);
|
|
|
},
|
|
|
//查询
|
|
|
- getSearchData (val) {
|
|
|
+ getSearchData(val) {
|
|
|
if (val) {
|
|
|
- this.$router.replace({ path: '/organization', query: { keyWords: val } })
|
|
|
+ this.$router.replace({
|
|
|
+ path: "/organization",
|
|
|
+ query: { keyWords: val },
|
|
|
+ });
|
|
|
} else if (this.$route.query) {
|
|
|
- this.$router.replace('/organization')
|
|
|
+ this.$router.replace("/organization");
|
|
|
}
|
|
|
this.$refs.tree.filter(val);
|
|
|
},
|
|
|
//清除查询
|
|
|
- clearSearchData () {
|
|
|
- this.$router.replace('/organization')
|
|
|
+ clearSearchData() {
|
|
|
+ this.$router.replace("/organization");
|
|
|
this.getOrganTree();
|
|
|
},
|
|
|
//节点关闭按钮点击
|
|
|
- onNodeClick (data) {
|
|
|
+ onNodeClick(data) {
|
|
|
this.flag = true;
|
|
|
this.dataId = data.OrganId;
|
|
|
this.title = data.OrganName;
|
|
|
},
|
|
|
//获取指定数据
|
|
|
- decompose (value, key, id) {
|
|
|
+ decompose(value, key, id) {
|
|
|
let data = _.cloneDeep(value);
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -374,41 +518,41 @@ export default {
|
|
|
|
|
|
//-----------获取数据------------
|
|
|
//应用状态变更
|
|
|
- async handleChange (id, flag, index = 0, isChildren = false) {
|
|
|
- const Status = flag ? 1 : 0
|
|
|
+ async handleChange(id, flag, index = 0, isChildren = false) {
|
|
|
+ const Status = flag ? 1 : 0;
|
|
|
try {
|
|
|
const res = await tissueTreeStart({
|
|
|
OrganId: id,
|
|
|
- Status: Status
|
|
|
+ Status: Status,
|
|
|
});
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success(res.message);
|
|
|
- this.initCurrentKeyStep.splice(0, 1, false)
|
|
|
+ this.initCurrentKeyStep.splice(0, 1, false);
|
|
|
if (this.currentKey === id) {
|
|
|
- sessionStorage.setItem('orgCurrentKey', this.dataUpId)
|
|
|
+ sessionStorage.setItem("orgCurrentKey", this.dataUpId);
|
|
|
} else {
|
|
|
- this.currentKey = null
|
|
|
+ this.currentKey = null;
|
|
|
}
|
|
|
- this.getOrganTree()
|
|
|
+ this.getOrganTree();
|
|
|
} else {
|
|
|
this.$message.error(res.message);
|
|
|
if (!isChildren) {
|
|
|
this.currDataArr[index].flag = !flag;
|
|
|
} else {
|
|
|
- this.childrenData[index].flag = !flag
|
|
|
+ this.childrenData[index].flag = !flag;
|
|
|
}
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log("出错了", error);
|
|
|
if (!isChildren) {
|
|
|
- this.currDataArr[index].flag = !flag;
|
|
|
- } else {
|
|
|
- this.childrenData[index].flag = !flag
|
|
|
- }
|
|
|
+ this.currDataArr[index].flag = !flag;
|
|
|
+ } else {
|
|
|
+ this.childrenData[index].flag = !flag;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//组织删除
|
|
|
- async deleteOrg (id) {
|
|
|
+ async deleteOrg(id) {
|
|
|
try {
|
|
|
const res = await organele({
|
|
|
OrganId: id,
|
|
@@ -416,8 +560,8 @@ export default {
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success(res.message);
|
|
|
this.flag = false;
|
|
|
- this.initCurrentKeyStep.splice(0, 1, false)
|
|
|
- this.currentKey = null
|
|
|
+ this.initCurrentKeyStep.splice(0, 1, false);
|
|
|
+ this.currentKey = null;
|
|
|
this.getOrganTree();
|
|
|
} else {
|
|
|
this.flag = false;
|
|
@@ -428,53 +572,70 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//树点击
|
|
|
- handleNodeClick (data) {
|
|
|
+ handleNodeClick(data) {
|
|
|
this.currentKey = data.OrganId;
|
|
|
},
|
|
|
//下级卡片点击
|
|
|
- childrenClick (data) {
|
|
|
+ childrenClick(data) {
|
|
|
this.currentKey = data.OrganId;
|
|
|
if (!this.expandedKeys.includes(this.currentKey)) {
|
|
|
- this.expandedKeys.push(this.currentKey)
|
|
|
+ this.expandedKeys.push(this.currentKey);
|
|
|
}
|
|
|
},
|
|
|
// 根据选中节点获取卡片
|
|
|
setCards() {
|
|
|
- this.currDataArr = this.decompose(this.dataArr, "OrganId", this.currentKey);
|
|
|
- this.childrenData = this.decompose(this.dataArr, "OrganUpid", this.currentKey);
|
|
|
+ this.currDataArr = this.decompose(
|
|
|
+ this.dataArr,
|
|
|
+ "OrganId",
|
|
|
+ this.currentKey
|
|
|
+ );
|
|
|
+ this.childrenData = this.decompose(
|
|
|
+ this.dataArr,
|
|
|
+ "OrganUpid",
|
|
|
+ this.currentKey
|
|
|
+ );
|
|
|
+ this.childrenData.sort((a, b) => b.organType - a.organType);
|
|
|
},
|
|
|
// 节点展开
|
|
|
- handleExpand (obj) {
|
|
|
- this.expandedKeys.push(obj.OrganId)
|
|
|
+ handleExpand(obj) {
|
|
|
+ this.expandedKeys.push(obj.OrganId);
|
|
|
},
|
|
|
// 节点收起
|
|
|
- handleCollapse (obj) {
|
|
|
- const { OrganId, children } = obj
|
|
|
- children.length && this.collapseChilren(children)
|
|
|
- this.expandedKeys = this.expandedKeys.filter(key => key !== OrganId)
|
|
|
+ handleCollapse(obj) {
|
|
|
+ const { OrganId, children } = obj;
|
|
|
+ children.length && this.collapseChilren(children);
|
|
|
+ this.expandedKeys = this.expandedKeys.filter((key) => key !== OrganId);
|
|
|
},
|
|
|
// 收起子节点
|
|
|
- collapseChilren (children) {
|
|
|
- children.forEach(child => {
|
|
|
- const { OrganId, children } = child
|
|
|
- children.length && this.collapseChilren(children)
|
|
|
- this.expandedKeys = this.expandedKeys.filter(key => key !== OrganId)
|
|
|
- })
|
|
|
+ collapseChilren(children) {
|
|
|
+ children.forEach((child) => {
|
|
|
+ const { OrganId, children } = child;
|
|
|
+ children.length && this.collapseChilren(children);
|
|
|
+ this.expandedKeys = this.expandedKeys.filter((key) => key !== OrganId);
|
|
|
+ });
|
|
|
},
|
|
|
//岗位点击
|
|
|
- toJob (data) {
|
|
|
+ toJob(data) {
|
|
|
this.$router.push({
|
|
|
path: "/jobs",
|
|
|
- query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId, orgType: 'org' },
|
|
|
+ query: {
|
|
|
+ OrganUpid: data.OrganUpid,
|
|
|
+ OrganId: data.OrganId,
|
|
|
+ orgType: "org",
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
//职员点击
|
|
|
- toOfficer (data) {
|
|
|
+ toOfficer(data) {
|
|
|
this.$router.push({
|
|
|
path: "/staff",
|
|
|
- query: { OrganUpid: data.OrganUpid, OrganId: data.OrganId, orgType: 'org' },
|
|
|
+ query: {
|
|
|
+ OrganUpid: data.OrganUpid,
|
|
|
+ OrganId: data.OrganId,
|
|
|
+ orgType: "org",
|
|
|
+ },
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|