guanqb
2023-06-25 cbb804de745718bae961008b524bdbca86a6572e
src/views/home/components/rightContainer.vue
@@ -6,41 +6,16 @@
                    <div>值班信息(当日)</div>
                </div>
                <div class="table-box" v-show="!showMJL">
                    <el-table size="small" :height="tableHeight" :data="schedulingList" style="width: 100%;"
                        :header-cell-style="{ 'text-align': 'center' }"
                        :cell-style="{ 'text-align': 'center', borderColor: '#324e75' }" :row-class-name="tableRowClassName"
                        :empty-text="schedulingNoDataText" v-loading="schedulingLoading" element-loading-text="拼命加载中"
                        element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.5)">
                        <el-table-column prop="dept" label="值班单位"></el-table-column>
                        <el-table-column prop="person" label="姓名"></el-table-column>
                        <el-table-column prop="contact" label="联系方式"></el-table-column>
                    </el-table>
                    <div class="pointList" v-if="schedulingList == []">
                        <el-tooltip class="item" effect="dark" :content="item.dept" placement="top"
                            v-for="(item, index) in schedulingDeptList" :key="index">
                            <div class="point" @click="getSchedlingList(item)"></div>
                        </el-tooltip>
                    </div>
                </div>
                <div class="duty-information-box" v-show="showMJL">
                    <div>
                <div class="duty-information-box">
                    <div v-for="item in schedulingList" :key="item.id">
                        <div>
                            <span>值班</span>
                            <span>{{ item.type }}</span>
                        </div>
                        <div>
                            <span>徐星逸,任圣日,娄永攀,蔡善龙,陈小强,刘开勇,梅祥,吕镇,付建冬</span>
                            <span>{{ item.person }}</span>
                        </div>
                    </div>
                    <div>
                        <div>
                            <span>副班、巡逻</span>
                        </div>
                        <div>
                            <span>章正椿,夏文翔,叶江明,黄俊龙,苏茯林,王顺祥</span>
                        </div>
                    </div>
                    <div v-if="schedulingList.length == 0" class="no-zb-data">暂无值班数据</div>
                </div>
            </div>
@@ -182,33 +157,41 @@
            pickerOptions: {
                shortcuts: [
                    {
                        text: "最近一周",
                        text: '最近一周',
                        onClick (picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
                            picker.$emit("pick", [start, end])
                        },
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: "最近一个月",
                        text: '最近两周',
                        onClick (picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 14)
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: '最近一个月',
                        onClick (picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
                            picker.$emit("pick", [start, end])
                        },
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: "最近三个月",
                        text: '最近三个月',
                        onClick (picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
                            picker.$emit("pick", [start, end])
                        },
                    },
                ],
                            picker.$emit('pick', [start, end])
                        }
                    }]
            },
            regionTotal: 0,
            linetype: 0,
@@ -216,7 +199,6 @@
            schedulingList: [],
            schedulingDeptList: [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6],
            policeStaionID: "",
            showMJL: false,
            originTitle: ['值班', '副班、巡逻'],
            transTitle: [{ label: '人员', width: '28%', align: 'center' }, { label: '人员', width: '', align: 'left' },],
            caseInfoType: 0
@@ -298,65 +280,25 @@
        getSchedulingList () {
            this.schedulingLoading = true
            if (this.userInfo.dept_id == "1596020515064381442") {
                this.schedulingNoDataText = '  '
                const data = [
                    {
                        person:
                            "徐星逸,任圣日,娄永攀,蔡善龙,陈小强,刘开勇,梅祥,吕镇,付建冬",
                        patrol: "章正椿,夏文翔,叶江明,黄俊龙,苏茯林,王顺祥",
                    }
                ]
                const matrixData = data.map((row) => {
                    let arr = []
                    for (let key in row) {
                        arr.push(row[key])
                    }
                    return arr
                })
                setTimeout(() => {
                    this.schedulingList = matrixData[0].map((col, i) => {
                        return [this.originTitle[i], ...matrixData.map((row) => {
                            return row[i]
                        })]
                    })
                    this.schedulingLoading = false
                }, 1000)
                this.$nextTick(() => {
                    this.tableHeight =
                        this.$refs.Container.offsetHeight -
                        this.$refs.caseBox.offsetHeight -
                        this.$refs.crowdBox.offsetHeight -
                        this.$refs.alertBoxTitle.offsetHeight
                })
                this.showMJL = true
            } else {
                const params = {
                    sameday: 1,
                }
                this.showMJL = false
                getSchedulingList(1, 100, params).then((res) => {
                    this.schedulingList = res.data.data.records
                })
                setTimeout(() => {
                    this.schedulingNoDataText = '  '
                    this.schedulingLoading = false
                    if (!this.schedulingList.length) {
                        setTimeout(() => {
                            this.schedulingNoDataText = '暂无值班数据'
                        }, 200)
                    }
                }, 500)
            const params = {
                sameday: 1,
                isPage: 1
            }
            getSchedulingList(params).then((res) => {
                this.schedulingList = res.data.data
            })
            setTimeout(() => {
                this.schedulingNoDataText = '  '
                this.schedulingLoading = false
                if (!this.schedulingList.length) {
                    setTimeout(() => {
                        this.schedulingNoDataText = '暂无值班数据'
                    }, 200)
                }
            }, 500)
        },
        echartsResize () {
@@ -1467,6 +1409,15 @@
                    text-align: left;
                }
            }
            .no-zb-data {
                width: 100%;
                height: 100%;
                background: transparent !important;
                align-items: center;
                display: flex;
                justify-content: center;
            }
        }
        #peopleList {