|
@ -3,7 +3,7 @@ import { Button, Form, Popconfirm, Divider, Space, Tooltip, Badge } from 'antd' |
|
|
import { useAtom, useAtomValue } from 'jotai' |
|
|
import { useAtom, useAtomValue } from 'jotai' |
|
|
import { |
|
|
import { |
|
|
deleteAppPackageAtom, |
|
|
deleteAppPackageAtom, |
|
|
saveOrUpdateAppPackageAtom, appPackageAtom, appPackagesAtom, appPackageSearchAtom, |
|
|
|
|
|
|
|
|
saveOrUpdateAppPackageAtom, appPackageAtom, appPackagesAtom, appPackageSearchAtom, packageAppAtom, |
|
|
} from '@/store/app/package' |
|
|
} from '@/store/app/package' |
|
|
import { useEffect, useMemo, useState } from 'react' |
|
|
import { useEffect, useMemo, useState } from 'react' |
|
|
import Action from '@/components/action/Action.tsx' |
|
|
import Action from '@/components/action/Action.tsx' |
|
@ -32,6 +32,7 @@ const AppPackage = () => { |
|
|
const [ currentAppPackage, setAppPackage ] = useAtom(appPackageAtom) |
|
|
const [ currentAppPackage, setAppPackage ] = useAtom(appPackageAtom) |
|
|
const { data, isFetching, isLoading, refetch } = useAtomValue(appPackagesAtom) |
|
|
const { data, isFetching, isLoading, refetch } = useAtomValue(appPackagesAtom) |
|
|
const { mutate: deleteAppPackage, isPending: isDeleting } = useAtomValue(deleteAppPackageAtom) |
|
|
const { mutate: deleteAppPackage, isPending: isDeleting } = useAtomValue(deleteAppPackageAtom) |
|
|
|
|
|
const { mutate: packageApp, isPending: packageing } = useAtomValue(packageAppAtom) |
|
|
|
|
|
|
|
|
const [ open, setOpen ] = useState(false) |
|
|
const [ open, setOpen ] = useState(false) |
|
|
const [ openFilter, setFilterOpen ] = useState(false) |
|
|
const [ openFilter, setFilterOpen ] = useState(false) |
|
@ -226,12 +227,22 @@ const AppPackage = () => { |
|
|
valueType: 'option', |
|
|
valueType: 'option', |
|
|
fixed: 'right', |
|
|
fixed: 'right', |
|
|
render: (_, record) => [ |
|
|
render: (_, record) => [ |
|
|
|
|
|
<Action key="package" |
|
|
|
|
|
as={'a'} |
|
|
|
|
|
loading={packageing} |
|
|
|
|
|
disabled={![ 0, 4 ].includes(record.status) || packageing} |
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
packageApp(record) |
|
|
|
|
|
}} |
|
|
|
|
|
>{t('actions.package', '应用打包')}</Action>, |
|
|
|
|
|
<Divider type={'vertical'}/>, |
|
|
<Action key="edit" |
|
|
<Action key="edit" |
|
|
as={'a'} |
|
|
as={'a'} |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
form.setFieldsValue(record) |
|
|
form.setFieldsValue(record) |
|
|
setOpen(true) |
|
|
setOpen(true) |
|
|
}}>{t('actions.edit')}</Action>, |
|
|
}}>{t('actions.edit')}</Action>, |
|
|
|
|
|
<Divider type={'vertical'}/>, |
|
|
<Popconfirm |
|
|
<Popconfirm |
|
|
key={'del_confirm'} |
|
|
key={'del_confirm'} |
|
|
disabled={isDeleting} |
|
|
disabled={isDeleting} |
|
@ -312,7 +323,7 @@ const AppPackage = () => { |
|
|
onRow={(record) => { |
|
|
onRow={(record) => { |
|
|
return { |
|
|
return { |
|
|
className: cx({ |
|
|
className: cx({ |
|
|
'ant-table-row-selected': currentAppPackage?.id === record.id |
|
|
|
|
|
|
|
|
// 'ant-table-row-selected': currentAppPackage?.id === record.id
|
|
|
}), |
|
|
}), |
|
|
onClick: () => { |
|
|
onClick: () => { |
|
|
setAppPackage(record) |
|
|
setAppPackage(record) |
|
|