Skip to content

Commit 43aa547

Browse files
committed
feat: 管理页新增分享按钮-流程管理/套件管理/模型助手管理/Skills管理/报表管理5个列表页操作列新增「分享」按钮,点击直接打开官方市场分享弹窗(GitHub PR),与「发布」共用内容组装逻辑(套件含全部接口/助手含图标),套件与报表列表操作列加宽
1 parent 3dceefb commit 43aa547

5 files changed

Lines changed: 145 additions & 21 deletions

File tree

‎JuggleNet6.Frontend/src/views/ai/AiAssistantList.vue‎

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
active-text="启用" inactive-text="禁用" inline-prompt style="--el-switch-on-color:#67c23a" />
2121
</template>
2222
</el-table-column>
23-
<el-table-column label="操作" width="140">
23+
<el-table-column label="操作" width="190">
2424
<template #default="{ row }">
2525
<el-button size="small" link type="primary" @click="$router.push(`/ai/assistant/${row.id}`)">运行</el-button>
2626
<el-button size="small" link @click="openEdit(row)">编辑</el-button>
2727
<el-button size="small" type="info" link @click="openPublish(row)">发布</el-button>
28+
<el-button size="small" type="warning" link @click="openShare(row)">分享</el-button>
2829
<el-button size="small" type="danger" link @click="doDelete(row)">删除</el-button>
2930
</template>
3031
</el-table-column>
@@ -114,6 +115,11 @@
114115
<MarketPublishDialog v-model:visible="publishVisible" item-type="assistant"
115116
:default-name="publishForm.itemName" :default-desc="publishForm.description" :default-group="publishForm.groupName"
116117
:content-json="publishForm.contentJson" />
118+
119+
<!-- 分享到官方市场(GitHub PR) -->
120+
<MarketShareDialog v-model:visible="shareVisible" item-type="assistant"
121+
:item-name="shareForm.itemName" :description="shareForm.description" :icon="shareForm.icon"
122+
:content-json="shareForm.contentJson" />
117123
</div>
118124
</template>
119125

@@ -122,23 +128,43 @@ import { ref, onMounted } from 'vue'
122128
import { ElMessage, ElMessageBox } from 'element-plus'
123129
import request from '../../utils/request'
124130
import MarketPublishDialog from '../../components/MarketPublishDialog.vue'
131+
import MarketShareDialog from '../../components/MarketShareDialog.vue'
125132
126133
// 发布到市场
127134
const publishVisible = ref(false)
128135
const publishForm = ref<any>({ itemName: '', description: '', groupName: '', contentJson: '{}' })
136+
137+
/** 组装助手内容 JSON */
138+
function buildAssistantContentJson(row: any) {
139+
return JSON.stringify({
140+
assistantName: row.assistantName, description: row.description, systemPrompt: row.systemPrompt,
141+
inputParams: row.inputParams, outputParams: row.outputParams, quickPrompts: row.quickPrompts, icon: row.icon
142+
})
143+
}
144+
129145
function openPublish(row: any) {
130146
publishForm.value = {
131147
itemName: row.assistantName || '',
132148
description: row.description || '',
133149
groupName: '',
134-
contentJson: JSON.stringify({
135-
assistantName: row.assistantName, description: row.description, systemPrompt: row.systemPrompt,
136-
inputParams: row.inputParams, outputParams: row.outputParams, quickPrompts: row.quickPrompts, icon: row.icon
137-
})
150+
contentJson: buildAssistantContentJson(row)
138151
}
139152
publishVisible.value = true
140153
}
141154
155+
// 分享到官方市场(GitHub PR)
156+
const shareVisible = ref(false)
157+
const shareForm = ref<any>({ itemName: '', description: '', icon: '', contentJson: '{}' })
158+
function openShare(row: any) {
159+
shareForm.value = {
160+
itemName: row.assistantName || '',
161+
description: row.description || '',
162+
icon: row.icon || '🤖',
163+
contentJson: buildAssistantContentJson(row)
164+
}
165+
shareVisible.value = true
166+
}
167+
142168
const loading = ref(false)
143169
const tableData = ref<any[]>([])
144170
const dialogVisible = ref(false)

