| | |
| | | <div class="Questionnairemanagement"> |
| | | <!-- 左侧栏 --> |
| | | <div class="sidecolumn"> |
| | | <div style="height: 300px"> |
| | | <el-steps direction="vertical" :active="Editprogress"> |
| | | <el-step title="问题库编辑"></el-step> |
| | | <el-step title="问题指标编辑"></el-step> |
| | | <div> |
| | | <el-steps finish-status="success" :active="Editprogress" simple> |
| | | <el-step> |
| | | <template slot="title"> |
| | | <span style="cursor: pointer" @click="Editprogress = 1" |
| | | >问题库编辑</span |
| | | > |
| | | </template> |
| | | </el-step> |
| | | <el-step> |
| | | <template slot="title"> |
| | | <span style="cursor: pointer" @click="nextstep" |
| | | >问题指标编辑</span |
| | | > |
| | | </template> |
| | | </el-step> |
| | | </el-steps> |
| | | </div> |
| | | </div> |
| | |
| | | placeholder="请选择状态" |
| | | > |
| | | <el-option |
| | | v-for="item in qyoptions" |
| | | v-for="item in usable" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | |
| | | <el-form-item label="问题分类" prop="status"> |
| | | <el-select |
| | | v-model="indexform.assortid" |
| | | placeholder="请选择状态" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | v-for="item in questionclass" |
| | | :key="item.id" |
| | | :label="item.indexAssortName" |
| | | :value="item.id" |
| | | <el-option-group |
| | | v-for="group in questionclass" |
| | | :key="group.id" |
| | | :label="group.indexAssortName" |
| | | > |
| | | </el-option> |
| | | <el-option |
| | | v-for="item in group.ivrLibaScriptAssortList" |
| | | :key="item.id" |
| | | :label="item.indexAssortName" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="通知变量" prop="name"> |
| | | <el-row v-for="item in variablelist"> |
| | | <el-col :span="4"> |
| | | <el-input |
| | | v-model="item.name" |
| | | placeholder="请输入变量名" |
| | | ></el-input> |
| | | </el-col> |
| | | <el-col :span="8" :offset="1"> |
| | | <el-input |
| | | v-model="item.value" |
| | | placeholder="请输入变量内容" |
| | | ></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 |
| | | v-if="item" |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="delvariable(item)" |
| | | ></el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <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-row> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="仅限院区" prop="region"> |
| | | <el-select |
| | | v-model="indexform.courtyard" |
| | | v-model="indexform.campus" |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | class="indexformaa" |
| | | v-for="item in options" |
| | | v-for="item in courtyardlist" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="适用方式" prop="status"> |
| | | <el-select |
| | | v-model="indexform.suitway" |
| | | multiple |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in mode" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="关联指标" prop="region"> |
| | | <el-select |
| | | v-model="indexform.targetid" |
| | |
| | | reserve-keyword |
| | | placeholder="请输入关键词" |
| | | :remote-method="remoteMethod" |
| | | @change="targetchange" |
| | | :loading="loading" |
| | | > |
| | | <el-option |
| | | v-for="item in targetlist" |
| | | :key="item.targetid" |
| | | :key="item.id" |
| | | :label="item.targetname" |
| | | :value="item.targetid" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | class="tsgname" |
| | | @click="tsgnameto(item)" |
| | | > |
| | | {{ item.name }} |
| | | {{ item.variatename }} |
| | | </div> |
| | | </div> |
| | | </el-col></el-row |
| | | > |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="问题文本" prop="questiontext"> |
| | | <el-form-item label="问题文本" prop="questionText"> |
| | | <el-input |
| | | :rows="2" |
| | | type="textarea" |
| | | :rows="2" |
| | | 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> |
| | |
| | | > |
| | | <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> |
| | |
| | | > |
| | | <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> |
| | |
| | | </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> |
| | |
| | | > |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="nextstep">确 定</el-button> |
| | | <el-button type="primary" @click="nextstep">下一步</el-button> |
| | | <el-button @click="closeFm">关 闭</el-button> |
| | | <el-button @click="Saveproblem()">保存数据</el-button> |
| | | </div> |
| | | </div> |
| | | <!-- 指标设置 --> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="值类型"> |
| | | <el-radio-group v-model="indexform.isenable"> |
| | | <el-radio-group v-model="indexform.valueType"> |
| | | <el-radio :label="1">选项</el-radio> |
| | | <el-radio :label="2">文本</el-radio> |
| | | <el-radio :label="3">数值</el-radio> |
| | |
| | | </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" |
| | | /> |
| | | <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-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> |
| | | <el-button @click="Saveproblem()">保存数据</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | gettargetInfolist, |
| | | gettargetInfo, |
| | | } from "@/api/AiCentre/index"; |
| | | import Regular from "@/components/Regular"; //正则组件 |
| | | import store from "@/store"; |
| | | |
| | | export default { |
| | | name: "Verbalproblem", |
| | | components: { Regular }, |
| | | data() { |
| | | return { |
| | | Editprogress: 1, //编辑进度 |
| | |
| | | radios: [], //多选题选中 |
| | | radioas: "", //填空题答案 |
| | | dynamicTags: [], |
| | | dellist: [], |
| | | inputVisible: false, |
| | | inputValue: "", |
| | | testvalue: "", |
| | | testgovalue: "", |
| | | topicobj: {}, |
| | | indexform: {}, |
| | | indexform: { |
| | | ivrLibaScriptTargetoptionList: [], |
| | | ivrLibaScriptTagList: [], |
| | | }, |
| | | mode: [], |
| | | questionclass: [], |
| | | currentInputId: "", |
| | | |
| | | courtyardlist: [], |
| | | // 总条数 |
| | | total: 1, |
| | | |
| | |
| | | url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100", |
| | | }, |
| | | ], |
| | | qyoptions: [], |
| | | usable: [], |
| | | options: [], |
| | | variablelist: [ |
| | | |
| | | { variatename: "姓名", variate: "${name}", default: 1 }, |
| | | { variatename: "电话", variate: "${phone}", default: 1 }, |
| | | { variatename: "病情", variate: "${illness}", default: 1 }, |
| | | ], |
| | | |
| | | addvalue: "添加题目", |
| | |
| | | this.mode = store.getters.mode; |
| | | this.valuetype = store.getters.valuetype; |
| | | this.languagelist = store.getters.languagelist; |
| | | this.qyoptions = store.getters.usable; |
| | | this.usable = store.getters.usable; |
| | | this.courtyardlist = store.getters.courtyardlist; |
| | | }, |
| | | |
| | | methods: { |
| | | // 获取详情数据 |
| | | getverbaltrick() { |
| | | let id = this.$route.query.id; |
| | | getverbaltrick({ id: id }).then((res) => { |
| | | this.indexform = res.data; |
| | | this.indexform.assortid = parseInt(this.indexform.assortid); |
| | | this.variablelist = JSON.parse(this.indexform.parameter)?JSON.parse(this.indexform.parameter):[{name:'',value:''}]; |
| | | this.dynamicTags = this.indexform.ivrLibaScriptTagList.map( |
| | | this.processElement |
| | | ); |
| | | this.targetlist = [ |
| | | { |
| | | targetid: this.indexform.targetid, |
| | | targetname: this.indexform.targetname, |
| | | }, |
| | | ]; |
| | | console.log(this.targetlist); |
| | | if (id) { |
| | | getverbaltrick({ id: id }).then((res) => { |
| | | this.indexform = res.data; |
| | | if (this.indexform.suitway) |
| | | this.indexform.suitway = this.indexform.suitway.split(","); |
| | | this.indexform.assortid = parseInt(this.indexform.assortid); |
| | | this.variablelist = JSON.parse(this.indexform.otherdata).length |
| | | ? JSON.parse(this.indexform.otherdata) |
| | | : this.variablelist; |
| | | this.dynamicTags = this.indexform.ivrLibaScriptTagList.map( |
| | | this.processElement |
| | | ); |
| | | |
| | | // this.targetlist = [ |
| | | // { |
| | | // id: this.indexform.targetid, |
| | | // targetname: this.indexform.targetname, |
| | | // }, |
| | | // ]; |
| | | }); |
| | | } |
| | | gettargetInfolist({ pageSize: 100, pageNum: 1 }).then((res) => { |
| | | this.targetlist = res.rows; |
| | | }); |
| | | // 树 |
| | | getbaltrickclassify({}).then((res) => { |
| | |
| | | |
| | | // 保存详细信息 |
| | | Saveproblem() { |
| | | this.indexform.otherdata = JSON.stringify(this.variablelist); |
| | | if (this.indexform.suitway) { |
| | | this.indexform.suitway = this.indexform.suitway.join(","); |
| | | } |
| | | |
| | | if (this.indexform.id) { |
| | | this.indexform.ivrLibaScriptTargetoptionList = |
| | | this.indexform.ivrLibaScriptTargetoptionList.map((res) => { |
| | | if (res.isoperation != 1) { |
| | | res.isoperation = 2; |
| | | } |
| | | return res; |
| | | }); |
| | | |
| | | this.indexform.isoperation = 2; |
| | | this.indexform.parameter = JSON.stringify(this.variablelist); |
| | | console.log(this.dellist); |
| | | this.indexform.ivrLibaScriptTargetoptionList = |
| | | this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist); |
| | | compileverbaltrick(this.indexform).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.$router.go(-1); |
| | | } else { |
| | | this.$message({ |
| | | message: "修改失败", |
| | | type: "error", |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.indexform.isoperation = 1; |
| | | |
| | | compileverbaltrick(this.indexform).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.$router.go(-1); |
| | | } else { |
| | | this.$message({ |
| | | message: "新增失败", |
| | | type: "error", |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | this.targetlist = []; |
| | | } |
| | | }, |
| | | targetchange(res) { |
| | | console.log(res); |
| | | gettargetInfo({ id: res }).then((res) => { |
| | | console.log(res.rows[0]); |
| | | this.$modal |
| | | .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; |
| | | this.$forceUpdate() |
| | | res.rows[0].targetoptionList.forEach((item) => { |
| | | item.isoperation = 1; |
| | | this.indexform.ivrLibaScriptTargetoptionList.push(item); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.$modal.msgSuccess("已取消"); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 下一步 |
| | | nextstep() { |
| | | if (this.Editprogress <= 1 && this.indexform.targetid) { |
| | | if (this.indexform.ivrLibaScriptTargetoptionList.length) { |
| | | return this.Editprogress++; |
| | | } |
| | | gettargetInfo({ targetID: this.indexform.targetid }).then((res) => { |
| | | this.indexform.isenable = res.rows[0].isenable; |
| | | this.indexform.targetname = res.rows[0].targetname; |
| | | res.rows[0].targetoptionList.forEach((item) => { |
| | | item.isoperation = 1; |
| | | this.indexform.ivrLibaScriptTargetoptionList.push(item); |
| | | }); |
| | | }); |
| | | if (this.Editprogress <= 1) { |
| | | // if (this.indexform.targetid) { |
| | | return this.Editprogress++; |
| | | // } else { |
| | | // this.$message.warning("请先选择关联指标"); |
| | | // } |
| | | } else { |
| | | this.$message.warning("请先选择关联指标"); |
| | | } |
| | | }, |
| | | // 上一步 |
| | |
| | | showInput() { |
| | | this.inputVisible = true; |
| | | }, |
| | | // -------------------------- |
| | | //测试表单 -------------------------- |
| | | gettagerlist() { |
| | | gettagerlist({ targetname: this.targetname }).then((response) => { |
| | |
| | | isoperation: 1, |
| | | targetvalue: "", |
| | | targetregex: "", |
| | | targetregex2: "", |
| | | dynamiccruxs: [], |
| | | nodynamiccruxs: [], |
| | | dynamiccruxsJson: "", |
| | | nodynamiccruxsJson: "", |
| | | }); |
| | | this.sortFn(); |
| | | }, |
| | | deloption() { |
| | | deloption(item) { |
| | | const index = this.indexform.ivrLibaScriptTargetoptionList.indexOf(item); |
| | | if (index !== -1) { |
| | | if (item.id) { |
| | | console.log(item, "chunz"); |
| | | item.isoperation = 3; |
| | | this.dellist.push(item); |
| | | } |
| | | console.log(this.dellist, "dellist"); |
| | | this.indexform.ivrLibaScriptTargetoptionList.splice(index, 1); // 从索引位置删除一个元素 |
| | | this.sortFn(); |
| | | } else { |
| | |
| | | return { |
| | | guid: index + 1, |
| | | targetvalue: item.targetvalue, |
| | | targetregex2: item.targetregex2, |
| | | targetregex: item.targetregex, |
| | | id: item.id, |
| | | targettype: this.indexform.targettype, |
| | | isoperation: item.id ? 2 : 1, |
| | | categoryName: item.categoryName, |
| | | language: item.language, |
| | | dynamiccruxs: item.dynamiccruxs, |
| | | nodynamiccruxs: item.nodynamiccruxs, |
| | | dynamiccruxsJson: item.dynamiccruxsJson, |
| | | nodynamiccruxsJson: item.nodynamiccruxsJson, |
| | | }; |
| | | }); |
| | | console.log(this.indexform.ivrLibaScriptTargetoptionList); |
| | |
| | | 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 { |
| | |
| | | // 拿到选中文字的长度(后续可以用来替换选中的文字) |
| | | let selectLength = el.selectionEnd - el.selectionStart; |
| | | // 将要插入/替换的文字插入/替换(value.name是要插入/替换的字符串) |
| | | inputValueArr.splice(el.selectionStart, selectLength, `${row.value}`); |
| | | inputValueArr.splice(el.selectionStart, selectLength, `${row.variate}`); |
| | | // 把数组重新转换为字符串并赋值 |
| | | 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 { |
| | |
| | | // 新增变量 |
| | | addvariable() { |
| | | this.variablelist.push({ |
| | | variable: "", |
| | | value: "", |
| | | variatename: "", |
| | | variate: "", |
| | | }); |
| | | }, |
| | | // 删除变量 |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .Questionnairemanagement { |
| | | display: flex; |
| | | // display: flex; |
| | | } |
| | | .sidecolumn { |
| | | width: 300px; |
| | | min-height: 100vh; |
| | | text-align: center; |
| | | // display: flex; |
| | | // margin-top: 20px; |
| | | margin: 20px; |
| | | margin-bottom: 0; |
| | | padding: 30px; |
| | | padding: 20px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | } |
| | | .leftvlue { |
| | | // display: flex; |
| | | // flex: 1; |
| | | width: 80%; |
| | | margin-top: 20px; |
| | | // margin: 20px; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #ffff; |
| | | border: 1px solid #dcdfe6; |