WXL
2023-12-28 2ef938e02a1c64c7e7c641d46a2db91e4cdd1b75
src/views/repositoryai/templateku/configurat/index.vue
@@ -29,26 +29,28 @@
          <el-row>
            <el-col :span="12">
              <el-form-item label="模版名称" prop="region">
                <div style="width: 30%">
                  <el-input v-model="ruleForm.name"></el-input>
                <div>
                  <el-input
                    v-model="ruleForm.templateName"
                    placeholder="请输入名称"
                  ></el-input>
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="随访模版分类" prop="region">
                <el-select
                  v-model="ruleForm.classify"
                  v-model="ruleForm.assortid"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    v-for="item in indexAssortlist"
                    :key="item.id"
                    :label="item.indexAssortName"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
@@ -56,28 +58,33 @@
            </el-col>
          </el-row>
          <el-form-item label="模版简介" prop="name">
          <el-form-item label="模版简介" prop="note">
            <div style="width: 50%">
              <el-input type="textarea" v-model="ruleForm.name"></el-input>
              <el-input
                type="textarea"
                placeholder="请输入简介"
                v-model="ruleForm.note"
              ></el-input>
            </div>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="版本号" prop="name">
                <el-input v-model="currentVersion"></el-input> </el-form-item
            <el-col :span="10">
              <el-form-item label="版本号" prop="version">
                <el-input
                  v-model="ruleForm.version"
                  placeholder="默认1.0.1"
                ></el-input> </el-form-item
            ></el-col>
            <el-col :span="9">
            <el-col :span="12">
              <el-form-item label="可用状态" prop="region">
                <el-select
                  v-model="ruleForm.classify"
                  v-model="ruleForm.usestate"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择分类"
                  placeholder="请选择"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in options"
                    v-for="item in usable"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -86,93 +93,34 @@
                </el-select> </el-form-item
            ></el-col>
          </el-row>
          <el-form-item label="通知变量" prop="name">
            <el-row v-for="item in variablelist">
              <el-col :span="4">
                <el-input v-model="item.variable"></el-input>
              </el-col>
              <el-col :span="8" :offset="1">
                <el-input v-model="item.value"></el-input>
              </el-col>
              <el-col :span="4" :offset="1">
                <el-button
                  type="success"
                  icon="el-icon-plus"
                  circle
                  @click="addvariable(item)"
                ></el-button>
                <el-button
                  type="danger"
                  icon="el-icon-delete"
                  circle
                  @click="delvariable(item)"
                ></el-button>
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item label="标签" prop="desc">
            <div class="xinz-inf">
              <el-tag
                :key="tag"
                type="success"
                v-for="tag in dynamicTags"
                closable
                :disable-transitions="false"
                @close="handleClose(tag)"
              >
                {{ tag }}
              </el-tag>
              <el-select
                v-model="inputValue"
                v-if="inputVisible"
                @change="handleInputConfirm"
                filterable
                  allow-create
                  default-first-option
                placeholder="请选择"
              >
                <el-option
                v-for="item in optionstag"
                  :key="item.tagname"
                    :label="item.tagname"
                    :value="item.tagname"
                >
                </el-option>
              </el-select>
              <el-button
                v-else
                class="button-new-tag"
                size="small"
                @click="showInput"
                >+ 新增标签</el-button
              >
            </div>
          </el-form-item>
          <el-row :gutter="20">
            <el-col :span="6">
            <el-col :span="10">
              <el-form-item label="语言" prop="name">
                <el-select
                  v-model="ruleForm.language"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                  placeholder="请选择语言"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in languagelist"
                    :key="item.value"
                    :key="item.label"
                    :label="item.label"
                    :value="item.value"
                    :value="item.label"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
            <el-col :span="9">
              <el-form-item label="播报优先" prop="region">
                <el-radio-group v-model="ruleForm.classify">
                  <el-radio :label="3">语言合成优先</el-radio>
                  <el-radio :label="6">语言文件优先</el-radio>
            <el-col :span="12">
              <el-form-item label="播报优先" prop="playType">
                <el-radio-group v-model="ruleForm.playType">
                  <el-radio
                    v-for="item in precedencetype"
                    :label="item.value"
                    >{{ item.label }}</el-radio
                  >
                </el-radio-group>
              </el-form-item></el-col
            >
@@ -188,7 +136,7 @@
            >
              <el-option
                class="ruleFormaa"
                v-for="item in xjxsoptions"
                v-for="item in mode"
                :key="item.value"
                :label="item.label"
                :value="item.value"
