12 changed files with 1295 additions and 73 deletions
@ -0,0 +1,10 @@ |
|||
export interface crumb{ |
|||
id:string; |
|||
title:string; |
|||
} |
|||
|
|||
export interface userOrgRole extends crumb{ |
|||
img:string; |
|||
isPick:number; |
|||
types:number; |
|||
} |
|||
@ -0,0 +1,236 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 13:36:49 |
|||
@ 备注: 只有行政组织的选项列 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { Search,ArrowRight } from '@element-plus/icons-vue' //搜索图标 |
|||
import { userOrgRole,crumb } from '@/api/hr/search/types' |
|||
|
|||
import { gainSunOrgAndUser } from '@/api/hr/people/index' |
|||
|
|||
const props = defineProps({ |
|||
pickList:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}) |
|||
|
|||
const emits = defineEmits(["update:pickList","updataPickLog"]); |
|||
|
|||
const loading = ref(false) |
|||
const crumbList = ref<crumb[]>([]) //面包屑 |
|||
const listAry = ref<userOrgRole[]>([]) //待选择数据 |
|||
const pickLists = ref<userOrgRole[]>([]) //待选择数据 |
|||
|
|||
const circleUrl = ref('https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png') |
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-24 13:17:30 |
|||
@ 功能: 已选择的数据 |
|||
*/ |
|||
const pickList = computed({ |
|||
get() { |
|||
return props.pickList |
|||
}, |
|||
set(val: any) { |
|||
emits('update:pickList', val) |
|||
} |
|||
}); |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 14:53:08 |
|||
@ 功能: 加载数据 |
|||
*/ |
|||
const dataLoading = (orgId?:string) => { |
|||
loading.value = true; |
|||
gainSunOrgAndUser({id:orgId}) |
|||
.then((data) =>{ |
|||
crumbList.value = data.data.orgList |
|||
listAry.value = data.data.orgUserList |
|||
}) |
|||
.finally(() =>{ |
|||
loading.value = false; |
|||
if(pickLists.value.length > 0){ |
|||
listAry.value.forEach((item:userOrgRole)=>{ |
|||
let isTrue = true |
|||
pickLists.value.forEach((itemVal:userOrgRole)=>{ |
|||
if(item.id == itemVal.id){ |
|||
item.isPick = true; |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
item.isPick = false; |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//初始加载 |
|||
onMounted(()=>{ |
|||
dataLoading() |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:04:01 |
|||
@ 功能: 选择项目 |
|||
*/ |
|||
const pickCont = (val:userOrgRole) => { |
|||
if(val.isPick != 1){ |
|||
val.isPick = 1 |
|||
if(pickLists.value.length > 0){ |
|||
let isTrue = true |
|||
pickLists.value.forEach((item:userOrgRole)=>{ |
|||
if(item.id == val.id){ |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
pickLists.value.push(val) |
|||
} |
|||
}else{ |
|||
pickLists.value.push(val) |
|||
} |
|||
}else{ |
|||
val.isPick = 2 |
|||
if(pickLists.value.length > 0){ |
|||
pickLists.value.forEach((item:userOrgRole,index:number)=>{ |
|||
if(item.id == val.id){ |
|||
pickLists.value.splice(index,1) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
// emits('update:pickList', pickLists) |
|||
console.log("选择项目-------->",pickLists.value) |
|||
emits('updataPickLog', pickLists.value) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:25:58 |
|||
@ 功能: 监听已选择的选项 |
|||
*/ |
|||
watch(() => props.pickList, (val:userOrgRole[])=>{ |
|||
console.log("监听已选择的选项-------->",val) |
|||
pickLists.value = val |
|||
listAry.value.forEach((item)=>{ |
|||
let isTrue = true |
|||
val.forEach((itemVal:userOrgRole)=>{ |
|||
if(item.id == itemVal.id){ |
|||
item.isPick = true; |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
item.isPick = false; |
|||
} |
|||
}) |
|||
},{ |
|||
deep: true |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:43:27 |
|||
@ 功能: 选择下一级 |
|||
*/ |
|||
const pickSunCont = (orgId?:string) => { |
|||
console.log("选择下一级-------->",orgId) |
|||
dataLoading(orgId) |
|||
} |
|||
|
|||
</script> |
|||
<template> |
|||
<div> |
|||
<el-breadcrumb v-loading="loading" :separator-icon="ArrowRight" class="mianbaoxue"> |
|||
<el-breadcrumb-item @click="pickSunCont()">首页</el-breadcrumb-item> |
|||
<el-breadcrumb-item v-for="item in crumbList" :key="item.id" @click="pickSunCont(item.id)">{{ item.title }}</el-breadcrumb-item> |
|||
</el-breadcrumb> |
|||
<el-scrollbar v-loading="loading" class="contentBox"> |
|||
<ul> |
|||
<li v-for="item in listAry" :key="item.id" :class="item.isPick==1?'active':''"> |
|||
<el-space wrap @click="pickCont(item)"> |
|||
<i v-if="item.isPick==1" class="fa fa-check-square-o"></i><i v-else class="fa fa-square-o"></i> |
|||
<svg-icon v-if="item.types==2" icon-class="fenZhu" :size="20" /> |
|||
<svg-icon v-if="item.types==3" icon-class="tasp" :size="20" /> |
|||
<el-avatar v-if="item.types==1" shape="square" :size="20" :src="circleUrl" /> |
|||
<el-text>{{ item.title }}</el-text> |
|||
</el-space> |
|||
<div v-if="item.types==2" class="contentLiLeft"> |
|||
<svg-icon icon-class="cascader" /> |
|||
<el-text @click="pickSunCont(item.id)">下级</el-text> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</el-scrollbar> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.mianbaoxue{ |
|||
display: flex; |
|||
white-space: nowrap; |
|||
padding: 10px 5px; |
|||
overflow: auto; |
|||
cursor: pointer; |
|||
} |
|||
.contentBox{ |
|||
height: 400px; |
|||
padding: 0 5px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #EBEEF5; |
|||
color: #409EFF; |
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
li.active{ |
|||
background-color: #EBEDF0; |
|||
color: #409EFF; |
|||
|
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
} |
|||
.contentLiLeft{ |
|||
border-left: 1px dashed #909399; |
|||
padding-left: 10px; |
|||
} |
|||
.pickBox{ |
|||
height: 420px; |
|||
padding: 10px 0px 0px 0px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #F56C6C; |
|||
color: #FFFFFF; |
|||
.el-text{ |
|||
color: #FFFFFF; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,245 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-27 10:55:51 |
|||
@ 备注: 行政集团和角色 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { Search,ArrowRight } from '@element-plus/icons-vue' //搜索图标 |
|||
import { userOrgRole,crumb } from '@/api/hr/search/types' |
|||
import { gainSunOrgAndUser,gainAllRole } from '@/api/hr/people/index' |
|||
|
|||
const props = defineProps({ |
|||
pickList:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}) |
|||
|
|||
const circleUrl = ref('https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png') |
|||
|
|||
const orgOrRole = ref(1) |
|||
const emits = defineEmits(["update:pickList","updataPickLog"]); |
|||
|
|||
|
|||
const loading = ref(false) |
|||
const crumbList = ref<crumb[]>([]) //面包屑 |
|||
const listAry = ref<userOrgRole[]>([]) //待选择数据 |
|||
const listRoleAry = ref<userOrgRole[]>([]) //待选择数据 |
|||
const pickLists = ref<userOrgRole[]>([]) //待选择数据 |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 14:53:08 |
|||
@ 功能: 加载数据 |
|||
*/ |
|||
const dataLoading = (orgId?:string) => { |
|||
loading.value = true; |
|||
gainSunOrgAndUser({id:orgId}) |
|||
.then((data) =>{ |
|||
crumbList.value = data.data.orgList |
|||
listAry.value = data.data.orgUserList |
|||
}) |
|||
.finally(() =>{ |
|||
loading.value = false; |
|||
if(pickLists.value.length > 0){ |
|||
listAry.value.forEach((item:userOrgRole)=>{ |
|||
let isTrue = true |
|||
pickLists.value.forEach((itemVal:userOrgRole)=>{ |
|||
if(item.id == itemVal.id){ |
|||
item.isPick = true; |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
item.isPick = false; |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:43:27 |
|||
@ 功能: 选择下一级 |
|||
*/ |
|||
const pickSunCont = (orgId?:string) => { |
|||
console.log("选择下一级-------->",orgId) |
|||
dataLoading(orgId) |
|||
} |
|||
//初始加载 |
|||
onMounted(()=>{ |
|||
dataLoading() |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:04:01 |
|||
@ 功能: 选择项目 |
|||
*/ |
|||
const pickCont = (val:userOrgRole) => { |
|||
if(val.isPick != 1){ |
|||
val.isPick = 1 |
|||
if(pickLists.value.length > 0){ |
|||
let isTrue = true |
|||
pickLists.value.forEach((item:userOrgRole)=>{ |
|||
if(item.id == val.id){ |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
pickLists.value.push(val) |
|||
} |
|||
}else{ |
|||
pickLists.value.push(val) |
|||
} |
|||
}else{ |
|||
val.isPick = 2 |
|||
if(pickLists.value.length > 0){ |
|||
pickLists.value.forEach((item:userOrgRole,index:number)=>{ |
|||
if(item.id == val.id){ |
|||
pickLists.value.splice(index,1) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
// emits('update:pickList', pickLists) |
|||
console.log("选择项目-------->",pickLists.value) |
|||
emits('updataPickLog', pickLists.value) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:25:58 |
|||
@ 功能: 监听已选择的选项 |
|||
*/ |
|||
watch(() => props.pickList, (val:userOrgRole[])=>{ |
|||
console.log("监听已选择的选项-------->",val) |
|||
pickLists.value = val |
|||
listAry.value.forEach((item)=>{ |
|||
let isTrue = true |
|||
val.forEach((itemVal:userOrgRole)=>{ |
|||
if(item.id == itemVal.id){ |
|||
item.isPick = true; |
|||
isTrue = false; |
|||
} |
|||
}) |
|||
if(isTrue){ |
|||
item.isPick = false; |
|||
} |
|||
}) |
|||
},{ |
|||
deep: true |
|||
}) |
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-27 11:48:32 |
|||
@ 功能: 获取角色 |
|||
*/ |
|||
const gainSysRole = (val?:string) => { |
|||
gainAllRole({name:val}) |
|||
.then((data) =>{ |
|||
listRoleAry.value = data.data.orgUserList |
|||
}) |
|||
} |
|||
|
|||
</script> |
|||
<template> |
|||
<el-tabs v-model="orgOrRole" class="demo-tabs"> |
|||
<el-tab-pane label="行政组织" :name="1"> |
|||
<el-breadcrumb v-loading="loading" :separator-icon="ArrowRight" class="mianbaoxue"> |
|||
<el-breadcrumb-item @click="pickSunCont()">首页</el-breadcrumb-item> |
|||
<el-breadcrumb-item v-for="item in crumbList" :key="item.id" @click="pickSunCont(item.id)">{{ item.title }}</el-breadcrumb-item> |
|||
</el-breadcrumb> |
|||
<el-scrollbar v-loading="loading" class="contentBox"> |
|||
<ul> |
|||
<li v-for="item in listAry" :key="item.id" :class="item.isPick==1?'active':''"> |
|||
<el-space wrap @click="pickCont(item)"> |
|||
<i v-if="item.isPick==1" class="fa fa-check-square-o"></i><i v-else class="fa fa-square-o"></i> |
|||
<svg-icon v-if="item.types==2" icon-class="fenZhu" :size="20" /> |
|||
<svg-icon v-if="item.types==3" icon-class="tasp" :size="20" /> |
|||
<el-avatar v-if="item.types==1" shape="square" :size="20" :src="circleUrl" /> |
|||
<el-text>{{ item.title }}</el-text> |
|||
</el-space> |
|||
<div v-if="item.types==2" class="contentLiLeft"> |
|||
<svg-icon icon-class="cascader" /> |
|||
<el-text @click="pickSunCont(item.id)">下级</el-text> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</el-scrollbar> |
|||
|
|||
</el-tab-pane> |
|||
<el-tab-pane label="角色" :name="2"> |
|||
{{ listRoleAry }} |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.mianbaoxue{ |
|||
display: flex; |
|||
white-space: nowrap; |
|||
padding: 0px 5px 10px 5px; |
|||
overflow: auto; |
|||
cursor: pointer; |
|||
} |
|||
.contentBox{ |
|||
height: 400px; |
|||
padding: 0 5px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #EBEEF5; |
|||
color: #409EFF; |
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
li.active{ |
|||
background-color: #EBEDF0; |
|||
color: #409EFF; |
|||
|
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
} |
|||
.contentLiLeft{ |
|||
border-left: 1px dashed #909399; |
|||
padding-left: 10px; |
|||
} |
|||
.pickBox{ |
|||
height: 420px; |
|||
padding: 10px 0px 0px 0px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #F56C6C; |
|||
color: #FFFFFF; |
|||
.el-text{ |
|||
color: #FFFFFF; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,263 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 13:50:03 |
|||
@ 备注: 行政组织及角色选择器 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { Search,ArrowRight } from '@element-plus/icons-vue' //搜索图标 |
|||
import { userOrgRole,crumb } from '@/api/hr/search/types' |
|||
const circleUrl = ref('https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png') |
|||
|
|||
|
|||
//引入页面 |
|||
import OrgPage from '@/views/hr/orgUserRole/org.vue' |
|||
import OrgRolePage from '@/views/hr/orgUserRole/orgrole.vue' |
|||
const props = defineProps({ |
|||
isOpen:{ |
|||
type:Boolean, |
|||
default:false |
|||
}, |
|||
types:{ |
|||
type:Number, |
|||
default:1 |
|||
}, |
|||
pickList:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}); |
|||
const taotleLog = ref(0) |
|||
const pickListAry = ref<userOrgRole[]>([]) //已选择数据 |
|||
const emits = defineEmits(["update:isOpen","update:types","pickInfo"]); |
|||
const searchQuery = reactive<any>({ |
|||
key:"", |
|||
types:1 |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 13:56:28 |
|||
@ 功能: 对话框状态 |
|||
*/ |
|||
const isShow = computed({ |
|||
get() { |
|||
// console.log("对话框状态",props.isOpen); |
|||
return props.isOpen |
|||
}, |
|||
set(val: boolean) { |
|||
// console.log("对话框状态",props.isOpen); |
|||
emits('update:isOpen', val) |
|||
} |
|||
}); |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-27 08:21:06 |
|||
@ 功能: 人员选择范围 |
|||
*/ |
|||
const userTypes = computed({ |
|||
get() { |
|||
// console.log("对话框状态",props.isOpen); |
|||
return props.types |
|||
}, |
|||
set(val: boolean) { |
|||
// console.log("对话框状态",props.isOpen); |
|||
emits('update:types', val) |
|||
} |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 14:15:10 |
|||
@ 功能: 关闭弹出对话框 |
|||
*/ |
|||
const handleClose = () => { |
|||
emits('update:isOpen', false) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 08:21:58 |
|||
@ 功能: 根据条件搜索数据 |
|||
*/ |
|||
const searchData = () => { |
|||
|
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:29:20 |
|||
@ 功能: 更新数据 |
|||
*/ |
|||
const updataPickLog = (val:userOrgRole[]) => { |
|||
|
|||
pickListAry.value = val |
|||
taotleLog.value = val.length |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:36:07 |
|||
@ 功能: 删除选中项目 |
|||
*/ |
|||
const delPickCont = (val:userOrgRole) => { |
|||
pickListAry.value.forEach((item:userOrgRole,index:number)=>{ |
|||
if(item.id == val.id){ |
|||
pickListAry.value.splice(index,1) |
|||
} |
|||
}) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:52:58 |
|||
@ 功能: 清空选项 |
|||
*/ |
|||
const clearVal = () => { |
|||
pickListAry.value = []; |
|||
taotleLog.value = 0 |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:59:11 |
|||
@ 功能: 提交数据 |
|||
*/ |
|||
const submitSend = () => { |
|||
emits('pickInfo', pickListAry,props.types) |
|||
|
|||
} |
|||
watch(()=>props.isOpen,(val:boolean)=>{ |
|||
if(!val){ |
|||
clearVal() |
|||
}else{ |
|||
if(props.pickList.length > 0){ |
|||
pickListAry.value = props.pickList |
|||
} |
|||
} |
|||
console.log("对话框状态",val); |
|||
}) |
|||
// |
|||
</script> |
|||
<template> |
|||
<el-dialog v-model="isShow" title="选择成员" width="700" draggable :before-close="handleClose"> |
|||
<el-row class="allBianLink"> |
|||
<el-col :span="12"> |
|||
<el-input |
|||
v-model="searchQuery.key" |
|||
:prefix-icon="Search" |
|||
size="large" |
|||
class="inputDeep" |
|||
@input="searchData" |
|||
/> |
|||
<OrgPage v-if="userTypes==1" :pick-list="pickListAry" @updataPickLog="updataPickLog" /> |
|||
<OrgRolePage v-if="userTypes==2" :pick-list="pickListAry" @updataPickLog="updataPickLog" /> |
|||
</el-col> |
|||
|
|||
<el-col :span="12" class="leftLink"> |
|||
<el-row> |
|||
<el-col :span="24" class="pickTitle"> |
|||
<el-text>已选({{ taotleLog }})</el-text> |
|||
<el-button type="danger" link @click="clearVal">清空</el-button> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<el-scrollbar class="pickBox"> |
|||
<ul> |
|||
<li v-for="item in pickListAry" :key="item.id"> |
|||
<el-space wrap> |
|||
<svg-icon v-if="item.types==2" icon-class="fenZhu" :size="20" /> |
|||
<svg-icon v-if="item.types==3" icon-class="tasp" :size="20" /> |
|||
<el-avatar v-if="item.types==1" shape="square" :size="20" :src="circleUrl" /> |
|||
<el-text>{{ item.title }}</el-text> |
|||
</el-space> |
|||
<div > |
|||
<svg-icon icon-class="cwkx" @click="delPickCont(item)" /> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
|
|||
</el-scrollbar> |
|||
</el-col> |
|||
</el-row> |
|||
</el-col> |
|||
</el-row> |
|||
<template #footer> |
|||
<div class="dialog-footer"> |
|||
<el-button @click="handleClose">取消</el-button> |
|||
<el-button type="primary" @click="submitSend">确定</el-button> |
|||
</div> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.allBianLink{ |
|||
border: 1px solid #E6E8EB; |
|||
.leftLink{ |
|||
border-left: 1px solid #E6E8EB; |
|||
} |
|||
.pickTitle{ |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 10px 10px; |
|||
border-bottom: 1px solid #E6E8EB; |
|||
} |
|||
} |
|||
.mianbaoxue{ |
|||
display: flex; |
|||
white-space: nowrap; |
|||
padding: 10px 5px; |
|||
overflow: auto; |
|||
cursor: pointer; |
|||
} |
|||
.contentBox{ |
|||
height: 400px; |
|||
padding: 0 5px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #EBEEF5; |
|||
color: #409EFF; |
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
li.active{ |
|||
background-color: #EBEDF0; |
|||
color: #409EFF; |
|||
|
|||
.el-text{ |
|||
color: #409EFF; |
|||
} |
|||
} |
|||
} |
|||
.contentLiLeft{ |
|||
border-left: 1px dashed #909399; |
|||
padding-left: 10px; |
|||
} |
|||
.pickBox{ |
|||
height: 420px; |
|||
padding: 10px 0px 0px 0px; |
|||
li { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
width: 100%; |
|||
padding: 5px 5px; |
|||
cursor: pointer; |
|||
i { |
|||
font-size: 15px; |
|||
} |
|||
} |
|||
li:hover { |
|||
background-color: #F56C6C; |
|||
color: #FFFFFF; |
|||
.el-text{ |
|||
color: #FFFFFF; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,84 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 10:34:53 |
|||
@ 备注: 应用权限 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { userOrgRole,crumb } from '@/api/hr/search/types' |
|||
|
|||
import LookSee from '@/views/sysworkflow/lowcodepage/appPage/appSetUp/looksee.vue' |
|||
const props = defineProps({ |
|||
appCont:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
const powerUser = ref<userOrgRole[]>([]) //管理员 |
|||
|
|||
|
|||
</script> |
|||
<template> |
|||
|
|||
<el-card shadow="always" class="powerBox"> |
|||
<el-row> |
|||
<el-col :span="24" class="appTitle">应用相关权限配置</el-col> |
|||
<el-col :span="24" class="appDesicer">为该应用进行权限的细化配置。确保应用信息在可控范围内传播。</el-col> |
|||
</el-row> |
|||
<LookSee /> |
|||
<el-card shadow="never" class="boxTop"> |
|||
<el-row> |
|||
<el-col :span="24" class="appTitle">应用主管理员</el-col> |
|||
<el-col :span="24" class="appContent">应用主管理员拥有应用管理后台的全部权限,可进行应用搭建、编辑、设置以及数据管理</el-col> |
|||
<el-col :span="24" class="appManList"> |
|||
<table> |
|||
<tr> |
|||
<td width="80px"> |
|||
<el-text >权限成员</el-text> |
|||
</td> |
|||
<td width="80px"> |
|||
<el-button link type="primary" size="large" @click="setupUser(2)">设置成员</el-button> |
|||
</td> |
|||
<td> |
|||
<el-space wrap :size="15"> |
|||
|
|||
<el-tag type="info" closable v-for="item in powerUser">秦东</el-tag> |
|||
|
|||
</el-space> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
|
|||
</el-card> |
|||
|
|||
</el-card> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.appTitle{ |
|||
font-size:22px; |
|||
} |
|||
.appDesicer{ |
|||
padding: 15px 0 0 0; |
|||
color: #606266; |
|||
} |
|||
.boxTop{ |
|||
margin: 15px 0 0 0; |
|||
} |
|||
.appContent{ |
|||
padding: 10px 0 15px 0; |
|||
color: #606266; |
|||
border-bottom: 1px solid #F0F2F5; |
|||
} |
|||
.appManList{ |
|||
padding: 30px 0 10px 0; |
|||
} |
|||
.powerBox{ |
|||
height: calc(100vh - 70px); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,126 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-22 09:37:55 |
|||
@ 备注: 应用设置 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import SetUp from '@/views/sysworkflow/lowcodepage/appPage/appSetUp/setup.vue' |
|||
import AppPower from '@/views/sysworkflow/lowcodepage/appPage/appSetUp/appPower.vue' |
|||
const props = defineProps({ |
|||
appCont:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
}, |
|||
groupKey:{ |
|||
type:String, |
|||
default:"" |
|||
} |
|||
}); |
|||
const activeMenuIndex = ref("1") |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 09:47:00 |
|||
@ 功能: 菜单打开 |
|||
*/ |
|||
const handleOpen = (key: string, keyPath: string[]) => { |
|||
console.log("菜单打开",key, keyPath) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 09:47:09 |
|||
@ 功能: 菜单关闭 |
|||
*/ |
|||
const handleClose = (key: string, keyPath: string[]) => { |
|||
console.log("菜单关闭",key, keyPath) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 10:19:45 |
|||
@ 功能: 单击菜单 |
|||
*/ |
|||
const clickMenu = (key:number) => { |
|||
activeMenuIndex.value = key |
|||
} |
|||
</script> |
|||
<template> |
|||
|
|||
<el-container> |
|||
<el-aside class="appMenuBox"> |
|||
<el-menu |
|||
default-active="1" |
|||
class="el-menu-vertical-demo allHeight" |
|||
@open="handleOpen" |
|||
@close="handleClose" |
|||
> |
|||
<el-menu-item index="1" @click="clickMenu(1)"> |
|||
<template #title> |
|||
<i class="fa fa-cog icont"></i> |
|||
<span>基础设置</span> |
|||
</template> |
|||
</el-menu-item> |
|||
<el-menu-item index="2" @click="clickMenu(2)"> |
|||
<template #title> |
|||
<i class="fa fa-lock icont"></i> |
|||
<span>应用权限</span> |
|||
</template> |
|||
</el-menu-item> |
|||
<el-menu-item index="3" @click="clickMenu(3)"> |
|||
<template #title> |
|||
<i class="fa fa-clone icont"></i> |
|||
<span>部署运维</span> |
|||
</template> |
|||
</el-menu-item> |
|||
<el-menu-item index="4" @click="clickMenu(4)"> |
|||
<template #title> |
|||
<i class="fa fa-database icont"></i> |
|||
<span>数据管理</span> |
|||
</template> |
|||
</el-menu-item> |
|||
</el-menu> |
|||
</el-aside> |
|||
<el-main class="appSetUpBox"> |
|||
<el-scrollbar class="appSetUpDraw"> |
|||
|
|||
<SetUp v-if="activeMenuIndex==1" :app-cont="appCont" :group-key="props.groupKey" /> |
|||
<AppPower v-if="activeMenuIndex==2" :app-cont="appCont" /> |
|||
</el-scrollbar> |
|||
</el-main> |
|||
</el-container> |
|||
|
|||
</template> |
|||
<style lang='scss' scoped> |
|||
|
|||
.appMenuBox{ |
|||
width: 200px; |
|||
.allHeight{ |
|||
height: calc(100vh - 45px); |
|||
.icont{ |
|||
margin-left:15px; |
|||
margin-right:10px; |
|||
font-size:16px; |
|||
} |
|||
} |
|||
::v-deep .el-menu-item.is-active{ |
|||
background-color : #ecf5ff |
|||
} |
|||
::v-deep .el-menu-item .is-active:hover{ |
|||
background-color : #ecf5ff |
|||
} |
|||
::v-deep .el-menu--vertical .nest-menu .el-sub-menu > .el-sub-menu__title:hover, .el-menu--vertical .el-menu-item:hover{ |
|||
background-color : #ecf5ff; |
|||
color:#FFFFFF; |
|||
} |
|||
} |
|||
.appSetUpBox{ |
|||
padding:0; |
|||
background: var(--el-fill-color-light); |
|||
.appSetUpDraw{ |
|||
background: var(--el-fill-color-light); |
|||
height: calc(100vh - 40px); |
|||
padding: 15px; |
|||
} |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,84 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-27 08:02:20 |
|||
@ 备注: 可见范围 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { userOrgRole,crumb } from '@/api/hr/search/types' |
|||
import PersonnelSelector from '@/views/hr/userBox.vue' |
|||
|
|||
|
|||
|
|||
|
|||
const lookSeeView = ref<userOrgRole[]>([]) //可见范围 |
|||
const isOpenBox = ref(false) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 14:01:37 |
|||
@ 功能: 人员选择器 |
|||
*/ |
|||
const setupUser = (types:number) => { |
|||
isOpenBox.value = true |
|||
console.log("isOpenBox",isOpenBox) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-24 15:54:55 |
|||
@ 功能: 选中得内容 |
|||
*/ |
|||
const pickInfo = (val:userOrgRole[]) =>{ |
|||
isOpenBox.value = false; |
|||
lookSeeView.value = val.value |
|||
} |
|||
</script> |
|||
<template> |
|||
<PersonnelSelector v-model:is-open="isOpenBox" :pick-list="lookSeeView" :types="2" @pickInfo="pickInfo" /> |
|||
<el-card shadow="never" class="boxTop"> |
|||
<el-row> |
|||
<el-col :span="24" class="appTitle">应用适用范围设置</el-col> |
|||
<el-col :span="24" class="appContent">为该应用配置可见范围。只有被允许行政组织、角色、具体人员才可使用本应用的相关功能。</el-col> |
|||
<el-col :span="24" class="appManList"> |
|||
<table> |
|||
<tr> |
|||
<td width="80px"> |
|||
<el-text >可见范围</el-text> |
|||
</td> |
|||
<td width="80px"> |
|||
<el-button link type="primary" size="large" @click="setupUser(1)">设置成员</el-button> |
|||
</td> |
|||
<td> |
|||
<el-space wrap :size="15"> |
|||
|
|||
<el-tag type="info" closable v-for="item in lookSeeView" >{{item.title}}</el-tag> |
|||
|
|||
</el-space> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</el-col> |
|||
</el-row> |
|||
</el-card> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.appTitle{ |
|||
font-size:22px; |
|||
} |
|||
.appDesicer{ |
|||
padding: 15px 0 0 0; |
|||
color: #606266; |
|||
} |
|||
.boxTop{ |
|||
margin: 15px 0 0 0; |
|||
} |
|||
.appContent{ |
|||
padding: 10px 0 15px 0; |
|||
color: #606266; |
|||
border-bottom: 1px solid #F0F2F5; |
|||
} |
|||
.appManList{ |
|||
padding: 30px 0 10px 0; |
|||
} |
|||
.powerBox{ |
|||
height: calc(100vh - 70px); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,197 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-22 14:33:09 |
|||
@ 备注: app设置 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { uploadUrl } from '@/api/DesignForm' |
|||
import type { ComponentSize, FormInstance, FormRules } from 'element-plus' |
|||
import { appSetUpContent } from '@src/api/DesignForm/types' |
|||
import { customerFormGroupList,appBasicSettings } from '@/api/DesignForm/requestapi' |
|||
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus' |
|||
|
|||
const props = defineProps({ |
|||
appCont:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
}, |
|||
groupKey:{ |
|||
type:String, |
|||
default:"" |
|||
} |
|||
}); |
|||
const appLoading = ref(false) |
|||
const formSize = ref<ComponentSize>('default') |
|||
const ruleFormRef = ref<FormInstance>() |
|||
const appSetupCont = reactive<appSetUpContent>({ |
|||
id:props.appCont.uuid, |
|||
title:props.appCont.appName, |
|||
appSvg:props.appCont.appSvg, |
|||
groupKey:props.groupKey, |
|||
appdescribe:props.appCont.describe |
|||
}) |
|||
const rules = reactive<FormRules<appSetUpContent>>({ |
|||
groupKey: [{ required: true, message: "请选择分组", trigger: "blur" }], |
|||
title: [{ required: true, message: "请输入App名称", trigger: "blur" }], |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-22 15:55:21 |
|||
@ 功能: 分组数据 |
|||
*/ |
|||
const formGroup = ref<any[]>([]) |
|||
const gainFormGroupList = () =>{ |
|||
let sendInfo = { |
|||
page:1, |
|||
pagesize:10000, |
|||
state:1 |
|||
} |
|||
customerFormGroupList(sendInfo) |
|||
.then((data)=>{ |
|||
formGroup.value = data.data |
|||
}) |
|||
} |
|||
watch(()=>props.appCont,(val:any)=>{ |
|||
gainFormGroupList(); |
|||
},{ |
|||
deep:true, |
|||
}) |
|||
onMounted(()=>{ |
|||
gainFormGroupList(); |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-22 16:10:27 |
|||
@ 功能: 重置表单 |
|||
*/ |
|||
const resetForm = (formEl: FormInstance | undefined) => { |
|||
if (!formEl) return |
|||
formEl.resetFields() |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-22 16:21:18 |
|||
@ 功能: 提交表单数据 |
|||
*/ |
|||
const submitForm = () => { |
|||
appLoading.value = true |
|||
ruleFormRef.value.validate((isValid: boolean) => { |
|||
if (isValid) { |
|||
console.log("提交数据",appSetupCont) |
|||
appBasicSettings(appSetupCont) |
|||
.then(() =>{ |
|||
props.appCont.appName = appSetupCont.title |
|||
props.appCont.appSvg = appSetupCont.appSvg |
|||
props.appCont.describe = appSetupCont.appdescribe |
|||
|
|||
ElMessage.success("编辑成功"); |
|||
appLoading.value = false; |
|||
}) |
|||
.finally(() =>{appLoading.value = false;}) |
|||
}else{ |
|||
appLoading.value = false |
|||
} |
|||
}) |
|||
} |
|||
const appSetupUpImg = ref(null) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-23 09:20:29 |
|||
@ 功能: 上传成功后回调 |
|||
*/ |
|||
const handleAvatarSuccess: UploadProps['onSuccess'] = ( |
|||
response, |
|||
uploadFile |
|||
) => { |
|||
// imageUrl.value = URL.createObjectURL(uploadFile.raw!) |
|||
appSetupCont.appSvg = response.data.url |
|||
// appSetupUpImg.clearFiles() |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-10 11:28:40 |
|||
@ 功能: 上传前验证 |
|||
*/ |
|||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => { |
|||
if (rawFile.type !== 'image/jpeg' && rawFile.type !== 'image/jpg' && rawFile.type !== 'image/png' && rawFile.type !== 'image/gif' && rawFile.type !== 'image/icon') { |
|||
ElMessage.error('请上传以下格式的图片(jpg、jpeg、png、gif、icon)!'+rawFile.type) |
|||
return false |
|||
} else if (rawFile.size / 1024 / 1024 > 800) { |
|||
ElMessage.error('图片大小不要大于 800MB!') |
|||
return false |
|||
} |
|||
return true |
|||
} |
|||
|
|||
|
|||
</script> |
|||
<template> |
|||
<el-card shadow="always"> |
|||
<el-divider content-position="left">App基础设置</el-divider> |
|||
<el-form |
|||
ref="ruleFormRef" |
|||
:model="appSetupCont" |
|||
:rules="rules" |
|||
label-width="auto" |
|||
class="demo-ruleForm" |
|||
:size="formSize" |
|||
status-icon |
|||
v-loading="appLoading" |
|||
> |
|||
<el-form-item label="归属分组" prop="groupKey"> |
|||
<el-select v-model="appSetupCont.groupKey" placeholder="请选择分组"> |
|||
<el-option v-for="item in formGroup.list" :key="item.idStr" :label="item.title" :value="item.idStr" /> |
|||
<p v-if="loadingmore">加载中</p> |
|||
<p v-if="loadingnomore">无数据</p> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="App名称" prop="title"> |
|||
<el-input v-model="appSetupCont.title" placeholder="请输入App名称" clearable style="width: 300px" /> |
|||
</el-form-item> |
|||
<el-form-item label="App图标" prop="icont"> |
|||
|
|||
<el-upload |
|||
ref="appSetupUpImg" |
|||
class="upload-demo" |
|||
:drag="true" |
|||
:action="uploadUrl" |
|||
|
|||
:show-file-list="false" |
|||
:on-success="handleAvatarSuccess" |
|||
:before-upload="beforeAvatarUpload" |
|||
> |
|||
<el-image v-if="appSetupCont.appSvg&&appSetupCont.appSvg!=''" :src="appSetupCont.appSvg" fit="cover" class="avatar" /> |
|||
<div v-else> |
|||
<el-icon class="el-icon--upload"><upload-filled /></el-icon> |
|||
<div class="el-upload__text"> |
|||
将文件拖到此处或 <em>单击上传</em> |
|||
</div> |
|||
</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item label="应用描述"> |
|||
<el-input v-model="appSetupCont.appdescribe" type="textarea" show-word-limit maxlength="300" style="width: 60%" /> |
|||
</el-form-item> |
|||
<el-form-item class="butClass"> |
|||
<el-button type="primary" @click="submitForm(ruleFormRef)">保存</el-button> |
|||
<el-button @click="resetForm(ruleFormRef)">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
</el-card> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.boxk{ |
|||
width:100%; |
|||
background: var(--el-fill-color-light); |
|||
} |
|||
.avatar{ |
|||
width: 150px; |
|||
height: 150px; |
|||
} |
|||
.butClass{ |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue