| | |
| | | name: 'JudgeDetailsList' |
| | | }); |
| | | |
| | | |
| | | const appStore = useAppStore(); |
| | | const { download } = useDownload(); |
| | | const { hasAuth } = useAuth(); |
| | |
| | | |
| | | const { columns, columnChecks, data, getData, getDataByPage, loading, mobilePagination, scrollX } = |
| | | useNaivePaginatedTable({ |
| | | api: () => fetchGetJudgeDetailsList(searchParams.value), |
| | | transform: response => defaultTransform(response), |
| | | onPaginationParamsChange: params => { |
| | | searchParams.value.pageNum = params.page; |
| | | searchParams.value.pageSize = params.pageSize; |
| | | }, |
| | | columns: () => [ |
| | | { |
| | | type: 'selection', |
| | | align: 'center', |
| | | width: 48 |
| | | api: () => fetchGetJudgeDetailsList(searchParams.value), |
| | | transform: response => defaultTransform(response), |
| | | onPaginationParamsChange: params => { |
| | | searchParams.value.pageNum = params.page; |
| | | searchParams.value.pageSize = params.pageSize; |
| | | }, |
| | | { |
| | | key: 'index', |
| | | title: $t('common.index'), |
| | | align: 'center', |
| | | width: 64, |
| | | render: (_, index) => index + 1 |
| | | }, |
| | | { |
| | | key: 'judgeId', |
| | | title: '判定主标识', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'itemCod', |
| | | title: '判定项ITEM', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'itemName', |
| | | title: '判定项NAME', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value3', |
| | | title: '标准值', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value1', |
| | | title: '判定值1', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value2', |
| | | title: '判定值2', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'location', |
| | | title: '缺陷位置', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'cls', |
| | | title: '判定级别 (A,B,C,D)', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'stdscore', |
| | | title: '分值标准 (扣分标准,得分标准),比如不合格一次扣多少分', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'ismix', |
| | | title: '标记此项是否为合成项目,比如外观,实际上关联了很多子项目', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'rid', |
| | | title: '若此字段有UUID值,表明它可能为其他项目的子项,比如“空头”,它为烟支外观项目的子项', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'category', |
| | | title: '范围-备用', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'decisionDes', |
| | | title: '备注', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'updateUser', |
| | | title: '修改人', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'operate', |
| | | title: $t('common.operate'), |
| | | align: 'center', |
| | | width: 130, |
| | | render: row => { |
| | | const divider = () => { |
| | | if (!hasAuth('qm:judgeDetails:edit') || !hasAuth('qm:judgeDetails:remove')) { |
| | | return null; |
| | | } |
| | | return <NDivider vertical />; |
| | | }; |
| | | columns: () => [ |
| | | { |
| | | type: 'selection', |
| | | align: 'center', |
| | | width: 48 |
| | | }, |
| | | { |
| | | key: 'index', |
| | | title: $t('common.index'), |
| | | align: 'center', |
| | | width: 64, |
| | | render: (_, index) => index + 1 |
| | | }, |
| | | { |
| | | key: 'judgeId', |
| | | title: '判定主标识', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'itemCod', |
| | | title: '判定项ITEM', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'itemName', |
| | | title: '判定项NAME', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value3', |
| | | title: '标准值', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value1', |
| | | title: '判定值1', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'value2', |
| | | title: '判定值2', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'location', |
| | | title: '缺陷位置', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'cls', |
| | | title: '判定级别 (A,B,C,D)', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'stdscore', |
| | | title: '分值标准 (扣分标准,得分标准),比如不合格一次扣多少分', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'ismix', |
| | | title: '标记此项是否为合成项目,比如外观,实际上关联了很多子项目', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'rid', |
| | | title: '若此字段有UUID值,表明它可能为其他项目的子项,比如“空头”,它为烟支外观项目的子项', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'category', |
| | | title: '范围-备用', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'decisionDes', |
| | | title: '备注', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'updateUser', |
| | | title: '修改人', |
| | | align: 'center', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | key: 'operate', |
| | | title: $t('common.operate'), |
| | | align: 'center', |
| | | width: 130, |
| | | render: row => { |
| | | const divider = () => { |
| | | if (!hasAuth('qm:judgeDetails:edit') || !hasAuth('qm:judgeDetails:remove')) { |
| | | return null; |
| | | } |
| | | return <NDivider vertical />; |
| | | }; |
| | | |
| | | const editBtn = () => { |
| | | if (!hasAuth('qm:judgeDetails:edit')) { |
| | | return null; |
| | | } |
| | | const editBtn = () => { |
| | | if (!hasAuth('qm:judgeDetails:edit')) { |
| | | return null; |
| | | } |
| | | return ( |
| | | <ButtonIcon |
| | | text |
| | | type="primary" |
| | | icon="material-symbols:drive-file-rename-outline-outline" |
| | | tooltipContent={$t('common.edit')} |
| | | onClick={() => edit(row.id)} |
| | | /> |
| | | ); |
| | | }; |
| | | |
| | | const deleteBtn = () => { |
| | | if (!hasAuth('qm:judgeDetails:remove')) { |
| | | return null; |
| | | } |
| | | return ( |
| | | <ButtonIcon |
| | | text |
| | | type="error" |
| | | icon="material-symbols:delete-outline" |
| | | tooltipContent={$t('common.delete')} |
| | | popconfirmContent={$t('common.confirmDelete')} |
| | | onPositiveClick={() => handleDelete(row.id)} |
| | | /> |
| | | ); |
| | | }; |
| | | |
| | | return ( |
| | | <ButtonIcon |
| | | text |
| | | type="primary" |
| | | icon="material-symbols:drive-file-rename-outline-outline" |
| | | tooltipContent={$t('common.edit')} |
| | | onClick={() => edit(row.id)} |
| | | /> |
| | | <div class="flex-center gap-8px"> |
| | | {editBtn()} |
| | | {divider()} |
| | | {deleteBtn()} |
| | | </div> |
| | | ); |
| | | }; |
| | | |
| | | const deleteBtn = () => { |
| | | if (!hasAuth('qm:judgeDetails:remove')) { |
| | | return null; |
| | | } |
| | | return ( |
| | | <ButtonIcon |
| | | text |
| | | type="error" |
| | | icon="material-symbols:delete-outline" |
| | | tooltipContent={$t('common.delete')} |
| | | popconfirmContent={$t('common.confirmDelete')} |
| | | onPositiveClick={() => handleDelete(row.id)} |
| | | /> |
| | | ); |
| | | }; |
| | | |
| | | return ( |
| | | <div class="flex-center gap-8px"> |
| | | {editBtn()} |
| | | {divider()} |
| | | {deleteBtn()} |
| | | </div> |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }); |
| | | ] |
| | | }); |
| | | |
| | | const { drawerVisible, operateType, editingData, handleAdd, handleEdit, checkedRowKeys, onBatchDeleted, onDeleted } = |
| | | useTableOperate(data, 'id', getData); |