branch_lyj
Liuyujie 7 months ago
parent aa13a6a04d
commit 8e314e8961

@ -1,9 +1,14 @@
<template>  <template>
<!-- 整个页面的容器用于包裹内部的各个组件 -->
<div class="app-container"> <div class="app-container">
<!-- el-card组件作为筛选搜索区域的容器设置阴影效果为"never"即无阴影 -->
<el-card class="filter-container" shadow="never"> <el-card class="filter-container" shadow="never">
<div> <div>
<!-- 使用el-icon-search图标用于表示搜索相关的视觉元素 -->
<i class="el-icon-search"></i> <i class="el-icon-search"></i>
<!-- 显示"筛选搜索"的文字提示 -->
<span>筛选搜索</span> <span>筛选搜索</span>
<!-- el-button按钮组件样式设置为右浮动按钮类型为"primary"主要按钮样式通常为主题色等突出显示点击时调用handleSearchList方法按钮大小为"small" -->
<el-button <el-button
style="float:right" style="float:right"
type="primary" type="primary"
@ -11,6 +16,7 @@
size="small"> size="small">
查询搜索 查询搜索
</el-button> </el-button>
<!-- el-button按钮组件样式设置为右浮动且距离右边距15px点击时调用handleResetSearch方法按钮大小为"small"用于重置相关操作 -->
<el-button <el-button
style="float:right;margin-right: 15px" style="float:right;margin-right: 15px"
@click="handleResetSearch()" @click="handleResetSearch()"
@ -19,12 +25,18 @@
</el-button> </el-button>
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<!-- el-form表单组件设置为行内表单形式绑定的数据模型是listQuery表单尺寸为"small"标签宽度为140px -->
<el-form :inline="true" :model="listQuery" size="small" label-width="140px"> <el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<!-- el-form-item表单项目组件用于输入框的包裹此处对应的标签文本为"专题名称:" -->
<el-form-item label="专题名称:"> <el-form-item label="专题名称:">
<!-- el-input输入框组件双向绑定数据到listQuery.subjectName设置输入框的类名为"input-width"有相应的占位提示文字 -->
<el-input v-model="listQuery.subjectName" class="input-width" placeholder="专题名称"></el-input> <el-input v-model="listQuery.subjectName" class="input-width" placeholder="专题名称"></el-input>
</el-form-item> </el-form-item>
<!-- el-form-item表单项目组件用于下拉选择框的包裹对应的标签文本为"推荐状态:" -->
<el-form-item label="推荐状态:"> <el-form-item label="推荐状态:">
<!-- el-select下拉选择框组件双向绑定数据到listQuery.recommendStatus有相应的占位提示文字可清空选择设置类名为"input-width" -->
<el-select v-model="listQuery.recommendStatus" placeholder="全部" clearable class="input-width"> <el-select v-model="listQuery.recommendStatus" placeholder="全部" clearable class="input-width">
<!-- 通过v-for循环遍历recommendOptions数组生成el-option下拉选项每个选项根据item中的属性设置相应的键显示标签和值 -->
<el-option v-for="item in recommendOptions" <el-option v-for="item in recommendOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
@ -35,24 +47,34 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
<!-- el-card组件作为操作相关区域的容器设置阴影效果为"never"即无阴影 -->
<el-card class="operate-container" shadow="never"> <el-card class="operate-container" shadow="never">
<!-- 使用el-icon-tickets图标用于表示相关操作的视觉元素 -->
<i class="el-icon-tickets"></i> <i class="el-icon-tickets"></i>
<!-- 显示"数据列表"的文字提示 -->
<span>数据列表</span> <span>数据列表</span>
<!-- el-button按钮组件按钮尺寸为"mini"点击时调用handleSelectSubject方法按钮样式类名为"btn-add"用于选择专题操作 -->
<el-button size="mini" class="btn-add" @click="handleSelectSubject()"></el-button> <el-button size="mini" class="btn-add" @click="handleSelectSubject()"></el-button>
</el-card> </el-card>
<!-- 作为表格显示区域的容器 -->
<div class="table-container"> <div class="table-container">
<!-- el-table表格组件引用了ref为"newSubjectTable"绑定的数据为list设置宽度为100%监听行选择变化事件绑定加载状态到listLoading变量显示表格边框 -->
<el-table ref="newSubjectTable" <el-table ref="newSubjectTable"
:data="list" :data="list"
style="width: 100%;" style="width: 100%;"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
v-loading="listLoading" border> v-loading="listLoading" border>
<!-- el-table-column表格列组件设置列类型为"selection"用于行选择的复选框列宽度为60px内容居中对齐 -->
<el-table-column type="selection" width="60" align="center"></el-table-column> <el-table-column type="selection" width="60" align="center"></el-table-column>
<!-- el-table-column表格列组件对应的标签为"编号"宽度为120px内容居中对齐通过插槽作用域展示对应行数据中的id属性 -->
<el-table-column label="编号" width="120" align="center"> <el-table-column label="编号" width="120" align="center">
<template slot-scope="scope">{{scope.row.id}}</template> <template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"专题名称"内容居中对齐通过插槽作用域展示对应行数据中的subjectName属性 -->
<el-table-column label="专题名称" align="center"> <el-table-column label="专题名称" align="center">
<template slot-scope="scope">{{scope.row.subjectName}}</template> <template slot-scope="scope">{{scope.row.subjectName}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"是否推荐"宽度为200px内容居中对齐内部包含一个el-switch开关组件用于切换推荐状态绑定相应的事件和值 -->
<el-table-column label="是否推荐" width="200" align="center"> <el-table-column label="是否推荐" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -63,12 +85,15 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"排序"宽度为160px内容居中对齐通过插槽作用域展示对应行数据中的sort属性 -->
<el-table-column label="排序" width="160" align="center"> <el-table-column label="排序" width="160" align="center">
<template slot-scope="scope">{{scope.row.sort}}</template> <template slot-scope="scope">{{scope.row.sort}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"状态"宽度为160px内容居中对齐通过过滤器formatRecommendStatus对推荐状态数据进行格式化展示 -->
<el-table-column label="状态" width="160" align="center"> <el-table-column label="状态" width="160" align="center">
<template slot-scope="scope">{{scope.row.recommendStatus | formatRecommendStatus}}</template> <template slot-scope="scope">{{scope.row.recommendStatus | formatRecommendStatus}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"操作"宽度为180px内容居中对齐内部包含两个el-button按钮组件分别用于设置排序和删除操作绑定对应的点击事件 -->
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" <el-button size="mini"
@ -83,10 +108,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<!-- 作为批量操作区域的容器 -->
<div class="batch-operate-container"> <div class="batch-operate-container">
<!-- el-select下拉选择框组件尺寸为"small"双向绑定数据到operateType有相应的占位提示文字 -->
<el-select <el-select
size="small" size="small"
v-model="operateType" placeholder="批量操作"> v-model="operateType" placeholder="批量操作">
<!-- 通过v-for循环遍历operates数组生成el-option下拉选项每个选项根据item中的属性设置相应的键显示标签和值 -->
<el-option <el-option
v-for="item in operates" v-for="item in operates"
:key="item.value" :key="item.value"
@ -94,6 +122,7 @@
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<!-- el-button按钮组件距离左边距20px样式类名为"search-button"点击时调用handleBatchOperate方法按钮类型为"primary"主要按钮样式按钮尺寸为"small"用于确定批量操作 -->
<el-button <el-button
style="margin-left: 20px" style="margin-left: 20px"
class="search-button" class="search-button"
@ -103,7 +132,9 @@
确定 确定
</el-button> </el-button>
</div> </div>
<!-- 作为分页区域的容器 -->
<div class="pagination-container"> <div class="pagination-container">
<!-- el-pagination分页组件设置背景色监听页面尺寸变化和当前页变化事件设置分页布局样式绑定每页显示数量可选的每页显示数量数组当前页码以及总数据量等相关属性 -->
<el-pagination <el-pagination
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@ -115,27 +146,35 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
<!-- el-dialog对话框组件标题为"选择专题"对话框显示状态双向绑定到selectDialogVisible变量宽度设置为50% -->
<el-dialog title="选择专题" :visible.sync="selectDialogVisible" width="50%"> <el-dialog title="选择专题" :visible.sync="selectDialogVisible" width="50%">
<!-- el-input输入框组件双向绑定数据到dialogData.listQuery.keyword设置宽度底边距以及尺寸等样式属性有相应的占位提示文字内部包含一个用于搜索操作的el-button按钮 -->
<el-input v-model="dialogData.listQuery.keyword" <el-input v-model="dialogData.listQuery.keyword"
style="width: 250px;margin-bottom: 20px" style="width: 250px;margin-bottom: 20px"
size="small" size="small"
placeholder="专题名称搜索"> placeholder="专题名称搜索">
<el-button slot="append" icon="el-icon-search" @click="handleSelectSearch()"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleSelectSearch()"></el-button>
</el-input> </el-input>
<!-- el-table表格组件绑定的数据为dialogData.list监听行选择变化事件显示表格边框 -->
<el-table :data="dialogData.list" <el-table :data="dialogData.list"
@selection-change="handleDialogSelectionChange" border> @selection-change="handleDialogSelectionChange" border>
<!-- el-table-column表格列组件设置列类型为"selection"用于行选择的复选框列宽度为60px内容居中对齐 -->
<el-table-column type="selection" width="60" align="center"></el-table-column> <el-table-column type="selection" width="60" align="center"></el-table-column>
<!-- el-table-column表格列组件对应的标签为"专题名称"内容居中对齐通过插槽作用域展示对应行数据中的title属性 -->
<el-table-column label="专题名称" align="center"> <el-table-column label="专题名称" align="center">
<template slot-scope="scope">{{scope.row.title}}</template> <template slot-scope="scope">{{scope.row.title}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"所属分类"宽度为160px内容居中对齐通过插槽作用域展示对应行数据中的categoryName属性 -->
<el-table-column label="所属分类" width="160" align="center"> <el-table-column label="所属分类" width="160" align="center">
<template slot-scope="scope">{{scope.row.categoryName}}</template> <template slot-scope="scope">{{scope.row.categoryName}}</template>
</el-table-column> </el-table-column>
<!-- el-table-column表格列组件对应的标签为"添加时间"宽度为160px内容居中对齐通过过滤器formatTime对时间数据进行格式化展示 -->
<el-table-column label="添加时间" width="160" align="center"> <el-table-column label="添加时间" width="160" align="center">
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template> <template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination-container"> <div class="pagination-container">
<!-- el-pagination分页组件设置背景色监听对话框内页面尺寸变化和当前页变化事件设置分页布局样式绑定对话框内每页显示数量当前页码以及总数据量等相关属性 -->
<el-pagination <el-pagination
background background
@size-change="handleDialogSizeChange" @size-change="handleDialogSizeChange"
@ -149,38 +188,50 @@
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div slot="footer"> <div slot="footer">
<!-- el-button按钮组件按钮尺寸为"small"点击时关闭对话框设置selectDialogVisible为false -->
<el-button size="small" @click="selectDialogVisible = false"> </el-button> <el-button size="small" @click="selectDialogVisible = false"> </el-button>
<!-- el-button按钮组件按钮尺寸为"small"按钮类型为"primary"主要按钮样式点击时调用handleSelectDialogConfirm方法用于确定操作 -->
<el-button size="small" type="primary" @click="handleSelectDialogConfirm()"> </el-button> <el-button size="small" type="primary" @click="handleSelectDialogConfirm()"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- el-dialog对话框组件标题为"设置排序"对话框显示状态双向绑定到sortDialogVisible变量宽度设置为40% -->
<el-dialog title="设置排序" <el-dialog title="设置排序"
:visible.sync="sortDialogVisible" :visible.sync="sortDialogVisible"
width="40%"> width="40%">
<!-- el-form表单组件绑定的数据模型是sortDialogData标签宽度为150px -->
<el-form :model="sortDialogData" <el-form :model="sortDialogData"
label-width="150px"> label-width="150px">
<!-- el-form-item表单项目组件对应的标签为"排序:"内部包含一个el-input输入框组件用于输入排序相关的值设置输入框宽度 -->
<el-form-item label="排序:"> <el-form-item label="排序:">
<el-input v-model="sortDialogData.sort" style="width: 200px"></el-input> <el-input v-model="sortDialogData.sort" style="width: 200px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer"> <span slot="footer">
<!-- el-button按钮组件点击时关闭对话框设置sortDialogVisible为false按钮尺寸为"small" -->
<el-button @click="sortDialogVisible = false" size="small"> </el-button> <el-button @click="sortDialogVisible = false" size="small"> </el-button>
<!-- el-button按钮组件按钮类型为"primary"主要按钮样式点击时调用handleUpdateSort方法按钮尺寸为"small"用于确定排序设置操作 -->
<el-button type="primary" @click="handleUpdateSort" size="small"> </el-button> <el-button type="primary" @click="handleUpdateSort" size="small"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {fetchList,updateRecommendStatus,deleteHomeSubject,createHomeSubject,updateHomeSubjectSort} from '@/api/homeSubject'; // '@/api/homeSubject'
import {fetchList as fetchSubjectList} from '@/api/subject'; import {fetchList,updateRecommendStatus,deleteHomeSubject,createHomeSubject,updateHomeSubjectSort} from '@/api/homeSubject';
import {formatDate} from '@/utils/date'; // '@/api/subject'fetchListfetchSubjectList
import {fetchList as fetchSubjectList} from '@/api/subject';
// '@/utils/date'formatDate
import {formatDate} from '@/utils/date';
const defaultListQuery = { //
const defaultListQuery = {
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
subjectName: null, subjectName: null,
recommendStatus: null recommendStatus: null
}; };
const defaultRecommendOptions = [ //
const defaultRecommendOptions = [
{ {
label: '未推荐', label: '未推荐',
value: 0 value: 0
@ -189,17 +240,25 @@
label: '推荐中', label: '推荐中',
value: 1 value: 1
} }
]; ];
export default {
export default {
name: 'homeSubjectList', name: 'homeSubjectList',
data() { data() {
return { return {
// defaultListQuery便
listQuery: Object.assign({}, defaultListQuery), listQuery: Object.assign({}, defaultListQuery),
// defaultRecommendOptions
recommendOptions: Object.assign({}, defaultRecommendOptions), recommendOptions: Object.assign({}, defaultRecommendOptions),
// null
list: null, list: null,
// null
total: null, total: null,
// truefalse
listLoading: false, listLoading: false,
//
multipleSelection: [], multipleSelection: [],
//
operates: [ operates: [
{ {
label: "设为推荐", label: "设为推荐",
@ -214,35 +273,43 @@
value: 2 value: 2
} }
], ],
// null
operateType: null, operateType: null,
selectDialogVisible:false, // falsetrue
dialogData:{ selectDialogVisible: false,
//
dialogData: {
list: null, list: null,
total: null, total: null,
multipleSelection:[], multipleSelection: [],
listQuery:{ listQuery: {
keyword: null, keyword: null,
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5
} }
}, },
sortDialogVisible:false, // falsetrue
sortDialogData:{sort:0,id:null} sortDialogVisible: false,
// id
sortDialogData: { sort: 0, id: null }
} }
}, },
created() { created() {
// getList
this.getList(); this.getList();
}, },
filters:{ filters: {
formatRecommendStatus(status){ // 1""""
if(status===1){ formatRecommendStatus(status) {
if (status === 1) {
return '推荐中'; return '推荐中';
}else{ } else {
return '未推荐'; return '未推荐';
} }
}, },
formatTime(time){ // "N/A"
if(time==null||time===''){ formatTime(time) {
if (time == null || time === '') {
return 'N/A'; return 'N/A';
} }
let date = new Date(time); let date = new Date(time);
@ -250,33 +317,42 @@
}, },
}, },
methods: { methods: {
// defaultListQuery
handleResetSearch() { handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery); this.listQuery = Object.assign({}, defaultListQuery);
}, },
// 1getList
handleSearchList() { handleSearchList() {
this.listQuery.pageNum = 1; this.listQuery.pageNum = 1;
this.getList(); this.getList();
}, },
handleSelectionChange(val){ // multipleSelection使
handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
// 1getList
handleSizeChange(val) { handleSizeChange(val) {
this.listQuery.pageNum = 1; this.listQuery.pageNum = 1;
this.listQuery.pageSize = val; this.listQuery.pageSize = val;
this.getList(); this.getList();
}, },
// getList
handleCurrentChange(val) { handleCurrentChange(val) {
this.listQuery.pageNum = val; this.listQuery.pageNum = val;
this.getList(); this.getList();
}, },
handleRecommendStatusStatusChange(index,row){ // updateRecommendStatusStatusid
this.updateRecommendStatusStatus(row.id,row.recommendStatus); handleRecommendStatusStatusChange(index, row) {
this.updateRecommendStatusStatus(row.id, row.recommendStatus);
}, },
handleDelete(index,row){ // deleteSubjectid
handleDelete(index, row) {
this.deleteSubject(row.id); this.deleteSubject(row.id);
}, },
handleBatchOperate(){ //
if (this.multipleSelection < 1) { //
handleBatchOperate() {
if (this.multipleSelection < 1) { //
this.$message({ this.$message({
message: '请选择一条记录', message: '请选择一条记录',
type: 'warning', type: 'warning',
@ -284,20 +360,20 @@
}); });
return; return;
} }
let ids = []; let ids = []; //
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id); ids.push(this.multipleSelection[i].id);
} }
if (this.operateType === 0) { if (this.operateType === 0) {
// //
this.updateRecommendStatusStatus(ids,1); this.updateRecommendStatusStatus(ids, 1);
} else if (this.operateType === 1) { } else if (this.operateType === 1) {
// //
this.updateRecommendStatusStatus(ids,0); this.updateRecommendStatusStatus(ids, 0);
} else if(this.operateType===2){ } else if (this.operateType === 2) {
// //
this.deleteSubject(ids); this.deleteSubject(ids);
}else { } else {
this.$message({ this.$message({
message: '请选择批量操作类型', message: '请选择批量操作类型',
type: 'warning', type: 'warning',
@ -305,27 +381,33 @@
}); });
} }
}, },
handleSelectSubject(){ //
this.selectDialogVisible=true; handleSelectSubject() {
this.dialogData.listQuery.keyword=null; this.selectDialogVisible = true;
this.getDialogList(); this.dialogData.listQuery.keyword = null;
this.getDialogList();//getDialogList
}, },
handleSelectSearch(){ //
this.getDialogList(); handleSelectSearch() {
this.getDialogList(); //getDialogList
}, },
//
handleDialogSizeChange(val) { handleDialogSizeChange(val) {
this.dialogData.listQuery.pageNum = 1; this.dialogData.listQuery.pageNum = 1; //1
this.dialogData.listQuery.pageSize = val; this.dialogData.listQuery.pageSize = val;
this.getDialogList(); this.getDialogList(); //getDialogList
}, },
//
handleDialogCurrentChange(val) { handleDialogCurrentChange(val) {
this.dialogData.listQuery.pageNum = val; this.dialogData.listQuery.pageNum = val;
this.getDialogList(); this.getDialogList(); //getDialogList
}, },
handleDialogSelectionChange(val){ // 使
handleDialogSelectionChange(val) {
this.dialogData.multipleSelection = val; this.dialogData.multipleSelection = val;
}, },
handleSelectDialogConfirm(){ //
handleSelectDialogConfirm() {
if (this.dialogData.multipleSelection < 1) { if (this.dialogData.multipleSelection < 1) {
this.$message({ this.$message({
message: '请选择一条记录', message: '请选择一条记录',
@ -337,8 +419,8 @@
let selectSubjects = []; let selectSubjects = [];
for (let i = 0; i < this.dialogData.multipleSelection.length; i++) { for (let i = 0; i < this.dialogData.multipleSelection.length; i++) {
selectSubjects.push({ selectSubjects.push({
subjectId:this.dialogData.multipleSelection[i].id, subjectId: this.dialogData.multipleSelection[i].id,
subjectName:this.dialogData.multipleSelection[i].title subjectName: this.dialogData.multipleSelection[i].title
}); });
} }
this.$confirm('使用要进行添加操作?', '提示', { this.$confirm('使用要进行添加操作?', '提示', {
@ -346,9 +428,9 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
createHomeSubject(selectSubjects).then(response=>{ createHomeSubject(selectSubjects).then(response => { //// createHomeSubject
this.selectDialogVisible=false; this.selectDialogVisible = false;
this.dialogData.multipleSelection=[]; this.dialogData.multipleSelection = [];
this.getList(); this.getList();
this.$message({ this.$message({
type: 'success', type: 'success',
@ -357,83 +439,89 @@
}); });
}); });
}, },
handleEditSort(index,row){ //
this.sortDialogVisible=true; handleEditSort(index, row) {
this.sortDialogData.sort=row.sort; this.sortDialogVisible = true;
this.sortDialogData.id=row.id; this.sortDialogData.sort = row.sort;
this.sortDialogData.id = row.id; //id
}, },
handleUpdateSort(){ //
handleUpdateSort() {
this.$confirm('是否要修改排序?', '提示', { this.$confirm('是否要修改排序?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
updateHomeSubjectSort(this.sortDialogData).then(response=>{ updateHomeSubjectSort(this.sortDialogData).then(response => { //updateHomeSubjectSort
this.sortDialogVisible=false; this.sortDialogVisible = false;
this.getList(); this.getList();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!' //updateHomeSubjectSort
}); });
}); });
}) })
}, },
//
getList() { getList() {
this.listLoading = true; this.listLoading = true; //true
fetchList(this.listQuery).then(response => { fetchList(this.listQuery).then(response => { //fetchList
this.listLoading = false; this.listLoading = false; //false
this.list = response.data.list; this.list = response.data.list; ////
this.total = response.data.total; this.total = response.data.total;
}) })
}, },
updateRecommendStatusStatus(ids,status){ //
this.$confirm('是否要修改推荐状态?', '提示', { updateRecommendStatusStatus(ids, status) {
this.$confirm('是否要修改推荐状态?', '提示', { //
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params=new URLSearchParams(); let params = new URLSearchParams(); //URLSearchParamsid
params.append("ids",ids); params.append("ids", ids);
params.append("recommendStatus",status); params.append("finalRecommendStatus", status);
updateRecommendStatus(params).then(response=>{ updateRecommendStatus(params).then(response => { //// updateRecommendStatus
this.getList(); this.getList();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!' //
}); });
}); });
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '已取消操作!' message: '已取消操作!' //
}); });
this.getList(); this.getList();
}); });
}, },
deleteSubject(ids){ //
this.$confirm('是否要删除该推荐?', '提示', { deleteSubject(ids) {
this.$confirm('是否要删除该推荐?', '提示', { //
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params=new URLSearchParams(); let params = new URLSearchParams(); //URLSearchParamsid
params.append("ids",ids); params.append("ids", ids);
deleteHomeSubject(params).then(response=>{ deleteHomeSubject(params).then(response => { //// deleteHomeSubject
this.getList(); this.getList();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!' //
}); });
}); });
}) })
}, },
getDialogList(){ //
fetchSubjectList(this.dialogData.listQuery).then(response=>{ getDialogList() {
this.dialogData.list=response.data.list; fetchSubjectList(this.dialogData.listQuery).then(response => { //fetchSubjectList
this.dialogData.total=response.data.total; this.dialogData.list = response.data.list; //
this.dialogData.total = response.data.total;
}) })
} }
} }
} }
</script> </script>
<style></style> <style></style>

Loading…
Cancel
Save