|
@@ -21,17 +21,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="content_right">
|
|
<div class="content_right">
|
|
|
<span v-if="isConfigMode" class="config_switch_desc">
|
|
<span v-if="isConfigMode" class="config_switch_desc">
|
|
|
- {{ selectedUser?.id ? `当前选中的用户:${selectedUser.name}` : '暂无选中的用户' }}
|
|
|
|
|
|
|
+ {{ selectedUser?.id ? `当前选中的员工:${selectedUser.name}` : '暂无选中的员工' }}
|
|
|
</span>
|
|
</span>
|
|
|
- <el-switch v-model="isConfigMode"
|
|
|
|
|
- style="--el-switch-on-color: #2E64FA"
|
|
|
|
|
- active-text="选中用户配置任课关系" />
|
|
|
|
|
- <el-button class="button_border">分组管理</el-button>
|
|
|
|
|
|
|
+ <el-switch v-model="isConfigMode" style="--el-switch-on-color: #2E64FA" />
|
|
|
|
|
+ <span class="config_switch_desc" :style="{color:isConfigMode ? '#2E64FA' : '#999999'}">选中员工配置关系</span>
|
|
|
|
|
+ <el-button class="button_border" @click="HandleOpenGroup">分组管理</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="page_jg_20" />
|
|
<div class="page_jg_20" />
|
|
|
- <Table :tableColumns="tableColumns" :tableData="groupTableData">
|
|
|
|
|
|
|
+ <Table :tableColumns="tableColumns" :tableData="groupPeopleTableData">
|
|
|
<template v-for="column in tableColumns.slice(1)" :key="column.name" v-slot:[column.name]="{row}">
|
|
<template v-for="column in tableColumns.slice(1)" :key="column.name" v-slot:[column.name]="{row}">
|
|
|
<div class="cell_container" @click="HandleAddUser(row, column.name)">
|
|
<div class="cell_container" @click="HandleAddUser(row, column.name)">
|
|
|
<template v-if="row?.[column.name]">
|
|
<template v-if="row?.[column.name]">
|
|
@@ -50,7 +49,7 @@
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <span v-if="isConfigMode" class="placeholder_text" >请选择用户</span>
|
|
|
|
|
|
|
+ <span v-if="isConfigMode" class="placeholder_text" >请选择员工</span>
|
|
|
<span v-else>-</span>
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
@@ -58,6 +57,29 @@
|
|
|
</Table>
|
|
</Table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <FormTableEdit
|
|
|
|
|
+ addOperationName="增加分组"
|
|
|
|
|
+ :startDragIndex="startDragIndex"
|
|
|
|
|
+ :endDragIndex="endDragIndex"
|
|
|
|
|
+ formTitle="分组管理"
|
|
|
|
|
+ :middleColumnItm="{name:'groupName',label:'分组名称'}"
|
|
|
|
|
+ :disabledDeleteRowScene="()=>{return false}"
|
|
|
|
|
+ :disabledEditRowScene="()=>{return false}"
|
|
|
|
|
+ :defaultTableData="gorupTableData"
|
|
|
|
|
+ v-model:formVisible="formVisible"
|
|
|
|
|
+ v-model:deleteFlag="deleteFlag"
|
|
|
|
|
+ v-model:formDialogConfirmFlag="formDialogConfirmFlag"
|
|
|
|
|
+ @editConfirm = 'HandleEditGroup'
|
|
|
|
|
+ @addConfirm = 'HandleAddGroup'
|
|
|
|
|
+ @deleteConfirm = 'HandleDeleteGroup'
|
|
|
|
|
+ @entiretyConfirm = 'HandleConfirmEntiretyGroup'
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #groupName="{row,currentIndex}">
|
|
|
|
|
+ <el-input v-model="row.groupName" v-if="row.tmpId" placeholder="请输fdff入内容" />
|
|
|
|
|
+ <span v-else>{{ row.groupName }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </FormTableEdit>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -67,12 +89,13 @@ import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
import {accountFormSearhList} from './formSearch'
|
|
import {accountFormSearhList} from './formSearch'
|
|
|
import Table from '@/baseComponents/Table.vue';
|
|
import Table from '@/baseComponents/Table.vue';
|
|
|
import TabSearch from '@/baseComponents/TabSearch.vue';
|
|
import TabSearch from '@/baseComponents/TabSearch.vue';
|
|
|
|
|
+import FormTableEdit from '@/baseComponents/formTableEdit/index.vue'
|
|
|
|
|
|
|
|
import {tableColumns,userTableColumns} from './table'
|
|
import {tableColumns,userTableColumns} from './table'
|
|
|
import {provinceTablist} from './tabSearch'
|
|
import {provinceTablist} from './tabSearch'
|
|
|
|
|
|
|
|
|
|
|
|
|
-// 用户账号信息
|
|
|
|
|
|
|
+// 员工账号信息
|
|
|
const userAccountData = ref([
|
|
const userAccountData = ref([
|
|
|
{
|
|
{
|
|
|
account:'xxx',
|
|
account:'xxx',
|
|
@@ -89,8 +112,8 @@ const userAccountData = ref([
|
|
|
// 分组信息
|
|
// 分组信息
|
|
|
const isConfigMode = ref(false)
|
|
const isConfigMode = ref(false)
|
|
|
const defaultProvince = ref('beijing')
|
|
const defaultProvince = ref('beijing')
|
|
|
-const groupTableData = ref([
|
|
|
|
|
- {
|
|
|
|
|
|
|
+const groupPeopleTableData = ref([
|
|
|
|
|
+ {
|
|
|
id:'1',
|
|
id:'1',
|
|
|
region:'xxx',
|
|
region:'xxx',
|
|
|
project1:{id:'1',name:'xxx'},
|
|
project1:{id:'1',name:'xxx'},
|
|
@@ -114,7 +137,7 @@ const groupTableData = ref([
|
|
|
},
|
|
},
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-const selectedUser = ref({})
|
|
|
|
|
|
|
+const selectedUser = ref()
|
|
|
|
|
|
|
|
// 设置表行选中 样式
|
|
// 设置表行选中 样式
|
|
|
const tableRowClassName = ({row,rowIndex})=>{
|
|
const tableRowClassName = ({row,rowIndex})=>{
|
|
@@ -122,7 +145,7 @@ const tableRowClassName = ({row,rowIndex})=>{
|
|
|
return 'active_row'
|
|
return 'active_row'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-// 行选中 选择用户
|
|
|
|
|
|
|
+// 行选中 选择员工
|
|
|
const HandleSelectUser = (user) => {
|
|
const HandleSelectUser = (user) => {
|
|
|
selectedUser.value = {
|
|
selectedUser.value = {
|
|
|
id:user.id,
|
|
id:user.id,
|
|
@@ -131,7 +154,7 @@ const HandleSelectUser = (user) => {
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 添加用户
|
|
|
|
|
|
|
+// 添加员工
|
|
|
const HandleAddUser = async (row, cell) => {
|
|
const HandleAddUser = async (row, cell) => {
|
|
|
if (!isConfigMode.value) return;
|
|
if (!isConfigMode.value) return;
|
|
|
if (!selectedUser.value) return;
|
|
if (!selectedUser.value) return;
|
|
@@ -163,7 +186,7 @@ const HandleAddUser = async (row, cell) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
-// 移除用户
|
|
|
|
|
|
|
+// 移除员工
|
|
|
const HandleRemoveUser = async (row, cell, index,type) => {
|
|
const HandleRemoveUser = async (row, cell, index,type) => {
|
|
|
if (!isConfigMode.value) return;
|
|
if (!isConfigMode.value) return;
|
|
|
let id = null
|
|
let id = null
|
|
@@ -180,6 +203,50 @@ const HandleRemoveUser = async (row, cell, index,type) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// 分组管理相关配置
|
|
|
|
|
+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
|
|
|
|
|
+ })
|
|
|
|
|
+ // 删除执行内容
|
|
|
|
|
+ deleteFlag.value = 'success'
|
|
|
|
|
+}
|
|
|
|
|
+const HandleConfirmEntiretyGroup = ()=>{
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ formDialogConfirmFlag.value = 'fail'
|
|
|
|
|
+ },1000)
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -227,7 +294,7 @@ const HandleRemoveUser = async (row, cell, index,type) => {
|
|
|
|
|
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
- padding: 8px;
|
|
|
|
|
|
|
+ padding: 8px 0;
|
|
|
gap: 8px;
|
|
gap: 8px;
|
|
|
|
|
|
|
|
.placeholder_text,
|
|
.placeholder_text,
|