|
@@ -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;
|