| | |
| | | ><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" |
| | |
| | | <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> |
| | | |
| | |
| | | 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 { |
| | |
| | | haoeducation: "", |
| | | indexid: null, |
| | | inputValue: "", |
| | | richText: "", |
| | | radio: "主分类", |
| | | inputVisible: false, |
| | | previewtf: false, |
| | | illnessVisible: false, //指标疾病弹框 |
| | | deptOptions: [], |
| | | courtyardlist: [], |
| | |
| | | /** 新增按钮操作 */ |
| | | 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 }, |
| | | }); |
| | | }, |
| | | // 查看宣教 |
| | | 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>' |
| | | ); |
| | | }, |
| | | |
| | | /** 删除按钮操作 */ |