From 35a2ad65ca5c7116f76fac609ae132d3341a950e Mon Sep 17 00:00:00 2001
From: vertoryao <673441990@qq.com>
Date: Tue, 6 May 2025 01:46:24 +0800
Subject: [PATCH] =?UTF-8?q?refactor(@vben/web-antd):=20=E5=AE=8C=E6=88=90p?=
=?UTF-8?q?pt=E5=92=8Cword=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/web-antd/src/views/spider/index.vue | 33 +--
apps/web-antd/src/views/word/index.vue | 61 +++--
apps/web-antd/vite.config.mts | 9 +-
packages/effects/common-ui/package.json | 2 +
packages/effects/common-ui/src/ui/index.ts | 1 +
.../common-ui/src/ui/ppt/ppt-perview.vue | 46 ++++
.../common-ui/src/ui/ppt/ppt-work-view.vue | 51 ++--
.../src/ui/spider/spider-list-view.vue | 6 +-
.../effects/common-ui/src/ui/spider/typing.ts | 5 +-
.../effects/common-ui/src/ui/word/index.ts | 4 +
.../effects/common-ui/src/ui/word/typing.ts | 17 ++
.../src/ui/word/word-history-view.vue | 43 +++
.../common-ui/src/ui/word/word-list-view.vue | 38 +++
.../common-ui/src/ui/word/word-preview.vue | 46 ++++
.../common-ui/src/ui/word/word-work-view.vue | 253 ++++++++++++++++++
pnpm-lock.yaml | 6 +
16 files changed, 553 insertions(+), 68 deletions(-)
create mode 100644 packages/effects/common-ui/src/ui/ppt/ppt-perview.vue
create mode 100644 packages/effects/common-ui/src/ui/word/index.ts
create mode 100644 packages/effects/common-ui/src/ui/word/typing.ts
create mode 100644 packages/effects/common-ui/src/ui/word/word-history-view.vue
create mode 100644 packages/effects/common-ui/src/ui/word/word-list-view.vue
create mode 100644 packages/effects/common-ui/src/ui/word/word-preview.vue
create mode 100644 packages/effects/common-ui/src/ui/word/word-work-view.vue
diff --git a/apps/web-antd/src/views/spider/index.vue b/apps/web-antd/src/views/spider/index.vue
index 5aed1d4..cb3caa2 100644
--- a/apps/web-antd/src/views/spider/index.vue
+++ b/apps/web-antd/src/views/spider/index.vue
@@ -1,31 +1,35 @@
@@ -33,7 +37,6 @@ onMounted(() => {
-import type { SpiderItem } from '@vben/common-ui';
+import type { WordTempItem } from '@vben/common-ui';
-import { onMounted, ref } from 'vue';
+import { onMounted, reactive, ref } from 'vue';
-import { SpiderListView, SpiderWorkView } from '@vben/common-ui';
+import { WordHistoryView, WordListView, WordWorkView } from '@vben/common-ui';
-import { getAppList, sendWorkflow } from '#/api';
+import { getChatList, sendChatflow } from '#/api';
-const spiderList = ref([]);
+let temp = reactive({
+ id: 'baca08c1-e92b-4dc9-a445-3584803f54d4',
+ name: '职业创新申报书',
+});
+
+const hitsory = ref([]);
const loading = ref(true);
-const spider = ref();
-const getFlowList = async () => {
- const res = await getAppList({});
- if (res) {
- spiderList.value = res;
- loading.value = false;
- }
+const getLogs = async (appid: string) => {
+ loading.value = true;
+ const res = await getChatList(
+ {
+ appid,
+ },
+ {
+ userId: '1562',
+ lastId: '',
+ sortBy: '',
+ limit: '5',
+ },
+ );
+ // const res = await getChatList({
+ // appid,
+ // limit: 5,
+ // page: 1,
+ // });
+ hitsory.value = res.data;
+ loading.value = false;
};
-function handleClick(item: SpiderItem) {
- spider.value = item;
+function handleClick(item: WordTempItem) {
+ temp = item;
}
onMounted(() => {
- getFlowList();
+ getLogs(temp.id);
});
@@ -32,19 +50,16 @@ onMounted(() => {
diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts
index 0f07d4f..f921083 100644
--- a/apps/web-antd/vite.config.mts
+++ b/apps/web-antd/vite.config.mts
@@ -13,15 +13,14 @@ export default defineConfig(async () => {
target: 'http://localhost:8081/api',
ws: true,
},
- '/static': {
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/static/, ''),
- target: 'http://47.112.173.8:6802',
- },
'/static/*.docx': {
changeOrigin: true,
target: 'http://47.112.173.8:6805',
},
+ '/static/*.ppt': {
+ changeOrigin: true,
+ target: 'http://47.112.173.8:6802',
+ },
'/v1': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/v1/, ''),
diff --git a/packages/effects/common-ui/package.json b/packages/effects/common-ui/package.json
index a108af5..9182318 100644
--- a/packages/effects/common-ui/package.json
+++ b/packages/effects/common-ui/package.json
@@ -39,6 +39,8 @@
"@vben/icons": "workspace:*",
"@vben/locales": "workspace:*",
"@vben/types": "workspace:*",
+ "@vue-office/docx": "^1.6.3",
+ "@vue-office/pptx": "^1.0.1",
"@vueuse/core": "catalog:",
"@vueuse/integrations": "catalog:",
"ant-design-vue": "catalog:",
diff --git a/packages/effects/common-ui/src/ui/index.ts b/packages/effects/common-ui/src/ui/index.ts
index 7fe5f36..0e6a909 100644
--- a/packages/effects/common-ui/src/ui/index.ts
+++ b/packages/effects/common-ui/src/ui/index.ts
@@ -5,3 +5,4 @@ export * from './fallback';
export * from './home';
export * from './ppt';
export * from './spider';
+export * from './word';
diff --git a/packages/effects/common-ui/src/ui/ppt/ppt-perview.vue b/packages/effects/common-ui/src/ui/ppt/ppt-perview.vue
new file mode 100644
index 0000000..96445f9
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/ppt/ppt-perview.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
diff --git a/packages/effects/common-ui/src/ui/ppt/ppt-work-view.vue b/packages/effects/common-ui/src/ui/ppt/ppt-work-view.vue
index 7e24da4..49c806e 100644
--- a/packages/effects/common-ui/src/ui/ppt/ppt-work-view.vue
+++ b/packages/effects/common-ui/src/ui/ppt/ppt-work-view.vue
@@ -1,16 +1,22 @@
-
+
{{ title }}
请选择需要爬取的网站
diff --git a/packages/effects/common-ui/src/ui/spider/typing.ts b/packages/effects/common-ui/src/ui/spider/typing.ts
index ef08602..54917ed 100644
--- a/packages/effects/common-ui/src/ui/spider/typing.ts
+++ b/packages/effects/common-ui/src/ui/spider/typing.ts
@@ -1,9 +1,6 @@
interface SpiderItem {
- id: number;
+ id: string;
name: string;
- description: string;
- content: string;
- path: string;
}
export type { SpiderItem };
diff --git a/packages/effects/common-ui/src/ui/word/index.ts b/packages/effects/common-ui/src/ui/word/index.ts
new file mode 100644
index 0000000..4ab39e9
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/index.ts
@@ -0,0 +1,4 @@
+export type * from './typing';
+export { default as WordHistoryView } from './word-history-view.vue';
+export { default as WordListView } from './word-list-view.vue';
+export { default as WordWorkView } from './word-work-view.vue';
diff --git a/packages/effects/common-ui/src/ui/word/typing.ts b/packages/effects/common-ui/src/ui/word/typing.ts
new file mode 100644
index 0000000..142f872
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/typing.ts
@@ -0,0 +1,17 @@
+interface WordTempItem {
+ id: string;
+ name: string;
+}
+
+interface WordHistoryItem {
+ id: string;
+ workflowRun: {
+ id: string;
+ };
+ createdByEndUser: {
+ id: string;
+ sessionId: string;
+ };
+}
+
+export type { WordHistoryItem, WordTempItem };
diff --git a/packages/effects/common-ui/src/ui/word/word-history-view.vue b/packages/effects/common-ui/src/ui/word/word-history-view.vue
new file mode 100644
index 0000000..718e8cb
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/word-history-view.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+ 运行历史
+
+
+
+
+
+
diff --git a/packages/effects/common-ui/src/ui/word/word-list-view.vue b/packages/effects/common-ui/src/ui/word/word-list-view.vue
new file mode 100644
index 0000000..c81a152
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/word-list-view.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+ 选择模板
+
+
+
+
+
+
diff --git a/packages/effects/common-ui/src/ui/word/word-preview.vue b/packages/effects/common-ui/src/ui/word/word-preview.vue
new file mode 100644
index 0000000..62d771e
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/word-preview.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
diff --git a/packages/effects/common-ui/src/ui/word/word-work-view.vue b/packages/effects/common-ui/src/ui/word/word-work-view.vue
new file mode 100644
index 0000000..ffc360c
--- /dev/null
+++ b/packages/effects/common-ui/src/ui/word/word-work-view.vue
@@ -0,0 +1,253 @@
+
+
+
+
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1f4c35d..a7486b2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1326,6 +1326,12 @@ importers:
'@vben/types':
specifier: workspace:*
version: link:../../types
+ '@vue-office/docx':
+ specifier: ^1.6.3
+ version: 1.6.3(vue-demi@0.14.10(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3))
+ '@vue-office/pptx':
+ specifier: ^1.0.1
+ version: 1.0.1(vue-demi@0.14.10(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3))
'@vueuse/core':
specifier: 'catalog:'
version: 13.1.0(vue@3.5.13(typescript@5.8.3))