no message

cyl/job_im_cus
jscyl13849007907 5 days ago
parent ff62186c9d
commit 405d511a44

@ -266,7 +266,7 @@
<div class="g_ell_1 g_flex_1" :style="{ color: '#333', fontSize: '14px', flex: 1, marginRight: '8px',padding:'0 4px' }">
{{ dept.teamName }}
</div>
<div class="g_flex_column_center g_flex_none">
<div class="g_flex_column_center g_flex_none" style="margin-right: 4px;">
<i
class="iconfont icon-a-duigoubeifen2"
style="font-size: 24px"
@ -371,6 +371,7 @@ export default {
isShow: false,
},
deptColumns: [], // [[{id,teamName,childs}], [...]]
expandedDeptIds: [], // id
selectedDeptIds: [], // id
selectedDeptNames: [], //
currentDeptItem: null, //
@ -811,8 +812,6 @@ export default {
//
openDeptPicker(item) {
this.currentDeptItem = item;
//
this.deptColumns = this.buildAllDeptColumns(this.deptList || []);
if (item.deptIds && item.deptIds.length) {
this.selectedDeptIds = [].concat(item.deptIds);
this.selectedDeptNames = [].concat(item.deptNames || []);
@ -820,26 +819,53 @@ export default {
this.selectedDeptIds = [];
this.selectedDeptNames = [];
}
//
this.expandedDeptIds = this.buildExpandedPath(this.deptList || [], item.deptIds || []);
this.deptColumns = this.buildCascadingColumns(this.deptList || []);
this.deptModal.isShow = true;
},
//
buildAllDeptColumns(list) {
// id
buildExpandedPath(list, selectedIds) {
if (!list || list.length === 0 || !selectedIds || selectedIds.length === 0) return [];
for (let i = 0; i < list.length; i++) {
let item = list[i];
if (selectedIds.indexOf(item.id) > -1) {
//
return [item.id];
}
if (item.childs && item.childs.length > 0) {
let childPath = this.buildExpandedPath(item.childs, selectedIds);
if (childPath.length > 0) {
return [item.id].concat(childPath);
}
}
}
return [];
},
//
buildCascadingColumns(list) {
if (!list || list.length === 0) return [];
let columns = [list];
//
let nextColumn = [];
list.forEach(item => {
if (item.childs && item.childs.length > 0) {
nextColumn = nextColumn.concat(item.childs);
let currentList = list;
for (let i = 0; i < this.expandedDeptIds.length; i++) {
let expandedId = this.expandedDeptIds[i];
let found = currentList.find(item => item.id === expandedId);
if (found && found.childs && found.childs.length > 0) {
columns.push(found.childs);
currentList = found.childs;
} else {
break;
}
});
if (nextColumn.length > 0) {
columns = columns.concat(this.buildAllDeptColumns(nextColumn));
}
return columns;
},
// +
//
isParentExpanded(dept, colIndex) {
return this.expandedDeptIds[colIndex] === dept.id;
},
// + /
handleDeptClick(dept, colIndex) {
//
let idx = this.selectedDeptIds.indexOf(dept.id);
if (idx > -1) {
this.selectedDeptIds.splice(idx, 1);
@ -848,6 +874,18 @@ export default {
this.selectedDeptIds.push(dept.id);
this.selectedDeptNames.push(dept.teamName);
}
// /
if (dept.childs && dept.childs.length > 0) {
if (this.expandedDeptIds[colIndex] === dept.id) {
//
this.expandedDeptIds = this.expandedDeptIds.slice(0, colIndex);
} else {
//
this.expandedDeptIds = this.expandedDeptIds.slice(0, colIndex);
this.expandedDeptIds.push(dept.id);
}
this.deptColumns = this.buildCascadingColumns(this.deptList || []);
}
},
//
submitDept() {
@ -990,11 +1028,16 @@ export default {
.dept-columns-scroll {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
flex: 1;
width: 100%;
padding-bottom: calc(constant(safe-area-inset-bottom) + 80rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 80rpx);
scrollbar-width: none;
}
.dept-columns-scroll::-webkit-scrollbar {
display: none;
}
.dept-columns {
display: flex;
@ -1006,7 +1049,7 @@ export default {
}
.dept-column {
width: 30vw;
min-width: 30vw;
min-width: 180px;
max-width: 30vw;
height: 100%;
border-right: 1px solid #ddd;

@ -137,9 +137,13 @@ let data = {
}
if (uni.getStorageSync("AGENCY_ID")) {
$header.AgencyId4A = uni.getStorageSync("AGENCY_ID");
console.log("---------------$url", $url);
if (!$parmas.agencyId) {
$parmas.agencyId = uni.getStorageSync("AGENCY_ID")
}
if($url == '/yishoudan/user/updateAgencyCorpUser'){
$parmas.agencyId = uni.getStorageSync("apply-userinfo").agencyId
}
}
if ($parmas.formdata || $method == "POST" || $method == "PUT") {

Loading…
Cancel
Save