“dzb”
2022-10-04 797cc9c1a5c90f413d46c5cb88e1ee5e3a84b071
src/views/operate/management/myIndex/index.vue
@@ -10,21 +10,19 @@
            </div>
            <div class="status">
                <div class="status-title">审核状态</div>
                <el-radio-group v-model="mystatus">
                    <el-radio :label="1">待审核</el-radio>
                    <el-radio :label="2">已审核</el-radio>
                    <el-radio :label="3">已结案</el-radio>
                <el-radio-group v-model="instatus">
                    <el-radio :label="7">待审核</el-radio>
                    <el-radio :label="8">已审核</el-radio>
                    <el-radio :label="9">已结案</el-radio>
                </el-radio-group>
            </div>
        </header>
        <!-- <el-button @click="dialogCreate = true">打开</el-button>
        <div class="dialog">
            <el-dialog title="审核详情页面" v-if="dialogCreate" :visible.sync="dialogCreate" width="80%" :before-close="handleClose">
                <MyDetail />
            </el-dialog>
        </div> -->
        <main>
            <div class="mainContent">
                <div class="type-nav">
                    <div @click="changeTypeChecked(index)" v-for="(item,index) in typeList" :key="item.name"
                        :class="[item.checked ? 'is-active':'','type-item']">{{item.name}}</div>
                </div>
                <!-- 数据展示 -->
                <el-table ref="multipleTable"
                    :header-cell-style="{background:'#06122c','font-size':'12px',color:'#4b9bb7','font-weight':'650','line-height':'45px'}"
@@ -32,31 +30,42 @@
                    @selection-change="tableChange">
                    <el-table-column type="selection" min-width="5">
                    </el-table-column>
                    <el-table-column prop="name" label="角色名称" min-width="10">
                    </el-table-column>
                    <el-table-column prop="sort" label="角色类型" min-width="10">
                    </el-table-column>
                    <el-table-column prop="adminCount" label="默认角色" min-width="10">
                    </el-table-column>
                    <el-table-column prop="description" label="备注" min-width="10">
                    </el-table-column>
                    <el-table-column prop="status" label="启用" min-width="5">
                    <el-table-column prop="id" label="事件编号" min-width="10">
                        <template slot-scope="scope">
                            <el-switch class="switchStyle" v-model="scope.row.status" active-text="开" inactive-text="关"
                                active-color="#3fef9a" inactive-color="#000212" @change="handleChangeStatus(scope.row)">
                            </el-switch>
                            <el-link @click="JumpView(scope.row)">{{scope.row.id}}</el-link>
                        </template>
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="15">
                    <el-table-column prop="eventSource" label="问题来源" min-width="10">
                    </el-table-column>
                    <el-table-column prop="category" label="大类名称" min-width="10">
                    </el-table-column>
                    <el-table-column prop="type" label="小类名称" min-width="10">
                    </el-table-column>
                    <el-table-column prop="actionCause" label="案由" min-width="10">
                    </el-table-column>
                    <el-table-column prop="site" label="报警点位" min-width="10">
                    </el-table-column>
                    <el-table-column prop="streetId" label="所属区域" min-width="10">
                    </el-table-column>
                    <el-table-column prop="alarmTime" label="报警时间" min-width="10">
                    </el-table-column>
                    <el-table-column prop="continueTime" label="持续时间" min-width="10">
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="20">
                        <template slot-scope="scope">
                            <div class="operation">
                                <span>查看</span>
                            <div class="btn">
                                <span @click="handleExamine(scope.row)">审核</span>
                                <span class="line">|</span>
                                <span>结案</span>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <!-- 审核页面 -->
                <el-dialog :visible.sync="dialogExamine" width="80%" title="基础信息(人工)" v-if="dialogExamine"
                    :before-close="handleClose">
                    <MyExamine :info="info" @closeDialog="closeDialog"></MyExamine>
                </el-dialog>
                <!-- tools -->
                <div class="tools">
                    <div class="funs">