@@ -196,38 +144,103 @@
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="适用疾病" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.illness"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类(多选)"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
          <el-form-item label="标签" prop="desc">
            <div class="xinz-inf">
              <el-tag
                :key="tag.tagname"
                type="success"
                v-for="tag in dynamicTags"
                closable
                :disable-transitions="false"
                @close="handleClosetag(tag)"
              >
              </el-option>
            </el-select>
                {{ tag.tagname }}
              </el-tag>
              <el-select
                v-model="inputValue"
                v-if="inputVisible"
                @change="handleInputConfirm"
                filterable
                remote
                reserve-keyword
                default-first-option
                :remote-method="remoteMethodtag"
                :loading="loading"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in optionstag"
                  :key="item.tagid"
                  :label="item.tagname"
                  :value="item.tagname"
                >
                </el-option>
              </el-select>
              <el-button
                v-else
                class="button-new-tag"
                size="small"
                @click="showInput"
                >+ 新增标签</el-button
              >
            </div>
          </el-form-item>
          <el-form-item label="适用疾病" prop="region">
            <div class="xinz-inf">
              <el-tag
                :key="item.icd10name"
                type="warning"
                v-for="item in illnesslist"
                closable
                :disable-transitions="false"
                @close="handleCloseillness(item)"
              >
                {{ item.icd10name }}
              </el-tag>
              <el-select
                v-model="inputValueillness"
                v-if="inputVisibleillness"
                @change="illnessConfirm"
                :remote-method="remoteMethod"
                filterable
                remote
                allow-create
                default-first-option
                placeholder="请选择/查询"
                :loading="loading"
              >
                <el-option
                  v-for="item in optionsillness"
                  :key="item.icdid"
                  :label="item.icdname"
                  :value="item.icdid"
                >
                </el-option>
              </el-select>
              <el-button
                v-else
                class="button-new-tag"
                size="small"
                @click="inputVisibleillness = true"
                >+ 新增疾病</el-button
              >
            </div>
          </el-form-item>
          <el-form-item label="适用院区" prop="region">
            <el-select
              v-model="ruleForm.courtyard"
              v-model="campusvalue"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                v-for="item in courtyardlist"
                :key="item.label"
                :label="item.label"
                :value="item.value"
                :value="item.label"
              >
              </el-option>
            </el-select>
@@ -235,7 +248,7 @@
          <el-form-item label="适用科室" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.administrative"
              v-model="deptNamesvalue"
              size="medium"
              multiple
              filterable
@@ -243,10 +256,10 @@
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                :key="item.value"
                v-for="item in administrativelist"
                :key="item.label"
                :label="item.label"
                :value="item.value"
                :value="item.label"
              >
              </el-option>
            </el-select>
@@ -254,7 +267,7 @@
          <el-form-item label="通用库" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.way"
              v-model="ruleForm.waya"
              size="medium"
              multiple
              filterable
@@ -262,7 +275,7 @@
            >
              <el-option
                class="ruleFormaa"
                v-for="item in xjxsoptions"
                v-for="item in generallist"
                :key="item.value"
                :label="item.label"
                :value="item.value"
@@ -274,14 +287,14 @@
            <el-col :span="8">
              <el-form-item label="随访前处理" prop="name">
                <el-select
                  v-model="ruleForm.languageq"
                  v-model="ruleForm.prefollowup"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                  placeholder="请选择"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in xjxsoptions"
                    v-for="item in prefollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -292,14 +305,14 @@
            <el-col :span="9">
              <el-form-item label="随访后处理" prop="region">
                <el-select
                  v-model="ruleForm.languageh"
                  v-model="ruleForm.postfollowup"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in xjxsoptions"
                    v-for="item in postfollowuplist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -309,14 +322,14 @@
            ></el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="8">
            <el-col :span="10">
              <el-form-item label="静默时间(秒)" prop="name">
                <div style="width: 40%">
                  <el-input
                    v-model="ruleForm.name"
                  ></el-input></div></el-form-item
            ></el-col>
            <el-col :span="8">
            <el-col :span="10">
              <el-form-item label="无匹配重复(次)" prop="region">
                <div style="width: 40%">
                  <el-input v-model="ruleForm.name"></el-input>
@@ -467,10 +480,10 @@
                <div class="topicxq" v-for="item in 2">
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="处理">
                      ><el-form-item label="选项名">
                        <el-input
                          type="text"
                          placeholder="(默认)无声"
                          placeholder="请输入"
                          v-model="queryParams.text"
                          show-word-limit
                        >
@@ -480,7 +493,7 @@
                      ><el-form-item label="节点ID">
                        <el-input
                          type="text"
                          placeholder="请输入分值"
                          placeholder="请输入节点"
                          v-model="queryParams.text"
                          show-word-limit
                        >
@@ -489,10 +502,10 @@
                  </el-row>
                  <el-row :gutter="10">
                    <el-col :span="12"
                      ><el-form-item label="选中提示">
                      ><el-form-item label="处理">
                        <el-input
                          type="text"
                          placeholder="请输入内容"
                          placeholder="(默认)无声"
                          v-model="queryParams.text"
                          maxlength="10"
                          show-word-limit
