| | |
| | | :label="group.name" |
| | | > |
| | | <el-option |
| | | v-for="item in group.svyLibTitleCategoryList" |
| | | v-for="item in group.svyLibTemplateCategoryList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | <div class="presentation"> |
| | | <div class="presentation-left"> |
| | | <el-card class="box-card" style="min-height: 688px"> |
| | | <el-table v-loading="loading" :data="ruleForm.svyLibTopics"> |
| | | <el-table v-loading="loading" :data="ruleForm.svyLibScripts"> |
| | | <el-table-column |
| | | label="序号" |
| | | align="center" |
| | |
| | | prop="guid" |
| | | /> |
| | | <el-table-column |
| | | label="题目" |
| | | label="题目标题" |
| | | align="center" |
| | | key="script" |
| | | prop="script" |
| | | key="topic" |
| | | prop="topic" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="主要内容" |
| | | label="题目内容" |
| | | align="center" |
| | | key="scriptContent" |
| | | prop="scriptContent" |
| | | key="script" |
| | | prop="script" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | |
| | |
| | | </div> |
| | | <el-form-item label="题目标题"> |
| | | <el-input |
| | | v-model="topicobj.script" |
| | | v-model="topicobj.topic" |
| | | placeholder="请输入标题" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <div class="headline">选项设置</div> |
| | | <div |
| | | class="topicxq" |
| | | v-for="item in topicobj.svyLibTopicoptions" |
| | | v-for="item in topicobj.svyLibTemplateTargetoptions" |
| | | > |
| | | <el-row :gutter="10"> |
| | | <el-col :span="11" |
| | |
| | | title="添加题目" |
| | | :visible.sync="drawer" |
| | | custom-class="demo-drawer" |
| | | width="50%" |
| | | size="50%" |
| | | > |
| | | <div class="preview-left"> |
| | | <el-form |
| | |
| | | :inline="true" |
| | | label-width="98px" |
| | | > |
| | | <el-form-item label="问题标题" prop="script"> |
| | | <el-form-item label="问题标题" prop="topic"> |
| | | <el-input |
| | | v-model="queryParams.script" |
| | | v-model="queryParams.topic" |
| | | placeholder="请输入" |
| | | clearable |
| | | style="width: 200px" |
| | |
| | | <el-table-column |
| | | label="标题" |
| | | align="center" |
| | | key="script" |
| | | prop="script" |
| | | key="topic" |
| | | prop="topic" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="问题内容" |
| | | align="center" |
| | | key="scriptContent" |
| | | prop="scriptContent" |
| | | key="script" |
| | | prop="script" |
| | | width="200" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getaddtopiclist" |
| | | /> |
| | | </div> |
| | | </el-drawer> |
| | | </div> |
| | |
| | | let result = []; |
| | | arr.forEach((item) => { |
| | | result.push(item); |
| | | if (item.svyLibTitleCategoryList) { |
| | | if (item.svyLibTemplateCategoryList) { |
| | | result = result.concat( |
| | | this.flattenArray(item.svyLibTitleCategoryList) |
| | | this.flattenArray(item.svyLibTemplateCategoryList) |
| | | ); |
| | | delete item.svyLibTitleCategoryList; |
| | | delete item.svyLibTemplateCategoryList; |
| | | } |
| | | }); |
| | | return result; |
| | |
| | | Departmenttreatment() { |
| | | this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist); |
| | | console.log(this.tempDetpRelevanceslist); |
| | | this.ruleForm.svyLibTopics = this.ruleForm.svyLibTopics.concat( |
| | | this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.concat( |
| | | this.delScriptVOList |
| | | ); |
| | | console.log(this.ruleForm.svyLibTopics, "this.ruleForm.svyLibTopics"); |
| | | console.log(this.ruleForm.svyLibScripts, "this.ruleForm.svyLibScripts"); |
| | | const result = this.tempDetpRelevanceslist.map( |
| | | (subArr) => subArr[subArr.length - 1] |
| | | ); |
| | |
| | | // 新增题目 |
| | | addtopic(row) { |
| | | row.isoperation = 1; |
| | | row.svyLibTopicoptions.forEach((item) => { |
| | | row.svyLibTemplateTargetoptions.forEach((item) => { |
| | | item.isoperation = 1; |
| | | }); |
| | | this.ruleForm.svyLibTopics.push(row); |
| | | this.ruleForm.svyLibScripts.push(row); |
| | | }, |
| | | handleDelete(row) { |
| | | let index = this.ruleForm.svyLibTopics.indexOf(row); |
| | | this.ruleForm.svyLibTopics.splice(index, 1); |
| | | let index = this.ruleForm.svyLibScripts.indexOf(row); |
| | | this.ruleForm.svyLibScripts.splice(index, 1); |
| | | row.isoperation = 3; |
| | | this.delScriptVOList.push(row); |
| | | this.sortFn(); |
| | |
| | | // }); |
| | | }, |
| | | syioption(row) { |
| | | const index = this.getIndexInArray(this.ruleForm.svyLibTopics, row); |
| | | const item = this.ruleForm.svyLibTopics.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中 |
| | | this.ruleForm.svyLibTopics.splice(index - 1, 0, item); // 将item插入到索引位置的前一位 |
| | | const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row); |
| | | const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中 |
| | | this.ruleForm.svyLibScripts.splice(index - 1, 0, item); // 将item插入到索引位置的前一位 |
| | | this.sortFn(); |
| | | }, |
| | | xiayioption(row) { |
| | | const index = this.getIndexInArray(this.ruleForm.svyLibTopics, row); |
| | | const item = this.ruleForm.svyLibTopics.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中 |
| | | this.ruleForm.svyLibTopics.splice(index + 1, 0, item); // 将item插入到索引位置的前一位 |
| | | const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row); |
| | | const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中 |
| | | this.ruleForm.svyLibScripts.splice(index + 1, 0, item); // 将item插入到索引位置的前一位 |
| | | this.sortFn(); |
| | | }, |
| | | sortFn() { |
| | | this.ruleForm.svyLibTopics = this.ruleForm.svyLibTopics.map( |
| | | this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.map( |
| | | (item, index) => { |
| | | return { |
| | | guid: index + 1, |
| | | svyid: item.svyid, |
| | | script: item.script, |
| | | scriptContent: item.scriptContent, |
| | | script: item.script, |
| | | }; |
| | | } |
| | | ); |
| | | console.log(this.ruleForm.svyLibTopics); |
| | | console.log(this.ruleForm.svyLibScripts); |
| | | }, |
| | | |
| | | // 修改题目信息 |
| | | Submittopicobj() {}, |
| | | Submittopicobj() { |
| | | |
| | | }, |
| | | // 新增变量 |
| | | addvariable() { |
| | | this.variablelist.push({ |