diff --git a/index.html b/index.html
index 67316e2..2b3145c 100644
--- a/index.html
+++ b/index.html
@@ -16,7 +16,7 @@
//background-size: cover;
//background-position: center center;
- //background-color: #0d1540;
+ background-color: #0d1540;
//background-color: rgba(45, 119, 243, 0.4);
//background-blend-mode: overlay;
}
diff --git a/src/assets/custom.scss b/src/assets/custom.scss
index f912fe4..63fb102 100644
--- a/src/assets/custom.scss
+++ b/src/assets/custom.scss
@@ -75,6 +75,11 @@
border: none;
}
+:deep(.ant-btn-default:disabled),
+:deep(.ant-btn-default:disabled svg) {
+ color: #AAAAAA;
+}
+
:deep(.ant-btn-default:hover) {
font-family: "Noto Sans SC", serif;
font-size: 14px;
@@ -514,3 +519,8 @@
color: white !important;
border-inline-end: 1px solid #183171 !important;
}
+
+:deep(.ant-checkbox-inner) {
+ border: 1px solid rgba(45, 119, 243, 0.3) !important;
+ background-color: #13265a !important;
+}
diff --git a/src/views/data/task/index.vue b/src/views/data/task/index.vue
index 3bbf26d..7cb6374 100644
--- a/src/views/data/task/index.vue
+++ b/src/views/data/task/index.vue
@@ -7,6 +7,9 @@
新增
+
+ 下发数据
+ 同步数据
@@ -35,6 +38,18 @@
onClick: handleView.bind(null, record),
divider: true
},
+ {
+ label: '下发数据',
+ icon: 'ant-design:download-outlined',
+ onClick: handleDownload.bind(null, record),
+ divider: true
+ },
+ {
+ label: '同步数据',
+ icon: 'ant-design:sync-outlined',
+ onClick: handleSync.bind(null, record),
+ divider: true
+ },
]"
/>
@@ -55,13 +70,15 @@
import { columns, searchFormSchema } from './schema';
import { useMessage } from "@/hooks/web/useMessage";
import {SvgIcon} from "@/components/Icon";
- import {h} from "vue";
- import {PlusOutlined} from "@ant-design/icons-vue";
-
+ import {h, ref} from "vue";
+ import {DownloadOutlined, PlusOutlined, SyncOutlined} from "@ant-design/icons-vue";
const { createMessage } = useMessage();
const { hasPermission } = usePermission();
const go = useGo();
-
+ const checkedKeys = ref>([]);
+ const onSelectChange = (selectedRowKeys: (string | number)[]) => {
+ checkedKeys.value = selectedRowKeys.filter(k => typeof k !== 'undefined');
+ }
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload }] = useTable({
api: (params) => TaskApi.search(handleParams(params)),
@@ -71,6 +88,10 @@
schemas: searchFormSchema,
showAdvancedButton: false,
},
+ rowSelection: {
+ type: 'checkbox',
+ onChange: onSelectChange,
+ },
useSearchForm: true,
showTableSetting: false,
bordered: true,
@@ -78,13 +99,12 @@
canResize: false,
rowKey: (record: any) => record.id,
actionColumn: {
- width: 250,
+ width: 420,
title: '操作',
dataIndex: 'action',
fixed: undefined,
},
});
-
const handleParams = (params) => {
const { pageNum, pageSize, field = 'id', order = 'descend', ...rest } = params;
const handledParams: any = { pageNum, pageSize, orderByClause: `${field} ${order === 'descend' ? 'desc' : 'asc'}` };
@@ -143,6 +163,14 @@
const handleView = (record) => {
go('/data/task/' + record.id);
};
+
+ const handleDownload = (record: Recordable) => {
+ const ids = [...new Set([...(record.id ? [record.id] : []), ...(checkedKeys.value.map(d => (d)))])]
+ };
+
+ const handleSync = (record: Recordable) => {
+ const ids = [...new Set([...(record.id ? [record.id] : []), ...(checkedKeys.value.map(d => (d)))])]
+ };