浏览代码

修改一部分bug

wangfumin 1 月之前
父节点
当前提交
38c80b9420

+ 1 - 0
src/request/urls.ts

@@ -152,6 +152,7 @@ export const unbindCamera = "/fusion/web/camera/unbind";
 /** ----------------组织架构---------------- */
 
 export const getTreeselect = "/fusion/web/department/treeselect";
+export const getHigherLevelDept = "/fusion/web/department/higherLevel";
 export const delTreeitem = "/fusion/web/department/del/";
 export const editTreeitem = "/fusion/web/department/edit";
 export const addTreeitem = "/fusion/web/department/add";

+ 1 - 0
src/store/user.ts

@@ -37,6 +37,7 @@ export type UserInfo = {
   roleId: string;
   password: string;
   userName: string;
+  roleList: string[];
 };
 
 type Params = Pick<UserInfo, "nickName" | "status" | "userName"> & {

+ 10 - 49
src/view/case/newShare.vue

@@ -12,14 +12,9 @@
         <span style="color: red;line-height: 36px;">*</span><span>上级组织共享权限</span>
       </template>
       <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>
       <p class="maker">说明:设置共享后,上级组织按所选权限访问案件数据</p>
       <div class="org-perm">
@@ -54,10 +49,11 @@
 import { computed, onMounted, ref } from "vue";
 import ShareForm from "./share.vue";
 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 { axios } from "@/request";
-import { sceneDeptShare, shareAuthList } from "@/request/urls";
+import { sceneDeptShare, shareAuthList, getHigherLevelDept } from "@/request/urls";
 
 const props = defineProps<{ caseId: number, projectName?: string }>();
 
@@ -69,33 +65,6 @@ const organTrees = ref<Organization[]>([]);
 const selectedParentId = ref<string>("");
 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 shareRef = ref<InstanceType<typeof ShareForm> | null>(null);
@@ -137,7 +106,10 @@ defineExpose<QuiskExpose>({
 
 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
   try {
     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>
 
 <style scoped lang="scss">

+ 22 - 6
src/view/newFireCase/dyManager/list.vue

@@ -29,8 +29,10 @@ import comPagination from "@/components/pagination/index.vue";
 import { SceneType } from "@/store/scene";
 import { SceneTypeDesc } from "@/constant/scene";
 import { useScenePaggingParams } from "./pagging";
+import { computed, watchEffect } from "vue";
+import { user } from "@/store/user";
 
-defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
+const props = defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
 
 const headOptions = [
   { value: SceneType.SWKK, name: SceneTypeDesc[SceneType.SWKK] },
@@ -41,9 +43,23 @@ const headOptions = [
   { value: SceneType.SWYDMX, name: SceneTypeDesc[SceneType.SWYDMX] },
   // { value: SceneType.SWMX, name: SceneTypeDesc[SceneType.SWMX] },
 ];
-const listOptions = [
-  { name: "场景列表", value: "0" },
-  { name: "场景共享", value: "1" },
-  { name: "全部", value: "2" },
-];
+
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const listOptions = computed(() => {
+  const options = [
+    { name: "场景列表", value: "0" },
+    { name: "场景共享", value: "1" },
+  ];
+  return canShowAll.value ? options.concat({ name: "全部", value: "2" }) : options;
+});
+
+watchEffect(() => {
+  if (!canShowAll.value && props.params.pagging.state.query.searchType === "2") {
+    props.params.pagging.state.query.searchType = "0";
+  }
+});
 </script>

+ 4 - 7
src/view/newFireCase/dyManager/sceneContent.vue

@@ -36,7 +36,7 @@
       {{ QuoteSceneStatusDesc[row.status] }}
     </el-table-column>
     <el-table-column label="所属架构" prop="deptName"></el-table-column>
-    <el-table-column label="操作" v-slot:default="{ row }: { row: QuoteScene }" width="300px">
+    <el-table-column label="操作" v-slot:default="{ row }: { row: QuoteScene }" width="340px">
       <span class="oper-span" @click="downHash(row)">
         Hash
       </span>
@@ -49,15 +49,12 @@
       <span class="oper-span" v-pdpath="['del']" v-if="pagging.state.query.searchType === '0'" @click="genMeshScene(row)">
         权限
       </span>
+      <span class="oper-span" @click="sceneDownloadHandler(row)">
+        下载
+      </span>
       <span class="oper-span delBtn delete-oper" v-pdpath="['del']" @click="delSceneHandler(row)">
         删除
       </span>
-      <span
-        class="oper-span"
-        @click="sceneDownloadHandler(row)"
-      >
-        下载
-      </span>
     </el-table-column>
   </el-table>
 </template>

+ 22 - 6
src/view/newFireCase/meshManager/list.vue

@@ -29,8 +29,10 @@ import comPagination from "@/components/pagination/index.vue";
 import { SceneType } from "@/store/scene";
 import { SceneTypeDesc } from "@/constant/scene";
 import { useScenePaggingParams } from "./pagging";
+import { computed, watchEffect } from "vue";
+import { user } from "@/store/user";
 
-defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
+const props = defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
 
 const headOptions = [
   { value: SceneType.SWKK, name: SceneTypeDesc[SceneType.SWKK] },
@@ -41,9 +43,23 @@ const headOptions = [
   { value: SceneType.SWYDMX, name: SceneTypeDesc[SceneType.SWYDMX] },
   // { value: SceneType.SWMX, name: SceneTypeDesc[SceneType.SWMX] },
 ];
-const listOptions = [
-  { name: "场景列表", value: "0" },
-  { name: "场景共享", value: "1" },
-  { name: "全部", value: "2" },
-];
+
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const listOptions = computed(() => {
+  const options = [
+    { name: "场景列表", value: "0" },
+    { name: "场景共享", value: "1" },
+  ];
+  return canShowAll.value ? options.concat({ name: "全部", value: "2" }) : options;
+});
+
+watchEffect(() => {
+  if (!canShowAll.value && props.params.pagging.state.query.searchType === "2") {
+    props.params.pagging.state.query.searchType = "0";
+  }
+});
 </script>

+ 3 - 6
src/view/newFireCase/meshManager/sceneContent.vue

@@ -49,15 +49,12 @@
       <span class="oper-span" v-pdpath="['edit']" v-if="pagging.state.query.searchType === '0'" @click="genMeshScene(row)">
         权限
       </span>
+      <span class="oper-span" @click="sceneDownloadHandler(row)">
+        下载
+      </span>
       <span class="oper-span delBtn delete-oper" v-pdpath="['del']" @click="delSceneHandler(row)">
         删除
       </span>
-      <span
-        class="oper-span"
-        @click="sceneDownloadHandler(row)"
-      >
-        下载
-      </span>
     </el-table-column>
   </el-table>
 </template>

+ 21 - 6
src/view/newFireCase/mix3dManager/list.vue

@@ -29,12 +29,27 @@ import comPagination from "@/components/pagination/index.vue";
 import { SceneType } from "@/store/scene";
 import { SceneTypeDesc } from "@/constant/scene";
 import { useScenePaggingParams } from "./pagging";
+import { computed, watchEffect } from "vue";
+import { user } from "@/store/user";
 
-defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
+const props = defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();
 
-const listOptions = [
-  { name: "多元融合列表", value: "0" },
-  { name: "多元融合共享", value: "1" },
-  { name: "全部", value: "2" },
-];
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const listOptions = computed(() => {
+  const options = [
+    { name: "多元融合列表", value: "0" },
+    { name: "多元融合共享", value: "1" },
+  ];
+  return canShowAll.value ? options.concat({ name: "全部", value: "2" }) : options;
+});
+
+watchEffect(() => {
+  if (!canShowAll.value && props.params.pagging.state.query.searchType === "2") {
+    props.params.pagging.state.query.searchType = "0";
+  }
+});
 </script>

+ 20 - 2
src/view/newFireCase/newFireDetails/components/otherFiles.vue

@@ -38,7 +38,7 @@
         >
           <div class="file-left" @click="handleView(file)">
             <div class="file-avatar"><img src="@/assets/image/otherFile.png" alt="" /></div>
-            <span class="file-name" :title="file.filesTitle">{{ file.filesTitle || '未命名' }}</span>
+            <span class="file-name" :title="getFileDisplayName(file)">{{ getFileDisplayName(file) }}</span>
           </div>
           <div class="file-actions" v-if="editOrShow === 'edit'">
             <el-tooltip content="重命名" placement="top">
@@ -105,6 +105,24 @@ const validateUpload = async (rawFile: File) => {
   return !!ok;
 };
 
+const getFileExtByUrl = (filesUrl?: string) => {
+  const url = (filesUrl || "").trim();
+  if (!url) return "";
+  const safeUrl = url.split("#")[0].split("?")[0];
+  const fileName = safeUrl.slice(safeUrl.lastIndexOf("/") + 1);
+  const dotIndex = fileName.lastIndexOf(".");
+  if (dotIndex < 0 || dotIndex === fileName.length - 1) return "";
+  return fileName.slice(dotIndex + 1).toLowerCase();
+};
+
+const getFileDisplayName = (file: CaseFile) => {
+  const title = file.filesTitle || "未命名";
+  const ext = getFileExtByUrl(file.filesUrl);
+  if (!ext) return title;
+  if (title.toLowerCase().endsWith(`.${ext}`)) return title;
+  return `${title}.${ext}`;
+};
+
 const refresh = async () => {
   if (!caseId.value || !otherTypeId.value) return;
   files.value = await getCaseFiles({ caseId: caseId.value!, filesTypeId: otherTypeId.value! });
@@ -313,4 +331,4 @@ onMounted(async () => {
 .preview-empty {
   color: #909399;
 }
-</style>
+</style>

+ 1 - 1
src/view/newFireCase/newFireDetails/components/scene.vue

@@ -28,7 +28,7 @@
           >
             <div class="item-main">
               <div class="title" :title="item.title">{{ item.title }}</div>
-              <div class="sub">{{ SceneTypeDesc[item.sceneType] }}</div>
+              <div class="sub">{{[0, 1, 3, 4, 6].includes(item.sceneType) ? 'mesh场景' : '点云场景' }}</div>
             </div>
             <div class="actions" v-show="String(item.sceneNumId) === activeId">
               <el-tooltip content="编辑" v-if="editOrShow === 'edit'">

+ 1 - 1
src/view/newFireCase/newFireDetails/components/screenShot.vue

@@ -344,7 +344,7 @@ const handleDelete = async (file: any) => {
     .empty-tip {
       text-align: center;
       color: #909399;
-      padding: 12px 0;
+      padding: 24px 0;
     }
   }
   .screen-shot {

+ 12 - 7
src/view/newFireCase/newFireDetails/components/siteInspection.vue

@@ -29,7 +29,7 @@
             <div class="content-block">
             <div class="block-header">
               <div class="title">方位图</div>
-              <el-dropdown trigger="click" v-if="editOrShow === 'edit'">
+              <el-dropdown trigger="hover" v-if="editOrShow === 'edit'">
                 <span class="el-dropdown-link plus-btn">
                   <el-icon><Plus /></el-icon>
                 </span>
@@ -76,7 +76,7 @@
             <div class="content-block">
               <div class="block-header">
                 <div class="title">平面图</div>
-                <el-dropdown trigger="click" v-if="editOrShow === 'edit'">
+                <el-dropdown trigger="hover" v-if="editOrShow === 'edit'">
                   <span class="el-dropdown-link plus-btn">
                     <el-icon><Plus /></el-icon>
                   </span>
@@ -1320,6 +1320,9 @@ watch(caseId, () => { loadListsFromTree(); loadAlbum(); });
 }
 
 .content-block {
+  :deep(:focus-visible){
+    outline: none;
+  }
   .block-header {
     display: flex;
     align-items: center;
@@ -1405,7 +1408,7 @@ watch(caseId, () => { loadListsFromTree(); loadAlbum(); });
         display: flex;
         gap: 32px;
         display: none;
-        padding: 8px 0 0 292px;
+        padding: 18px 0 0 292px;
         transition: opacity .2s ease-in-out;
       }
       &.active .header-actions {
@@ -1431,10 +1434,12 @@ watch(caseId, () => { loadListsFromTree(); loadAlbum(); });
   padding-bottom: 20px;
   position: relative;
   .viewer-placeholder {
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    transform: translate(-50%, -50%);
+    width: calc(100% - 48px);
+    height: calc(100% - 48px);
+    background: #F5F5F5;
+    display: flex;
+    align-items: center;
+    justify-content: center;
     color: #909399;
   }
   .scene-image {

+ 21 - 6
src/view/newFireCase/newdispatch/example.vue

@@ -72,7 +72,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, watch } from "vue";
+import { computed, watch, watchEffect } from "vue";
 import comHead from "@/components/head/index.vue";
 import comCompany from "@/components/company-select/index.vue";
 import comPagination from "@/components/pagination/index.vue";
@@ -85,6 +85,7 @@ import { copyCase } from "@/store/case";
 import EditMenuToDetail from "@/view/case/editMenuToDetail.vue";
 import MoreMenu from "@/view/case/moreMenu.vue";
 import { RouteName, router } from "@/router";
+import { user } from "@/store/user";
 
 let { state, refresh, queryReset, del, changPageSize, changPageCurrent } = usePagging({
   get: getExamplePagging,
@@ -101,14 +102,28 @@ queryReset = () => {
   queryResetRaw();
   state.query.searchType = type;
 };
-const head = computed(() => [
-  { name: "案件列表", value: "0" },
-  { name: "案件共享", value: "1" },
-  { name: "全部", value: "2" },
-]);
+
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const head = computed(() => {
+  const options = [
+    { name: "案件列表", value: "0" },
+    { name: "案件共享", value: "1" },
+  ];
+  return canShowAll.value ? options.concat({ name: "全部", value: "2" }) : options;
+});
 watch(() => state.query.searchType, (newVal) => {
   queryReset();
 });
+
+watchEffect(() => {
+  if (!canShowAll.value && state.query.searchType === "2") {
+    state.query.searchType = "0";
+  }
+});
 const addHandler = async () => {
   if (await addExample({})) {
     refresh();

+ 20 - 5
src/view/newFireCase/newdispatch/header.vue

@@ -72,18 +72,33 @@ import { reason, place, fireStatuOptions } from "@/app/fire/constant/fire";
 import comHead from "@/components/head/index.vue";
 import { computed, ref, watchEffect, watch } from "vue";
 import { UN_REQ_NUM } from "@/constant/sys";
+import { user } from "@/store/user";
 
 const props = defineProps<{ pagging: FirePagging; isTeached: boolean }>();
-const head = computed(() => [
-  { name: "火调列表", value: "0" },
-  { name: "火调共享", value: "1" },
-  { name: "全部", value: "2" },
-]);
+
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const head = computed(() => {
+  const options = [
+    { name: "火调列表", value: "0" },
+    { name: "火调共享", value: "1" },
+  ];
+  return canShowAll.value ? options.concat({ name: "全部", value: "2" }) : options;
+});
 
 watch(() => props.pagging.state.query.searchType, (newVal) => {
   console.log(newVal, 666)
   props.pagging.queryReset();
 });
+
+watchEffect(() => {
+  if (!canShowAll.value && props.pagging.state.query.searchType === "2") {
+    props.pagging.state.query.searchType = "0";
+  }
+});
 const projectSite = genCascaderValue(
   computed(() => props.pagging.state.query),
   "projectSite",

+ 17 - 5
src/view/user/index.vue

@@ -93,11 +93,17 @@ import { UserInfo, changeUserStatus, delUser, getUserPagging, user } from "@/sto
 import { ElMessage } from "element-plus";
 import { confirm } from "@/helper/message";
 import { addUser, editUser } from "./quisk";
-import { computed, watch } from "vue";
-const head = computed(() => [
-  { name: "用户列表", value: "0" },
-  { name: "全部", value: "1" },
-]);
+import { computed, watch, watchEffect } from "vue";
+
+const canShowAll = computed(() => {
+  const roleList = user.value.info?.roleList || [];
+  return roleList.includes("admin") || roleList.includes("admin-super");
+});
+
+const head = computed(() => {
+  const options = [{ name: "用户列表", value: "0" }];
+  return canShowAll.value ? options.concat({ name: "全部", value: "1" }) : options;
+});
 let { state, queryReset, refresh, changPageCurrent, changPageSize } = usePagging({
   get: getUserPagging,
   paramsTemlate: {
@@ -118,6 +124,12 @@ queryReset = () => {
 watch(() => state.query.searchType, (newVal) => {
   queryReset();
 });
+
+watchEffect(() => {
+  if (!canShowAll.value && state.query.searchType === "1") {
+    state.query.searchType = "0";
+  }
+});
 const delInfo = async (row: UserInfo) => {
   if (
     await confirm(