‎JuggleNet6.Frontend/src/views/flow/FlowDefinitionList.vue‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@
5858
</template>
5959
</el-table-column>
6060
<el-table-column prop="createdAt" label="创建时间" width="180" show-overflow-tooltip />
61-
<el-table-column label="操作" width="370" fixed="right">
61+
<el-table-column label="操作" width="420" fixed="right">
6262
<template #default="{ row }">
6363
<el-button size="small" type="primary" link @click="goDesign(row)">设计</el-button>
6464
<el-button size="small" type="success" link @click="doDeploy(row)">部署</el-button>
6565
<el-button size="small" link @click="openEdit(row)">编辑</el-button>
6666
<el-button size="small" type="info" link @click="doClone(row)">克隆</el-button>
6767
<el-button size="small" type="warning" link @click="doExport(row)">导出</el-button>
6868
<el-button size="small" type="info" link @click="openPublish(row)">发布</el-button>
69+
<el-button size="small" type="warning" link @click="openShare(row)">分享</el-button>
6970
<el-tooltip v-if="row.serviceAlias" :content="`WSDL: /open/services/${row.serviceAlias}/wsdl`">
7071
<el-button size="small" link @click="openServiceWsdl(row)">WSDL</el-button>
7172
</el-tooltip>
@@ -117,6 +118,11 @@
117118
<MarketPublishDialog v-model:visible="publishVisible" item-type="flow"
118119
:default-name="publishForm.itemName" :default-desc="publishForm.description" :default-group="publishForm.groupName"
119120
:content-json="publishForm.contentJson" />
121+
122+
<!-- 分享到官方市场(GitHub PR) -->
123+
<MarketShareDialog v-model:visible="shareVisible" item-type="flow"
124+
:item-name="shareForm.itemName" :description="shareForm.description"
125+
:content-json="shareForm.contentJson" />
120126
</div>
121127
</template>
122128

@@ -128,6 +134,7 @@ import request from '../../utils/request'
128134
import { Document, Packer, Paragraph, Table, TableRow, TableCell, WidthType, HeadingLevel, AlignmentType, BorderStyle } from 'docx'
129135
import { saveAs } from 'file-saver'
130136
import MarketPublishDialog from '../../components/MarketPublishDialog.vue'
137+
import MarketShareDialog from '../../components/MarketShareDialog.vue'
131138
132139
// 发布到市场
133140
const publishVisible = ref(false)
@@ -144,6 +151,20 @@ function openPublish(row: any) {
144151
publishVisible.value = true
145152
}
146153
154+
// 分享到官方市场(GitHub PR)
155+
const shareVisible = ref(false)
156+
const shareForm = ref<any>({ itemName: '', description: '', contentJson: '{}' })
157+
function openShare(row: any) {
158+
shareForm.value = {
159+
itemName: row.flowName || '',
160+
description: row.flowDesc || '',
161+
contentJson: JSON.stringify({
162+
flowName: row.flowName, flowDesc: row.flowDesc, groupName: row.groupName, flowContent: row.flowContent || '[]'
163+
})
164+
}
165+
shareVisible.value = true
166+
}
167+
147168
const router = useRouter()
148169
const loading = ref(false)
149170
const tableData = ref([])

‎JuggleNet6.Frontend/src/views/report/ReportList.vue‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
<el-table-column label="状态" width="70">
2020
<template #default="{ row }"><el-tag :type="row.status===1?'success':'info'" size="small">{{ row.status===1?'启用':'停用' }}</el-tag></template>
2121
</el-table-column>
22-
<el-table-column label="操作" width="320">
22+
<el-table-column label="操作" width="370">
2323
<template #default="{ row }">
2424
<el-button size="small" link @click="openDesigner(row.id)">设计</el-button>
2525
<el-button size="small" type="primary" link @click="openPreview(row)">预览</el-button>
2626
<el-button size="small" type="warning" link @click="doExportPdf(row)">PDF</el-button>
2727
<el-button size="small" type="success" link @click="doExportExcel(row)">Excel</el-button>
2828
<el-button size="small" link @click="doPrint(row)">打印</el-button>
2929
<el-button size="small" type="info" link @click="openPublish(row)">发布</el-button>
30+
<el-button size="small" type="warning" link @click="openShare(row)">分享</el-button>
3031
<el-button size="small" type="danger" link @click="doDelete(row)">删除</el-button>
3132
</template>
3233
</el-table-column>
@@ -38,6 +39,11 @@
3839
<MarketPublishDialog v-model:visible="publishVisible" item-type="report"
3940
:default-name="publishForm.itemName" :default-desc="publishForm.description" :default-group="publishForm.groupName"
4041
:content-json="publishForm.contentJson" />
42+
43+
<!-- 分享到官方市场(GitHub PR) -->
44+
<MarketShareDialog v-model:visible="shareVisible" item-type="report"
45+
:item-name="shareForm.itemName" :description="shareForm.description"
46+
:content-json="shareForm.contentJson" />
4147
</div>
4248
</template>
4349

