zhanghua
2022-11-16 cc9ddf2ecaf3ad935374f49c842227f7eb15779d
src/views/operate/myWait/index.vue
@@ -9,7 +9,7 @@
                    <span>筛选条件:</span>
                    <el-input placeholder="请输入内容" v-model="context"></el-input>
                    <div class="findBtn">
                        <el-button type="primary" @click="getUserList">查询</el-button>
                        <el-button type="primary" @click="getTableData">查询</el-button>
                    </div>
                </div>
            </div>
@@ -27,43 +27,34 @@
                    </el-table-column>
                    <el-table-column prop="eventSource" label="问题来源" min-width="10">
                        <template slot-scope="scope">
                            <span>{{scope.row.eventSource===1 ? '视频巡查': '人工上报'}}</span>
                            <span>{{scope.row}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="category" label="问题类别" min-width="10">
                        <template slot-scope="scope">
                            <span>{{scope.row.category===1 ? '违规': '违建'}}</span>
                            <span>{{scope.row}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="createTime" label="创建时间" min-width="10">
                        <template slot-scope="scope">
                            <span>{{changeTime(scope.row.createTime)}}</span>
                            <span>{{changeTime(scope.row)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="type" label="剩余时间" min-width="10">
                        <template slot-scope="scope">
                            <span>{{getRestTime(scope.row.limitTime)}}</span>
                            <span>{{getRestTime(scope.row)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="stepName" label="问题状态" min-width="10">
                    </el-table-column>
                    <el-table-column  min-width="10">
                    </el-table-column>
                    <!-- <el-table-column prop="operation" label="操作" min-width="10">
                        <template slot-scope="scope">
                            <div class="operation">
                                <span @click="handleFind(scope.row)">查看</span>
                                <span class="line">|</span>
                                <span @click="handleDelete(scope.row)">删除</span>
                            </div>
                        </template>
                    </el-table-column> -->
                </el-table>
                <!-- 查看修改页面 -->
                <el-dialog :visible.sync="dialogUpdate" width="45%" :title="updateFlag ? '权限设置' :'查看角色信息'"
                    v-if="dialogUpdate" :before-close="handleClose">
                    <updateUser :updateFlag="updateFlag" :userInfo=userInfo
                        :getUserList=" context ? getUserList : getUserList" @changeDialog="changeDialog" />
                        :getTableData=" context ? getTableData : getTableData" @changeDialog="changeDialog" />
                </el-dialog>
                <!-- tools -->
                <div class="tools">
@@ -98,6 +89,8 @@
import createUser from "./createUser"
import {computeTime} from '@/utils/helper'
import filterTime from '@/utils/mydate'
import myWait from "@/api/operate/myWait";
export default {
    components: {
        updateUser,createUser
@@ -139,22 +132,19 @@
        }
    },
    created() {
        this.getUserList();
      this.getTableData();
    },
    methods: {
        // 批量删除
        mulDelete(idArr){
            console.log(idArr);
            this.$axios({
                method:'delete',
                url:'sccg/violations/batch_delete?ids='+idArr,
            }).then(res=>{
                this.getUserList();
                this.$message({
                    message:res.message,
                    type:res.code === 200 ? 'success' : 'warning'
                })
      getTableData() {
        myWait.getMybackLog({ num: this.context })
            .then(res => {
              this.tableData = res;
            })
            .catch(err => this.$message({ type: 'error', message: err }))
      },
      // 批量删除
        mulDelete(idArr){
        },
        // 执行下拉框操作
        selectChange(val) {
@@ -176,11 +166,7 @@
        // 监听表格选中状态
        tableChange(list) {
            this.tempList = list;
            if (list.length === this.tableData.length) {
                this.all = true;
            } else {
                this.all = false
            }
            this.all = list.length === this.tableData.length;
        },
        // 全选
        selectAll() {
@@ -194,39 +180,6 @@
        },
        // 删除单条数据
        handleDelete({ number }) {
            console.log(number);
            this.$confirm('确认删除?')
                .then(_ => {
                    console.log(1);
                    this.$axios({
                        method: 'delete',
                        url: `sccg/violations/delete?id=${number}`,
                    })
                        .then(res => {
                            console.log(res);
                            this.$message({
                                type: res.code === 200 ? 'success' : 'warning',
                                message: res.message
                            })
                            this.getUserList();
                        })
                })
                .catch(_ => { console.log(2) });
        },
        // 获取用户列表
        getUserList() {
            const { currentPage, pageSize, context } = this;
            // 获取所有用户信息
            this.$axios({
                method: 'get',
                // ?current=${currentPage},&size=${pageSize}&
                url: `sccg/my_backlog/query?num=${context}`,
            })
                .then(res => {
                    this.tableData = res.data;
                    this.totalNum = res.data.length;
                })
        },
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
@@ -235,7 +188,6 @@
            } else {
                return 'success-row';
            }
            return '';
        },
        // 查看用户信息(不可修改)
        handleFind(rowData) {
@@ -246,17 +198,17 @@
        // 当前页改变触发事件
        changeCurrentPage(page) {
            this.currentPage = page;
            this.getUserList();
            this.getTableData();
        },
        // 上一页点击事件
        handlePrev(page) {
            this.currentPage = page;
            this.getUserList();
            this.getTableData();
        },
        // 下一页点击事件
        handleNext(page) {
            this.currentPage = page;
            this.getUserList();
            this.getTableData();
        },
        changeDialog(val) {
            this.dialogUpdate = val.dialogUpdate;