Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fbd73dcd
authored
Mar 30, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化gpt体验
1 parent
b4ffd1fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
src/views/crowdManage/crowdAdd.vue
src/views/crowdManage/crowdAdd.vue
View file @
fbd73dc
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
<el-form
ref=
"orderform"
:model=
"orderform"
class=
"order-form"
>
<el-form
ref=
"orderform"
:model=
"orderform"
class=
"order-form"
>
<div
class=
"order"
>
<div
class=
"order"
>
<el-form-item
label=
"输入内容"
>
<el-form-item
label=
"输入内容"
>
<el-input
type=
"textarea"
v-model=
"orderform.order"
rows=
"3"
:clearable=
"true"
></el-input>
<el-input
type=
"textarea"
v-model=
"orderform.order"
rows=
"3"
:clearable=
"true"
:placeholder=
"`例如:$
{placeholder}`"
>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
size=
"small"
@
click=
"handleResetOrder"
>
重置
</el-button>
<el-button
size=
"small"
@
click=
"handleResetOrder"
>
重置
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleOrder"
>
确定
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleOrder"
:disabled=
"disabled"
>
{{
disabled
?
'解析中...'
:
'确定'
}}
</el-button>
</el-form-item>
</el-form-item>
</div>
</div>
<div
class=
"result"
>
<div
class=
"result"
>
...
@@ -205,6 +205,7 @@ export default {
...
@@ -205,6 +205,7 @@ export default {
crowdName
:
''
,
crowdName
:
''
,
crowdDesc
:
''
crowdDesc
:
''
},
},
placeholder
:
'帮我创建一个人群名为名车群,描述为名车车主群。有保养记录和试驾记录,近两年购车的奥迪和宝马30岁以下的男性车主。'
,
crowdRules
:
{
crowdRules
:
{
crowdName
:
[
crowdName
:
[
{
required
:
true
,
message
:
'请输入人群名称'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请输入人群名称'
,
trigger
:
'blur'
},
...
@@ -249,7 +250,8 @@ export default {
...
@@ -249,7 +250,8 @@ export default {
}
}
]
]
},
},
selectedArray
:
[]
selectedArray
:
[],
disabled
:
false
}
}
},
},
created
()
{
created
()
{
...
@@ -688,13 +690,12 @@ export default {
...
@@ -688,13 +690,12 @@ export default {
return
str
return
str
},
},
async
handleOrder
()
{
async
handleOrder
()
{
this
.
disabled
=
true
await
this
.
handleResetOrder
()
await
this
.
handleResetOrder
()
console
.
log
(
this
.
tableData
)
const
tagsAll
=
this
.
tableData
.
reduce
((
tags
,
next
)
=>
{
const
tagsAll
=
this
.
tableData
.
reduce
((
tags
,
next
)
=>
{
tags
+=
next
.
labelUnitList
.
map
(({
labelName
})
=>
labelName
).
join
(
','
)
tags
+=
next
.
labelUnitList
.
map
(({
labelName
})
=>
labelName
).
join
(
','
)
return
tags
+
','
return
tags
+
','
},
''
)
},
''
)
console
.
log
(
tagsAll
)
// 取值范围是:"${tagsAll}"输出json格式`
// 取值范围是:"${tagsAll}"输出json格式`
// 帮我创建一个人群名为测试群,描述为test,未加企微的客户。
// 帮我创建一个人群名为测试群,描述为test,未加企微的客户。
// 帮我创建一个人群名为名车群,描述为名车车主群。去年和今年3月到4月间购车的奥迪和宝马车主。
// 帮我创建一个人群名为名车群,描述为名车车主群。去年和今年3月到4月间购车的奥迪和宝马车主。
...
@@ -706,18 +707,21 @@ export default {
...
@@ -706,18 +707,21 @@ export default {
//取值范围为:"'30岁以下','31-40岁','41-55岁'",
//取值范围为:"'30岁以下','31-40岁','41-55岁'",
// 提取出购车月份,命名为buyMonth,例如5月,用数组输出;
// 提取出购车月份,命名为buyMonth,例如5月,用数组输出;
// tags包括上面的购车年份,命名为buyYear,购车月份,命名为buyMonth,车型,命名为brand,是否保养,命名为maintain
// tags包括上面的购车年份,命名为buyYear,购车月份,命名为buyMonth,车型,命名为brand,是否保养,命名为maintain
if
(
this
.
orderform
.
order
==
''
)
{
this
.
orderform
.
order
=
this
.
placeholder
}
const
order
=
this
.
orderform
.
order
const
order
=
this
.
orderform
.
order
// const content = '帮我查询从2023-3-29日至2023-04-05日期间西安飞广州或者深圳的机票,从上面一句话中提取出发日期,命名为date,出发地,命名为start,目的地,命名为end,输出json格式。'
// const content = '帮我查询从2023-3-29日至2023-04-05日期间西安飞广州或者深圳的机票,从上面一句话中提取出发日期,命名为date,出发地,命名为start,目的地,命名为end,输出json格式。'
const
content
=
`
${
order
}
,忽略之前的
提问
,今年是2023年,针对上面这段文字,
const
content
=
`
${
order
}
,忽略之前的
上下文
,今年是2023年,针对上面这段文字,
提取出人群名称,命名为crowdName;
提取出人群名称,命名为crowdName;
提取出人群描述,命名为crowdDesc;
提取出人群描述,命名为crowdDesc;
提取出购车年份,命名为buyYear,例如20xx年,用数组输出;
提取出购车年份,命名为buyYear,例如20xx年,用数组输出;
提取品牌,命名为brand,用数组输出;
提取品牌,命名为brand,
取值范围为:"'奔驰','奥迪','宝马','特斯拉','比亚迪'",
用数组输出;
提取性别,命名为sex,用数组输出;
提取性别,命名为sex,
取值范围为:"'男','女'",
用数组输出;
提取是否有保养记录,命名为maintain,用数组输出;
提取是否有保养记录,命名为maintain,
取值范围为:"'有记录','无记录'",
用数组输出;
提取出年龄,命名为age,用数组输出;
提取出年龄,命名为age,
取值范围为:"'30岁以下','31-40岁','41-55岁'",
用数组输出;
提取出试驾记录,命名为drive,用数组输出;
提取出试驾记录,命名为drive,
取值范围为:"'有','无'"
用数组输出;
所有提取字段取值范围是:"
${
tagsAll
}
"。
所有提取字段取值
精确匹配,
范围是:"
${
tagsAll
}
"。
所有提取的字段未精确匹配到的不提取和输出。
所有提取的字段未精确匹配到的不提取和输出。
输出json格式`
输出json格式`
const
result
=
await
this
.
$apis
.
crowdManage
.
gpt
(
content
)
const
result
=
await
this
.
$apis
.
crowdManage
.
gpt
(
content
)
...
@@ -742,6 +746,7 @@ export default {
...
@@ -742,6 +746,7 @@ export default {
this
.
handleTags
(
arr
)
this
.
handleTags
(
arr
)
}
else
{
}
else
{
this
.
disabled
=
false
this
.
$message
.
error
(
message
)
this
.
$message
.
error
(
message
)
}
}
},
},
...
@@ -753,6 +758,7 @@ export default {
...
@@ -753,6 +758,7 @@ export default {
this
.
selectTag
(
this
.
tableData
[
0
].
labelUnitList
[
0
])
this
.
selectTag
(
this
.
tableData
[
0
].
labelUnitList
[
0
])
}
}
})
})
this
.
disabled
=
false
},
},
async
handleResetOrder
()
{
async
handleResetOrder
()
{
this
.
crowdForm
=
{
crowdName
:
''
,
crowdDesc
:
''
}
this
.
crowdForm
=
{
crowdName
:
''
,
crowdDesc
:
''
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment