|
@@ -9,7 +9,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="内容分类:">
|
|
|
<el-select v-model="form.type" placeholder="请选择内容分类" clearable>
|
|
|
- <el-option v-for="item in locationOptions" :key="item.id" :label="item.name" :value='item.id' />
|
|
|
+ <el-option v-for="item in classifyOptions" :key="item.id" :label="item.name" :value='item.id' />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="当前状态:">
|
|
@@ -71,8 +71,7 @@
|
|
|
<el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="推荐位置:" prop="tagId">
|
|
|
<el-select v-model="dialogForm.tagId" placeholder="请选择推荐位置">
|
|
|
- <el-option v-for="item in locationOptions" :key="item.value" :label="item.label"
|
|
|
- :value='item.value' />
|
|
|
+ <el-option v-for="item in classifyOptions" :key="item.id" :label="item.name" :value='item.id' />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="推荐权重:" prop="weight">
|
|
@@ -80,7 +79,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="权重唯一:" prop="isOnlyWeight">
|
|
|
<el-select v-model="dialogForm.isOnlyWeight" placeholder="权重是否唯一">
|
|
|
- <el-option v-for="item in dict.type.hot_yes_no" :key="item.value" :label="item.label"
|
|
|
+ <el-option v-for="item in onlyOptions" :key="item.value" :label="item.label"
|
|
|
:value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -178,9 +177,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { list, detail, showOrHide, recommend, commentShowOrHide, typeList } from '@/api/ohplay/content'
|
|
|
+import { list, detail, showOrHide, recommend, commentShowOrHide, } from '@/api/ohplay/content'
|
|
|
+import { classifyMixin, typeMixin } from '../mixin/index'
|
|
|
export default {
|
|
|
- dicts: ['hot_yes_no'],
|
|
|
+ mixins: [classifyMixin, typeMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -207,18 +207,24 @@ export default {
|
|
|
isOnlyWeight: '',
|
|
|
dialogDate: [],
|
|
|
},
|
|
|
- // 推荐位置
|
|
|
- locationOptions: [],
|
|
|
- // 内容类型
|
|
|
- typeOptions: [
|
|
|
- { value: 0, label: '帖子' },
|
|
|
- { value: 1, label: '图片' }
|
|
|
- ],
|
|
|
// 当前状态
|
|
|
- statusOptions: [
|
|
|
- { value: 0, label: '显示' },
|
|
|
- { value: 1, label: '隐藏' }
|
|
|
- ],
|
|
|
+ statusOptions: [{
|
|
|
+ value: 0,
|
|
|
+ label: '显示'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '隐藏'
|
|
|
+ }],
|
|
|
+ // 权重是否唯一
|
|
|
+ onlyOptions: [{
|
|
|
+ value: 0,
|
|
|
+ label: '否'
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ label: '是'
|
|
|
+ }],
|
|
|
+
|
|
|
// 校验
|
|
|
rules: {
|
|
|
tagId: [{
|
|
@@ -247,7 +253,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getTypeList()
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
@@ -288,15 +293,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 内容分类
|
|
|
- getTypeList() {
|
|
|
- typeList().then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.locationOptions = res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
// 隐藏或显示
|
|
|
getChange(row, type) {
|
|
|
showOrHide(row.id, type).then(res => {
|