@@ -86,16 +95,16 @@
    </div>
</template>
<script>
import helper from "@/utils/mydate.js"
import MyDetail from "@/components/detail"
import MyExamine from './components/examine'
export default {
    components:{
        MyDetail,
    components: {
        MyExamine
    },
    data() {
        return {
            tableData: [],
            dialogCreate: false,
            dialogExamine:false,
            info: {},
            totalNum: null,
            pageSize: 10,
            currentPage: 1,
@@ -123,20 +132,48 @@
                }
            ],
            tempList: [],
            myproblem: 0,
            mystatus: 0,
            typeList: [
                {
                    name: '违规',
                    value: 1,
                    checked: true
                },
                {
                    name: '违建',
                    value: 2,
                    checked: false,
                },
            ],
            caseId: '',
            myproblem: 1,
            instatus: 7,
        }
    },
    created() {
        this.getUserList();
    },
    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'
                })
            })
        },
        // 执行下拉框操作
        selectChange(list) {
            console.log(this.tempList);
            if (this.tempList.length !== 0) {
                if (list === 3) {
                    this.preMyIdx = list;
                    this.handleDelete(this.tempList);
                    this.mulDelete(this.tempList);
                }
            } else {
                this.myIdx = this.preMyIdx;
@@ -146,10 +183,11 @@
                })
            }
        },
        // 监听表格
        tableChange(list) {
            this.tempList = [];
            list.forEach(item => {
                this.tempList.push(item.id);
                this.tempList.push(item.code);
            })
            if (list.length === this.tableData.length) {
                this.all = true;
@@ -157,97 +195,59 @@
                this.all = false
            }
        },
        changeTime({ createTime }) {
            return helper(createTime);
        },
        // 全选
        selectAll() {
            this.$refs.multipleTable.toggleAllSelection();
        },
        // 反选
        disSame(list) {
            list.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row)
            })
        },
        handleDelete(id) {
            const that = this;
            // let arr = [];
            // arr.push(id);
        // 删除单条数据
        handleDelete({ number }) {
            console.log(number);
            this.$confirm('确认删除?')
                .then(_ => {
                    that.$axios({
                        method: 'post',
                        url: 'sccg/role/delete?ids=' + id,
                    console.log(1);
                    this.$axios({
                        method: 'delete',
                        url: `sccg/violations/delete?id=${number}`,
                    })
                        .then(res => {
                            this.myIdx = 0;
                            this.preMyIdx = 0;
                            console.log(res);
                            this.$message({
                                type: 'success',
                                type: res.code === 200 ? 'success' : 'warning',
                                message: res.message
                            })
                            this.getUserList();
                        })
                })
                .catch(_ => { });
        },
        // 修改角色
        handleChangeRole(obj) {
            this.dialogUpdate = true
            this.user = obj;
            // console.log(obj)
        },
        // 修改用户状态
        handleChangeStatus(obj) {
            let { id, status } = obj;
            status == true ? status = 1 : status = 0;
            console.log(id, status);
            this.$axios.post(`/sccg/role/updateStatus/` + id + '?status=' + status).then(res => {
                console.log(res);
            })
                .catch(_ => { console.log(2) });
        },
        // 获取用户列表
        getUserList() {
            const that = this;
            this.dialogCreate = false;
            // 获取所有用户信息
            this.$axios.get('sccg/role/listAll').then(res => {
                this.totalNum = res.data.length;
                this.search();
            const { currentPage, pageSize, instatus, myproblem } = this;
            this.$axios({
                method: 'get',
                url: `sccg/base_case/query?state=${instatus}&current=${currentPage}&size=${pageSize}&resource=2&type=${myproblem}`
            }).then(res => {
                this.totalNum = res.data.total;
                this.tableData = res.data.records;
            })
        },
        search() {
            const that = this;
            const { currentPage, pageSize, context } = this;
            this.dialogCreate = false;
            // 获取所有用户信息
            if (context == '') {
                this.$axios.get('sccg/role/list?keyword=' + '&pageNum=' + currentPage + '&pageSize=' + pageSize).then(res => {
                    if (res.code === 200) {
                        console.log(res);
                        res.data.list.forEach(item => {
                            // item.createTime = helper(item.createTime);
                            item.status == 1 ? item.status = true : item.status = false;
                        })
                        that.tableData = res.data.list;
                        this.totalNum = res.data.list.length;
                    }
                })
            } else {
                this.$axios({
                    method: 'get',
                    url: 'sccg/role/list?keyword=' + context + '&pageNum=' + currentPage + '&pageSize=' + pageSize,
                }).then(res => {
                    if (res.code === 200) {
                        res.data.list.forEach(item => {
                            item.status == 1 ? item.status = true : item.status = false;
                        })
                        that.tableData = res.data.list
                        this.totalNum = res.data.list.length;
                    }
                })
            }
        // 更改违规/违建
        changeTypeChecked(idx) {
            this.typeList.forEach((item, index) => {
                if (index === idx) {
                    item.checked = true;
                } else {
                    item.checked = false;
                }
            })
            this.getUserList();
        },
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
@@ -258,47 +258,51 @@
            }
            return '';
        },
        // 查看用户信息(不可修改)
        handleFind(rowData) {
            this.dialogUpdate = true;
            this.updateFlag = false;
            this.userInfo = rowData;
        },
        // 修改用户部门信息
        handleUpdate(rowData) {
            this.dialogUpdate = true;
            this.updateFlag = true;
            this.userInfo = rowData
        },
        // 当前页改变触发事件
        changeCurrentPage(page) {
            this.currentPage = page;
            this.search();
            this.getUserList();
        },
        // 上一页点击事件
        handlePrev(page) {
            this.currentPage = page;
            this.search();
            this.getUserList();
        },
        // 下一页点击事件
        handleNext(page) {
            this.currentPage = page;
            this.search();
        },
        changeDialog(val) {
            this.dialogUpdate = val.dialogUpdate;
            this.$message({
                type: 'success',
                message: '更改成功',
            })
            this.getUserList();
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
                    this.dialogCreate = false;
                    this.dialogExamine = false;
                    done();
                })
                .catch(_ => { });
        },
        async JumpView(data) {
            await this.getEventInfo(data.code);
        },
        // 获取案件信息
        getEventInfo(code) {
            this.$axios({
                method: 'get',
                url: `sccg/base_case/baseCaseDetail/${code}`
            })
                .then(res => {
                    console.log(res);
                    this.info = res.data;
                    this.dialogExamine = true;
                })
        },
        // 去审核
        handleExamine({code}) {
            this.getEventInfo(code);
        },
        // 关闭dialog
        closeDialog({flag}){
            this.dialogExamine = flag;
        }
    }
}
@@ -326,14 +330,38 @@
        }
    }
    &::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
    }
    main {
        background-color: #09152f;
        margin-top: 20px;
        padding-bottom: 50px;
        border: 1pox solid #fff;
        .mainTitle {
            line-height: 60px;
        .type-nav {
            display: flex;
            line-height: 40px;
            margin-left: 30px;
            padding-top: 10px;
            margin-bottom: 10px;
            .type-item {
                width: 80px;
                text-align: center;
                &:hover {
                    cursor: pointer;
                }
            }
            .is-active {
                background-color: #070f22;
                border-radius: 4px;
                color: #fff;
            }
        }
        .tools {
@@ -406,6 +434,12 @@
            color: #4b9bb7;
            font-size: 10px;
            &::v-deep .cell {
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
            }
            &::v-deep .el-table__empty-block {
                background-color: #09152f;
            }
@@ -465,6 +499,10 @@
        }
    }
    .line {
        padding: 0 5px;
    }
    &::v-deep .el-dialog__header,
    &::v-deep .el-dialog__body {
        background-color: #06122c;