no message

cyl/job_im_cus
jscyl13849007907 5 days ago
parent 405d511a44
commit 57f1438eb1

@ -258,11 +258,18 @@
<u-popup v-model="deptModal.isShow" mode="bottom" border-radius="16" height="980" :mask-close-able="true" @close="deptModal.isShow = false">
<div class="dept-picker-wrap">
<div class="g_fs_18 g_c_3 g_flex_row_center g_pt_16 g_pb_16">选择部门</div>
<div class="dept-columns-scroll">
<div class="dept-columns-scroll" style="overflow-x: auto;width: 100vw;">
<div class="dept-columns g_flex_row_start">
<div class="dept-column" v-for="(column, colIndex) in deptColumns" :key="colIndex">
<div class="">
<div class="g_flex_row_between g_pt_16 g_pb_16" style="border-bottom: 1px solid #ddd;" v-for="(dept, deptIndex) in column" :key="dept.id" @click="handleDeptClick(dept, colIndex)">
<div class="dept-column" v-for="(column, colIndex) in deptColumns" :key="colIndex" :id="'dept-column-' + colIndex">
<div :style="{ paddingTop: (columnPaddingTops[colIndex] || 0) + 'px' }">
<div
class="g_flex_row_between g_pt_16 g_pb_16"
style="border-bottom: 1px solid #ddd;"
v-for="(dept, deptIndex) in column"
:key="dept.id"
:id="'dept-item-' + colIndex + '-' + deptIndex"
@click="handleDeptClick(dept, colIndex, deptIndex)"
>
<div class="g_ell_1 g_flex_1" :style="{ color: '#333', fontSize: '14px', flex: 1, marginRight: '8px',padding:'0 4px' }">
{{ dept.teamName }}
</div>
@ -375,6 +382,7 @@ export default {
selectedDeptIds: [], // id
selectedDeptNames: [], //
currentDeptItem: null, //
columnPaddingTops: {}, //
roleModal: {
isShow: false,
},
@ -821,6 +829,7 @@ export default {
}
//
this.expandedDeptIds = this.buildExpandedPath(this.deptList || [], item.deptIds || []);
this.columnPaddingTops = {};
this.deptColumns = this.buildCascadingColumns(this.deptList || []);
this.deptModal.isShow = true;
},
@ -864,7 +873,7 @@ export default {
return this.expandedDeptIds[colIndex] === dept.id;
},
// + /
handleDeptClick(dept, colIndex) {
handleDeptClick(dept, colIndex, deptIndex) {
//
let idx = this.selectedDeptIds.indexOf(dept.id);
if (idx > -1) {
@ -879,14 +888,41 @@ export default {
if (this.expandedDeptIds[colIndex] === dept.id) {
//
this.expandedDeptIds = this.expandedDeptIds.slice(0, colIndex);
// padding-top
for (let i = colIndex + 1; i <= Object.keys(this.columnPaddingTops).length; i++) {
this.$delete(this.columnPaddingTops, i);
}
} else {
//
this.expandedDeptIds = this.expandedDeptIds.slice(0, colIndex);
this.expandedDeptIds.push(dept.id);
}
this.deptColumns = this.buildCascadingColumns(this.deptList || []);
// 使
this.$nextTick(() => {
this.alignColumnToParent(colIndex, deptIndex);
});
}
},
// 使
alignColumnToParent(colIndex, deptIndex) {
let that = this;
let parentItemId = '#dept-item-' + colIndex + '-' + deptIndex;
let childColumnId = '#dept-column-' + (colIndex + 1);
let firstColumnId = '#dept-column-0';
uni.createSelectorQuery().in(that).select(parentItemId).boundingClientRect(function(parentRect) {
if (!parentRect) return;
uni.createSelectorQuery().in(that).select(firstColumnId).boundingClientRect(function(firstRect) {
if (!firstRect) return;
//
let offset = parentRect.top - firstRect.top;
if (offset > 0) {
// padding-top使
that.$set(that.columnPaddingTops, colIndex + 1, offset);
}
}).exec();
}).exec();
},
//
submitDept() {
let ids = this.selectedDeptIds.join(",");

Loading…
Cancel
Save