“dzb”
2022-09-29 dc04c05b22a5323925218092a0687555a2a5c9c1
src/views/systemSetting/baseSetting/role/index.vue
@@ -57,7 +57,7 @@
                                <span class="line">|</span>
                                <span @click="handleStop(scope.row)">停用</span>
                                <span class="line">|</span>
                                <span @click="handleDelete(scope.row)">删除</span>
                                <span @click="handleDelete([scope.row.id])">删除</span>
                            </div>
                        </template>
                    </el-table-column>
@@ -118,6 +118,7 @@
            all: false,
            unsame: false,
            myIdx: 0,
            preMyIdx: 0,
            options: [
                {
                    value: 0,
@@ -145,11 +146,25 @@
    },
    methods: {
        selectChange(list) {
            console.log(list);
            console.log(this.tempList);
            if (this.tempList.length !== 0) {
                if (list === 3) {
                    this.preMyIdx = list;
                    this.handleDelete(this.tempList);
                }
            } else {
                this.myIdx = this.preMyIdx;
                this.$message({
                    type: 'warning',
                    message: '您还没选中任何数据',
                })
            }
        },
        tableChange(list) {
            this.tempList = list;
            this.tempList = [];
            list.forEach(item => {
                this.tempList.push(item.id);
            })
            if (list.length === this.tableData.length) {
                this.all = true;
            } else {
@@ -160,27 +175,26 @@
            return helper(createTime);
        },
        selectAll() {
            this.$refs.multipleTable.toggleAllSelection();
        },
        disSame(list) {
            // console.log(this.$refs.multipleTable);
            // const row = this.$refs.table.data
            list.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row)
            })
        },
        handleDelete({ id }) {
        handleDelete(id) {
            const that = this;
            let arr = [];
            arr.push(id);
            // let arr = [];
            // arr.push(id);
            this.$confirm('确认删除?')
                .then(_ => {
                    that.$axios({
                        method: 'post',
                        url: 'sccg/role/delete?ids=' + arr,
                        url: 'sccg/role/delete?ids=' + id,
                    })
                        .then(res => {
                            this.myIdx = 0;
                            this.preMyIdx = 0;
                            console.log(res);
                            this.$message({
                                type: 'success',
@@ -295,7 +309,10 @@
        },
        changeDialog(val) {
            this.dialogUpdate = val.dialogUpdate;
            console.log(val);
            this.$message({
                type:'success',
                message:'更改成功',
            })
        },
        handleClose(done) {
            this.$confirm('确认关闭?')