From beca65f4d01ca07c358102a35b949c2a4f277afe Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期三, 24 五月 2023 10:36:27 +0800 Subject: [PATCH] 增加车间监控界面 --- src/views/dry/DryHerbList.vue | 320 ++++++++++++++++++++++++++-------------------------- 1 files changed, 160 insertions(+), 160 deletions(-) diff --git a/src/views/dry/DryHerbList.vue b/src/views/dry/DryHerbList.vue index 08705cf..10795d6 100644 --- a/src/views/dry/DryHerbList.vue +++ b/src/views/dry/DryHerbList.vue @@ -1,169 +1,169 @@ <template> - <div> - <!--寮曠敤琛ㄦ牸--> - <BasicTable @register="registerTable" :rowSelection="rowSelection"> - <!--鎻掓Ы:table鏍囬--> - <template #tableTitle> - <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 鏂板</a-button> - <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 瀵煎嚭</a-button> - <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">瀵煎叆</j-upload-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <template #overlay> - <a-menu> - <a-menu-item key="1" @click="batchHandleDelete"> - <Icon icon="ant-design:delete-outlined" /> - 鍒犻櫎 - </a-menu-item> - </a-menu> - </template> - <a-button - >鎵归噺鎿嶄綔 - <Icon icon="mdi:chevron-down" /> - </a-button> - </a-dropdown> - </template> - <!--鎿嶄綔鏍�--> - <template #action="{ record }"> - <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> - </template> - <!--瀛楁鍥炴樉鎻掓Ы--> - <template #htmlSlot="{ text }"> - <div v-html="text"></div> - </template> - <!--鐪佸競鍖哄瓧娈靛洖鏄炬彃妲�--> - <template #pcaSlot="{ text }"> - {{ getAreaTextByCode(text) }} - </template> - <template #fileSlot="{ text }"> - <span v-if="!text" style="font-size: 12px; font-style: italic">鏃犳枃浠�</span> - <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">涓嬭浇</a-button> - </template> - </BasicTable> - <!-- 琛ㄥ崟鍖哄煙 --> - <DryHerbModal @register="registerModal" @success="handleSuccess" /> - </div> + <div> + <!--寮曠敤琛ㄦ牸--> + <BasicTable @register="registerTable" :rowSelection="rowSelection"> + <!--鎻掓Ы:table鏍囬--> + <template #tableTitle> + <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 鏂板</a-button> + <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 瀵煎嚭</a-button> + <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">瀵煎叆</j-upload-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <template #overlay> + <a-menu> + <a-menu-item key="1" @click="batchHandleDelete"> + <Icon icon="ant-design:delete-outlined" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + </template> + <a-button + >鎵归噺鎿嶄綔 + <Icon icon="mdi:chevron-down" /> + </a-button> + </a-dropdown> + </template> + <!--鎿嶄綔鏍�--> + <template #action="{ record }"> + <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> + </template> + <!--瀛楁鍥炴樉鎻掓Ы--> + <template #htmlSlot="{ text }"> + <div v-html="text"></div> + </template> + <!--鐪佸競鍖哄瓧娈靛洖鏄炬彃妲�--> + <template #pcaSlot="{ text }"> + {{ getAreaTextByCode(text) }} + </template> + <template #fileSlot="{ text }"> + <span v-if="!text" style="font-size: 12px; font-style: italic">鏃犳枃浠�</span> + <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">涓嬭浇</a-button> + </template> + </BasicTable> + <!-- 琛ㄥ崟鍖哄煙 --> + <DryHerbModal @register="registerModal" @success="handleSuccess" /> + </div> </template> <script lang="ts" name="dry-dryHerb" setup> - import { ref } from 'vue'; - import DryHerbModal from './components/DryHerbModal.vue'; - import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './api/DryHerb.api'; - import { columns, searchFormSchema } from './dataDefine/DryHerb.data'; - import { useModal } from '/@/components/Modal'; - import { BasicTable, TableAction } from '/@/components/Table'; - import { useListPage } from '/@/hooks/system/useListPage'; - import { downloadFile } from '/@/utils/common/renderUtils'; - const checkedKeys = ref<Array<string | number>>([]); - //娉ㄥ唽model - const [registerModal, { openModal }] = useModal(); - //娉ㄥ唽table鏁版嵁 - const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ - tableProps: { - title: '鑽潗', - api: list, - columns, - canResize: false, - formConfig: { - //labelWidth: 120, - schemas: searchFormSchema, - autoSubmitOnEnter: true, - showAdvancedButton: true, - fieldMapToNumber: [], - fieldMapToTime: [], - }, - actionColumn: { - width: 120, - fixed: 'right', - }, - }, - exportConfig: { - name: '鑽潗', - url: getExportUrl, - }, - importConfig: { - url: getImportUrl, - success: handleSuccess, - }, - }); + import { ref } from 'vue' + import DryHerbModal from './components/DryHerbModal.vue' + import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './api/DryHerb.api' + import { columns, searchFormSchema } from './dataDefine/DryHerb.data' + import { useModal } from '/@/components/Modal' + import { BasicTable, TableAction } from '/@/components/Table' + import { useListPage } from '/@/hooks/system/useListPage' + import { downloadFile } from '/@/utils/common/renderUtils' + const checkedKeys = ref<Array<string | number>>([]) + //娉ㄥ唽model + const [registerModal, { openModal }] = useModal() + //娉ㄥ唽table鏁版嵁 + const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ + tableProps: { + title: '鑽潗', + api: list, + columns, + canResize: false, + formConfig: { + //labelWidth: 120, + schemas: searchFormSchema, + autoSubmitOnEnter: true, + showAdvancedButton: true, + fieldMapToNumber: [], + fieldMapToTime: [], + }, + actionColumn: { + width: 120, + fixed: 'right', + }, + }, + exportConfig: { + name: '鑽潗', + url: getExportUrl, + }, + importConfig: { + url: getImportUrl, + success: handleSuccess, + }, + }) - const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext; + const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext - /** - * 鏂板浜嬩欢 - */ - function handleAdd() { - openModal(true, { - isUpdate: false, - showFooter: true, - }); - } - /** - * 缂栬緫浜嬩欢 - */ - function handleEdit(record: Recordable) { - openModal(true, { - record, - isUpdate: true, - showFooter: true, - }); - } - /** - * 璇︽儏 - */ - function handleDetail(record: Recordable) { - openModal(true, { - record, - isUpdate: true, - showFooter: false, - }); - } - /** - * 鍒犻櫎浜嬩欢 - */ - async function handleDelete(record) { - await deleteOne({ id: record.id }, handleSuccess); - } - /** - * 鎵归噺鍒犻櫎浜嬩欢 - */ - async function batchHandleDelete() { - await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); - } - /** - * 鎴愬姛鍥炶皟 - */ - function handleSuccess() { - (selectedRowKeys.value = []) && reload(); - } - /** - * 鎿嶄綔鏍� - */ - function getTableAction(record) { - return [ - { - label: '缂栬緫', - onClick: handleEdit.bind(null, record), - }, - ]; - } - /** - * 涓嬫媺鎿嶄綔鏍� - */ - function getDropDownAction(record) { - return [ - { - label: '璇︽儏', - onClick: handleDetail.bind(null, record), - }, - { - label: '鍒犻櫎', - popConfirm: { - title: '鏄惁纭鍒犻櫎', - confirm: handleDelete.bind(null, record), - }, - }, - ]; - } + /** + * 鏂板浜嬩欢 + */ + function handleAdd() { + openModal(true, { + isUpdate: false, + showFooter: true, + }) + } + /** + * 缂栬緫浜嬩欢 + */ + function handleEdit(record: Recordable) { + openModal(true, { + record, + isUpdate: true, + showFooter: true, + }) + } + /** + * 璇︽儏 + */ + function handleDetail(record: Recordable) { + openModal(true, { + record, + isUpdate: true, + showFooter: false, + }) + } + /** + * 鍒犻櫎浜嬩欢 + */ + async function handleDelete(record) { + await deleteOne({ id: record.id }, handleSuccess) + } + /** + * 鎵归噺鍒犻櫎浜嬩欢 + */ + async function batchHandleDelete() { + await batchDelete({ ids: selectedRowKeys.value }, handleSuccess) + } + /** + * 鎴愬姛鍥炶皟 + */ + function handleSuccess() { + ;(selectedRowKeys.value = []) && reload() + } + /** + * 鎿嶄綔鏍� + */ + function getTableAction(record) { + return [ + { + label: '缂栬緫', + onClick: handleEdit.bind(null, record), + }, + ] + } + /** + * 涓嬫媺鎿嶄綔鏍� + */ + function getDropDownAction(record) { + return [ + { + label: '璇︽儏', + onClick: handleDetail.bind(null, record), + }, + { + label: '鍒犻櫎', + popConfirm: { + title: '鏄惁纭鍒犻櫎', + confirm: handleDelete.bind(null, record), + }, + }, + ] + } </script> <style scoped></style> -- Gitblit v1.9.3