|
|
@@ -41,7 +41,7 @@
|
|
|
>
|
|
|
<div v-if="isConfigMode" class="teacher_tag">
|
|
|
<span :title="row?.[column.name].name">{{ row?.[column.name].name }}</span>
|
|
|
- <el-icon class="delete_icon" @click.stop="HandleRemoveUser(row, column.name, idx,'administrative')"><Close /></el-icon>
|
|
|
+ <el-icon class="delete_icon" @click.stop="OpenDeleteDialog(row, column,)"><Close /></el-icon>
|
|
|
</div>
|
|
|
<div v-else class="disabled_teacher">
|
|
|
<span :title="row?.[column.name].name">{{ row?.[column.name].name}}</span>
|
|
|
@@ -58,7 +58,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- 分组管理弹窗 -->
|
|
|
<FormTableEdit
|
|
|
+ style="flex-grow: 0;"
|
|
|
addOperationName="增加分组"
|
|
|
:startDragIndex="startDragIndex"
|
|
|
:endDragIndex="endDragIndex"
|
|
|
@@ -80,6 +82,19 @@
|
|
|
<span v-else>{{ row.groupName }}</span>
|
|
|
</template>
|
|
|
</FormTableEdit>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 地区 组内用户 删除弹窗 -->
|
|
|
+ <Dialog
|
|
|
+ style="flex-grow: 0;"
|
|
|
+ v-if="dialogVisible"
|
|
|
+ :submitLoading="dialogSubmitLoading"
|
|
|
+ :visible="dialogVisible"
|
|
|
+ @confirm="HandleDialogConfirm"
|
|
|
+ @close="HandleDialogClose">
|
|
|
+ 请确认是否确认删除{{ currentDeleteColumn.label }} {{currentDeleteRow[currentDeleteColumn.name].name}} {{provinceTablist.find(item=>item.key == defaultProvince)?.label}}{{currentDeleteRow.region}} 的权限?
|
|
|
+ </Dialog>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@@ -91,10 +106,15 @@ import Table from '@/baseComponents/Table.vue';
|
|
|
import TabSearch from '@/baseComponents/TabSearch.vue';
|
|
|
import FormTableEdit from '@/baseComponents/formTableEdit/index.vue'
|
|
|
|
|
|
+import Dialog from '@/baseComponents/Dialog.vue';
|
|
|
+
|
|
|
import {tableColumns,userTableColumns} from './table'
|
|
|
import {provinceTablist} from './tabSearch'
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 1. 左侧 员工相关信息及操作
|
|
|
+ */
|
|
|
// 员工账号信息
|
|
|
const userAccountData = ref([
|
|
|
{
|
|
|
@@ -108,14 +128,35 @@ const userAccountData = ref([
|
|
|
id:'2',
|
|
|
},
|
|
|
])
|
|
|
+// 当前选中的用户
|
|
|
+const selectedUser = ref()
|
|
|
+// 设置表行选中 样式
|
|
|
+const tableRowClassName = ({row,rowIndex})=>{
|
|
|
+ if(row.id == selectedUser.value?.id){
|
|
|
+ return 'active_row'
|
|
|
+ }
|
|
|
+}
|
|
|
+// 行选中 选择员工
|
|
|
+const HandleSelectUser = (user) => {
|
|
|
+ selectedUser.value = {
|
|
|
+ id:user.id,
|
|
|
+ name:user.name,
|
|
|
+ account:user.account,
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+/**
|
|
|
+ * 2. 右侧分组展示信息 及操作
|
|
|
+ */
|
|
|
// 分组信息
|
|
|
const isConfigMode = ref(false)
|
|
|
const defaultProvince = ref('beijing')
|
|
|
const groupPeopleTableData = ref([
|
|
|
{
|
|
|
id:'1',
|
|
|
- region:'xxx',
|
|
|
+ region:'东城区',
|
|
|
project1:{id:'1',name:'xxx'},
|
|
|
project2:{id:'1',name:'xxx'},
|
|
|
project3:{id:'1',name:'xxx'},
|
|
|
@@ -126,7 +167,7 @@ const groupPeopleTableData = ref([
|
|
|
},
|
|
|
{
|
|
|
id:'2',
|
|
|
- region:'xxx',
|
|
|
+ region:'西城区',
|
|
|
project1:{id:'1',name:'xxx'},
|
|
|
project2:{id:'1',name:'xxx'},
|
|
|
project3:{id:'1',name:'xxx'},
|
|
|
@@ -137,23 +178,6 @@ const groupPeopleTableData = ref([
|
|
|
},
|
|
|
])
|
|
|
|
|
|
-const selectedUser = ref()
|
|
|
-
|
|
|
-// 设置表行选中 样式
|
|
|
-const tableRowClassName = ({row,rowIndex})=>{
|
|
|
- if(row.id == selectedUser.value?.id){
|
|
|
- return 'active_row'
|
|
|
- }
|
|
|
-}
|
|
|
-// 行选中 选择员工
|
|
|
-const HandleSelectUser = (user) => {
|
|
|
- selectedUser.value = {
|
|
|
- id:user.id,
|
|
|
- name:user.name,
|
|
|
- account:user.account,
|
|
|
- };
|
|
|
-};
|
|
|
-
|
|
|
// 添加员工
|
|
|
const HandleAddUser = async (row, cell) => {
|
|
|
if (!isConfigMode.value) return;
|
|
|
@@ -171,70 +195,68 @@ const HandleAddUser = async (row, cell) => {
|
|
|
}
|
|
|
row[cell] = teacherMsg;
|
|
|
|
|
|
- // let res = await saveTeachingRelationshipApi({
|
|
|
- // ...teacherMsg,
|
|
|
- // evaluationId:route.query.id,
|
|
|
- // evaluationGradeId:searchParmams.value.gradeId,
|
|
|
- // evaluationSubjectId:cell,
|
|
|
- // evaluationClassId:row.className.evaluationClassId,
|
|
|
- // classType:searchParmams.value.classType == 'teach' ? 1 : 0 //班级类型,0-行政班,1-教学班
|
|
|
- // })
|
|
|
- // if(res?.code == 200){
|
|
|
- // ElMessage.success(res?.msg)
|
|
|
- // row[cell].push({...teacherMsg,id:res?.data});
|
|
|
- // }
|
|
|
};
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 3. 删除员工的弹窗 及操作
|
|
|
+ */
|
|
|
+const dialogVisible = ref(false)
|
|
|
+const dialogSubmitLoading = ref(false)
|
|
|
+const currentDeleteCell = ref() //当前准备删除的(员工)单元格数据
|
|
|
+const currentDeleteRow = ref() //当前准备删除的(员工)所在行数据
|
|
|
+const currentDeleteColumn = ref() //当前准备删除的(员工)所在列信息
|
|
|
// 移除员工
|
|
|
-const HandleRemoveUser = async (row, cell, index,type) => {
|
|
|
- if (!isConfigMode.value) return;
|
|
|
+const HandleDialogConfirm = ()=>{
|
|
|
let id = null
|
|
|
let res = undefined
|
|
|
- row[cell] = '';
|
|
|
-
|
|
|
- // id = row[cell][index].id
|
|
|
- // res = await deleteTeachingRelationshipApi(id)
|
|
|
- // if(res?.code == 200){
|
|
|
- // ElMessage.success(res?.msg)
|
|
|
- // row[cell].splice(index, 1);
|
|
|
- // }
|
|
|
-};
|
|
|
+ currentDeleteRow.value[currentDeleteColumn.value.name] = ''
|
|
|
+ // id = currentDeleteCell.value.id
|
|
|
+ HandleDialogClose()
|
|
|
+}
|
|
|
|
|
|
+const HandleDialogClose = ()=>{
|
|
|
+ currentDeleteCell.value = null
|
|
|
+ currentDeleteRow.value = null
|
|
|
+ currentDeleteColumn.value = null
|
|
|
+ dialogVisible.value = false
|
|
|
+}
|
|
|
+const OpenDeleteDialog = (row, cellObj)=>{
|
|
|
+ if (!isConfigMode.value) return;
|
|
|
+ dialogVisible.value = true
|
|
|
+ currentDeleteCell.value = row[cellObj.name]
|
|
|
+ currentDeleteRow.value = row
|
|
|
+ currentDeleteColumn.value = cellObj
|
|
|
+}
|
|
|
|
|
|
|
|
|
-// 分组管理相关配置
|
|
|
+/**
|
|
|
+ * 4. 分组管理 弹窗相关配置
|
|
|
+ */
|
|
|
const formVisible = ref(false)
|
|
|
-
|
|
|
const formDialogConfirmFlag = ref('')
|
|
|
const deleteFlag = ref('')
|
|
|
-
|
|
|
const gorupTableData = ref([
|
|
|
{
|
|
|
id:'xxx',
|
|
|
groupName:'xxxx'
|
|
|
}
|
|
|
])
|
|
|
-
|
|
|
const HandleOpenGroup = ()=>{
|
|
|
formVisible.value = true
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
const startDragIndex = ()=>{
|
|
|
return 0
|
|
|
}
|
|
|
const endDragIndex = (tableData)=>{
|
|
|
return tableData.length
|
|
|
}
|
|
|
-
|
|
|
const HandleEditGroup = (row,params)=>{
|
|
|
row.editFlag = ''
|
|
|
}
|
|
|
const HandleAddGroup = (row,params)=>{
|
|
|
row.tmpId = ''
|
|
|
}
|
|
|
-
|
|
|
const HandleDeleteGroup = (row)=>{
|
|
|
gorupTableData.value = gorupTableData.value.filter(item=>{
|
|
|
return item.id !== row.id
|
|
|
@@ -247,6 +269,9 @@ const HandleConfirmEntiretyGroup = ()=>{
|
|
|
formDialogConfirmFlag.value = 'fail'
|
|
|
},1000)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
|