WXL
2024-06-17 43988e7dae93378116a8c5f1fc76f5568d8fd4b2
src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -154,40 +154,46 @@
              >
            </div>
          </el-form-item>
          <el-form-item label="通知变量" prop="name">
            <div style="margin-bottom: 5px" v-for="item in variablelist">
              <el-row>
                <el-col :span="5">
                  <el-input
                    v-model="item.variatename"
                    placeholder="请输入变量名"
                  ></el-input>
                </el-col>
                <el-col :span="8" :offset="1">
                  <el-input
                    v-model="item.variate"
                    placeholder="请输入变量内容"
                  ></el-input>
                </el-col>
                <el-col :span="8" :offset="1">
                  <el-button
                    type="success"
                    icon="el-icon-plus"
                    circle
                    @click="addvariable(item)"
                  ></el-button>
                  <el-button
                    v-if="!item.default"
                    type="danger"
                    icon="el-icon-delete"
                    circle
                    @click="delvariable(item)"
                  ></el-button>
                </el-col>
              </el-row>
            </div>
          </el-form-item>
          <el-drawer
            title="变量编辑"
            :visible.sync="variabledeawer"
            direction="ttb"
            size="35%"
          >
            <el-form-item label="通知变量" prop="name">
              <div style="margin-bottom: 5px" v-for="item in variablelist">
                <el-row>
                  <el-col :span="5">
                    <el-input
                      v-model="item.variatename"
                      placeholder="请输入变量名"
                    ></el-input>
                  </el-col>
                  <el-col :span="8" :offset="1">
                    <el-input
                      v-model="item.variate"
                      placeholder="请输入变量内容"
                    ></el-input>
                  </el-col>
                  <el-col :span="8" :offset="1">
                    <el-button
                      type="success"
                      icon="el-icon-plus"
                      circle
                      @click="addvariable(item)"
                    ></el-button>
                    <el-button
                      v-if="!item.default"
                      type="danger"
                      icon="el-icon-delete"
                      circle
                      @click="delvariable(item)"
                    ></el-button>
                  </el-col>
                </el-row>
              </div>
            </el-form-item>
          </el-drawer>
          <el-row>
            <el-col :span="6">
              <el-form-item label="仅限院区" prop="region">
@@ -250,30 +256,33 @@
          </el-row>
          <el-row>
            <el-col :span="24">
              <div
                style="display: flex; margin-left: 100px; margin-bottom: 10px"
              >
                <div
                  v-for="item in variablelist"
                  class="tsgname"
                  @click="tsgnameto(item)"
                >
                  {{ item.variatename }}
              <el-form-item label="问题变量" prop="questionText">
                <div style="display: flex; margin-bottom: 10px">
                  <div
                    v-for="item in variablelist"
                    class="tsgname"
                    @click="tsgnameto(item)"
                  >
                    {{ item.variatename }}
                  </div>
                  <div class="tsgnamebj" @click="variabledeawer = true">
                    变量编辑
                  </div>
                </div>
              </div>
              </el-form-item>
            </el-col></el-row
          >
          <el-row>
            <el-col :span="24">
              <el-form-item label="问题文本" prop="questiontext">
              <el-form-item label="问题文本" prop="questionText">
                <el-input
                  type="textarea"
                  :rows="2"
                  type="textarea"
                  id="questionText"
                  show-word-limit
                  placeholder="请输入内容"
                  id="questiontext"
                  v-model.sync="indexform.questiontext"
                  @focus="handleInput('questiontext')"
                  maxlength="30"
                  v-model.sync="indexform.questionText"
                  @focus="handleInput('questionText')"
                />
              </el-form-item> </el-col
          ></el-row>
@@ -290,21 +299,22 @@
                >
                  <el-button size="small" type="primary">点击上传</el-button>
                </el-upload>
                <!-- <el-input v-model="indexform.userName" maxlength="30" /> -->
                <!-- <el-input v-model="indexform.userName" maxlength="66"
                  show-word-limit /> -->
              </el-form-item>
            </el-col></el-row
          >
          <el-row>
            <el-col :span="24">
              <el-form-item label="无匹配文本" prop="nomatchtext">
              <el-form-item label="无匹配文本" prop="noMatchText">
                <el-input
                  type="textarea"
                  :rows="2"
                  id="nomatchtext"
                  id="noMatchText"
                  placeholder="请输入内容"
                  v-model.sync="indexform.nomatchtext"
                  @focus="handleInput('nomatchtext')"
                  maxlength="30"
                  v-model.sync="indexform.noMatchText"
                  @focus="handleInput('noMatchText')"
                  show-word-limit
                />
              </el-form-item> </el-col
          ></el-row>