@@ -503,14 +516,14 @@
                      ><el-form-item label="选中跳转">
                        <el-input
                          type="text"
                          placeholder="请输入题号"
                          placeholder="请输入题目节点"
                          v-model="queryParams.text"
                          show-word-limit
                        >
                        </el-input> </el-form-item
                    ></el-col>
                  </el-row>
                  <el-form-item label="语音文本">
                  <el-form-item label="匹配正则">
                    <el-input
                      style="width: 24vw"
                      type="textarea"
@@ -640,13 +653,11 @@
            <el-select
              v-model="ruleForm.classify"
              size="medium"
              multiple
              filterable
              placeholder="请选择分类"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in options"
                v-for="item in themelist"
                :key="item.value"
                :label="item.label"
                :value="item.value"
@@ -708,91 +719,76 @@
<script>
import { listtag } from "@/api/system/label";
import store from "@/store";
import {
  getFollowupclassify,
  delFollowupclassify,
  addFollowupclassify,
  addtargetillness,
  getvFollowup,
  compileFollowup,
  delFollowupinfo,
  Followupinfo,
  getFollowuplist,
  getillnesslist,
  illnesslistget,
  getillness,
} from "@/api/AiCentre/index";
export default {
  data() {
    return {
      sidecolumnrabs: "left", //方向
      Editprogress: 2, //编辑进度
      currentVersion: "1.2.3", //当前版本
      Editprogress: 1, //编辑进度
      loading: false, // 遮罩层
      drawer: false, //控制展开
      radio: "false", //单选题选中
      radios: [], //多选题选中
      radioas: "", //填空题答案
      dynamicTags: ["标签一", "标签二", "标签三"],
      inputVisible: false,
      campusvalue: [], //院区临时存储
      labelInfovalue: [], //标签临时存储
      deptNamesvalue: [], //科室临时存储
      dynamicTags: [],
      indexAssortlist: [],
      inputValue: "",
      inputValueillness: "",
      topicobj: {},
      // 总条数
      total: 1,
      ruleForm: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
        templatevalue: "",
        data2: "",
      },
      id: "",
      ruleForm: {},
      rules: {},
      rulesa: {},
      optionstag:[],
      xjxsoptions: [
        {
          value: "选项1",
          label: "图文",
        },
        {
          value: "选项2",
          label: "视频",
        },
        {
          value: "选项3",
          label: "音频",
        },
      ],
      optionstag: [],
      prefollowuplist: [],
      postfollowuplist: [],
      generallist: [{ value: "1", label: "随访通用库一" }],
      fileList: [
        {
          name: "food.jpeg",
          url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
        },
      ],
      options: [
        {
          value: "选项1",
          label: "疾病随访模版",
        },
        {
          value: "选项2",
          label: "入院随访模版",
        },
        {
          value: "选项3",
          label: "手术随访模版",
        },
        {
          value: "选项4",
          label: "护理随访模版",
        },
      administrativelist: [
        { value: "1", label: "心外科" },
        { value: "2", label: "心内科" },
      ],
      languagelist: [
        {
          value: "1",
          label: "普通话",
        },
        {
          value: "2",
          label: "粤语",
        },
        {
          value: "3",
          label: "英文",
        },
      ],
      themelist: [],
      languagelist: [],
      courtyardlist: [],
      precedencetype: [],
      usable: [],
      mode: [],
      inputVisible: false,
      inputVisibleillness: false,
      illnessVisible: false, //指标疾病弹框
      deptOptions: [],
      optionsillness: [],
      illnesslistapi: [],
      illnesslist: [],
      defaultProps: {
        children: "ivrLibaTemplateAssortList",
        label: "indexAssortName",
      },
      variablelist: [
        {
          variable: "paitent",
@@ -846,19 +842,59 @@
  created() {
    this.gettabList();
    this.getvFollowup();
    this.auxiliary();
    this.mode = store.getters.mode;
    this.usable = store.getters.usable;
    this.languagelist = store.getters.languagelist;
    this.courtyardlist = store.getters.courtyardlist;
    this.precedencetype = store.getters.precedencetype;
  },
  methods: {
    getIndexInArray(arr, obj) {
      return arr.indexOf(obj);
    },
    // 获取表单数据
    getvFollowup() {
      this.id = this.$route.query.id;
      getvFollowup({ id: this.id }).then((res) => {
        this.ruleForm = res.data;
      });
      getillnesslist({
        pageNum: 1,
        pageSize: 100,
      }).then((response) => {
        this.optionsillness = response.rows;
      });
      getillness({ outid: this.id, type: 3 }).then((res) => {
        this.illnesslist = res.rows;
      });
    },
    // 附属数据表
    auxiliary() {
      // 分类
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
      });
      // 疾病列
    },
    submitForm(formName) {
      this.rules = this.rulesa;
      if (this.ruleForm.id) {
        this.ruleForm.isoperation = 2;
      } else {
        this.ruleForm.isoperation = 2;
      }
      this.ruleForm.campus = JSON.stringify(this.illnesslist);
      this.ruleForm.deptNames = this.deptNamesvalue.join(",");
      this.ruleForm.labelInfo = JSON.stringify(this.dynamicTags);
      //   提交
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
          compileFollowup(this.ruleForm).then((res) => {
            this.$modal.msgSuccess("修改成功");
          });
        } else {
          console.log("error submit!!");
          return false;
@@ -910,22 +946,7 @@
    },
    // 修改题目信息
    Submittopicobj() {},
    // 新增变量
    addvariable() {
      this.variablelist.push({
        variable: "",
        value: "",
      });
    },
    // 删除变量
    delvariable(item) {
      const index = this.variablelist.indexOf(item);
      if (index !== -1) {
        this.variablelist.splice(index, 1); // 从索引位置删除一个元素
      } else {
        console.log("未找到该对象");
      }
    },
    // 控制文件
    handleChange(file, fileList) {
      this.fileList = fileList.slice(-3);
@@ -950,23 +971,54 @@
        this.optionstag = response.rows;
      });
    },
    handleClose(tag) {
    handleClosetag(tag) {
      console.log(tag);
      console.log(this.dynamicTags.indexOf(tag));
      const lindex = this.dynamicTags.indexOf(tag);
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      this.ruleForm.ivrLibaTemplateTargetList[lindex].isoperation = 3;
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      let tagvalue = {};
      let tagname = this.inputValue;
      if (tagname) {
        listtag({
          pageNum: 1,
          pageSize: 1000,
          tagcategoryid: "0",
          tagname: tagname,
        }).then((res) => {
          if (res.rows[0]) {
            tagvalue = res.rows[0];
            tagvalue.isoperation = 1;
          } else {
            tagvalue = {
              tagname: tagname,
              isoperation: 1,
            };
          }
          this.ruleForm.ivrLibaTemplateTargetList.push(tagvalue);
          this.dynamicTags.push(tagvalue);
        });
      }
      this.inputVisible = false;
      this.inputValue = "";
    },
    remoteMethodtag(query) {
      if (query !== "") {
        this.loading = true;
        setTimeout(() => {
          this.loading = false;
          listtag({ tagname: query, tagcategoryid: "0" }).then((res) => {
            this.optionstag = res.rows;
          });
        }, 200);
      } else {
        this.optionstag = [];
      }
    },
    showInput() {
      this.inputVisible = true;
      // 自动获取焦点
      // this.$nextTick((_) => {
      //   this.$refs.saveTagInput.$refs.input.focus();
      // });
    },
    //测试表单 ---------------------------------
    addzbiao() {},
@@ -1009,6 +1061,61 @@
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    // 疾病-----------------------
    handleCloseillness(tag) {
      this.illnesslist.splice(this.illnesslist.indexOf(tag), 1);
      if (tag.id) {
        this.illnesslistapi.push(tag.id);
      }
    },
    remoteMethod(value) {
      console.log(value);
      const illnessqueryParams = {
        pageNum: 1,
        pageSize: 100,
        icdname: value,
      };
      this.loading = true;
      setTimeout(() => {
        this.loading = false;
        getillnesslist(illnessqueryParams).then((response) => {
          this.optionsillness = response.rows;
        });
      }, 200);
    },
    illnessConfirm(item) {
      let opeavalue = {};
      let tagname = this.inputValueillness;
      illnesslistget(item).then((res) => {
        opeavalue = res.data;
        opeavalue.outid = this.id;
        opeavalue.type = 3;
        opeavalue.icd10id = opeavalue.icdid;
        opeavalue.icd10name = opeavalue.icdname;
        opeavalue.icd10code = opeavalue.icdcode;
        if (tagname) {
          this.illnesslist.push(opeavalue);
        }
      });
      console.log(this.illnesslist);
      this.inputVisibleillness = false;
      this.inputValueillness = "";
    },
    // 保存
    confirmillness() {
      this.illnesslist.forEach((item, index) => {
        if (!item.id) {
          addtargetillness(item).then((res) => {});
        }
      });
      if (this.illnesslistapi.length) {
        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
      }
      this.illnessVisible = false;
      this.$modal.msgSuccess("编辑成功");
    },
  },
};
</script>
@@ -1018,7 +1125,7 @@
  display: flex;
}
.sidecolumn {
  width: 300px;
  width: 250px;
  min-height: 100vh;
  text-align: center;
  //   display: flex;