style: 优化代码格式和布局
- 调整了多行代码的缩进和换行方式,提高了代码可读性 - 在 Materials 和 QuestionUserAnswer 组件中进行了相似的格式化修改 - 未改变原有功能,仅优化了代码结构
This commit is contained in:
@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
||||||
|
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="auto">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="auto">
|
||||||
<el-form-item label="材料名称" prop="materialsName">
|
<el-form-item label="材料名称" prop="materialsName">
|
||||||
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable
|
||||||
|
@keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="材料提供商" prop="companyId">
|
<el-form-item label="材料提供商" prop="companyId">
|
||||||
<el-select v-model="queryParams.companyId" clearable placeholder="全部">
|
<el-select v-model="queryParams.companyId" clearable placeholder="全部">
|
||||||
@ -25,20 +27,22 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materials:add']"> 新增 </el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materials:add']"> 新增
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['materials:materials:edit']"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['materials:materials:remove']"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
>删除
|
v-hasPermi="['materials:materials:edit']">修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['materials:materials:export']">导出 </el-button>
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
|
v-hasPermi="['materials:materials:remove']">删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
|
v-hasPermi="['materials:materials:export']">导出 </el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -68,20 +72,25 @@
|
|||||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="320">
|
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="320">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-space>
|
<el-space>
|
||||||
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['materials:materials:query']">
|
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)"
|
||||||
|
v-hasPermi="['materials:materials:query']">
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materials:edit']"> 修改 </el-button>
|
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['materials:materials:remove']">
|
v-hasPermi="['materials:materials:edit']"> 修改 </el-button>
|
||||||
|
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['materials:materials:remove']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAddMaterialsInventory(scope.row)"> 出入库 </el-button>
|
<el-button v-hasPermi="['materials:materialsInventory:edit']" link type="primary" icon="Plus"
|
||||||
|
@click="handleAddMaterialsInventory(scope.row)"> 出入库 </el-button>
|
||||||
</el-space>
|
</el-space>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改材料名称对话框 -->
|
<!-- 添加或修改材料名称对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
@ -112,17 +121,12 @@
|
|||||||
<el-form-item label="材料文件" prop="fileOssIdMap">
|
<el-form-item label="材料文件" prop="fileOssIdMap">
|
||||||
<div :key="item.value" v-for="item in materials_file_type">
|
<div :key="item.value" v-for="item in materials_file_type">
|
||||||
<h3>{{ item.label }}</h3>
|
<h3>{{ item.label }}</h3>
|
||||||
<file-upload
|
<file-upload v-model="ossIdMap[item.value]" :limit="1" :file-size="50" :file-type="['pdf']"
|
||||||
v-model="ossIdMap[item.value]"
|
|
||||||
:limit="1"
|
|
||||||
:file-size="50"
|
|
||||||
:file-type="['pdf']"
|
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(args) => {
|
(args) => {
|
||||||
handleOssUpdate(args, item.value);
|
handleOssUpdate(args, item.value);
|
||||||
}
|
}
|
||||||
"
|
" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -133,7 +137,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef" @submit="getList" />
|
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef"
|
||||||
|
@submit="getList" />
|
||||||
<el-dialog title="材料详情" v-model="showDetailDrawer" width="700px">
|
<el-dialog title="材料详情" v-model="showDetailDrawer" width="700px">
|
||||||
<materials-detail-drawer :materials-id="currentMaterialsId" />
|
<materials-detail-drawer :materials-id="currentMaterialsId" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
||||||
|
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
@ -24,26 +25,21 @@
|
|||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5" v-hasPermi="['safety:questionUserAnswer:uploadZip']">
|
||||||
<el-tooltip placement="top" effect="dark">
|
<el-tooltip placement="top" effect="dark">
|
||||||
<template #content>
|
<template #content>
|
||||||
注:上传压缩包内的文件夹名称需设置为【姓名-身份证-满分-得分-及格分】, <br />
|
注:上传压缩包内的文件夹名称需设置为【姓名-身份证-满分-得分-及格分】, <br />
|
||||||
例如:小明-5130112333654X-100-59-60
|
例如:小明-5130112333654X-100-59-60
|
||||||
</template>
|
</template>
|
||||||
<file-upload
|
<file-upload :limit="1" v-model:model-value="filePath" isImportInfo :fileType="['zip']"
|
||||||
:limit="1"
|
uploadUrl="/safety/questionUserAnswer/upload/zip" :file-size="5000"
|
||||||
v-model:model-value="filePath"
|
:data="{ projectId: currentProject.id }"><el-button type="success" plain
|
||||||
isImportInfo
|
icon="Upload">上传线下安全考试</el-button></file-upload>
|
||||||
:fileType="['zip']"
|
|
||||||
uploadUrl="/safety/questionUserAnswer/upload/zip"
|
|
||||||
:file-size="5000"
|
|
||||||
:data="{ projectId: currentProject.id }"
|
|
||||||
><el-button type="success" plain icon="Upload">上传线下安全考试</el-button></file-upload
|
|
||||||
>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Download" :disabled="single" @click="handleDownload()">批量下载试卷</el-button>
|
<el-button type="primary" plain icon="Download" :disabled="single"
|
||||||
|
@click="handleDownload()">批量下载试卷</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -70,12 +66,14 @@
|
|||||||
<el-button link type="primary" icon="View">预览试卷</el-button>
|
<el-button link type="primary" icon="View">预览试卷</el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
|
|
||||||
<el-button link type="primary" icon="Download" @click="downloadOssOne(scope.row)">下载试卷</el-button>
|
<el-button link type="primary" icon="Download" @click="downloadOssOne(scope.row)"
|
||||||
|
v-hasPermi="['system:oss:download']">下载试卷</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user