@@ -5,7 +5,7 @@ import router from '@/router'
export const useAppStore = defineStore('app', {
state: () => ({
- userInfo: null,
+ userInfo: <any>null,
tenantInfo: null,
tenants: [],
permission: {
@@ -16,9 +16,10 @@ export const useAppStore = defineStore('app', {
}),
getters: {
isSuperAdmin() {
+ const _this: any = this
return (
- this.userInfo?.loginId === (import.meta as any).env.VITE_SUPER_ADMIN ||
- this.userInfo?.type == 0
+ _this.userInfo?.loginId === (import.meta as any).env.VITE_SUPER_ADMIN ||
+ _this.userInfo?.type == 0
)
},
@@ -97,7 +97,7 @@ export const useWorkflowStore = defineStore('workflow', {
pathNodes.forEach((n) => {
const wd = n.data.workflowData
const group = {
- label: wd.subTitle || wd.title,
+ label: wd.desc || wd.title,
key: wd.id,
options: [
...(wd.outVars?.map((v) => {
@@ -1,7 +1,18 @@
+import { v4 } from 'uuid'
const nodeDefault = {
defaultValue: () => ({
- modelId: '',
- tip: '',
+ modelConfig: {
+ id: v4(),
+ pluginInstanceId: '',
+ pluginInstanceName: '',
+ paramConfigs: {},
+ bizConfigs: {},
+ },
+ chatModelMessages: [
+ { role: 'system', text: '', id: v4() },
+ { role: 'user', text: '', id: v4() },
+ { role: 'assistant', text: '', id: v4() },
+ ],
outVars: [{ label: '生成内容', key: 'text', type: 'String' }],
}
@@ -1,15 +1,21 @@
<template>
<div class="">
- <div class="mb-2 text-xs opacity-85" v-if="state.nodeData.modelName">
- {{ state.nodeData.modelName }}
+ <div
+ class="mb-2 text-xs opacity-85"
+ v-if="state.nodeData.modelConfig.pluginInstanceName"
+ >
+ {{ state.nodeData.modelConfig.pluginInstanceName }}
</div>
- <paramsTextarea
- v-model="state.nodeData.tip"
- :node="node"
- :readonly="true"
- class="mb-2"
- title="提示词"
- />
+ <template v-for="item in state.nodeData.chatModelMessages">
+ <paramsTextarea
+ v-if="item.text"
+ v-model="item.text"
+ :node="node"
+ :readonly="true"
+ class="mb-2"
+ :title="item.role"
+ />
+ </template>
</template>
@@ -6,19 +6,23 @@
<CzrFormColumn
:span="24"
label-width="0px"
- v-model:param="state.nodeData.modelId"
+ v-model:param="state.nodeData.modelConfig.pluginInstanceId"
link="select"
:options="state.llmModelOptions"
labelKey="name"
valueKey="id"
- @getObject="(val) => (state.nodeData.modelName = val.name)"
- class="mt-4 max-h-100"
+ @getObject="
+ (val) => (state.nodeData.modelConfig.pluginInstanceName = val.name)
+ "
/>
+ class="mt-4 max-h-100"
<div class="_p-title">
<div class="text-sm">输出变量</div>