马宇豪
2024-01-26 c694cffc8541d921e5256d33e14e3237454de950
src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue
@@ -1,6 +1,6 @@
<template>
    <div class="home-container">
        <div style="height: 100%">
      <div style="height: 100%;display: flex;flex-direction: column;align-items: stretch;">
            <el-row class="homeCard">
                <div class="basic-line">
                    <span>任务类型:</span>
@@ -31,12 +31,13 @@
                    <el-row class="cardTop">
                        <el-col :span="12" class="mainCardBtn">
                            <el-button type="primary" :icon="Plus" size="default" @click="openInspectTaskDialog('新增', {})">新增</el-button>
                          <el-button type="primary" :icon="Upload" size="default" @click="openUploadDialog('任务')">导入</el-button>
                            <!--                            <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>-->
                        </el-col>
                        <el-button type="primary" :icon="Refresh" size="default" />
                    </el-row>
                    <el-table ref="multipleTableRef" :data="tableData.inspectTaskData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange">
                        <el-table-column type="selection" width="55" />
<!--                        <el-table-column type="selection" width="55" />-->
                        <el-table-column property="unitName" label="任务名称" />
                        <el-table-column property="workType" label="任务类型">
                            <template #default="scope">
@@ -121,15 +122,17 @@
            </div>
        </div>
        <inspect-task-dialog ref="inspectTaskDialogRef" @refreshInspectTask="getInspectionTask"></inspect-task-dialog>
        <upload-dialog ref="uploadRef" @refresh="getInspectionTask"></upload-dialog>
    </div>
</template>
<script lang="ts">
import { toRefs, reactive, ref, onMounted } from 'vue';
import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue';
import { Edit, View, Plus, Delete, Refresh, Search, Download, Upload } from '@element-plus/icons-vue';
import { ElTable, ElMessage, ElMessageBox } from 'element-plus';
import { inspectTaskApi } from '/@/api/intellectInspectSystem/inspectTask';
import inspectTaskDialog from './components/inspectTaskDialog.vue';
import inspectTaskDialog from './components/inspectTaskDialog.vue'
import uploadDialog from './components/upload.vue'
import { departmentApi } from '/@/api/systemManage/department';
import { teamManageApi } from '/@/api/systemManage/personShiftManage/teamManage';
import { inspectPointApi } from '/@/api/intellectInspectSystem/inspectPointManage';
@@ -178,9 +181,10 @@
}
export default {
    name: 'index',
    components: { inspectTaskDialog },
    components: { inspectTaskDialog, uploadDialog },
    setup() {
        const inspectTaskDialogRef = ref();
        const uploadRef = ref()
        const state = reactive<stateType>({
            tableData: {
                inspectTaskData: [],
@@ -425,6 +429,10 @@
            }
        };
        const openUploadDialog = (type: string)=>{
          uploadRef.value.open(type)
        }
        // 分页改变
        const onHandleSizeChange = (val: number) => {
            state.tableData.params.pageSize = val;
@@ -467,7 +475,9 @@
            Delete,
            Refresh,
            Plus,
            Upload,
            reset,
          openUploadDialog,
            changeStatus,
            changeGroup,
            parseNumber,
@@ -476,6 +486,7 @@
            onHandleSizeChange,
            onHandleCurrentChange,
            inspectTaskDialogRef,
            uploadRef,
            openInspectTaskDialog,
            ...toRefs(state)
        };
@@ -489,12 +500,14 @@
    height: calc(100vh - 144px);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    .homeCard {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
        background: #fff;
        border-radius: 4px;
        flex: 0 auto;
        .main-card {
            width: 100%;
@@ -509,10 +522,18 @@
                }
            }
            .pageBtn {
                height: 60px;
                display: flex;
                align-items: center;
                justify-content: right;
              position: absolute;
              width: 100%;
              z-index: 99;
              bottom: 0;
              right: 0;
              height: 60px;
              border-radius: 0 0 4px 4px;
              padding-right: 20px;
              background: #fff;
              display: flex;
              align-items: center;
              justify-content: right;
                .demo-pagination-block + .demo-pagination-block {
                    margin-top: 10px;
@@ -523,7 +544,7 @@
            }
        }
        &:last-of-type {
            height: calc(100% - 100px);
          flex: 1;
        }
    }
    .el-row {