From bb79260cbeeac88cfbadc9606eea57002e8945bc Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期四, 17 四月 2025 09:43:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- eims-ui/apps/web-antd/src/views/eims/spare/index.vue | 98 +++++++++++++++++++++++++++---------------------- 1 files changed, 54 insertions(+), 44 deletions(-) diff --git a/eims-ui/apps/web-antd/src/views/eims/spare/index.vue b/eims-ui/apps/web-antd/src/views/eims/spare/index.vue index 1682ab2..0cb214a 100644 --- a/eims-ui/apps/web-antd/src/views/eims/spare/index.vue +++ b/eims-ui/apps/web-antd/src/views/eims/spare/index.vue @@ -10,11 +10,12 @@ import { Image, Modal, Popconfirm, Space } from 'ant-design-vue'; import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; -import { delSpare, listSpare, spareExport } from '#/api/eims/spare'; +import { delSpare, listInout, listSpare, spareExport } from '#/api/eims/spare'; import { configInfoByKey } from '#/api/system/config'; import { commonDownloadExcel } from '#/utils/file/download'; +import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; -import { columns, querySchema } from './data'; +import { columns, inoutCol, querySchema } from './data'; import spareDrawer from './spare-drawer.vue'; import SpareTypeTree from './spare-type-tree.vue'; @@ -59,7 +60,7 @@ height: 'auto', keepSource: true, pagerConfig: { - enabled: false, + enabled: false }, proxyConfig: { enabled: true, @@ -84,7 +85,7 @@ keyField: 'id' }, columnConfig: { - resizable: true, + resizable: true }, sortConfig: { // 杩滅▼鎺掑簭 @@ -94,12 +95,16 @@ }, id: 'eims-spare-index' }; - +const id = ref<string>(); const [BasicTable, tableApi] = useVbenVxeGrid({ formOptions, gridOptions, gridEvents: { - sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) + sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), + cellClick: (e: any) => { + const { row } = e; + id.value = row.id; + } } }); @@ -163,51 +168,56 @@ <Page :auto-content-height="true"> <div class="flex h-full gap-[8px]"> <SpareTypeTree v-model:select-type-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" @select="() => tableApi.reload()" /> - <BasicTable class="flex-1 overflow-hidden" table-title="澶囦欢鍙拌处"> - <template #toolbar-tools> - <Space> - <a-button v-access:code="['eims:spare:export']" @click="handleDownloadExcel"> - {{ $t('pages.common.export') }} - </a-button> - <a-button - :disabled="!vxeCheckboxChecked(tableApi)" - danger - type="primary" - v-access:code="['eims:spare:remove']" - @click="handleMultiDelete" - > - {{ $t('pages.common.delete') }} - </a-button> - <a-button type="primary" v-access:code="['eims:spare:add']" @click="handleAdd"> - {{ $t('pages.common.add') }} - </a-button> - </Space> - </template> + <div class="flex-1 overflow-hidden"> + <div class="flex h-full gap-[8px] flex-col"> + <BasicTable class="h-2/3" table-title="澶囦欢鍙拌处"> + <template #toolbar-tools> + <Space> + <a-button v-access:code="['eims:spare:export']" @click="handleDownloadExcel"> + {{ $t('pages.common.export') }} + </a-button> + <a-button + :disabled="!vxeCheckboxChecked(tableApi)" + danger + type="primary" + v-access:code="['eims:spare:remove']" + @click="handleMultiDelete" + > + {{ $t('pages.common.delete') }} + </a-button> + <a-button type="primary" v-access:code="['eims:spare:add']" @click="handleAdd"> + {{ $t('pages.common.add') }} + </a-button> + </Space> + </template> - <template #imgUrl="{ row }"> - <Image v-if="preview && isImageFile(row.imgUrl)" :src="row.imgUrl" height="38px" /> - <span v-else>{{ row.imgUrl }}</span> - </template> + <template #imgUrl="{ row }"> + <Image v-if="preview && isImageFile(row.imgUrl)" :src="row.imgUrl" height="38px" /> + <span v-else>{{ row.imgUrl }}</span> + </template> - <template #action="{ row }"> - <Space> - <ghost-button v-access:code="['eims:spare:edit']" @click.stop="handleEdit(row)"> - {{ $t('pages.common.edit') }} - </ghost-button> - <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="纭鍒犻櫎锛�" @confirm="handleDelete(row)"> - <ghost-button danger v-access:code="['eims:spare:remove']" @click.stop=""> - {{ $t('pages.common.delete') }} - </ghost-button> - </Popconfirm> - </Space> - </template> - </BasicTable> + <template #action="{ row }"> + <Space> + <ghost-button v-access:code="['eims:spare:edit']" @click.stop="handleEdit(row)"> + {{ $t('pages.common.edit') }} + </ghost-button> + <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="纭鍒犻櫎锛�" @confirm="handleDelete(row)"> + <ghost-button danger v-access:code="['eims:spare:remove']" @click.stop=""> + {{ $t('pages.common.delete') }} + </ghost-button> + </Popconfirm> + </Space> + </template> + </BasicTable> + <BasisSubTable :columns="inoutCol" :list-api="listInout" :req-value="id" class="h-1/3" req-key="id" title="鍑哄叆搴撴槑缁�" /> + </div> + </div> </div> <SpareDrawer @reload="tableApi.query()" /> </Page> </template> -<style> +<style lang="scss" scoped> /* 缁熶竴鎵�鏈夊垪鐨勮竟妗嗗拰琛岄珮 */ .vxe-table--body .vxe-body--row .vxe-body--column { height: 56px !important; -- Gitblit v1.9.3