|
@@ -12,14 +12,9 @@
|
|
|
<span style="color: red;line-height: 36px;">*</span><span>上级组织共享权限</span>
|
|
<span style="color: red;line-height: 36px;">*</span><span>上级组织共享权限</span>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="org-share-row">
|
|
<div class="org-share-row">
|
|
|
- <el-cascader
|
|
|
|
|
- class="org-picker"
|
|
|
|
|
- :modelValue="superiorValue"
|
|
|
|
|
- @update:modelValue="(val: string[]) => updateSuperiorValue(val)"
|
|
|
|
|
- :options="organTrees"
|
|
|
|
|
- :props="{ checkStrictly: true, label: 'name', value: 'id', disabled: 'disabled' }"
|
|
|
|
|
- placeholder="请选择上级组织"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-select v-model="selectedParentId" placeholder="请选择">
|
|
|
|
|
+ <el-option v-for="item in organTrees" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
<p class="maker">说明:设置共享后,上级组织按所选权限访问案件数据</p>
|
|
<p class="maker">说明:设置共享后,上级组织按所选权限访问案件数据</p>
|
|
|
<div class="org-perm">
|
|
<div class="org-perm">
|
|
@@ -54,10 +49,11 @@
|
|
|
import { computed, onMounted, ref } from "vue";
|
|
import { computed, onMounted, ref } from "vue";
|
|
|
import ShareForm from "./share.vue";
|
|
import ShareForm from "./share.vue";
|
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
|
-import { Organization, getOrganizationTree } from "@/store/organization";
|
|
|
|
|
|
|
+import { Organization } from "@/store/organization";
|
|
|
|
|
+import { user } from "@/store/user";
|
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
|
import { axios } from "@/request";
|
|
import { axios } from "@/request";
|
|
|
-import { sceneDeptShare, shareAuthList } from "@/request/urls";
|
|
|
|
|
|
|
+import { sceneDeptShare, shareAuthList, getHigherLevelDept } from "@/request/urls";
|
|
|
|
|
|
|
|
const props = defineProps<{ caseId: number, projectName?: string }>();
|
|
const props = defineProps<{ caseId: number, projectName?: string }>();
|
|
|
|
|
|
|
@@ -69,33 +65,6 @@ const organTrees = ref<Organization[]>([]);
|
|
|
const selectedParentId = ref<string>("");
|
|
const selectedParentId = ref<string>("");
|
|
|
const orgSharePerm = ref<"none" | "read" | "edit">("none");
|
|
const orgSharePerm = ref<"none" | "read" | "edit">("none");
|
|
|
|
|
|
|
|
-const queryPathById = (
|
|
|
|
|
- id: string,
|
|
|
|
|
- current: Organization[]
|
|
|
|
|
-): string[] | null => {
|
|
|
|
|
- for (const item of current) {
|
|
|
|
|
- if (item.id === id) {
|
|
|
|
|
- return [item.id];
|
|
|
|
|
- } else if (item.children) {
|
|
|
|
|
- const cItem = queryPathById(id, item.children);
|
|
|
|
|
- if (cItem) {
|
|
|
|
|
- return [item.id, ...cItem];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const superiorValue = computed(() => {
|
|
|
|
|
- return selectedParentId.value
|
|
|
|
|
- ? queryPathById(selectedParentId.value, organTrees.value) || []
|
|
|
|
|
- : [];
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-const updateSuperiorValue = (value: string[]) => {
|
|
|
|
|
- selectedParentId.value = value[value.length - 1];
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
// 查看权限
|
|
// 查看权限
|
|
|
const viewScope = ref<"login" | "public">("login");
|
|
const viewScope = ref<"login" | "public">("login");
|
|
|
const shareRef = ref<InstanceType<typeof ShareForm> | null>(null);
|
|
const shareRef = ref<InstanceType<typeof ShareForm> | null>(null);
|
|
@@ -137,7 +106,10 @@ defineExpose<QuiskExpose>({
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
// 预取组织树
|
|
// 预取组织树
|
|
|
- organTrees.value = await getOrganizationTree("1");
|
|
|
|
|
|
|
+ const deptId = user.value.info.deptId;
|
|
|
|
|
+ const res = await axios.get(getHigherLevelDept, { params: { deptId } });
|
|
|
|
|
+ organTrees.value = res.data as any;
|
|
|
|
|
+
|
|
|
// 预取案件共享权限并回显:deptId、isAuth、shareAuth、mapShow
|
|
// 预取案件共享权限并回显:deptId、isAuth、shareAuth、mapShow
|
|
|
try {
|
|
try {
|
|
|
const res: any = await axios.post(shareAuthList, { caseId: props.caseId });
|
|
const res: any = await axios.post(shareAuthList, { caseId: props.caseId });
|
|
@@ -166,17 +138,6 @@ onMounted(async () => {
|
|
|
// 忽略错误,保持默认值
|
|
// 忽略错误,保持默认值
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
-onMounted(async () => {
|
|
|
|
|
- const trees = await getOrganizationTree("1");
|
|
|
|
|
- const changeStatus = (trees: Organization[], fDisabled: boolean = false) =>
|
|
|
|
|
- trees.map((item) => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- disabled: fDisabled,
|
|
|
|
|
- children: item.children && changeStatus(item.children, fDisabled),
|
|
|
|
|
- }));
|
|
|
|
|
- organTrees.value = changeStatus(trees);
|
|
|
|
|
-});
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|