| | |
| | | <div class="mainContent"> |
| | | <div class="main-nav"> |
| | | <span>数据列表</span> |
| | | <el-button type="primary" icon="el-icon-plus" @click="dialogCreate = true">添加</el-button> |
| | | <el-button class="button-addition" type="primary" icon="el-icon-plus" @click="dialogCreate = true">添加</el-button> |
| | | </div> |
| | | <!-- 数据展示 --> |
| | | <el-table ref="multipleTable" |
| | |
| | | tableData: [], |
| | | dialogCreate: false, |
| | | dialogEdit:false, |
| | | totalNum: null, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | all: false, |
| | |
| | | }, |
| | | // 删除数据 |
| | | handleDelete(idArr) { |
| | | console.log(idArr); |
| | | this.$confirm('是否确定确定删除栏目?') |
| | | .then(_ => { |
| | | this.$axios({ |
| | |
| | | }) |
| | | }) |
| | | .catch(err=>{ |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | // 修改栏目状态 |
| | | handleChangeStatus({ id, status }) { |
| | | console.log(id, status); |
| | | status === true ? status = 1 : status = 0; |
| | | handleChangeStatus({ id, isShow }) { |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: `sccg/message_column/update/${id}`, |
| | | data: { |
| | | isShow: status, |
| | | isShow: Number(isShow), |
| | | } |
| | | }) |
| | | .then(res => { |
| | |
| | | item.isShow === 1 ? item.isShow = true : item.isShow = false; |
| | | }) |
| | | arr = res.data |
| | | // console.log(res); |
| | | }) |
| | | return arr; |
| | | }, |
| | | // 设置表格数据 |
| | | async setTableData() { |
| | | this.tableData = await this.getColumnList(); |
| | | this.totalNum = this.tableData.length; |
| | | }, |
| | | // 下拉框监听 |
| | | async selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | this.preMyIdx = list; |
| | | if (list === 3) { |
| | |
| | | message: res.message |
| | | }) |
| | | } |
| | | console.log(res); |
| | | }) |
| | | }) |
| | | .catch(err => { console.log(err) }) |
| | | .catch(err => { }) |
| | | }, |
| | | // 表格状态监听 |
| | | tableChange(list) { |
| | |
| | | done(); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | // 自定义关闭弹窗 |