From 2f66c7af1116447b4ec893614649ef49eb551466 Mon Sep 17 00:00:00 2001
From: rd <1344903914@qq.com>
Date: Mon, 15 Sep 2025 17:02:48 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=9F=E6=96=99=E5=BA=93-=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=92=8C=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在 `raw-material` 组件中添加标签管理按钮和模态框
- 新增 `tags-manage-modal` 组件及其子组件 `add-tag` 和 `delete-tag`
- 添加原料库标签相关的 API 接口
- 更新样式文件以支持新的标签管理界面
---
src/api/all/generationWorkshop.ts | 21 +++
.../components/tags-manage-modal/add-tag.vue | 75 ++++++++++
.../tags-manage-modal/delete-tag.vue | 63 +++++++++
.../components/tags-manage-modal/index.vue | 132 ++++++++++++++++++
.../components/tags-manage-modal/style.scss | 51 +++++++
.../components/raw-material/index.vue | 51 ++++++-
.../components/tags-manage-modal/index.vue | 4 +-
7 files changed, 392 insertions(+), 5 deletions(-)
create mode 100644 src/views/material-center/components/raw-material/components/tags-manage-modal/add-tag.vue
create mode 100644 src/views/material-center/components/raw-material/components/tags-manage-modal/delete-tag.vue
create mode 100644 src/views/material-center/components/raw-material/components/tags-manage-modal/index.vue
create mode 100644 src/views/material-center/components/raw-material/components/tags-manage-modal/style.scss
diff --git a/src/api/all/generationWorkshop.ts b/src/api/all/generationWorkshop.ts
index f31186e..cb73f96 100644
--- a/src/api/all/generationWorkshop.ts
+++ b/src/api/all/generationWorkshop.ts
@@ -170,3 +170,24 @@ export const batchDeleteRawMaterials = (params = {}) => {
export const postRawMaterialsAI = (params = {}) => {
return Http.post('/v1/raw-materials/ai', params);
};
+
+// 原料库标签-列表
+export const getRawMaterialTagsList = (params = {}) => {
+ return Http.get('/v1/raw-material-tags/list', params);
+};
+
+// 原料库标签-添加
+export const posRawMaterialTags = (params = {}) => {
+ return Http.post('/v1/raw-material-tags', params);
+};
+
+// 原料库标签-修改
+export const putRawMaterialTag = (params = {}) => {
+ const { id, ...rest } = params as { id: string; [key: string]: any };
+ return Http.put(`/v1/raw-material-tags/${id}`, rest);
+};
+
+// 原料库标签-删除
+export const deleteRawMaterialTag = (id: string) => {
+ return Http.delete(`/v1/raw-material-tags/${id}`);
+};
diff --git a/src/views/material-center/components/raw-material/components/tags-manage-modal/add-tag.vue b/src/views/material-center/components/raw-material/components/tags-manage-modal/add-tag.vue
new file mode 100644
index 0000000..bec2264
--- /dev/null
+++ b/src/views/material-center/components/raw-material/components/tags-manage-modal/add-tag.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/material-center/components/raw-material/components/tags-manage-modal/delete-tag.vue b/src/views/material-center/components/raw-material/components/tags-manage-modal/delete-tag.vue
new file mode 100644
index 0000000..0543477
--- /dev/null
+++ b/src/views/material-center/components/raw-material/components/tags-manage-modal/delete-tag.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
![]()
+
确认删除 "{{ tagName }}" 这个标签吗?
+
+
+
+
+
+
+
+
+
diff --git a/src/views/material-center/components/raw-material/components/tags-manage-modal/index.vue b/src/views/material-center/components/raw-material/components/tags-manage-modal/index.vue
new file mode 100644
index 0000000..a7f0b32
--- /dev/null
+++ b/src/views/material-center/components/raw-material/components/tags-manage-modal/index.vue
@@ -0,0 +1,132 @@
+
+
+
+
+
+ 标签名称
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ tag.name }}
+
![]()
+
+
+
+
+
+ 暂无标签
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/material-center/components/raw-material/components/tags-manage-modal/style.scss b/src/views/material-center/components/raw-material/components/tags-manage-modal/style.scss
new file mode 100644
index 0000000..2ec1a38
--- /dev/null
+++ b/src/views/material-center/components/raw-material/components/tags-manage-modal/style.scss
@@ -0,0 +1,51 @@
+.raw-material-tags-manage-modal {
+ border-radius: 8px;
+
+ .ant-modal-body {
+ // padding: 24px 24px 44px !important;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+
+ .arcanto-btn {
+ width: fit-content;
+
+ .ant-btn-icon {
+ line-height: 16px;
+ }
+ }
+
+ .tag-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
+
+ .tag-item {
+ height: 24px;
+ display: flex;
+ align-items: center;
+ background: #f5f5f5;
+ border-radius: 4px;
+ padding: 4px 12px;
+ position: relative;
+
+ .delete-icon {
+ position: absolute;
+ z-index: 1;
+ top: -6px;
+ right: -6px;
+ cursor: pointer;
+ width: 12px;
+ height: 12px;
+ display: none;
+ }
+
+ &:hover {
+ .delete-icon {
+ display: block;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/views/material-center/components/raw-material/index.vue b/src/views/material-center/components/raw-material/index.vue
index 0673c1c..d662d5e 100644
--- a/src/views/material-center/components/raw-material/index.vue
+++ b/src/views/material-center/components/raw-material/index.vue
@@ -1,14 +1,18 @@