diff --git a/src/api/all/assignment-management.ts b/src/api/all/assignment-management.ts index 2d7834f..f9aa270 100644 --- a/src/api/all/assignment-management.ts +++ b/src/api/all/assignment-management.ts @@ -14,7 +14,7 @@ export const delTaskSchedules = (id: string) => { // 任务管理-修改 export const editTaskSchedules = (id: string, params = {}) => { console.log('id', id); - return Http.put(`/v1/task-schedules/${id}`,params); + return Http.put(`/v1/task-schedules/${id}`, params); }; // 任务管理-详情 @@ -22,3 +22,18 @@ export const getTaskSchedulesDetail = (id: string) => { console.log('id', id); return Http.get(`/v1/task-schedules/${id}`); }; +//任务管理-手动添加 +export const createTask = (params = {}) => { + return Http.post(`/v1/task-schedules/manual`, params); +}; + +//任务管理-手动添加 +export const generateContent = (id: string) => { + return Http.post(`/v1/task-schedules/${id}/generate-content`); +}; + +// 任务管理-修改 +export const editTaskSchedulesTime = (id: string, params = {}) => { + console.log('id', id); + return Http.patch(`/v1/task-schedules/${id}/execution-time`, params); +}; diff --git a/src/assets/img/media-account/icon-AI.png b/src/assets/img/media-account/icon-AI.png new file mode 100644 index 0000000..795b3bb Binary files /dev/null and b/src/assets/img/media-account/icon-AI.png differ diff --git a/src/components/common-select/index.vue b/src/components/common-select/index.vue index 74663c0..2ca73d2 100644 --- a/src/components/common-select/index.vue +++ b/src/components/common-select/index.vue @@ -11,23 +11,35 @@ :allowClear="allClear" :showSearch="allowSearch" showArrow - :maxTagCount="maxTagCount" + :maxTagCount="maxTagCount !== undefined ? maxTagCount : multiple ? 3 : undefined" @change="handleChange" @dropdownVisibleChange="onDropdownVisibleChange" + :filterOption="allowSearch ? filterOption : undefined" > - + + + + diff --git a/src/components/filter-popup/index.vue b/src/components/filter-popup/index.vue new file mode 100644 index 0000000..435a0f9 --- /dev/null +++ b/src/components/filter-popup/index.vue @@ -0,0 +1,115 @@ + + + + + + \ No newline at end of file diff --git a/src/hooks/useTableSelectionWithPagination.ts b/src/hooks/useTableSelectionWithPagination.ts index ebc6b22..563f9b7 100644 --- a/src/hooks/useTableSelectionWithPagination.ts +++ b/src/hooks/useTableSelectionWithPagination.ts @@ -1,7 +1,10 @@ import { ref, computed } from 'vue'; +import { merge } from 'lodash-es'; +import { cloneDeep } from 'lodash-es'; interface UseTableSelectionWithPaginationOptions { rowKey?: string; // 主键字段名,默认 'id' + type?: 'checkbox' | 'radio'; // 选择类型,默认 'checkbox' pageInfo?: { page?: number; page_size?: number; @@ -20,6 +23,7 @@ const DEFAULT_PAGE_INFO = { export function useTableSelectionWithPagination(options: UseTableSelectionWithPaginationOptions = {}) { const rowKey = options.rowKey || 'id'; + const type = options.type || 'checkbox'; // 默认为复选框 const selectedRowKeys = ref>([]); const selectedRows = ref>([]); @@ -31,12 +35,24 @@ export function useTableSelectionWithPagination(options: UseTableSelectionWithPa // 单行选择 const handleSelect = (record: any, select: boolean) => { const _targetKey = record[rowKey]; - if (select) { - selectedRows.value.push(record); - selectedRowKeys.value.push(_targetKey); + if (type === 'radio') { + // 单选模式 + if (select) { + selectedRows.value = [record]; + selectedRowKeys.value = [_targetKey]; + } else { + selectedRows.value = []; + selectedRowKeys.value = []; + } } else { - selectedRows.value = selectedRows.value.filter((v) => v[rowKey] !== _targetKey); - selectedRowKeys.value = selectedRowKeys.value.filter((key) => key !== _targetKey); + // 多选模式(默认) + if (select) { + selectedRows.value.push(record); + selectedRowKeys.value.push(_targetKey); + } else { + selectedRows.value = selectedRows.value.filter((v) => v[rowKey] !== _targetKey); + selectedRowKeys.value = selectedRowKeys.value.filter((key) => key !== _targetKey); + } } options.onSelectChange?.(); @@ -44,6 +60,9 @@ export function useTableSelectionWithPagination(options: UseTableSelectionWithPa // 全选/取消全选 const handleSelectAll = (checked: boolean) => { + // 单选模式下不支持全选 + if (type === 'radio') return; + const currentPageRows = dataSource.value; const currentPageKeys = currentPageRows.map((v) => v[rowKey]); @@ -60,26 +79,44 @@ export function useTableSelectionWithPagination(options: UseTableSelectionWithPa options.onSelectChange?.(); }; + // 选择变更处理 + const handleSelectChange = (keys: Array, rows: Array) => { + if (type === 'radio') { + // 单选模式下只保留最后一个选择 + selectedRowKeys.value = keys.length > 0 ? [keys[keys.length - 1]] : []; + selectedRows.value = rows.length > 0 ? [rows[rows.length - 1]] : []; + } else { + // 多选模式 + selectedRowKeys.value = keys; + selectedRows.value = rows; + } + options.onSelectChange?.(); + }; + const onPageChange = (page: number, pageSize: number) => { // console.log('onPageChange', page, pageSize); pageInfo.value.page = page; pageInfo.value.page_size = pageSize; options.onPageChange?.(page); }; + const onPageSizeChange = (current: number, size: number) => { // console.log('onPageSizeChange', current, size); // pageInfo.value.page_size = size; // pageInfo.value.page = 1; // options.onPageSizeChange?.(size); }; + const resetPageInfo = () => { pageInfo.value = cloneDeep(DEFAULT_PAGE_INFO); }; const rowSelection = computed(() => ({ - type: 'checkbox', - showCheckedAll: true, + type: type, + showCheckedAll: type === 'checkbox', // 只有复选框模式才显示全选 width: 48, + selectedRowKeys: selectedRowKeys.value, + onChange: handleSelectChange })); return { @@ -92,7 +129,8 @@ export function useTableSelectionWithPagination(options: UseTableSelectionWithPa rowSelection, handleSelect, handleSelectAll, + handleSelectChange, resetPageInfo, DEFAULT_PAGE_INFO, }; -} +} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index bf34b07..150a597 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,7 +13,7 @@ import SvgIcon from '@/components/svg-icon/index.vue'; import '@/api/index'; import './core'; -import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式 +// import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式 import 'normalize.css'; import 'uno.css'; diff --git a/src/views/material-center/components/finished-products/manuscript/list/components/manuscript-table/constants.ts b/src/views/material-center/components/finished-products/manuscript/list/components/manuscript-table/constants.ts index a285027..8045360 100644 --- a/src/views/material-center/components/finished-products/manuscript/list/components/manuscript-table/constants.ts +++ b/src/views/material-center/components/finished-products/manuscript/list/components/manuscript-table/constants.ts @@ -43,14 +43,6 @@ export const TABLE_COLUMNS = [ dataIndex: 'origin', width: 120, }, - { - title: '上传时间', - dataIndex: 'created_at', - width: 180, - sortable: { - sortDirections: ['ascend', 'descend'], - }, - }, { title: '上传人员', dataIndex: 'uploader', diff --git a/src/views/property-marketing/assignment-management/components/TaskDetail.vue b/src/views/property-marketing/assignment-management/components/TaskDetail.vue deleted file mode 100644 index 0d3499c..0000000 --- a/src/views/property-marketing/assignment-management/components/TaskDetail.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - - - diff --git a/src/views/property-marketing/assignment-management/components/colorTip.vue b/src/views/property-marketing/assignment-management/components/colorTip.vue new file mode 100644 index 0000000..9bb4524 --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/colorTip.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/date-selector.vue b/src/views/property-marketing/assignment-management/components/date-selector.vue new file mode 100644 index 0000000..9ad0dbb --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/date-selector.vue @@ -0,0 +1,280 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/draw-popup.vue b/src/views/property-marketing/assignment-management/components/draw-popup.vue new file mode 100644 index 0000000..5ac260f --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/draw-popup.vue @@ -0,0 +1,625 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/filter-popup.vue b/src/views/property-marketing/assignment-management/components/filter-popup.vue new file mode 100644 index 0000000..9398eac --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/filter-popup.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/finished-product-drawer.vue b/src/views/property-marketing/assignment-management/components/finished-product-drawer.vue new file mode 100644 index 0000000..835d499 --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/finished-product-drawer.vue @@ -0,0 +1,270 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue b/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue new file mode 100644 index 0000000..df5253f --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/components/task-item.vue b/src/views/property-marketing/assignment-management/components/task-item.vue new file mode 100644 index 0000000..c0a7768 --- /dev/null +++ b/src/views/property-marketing/assignment-management/components/task-item.vue @@ -0,0 +1,372 @@ + + + + + diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue index 5746a4b..7238362 100644 --- a/src/views/property-marketing/assignment-management/index.vue +++ b/src/views/property-marketing/assignment-management/index.vue @@ -1,308 +1,97 @@ diff --git a/yarn.lock b/yarn.lock index 1f3617c..aec5f68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8936,6 +8936,11 @@ vue-eslint-parser@^9.0.0, vue-eslint-parser@^9.0.1, vue-eslint-parser@^9.1.0, vu lodash "^4.17.21" semver "^7.3.6" +vue-lazyload@^3.0.0: + version "3.0.0" + resolved "https://registry.npmmirror.com/vue-lazyload/-/vue-lazyload-3.0.0.tgz" + integrity sha512-h2keL/Rj550dLgesgOtXJS9qOiSMmuJNeVlfNAYV1/IYwOQYaWk5mFJlwRxmZDK9YC5gECcFLYYj7z1lKSf9ug== + vue-router@^4.4.0: version "4.5.1" resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.1.tgz"