Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
75af4f07
authored
Jul 09, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【解决todo】isUser 修改为 computed
parent
9e3f228a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
src/views/ai/model/chatRole/ChatRoleForm.vue
+8
-9
No files found.
src/views/ai/model/chatRole/ChatRoleForm.vue
View file @
75af4f07
...
...
@@ -13,7 +13,7 @@
<el-form-item
label=
"角色头像"
prop=
"avatar"
>
<UploadImg
v-model=
"formData.avatar"
height=
"60px"
width=
"60px"
/>
</el-form-item>
<el-form-item
label=
"绑定模型"
prop=
"modelId"
v-if=
"!isUser
(formType)
"
>
<el-form-item
label=
"绑定模型"
prop=
"modelId"
v-if=
"!isUser"
>
<el-select
v-model=
"formData.modelId"
placeholder=
"请选择模型"
clearable
>
<el-option
v-for=
"chatModel in chatModelList"
...
...
@@ -23,7 +23,7 @@
/>
</el-select>
</el-form-item>
<el-form-item
label=
"角色类别"
prop=
"category"
v-if=
"!isUser
(formType)
"
>
<el-form-item
label=
"角色类别"
prop=
"category"
v-if=
"!isUser"
>
<el-input
v-model=
"formData.category"
placeholder=
"请输入角色类别"
/>
</el-form-item>
<el-form-item
label=
"角色描述"
prop=
"description"
>
...
...
@@ -32,7 +32,7 @@
<el-form-item
label=
"角色设定"
prop=
"systemMessage"
>
<el-input
type=
"textarea"
v-model=
"formData.systemMessage"
placeholder=
"请输入角色设定"
/>
</el-form-item>
<el-form-item
label=
"是否公开"
prop=
"publicStatus"
v-if=
"!isUser
(formType)
"
>
<el-form-item
label=
"是否公开"
prop=
"publicStatus"
v-if=
"!isUser"
>
<el-radio-group
v-model=
"formData.publicStatus"
>
<el-radio
v-for=
"dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
...
...
@@ -43,10 +43,10 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"角色排序"
prop=
"sort"
v-if=
"!isUser
(formType)
"
>
<el-form-item
label=
"角色排序"
prop=
"sort"
v-if=
"!isUser"
>
<el-input-number
v-model=
"formData.sort"
placeholder=
"请输入角色排序"
class=
"!w-1/1"
/>
</el-form-item>
<el-form-item
label=
"开启状态"
prop=
"status"
v-if=
"!isUser
(formType)
"
>
<el-form-item
label=
"开启状态"
prop=
"status"
v-if=
"!isUser"
>
<el-radio-group
v-model=
"formData.status"
>
<el-radio
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
...
...
@@ -97,10 +97,9 @@ const formRef = ref() // 表单 Ref
const
chatModelList
=
ref
([]
as
ChatModelVO
[])
// 聊天模型列表
/** 是否【我】自己创建,私有角色 */
// TODO @fan:建议改成计算函数 computed
const
isUser
=
(
type
:
string
)
=>
{
return
type
===
'my-create'
||
type
===
'my-update'
}
const
isUser
=
computed
(()
=>
{
return
formType
.
value
===
'my-create'
||
formType
.
value
===
'my-update'
})
// TODO @fan:直接使用 formRules;只要隐藏掉的字段,它是不会校验的哈;
const
getFormRules
=
async
(
type
:
string
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment