|
@@ -13,8 +13,8 @@
|
|
|
<div class="school-list-header">
|
|
|
<div class="correlationbox-titles">目前用户所关联学校:<span>关联数量:<span class="correlationbox-num">{{nowUsers.handleSchools.length}}</span></span></div>
|
|
|
<div class="correlationbox-btn">
|
|
|
- <el-button type="primary" size="small" v-if="removeBatchschool.length >0 && PowerShow" @click="multipeRemove"> 移除选中学校</el-button>
|
|
|
- <el-button type="primary" size="small" v-else-if="removeBatchschool.length ===0 && PowerShow" disabled>移除选中学校</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="removeBatchschool.length >0 && PowerShow && adminOrleader===false" @click="multipeRemove"> 移除选中学校</el-button>
|
|
|
+ <el-button type="primary" size="small" v-else-if="removeBatchschool.length ===0 && PowerShow && adminOrleader===true" disabled>移除选中学校</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <p class="correlationbox-title">目前用户所关联学校:</p>
|
|
@@ -48,7 +48,7 @@
|
|
|
<span class="areaitem-insti" v-else>{{scope.row.institution}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow">
|
|
|
+ <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow && adminOrleader===false">
|
|
|
<template #default="scope">
|
|
|
<el-button type="text" size="small" @click="removeSchool(scope.row,scope.$index)">取消关联</el-button>
|
|
|
</template>
|
|
@@ -65,8 +65,8 @@
|
|
|
<el-input v-model="schoolSearch" placeholder="输入学校名称/简码 搜索" :prefix-icon="Search" size="small" clearable />
|
|
|
</div>
|
|
|
<div class="correlationbox-btn">
|
|
|
- <el-button type="primary" size="small" v-if="multipleSchool.length >0 && PowerShow" @click="multipleCorrelation">关联选中学校</el-button>
|
|
|
- <el-button type="primary" size="small" v-else-if="multipleSchool.length ===0 && PowerShow" disabled>关联选中学校</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="multipleSchool.length >0 && PowerShow && adminOrleader===false" @click="multipleCorrelation">关联选中学校</el-button>
|
|
|
+ <el-button type="primary" size="small" v-else-if="multipleSchool.length ===0 && PowerShow && adminOrleader===true" disabled>关联选中学校</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="listbox">
|
|
@@ -94,7 +94,7 @@
|
|
|
<span class="areaitem-insti" v-else>{{scope.row.institution}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow">
|
|
|
+ <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow && adminOrleader===false">
|
|
|
<template #default="scope">
|
|
|
<el-button type="text" size="small" @click="correlation(scope.row,tableData)">关联学校</el-button>
|
|
|
</template>
|
|
@@ -150,6 +150,7 @@ export default {
|
|
|
})
|
|
|
//关联筛选原始data
|
|
|
let correlaData = ref([])
|
|
|
+ let adminOrleader = ref(false)
|
|
|
onMounted(() => {
|
|
|
//监听表格滚动事件
|
|
|
// let table = mutipleTable.value._value.layout.table.refs.bodyWrapper;
|
|
@@ -300,9 +301,9 @@ export default {
|
|
|
.then((res) => {
|
|
|
console.log(res, '成功的返回')
|
|
|
res.state === 200
|
|
|
- ? ((nowUsers.value.handleSchools = nowUsers.value.handleSchools.concat(schoolData)), getSchoolList('', 'restart'), processingSchool(), context.emit('changerestart', true))
|
|
|
+ ? ((nowUsers.value.handleSchools = nowUsers.value.handleSchools.concat(schoolData)), getSchoolList('', 'restart'), processingSchool(), context.emit('changerestart', true), ElMessage.success('操作成功'))
|
|
|
: res.state === 201
|
|
|
- ? (ElMessage.success('已关联,请勿重复操作'), getSchoolList())
|
|
|
+ ? (ElMessage.success('已关联,请勿重复操作'), getSchoolList('', 'restart'))
|
|
|
: ''
|
|
|
})
|
|
|
.catch((error) => {
|
|
@@ -459,6 +460,7 @@ export default {
|
|
|
}
|
|
|
//处理显示目前关联的
|
|
|
function nowRelevance (value) {
|
|
|
+ console.log(value, '这个人的身份')
|
|
|
nowUsers.value = JSON.parse(JSON.stringify(value))
|
|
|
let nowUserdata = nowUsers.value
|
|
|
nowUserdata.handleSchools.forEach((item) => {
|
|
@@ -470,6 +472,7 @@ export default {
|
|
|
})
|
|
|
nowUsers.value.handleSchools = nowUserdata.handleSchools
|
|
|
correlaData.value = nowUserdata.handleSchools
|
|
|
+ value.handleRoles.includes('admin') || value.handleRoles.includes('leader') ? adminOrleader.value = true : adminOrleader.value = false
|
|
|
loadingData.value.possess = false
|
|
|
}
|
|
|
watch(scrollHeight, (newdata, olddata) => {
|
|
@@ -520,7 +523,8 @@ export default {
|
|
|
removeBatch,
|
|
|
nowRelevance,
|
|
|
correlaData,
|
|
|
- correlaSchool
|
|
|
+ correlaSchool,
|
|
|
+ adminOrleader
|
|
|
}
|
|
|
},
|
|
|
}
|