fix : 屏蔽导出修复角色权限
This commit is contained in:
@@ -52,7 +52,6 @@ const router = useRouter()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const showTinymce = ref(true)
|
|
||||||
const showTable = ref(true)
|
const showTable = ref(true)
|
||||||
const processInstanceData = ref()
|
const processInstanceData = ref()
|
||||||
const fundForm = ref()
|
const fundForm = ref()
|
||||||
@@ -249,10 +248,8 @@ const getDetailInfo = async () => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
formData.value = res.data
|
formData.value = res.data
|
||||||
showTinymce.value = false
|
|
||||||
showTable.value = false
|
showTable.value = false
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
showTinymce.value = true
|
|
||||||
showTable.value = true
|
showTable.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
||||||
<div class="assign-menu-title" >
|
<div class="assign-menu-title" >
|
||||||
<baseTitle title="分配菜单"></baseTitle>
|
<baseTitle title="分配菜单"></baseTitle>
|
||||||
<fvSelect
|
<fvSelect
|
||||||
:options="localData.tempRoleOpt"
|
:options="localData.tempRoleOpt"
|
||||||
v-model="localData.tempRoleSelect"
|
v-model="localData.tempRoleSelect"
|
||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
placeholder="请选择模版角色"
|
placeholder="请选择模版角色"
|
||||||
@change="roleTempChange"
|
@change="roleTempChange"
|
||||||
@@ -15,14 +15,14 @@
|
|||||||
<fvCheckbox :options="localData.checkOptions" v-model="localData.checkList" @change="checkBoxChange" />
|
<fvCheckbox :options="localData.checkOptions" v-model="localData.checkList" @change="checkBoxChange" />
|
||||||
<el-input v-model="localData.filterText" placeholder="请输入关键词" style="width: 400px;" />
|
<el-input v-model="localData.filterText" placeholder="请输入关键词" style="width: 400px;" />
|
||||||
<div class="menu-assign">
|
<div class="menu-assign">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="menuTree"
|
ref="menuTree"
|
||||||
:data="localData.menuData"
|
:data="localData.menuData"
|
||||||
:filter-node-method="filterMenu"
|
:filter-node-method="filterMenu"
|
||||||
:props="localData.menuTreeProps"
|
:props="localData.menuTreeProps"
|
||||||
:check-strictly="!localData.checkStrictly"
|
:check-strictly="!localData.checkStrictly"
|
||||||
show-checkbox
|
show-checkbox
|
||||||
node-key="menuId"
|
node-key="value"
|
||||||
@check-change="checkChange"
|
@check-change="checkChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,7 +38,7 @@ import { useTagsView } from '@/stores/tagsview.js'
|
|||||||
import { useAuthStore } from '@/stores/userstore.js'
|
import { useAuthStore } from '@/stores/userstore.js'
|
||||||
import fvRadio from '@/fvcomponents/fvRadio/index.vue'
|
import fvRadio from '@/fvcomponents/fvRadio/index.vue'
|
||||||
import { ElLoading, ElNotification } from 'element-plus';
|
import { ElLoading, ElNotification } from 'element-plus';
|
||||||
import { getMenuList } from '@/api/system/menuman.js'
|
import { getMenuOpt } from '@/api/system/menuman.js'
|
||||||
import { getRoleDetail, operate, getTemRoleOption } from "@/api/role/role";
|
import { getRoleDetail, operate, getTemRoleOption } from "@/api/role/role";
|
||||||
|
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
@@ -55,8 +55,8 @@ const localData = reactive({
|
|||||||
filterText: '',
|
filterText: '',
|
||||||
menuData: [],
|
menuData: [],
|
||||||
menuTreeProps: {
|
menuTreeProps: {
|
||||||
value: "menuId",
|
value: "value",
|
||||||
label: 'menuName',
|
label: 'label',
|
||||||
children: 'children'
|
children: 'children'
|
||||||
},
|
},
|
||||||
checkStrictly: true,
|
checkStrictly: true,
|
||||||
@@ -143,7 +143,7 @@ const init = async () => {
|
|||||||
form.value.setValues({state: '1', template: false})
|
form.value.setValues({state: '1', template: false})
|
||||||
const res = await getTemRoleOption()
|
const res = await getTemRoleOption()
|
||||||
localData.tempRoleOpt = res.data
|
localData.tempRoleOpt = res.data
|
||||||
const { data } = await getMenuList()
|
const { data } = await getMenuOpt(0)
|
||||||
localData.menuData = data
|
localData.menuData = data
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ const roleTempChange = async (val) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterMenu = (value, data) => {
|
const filterMenu = (value, data) => {
|
||||||
@@ -261,4 +261,4 @@ onMounted( async ()=>{
|
|||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import Tag from '@/components/Tag.vue'
|
|||||||
import { ElMessageBox, ElNotification } from 'element-plus';
|
import { ElMessageBox, ElNotification } from 'element-plus';
|
||||||
import { deleteRole } from "@/api/role/role";
|
import { deleteRole } from "@/api/role/role";
|
||||||
import { useAuthStore } from '@/stores/userstore.js'
|
import { useAuthStore } from '@/stores/userstore.js'
|
||||||
|
import {getSubCompOpt} from "@/api/user/user";
|
||||||
|
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -43,7 +44,19 @@ const shortcuts = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = ref([
|
||||||
|
{
|
||||||
|
label: '子公司名称',
|
||||||
|
prop: 'subCompanyId',
|
||||||
|
component: 'el-tree-select',
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入',
|
||||||
|
clearable: true,
|
||||||
|
data: [],
|
||||||
|
filterable: true,
|
||||||
|
checkStrictly: true
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '角色名称',
|
label: '角色名称',
|
||||||
prop: 'roleName',
|
prop: 'roleName',
|
||||||
@@ -108,6 +121,11 @@ const tableConfig = reactive({
|
|||||||
label: '角色权限',
|
label: '角色权限',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'companyName',
|
||||||
|
label: '公司名称',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'template',
|
prop: 'template',
|
||||||
label: '是否为模版角色',
|
label: '是否为模版角色',
|
||||||
@@ -144,7 +162,7 @@ const tableConfig = reactive({
|
|||||||
// }
|
// }
|
||||||
// )
|
// )
|
||||||
if(authStore.roles.includes('superAdmin')) {
|
if(authStore.roles.includes('superAdmin')) {
|
||||||
btn.push({label: '删除', auth: auths.del, func: ()=>handleDel(row) , type: 'danger'})
|
btn.push({label: '删除', auth: auths.del, func: ()=>handleDel(row) , type: 'danger'})
|
||||||
} else if(!row.template) {
|
} else if(!row.template) {
|
||||||
btn.push({label: '删除', auth: auths.del, func: ()=>handleDel(row) , type: 'danger'})
|
btn.push({label: '删除', auth: auths.del, func: ()=>handleDel(row) , type: 'danger'})
|
||||||
}
|
}
|
||||||
@@ -152,9 +170,9 @@ const tableConfig = reactive({
|
|||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
btn.map(item=>(
|
btn.map(item=>(
|
||||||
<el-button
|
<el-button
|
||||||
type={item.type}
|
type={item.type}
|
||||||
v-perm={item.auth}
|
v-perm={item.auth}
|
||||||
onClick={()=>item.func()}
|
onClick={()=>item.func()}
|
||||||
link
|
link
|
||||||
>
|
>
|
||||||
@@ -183,20 +201,6 @@ const search = (val) => {
|
|||||||
tableIns.value.refresh()
|
tableIns.value.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatDataScope = (dataScope) => {
|
|
||||||
let text = '--'
|
|
||||||
switch(dataScope) {
|
|
||||||
case '1': text = '所有数据权限'
|
|
||||||
break
|
|
||||||
case '2': text = '自定义数据权限'
|
|
||||||
break
|
|
||||||
case '3': text = '本部门数据权限'
|
|
||||||
break
|
|
||||||
case '4': text = '本部门及以下数据权限'
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
router.push({
|
router.push({
|
||||||
@@ -229,7 +233,7 @@ const handleDel = (row) => {
|
|||||||
// })
|
// })
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ElMessageBox.confirm('确定删除该条数据吗?', '确定删除', {
|
ElMessageBox.confirm('确定删除该条数据吗?', '确定删除', {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
@@ -252,8 +256,18 @@ const headBtnClick = (key) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const init = async () => {
|
||||||
|
if(!authStore.roles.includes('superAdmin')) {
|
||||||
|
searchConfig.value = searchConfig.value.slice(1)
|
||||||
|
}
|
||||||
|
searchConfig.value = searchConfig.value
|
||||||
|
const res = await getSubCompOpt()
|
||||||
|
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
|
||||||
|
}
|
||||||
|
init()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const router = useRouter()
|
|||||||
|
|
||||||
const searchConfig = ref([
|
const searchConfig = ref([
|
||||||
{
|
{
|
||||||
label: '子公司ID',
|
label: '子公司名称',
|
||||||
prop: 'subCompanyId',
|
prop: 'subCompanyId',
|
||||||
component: 'el-tree-select',
|
component: 'el-tree-select',
|
||||||
props: {
|
props: {
|
||||||
@@ -33,7 +33,7 @@ const searchConfig = ref([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '部门ID',
|
label: '部门名称',
|
||||||
prop: 'departmentId',
|
prop: 'departmentId',
|
||||||
component: 'el-tree-select',
|
component: 'el-tree-select',
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
Reference in New Issue
Block a user