| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </el-col></el-row |
| | | > |
| | | |
| | | <el-card class="box-card" style="margin-bottom: 20px"> |
| | | <!-- <el-card class="box-card" style="margin-bottom: 20px"> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="indexform.ivrLibaScriptTargetoptionList" |
| | |
| | | </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"> |
| | |
| | | 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: "", |
| | |
| | | // 获取详情数据 |
| | | getverbaltrick() { |
| | | let id = this.$route.query.id; |
| | | getverbaltrick({ id: id }).then((res) => { |
| | | this.indexform = res.data; |
| | | 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, |
| | | }, |
| | | ]; |
| | | }); |
| | | 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, |
| | | }, |
| | | ]; |
| | | }); |
| | | } |
| | | // 树 |
| | | getbaltrickclassify({}).then((res) => { |
| | | this.questionclass = res.rows; |
| | |
| | | |
| | | // 保存详细信息 |
| | | Saveproblem() { |
| | | console.log(this.variablelist); |
| | | this.indexform.otherdata = JSON.stringify(this.variablelist); |
| | | this.indexform.suitway = this.indexform.suitway.join(","); |
| | | 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; |
| | | 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("修改成功"); |
| | |
| | | }); |
| | | } else { |
| | | this.indexform.isoperation = 1; |
| | | |
| | | compileverbaltrick(this.indexform).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("新增成功"); |
| | |
| | | .confirm('是否添加"' + this.indexform.targetname + '"指标的选项?') |
| | | .then(() => { |
| | | this.indexform.isenable = res.rows[0].isenable; |
| | | console.log(res.rows[0].targetoptionList); |
| | | res.rows[0].targetoptionList.forEach((item) => { |
| | | item.isoperation = 1; |
| | | this.indexform.ivrLibaScriptTargetoptionList.push(item); |
| | |
| | | |
| | | // 下一步 |
| | | nextstep() { |
| | | if (this.Editprogress <= 1 && this.indexform.targetid) { |
| | | if (this.indexform.ivrLibaScriptTargetoptionList.length) { |
| | | if (this.Editprogress <= 1) { |
| | | if (this.indexform.targetid) { |
| | | return this.Editprogress++; |
| | | } else { |
| | | this.$message.warning("请先选择关联指标"); |
| | | } |
| | | |
| | | return this.Editprogress++; |
| | | } else { |
| | | this.$message.warning("请先选择关联指标"); |
| | | } |
| | | }, |
| | | // 上一步 |
| | |
| | | isoperation: 1, |
| | | targetvalue: "", |
| | | targetregex: "", |
| | | targetregex2: "", |
| | | dynamiccruxs: [], |
| | | nodynamiccruxs: [], |
| | | dynamiccruxsJson: "", |
| | | nodynamiccruxsJson: "", |
| | | }); |
| | | this.sortFn(); |
| | | }, |
| | | 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); |
| | |
| | | |
| | | <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; |