|
|
@@ -20,6 +20,21 @@
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
|
|
|
+ <template #table-column-inTurn="{scope}">
|
|
|
+ <span v-if="!scope.row._inTurn" @click="showSort(scope.row)">{{
|
|
|
+ scope.row.inTurn
|
|
|
+ }}</span>
|
|
|
+
|
|
|
+ <el-input-number
|
|
|
+ ref="sort-input"
|
|
|
+ focus
|
|
|
+ size="mini"
|
|
|
+ v-else
|
|
|
+ v-model="scope.row.inTurn"
|
|
|
+ @blur="changeSort(scope.row)"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+
|
|
|
<!-- 编辑 -->
|
|
|
<template #slot-poster="{scope}">
|
|
|
<el-button type="text" @click="getPosterBtnFn(scope.row)">获取海报</el-button>
|
|
|
@@ -31,7 +46,7 @@
|
|
|
</template>
|
|
|
|
|
|
<!-- 添加 -->
|
|
|
- <template #slot-add-ad-btn="{scope}">
|
|
|
+ <template #slot-add-ad-btn>
|
|
|
<el-button type="primary" size="mini" @click="addBtnFn">添加</el-button>
|
|
|
</template>
|
|
|
</cl-crud>
|
|
|
@@ -245,6 +260,30 @@ export default {
|
|
|
})
|
|
|
.done();
|
|
|
app.refresh({ type: this.tabIndex });
|
|
|
+ },
|
|
|
+
|
|
|
+ showSort(e) {
|
|
|
+ this.$set(e, '_inTurn', true);
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['sort-input'].focus();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ changeSort(d) {
|
|
|
+ d._inTurn = false;
|
|
|
+
|
|
|
+ this.$service.category
|
|
|
+ .sort({
|
|
|
+ inTurn: d.inTurn,
|
|
|
+ id: d.id
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.$message.error(err);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|