|
@@ -54,7 +54,7 @@
|
|
|
@change="handleStatusChange(scope.$index, scope.row)"
|
|
|
:active-value="1"
|
|
|
:inactive-value="0"
|
|
|
- v-model="scope.row.status">
|
|
|
+ v-model="scope.row.showStatus">
|
|
|
</el-switch>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
@@ -115,7 +115,7 @@
|
|
|
style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="是否启用:">
|
|
|
- <el-radio-group v-model="subject.status">
|
|
|
+ <el-radio-group v-model="subject.showStatus">
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
@@ -130,7 +130,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import {fetchList, createsubject, updatesubject, deletesubject, subjectTypeList} from '@/api/subject';
|
|
|
+ import {fetchList, createsubject, updatesubject, deletesubject, subjectTypeList, updateStatus} from '@/api/subject';
|
|
|
import {formatDate} from '@/utils/date';
|
|
|
// import {createuse,updateuse,deleteuse,roleuse} from '@/api/permissions'
|
|
|
import SingleUpload from '@/components/Upload/singleUpload'
|
|
@@ -148,7 +148,7 @@
|
|
|
categoryId:null,
|
|
|
description: null,
|
|
|
pic:'',
|
|
|
- status: 1
|
|
|
+ showStatus: 1
|
|
|
};
|
|
|
export default {
|
|
|
components: {SingleUpload},
|
|
@@ -213,26 +213,26 @@
|
|
|
this.subject.categoryId = obj[0].id
|
|
|
}
|
|
|
},
|
|
|
- // handleStatusChange(index, row) {
|
|
|
- // this.$confirm('是否要修改该状态?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // }).then(() => {
|
|
|
- // updateStatus(row.id, {status: row.status}).then(response => {
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: '修改成功!'
|
|
|
- // });
|
|
|
- // });
|
|
|
- // }).catch(() => {
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: '取消修改'
|
|
|
- // });
|
|
|
- // this.getList();
|
|
|
- // });
|
|
|
- // },
|
|
|
+ handleStatusChange(index, row) {
|
|
|
+ this.$confirm('是否要修改该状态?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ updateStatus(row.id, {showStatus: row.showStatus}).then(response => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改成功!'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '取消修改'
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
handleDelete(index, row) {
|
|
|
this.$confirm('是否要删除该专题?', '提示', {
|
|
|
confirmButtonText: '确定',
|