Commit 4b7d6818 authored by 曹泽华's avatar 曹泽华

话题管理

parent 6ac32e51
......@@ -19,6 +19,7 @@ const yesOrNo = [
]
const isExam = [
{ value: '0', label: '未审核' },
{ value: '1', label: '已审核' }
{ value: '0', label: '待审核' },
{ value: '1', label: '已通过' },
{ value: '2', label: '已审核' }
]
......@@ -69,10 +69,10 @@
<el-table-column align="center" prop="topicName" label="话题名称" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="examStatus" label="审核状态" min-width="200" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.examStatus === '1' ? '已审核' : '未审核' }}</span>
<span>{{ scope.row.examStatus === '0' ? '待审核' : scope.row.examStatus === '1' ? '已通过' : '已驳回' }}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="weight" label="排序" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="weight" label="权重" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="articleCount" label="动态数" min-width="200" show-overflow-tooltip />
<el-table-column align="left" prop="flag" label="状态" min-width="120" show-overflow-tooltip>
......@@ -115,19 +115,19 @@
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
v-show="scope.row.examStatus === '0'"
v-show="scope.row.examStatus !== '1'"
:class="commonField.resetPasClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleExam(scope.row)"
>审核</el-button>
<el-button
v-show="scope.row.examStatus === '1'"
:class="commonField.resetPasClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleNoExam(scope.row)"
>撤回审核</el-button>
<!-- <el-button-->
<!-- v-show="scope.row.examStatus === '1'"-->
<!-- :class="commonField.resetPasClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleNoExam(scope.row)"-->
<!-- >撤回审核</el-button>-->
<el-button
:class="commonField.resetPasClass"
:type="commonField.typeParent"
......@@ -154,15 +154,15 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="话题名称:" prop="topicName">
<el-form-item label="名称:" prop="topicName">
<el-input v-model.trim="form.topicName" show-word-limit :maxlength="500" placeholder="请输入话题名称" />
</el-form-item>
<el-form-item label="权重:" prop="weight">
<el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item>
<!-- <el-form-item label="动态数:" prop="articleCount">-->
<!-- <el-input-number v-model.trim="form.articleCount" style="width: 100%" controls-position="right" :min="0" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="动态数:" prop="articleCount">-->
<!-- <el-input-number v-model.trim="form.articleCount" style="width: 100%" controls-position="right" :min="0" />-->
<!-- </el-form-item>-->
<el-form-item label="状态:">
<el-radio-group v-model="form.flag" style="width: 100%">
<el-radio
......@@ -206,7 +206,7 @@ export default {
return {
pageKey: 0,
open: false,
title: '新增话题',
title: '',
hasAddPerm: ['sys:topic:add'],
hasUpdatePerm: ['sys:topic:update'],
hasDetailPerm: ['sys:topic:query'],
......@@ -223,12 +223,9 @@ export default {
enableOrDisable,
// 新增课程
form: {
id: '',
topicName: '',
examStatus: '',
weight: '',
articleCount: '',
flag: ''
flag: '1'
},
// 课程方向
courseDirection: [],
......@@ -307,11 +304,7 @@ export default {
],
weight: [
{ required: true, message: '请输入排序' }
],
articleCount: [
{ required: true, message: '请输入动态数' }
{ required: true, message: '请输入权重' }
]
}
......@@ -346,6 +339,7 @@ export default {
this.loadData()
},
methods: {
step(index) {
return 'step' + index
},
......@@ -388,31 +382,31 @@ export default {
if (this.form.businessId !== undefined) {
updateOpmTopic(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.loadData()
this.cancel()
})
} else {
addOpmTopic(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.loadData()
this.cancel()
})
}
}
})
},
cancel() {
this.reset()
this.$refs['form'].resetFields()
this.open = false
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
topicName: undefined,
weight: undefined,
articleCount: undefined,
flag: '0'
flag: '1'
}
},
......@@ -483,12 +477,14 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.open = true
this.title = '新增话题'
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset()
this.reset()
const id = row.businessId
console.log('id', id)
console.log('row', row)
getOpmTopic(id).then(response => {
this.form = response.data
this.open = true
......
......@@ -56,8 +56,8 @@
<el-col :span="12">
<!-- 是否置顶-->
<el-form-item
label="排序:"
prop="isTop"
label="权重:"
prop="weight"
:rules="{ required: !(controls.isOperation === '3'), message: '请选择排序', trigger: 'change' }"
>
<el-input-number v-model="form.weight" placeholder="请选择是否置顶公告" size="small" class="normalInput" :disabled="secondFromDisabled">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment