| | |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in optionsclass" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | <el-option-group |
| | | v-for="group in optionsclass" |
| | | :key="group.id" |
| | | :label="group.name" |
| | | > |
| | | </el-option> |
| | | <el-option |
| | | v-for="item in group.svyLibTitleCategoryList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="问卷标题" prop="name"> |
| | |
| | | <el-table-column |
| | | label="序号" |
| | | align="center" |
| | | key="topicid" |
| | | prop="topicid" |
| | | key="guid" |
| | | prop="guid" |
| | | /> |
| | | <el-table-column |
| | | label="题目" |
| | |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="200" |
| | | width="250" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | icon="el-icon-edit" |
| | | type="primary" |
| | | round |
| | | circle |
| | | @click="handleUpdate(scope.row)" |
| | | >修改</el-button |
| | | > |
| | | ></el-button> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="handleDelete(scope.row)" |
| | | ></el-button> |
| | | <el-button |
| | | @click="syioption(scope.row)" |
| | | type="success" |
| | | icon="el-icon-top" |
| | | circle |
| | | ></el-button> |
| | | <el-button |
| | | @click="xiayioption(scope.row)" |
| | | type="success" |
| | | icon="el-icon-bottom" |
| | | circle |
| | | ></el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | compileissue, |
| | | delQtemplateinfo, |
| | | Followupinfo, |
| | | issueinfo, |
| | | getissuelist, |
| | | deltargetillness, |
| | | addtargetillness, |
| | |
| | | data() { |
| | | return { |
| | | sidecolumnrabs: "left", //方向 |
| | | Editprogress: 2, //编辑进度 |
| | | Editprogress: 1, //编辑进度 |
| | | currentVersion: "1.2.3", //当前版本 |
| | | loading: false, // 遮罩层 |
| | | drawer: false, //控制展开 |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // 公共方法--------------- |
| | | getIndexInArray(arr, obj) { |
| | | return arr.indexOf(obj); |
| | | }, |
| | | // 递归扁平化 |
| | | flattenArray(arr) { |
| | | let result = []; |
| | | arr.forEach((item) => { |
| | | result.push(item); |
| | | if (item.svyLibTitleCategoryList) { |
| | | result = result.concat( |
| | | this.flattenArray(item.svyLibTitleCategoryList) |
| | | ); |
| | | delete item.svyLibTitleCategoryList; |
| | | } |
| | | }); |
| | | return result; |
| | | }, |
| | | // ----------------------------- |
| | | // 获取数据 |
| | | getissueinfo() { |
| | | this.id = this.$route.query.id; |
| | |
| | | listDept(this.queryParams).then((response) => { |
| | | this.deptList = this.handleTree(response.data, "deptId"); |
| | | }); |
| | | // 分类 |
| | | getQtemplateclassify({}).then((res) => { |
| | | // this.optionsclass = this.flattenArray(res.rows); |
| | | this.optionsclass = res.rows; |
| | | }); |
| | | }, |
| | |
| | | this.ruleForm.svyLibTopics.indexOf(row), |
| | | 1 |
| | | ); |
| | | this.sortFn(); |
| | | }, |
| | | handleUpdate(row) { |
| | | console.log(row); |
| | | this.topicobj = row; |
| | | getissuelist({ svyid: row.svyid }).then((res) => { |
| | | this.topicobj = res.rows[0]; |
| | | }); |
| | | }, |
| | | 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插入到索引位置的前一位 |
| | | 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插入到索引位置的前一位 |
| | | this.sortFn(); |
| | | }, |
| | | sortFn() { |
| | | this.ruleForm.svyLibTopics = this.ruleForm.svyLibTopics.map( |
| | | (item, index) => { |
| | | return { |
| | | guid: index + 1, |
| | | svyid: item.svyid, |
| | | topic: item.topic, |
| | | topicContent: item.topicContent, |
| | | }; |
| | | } |
| | | ); |
| | | console.log(this.ruleForm.svyLibTopics); |
| | | }, |
| | | |
| | | // 修改题目信息 |