|
@@ -2,7 +2,7 @@
|
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
|
import { Search } from '@/components/Search'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
-import { ElButton } from 'element-plus'
|
|
|
+import { ElButton, ElButtonGroup, ElTooltip } from 'element-plus'
|
|
|
import { Table } from '@/components/Table'
|
|
|
import { getTableListApi, delTableListApi } from '@/api/manage/product'
|
|
|
import { useTable } from '@/hooks/web/useTable'
|
|
@@ -14,6 +14,7 @@ import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
|
import { TableSetting } from '@/components/TableSetting'
|
|
|
import { usePageStore } from '@/store/modules/page'
|
|
|
import { set } from 'lodash-es'
|
|
|
+import { useIcon } from '@/hooks/web/useIcon'
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'ProductPage'
|
|
@@ -21,6 +22,10 @@ defineOptions({
|
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
|
+const EditIcon = useIcon({ icon: 'ep:edit' })
|
|
|
+const DetailIcon = useIcon({ icon: 'ep:document' })
|
|
|
+const DeleteIcon = useIcon({ icon: 'ep:delete' })
|
|
|
+
|
|
|
const id = ref<string>('')
|
|
|
|
|
|
const searchParams = ref({})
|
|
@@ -39,7 +44,7 @@ const { tableRegister, tableState, tableMethods } = useTable({
|
|
|
})
|
|
|
return {
|
|
|
list: res.data.list,
|
|
|
- total: res.data.total
|
|
|
+ total: Number(res.data.totalCount)
|
|
|
}
|
|
|
},
|
|
|
fetchDelApi: async () => {
|
|
@@ -157,7 +162,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
},
|
|
|
{
|
|
|
field: 'action',
|
|
|
- width: '260px',
|
|
|
+ width: '160px',
|
|
|
label: t('tableDemo.action'),
|
|
|
search: {
|
|
|
hidden: true
|
|
@@ -173,17 +178,17 @@ const crudSchemas: CrudSchema[] = [
|
|
|
slots: {
|
|
|
default: (data: any) => {
|
|
|
return (
|
|
|
- <>
|
|
|
- <ElButton type="primary" onClick={() => action(data.row, 'edit')}>
|
|
|
- {t('exampleDemo.edit')}
|
|
|
- </ElButton>
|
|
|
- <ElButton type="success" onClick={() => action(data.row, 'detail')}>
|
|
|
- {t('exampleDemo.detail')}
|
|
|
- </ElButton>
|
|
|
- <ElButton type="danger" onClick={() => delData(data.row)}>
|
|
|
- {t('exampleDemo.del')}
|
|
|
- </ElButton>
|
|
|
- </>
|
|
|
+ <ElButtonGroup>
|
|
|
+ <ElTooltip content="编辑">
|
|
|
+ <ElButton text icon={EditIcon} onClick={() => action(data.row, 'edit')} />
|
|
|
+ </ElTooltip>
|
|
|
+ <ElTooltip content="详情">
|
|
|
+ <ElButton text icon={DetailIcon} onClick={() => action(data.row, 'detail')} />
|
|
|
+ </ElTooltip>
|
|
|
+ <ElTooltip content="删除">
|
|
|
+ <ElButton text icon={DeleteIcon} type="danger" onClick={() => delData(data.row)} />
|
|
|
+ </ElTooltip>
|
|
|
+ </ElButtonGroup>
|
|
|
)
|
|
|
}
|
|
|
}
|