bill 1 éve
szülő
commit
350271d9d1

+ 22 - 19
src/components/base/components/menu-item/index.vue

@@ -1,39 +1,42 @@
 <template>
-  <div 
-    class="ui-menu-item" 
-    :class="{ active }" 
-    ref="self" 
+  <div
+    class="ui-menu-item"
+    :class="{ active }"
+    ref="self"
     v-bind="attr"
-    @mouseenter="emit('enter')" 
+    @mouseenter="emit('enter')"
     @mouseleave="emit('leave')"
-    @click="emit('click')">
-    <UIIcon :type="icon" size="18px" />
+    @click="emit('click')"
+  >
+    <UIIcon :type="icon" size="18px" :class="{ emptyContext: !text }" />
     <span>{{ text }}</span>
     <slot />
   </div>
 </template>
 
 <script setup>
-import UIIcon from '../icon'
-import { ref, useAttrs } from 'vue'
-const attr = useAttrs()
-const self = ref(null)
+import UIIcon from "../icon";
+import { ref, useAttrs } from "vue";
+const attr = useAttrs();
+const self = ref(null);
 const props = defineProps({
   icon: {
     type: String,
-    require: true
+    require: true,
   },
   text: {
     type: String,
-    require: true
+    require: true,
   },
   active: {
-    type: Boolean
-  }
-})
-const emit = defineEmits(['leave', 'enter', 'click'])
+    type: Boolean,
+  },
+});
+const emit = defineEmits(["leave", "enter", "click"]);
 
-defineExpose({ dom: self })
+defineExpose({ dom: self });
 </script>
 
-<script> export default { name: 'ui-menu-item' } </script>
+<script>
+export default { name: "ui-menu-item" };
+</script>

+ 23 - 17
src/views/graphic/header.vue

@@ -53,7 +53,7 @@
     </div>
     <div
       class="meterPerPixel"
-      :class="{noBoxShadow : ! graphicState.showBackImage}"
+      :class="{ noBoxShadow: !graphicState.showBackImage }"
       v-if="currentMeterPerPixel && isRoad"
       :style="{ color: graphicState.showBackImage ? '#fff' : '#16181A' }"
     >
@@ -78,6 +78,7 @@ import { loadData, bus } from "@/hook/useGraphic";
 
 import { dataService } from "@/graphic/Service/DataService";
 import { boxShadow } from "html2canvas/dist/types/css/property-descriptors/box-shadow";
+import { Message } from "@kankan/components/expose-common";
 
 const data = useData();
 const mode = computed(() => Number(router.currentRoute.value.params.mode) as Mode);
