|
@@ -154,7 +154,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="table_content" v-if="stype == 2">
|
|
|
- <el-table ref="table" :data="worksArray" border :height="tableHeight" :fit="true" :key="1"
|
|
|
+ <el-table class="el-table" ref="table" :data="worksArray" border :height="tableHeight" :fit="true" :key="1"
|
|
|
v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }">
|
|
|
<el-table-column fixed label="序号" width="80px" align="left">
|
|
|
<template slot-scope="scope">
|
|
@@ -164,7 +164,10 @@
|
|
|
<el-table-column fixed prop="name" label="提交人" width="120px" align="left">
|
|
|
</el-table-column>
|
|
|
<el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" min-width="150"
|
|
|
- align="left">
|
|
|
+ align="left"
|
|
|
+ :filters="item.type == 1 ? item.nameFilters : null"
|
|
|
+ :filter-method="item.type == 1 ? (value,row)=>{return filterName(value,row,index)} : null"
|
|
|
+ :filter-placement="item.type == 1 ? filterPlacement : null">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
|
|
|
<span class="answer_type" v-for="(answer2, index2) in scope.row.array[index].json.answer2"
|
|
@@ -272,7 +275,8 @@ export default {
|
|
|
dialogVisibleVideo: false,
|
|
|
dialogVisibleOffice: false,
|
|
|
wurl: "",
|
|
|
- chapters: []
|
|
|
+ chapters: [],
|
|
|
+ filterPlacement: 'bottom-end',
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
@@ -309,6 +313,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ filterName(value, row,index) {
|
|
|
+ let name = []
|
|
|
+ for(var i=0;i<row.array[index].json.answer2.length;i++){
|
|
|
+ name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
|
|
|
+ }
|
|
|
+ console.log(name.indexOf(value) != -1);
|
|
|
+ return name.indexOf(value) != -1;
|
|
|
+ },
|
|
|
wordClickHandler(name, value) {
|
|
|
// this.$notify({
|
|
|
// title: name,
|
|
@@ -407,7 +419,7 @@ export default {
|
|
|
this.iscount = res.data[2][0].count
|
|
|
this.pcount = res.data[3][0].count
|
|
|
let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
|
|
|
- this.chapters = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters))))
|
|
|
+ this.chapters = this.setFilter(this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
|
|
|
|
|
|
let testArray = []
|
|
|
let array = []
|
|
@@ -582,6 +594,24 @@ export default {
|
|
|
console.log(array);
|
|
|
return array;
|
|
|
},
|
|
|
+ setFilter(json){
|
|
|
+ let _json = json
|
|
|
+ let array = []
|
|
|
+ _json.filter((item) => {
|
|
|
+ item.nameFilters = [],
|
|
|
+ item.filterParams = {
|
|
|
+ name: [],
|
|
|
+ }
|
|
|
+ if(item.type == 1){
|
|
|
+ for(var i = 0; i < item.json.array.length; i++){
|
|
|
+ item.nameFilters.push({text: item.json.array[i].option, value: item.json.array[i].option})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ array.push(item)
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ return array
|
|
|
+ },
|
|
|
checkFile(item) {
|
|
|
if (item.type == 3) {
|
|
|
this.$hevueImgPreview(item.url);
|
|
@@ -1181,4 +1211,6 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
</style>
|