|
@@ -0,0 +1,79 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
+import {dataTree} from "@/views/utilities/page-editor-help/public-data";
|
|
|
+import XcComboGridV2 from "@/components/xiao-chan/combo-grid/XcComboGridV2.vue";
|
|
|
+import {getRenYuan} from "@/api/public-api";
|
|
|
+import {useCompRef} from "@/utils/useCompRef";
|
|
|
+import {ElTree} from "element-plus";
|
|
|
+import {getRulesByCode, saveThePersonRoleCode} from "@/api/reports/report-query-center";
|
|
|
+
|
|
|
+const dialog = ref(false)
|
|
|
+const personnelList = ref([])
|
|
|
+const treeRef = useCompRef(ElTree)
|
|
|
+const userCode = ref<string>('')
|
|
|
+
|
|
|
+const personnel = [
|
|
|
+ {label: '编码', prop: 'code', width: 46},
|
|
|
+ {label: '名称', prop: 'name', width: 56},
|
|
|
+ {label: '科室', prop: 'deptName', width: 92},
|
|
|
+ {label: '级别', prop: 'empTitName', width: 105},
|
|
|
+]
|
|
|
+
|
|
|
+const rowClick = (row) => {
|
|
|
+ getRulesByCode(row.code).then((res) => {
|
|
|
+ treeRef.value.setCheckedKeys(res)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const preserve = () => {
|
|
|
+ const halfCheckKeys = treeRef.value.getHalfCheckedKeys()
|
|
|
+ const checkedKeys = treeRef.value.getCheckedKeys()
|
|
|
+ let temp = [...checkedKeys, ...halfCheckKeys]
|
|
|
+ saveThePersonRoleCode({userCode: userCode.value, list: temp})
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getRenYuan('').then(res => {
|
|
|
+ personnelList.value = res
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-button @click="dialog = true">权限设置</el-button>
|
|
|
+ <el-dialog v-model="dialog" title="权限配置">
|
|
|
+ <div style="max-height: 400px ; overflow: auto">
|
|
|
+ 人员:
|
|
|
+ <xc-combo-grid-v2 v-model="userCode"
|
|
|
+ filterable
|
|
|
+ select
|
|
|
+ @rowClick="rowClick"
|
|
|
+ clearable
|
|
|
+ :table-header="personnel"
|
|
|
+ :data="personnelList"/>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <el-button @click="preserve">保存</el-button>
|
|
|
+ <el-divider/>
|
|
|
+ <el-tree :data="dataTree"
|
|
|
+ ref="treeRef"
|
|
|
+ show-checkbox
|
|
|
+ node-key="id"
|
|
|
+ highlight-current
|
|
|
+ default-expand-all>
|
|
|
+ <template #default="{node,data}">
|
|
|
+ <el-icon>
|
|
|
+ <Document v-if="data.type === 0"/>
|
|
|
+ <Folder v-else/>
|
|
|
+ </el-icon>
|
|
|
+ {{ data.name }}
|
|
|
+ </template>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+
|
|
|
+</style>
|