@@ -326,15 +336,15 @@
          >
          <el-row>
            <el-col :span="24">
              <el-form-item label="无声文本" prop="sliencetext">
              <el-form-item label="无声文本" prop="slienceText">
                <el-input
                  type="textarea"
                  :rows="2"
                  id="sliencetext"
                  id="slienceText"
                  placeholder="请输入内容"
                  v-model.sync="indexform.sliencetext"
                  @focus="handleInput('sliencetext')"
                  maxlength="30"
                  v-model.sync="indexform.slienceText"
                  @focus="handleInput('slienceText')"
                  show-word-limit
                />
              </el-form-item> </el-col
          ></el-row>
@@ -354,47 +364,18 @@
              </el-form-item>
            </el-col></el-row
          >
          <el-row>
            <el-col :span="24">
              <el-form-item label="通用库文本" prop="submoduletext">
              <el-form-item label="听不清文本" prop="noClearlyText">
                <el-input
                  type="textarea"
                  :rows="2"
                  id="submoduletext"
                  placeholder="请输入内容"
                  v-model.sync="indexform.submoduletext"
                  @focus="handleInput('submoduletext')"
                  maxlength="30"
                />
              </el-form-item> </el-col
          ></el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="通用库语音" prop="libraryy">
                <el-upload
                  class="upload-demo"
                  action="https://jsonplaceholder.typicode.com/posts/"
                  :on-change="handleChange"
                  :file-list="fileList"
                  :limit="1"
                  :on-exceed="handleExceed"
                >
                  <el-button size="small" type="primary">点击上传</el-button>
                </el-upload>
              </el-form-item>
            </el-col></el-row
          >
          <el-row>
            <el-col :span="24">
              <el-form-item label="听不清文本" prop="noclearlytext">
                <el-input
                  type="textarea"
                  id="noclearlytext"
                  id="noClearlyText"
                  :rows="2"
                  placeholder="请输入内容"
                  @focus="handleInput('noclearlytext')"
                  v-model.sync="indexform.noclearlytext"
                  maxlength="30"
                  @focus="handleInput('noClearlyText')"
                  v-model.sync="indexform.noClearlyText"
                  show-word-limit
                />
              </el-form-item> </el-col
          ></el-row>
@@ -432,12 +413,21 @@
          label-width="100px"
        >
          <el-row>
            <el-col :span="12">
            <el-col :span="8">
              <el-form-item label="指标名称" prop="deptId">
                <el-input
                  v-model="indexform.targetname"
                  placeholder="请输入指标名称"
                  maxlength="40"
                  maxlength="20"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="指标描述" prop="deptId">
                <el-input
                  v-model="indexform.targetname"
                  placeholder="请输入指标描述"
                  maxlength="60"
                />
              </el-form-item>
            </el-col>
@@ -446,7 +436,7 @@
          <el-row>
            <el-col :span="24">
              <el-form-item label="值类型">
                <el-radio-group v-model="indexform.isenable">
                <el-radio-group disabled v-model="indexform.valueType">
                  <el-radio :label="1">选项</el-radio>
                  <el-radio :label="2">文本</el-radio>
                  <el-radio :label="3">数值</el-radio>
