jinx 1 năm trước cách đây
mục cha
commit
bfcb027526

+ 1 - 1
src/views/tables/ask.vue

@@ -151,7 +151,7 @@
         </div>
       </div>
     </div>
-    <div class="bottom-name" v-show="!isWrite">
+    <div v-if="page <= 1" class="bottom-name" v-show="!isWrite">
       <span v-if="type == '1'">被询问人:</span>
       <span v-else>被讯问人:</span>
       <div style="flex: 1">

+ 12 - 5
src/views/tables/explorate-two.vue

@@ -43,14 +43,16 @@
           </div>
           <div class="item column">
             <span>伤亡人员去向:</span>
-            <div style="height: 60px; width: 100%">
-              <textarea v-model="data.hurtDieGo" name="" id="" cols="30" rows="10"></textarea>
+            <div style="min-height: 60px; width: 100%">
+              <textarea style="height: 60px;" v-model="data.hurtDieGo" name="" id="" cols="30" rows="10"></textarea>
+              <div class="content-box top-left">{{ data.hurtDieGo }}</div>
             </div>
           </div>
           <div class="item column">
             <span>其他需求说明的情况:</span>
-            <div style="height: 60px; width: 100%">
-              <textarea v-model="data.desc" name="" id="" cols="30" rows="10"></textarea>
+            <div style="min-height: 60px; width: 100%">
+              <textarea style="height: 60px;" v-model="data.desc" name="" id="" cols="30" rows="10"></textarea>
+              <div class="content-box top-left">{{ data.desc }}</div>
             </div>
           </div>
           <p>(二)救援简要情况:</p>
@@ -257,6 +259,10 @@ div[contenteditable] {
   &.left {
     justify-content: flex-start;
   }
+  &.top-left {
+    align-items: flex-start;
+    justify-content: flex-start;
+  }
 }
 .explorate {
   color: #000;
@@ -266,7 +272,8 @@ div[contenteditable] {
 
   font-family: sr, st;
   &.downMode {
-    input {
+    input,
+    textarea {
       display: none;
     }
     .content-box {

+ 1 - 1
src/views/tables/index.vue

@@ -181,7 +181,7 @@ const getLayoutImage = async () => {
         return canvas.toBlob(resolve, "image/jpeg", 0.95);
       });
       await downloadImage(blob, `tables_${index}.jpg`);
-      Message.success({ msg: "已保存至相册", time: 2000 });
+            Message.success({ msg: "已保存至相册", time: 2000 });
       num++;
 
       if (num == eleList.value.length) {

+ 60 - 9
src/views/tables/write/doc.vue

@@ -17,21 +17,31 @@
     </div>
   </div>
 
-  <div class="bottom-name">
+  <div class="bottom-name" :class="{ downMode }" v-if="data">
     <span v-if="type == '1'">被询问人:</span>
     <span v-else>被讯问人:</span>
-    <div style="flex: 1" contenteditable></div>
+    <div style="flex: 1">
+      <input type="text" v-model="data.askerBys" />
+      <div class="content-box left">{{ data.askerBys }}</div>
+    </div>
   </div>
 </template>
 
 <script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, defineProps, defineEmits } from 'vue';
-import { router } from '@/router';
-
+import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, defineProps, defineEmits } from "vue";
+import { router } from "@/router";
+import { tables } from "@/store/tables";
+import { tablesInfo, setData } from "../data";
+const data = ref(null);
 const props = defineProps({
+  downMode: {
+    type: Boolean,
+    default: false,
+  },
+  isDownloadShow: { type: Boolean, default: false },
   text: {
     type: String,
-    default: '',
+    default: "",
   },
   page: {
     type: Number,
@@ -42,12 +52,13 @@ const props = defineProps({
     default: 1,
   },
 });
-const emits = defineEmits(['goWrite']);
+
+const emits = defineEmits(["goWrite"]);
 const type = ref(router.currentRoute.value.query.type);
 const lineCount = ref(1);
 const inputHeight = ref(0);
 const getLineCount = () => {
-  let containerH = document.getElementById('view-container').clientHeight;
+  let containerH = document.getElementById("view-container").clientHeight;
   let count = Math.floor(containerH / 40);
   lineCount.value = count;
   inputHeight.value = count * 40;
@@ -57,15 +68,44 @@ const getLineCount = () => {
 const goWrite = () => {
   let text = window.getSelection();
   let textIndex = text.anchorOffset;
-  emits('goWrite', { textIndex });
+  emits("goWrite", { textIndex });
 };
 
 onMounted(async () => {
   await nextTick();
   getLineCount();
+
+  if (props.isDownloadShow) {
+  } else {
+    if (type.value == "1") {
+      setData("askOne");
+    } else {
+      setData("askTwo");
+    }
+  }
+  if (type.value == "1") {
+    if (tablesInfo.askOne) {
+      data.value = tablesInfo.askOne;
+    }
+  } else {
+    if (tablesInfo.askTwo) {
+      data.value = tablesInfo.askTwo;
+    }
+    console.error(tablesInfo);
+  }
 });
 </script>
 <style lang="scss" scoped>
+.content-box {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  &.left {
+    justify-content: flex-start;
+  }
+}
 div[contenteditable] {
   outline: none;
 }
@@ -77,6 +117,17 @@ div[contenteditable] {
   display: flex;
   font-size: 24px;
   font-family: SimSun-Regular, SimSun;
+  .content-box {
+    display: none;
+  }
+  &.downMode {
+    input {
+      display: none;
+    }
+    .content-box {
+      display: flex;
+    }
+  }
 }
 .num-box {
   display: flex;