1. 特色方功能迭代(固定价格),固定价格目前统一使用药品id(-102),后期会考虑新增特色方的时候自动添加一个特色方药品
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
2. 退款的时候可以退回分成
This commit is contained in:
@@ -3,7 +3,7 @@ import { ref, watch } from 'vue';
|
||||
|
||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { EditOutlined, FolderOutlined } from '@ant-design/icons-vue';
|
||||
import { EditOutlined, FolderAddOutlined, FolderOutlined } from '@ant-design/icons-vue';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
@@ -23,6 +23,7 @@ import { useFileGalleryFilter } from '#/composables/use-file-gallery-filter';
|
||||
import { resolveTypeIcon } from '#/composables/use-file-type-icon';
|
||||
import type { FileGalleryItem } from '#/api/core/file-gallery';
|
||||
import {
|
||||
addFileToGroup,
|
||||
batchArchiveFiles,
|
||||
deleteFileGalleryItem,
|
||||
getFileGalleryList,
|
||||
@@ -30,6 +31,7 @@ import {
|
||||
renameFileGalleryItem,
|
||||
syncFileGalleryFromOss,
|
||||
} from '#/api/core/file-gallery';
|
||||
import { useFileGroupCache } from '#/composables/use-file-group-cache';
|
||||
|
||||
import FileDetailDrawer from './components/file-detail-drawer.vue';
|
||||
|
||||
@@ -49,14 +51,19 @@ const pageSizeOptions = ['12', '24', '48', '96'];
|
||||
|
||||
const {
|
||||
activeType,
|
||||
activeGroupId,
|
||||
keyword,
|
||||
tabs,
|
||||
groupTabs,
|
||||
setActiveType,
|
||||
setActiveGroupId,
|
||||
buildListParams,
|
||||
fileTypes,
|
||||
typesLoading,
|
||||
} = useFileGalleryFilter('file-management-active-type');
|
||||
|
||||
const { loadGroupOptions: refreshGroupOptionsForMenu } = useFileGroupCache();
|
||||
|
||||
const [DetailDrawer, detailDrawerApi] = useVbenDrawer({
|
||||
connectedComponent: FileDetailDrawer,
|
||||
});
|
||||
@@ -151,7 +158,27 @@ async function handleMoveType(item: FileGalleryItem, type: number) {
|
||||
await load();
|
||||
}
|
||||
|
||||
function buildContextMenus(item: FileGalleryItem): ContextMenuItem[] {
|
||||
async function handleAddToGroup(item: FileGalleryItem, groupId: number) {
|
||||
await addFileToGroup(item.id, groupId);
|
||||
message.success('已加入分组');
|
||||
if (!item.group_ids) {
|
||||
item.group_ids = [];
|
||||
}
|
||||
if (!item.group_ids.includes(groupId)) {
|
||||
item.group_ids.push(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
async function buildContextMenus(item: FileGalleryItem): Promise<ContextMenuItem[]> {
|
||||
const groups = await refreshGroupOptionsForMenu();
|
||||
const joinedIds = new Set(item.group_ids ?? []);
|
||||
const groupChildren: ContextMenuItem[] = groups.map((groupItem) => ({
|
||||
key: `group-${groupItem.id}`,
|
||||
label: groupItem.name,
|
||||
disabled: joinedIds.has(groupItem.id),
|
||||
handler: () => handleAddToGroup(item, groupItem.id),
|
||||
}));
|
||||
|
||||
const moveChildren: ContextMenuItem[] = fileTypes.value.map((typeItem) => ({
|
||||
key: `move-${typeItem.value}`,
|
||||
label: typeItem.name,
|
||||
@@ -167,6 +194,12 @@ function buildContextMenus(item: FileGalleryItem): ContextMenuItem[] {
|
||||
icon: EditOutlined,
|
||||
handler: () => handleRename(item),
|
||||
},
|
||||
{
|
||||
key: 'add-group',
|
||||
label: '加入分组',
|
||||
icon: FolderAddOutlined,
|
||||
children: groupChildren.length ? groupChildren : [{ key: 'empty', label: '暂无分组', disabled: true }],
|
||||
},
|
||||
{
|
||||
key: 'move',
|
||||
label: '移动分类',
|
||||
@@ -176,8 +209,9 @@ function buildContextMenus(item: FileGalleryItem): ContextMenuItem[] {
|
||||
];
|
||||
}
|
||||
|
||||
function onContextMenu(e: MouseEvent, item: FileGalleryItem) {
|
||||
showContextMenu(e, buildContextMenus(item), item);
|
||||
async function onContextMenu(e: MouseEvent, item: FileGalleryItem) {
|
||||
const menus = await buildContextMenus(item);
|
||||
showContextMenu(e, menus, item);
|
||||
}
|
||||
|
||||
function onTabChange(key: string | number) {
|
||||
@@ -186,6 +220,12 @@ function onTabChange(key: string | number) {
|
||||
void load();
|
||||
}
|
||||
|
||||
function onGroupTabChange(key: string | number) {
|
||||
setActiveGroupId(Number(key));
|
||||
page.value = 1;
|
||||
void load();
|
||||
}
|
||||
|
||||
function onSearch(value: string) {
|
||||
keyword.value = value;
|
||||
page.value = 1;
|
||||
@@ -236,6 +276,16 @@ watch(typesLoading, (val) => {
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
|
||||
<Tabs
|
||||
v-if="groupTabs.length > 1"
|
||||
:active-key="String(activeGroupId)"
|
||||
class="group-tabs"
|
||||
size="small"
|
||||
@change="onGroupTabChange"
|
||||
>
|
||||
<Tabs.TabPane v-for="tab in groupTabs" :key="String(tab.value)" :tab="tab.label" />
|
||||
</Tabs>
|
||||
|
||||
<div class="toolbar">
|
||||
<Input.Search
|
||||
v-model:value="keyword"
|
||||
@@ -315,6 +365,10 @@ watch(typesLoading, (val) => {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.group-tabs {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user