@@ -454,117 +444,52 @@
              </el-form-item>
            </el-col></el-row
          >
          <!-- <el-card class="box-card" style="margin-bottom: 20px">
            <el-table
              v-loading="loading"
              :data="indexform.ivrLibaScriptTargetoptionList"
            >
              <el-table-column
                label="序号"
                align="center"
                key="guid"
                prop="guid"
                width="50"
          <div v-if="indexform.valueType == 1">
            <el-card class="box-card" style="margin-bottom: 20px">
              <Regular
                :TargetoptionList="indexform.ivrLibaScriptTargetoptionList"
                @addoption="addoption"
                @deloption="deloption"
                @syioption="syioption"
                @xiayioption="xiayioption"
                :intent="false"
              />
              <el-table-column
                label="指标选项"
                align="center"
                key="targetvalue"
                prop="targetvalue"
                :show-overflow-tooltip="true"
              >
                <template slot-scope="scope">
            </el-card>
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="测试输入" prop="targetvalue">
                  <el-input
                    v-model="scope.row.targetvalue"
                    placeholder="请输入内容"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column
                label="解析规则"
                align="center"
                key="targetregex"
                prop="targetregex"
                width="460"
                :show-overflow-tooltip="true"
                    v-model="testvalue"
                    placeholder="请输入测试内容"
                    maxlength="40"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-button type="success">开始测试</el-button>
              </el-col>
            </el-row>
            <div style="margin-bottom: 20px">
              <el-input
                type="textarea"
                :rows="4"
                placeholder="此处展示识别结果"
                v-model="testgovalue"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.targetregex"
                    placeholder="请输入内容"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column
                label="操作"
                align="center"
                width="200"
                class-name="small-padding fixed-width"
              >
                <template slot-scope="scope">
                  <el-button
                    @click="addoption(scope.row)"
                    type="success"
                    icon="el-icon-circle-plus-outline"
                    circle
                  ></el-button>
                  <el-button
                    type="danger"
                    icon="el-icon-delete"
                    circle
                    @click="deloption(scope.row)"
                  ></el-button>
                  <el-button
                    @click="syioption(scope.row)"
                    type="primary"
                    icon="el-icon-top"
                    circle
                  ></el-button>
                  <el-button
                    @click="xiayioption(scope.row)"
                    type="primary"
                    icon="el-icon-bottom"
                    circle
                  ></el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-card> -->
          <el-card class="box-card" style="margin-bottom: 20px">
            <Regular
              :TargetoptionList="indexform.ivrLibaScriptTargetoptionList"
              @addoption="addoption"
              @deloption="deloption"
              @syioption="syioption"
              @xiayioption="xiayioption"
            />
          </el-card>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="测试输入" prop="targetvalue">
                <el-input
                  v-model="testvalue"
                  placeholder="请输入测试内容"
                  maxlength="40"
                />
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-button type="success">开始测试</el-button>
            </el-col>
          </el-row>
              </el-input>
            </div>
          </div>
          <div style="margin-bottom: 20px" v-else>
            <el-input
              type="textarea"
              :rows="4"
              placeholder="此处展示收集信息"
              v-model="testgovalue"
            >
            </el-input>
          </div>
        </el-form>
        <div style="margin-bottom: 10px">
          <el-input
            type="textarea"
            :rows="4"
            placeholder="此处展示识别结果"
            v-model="testgovalue"
          >
          </el-input>
        </div>
        <el-button type="primary" @click="laststep()">上一步</el-button>
        <el-button type="info" @click="closeFm()">关闭</el-button>
        <el-button @click="Saveproblem()">保存数据</el-button>
@@ -576,8 +501,8 @@
<script>
import { listtag } from "@/api/system/label";
import {
  getverbaltricklist,
  verbaltrickinfo,
  gettagerlist,
  testtagerlist,
  delverbaltrickinfo,
  compileverbaltrick,
  getverbaltrick,
@@ -652,6 +577,7 @@
        deptId: undefined,
        IDnumber: undefined,
      },
      variabledeawer: false,
    };
  },
