|
|
|
@ -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(() => {});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|