|
|
@@ -2,73 +2,119 @@
|
|
|
<div class="app-container">
|
|
|
|
|
|
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="客服名称" prop="roleName">
|
|
|
- <el-input v-model="form.roleName" placeholder="请输入角色名" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="角色类型" prop="roleType">
|
|
|
- <el-select v-model="form.roleType" placeholder="请选择类型" clearable size="small" style="width: 150px" >
|
|
|
- <el-option
|
|
|
- v-for="item in typeOptions"
|
|
|
- :key="item.dictValue"
|
|
|
- :label="item.dictLabel"
|
|
|
- :value="String(item.dictValue)"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="客服头像" prop="avatar">
|
|
|
- <ImageUpload v-model="form.avatar" type="image" :num="1" :width="150" :height="150" style="margin-top: 1%;" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="APPKey" >
|
|
|
- <el-input type="textarea" v-model="form.modeConfigJson.APPKey" placeholder="请输入FastGPT的APPKey(特定key)" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="提示词" >
|
|
|
- <el-input type="textarea" :rows="3" v-model="form.reminderWords" placeholder="请输入FastGPT的提示词" />
|
|
|
- </el-form-item>
|
|
|
-<!-- <el-form-item label="标签人设" >
|
|
|
- <div v-if="tagsFormList.length > 0" style="display: flex; align-items: center; flex-wrap: wrap; width: 100%;">
|
|
|
- <div style="min-height: 40px; max-height: 200px; overflow-y: auto; width: 100%;">
|
|
|
- <div style="display: flex; flex-wrap: wrap; width: 100%;">
|
|
|
- <div v-for="(tagsForm, index) in tagsFormList" :key="tagsForm.id">
|
|
|
- <el-tag type="success"
|
|
|
- closable
|
|
|
- :disable-transitions="false"
|
|
|
- @click="handleEditRoleTag(tagsForm, index)"
|
|
|
- @close="handleCloseRoleTag(tagsForm, index)"
|
|
|
- style="margin: 3px;">
|
|
|
- {{ getTagNames(tagsForm.tagIds) }}
|
|
|
- </el-tag>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-form-item label="客服名称" prop="roleName">
|
|
|
+ <el-input v-model="form.roleName" placeholder="请输入角色名" />
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ AI角色名字
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="角色类型" prop="roleType">
|
|
|
+ <el-select v-model="form.roleType" placeholder="请选择类型" clearable size="small" style="width: 150px" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="String(item.dictValue)"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ 选择角色类型:一般选择伴学助手,医生工作室,伴学助手无性别,无性别版本只会叫用户同学,其余的会叫用户先生女士
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="渠道类型" prop="channelType">
|
|
|
+ <el-select v-model="form.channelType" placeholder="请选择类型" clearable size="small" style="width: 150px" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in channelOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="String(item.dictLabel)"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ 选择进线渠道:只影响新客户进来的首次对话
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="物流提醒" prop="logistics">
|
|
|
+ <el-select v-model="form.logistics" placeholder="请选择类型" clearable size="small" style="width: 150px" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in logisticsOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ AI是否主动发送物流信息,发货和到货的时候会提醒用户
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="客服头像" prop="avatar">
|
|
|
+ <ImageUpload v-model="form.avatar" type="image" :num="1" :width="150" :height="150" style="margin-top: 1%;" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="APPKey" >
|
|
|
+ <el-input type="textarea" v-model="form.modeConfigJson.APPKey" placeholder="请输入APPKey(特定key)" />
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ 根据管理员发送的APPKey填写
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="提示词" >
|
|
|
+ <el-input type="textarea" :rows="3" v-model="form.reminderWords" placeholder="请输入提示词" />
|
|
|
+ <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ 输入个人的介绍,并且在最后增加一个自我介绍(用于首次交流触发),模板可以找管理员获取
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="标签人设" >
|
|
|
+ <div v-if="tagsFormList.length > 0" style="display: flex; align-items: center; flex-wrap: wrap; width: 100%;">
|
|
|
+ <div style="min-height: 40px; max-height: 200px; overflow-y: auto; width: 100%;">
|
|
|
+ <div style="display: flex; flex-wrap: wrap; width: 100%;">
|
|
|
+ <div v-for="(tagsForm, index) in tagsFormList" :key="tagsForm.id">
|
|
|
+ <el-tag type="success"
|
|
|
+ closable
|
|
|
+ :disable-transitions="false"
|
|
|
+ @click="handleEditRoleTag(tagsForm, index)"
|
|
|
+ @close="handleCloseRoleTag(tagsForm, index)"
|
|
|
+ style="margin: 3px;">
|
|
|
+ {{ getTagNames(tagsForm.tagIds) }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary" plain
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
- @click="handleAddTags(form.roleId,form.bindCorpId)"
|
|
|
- v-hasPermi="['fastGptRole:fastGptRole:edit']"
|
|
|
- >添加标签人设</el-button>
|
|
|
- </el-form-item> -->
|
|
|
-
|
|
|
-<!-- <el-form-item label="修改栏目" prop="contactInfo">
|
|
|
- <el-select v-model="contactInfo" multiple filterable placeholder="请选择修改栏目" clearable size="small" style="width: 50%" >
|
|
|
- <el-option
|
|
|
- v-for="item in externalInfoOptions"
|
|
|
- :key="item.dictValue"
|
|
|
- :label="item.dictLabel"
|
|
|
- :value="item.dictValue"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item> -->
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer" style="padding-bottom: 40px;">
|
|
|
- <el-button type="primary" @click="submitForm" style="float: right;margin-right: 20px;">确 定</el-button>
|
|
|
- <el-button @click="cancel" style="float: right;margin-right: 20px;">取 消</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
-<!-- 修改-->
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary" plain
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ @click="handleAddTags(form.roleId,form.bindCorpId)"
|
|
|
+ v-hasPermi="['fastGptRole:fastGptRole:edit']"
|
|
|
+ >添加标签人设</el-button>
|
|
|
+ </el-form-item> -->
|
|
|
+
|
|
|
+ <!-- <el-form-item label="修改栏目" prop="contactInfo">
|
|
|
+ <el-select v-model="contactInfo" multiple filterable placeholder="请选择修改栏目" clearable size="small" style="width: 50%" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in externalInfoOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item> -->
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer" style="padding-bottom: 40px;">
|
|
|
+ <el-button type="primary" @click="submitForm" style="float: right;margin-right: 20px;">确 定</el-button>
|
|
|
+ <el-button @click="cancel" style="float: right;margin-right: 20px;">取 消</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 修改-->
|
|
|
<el-dialog :title="changeTagsOpen.title" :visible.sync="changeTagsOpen.open" width="800px" append-to-body>
|
|
|
|
|
|
<el-form ref="tagsForm" :model="tagsForm" :rules="tagsFormRules">
|
|
|
@@ -102,18 +148,15 @@
|
|
|
<div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
|
|
|
<span class="name-background">{{ item.name }}</span>
|
|
|
</div>
|
|
|
- <!-- 添加外层滚动容器 -->
|
|
|
- <div class="scroll-wrapper">
|
|
|
- <div class="tag-container">
|
|
|
- <a
|
|
|
- v-for="tagItem in item.tag"
|
|
|
- class="tag-box"
|
|
|
- @click="tagSelection(tagItem)"
|
|
|
- :class="{ 'tag-selected': tagItem.isSelected }"
|
|
|
- >
|
|
|
- {{ tagItem.name }}
|
|
|
- </a>
|
|
|
- </div>
|
|
|
+ <div class="tag-container">
|
|
|
+ <a
|
|
|
+ v-for="tagItem in item.tag"
|
|
|
+ class="tag-box"
|
|
|
+ @click="tagSelection(tagItem)"
|
|
|
+ :class="{ 'tag-selected': tagItem.isSelected }"
|
|
|
+ >
|
|
|
+ {{ tagItem.name }}
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -122,7 +165,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
-<!-- 新增-->
|
|
|
+ <!-- 新增-->
|
|
|
<el-dialog :title="changeTagsOpenAdd.title" :visible.sync="changeTagsOpenAdd.open" width="800px" append-to-body>
|
|
|
|
|
|
<el-form ref="tagsFormAdd" :model="tagsFormAdd" :rules="tagsFormAddRules">
|
|
|
@@ -156,18 +199,15 @@
|
|
|
<div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
|
|
|
<span class="name-background">{{ item.name }}</span>
|
|
|
</div>
|
|
|
- <!-- 添加外层滚动容器 -->
|
|
|
- <div class="scroll-wrapper">
|
|
|
- <div class="tag-container">
|
|
|
- <a
|
|
|
- v-for="tagItem in item.tag"
|
|
|
- class="tag-box"
|
|
|
- @click="tagSelection(tagItem)"
|
|
|
- :class="{ 'tag-selected': tagItem.isSelected }"
|
|
|
- >
|
|
|
- {{ tagItem.name }}
|
|
|
- </a>
|
|
|
- </div>
|
|
|
+ <div class="tag-container">
|
|
|
+ <a
|
|
|
+ v-for="tagItem in item.tag"
|
|
|
+ class="tag-box"
|
|
|
+ @click="tagSelection(tagItem)"
|
|
|
+ :class="{ 'tag-selected': tagItem.isSelected }"
|
|
|
+ >
|
|
|
+ {{ tagItem.name }}
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -197,6 +237,10 @@ export default {
|
|
|
components: {ImageUpload},
|
|
|
data() {
|
|
|
return {
|
|
|
+ logisticsOptions: [
|
|
|
+ { label: '是', value: 1 },
|
|
|
+ { label: '否', value: 0 }
|
|
|
+ ],
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
|
@@ -205,6 +249,8 @@ export default {
|
|
|
typeOptions: [],
|
|
|
//AI模型
|
|
|
modeOptions: [],
|
|
|
+ //渠道类型
|
|
|
+ channelOptions: [],
|
|
|
changeTagsOpen: {
|
|
|
title : "",
|
|
|
open :false,
|
|
|
@@ -234,7 +280,7 @@ export default {
|
|
|
|
|
|
//所有的标签
|
|
|
tagList:[],
|
|
|
- contactInfo:[],
|
|
|
+ contactInfo:[],
|
|
|
//已经选择的标签
|
|
|
tagListFormIndex:[],
|
|
|
|
|
|
@@ -244,7 +290,7 @@ export default {
|
|
|
uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
- externalInfoOptions : [],
|
|
|
+ externalInfoOptions : [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
|
@@ -270,7 +316,9 @@ export default {
|
|
|
kfId: null,
|
|
|
kfUrl: null,
|
|
|
avatar: null,
|
|
|
- kfMediaId: null
|
|
|
+ kfMediaId: null,
|
|
|
+ channelType: null,
|
|
|
+ logistics: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
@@ -289,6 +337,9 @@ export default {
|
|
|
roleType: [
|
|
|
{ required: true, message: "角色类型不能为空", trigger: "change" }
|
|
|
],
|
|
|
+ logistics: [
|
|
|
+ { required: true, message: "物流提醒不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
},
|
|
|
tagsFormRules:{
|
|
|
tagIds:[
|
|
|
@@ -364,7 +415,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
- this.handleUpdate();
|
|
|
+ this.handleUpdate();
|
|
|
//客服类型
|
|
|
// this.getDicts("chat_role_type").then((response) => {
|
|
|
// this.typeOptions = response.data;
|
|
|
@@ -374,12 +425,16 @@ export default {
|
|
|
this.modeOptions = response.data;
|
|
|
});
|
|
|
this.getDicts("sys_fastgpt_role_external_info").then((response) => {
|
|
|
- this.externalInfoOptions = response.data;
|
|
|
+ this.externalInfoOptions = response.data;
|
|
|
+ });
|
|
|
+ //渠道类型
|
|
|
+ this.getDicts("sys_fastgpt_channel_type").then((response) => {
|
|
|
+ this.channelOptions = response.data;
|
|
|
});
|
|
|
|
|
|
- getAllRoleType().then(response => {
|
|
|
- this.typeOptions = response.data;
|
|
|
- });
|
|
|
+ getAllRoleType().then(response => {
|
|
|
+ this.typeOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询应用列表 */
|
|
|
@@ -395,7 +450,7 @@ export default {
|
|
|
cancel() {
|
|
|
|
|
|
this.reset();
|
|
|
- window.location.replace('/fastGpt/fastGptRole')
|
|
|
+ window.location.replace('/fastGpt/fastGptRole')
|
|
|
},
|
|
|
cancelTags(){
|
|
|
this.changeTagsOpen.open=false;
|
|
|
@@ -482,7 +537,7 @@ export default {
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate() {
|
|
|
- var id=this.$route.params.command
|
|
|
+ var id=this.$route.params.command
|
|
|
this.reset();
|
|
|
getFastGptRole(id).then(response => {
|
|
|
this.form = response.role;
|
|
|
@@ -490,11 +545,11 @@ export default {
|
|
|
if(this.form.modeConfigJson!=null&&this.form.modeConfigJson!=""){
|
|
|
this.form.modeConfigJson=JSON.parse(this.form.modeConfigJson)
|
|
|
}else{
|
|
|
- this.form.modeConfigJson={APPKey:null}
|
|
|
- }
|
|
|
- if(this.form.contactInfo!=null){
|
|
|
- this.contactInfo = (this.form.contactInfo).split(",");
|
|
|
- }
|
|
|
+ this.form.modeConfigJson={APPKey:null}
|
|
|
+ }
|
|
|
+ if(this.form.contactInfo!=null){
|
|
|
+ this.contactInfo = (this.form.contactInfo).split(",");
|
|
|
+ }
|
|
|
//含标签吗
|
|
|
getListByRoleId(id).then(res => {
|
|
|
this.tagsFormList=res.rows;
|
|
|
@@ -668,9 +723,9 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- if(this.contactInfo!=null){
|
|
|
- this.form.contactInfo= (this.contactInfo).toString()
|
|
|
- }
|
|
|
+ if(this.contactInfo!=null){
|
|
|
+ this.form.contactInfo= (this.contactInfo).toString()
|
|
|
+ }
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.form.modeConfigJson=JSON.stringify(this.form.modeConfigJson)
|
|
|
@@ -701,7 +756,7 @@ export default {
|
|
|
this.changeTagsOpen = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -711,12 +766,12 @@ export default {
|
|
|
if (valid) {
|
|
|
this.tagsFormAdd.roleId=roleId
|
|
|
this.tagsFormAdd.tagIds=this.tagsFormAdd.tagIds.join(",")
|
|
|
- addFastGptRoleTag(this.tagsFormAdd).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.changeTagsOpenAdd = false;
|
|
|
- this.open=false;
|
|
|
- this.handleUpdate();
|
|
|
- });
|
|
|
+ addFastGptRoleTag(this.tagsFormAdd).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.changeTagsOpenAdd = false;
|
|
|
+ this.open=false;
|
|
|
+ this.handleUpdate();
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
});
|
|
|
@@ -725,30 +780,30 @@ export default {
|
|
|
handleDelete(row) {
|
|
|
const roleIds = row.roleId || this.ids;
|
|
|
this.$confirm('是否确认删除应用编号为"' + roleIds + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delFastGptRole(roleIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delFastGptRole(roleIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|
|
|
this.$confirm('是否确认导出所有应用数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.exportLoading = true;
|
|
|
- return exportFastGptRole(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- this.exportLoading = false;
|
|
|
- }).catch(() => {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportFastGptRole(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -802,19 +857,4 @@ export default {
|
|
|
overflow-y: auto; /* 内容超出时显示滚动条 */
|
|
|
line-height: 1.5em; /* 行高设置,确保每行高度一致 */
|
|
|
}
|
|
|
-/* 新增的滚动容器样式(不影响原有样式) */
|
|
|
-.scroll-wrapper {
|
|
|
- max-height: 130px; /* 大约三行的高度 */
|
|
|
- overflow-y: auto; /* 垂直滚动 */
|
|
|
- padding-right: 5px; /* 为滚动条留出空间 */
|
|
|
-}
|
|
|
-
|
|
|
-/* 美化滚动条(可选) */
|
|
|
-.scroll-wrapper::-webkit-scrollbar {
|
|
|
- width: 6px;
|
|
|
-}
|
|
|
-.scroll-wrapper::-webkit-scrollbar-thumb {
|
|
|
- background: rgba(0, 0, 0, 0.2);
|
|
|
- border-radius: 3px;
|
|
|
-}
|
|
|
</style>
|