WXL (wul)
4 天以前 70e4d2c33cc2e3af590d1816c0c703da341538cf
src/views/patient/propaganda/index.vue
@@ -373,7 +373,6 @@
          </template>
        </el-table-column> -->
        <el-table-column
          fixed="right"
          label="任务结果记录"
          width="120"
          align="center"
@@ -394,7 +393,6 @@
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="宣教时间"
          sortable
          align="center"
@@ -403,6 +401,17 @@
        >
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.finishtime) }}</span>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" align="center" width="100">
          <template slot-scope="scope">
            <el-button
              size="medium"
              type="text"
              icon="el-icon-view"
              @click="previewTemplate(scope.row)"
              >预览</el-button
            >
          </template>
        </el-table-column>
        <!-- <el-table-column
@@ -557,6 +566,10 @@
        >
      </span>
    </el-dialog>
    <!-- 宣教模板预览 -->
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div v-html="htmlRichText"></div>
    </el-dialog>
  </div>
</template>
@@ -570,10 +583,11 @@
  resetUserPwd,
  changeUserStatus,
} from "@/api/system/user";
import { getTaskservelist } from "@/api/AiCentre/index";
import { getTaskservelist, getlibrarylist } from "@/api/AiCentre/index";
import Treeselect from "@riophae/vue-treeselect";
import store from "@/store";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import axios from "axios";
export default {
  name: "Discharge",
@@ -632,6 +646,8 @@
      inputVisible: false,
      inputValue: "",
      previewVisible: false, //门诊宣教预览弹框
      previewtf: false, //宣教模板预览弹框
      htmlRichText: "", //宣教模板预览富文本
      radio: "",
      radios: [],
      previewtype: 2, //预览门诊宣教类型
@@ -847,8 +863,8 @@
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      this.loading = true;
      console.log(this.topqueryParams.leavehospitaldistrictcodes,'123');
      console.log(this.topqueryParams.leaveldeptcodes,'344');
      console.log(this.topqueryParams.leavehospitaldistrictcodes, "123");
      console.log(this.topqueryParams.leaveldeptcodes, "344");
      if (
        this.topqueryParams.leavehospitaldistrictcodes[0] &&
@@ -878,6 +894,48 @@
    // 查看门诊宣教详情
    Referencequestion(row) {
      this.previewVisible = true;
    },
    // 预览宣教模板(通过 libtemplateid 查询模板信息)
    previewTemplate(row) {
      if (!row.libtemplateid) {
        this.$message.warning("该任务未关联宣教模板");
        return;
      }
      this.htmlRichText = null;
      this.previewtf = true;
      getlibrarylist({ id: row.libtemplateid })
        .then((res) => {
          const tpl = (res.rows && res.rows[0]) || null;
          if (!tpl || !tpl.htmlRichText) {
            this.$message.warning("该模板暂无预览内容");
            return;
          }
          axios
            .get(tpl.htmlRichText)
            .then((response) => {
              this.htmlRichText = response.data;
              this.htmlRichText = this.addStyleToImages(this.htmlRichText);
            })
            .catch(() => {
              this.$message.error("获取模板内容失败");
            });
        })
        .catch(() => {
          this.$message.error("查询模板信息失败");
        });
    },
    // 修复富文本图片路径与样式
    addStyleToImages(html) {
      if (!html) return html;
      let processedHtml = html.replace(
        /\/aifollowup\/aifollowup\//g,
        "/aifollowup/"
      );
      processedHtml = processedHtml.replace(
        /<img([^>]*)style=(['"])(?:(?!\2).)*\2([^>]*)>/g,
        '<img$1style="width:100%;height:auto;"$3>'
      );
      return processedHtml;
    },
    // 添加弹框搜索
    remoteMethod(query) {
@@ -1101,8 +1159,8 @@
<style lang="scss" scoped>
.el-button--primary.is-plain {
  color: #ffffff;
  background: #409eff;
  border-color: #4fabe9;
  background: #5b7cfa;
  border-color: #5b7cfa;
}
.document {
@@ -1227,4 +1285,75 @@
//     font-size: 24px;
//   }
// }
/* ================= 清新高级简约风 ================= */
.app-container {
  background: #f5f7fb;
  border-radius: 14px;
  padding: 20px;
}
/* 查询表单:白色圆角卡片 */
::v-deep .el-form--inline {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px 22px 8px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
/* 隐藏分割线 */
::v-deep .el-divider {
  display: none;
}
/* 工具栏底部间距 */
.mb8 {
  margin-bottom: 18px;
}
/* 按钮:圆角 + 柔和过渡 */
::v-deep .el-button {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
}
/* 主按钮:清新靛蓝 */
::v-deep .el-button--primary:not(.is-plain) {
  background: #5b7cfa;
  border-color: #5b7cfa;
}
::v-deep .el-button--primary:not(.is-plain):hover,
::v-deep .el-button--primary:not(.is-plain):focus {
  background: #7593fb;
  border-color: #7593fb;
}
/* 表格:白色圆角卡片 + 柔和表头 */
::v-deep .el-table {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
::v-deep .el-table::before {
  display: none;
}
::v-deep .el-table th {
  background: #f7f9fd !important;
  color: #3f4d63;
  font-weight: 600;
}
::v-deep .el-table td {
  padding: 12px 0;
}
/* 标签圆角 */
::v-deep .el-tag {
  border-radius: 6px;
}
/* 分页间距 */
::v-deep .pagination-container {
  padding-top: 18px;
}
</style>