From 37e5dc2b41fe3f79a4f45e82eba4c3b05bedd293 Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期四, 06 六月 2024 18:38:27 +0800 Subject: [PATCH] 优化 --- src/books/lifeCare/view/chapter006.vue | 122 +++++++++++++++++++++++++++++++++++----- 1 files changed, 107 insertions(+), 15 deletions(-) diff --git a/src/books/lifeCare/view/chapter006.vue b/src/books/lifeCare/view/chapter006.vue index 493e372..28a3456 100644 --- a/src/books/lifeCare/view/chapter006.vue +++ b/src/books/lifeCare/view/chapter006.vue @@ -139,11 +139,11 @@ <p>鏍规嵁浠ヤ笂鎯呭锛岃灏忕粍璁ㄨ姘翠笌濠村辜鍎跨殑鍋ュ悍鏈変粈涔堝叧绯汇��</p> <div class="bk-tx"> <textarea - v-model="chapter006.textAreaItem.text1" + v-model="chapter006.textAreaItem.text1111" style="border: 0" placeholder="璇疯緭鍏ュ唴瀹�" rows="5" - @blur="onBlurChange('text1')" + @blur="onBlurChange('text1111')" ></textarea> </div> <h4 id="d063"> @@ -600,7 +600,7 @@ </div> </div> <div class="bodystyle"> - <p> + <!-- <p> 1.鏍规嵁浠ヤ笂鎯呭锛岄拡瀵规煇涓�骞撮緞娈碉紝浠ュ皬缁勫悎浣滅殑鏂瑰紡鍏卞悓璁捐涓�涓富棰樺楗帮紝浣垮┐骞煎効鑳藉叿浣撱�佺洿瑙傚湴鐪嬪埌鑷繁鐨勯ギ姘撮噺锛屽悓鏃朵篃渚夸簬鎵樿偛鍥搷浣溿�傚湪涓嬫柟鐢诲嚭璁捐鑽夊浘锛屽苟鍒朵綔瀹屾垚銆� </p> <div class="bk-tx"> @@ -611,6 +611,54 @@ rows="5" @blur="onBlurChange('text17')" ></textarea> + </div> --> + <p class="pic-wall chapter-006"> + <span + >1.鏍规嵁浠ヤ笂鎯呭锛岄拡瀵规煇涓�骞撮緞娈碉紝浠ュ皬缁勫悎浣滅殑鏂瑰紡鍏卞悓璁捐涓�涓富棰樺楗帮紝浣垮┐骞煎効鑳藉叿浣撱�佺洿瑙傚湴鐪嬪埌鑷繁鐨勯ギ姘撮噺锛屽悓鏃朵篃渚夸簬鎵樿偛鍥搷浣溿�傚湪涓嬫柟鐢诲嚭璁捐鑽夊浘锛屽苟鍒朵綔瀹屾垚銆�</span + > + <span class="btnUpload-list btn" @click="handFile('fileThree')"> + <svg + t="1717059899765" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="2633" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="18" + height="18" + > + <path + d="M256.111993 608.601962c61.628148 0 122.808324 17.790888 183.220549 52.796701 88.122492-119.67252 198.387601-180.788701 328.747453-180.788701 80.122992 0 142.071121 0 191.860009 41.213424V217.522405C959.940004 168.181489 919.750516 127.992 870.345603 127.992h-716.755202A89.5944 89.5944 0 0 0 63.996 217.586401v489.569402c47.165052-64.95594 111.929004-98.489844 192.179989-98.489845z m95.994-159.99a95.994 95.994 0 1 0 0-191.988001 95.994 95.994 0 0 0 0 191.988001z m0 63.996a159.990001 159.990001 0 1 1 0-319.980001 159.990001 159.990001 0 0 1 0 319.980001zM1023.936004 619.097306a254.448097 254.448097 0 0 0-112.63296-41.469408c-38.909568-33.021936-81.27492-33.021936-143.223049-33.021936-116.664708 0-213.682645 58.23636-293.357665 177.716893l-17.726892 26.622336-26.622336-17.726892c-58.940316-39.293544-116.920692-58.620336-174.261109-58.620336-72.699456 0-125.880132 53.564652-163.317793 128.439972l-14.335104 28.606212-14.207112-7.103556A89.5944 89.5944 0 0 0 153.590401 905.031436h425.893381c6.783576 22.782576 16.63896 44.285232 29.182176 63.996H153.590401a153.590401 153.590401 0 0 1-153.590401-153.590401V217.586401A153.590401 153.590401 0 0 1 153.590401 63.996h716.691206A153.654397 153.654397 0 0 1 1023.936004 217.586401v401.510905z" + p-id="2634" + ></path> + <path + d="M796.366227 796.430223v-142.199112a28.414224 28.414224 0 0 1 56.892444 0v142.199112h142.199113a28.414224 28.414224 0 0 1 0 56.828448h-142.199113v142.263109a28.414224 28.414224 0 0 1-56.95644 0v-142.263109h-142.135116a28.414224 28.414224 0 0 1 0-56.828448h142.199112z" + p-id="2635" + ></path> + </svg> + </span> + </p> + <div class="bk-tx"> + <div + class="upload-list" + v-if="chapter006.pictrueListThree.length > 0" + > + <div + class="demo-image__preview openImgBox" + v-for="item in chapter006.pictrueListThree" + :key="item" + > + <img style="height: 100%" :src="item" alt="" /> + </div> + </div> + <div class="bk-inputUpload"> + <input + type="file" + id="fileThree" + @change="handUploadFile($event, '3')" + /> + </div> </div> <p> 2.妯℃嫙婕旂粌銆傛敹闆嗛ギ姘村仴搴锋暀鑲茬殑绱犳潗锛屽鍎挎瓕銆佹晠浜嬨�佺粯鏈�佹瓕鏇茬瓑锛岄�夊彇鏌愬勾榫勬锛�6锝�12鏈堛��1锝�2宀併��2锝�3宀侊級锛岄拡瀵瑰┐骞煎効涓诲姩鍠濇按鏂归潰鐨勬煇涓�闂锛屽皬缁勫悎浣滄ā鎷熻繘琛岄ギ姘村仴搴锋暀鑲诧紝缁勫唴鎴愬憳杩涜鐐硅瘎锛屽啓鍑烘敼杩涙帾鏂姐�� @@ -863,10 +911,7 @@ <tr> <th :style="{ - width: - index == 1 || index == chapter006.groupData.length - 1 - ? '100px' - : '', + width: index == 3 ? '300px' : '', }" v-for="(header, index) in chapter006.publicHeader" :key="index" @@ -1107,11 +1152,7 @@ <tr> <th :style="{ - width: - index == 1 || - index == chapter006.scoreData1.length - 1 - ? '100px' - : '', + width: index == 3 ? '300px' : '50px', }" v-for="(header, index) in chapter006.publicHeader" :key="index" @@ -1131,7 +1172,7 @@ type="text" v-model="chapter006.scoreData1[rowIndex][cellIndex]" @blur=" - updateCellGroup( + updateCellGroup1( rowIndex, cellIndex, $event.target.value @@ -1144,7 +1185,7 @@ type="text" v-model="chapter006.scoreData1[rowIndex][cellIndex]" @blur=" - updateCellGroup( + updateCellGroup1( rowIndex, cellIndex, $event.target.value @@ -1309,6 +1350,7 @@ <script> import { getResourcePath } from "@/assets/methods/resources.js"; import examinations from "@/components/examinations/index.vue"; +import { getFileMd5, getPublicImage } from "../js/tool.js"; export default { // eslint-disable-next-line vue/multi-word-component-names @@ -1336,6 +1378,7 @@ idOpenThree: true, isScore1Open: true, qustionData: {}, + pictrueListThree: [], // 鍑嗗楗按鐗╁搧鐨勮瘎鍒嗘爣鍑� publicHeader: ["搴忓彿", "鑰冩牳鍐呭", "閰嶅垎", "璇勫垎鏍囧噯", "鎵e垎", "寰楀垎"], groupData: [ @@ -1512,12 +1555,25 @@ } localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); }, + updateCellGroup1(rowIndex, cellIndex, value) { + // 鏇存柊鍗曞厓鏍兼暟鎹� + this.$set(this.chapter006.scoreData1[rowIndex], cellIndex, value); + if (cellIndex == 4) { + this.$set( + this.chapter006.scoreData1[rowIndex], + 5, + this.chapter006.scoreData1[rowIndex][2] - + this.chapter006.scoreData1[rowIndex][cellIndex] + ); + } + localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); + }, updateCell(rowIndex, cellIndex, value) { // 鏇存柊鍗曞厓鏍兼暟鎹� this.$set(this.chapter006.tableData161[rowIndex], cellIndex, value); localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); }, - updateCell162(rowIndex, cellIndex, value) { + updateCell162() { // 鏇存柊鍗曞厓鏍兼暟鎹� localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); }, @@ -1527,6 +1583,42 @@ onRadioText() { localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); }, + handUploadFile(e, type) { + console.log(type); + var that = this; + const file = e.target.files[0]; + const FileName = file.name.split(".")[0]; + const Extension = file.name.split(".")[1]; + const FileType = file.type; + let size = 1024; + getFileMd5(file, size * 1024) + .then((e) => { + const imgData = new FormData(); + imgData.append("Md5", e); + imgData.append("FileName", FileName); + imgData.append("Extension", Extension); + imgData.append("FileType", FileType); + imgData.append("MetaData", null); + imgData.append("file", file); + that.MG.file.upload(imgData).then(() => {}); + setTimeout(() => { + that.chapter006.pictrueListThree.push(getPublicImage(e)); + that.isLoding = false; + this.$emit("Upload_initViewer", ""); + localStorage.setItem("chapter006", JSON.stringify(this.chapter006)); + }, 1000); + }) + .catch((e) => { + that.isLoding = false; + console.error(e); + }); + }, + handFile(str) { + let dom = (this.container ? this.container : document).getElementById( + str + ); + dom.click(); + }, }, }; </script> -- Gitblit v1.9.1