fangyuan
2022-12-16 9ff66017debadfc89bc0c1b796684a4d1dbe2bc3
src/views/operate/message/mycontrol/index.vue
@@ -4,7 +4,7 @@
            <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"
@@ -49,30 +49,6 @@
                    :before-close="handleClose">
                    <MyEdit  @closeDialog="closeDialog" :info="info"></MyEdit>
                </el-dialog>
                <!-- tools -->
                <!-- <div class="tools">
                    <div class="funs">
                        <div class="funsItem">
                            <el-checkbox v-model="all" @change="selectAll()">全选</el-checkbox>
                        </div>
                        <div class="funsItem">
                            <el-checkbox v-model="unsame" @change="disSame(tableData)">反选</el-checkbox>
                        </div>
                        <div class="funsItem">
                            <el-select v-model="myIdx" placeholder="批量操作" @change="selectChange">
                                <el-option v-for="item in options" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                    <div class="pagination">
                        <el-pagination background :current-page="currentPage" layout="prev, pager, next"
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"
                            @prev-click="handlePrev" @next-click="handleNext">
                        </el-pagination>
                    </div>
                </div> -->
            </div>
        </main>
    </div>
@@ -93,7 +69,6 @@
            tableData: [],
            dialogCreate: false,
            dialogEdit:false,
            totalNum: null,
            pageSize: 10,
            currentPage: 1,
            all: false,
@@ -134,7 +109,6 @@
        },
        // 删除数据
        handleDelete(idArr) {
            console.log(idArr);
            this.$confirm('是否确定确定删除栏目?')
                .then(_ => {
                    this.$axios({
@@ -152,18 +126,15 @@
                        })
                })
                .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 => {
@@ -184,18 +155,15 @@
                        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) {
@@ -235,10 +203,9 @@
                                    message: res.message
                                })
                            }
                            console.log(res);
                        })
                })
                .catch(err => { console.log(err) })
                .catch(err => {  })
        },
        // 表格状态监听
        tableChange(list) {
@@ -297,7 +264,6 @@
                    done();
                })
                .catch(err => {
                    console.log(err);
                })
        },
        // 自定义关闭弹窗