@@ -47,22 +53,41 @@ import { useRouter } from 'vue-router'
4753
import { ElMessage, ElMessageBox } from 'element-plus'
4854
import request from '../../utils/request'
4955
import MarketPublishDialog from '../../components/MarketPublishDialog.vue'
56+
import MarketShareDialog from '../../components/MarketShareDialog.vue'
5057
5158
// 发布到市场
5259
const publishVisible = ref(false)
5360
const publishForm = ref<any>({ itemName: '', description: '', groupName: '', contentJson: '{}' })
61+
62+
/** 组装报表内容 JSON */
63+
function buildReportContentJson(row: any) {
64+
return JSON.stringify({
65+
name: row.name, groupName: row.groupName, paramsConfig: row.paramsConfig || '[]', layoutJson: row.layoutJson || '{}'
66+
})
67+
}
68+
5469
function openPublish(row: any) {
5570
publishForm.value = {
5671
itemName: row.name || '',
5772
description: row.groupName || '',
5873
groupName: row.groupName || '',
59-
contentJson: JSON.stringify({
60-
name: row.name, groupName: row.groupName, paramsConfig: row.paramsConfig || '[]', layoutJson: row.layoutJson || '{}'
61-
})
74+
contentJson: buildReportContentJson(row)
6275
}
6376
publishVisible.value = true
6477
}
6578
79+
// 分享到官方市场(GitHub PR)
80+
const shareVisible = ref(false)
81+
const shareForm = ref<any>({ itemName: '', description: '', contentJson: '{}' })
82+
function openShare(row: any) {
83+
shareForm.value = {
84+
itemName: row.name || '',
85+
description: row.groupName || '',
86+
contentJson: buildReportContentJson(row)
87+
}
88+
shareVisible.value = true
89+
}
90+
6691
const router = useRouter()
6792
const loading = ref(false)
6893
const tableData = ref<any[]>([])

‎JuggleNet6.Frontend/src/views/suite/SuiteList.vue‎

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
<el-table-column prop="suiteVersion" label="版本" width="80" />
3333
<el-table-column prop="suiteDesc" label="描述" show-overflow-tooltip />
3434
<el-table-column prop="createdAt" label="创建时间" width="180" show-overflow-tooltip />
35-
<el-table-column label="操作" width="220" fixed="right">
35+
<el-table-column label="操作" width="270" fixed="right">
3636
<template #default="{ row }">
3737
<el-button size="small" type="primary" link @click="goApiList(row)">接口管理</el-button>
3838
<el-button size="small" link @click="openEdit(row)">编辑</el-button>
3939
<el-button size="small" type="info" link @click="openPublish(row)">发布</el-button>
40+
<el-button size="small" type="warning" link @click="openShare(row)">分享</el-button>
4041
<el-button size="small" type="warning" link @click="doExport(row)">导出</el-button>
4142
<el-button size="small" type="danger" link @click="doDelete(row)">删除</el-button>
4243
</template>
@@ -71,6 +72,11 @@
7172
<MarketPublishDialog v-model:visible="publishVisible" item-type="api"
7273
:default-name="publishForm.itemName" :default-desc="publishForm.description" :default-group="publishForm.groupName"
7374
:content-json="publishForm.contentJson" />
75+
76+
<!-- 分享到官方市场(GitHub PR) -->
77+
<MarketShareDialog v-model:visible="shareVisible" item-type="api"
78+
:item-name="shareForm.itemName" :description="shareForm.description"
79+
:content-json="shareForm.contentJson" />
7480
</div>
7581
</template>
7682

@@ -80,28 +86,49 @@ import { useRouter } from 'vue-router'
8086
import { ElMessage, ElMessageBox } from 'element-plus'
8187
import request from '../../utils/request'
8288
import MarketPublishDialog from '../../components/MarketPublishDialog.vue'
89+
import MarketShareDialog from '../../components/MarketShareDialog.vue'
8390
8491
// 发布到市场(套件及其全部接口)
8592
const publishVisible = ref(false)
8693
const publishForm = ref<any>({ itemName: '', description: '', groupName: '', contentJson: '{}' })
94+
95+
/** 组装套件内容 JSON(套件 + 全部接口) */
96+
async function buildSuiteContentJson(row: any) {
97+
const apisRes: any = await request.post('/suite/api/list', { suiteCode: row.suiteCode })
98+
const apis = (apisRes.data || []).map((a: any) => ({
99+
suiteCode: a.suiteCode, methodCode: a.methodCode, methodName: a.methodName,
100+
methodDesc: a.methodDesc, url: a.url, requestType: a.requestType || 'POST'
101+
}))
102+
return JSON.stringify({
103+
suites: [{ suiteCode: row.suiteCode, suiteName: row.suiteName, suiteDesc: row.suiteDesc }], apis
104+
})
105+
}
106+
87107
async function openPublish(row: any) {
88108
try {
89-
const apisRes: any = await request.post('/suite/api/list', { suiteCode: row.suiteCode })
90-
const apis = (apisRes.data || []).map((a: any) => ({
91-
suiteCode: a.suiteCode, methodCode: a.methodCode, methodName: a.methodName,
92-
methodDesc: a.methodDesc, url: a.url, requestType: a.requestType || 'POST'
93-
}))
94109
publishForm.value = {
95110
itemName: row.suiteName || row.suiteCode || '',
96111
description: row.suiteDesc || '',
97112
groupName: '',
98-
contentJson: JSON.stringify({
99-
suites: [{ suiteCode: row.suiteCode, suiteName: row.suiteName, suiteDesc: row.suiteDesc }], apis
100-
})
113+
contentJson: await buildSuiteContentJson(row)
101114
}
102115
publishVisible.value = true
103116
} catch { /* 拦截器已提示 */ }
104117
}
118+
119+
// 分享到官方市场(GitHub PR)
120+
const shareVisible = ref(false)
121+
const shareForm = ref<any>({ itemName: '', description: '', contentJson: '{}' })
122+
async function openShare(row: any) {
123+
try {
124+
shareForm.value = {
125+
itemName: row.suiteName || row.suiteCode || '',
126+
description: row.suiteDesc || '',
127+
contentJson: await buildSuiteContentJson(row)
128+
}
129+
shareVisible.value = true
130+
} catch { /* 拦截器已提示 */ }
131+
}
105132
import { Document, Packer, Paragraph, Table, TableRow, TableCell, WidthType, HeadingLevel, AlignmentType, BorderStyle } from 'docx'
106133
import { saveAs } from 'file-saver'
107134

