zx 3 years ago
parent 8e35af930a
commit 4fa777ac0d

@ -300,7 +300,7 @@ export default defineComponent({
getRank() {
let obj = Object.assign({pageNum: 1,pageSize: 10},this.form)
this.proxy.$post("/statistics/data3", obj).then(res => {
let data = res.data;
let data = res.data.records;
this.tableData = data;
}).catch(() => {});
},

@ -7,8 +7,9 @@ export function statusFormatter(row) {
}
};
export function groupFormatter(row) {
switch(row.groupId) {
case 0: return '未分组'
default: return row.groupId;
if(row.groupName) {
return row.groupName
} else {
return '未分组'
}
}

@ -46,7 +46,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="groupId" label="分组" :formatter="groupFormatter"></el-table-column>
<el-table-column prop="groupName" label="分组" :formatter="groupFormatter"></el-table-column>
<el-table-column prop="brandList" label="车型">
<template #default="scope">
<el-tag style="margin-right: 8px" v-for="(item,index) in scope.row.brandList" :key="index">

@ -22,6 +22,13 @@
<el-switch @change="changeIsShow(scope.row)" :model-value="scope.row.showAtIndex" :active-value="1" :inactive-value="0" active-text="" inactive-text=""></el-switch>
</template>
</el-table-column>
<el-table-column prop="sortWeight" label="排序">
<template #default="scope">
<el-input v-model="sortValue" @change="handlerChangeSort(value)" style="width: 120px" v-if="isEditing && scope.row.id == activeId"></el-input>
<span v-else>{{scope.row.sortWeight}}</span>
<el-icon @click="handlerSortEdit(scope.row)"><Edit /></el-icon>
</template>
</el-table-column>
<el-table-column prop="cover" label="封面" >
<template #default="scope">
<img style="width: 160px;height: 120px" :src="$ImgUrl(scope.row.cover)" />
@ -48,7 +55,7 @@
</template>
<script>
import {defineComponent, reactive, watch, getCurrentInstance} from 'vue'
import {defineComponent, reactive, ref, watch, getCurrentInstance} from 'vue'
import {statusFormatter} from './config.js'
export default defineComponent({
name: 'v-questList',
@ -64,10 +71,14 @@ export default defineComponent({
total: 0,
current: 1,
pageSize: 10
})
});
const isEditing = ref(false);
const activeId = ref(undefined);
const sortValue = ref(undefined);
return {
form,proxy,
tableData,pagination,
isEditing,activeId,sortValue,
statusFormatter
}
},
@ -129,6 +140,24 @@ export default defineComponent({
this.$message.error(res.msg)
}
}).catch(() => {});
},
//
handlerSortEdit(value) {
this.activeId = value.id;
this.isEditing = true;
},
editCancel() {
this.isEditing = false;
},
handlerChangeSort(value) {
let obj = {id: this.activeId,sortWeight: this.sortValue*1}
this.proxy.$post("/topicActivity/updSort", obj).then(res => {
this.getData();
this.isEditing = false;
this.activeId = undefined;
this.sortValue = undefined;
this.$message.success(res.data)
}).catch(() => {});
}
}
})

Loading…
Cancel
Save