@@ -187,21 +188,26 @@ const saveStore = genUseLoading(async () => {
 
 const saveHandler = async () => {
   await saveStore();
-  if (!isRoad.value) {
-    await router.replace({
-      name: isRoad.value ? writeRouteName.roads : writeRouteName.accidents,
-    });
-  } else {
-    if (router.currentRoute.value.params.action === "update") {
-      await loadData(data.value, data.value.id);
-      backImageChang(graphicState.value.showBackImage);
-    } else {
-      await router.replace({
-        name: writeRouteName.graphic,
-        params: { mode: Mode.Road, id: data.value.id, action: "update" },
-      });
-    }
-  }
+  Message.success("保存成功");
+  await router.replace({
+    name: isRoad.value ? writeRouteName.roads : writeRouteName.accidents,
+  });
+
+  // if (!isRoad.value) {
+  //   await router.replace({
+  //     name: isRoad.value ? writeRouteName.roads : writeRouteName.accidents,
+  //   });
+  // } else {
+  //   if (router.currentRoute.value.params.action === "update") {
+  //     await loadData(data.value, data.value.id);
+  //     backImageChang(graphicState.value.showBackImage);
+  //   } else {
+  //     await router.replace({
+  //       name: writeRouteName.graphic,
+  //       params: { mode: Mode.Road, id: data.value.id, action: "update" },
+  //     });
+  //   }
+  // }
 };
 
 const createTable = async () => {
@@ -297,7 +303,7 @@ const createTable = async () => {
   font-weight: 400;
   line-height: 23px;
   text-shadow: 0 0 2px rgb(0 0 0 / 70%);
-  &.noBoxShadow{
+  &.noBoxShadow {
     text-shadow: none;
   }
 }

+ 20 - 7
src/views/roads/index.vue

@@ -4,7 +4,7 @@
       <Header
         :count="selects.length"
         :title="`现场图管理(${sortPhotos.length})`"
-        type="return_l"
+        type="return"
         :on-back="() => onBack()"
       >
         <ui-button
@@ -26,7 +26,7 @@
         </ui-button>
         <template v-slot:center="{ count }">
           <template v-if="count"> 已选择 {{ count }} 张 </template>
-          <div v-else class="filter-type">
+          <!-- <div v-else class="filter-type">
             <span
               :class="{ active: currentType === TypeEnum.Draw }"
               @click="() => (currentType = TypeEnum.Draw)"
@@ -37,18 +37,19 @@
               @click="() => (currentType = TypeEnum.Table)"
               >制表</span
             >
-          </div>
+          </div> -->
         </template>
       </Header>
     </template>
 
+    <!-- :getURL="(data) => data?.table?.url || data.url" -->
     <Photos
       undata-msg="无现场图。请点击右上角按钮绘制现场图。"
       v-model:active="active"
       v-model:selects="selects"
       :select-mode="selectMode"
       :data="sortPhotos"
-      :getURL="(data) => data?.table?.url || data.url"
+      :getURL="(data) => data.url"
     >
       <template v-slot="{ data }">
         <p v-if="currentType === TypeEnum.Table">
@@ -65,8 +66,9 @@
     />
   </MainPanel>
 
+  <!-- :getURL="(data) => data?.table?.url || data.url" -->
   <FillSlide
-    :getURL="(data) => data?.table?.url || data.url"
+    :getURL="(data) => data.url"
     :data="sortPhotos"
     v-model:active="active"
     @quit="active = null"
@@ -107,7 +109,7 @@ const enum TypeEnum {
 const currentType = ref(TypeEnum.Draw);
 const sortPhotos = computed(() =>
   roadPhotos.value
-    .filter((item) => (currentType.value === TypeEnum.Draw ? !item.table : !!item.table))
+    // .filter((item) => (currentType.value === TypeEnum.Draw ? !item.table : !!item.table))
     .reverse()
 );
 const onBack = () => {
@@ -223,7 +225,7 @@ const delSelects = async () => {
 };
 
 const gotoDraw = (road = active.value, forece = false) => {
-  if (forece || road.table) {
+  if (forece) {
     router.push({
       name: writeRouteName.tabulation,
       params: { id: road.id },
@@ -234,6 +236,17 @@ const gotoDraw = (road = active.value, forece = false) => {
       params: { mode: Mode.Road, id: road.id, action: "update" },
     });
   }
+  // if (forece || road.table) {
+  //   router.push({
+  //     name: writeRouteName.tabulation,
+  //     params: { id: road.id },
+  //   });
+  // } else {
+  //   router.push({
+  //     name: writeRouteName.graphic,
+  //     params: { mode: Mode.Road, id: road.id, action: "update" },
+  //   });
+  // }
 };
 
 onDeactivated(() => {

+ 8 - 4
src/views/sys/menu/index.vue

@@ -40,11 +40,11 @@ const emit = defineEmits<{
 }>();
 
 const gotoMenuItem = (item: MenuAtom) => {
-  console.error(item)
+  console.error(item);
   //test
-  if(item['key'] =='structure'){
-    item.onClick()
-    return
+  if (item["key"] == "structure") {
+    item.onClick();
+    return;
   }
 
   if (!props.disabledGoto) {
@@ -100,6 +100,10 @@ const active = computed(() =>
   }
   .ui-menu-item .icon {
     font-size: 20px !important;
+
+    &.emptyContext {
+      font-size: 30px !important;
+    }
   }
 }