‎JuggleNet6.Frontend/src/views/system/SkillList.vue‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
active-text="启用" inactive-text="禁用" inline-prompt style="--el-switch-on-color:#67c23a" />
3030
</template>
3131
</el-table-column>
32-
<el-table-column label="操作" width="200">
32+
<el-table-column label="操作" width="250">
3333
<template #default="{ row }">
3434
<el-button size="small" link @click="openEdit(row)">编辑</el-button>
3535
<el-button size="small" link @click="viewSkill(row)">查看</el-button>
3636
<el-button size="small" type="info" link @click="openPublish(row)">发布</el-button>
37+
<el-button size="small" type="warning" link @click="openShare(row)">分享</el-button>
3738
<el-button size="small" type="primary" link @click="doExport(row)">导出</el-button>
3839
<el-button size="small" type="danger" link @click="doDelete(row)">删除</el-button>
3940
</template>
@@ -86,6 +87,11 @@
8687
<MarketPublishDialog v-model:visible="publishVisible" item-type="skill"
8788
:default-name="publishForm.itemName" :default-desc="publishForm.description" :default-group="publishForm.groupName"
8889
:content-json="publishForm.contentJson" />
90+
91+
<!-- 分享到官方市场(GitHub PR) -->
92+
<MarketShareDialog v-model:visible="shareVisible" item-type="skill"
93+
:item-name="shareForm.itemName" :description="shareForm.description"
94+
:content-json="shareForm.contentJson" />
8995
</div>
9096
</template>
9197

@@ -95,20 +101,39 @@ import { ElMessage, ElMessageBox } from 'element-plus'
95101
import request from '../../utils/request'
96102
import { saveAs } from 'file-saver'
97103
import MarketPublishDialog from '../../components/MarketPublishDialog.vue'
104+
import MarketShareDialog from '../../components/MarketShareDialog.vue'
98105
99106
// 发布到市场
100107
const publishVisible = ref(false)
101108
const publishForm = ref<any>({ itemName: '', description: '', groupName: '', contentJson: '{}' })
109+
110+
/** 组装技能内容 JSON */
111+
function buildSkillContentJson(row: any) {
112+
return JSON.stringify({ skillName: row.skillName, groupName: row.groupName, description: row.description, content: row.content })
113+
}
114+
102115
function openPublish(row: any) {
103116
publishForm.value = {
104117
itemName: row.skillName || '',
105118
description: row.description || '',
106119
groupName: row.groupName || '',
107-
contentJson: JSON.stringify({ skillName: row.skillName, groupName: row.groupName, description: row.description, content: row.content })
120+
contentJson: buildSkillContentJson(row)
108121
}
109122
publishVisible.value = true
110123
}
111124
125+
// 分享到官方市场(GitHub PR)
126+
const shareVisible = ref(false)
127+
const shareForm = ref<any>({ itemName: '', description: '', contentJson: '{}' })
128+
function openShare(row: any) {
129+
shareForm.value = {
130+
itemName: row.skillName || '',
131+
description: row.description || '',
132+
contentJson: buildSkillContentJson(row)
133+
}
134+
shareVisible.value = true
135+
}
136+
112137
const loading = ref(false)
113138
const tableData = ref<any[]>([])
114139
const keyword = ref('')

0 commit comments

Comments
 (0)