|
|
@@ -54,7 +54,7 @@ import { QuiskExpose } from "@/helper/mount";
|
|
|
import { Organization, getOrganizationTree } from "@/store/organization";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { axios } from "@/request";
|
|
|
-import { sceneDeptShare } from "@/request/urls";
|
|
|
+import { sceneDeptShare, shareAuthList } from "@/request/urls";
|
|
|
|
|
|
const props = defineProps<{ caseId: number, projectName?: string }>();
|
|
|
|
|
|
@@ -129,6 +129,38 @@ defineExpose<QuiskExpose>({
|
|
|
});
|
|
|
|
|
|
onMounted(async () => {
|
|
|
+ // 预取组织树
|
|
|
+ organTrees.value = await getOrganizationTree("1");
|
|
|
+ // 预取案件共享权限并回显:deptId、isAuth、shareAuth、mapShow
|
|
|
+ try {
|
|
|
+ const res: any = await axios.post(shareAuthList, { caseId: props.caseId });
|
|
|
+ const raw = res?.data ?? null;
|
|
|
+ const item = Array.isArray(raw) ? raw[0] : raw;
|
|
|
+ if (item) {
|
|
|
+ if (item.deptId != null) {
|
|
|
+ selectedParentId.value = String(item.deptId || "");
|
|
|
+ }
|
|
|
+ if (item.isAuth != null) {
|
|
|
+ const mapAuth: Record<number, "none" | "read" | "edit"> = {
|
|
|
+ 0: "none",
|
|
|
+ 1: "read",
|
|
|
+ 2: "edit",
|
|
|
+ };
|
|
|
+ orgSharePerm.value = mapAuth[Number(item.isAuth)] ?? "none";
|
|
|
+ }
|
|
|
+ if (item.shareAuth != null) {
|
|
|
+ viewScope.value = Number(item.shareAuth) === 1 ? "public" : "login";
|
|
|
+ }
|
|
|
+ if (item.mapShow != null) {
|
|
|
+ visibleInDashboard.value = Number(item.mapShow) === 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ // 忽略错误,保持默认值
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
const trees = await getOrganizationTree("1");
|
|
|
const changeStatus = (trees: Organization[], fDisabled: boolean = false) =>
|
|
|
trees.map((item) => ({
|