bill 1 rok pred
rodič
commit
267cce849a

+ 7 - 3
src/hook/upload.ts

@@ -30,12 +30,16 @@ export const useUpload = <T>(props: UploadProps<T>) => {
   const accept = computed(() =>
     props.formats
       .map((format) => {
-        const index = format.indexOf(".");
-        const ext = ~index ? format.substring(index + 1) : format;
-        return mime.getType(ext) as string;
+        // const index = format.indexOf(".");
+        // const ext = ~index ? format.substring(index + 1) : format;
+        // const extMime = mime.getType(ext);
+        // return (extMime.substring(0, extMime.indexOf("/") + 1) + ext) as string;
+
+        return format;
       })
       .join(", ")
   );
+  console.log(accept);
   const fileRef = ref<File>();
 
   (window as any).fileRef = fileRef;

+ 3 - 1
src/view/case/draw/edit-shape/compass.vue

@@ -10,7 +10,8 @@
       :max="360"
     /> -->
     <el-input-number
-      :model-value="value"
+      :model-value="value || 0"
+      placeholder="0"
       @update:model-value="val => setRotate(val as number, false)"
       :min="0"
       :max="360"
@@ -27,6 +28,7 @@ const emit = defineEmits<{ (e: "blur"): void }>();
 const value = ref<number>(props.shape.data.rotate);
 console.log(props.shape);
 const setRotate = (edg: number, save: boolean) => {
+  edg = edg || 0;
   value.value = edg;
   props.shape.setRotate(edg, save);
 };

+ 4 - 5
src/view/case/draw/index.vue

@@ -76,9 +76,9 @@ const props = computed(() => {
 });
 
 const backPageHandler = () => {
-  board.value && board.value.clear()
-  router.back()
-}
+  board.value && board.value.clear();
+  router.back();
+};
 
 const setBackImage = (blob: Blob) => {
   board.value!.setImage(URL.createObjectURL(blob));
@@ -137,7 +137,6 @@ const saveHandler = async () => {
   args.inAdd || (body.filesId = props.value!.fileId);
 
   const data = await saveCaseFileImageInfo(body);
-  console.log(body)
   if (args.inAdd) {
     router.replace({
       name: RouteName.drawCaseFile,
@@ -147,7 +146,7 @@ const saveHandler = async () => {
 
   await nextTick();
   setTimeout(() => {
-    // location.reload();
+    location.reload();
   }, 100);
 };
 

+ 8 - 6
src/view/case/draw/slider.vue

@@ -90,7 +90,7 @@ import { confirm } from "@/helper/message";
 
 const props = defineProps<{
   type: BoardType;
-  existsBgImage: boolean
+  existsBgImage: boolean;
   addShape: MetaShapeType | null;
 }>();
 
@@ -112,12 +112,14 @@ const cover = reactive(
 );
 
 const coverUploadHandler = async () => {
-  if (props.existsBgImage && await confirm('重新上传将替换当前图体,确定要上传吗?')) {
+  if (props.existsBgImage && (await confirm("重新上传将替换当前图体,确定要上传吗?"))) {
     // await cover.upload(file)
   }
-  const input = document.querySelector('#coverupload')!.querySelector('input[type=file]') as HTMLInputElement
-  input.click()
-}
+  const input = document
+    .querySelector("#coverupload")!
+    .querySelector("input[type=file]") as HTMLInputElement;
+  input.click();
+};
 watchEffect(async () => {
   if (cover.file) {
     const coverImage = (await coverImageSize(cover.file, 540, 390, false)) || cover.file;
@@ -141,7 +143,7 @@ watchEffect(async () => {
   if (imageLabel.file) {
     emit("update:addShape", customImage, imageLabel.file);
     imageLabel.removeFile();
-    ElMessage.info("请前往右边画板选择为止单击添加图例");
+    // ElMessage.info("请前往右边画板选择为止单击添加图例");
   }
 });
 </script>