Showing
16 changed files
with
530 additions
and
6 deletions
src/api/inspection/inspectionPlan.ts
0 → 100644
| 1 | +import { defHttp } from '/@/utils/http/axios'; | |
| 2 | +import { omit } from 'lodash-es'; | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * 获取列表 | |
| 6 | + */ | |
| 7 | +export const getInspectionPlanList = (params) => { | |
| 8 | + const { page, pageSize } = params; | |
| 9 | + const otherParams = omit(params, ['page', 'pageSize']); | |
| 10 | + return defHttp.get<any>({ | |
| 11 | + url: `/inspectionPlan?page=${page}&pageSize=${pageSize}`, | |
| 12 | + params: otherParams, | |
| 13 | + }); | |
| 14 | +}; | ... | ... |
src/api/inspection/inspectionRecord.ts
0 → 100644
| 1 | +import { defHttp } from '/@/utils/http/axios'; | |
| 2 | +import { omit } from 'lodash-es'; | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * 获取列表 | |
| 6 | + */ | |
| 7 | +export const getInspectionRecordList = (params) => { | |
| 8 | + const { page, pageSize } = params; | |
| 9 | + const otherParams = omit(params, ['page', 'pageSize']); | |
| 10 | + return defHttp.get<any>({ | |
| 11 | + url: `/inspectionRecord?page=${page}&pageSize=${pageSize}`, | |
| 12 | + params: otherParams, | |
| 13 | + }); | |
| 14 | +}; | ... | ... |
src/api/inspection/servicePlan.ts
0 → 100644
| 1 | +import { defHttp } from '/@/utils/http/axios'; | |
| 2 | +import { omit } from 'lodash-es'; | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * 获取列表 | |
| 6 | + */ | |
| 7 | +export const getServicePlanList = (params) => { | |
| 8 | + const { page, pageSize } = params; | |
| 9 | + const otherParams = omit(params, ['page', 'pageSize']); | |
| 10 | + return defHttp.post<any>({ | |
| 11 | + url: `/preservePlan/pageData?page=${page}&pageSize=${pageSize}`, | |
| 12 | + params: otherParams, | |
| 13 | + }); | |
| 14 | +}; | ... | ... |
src/api/inspection/serviceRecord.ts
0 → 100644
| 1 | +import { defHttp } from '/@/utils/http/axios'; | |
| 2 | +import { omit } from 'lodash-es'; | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * 获取列表 | |
| 6 | + */ | |
| 7 | +export const getServiceRecordList = (params) => { | |
| 8 | + const { page, pageSize } = params; | |
| 9 | + const otherParams = omit(params, ['page', 'pageSize']); | |
| 10 | + return defHttp.post<any>({ | |
| 11 | + url: `/preserveRecord/pageData?page=${page}&pageSize=${pageSize}`, | |
| 12 | + params: otherParams, | |
| 13 | + }); | |
| 14 | +}; | ... | ... |
| 1 | +export default { | |
| 2 | + listText: '巡检计划', | |
| 3 | + nameText: '名称', | |
| 4 | + codeText: '记录编号', | |
| 5 | + createCategoryText: '创建记录', | |
| 6 | + statusText: '计划状态', | |
| 7 | + typeNameText: '类型', | |
| 8 | + NOT_START: '未开始', | |
| 9 | + UNDERWAY: '进行中', | |
| 10 | + FINISH: '已完成', | |
| 11 | + STOP: '停用', | |
| 12 | + time: '计划时间', | |
| 13 | + startTimeText: '开始时间', | |
| 14 | + endTimeText: '结束时间', | |
| 15 | +}; | ... | ... |
| 1 | +export default { | |
| 2 | + listText: '巡检记录', | |
| 3 | + nameText: '巡检计划', | |
| 4 | + recordCodeText: '巡检编号', | |
| 5 | + inspectionPlanText: '巡检计划', | |
| 6 | + checkDateText: '巡检日期', | |
| 7 | + inspectorByName: '巡检员', | |
| 8 | + inspectorIdText: '巡检员', | |
| 9 | + startTimeText: '开始时间', | |
| 10 | + endTimeText: '结束时间', | |
| 11 | + recordResultText: '巡检结果', | |
| 12 | + normal: '正常', | |
| 13 | + error: '异常', | |
| 14 | +}; | ... | ... |
| 1 | +export default { | |
| 2 | + listText: '保养记录', | |
| 3 | + preserveNameText: '维护结果', | |
| 4 | + preserveCodeText: '计划编号', | |
| 5 | + statusText: '状态', | |
| 6 | + time: '保养日期', | |
| 7 | + frequencyText: '频率', | |
| 8 | + timesText: '次数', | |
| 9 | + createCategoryText: '创建记录', | |
| 10 | + INCOMPLETE : '未完成', | |
| 11 | + COMPLETE: '已完成', | |
| 12 | + recordCodeText: '记录编号', | |
| 13 | + createTimeText: '保养日期', | |
| 14 | + preserveByName: '保养人员', | |
| 15 | + preservePlanName: '保养计划', | |
| 16 | +}; | ... | ... |
src/views/inspection/inspectionPlan/index.ts
0 → 100644
| 1 | +import { FormSchema } from '/@/components/Form'; | |
| 2 | +import { useI18n } from '/@/hooks/web/useI18n'; | |
| 3 | +import { BasicColumn } from '/@/components/Table'; | |
| 4 | +import moment from "moment/moment"; | |
| 5 | +const { t } = useI18n(); | |
| 6 | + | |
| 7 | +const typeOptions = [ | |
| 8 | + { label: t('inspection.inspectionPlan.NOT_START'), value: 'NOT_START' }, | |
| 9 | + { label: t('inspection.inspectionPlan.UNDERWAY'), value: 'UNDERWAY' }, | |
| 10 | + { label: t('inspection.inspectionPlan.FINISH'), value: 'FINISH' }, | |
| 11 | + { label: t('inspection.inspectionPlan.STOP'), value: 'STOP' }, | |
| 12 | +]; | |
| 13 | + | |
| 14 | +export const searchFormSchema: FormSchema[] = [ | |
| 15 | + { | |
| 16 | + field: 'name', | |
| 17 | + label: t('inspection.inspectionPlan.nameText'), | |
| 18 | + component: 'Input', | |
| 19 | + colProps: { span: 6 }, | |
| 20 | + }, | |
| 21 | + { | |
| 22 | + field: 'type', | |
| 23 | + label: t('inspection.inspectionPlan.typeNameText'), | |
| 24 | + component: 'Select', | |
| 25 | + colProps: { span: 6 }, | |
| 26 | + componentProps: { | |
| 27 | + options: typeOptions, | |
| 28 | + }, | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + field: 'startTime', | |
| 32 | + label: t('inspection.inspectionPlan.startTimeText'), | |
| 33 | + component: 'RangePicker', | |
| 34 | + componentProps: { | |
| 35 | + showTime: { | |
| 36 | + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')], | |
| 37 | + }, | |
| 38 | + }, | |
| 39 | + colProps: { span: 6 }, | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + field: 'endTime', | |
| 43 | + label: t('inspection.inspectionPlan.endTimeText'), | |
| 44 | + component: 'RangePicker', | |
| 45 | + componentProps: { | |
| 46 | + showTime: { | |
| 47 | + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')], | |
| 48 | + }, | |
| 49 | + }, | |
| 50 | + colProps: { span: 6 }, | |
| 51 | + }, | |
| 52 | +]; | |
| 53 | + | |
| 54 | +export const columns: BasicColumn[] = [ | |
| 55 | + { | |
| 56 | + title: t('inspection.inspectionPlan.codeText'), | |
| 57 | + dataIndex: 'code', | |
| 58 | + }, | |
| 59 | + { | |
| 60 | + title: t('inspection.inspectionPlan.nameText'), | |
| 61 | + dataIndex: 'name', | |
| 62 | + }, | |
| 63 | + { | |
| 64 | + title: t('inspection.inspectionPlan.startTimeText'), | |
| 65 | + dataIndex: 'startTime', | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + title: t('inspection.inspectionPlan.endTimeText'), | |
| 69 | + dataIndex: 'endTime', | |
| 70 | + }, | |
| 71 | + { | |
| 72 | + title: t('inspection.inspectionPlan.statusText'), | |
| 73 | + dataIndex: 'status', | |
| 74 | + slots: { customRender: 'status' }, | |
| 75 | + }, | |
| 76 | +]; | ... | ... |
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <BasicTable :clickToRowSelect="false" @register="registerTable"> | |
| 4 | + <template #toolbar> | |
| 5 | + <Authority value="api:yt:product:category:post"> | |
| 6 | + <Button type="primary"> | |
| 7 | + {{ t('inspection.inspectionPlan.createCategoryText') }} | |
| 8 | + </Button> | |
| 9 | + </Authority> | |
| 10 | + </template> | |
| 11 | + <template #status="{ record }"> | |
| 12 | + <Tag | |
| 13 | + :color=" | |
| 14 | + record.status == 'NOT_START' | |
| 15 | + ? 'yellow' | |
| 16 | + : record.status == 'UNDERWAY' | |
| 17 | + ? 'blue': record.status == 'FINISH' | |
| 18 | + ? 'green': 'red' | |
| 19 | + " | |
| 20 | + class="ml-2" | |
| 21 | + > | |
| 22 | + {{ t(`inspection.inspectionPlan.${record.status}`) }} | |
| 23 | + </Tag> | |
| 24 | + </template> | |
| 25 | + </BasicTable> | |
| 26 | + </div> | |
| 27 | +</template> | |
| 28 | +<script setup lang="ts"> | |
| 29 | +import { BasicTable, useTable } from '/@/components/Table'; | |
| 30 | +import { getInspectionPlanList } from '/@/api/inspection/inspectionPlan'; | |
| 31 | +import { columns, searchFormSchema } from './index'; | |
| 32 | +import { useI18n } from '/@/hooks/web/useI18n'; | |
| 33 | +import { Button, Tag } from 'ant-design-vue'; | |
| 34 | +const { t } = useI18n(); | |
| 35 | + | |
| 36 | +const [ | |
| 37 | + registerTable, | |
| 38 | + { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
| 39 | +] = useTable({ | |
| 40 | + title: t('inspection.inspectionPlan.listText'), | |
| 41 | + api: getInspectionPlanList, | |
| 42 | + columns, | |
| 43 | + formConfig: { | |
| 44 | + labelWidth: 100, | |
| 45 | + schemas: searchFormSchema, | |
| 46 | + }, | |
| 47 | + immediate: true, | |
| 48 | + useSearchForm: true, | |
| 49 | + showTableSetting: true, | |
| 50 | + bordered: true, | |
| 51 | + showIndexColumn: false, | |
| 52 | + clickToRowSelect: false, | |
| 53 | + rowKey: 'id', | |
| 54 | + actionColumn: { | |
| 55 | + width: 230, | |
| 56 | + title: t('common.actionText'), | |
| 57 | + slots: { customRender: 'action' }, | |
| 58 | + fixed: 'right', | |
| 59 | + }, | |
| 60 | + rowSelection: { | |
| 61 | + type: 'checkbox', | |
| 62 | + getCheckboxProps: (record: any) => {}, | |
| 63 | + }, | |
| 64 | +}); | |
| 65 | +</script> | ... | ... |
| 1 | +import { FormSchema } from '/@/components/Form'; | |
| 2 | +import { useI18n } from '/@/hooks/web/useI18n'; | |
| 3 | +import { BasicColumn } from '/@/components/Table'; | |
| 4 | +import moment from "moment"; | |
| 5 | +const { t } = useI18n(); | |
| 6 | + | |
| 7 | + | |
| 8 | +const resultOptions = [ | |
| 9 | + { label: t('inspection.inspectionRecord.normal'), value: 'true' }, | |
| 10 | + { label: t('inspection.inspectionRecord.error'), value: 'false' }, | |
| 11 | +]; | |
| 12 | + | |
| 13 | +export const searchFormSchema: FormSchema[] = [ | |
| 14 | + { | |
| 15 | + field: 'inspectionPlanId', | |
| 16 | + label: t('inspection.inspectionRecord.nameText'), | |
| 17 | + component: 'Input', | |
| 18 | + colProps: { span: 6 }, | |
| 19 | + }, | |
| 20 | + { | |
| 21 | + field: 'inspectorId', | |
| 22 | + label: t('inspection.inspectionRecord.inspectorIdText'), | |
| 23 | + component: 'Input', | |
| 24 | + colProps: { span: 6 }, | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + field: 'startTime', | |
| 28 | + label: t('inspection.inspectionRecord.startTimeText'), | |
| 29 | + component: 'RangePicker', | |
| 30 | + componentProps: { | |
| 31 | + showTime: { | |
| 32 | + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')], | |
| 33 | + }, | |
| 34 | + }, | |
| 35 | + colProps: { span: 6 }, | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + field: 'endTime', | |
| 39 | + label: t('inspection.inspectionRecord.endTimeText'), | |
| 40 | + component: 'RangePicker', | |
| 41 | + componentProps: { | |
| 42 | + showTime: { | |
| 43 | + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')], | |
| 44 | + }, | |
| 45 | + }, | |
| 46 | + colProps: { span: 6 }, | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + field: 'recordResult', | |
| 50 | + label: t('inspection.inspectionRecord.recordResultText'), | |
| 51 | + component: 'Select', | |
| 52 | + colProps: { span: 8 }, | |
| 53 | + componentProps: { | |
| 54 | + options: resultOptions, | |
| 55 | + }, | |
| 56 | + }, | |
| 57 | +]; | |
| 58 | + | |
| 59 | +export const columns: BasicColumn[] = [ | |
| 60 | + { | |
| 61 | + title: t('inspection.inspectionRecord.recordCodeText'), | |
| 62 | + dataIndex: 'code', | |
| 63 | + }, | |
| 64 | + { | |
| 65 | + title: t('inspection.inspectionRecord.inspectionPlanText'), | |
| 66 | + dataIndex: 'inspectionPlanId', | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + title: t('inspection.inspectionRecord.inspectorByName'), | |
| 70 | + dataIndex: 'inspectorId', | |
| 71 | + | |
| 72 | + }, | |
| 73 | + { | |
| 74 | + title: t('inspection.inspectionRecord.checkDateText'), | |
| 75 | + dataIndex: 'checkDate', | |
| 76 | + }, | |
| 77 | + { | |
| 78 | + title: t('inspection.inspectionRecord.recordResultText'), | |
| 79 | + dataIndex: 'recordResult', | |
| 80 | + slots: { customRender: 'recordResult' }, | |
| 81 | + | |
| 82 | + }, | |
| 83 | +]; | ... | ... |
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <BasicTable :clickToRowSelect="false" @register="registerTable"> | |
| 4 | + <template #toolbar> | |
| 5 | + <Authority value="api:yt:product:category:post"> | |
| 6 | + <Button type="primary" > | |
| 7 | + {{ t('inspection.inspectionRecord.createCategoryText') }} | |
| 8 | + </Button> | |
| 9 | + </Authority> | |
| 10 | + </template> | |
| 11 | + <template #recordResult="{ record }"> | |
| 12 | + <Tag | |
| 13 | + :color="record.status ? 'green' : 'red'" | |
| 14 | + class="ml-2" | |
| 15 | + > | |
| 16 | + {{record.recordResult ? '正常' : '异常'}} | |
| 17 | + </Tag> | |
| 18 | + </template> | |
| 19 | + </BasicTable> | |
| 20 | + </div> | |
| 21 | +</template> | |
| 22 | +<script setup lang="ts"> | |
| 23 | + import { BasicTable, useTable } from '/@/components/Table'; | |
| 24 | + import { getInspectionRecordList } from '/@/api/inspection/inspectionRecord'; | |
| 25 | + import { columns, searchFormSchema } from './index'; | |
| 26 | + import { useI18n } from '/@/hooks/web/useI18n'; | |
| 27 | + import { Button, Tag } from 'ant-design-vue'; | |
| 28 | + const { t } = useI18n(); | |
| 29 | + | |
| 30 | + const [ | |
| 31 | + registerTable, | |
| 32 | + { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
| 33 | + ] = useTable({ | |
| 34 | + title: t('inspection.inspectionRecord.listText'), | |
| 35 | + api: getInspectionRecordList, | |
| 36 | + columns, | |
| 37 | + formConfig: { | |
| 38 | + labelWidth: 100, | |
| 39 | + schemas: searchFormSchema, | |
| 40 | + }, | |
| 41 | + immediate: true, | |
| 42 | + useSearchForm: true, | |
| 43 | + showTableSetting: true, | |
| 44 | + bordered: true, | |
| 45 | + showIndexColumn: false, | |
| 46 | + clickToRowSelect: false, | |
| 47 | + rowKey: 'id', | |
| 48 | + actionColumn: { | |
| 49 | + width: 230, | |
| 50 | + title: t('common.actionText'), | |
| 51 | + slots: { customRender: 'action' }, | |
| 52 | + fixed: 'right', | |
| 53 | + }, | |
| 54 | + rowSelection: { | |
| 55 | + type: 'checkbox', | |
| 56 | + getCheckboxProps: (record: any) => {}, | |
| 57 | + }, | |
| 58 | + }); | |
| 59 | +</script> | ... | ... |
| ... | ... | @@ -8,15 +8,29 @@ |
| 8 | 8 | </Button> |
| 9 | 9 | </Authority> |
| 10 | 10 | </template> |
| 11 | + <template #status="{ record }"> | |
| 12 | + <Tag | |
| 13 | + :color=" | |
| 14 | + record.status == 'NOTSTART' | |
| 15 | + ? 'red' | |
| 16 | + : record.status == 'UNDERWAY' | |
| 17 | + ? 'blue': record.status == 'COMPLETED' | |
| 18 | + ? 'green': 'yellow' | |
| 19 | + " | |
| 20 | + class="ml-2" | |
| 21 | + > | |
| 22 | + {{ t(`inspection.servicePlan.${record.status}`) }} | |
| 23 | + </Tag> | |
| 24 | + </template> | |
| 11 | 25 | </BasicTable> |
| 12 | 26 | </div> |
| 13 | 27 | </template> |
| 14 | 28 | <script setup lang="ts"> |
| 15 | - import { useTable } from '/@/components/Table'; | |
| 16 | - import { getRepairOrderList } from '/@/api/repair/order'; | |
| 29 | + import { BasicTable, useTable } from '/@/components/Table'; | |
| 30 | + import { getServicePlanList } from '/@/api/inspection/servicePlan'; | |
| 17 | 31 | import { columns, searchFormSchema } from './index'; |
| 18 | 32 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 19 | - | |
| 33 | + import { Button, Tag } from 'ant-design-vue'; | |
| 20 | 34 | const { t } = useI18n(); |
| 21 | 35 | |
| 22 | 36 | const [ |
| ... | ... | @@ -24,7 +38,7 @@ |
| 24 | 38 | { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, |
| 25 | 39 | ] = useTable({ |
| 26 | 40 | title: t('inspection.servicePlan.listText'), |
| 27 | - api: getRepairOrderList, | |
| 41 | + api: getServicePlanList, | |
| 28 | 42 | columns, |
| 29 | 43 | formConfig: { |
| 30 | 44 | labelWidth: 100, | ... | ... |
src/views/inspection/serviceRecord/index.ts
0 → 100644
| 1 | +import { FormSchema } from '/@/components/Form'; | |
| 2 | +import { useI18n } from '/@/hooks/web/useI18n'; | |
| 3 | +import { BasicColumn } from '/@/components/Table'; | |
| 4 | +import moment from "moment"; | |
| 5 | +const { t } = useI18n(); | |
| 6 | + | |
| 7 | + | |
| 8 | +const statusOptions = [ | |
| 9 | + { label: t('inspection.serviceRecord.INCOMPLETE'), value: 'INCOMPLETE' }, | |
| 10 | + { label: t('inspection.serviceRecord.COMPLETE'), value: 'COMPLETE' }, | |
| 11 | +]; | |
| 12 | + | |
| 13 | +export const searchFormSchema: FormSchema[] = [ | |
| 14 | + { | |
| 15 | + field: 'preserveStatus', | |
| 16 | + label: t('inspection.serviceRecord.preserveNameText'), | |
| 17 | + component: 'Select', | |
| 18 | + colProps: { span: 8 }, | |
| 19 | + componentProps: { | |
| 20 | + options: statusOptions, | |
| 21 | + }, | |
| 22 | + }, | |
| 23 | + { | |
| 24 | + field: 'startDate', | |
| 25 | + label: t('inspection.serviceRecord.time'), | |
| 26 | + component: 'RangePicker', | |
| 27 | + componentProps: { | |
| 28 | + showTime: { | |
| 29 | + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')], | |
| 30 | + }, | |
| 31 | + }, | |
| 32 | + colProps: { span: 6 }, | |
| 33 | + }, | |
| 34 | +]; | |
| 35 | + | |
| 36 | +export const columns: BasicColumn[] = [ | |
| 37 | + { | |
| 38 | + title: t('inspection.serviceRecord.recordCodeText'), | |
| 39 | + dataIndex: 'recordCode', | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + title: t('inspection.serviceRecord.createTimeText'), | |
| 43 | + dataIndex: 'createTime', | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + title: t('inspection.serviceRecord.preserveByName'), | |
| 47 | + dataIndex: 'preserveByName', | |
| 48 | + | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + title: t('inspection.serviceRecord.preserveNameText'), | |
| 52 | + dataIndex: 'preserveStatus', | |
| 53 | + slots: { customRender: 'preserveStatus' }, | |
| 54 | + }, | |
| 55 | + { | |
| 56 | + title: t('inspection.serviceRecord.preservePlanName'), | |
| 57 | + dataIndex: 'preservePlanName', | |
| 58 | + }, | |
| 59 | +]; | ... | ... |
src/views/inspection/serviceRecord/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <BasicTable :clickToRowSelect="false" @register="registerTable"> | |
| 4 | + <template #toolbar> | |
| 5 | + <Authority value="api:yt:product:category:post"> | |
| 6 | + <Button type="primary" > | |
| 7 | + {{ t('inspection.serviceRecord.createCategoryText') }} | |
| 8 | + </Button> | |
| 9 | + </Authority> | |
| 10 | + </template> | |
| 11 | + <template #preserveStatus="{ record }"> | |
| 12 | + <Tag | |
| 13 | + :color=" | |
| 14 | + record.status == 'INCOMPLETE' | |
| 15 | + ? 'red': record.status == 'COMPLETED' | |
| 16 | + ? 'green': 'yellow' | |
| 17 | + " | |
| 18 | + class="ml-2" | |
| 19 | + > | |
| 20 | + {{ t(`inspection.serviceRecord.${record.preserveStatus}`) }} | |
| 21 | + </Tag> | |
| 22 | + </template> | |
| 23 | + </BasicTable> | |
| 24 | + </div> | |
| 25 | +</template> | |
| 26 | +<script setup lang="ts"> | |
| 27 | +import { BasicTable, useTable } from '/@/components/Table'; | |
| 28 | +import { getServiceRecordList } from '/@/api/inspection/serviceRecord'; | |
| 29 | +import { columns, searchFormSchema } from './index'; | |
| 30 | +import { useI18n } from '/@/hooks/web/useI18n'; | |
| 31 | +import { Button, Tag } from 'ant-design-vue'; | |
| 32 | +const { t } = useI18n(); | |
| 33 | + | |
| 34 | +const [ | |
| 35 | + registerTable, | |
| 36 | + { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
| 37 | +] = useTable({ | |
| 38 | + title: t('inspection.serviceRecord.listText'), | |
| 39 | + api: getServiceRecordList, | |
| 40 | + columns, | |
| 41 | + formConfig: { | |
| 42 | + labelWidth: 100, | |
| 43 | + schemas: searchFormSchema, | |
| 44 | + }, | |
| 45 | + immediate: true, | |
| 46 | + useSearchForm: true, | |
| 47 | + showTableSetting: true, | |
| 48 | + bordered: true, | |
| 49 | + showIndexColumn: false, | |
| 50 | + clickToRowSelect: false, | |
| 51 | + rowKey: 'id', | |
| 52 | + actionColumn: { | |
| 53 | + width: 230, | |
| 54 | + title: t('common.actionText'), | |
| 55 | + slots: { customRender: 'action' }, | |
| 56 | + fixed: 'right', | |
| 57 | + }, | |
| 58 | + rowSelection: { | |
| 59 | + type: 'checkbox', | |
| 60 | + getCheckboxProps: (record: any) => {}, | |
| 61 | + }, | |
| 62 | +}); | |
| 63 | +</script> | ... | ... |