Your Name
2022-08-01 1621b3719092d93e6c29f7a27e401529e0454420
src/views/doublePrevent/riskCheckManage/checkTaskManage/checkTask/index.vue
文件名从 src/views/doublePrevent/checkTaskManage/record/index.vue 修改
@@ -29,41 +29,34 @@
                </el-button>
            </div>
            <el-table :data="recordData.data" style="width: 100%">
                <el-table-column type="index" label="序号" width="60" />
                <el-table-column prop="checkRecordName" label="排查名称" show-overflow-tooltip></el-table-column>
                <el-table-column prop="checkRecordType" label="排查类型" show-overflow-tooltip>
                <el-table-column type="expand">
                    <template #default="scope">
                        {{ parseNumber(scope.row.checkRecordType, '排查类型') }}
                        <el-table :data="scope.row.checkContent" style="width: 100%">
                            <el-table-column label="序号" type="index" width="150" align="center"> </el-table-column>
                            <el-table-column label="检查内容" prop="checkContent" align="center"> </el-table-column>
                            <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
                                <template #default="scope">
                                    <el-button size="small" text type="primary" :icon="View" @click="onOpenDialogRef('查看', scope.row)">查看</el-button>
                                    <el-button size="small" text type="primary" :icon="Check" @click="onOpenDialogRef('整改', scope.row)">提交</el-button>
                    </template>
                </el-table-column>
                <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column>
                <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column>
                <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column>
                        </el-table>
                    </template>
                </el-table-column>
                <el-table-column type="index" label="序号" width="60" />
                <el-table-column prop="taskCode" label="排查名称" show-overflow-tooltip></el-table-column>
                <el-table-column prop="taskStatus" label="状态" show-overflow-tooltip>
                    <template #default="scope">
                        {{ parseNumber(scope.row.taskStatus, '状态') }}
                    </template>
                </el-table-column>
                <el-table-column prop="createUserName" label="创建人" show-overflow-tooltip></el-table-column>
                <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column>
                <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column>
                <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column>
                <el-table-column label="操作" width="150">
                    <template #default="scope">
                        <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button>
                        <el-button size="small" text type="danger" @click="onDelrecord(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <br />
            <el-pagination
                @size-change="onHandleSizeChange"
                @current-change="onHandleCurrentChange"
                :pager-count="5"
                :page-sizes="[10, 20, 30]"
                v-model:current-page="recordData.params.pageIndex"
                background
                v-model:page-size="recordData.params.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="recordData.total"
                class="page-position"
            >
            </el-pagination>
            <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="recordData.params.pageIndex" background v-model:page-size="recordData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordData.total" class="page-position"> </el-pagination>
            <br />
            <br />
        </el-card>
@@ -78,6 +71,7 @@
import { recordApi } from '/@/api/doublePreventSystem/record/index.ts';
import { departmentApi } from '/@/api/department';
import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit';
import { View, Check } from '@element-plus/icons-vue';
// 定义接口来定义对象的类型
interface TableData {
@@ -115,7 +109,7 @@
export default defineComponent({
    name: 'record',
    components: { recordDialog },
    components: { recordDialog, View, Check },
    setup() {
        const recordDialogRef = ref();
        const state = reactive<TableDataState>({
@@ -191,7 +185,7 @@
        // 打开生产装置弹窗
        const onOpenDialogRef = (type: string, value: any) => {
            recordDialogRef.value.openRecordDialog(type, value, state.departmentList, state.checkRecordTypeList, state.taskUnitList);
            recordDialogRef.value.openRecordDialog(type, value);
        };
        // 删除角色
        const onDelRecord = (row: any) => {
@@ -219,8 +213,6 @@
                .catch(() => {});
        };
        const parseNumber = (value: string | number, type: string) => {};
        const handleSearch = () => {
            initRecordTableData();
        };
@@ -234,6 +226,13 @@
            state.recordData.params.pageIndex = val;
            initRecordTableData();
        };
        const parseNumber = (value: string | number, type: string) => {
            if (type === '状态') {
                return state.taskStatusList.find((item) => item.id === value)?.name;
            }
        };
        // 页面加载时
        onMounted(() => {
            initRecordTableData();
@@ -242,11 +241,13 @@
        });
        return {
            View,
            Check,
            parseNumber,
            handleSearch,
            onOpenDialogRef,
            onHandleSizeChange,
            onDelRecord,
            parseNumber,
            onHandleCurrentChange,
            recordDialog,
            recordDialogRef,