@@ -681,14 +607,18 @@
          this.dynamicTags = this.indexform.ivrLibaScriptTagList.map(
            this.processElement
          );
          this.targetlist = [
            {
              id: this.indexform.targetid,
              targetname: this.indexform.targetname,
            },
          ];
          // this.targetlist = [
          //   {
          //     id: this.indexform.targetid,
          //     targetname: this.indexform.targetname,
          //   },
          // ];
        });
      }
      gettargetInfolist({ pageSize: 100, pageNum: 1 }).then((res) => {
        this.targetlist = res.rows;
      });
      // 树
      getbaltrickclassify({}).then((res) => {
        this.questionclass = res.rows;
@@ -714,7 +644,8 @@
        this.indexform.isoperation = 2;
        console.log(this.dellist);
        this.indexform.ivrLibaScriptTargetoptionList=this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
        this.indexform.ivrLibaScriptTargetoptionList =
          this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
        compileverbaltrick(this.indexform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("修改成功");
@@ -758,12 +689,18 @@
    targetchange(res) {
      console.log(res);
      gettargetInfo({ id: res }).then((res) => {
        this.indexform.targetname = res.rows[0].targetname;
        console.log(res.rows[0]);
        this.$modal
          .confirm('是否添加"' + this.indexform.targetname + '"指标的选项?')
          .confirm('是否添加"' + res.rows[0].targetname + '"指标的选项?')
          .then(() => {
            this.indexform.valueType = res.rows[0].valueType;
            this.indexform.questiontitle = res.rows[0].targetname;
            this.indexform.targetname = res.rows[0].targetname;
            this.indexform.questionText = res.rows[0].targetdesc;
            this.indexform.isAvailable = "0";
            this.indexform.language = "普通话";
            this.indexform.isenable = res.rows[0].isenable;
            console.log(res.rows[0].targetoptionList);
            this.$forceUpdate();
            res.rows[0].targetoptionList.forEach((item) => {
              item.isoperation = 1;
              this.indexform.ivrLibaScriptTargetoptionList.push(item);
@@ -778,11 +715,11 @@
    // 下一步
    nextstep() {
      if (this.Editprogress <= 1) {
        if (this.indexform.targetid) {
          return this.Editprogress++;
        } else {
          this.$message.warning("请先选择关联指标");
        }
        // if (this.indexform.targetid) {
        return this.Editprogress++;
        // } else {
        //   this.$message.warning("请先选择关联指标");
        // }
      } else {
      }
    },
@@ -974,14 +911,14 @@
      let inputValueArr = "";
      let el = document.querySelector("#" + this.currentInputId);
      //el.selectionStart; 这就是当前光标所在的位置(字符串中字符的index)
      if (this.currentInputId == "questiontext") {
        inputValueArr = this.indexform.questiontext.split("");
      } else if (this.currentInputId == "nomatchtext") {
        inputValueArr = this.indexform.nomatchtext.split("");
      } else if (this.currentInputId == "sliencetext") {
        inputValueArr = this.indexform.sliencetext.split("");
      } else if (this.currentInputId == "noclearlytext") {
        inputValueArr = this.indexform.noclearlytext.split("");
      if (this.currentInputId == "questionText") {
        inputValueArr = this.indexform.questionText.split("");
      } else if (this.currentInputId == "noMatchText") {
        inputValueArr = this.indexform.noMatchText.split("");
      } else if (this.currentInputId == "slienceText") {
        inputValueArr = this.indexform.slienceText.split("");
      } else if (this.currentInputId == "noClearlyText") {
        inputValueArr = this.indexform.noClearlyText.split("");
      } else if (this.currentInputId == "submoduletext") {
        inputValueArr = this.indexform.submoduletext.split("");
      } else {
@@ -996,14 +933,14 @@
      // 把数组重新转换为字符串并赋值
      inputValueArr = inputValueArr.join("");
      console.log(inputValueArr);
      if (this.currentInputId == "questiontext") {
        this.indexform.questiontext = inputValueArr;
      } else if (this.currentInputId == "nomatchtext") {
        this.indexform.nomatchtext = inputValueArr;
      } else if (this.currentInputId == "sliencetext") {
        this.indexform.sliencetext = inputValueArr;
      } else if (this.currentInputId == "noclearlytext") {
        this.indexform.noclearlytext = inputValueArr;
      if (this.currentInputId == "questionText") {
        this.indexform.questionText = inputValueArr;
      } else if (this.currentInputId == "noMatchText") {
        this.indexform.noMatchText = inputValueArr;
      } else if (this.currentInputId == "slienceText") {
        this.indexform.slienceText = inputValueArr;
      } else if (this.currentInputId == "noClearlyText") {
        this.indexform.noClearlyText = inputValueArr;
      } else if (this.currentInputId == "submoduletext") {
        this.indexform.submoduletext = inputValueArr;
      } else {
@@ -1111,6 +1048,21 @@
.tsgname:hover {
  background: #3366f5;
}
.tsgnamebj {
  width: 90px;
  margin-left: 15px;
  text-align: center;
  cursor: pointer;
  height: 40px;
  line-height: 40px;
  background: #49dbb7;
  color: #ffff;
  font-size: 18px;
  border-radius: 5px;
}
.tsgnamebj:hover {
  background: #27c449;
}
::v-deep .addtopic-input {
  input {