|
@@ -10,11 +10,21 @@
|
|
|
{{ $t('create') }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div style="width: 100%;display: flex">
|
|
|
+ <el-button v-if="!adjustPosition" style="width: 100%;" size="small" @click="adjustPositionClick()">调整部门</el-button>
|
|
|
+ <el-button v-if="adjustPosition" style="width: 50%" size="small" @click="adjustPosition = !adjustPosition,data = dataRepeat">取消</el-button>
|
|
|
+ <el-button v-if="adjustPosition" style="width: 50%" size="small" @click="adjustPositionClick()">确定</el-button>
|
|
|
+ </div>
|
|
|
<el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
|
|
|
<div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
|
|
|
<!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
|
|
|
<!-- <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa"> -->
|
|
|
- <el-tree :data="data" :props="defaultProps" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
|
|
|
+ <el-tree :data="data"
|
|
|
+ :props="defaultProps"
|
|
|
+ :draggable="adjustPosition"
|
|
|
+ :allow-drop="allowDrop"
|
|
|
+ @node-drop="nodeDrop"
|
|
|
+ :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
|
|
|
<span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node }" @mouseleave= mouseleave(data,$event) @mouseover= mouseover(data,$event)>
|
|
|
<span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
|
|
|
<span v-if="user.userNameNeedTranslate == '1'">
|
|
@@ -35,6 +45,10 @@
|
|
|
<span v-if="user.userNameNeedTranslate != '1'">
|
|
|
{{ node.label }}
|
|
|
</span> -->
|
|
|
+
|
|
|
+ <span v-if="node.label != $t('lable.allStaff') && node.label != $t('lable.unassigned') && adjustPosition" class="treeIons">
|
|
|
+ <i class="el-icon-s-operation" style="color: #409eff"></i>
|
|
|
+ </span>
|
|
|
</span>
|
|
|
|
|
|
<!-- <span v-if="node.label != '全部人员'" class="node none"> -->
|
|
@@ -46,6 +60,7 @@
|
|
|
<i class="el-icon-delete"></i> <!-- 删除 -->
|
|
|
</el-button>
|
|
|
</span>
|
|
|
+
|
|
|
</span>
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -186,13 +201,17 @@
|
|
|
{{scope.$index+1+(page-1)*size}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" :label="$t('lable.name')" >
|
|
|
+ <el-table-column prop="name" :label="$t('lable.name')" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <div v-if="user.userNameNeedTranslate == 1">
|
|
|
+ <div class="classwxName">
|
|
|
+ <span v-if="user.corpwxUserid && saasSyncContact == 0" class="classwxNameIon">
|
|
|
+ <img src="../../assets/image/qiyeweix.png" alt="">
|
|
|
+ </span>
|
|
|
+ <!-- <div v-if="user.userNameNeedTranslate == 1">
|
|
|
<ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
|
|
|
</div>
|
|
|
- <div v-else>{{scope.row.name}}</div>
|
|
|
+ <div v-else>{{scope.row.name}}</div> -->
|
|
|
+ <div>{{scope.row.name}}</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -1051,6 +1070,10 @@ export default {
|
|
|
newSyncWithCorpWxDayload: false,
|
|
|
|
|
|
wxManager: false,
|
|
|
+
|
|
|
+ adjustPosition: false,
|
|
|
+
|
|
|
+ dataRepeat: []
|
|
|
};
|
|
|
},
|
|
|
filters: {
|
|
@@ -1066,6 +1089,13 @@ export default {
|
|
|
that = this;
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 调整
|
|
|
+ adjustPositionClick() {
|
|
|
+ this.adjustPosition = !this.adjustPosition
|
|
|
+ if(!this.adjustPosition) {
|
|
|
+ this.queding()
|
|
|
+ }
|
|
|
+ },
|
|
|
getWxManager() {
|
|
|
this.http.post('/user/isManager', {},
|
|
|
res => {
|
|
@@ -1861,13 +1891,18 @@ export default {
|
|
|
this.jDarr = arrs;
|
|
|
},
|
|
|
mouseleave(data, $event) {
|
|
|
- $event.currentTarget.firstElementChild.nextElementSibling.setAttribute(
|
|
|
- "class",
|
|
|
- "node none poAub"
|
|
|
- );
|
|
|
+ if($event.currentTarget && !this.adjustPosition) {
|
|
|
+ $event.currentTarget.firstElementChild.nextElementSibling.setAttribute(
|
|
|
+ "class",
|
|
|
+ "node none poAub"
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
mouseover(data, $event) {
|
|
|
- $event.currentTarget.lastChild.setAttribute("class", "node block poAub");
|
|
|
+ if($event.currentTarget && !this.adjustPosition) {
|
|
|
+ $event.currentTarget.lastChild.setAttribute("class", "node block poAub");
|
|
|
+ }
|
|
|
},
|
|
|
confirmDeactive() {
|
|
|
this.http.post(
|
|
@@ -2118,6 +2153,7 @@ export default {
|
|
|
(res) => {
|
|
|
if (res.code == "ok") {
|
|
|
this.timeType = res.data;
|
|
|
+ this.saasSyncContact = res.saasSyncContact
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -2783,6 +2819,7 @@ export default {
|
|
|
label: this.$t('lable.unassigned'),
|
|
|
});
|
|
|
this.data = list;
|
|
|
+ this.dataRepeat = JSON.parse(JSON.stringify(list))
|
|
|
console.log(list, "部门数据")
|
|
|
this.option = this.changeArr(list1);
|
|
|
} else {
|
|
@@ -3455,6 +3492,39 @@ export default {
|
|
|
error => {
|
|
|
this.$message({message: error,type: "error"});
|
|
|
});
|
|
|
+ },
|
|
|
+ // 拖拽时判定目标节点能否被放置
|
|
|
+ allowDrop(draggingNode, dropNode, type) {
|
|
|
+ // 判断他是否属于同一级
|
|
|
+ if(draggingNode.parent.id == dropNode.parent.id) {
|
|
|
+ // 禁止插入目标节点内
|
|
|
+ if(type != 'inner') {
|
|
|
+ return type
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ nodeDrop() {
|
|
|
+ console.log(this.data)
|
|
|
+ },
|
|
|
+ queding() {
|
|
|
+ console.log(JSON.stringify(this.data), '数据', this.data)
|
|
|
+ this.http.post('/department/sortList', {
|
|
|
+ list: JSON.stringify(this.data)
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({message: res.msg,type: "error"});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({message: error,type: "error"});
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -3482,6 +3552,22 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.treeIons {
|
|
|
+ float: right;
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ top: 0;
|
|
|
+}
|
|
|
+.classwxName{
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.classwxNameIon {
|
|
|
+ width: 20px;
|
|
|
+}
|
|
|
+.classwxNameIon img {
|
|
|
+ width: 20px;
|
|
|
+}
|
|
|
.workingHours {
|
|
|
padding: 0 60px;
|
|
|
}
|