From c73a2c380aca7ac4ef16e76388b1a52356df8634 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期五, 30 八月 2024 19:01:04 +0800 Subject: [PATCH] 测试完成 --- src/views/knowledge/education/index.vue | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/views/knowledge/education/index.vue b/src/views/knowledge/education/index.vue index ec87876..9216623 100644 --- a/src/views/knowledge/education/index.vue +++ b/src/views/knowledge/education/index.vue @@ -183,6 +183,7 @@ label="鏍囬" fixed align="center" + width="150" key="preachname" prop="preachname" :show-overflow-tooltip="true" @@ -197,6 +198,7 @@ <el-table-column label="涓昏鍐呭" align="center" + width="260" key="preachcontent" prop="preachcontent" :show-overflow-tooltip="true" @@ -310,15 +312,15 @@ ><i class="el-icon-edit"></i>浜岀淮鐮�</span ></el-button > --> - <!-- <el-button + <el-button size="medium" type="text" @click="Vieweducation(scope.row)" v-hasPermi="['system:user:edit']" ><span class="button-textck" - ><i class="el-icon-edit"></i>鏌ョ湅</span + ><i class="el-icon-edit"></i>棰勮</span ></el-button - > --> + > <el-button size="medium" type="text" @@ -442,6 +444,16 @@ <div class="qrcode-img"></div> </div> </el-dialog> + <el-dialog title="妯$増棰勮" :visible.sync="previewtf" width="60%"> + <div class="preview-left"> + <!-- 鍗曢�� --> + <div v-html="richText"></div> + </div> + <!-- <span slot="footer" class="dialog-footer"> + <el-button @click="previewGo">鍓嶅線妯$増璇︽儏淇敼</el-button> + <el-button type="primary" @click="previewFn">纭浣跨敤</el-button> + </span> --> + </el-dialog> </div> </template> @@ -463,7 +475,7 @@ import { listDept } from "@/api/system/dept"; import { getToken } from "@/utils/auth"; import store from "@/store"; - +import axios from "axios"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { @@ -489,8 +501,10 @@ haoeducation: "", indexid: null, inputValue: "", + richText: "", radio: "涓诲垎绫�", inputVisible: false, + previewtf: false, illnessVisible: false, //鎸囨爣鐤剧梾寮规 deptOptions: [], courtyardlist: [], @@ -626,22 +640,37 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.$router.push({ - path: "/knowledge/education/compilequer/", + path: "/knowledge/educationinfo/", }); }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.$router.push({ - path: "/knowledge/education/compilequer/", + path: "/knowledge/educationinfo/", query: { id: row.id }, }); }, // 鏌ョ湅瀹f暀 - Vieweducation() { - this.$router.push({ - path: "/knowledge/education/examine/", - query: { id: row.id }, - }); + Vieweducation(row) { + this.richText = null; + this.previewtf = true; + axios + .get(row.richText) + .then((response) => { + console.log(response.data, "鏁版嵁"); // 杈撳嚭鑾峰彇鍒扮殑鏂囦欢鍐呭 + this.richText = response.data; + this.richText = this.addStyleToImages(this.richText); + }) + .catch((error) => { + this.$modal.msgError("鑾峰彇瀵屾枃鏈け璐�"); + console.error("Failed to fetch file:", error); + }); + }, + addStyleToImages(html) { + return html.replace( + /<img([^>]*)style=(['"])(?:(?!\2).)*\2([^>]*)>/g, + '<img$1style="width:100%;height:auto;"$3>' + ); }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ @@ -702,6 +731,7 @@ } else { return this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�"); } + this.classifyform.hetype = 1; addheLibraryAssort(this.classifyform).then((res) => { this.getDeptTree(); this.$modal.msgSuccess("鏂板鎴愬姛"); -- Gitblit v1.9.3