kefu/static/templates/default/setting_articles.html

244 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-tabs type="border-card" value="articleList" @tab-click="handleTabClick">
<el-tab-pane label="知识库" name="articleList">
<div style="display: flex">
<div style="width: 300px;margin-right: 2px;border-right: 1px solid #ebeef5;">
<el-button size="mini" style="margin-bottom: 10px;" @click="addCate" type="primary" size="small"><{flyLang.newCate}></el-button>
<el-table
:empty-text="flyLang.nodata"
@row-click="setArticleCate"
:data="articleCate"
highlight-current-row
>
<el-table-column :label="flyLang.cateName"
>
<template slot-scope="scope">
<{ scope.row.cat_name }>
</template>
</el-table-column>
<el-table-column
width="160"
:label="flyLang.doIt">
<template slot-scope="scope">
<el-button v-if="scope.row.is_top!=1" @click="setArticleCateTop(scope.row.id,1)" type="text" size="mini"><{flyLang.top}></el-button>
<el-button v-if="scope.row.is_top==1" @click="setArticleCateTop(scope.row.id,2)" type="text" size="mini"><{flyLang.cancel}></el-button>
<el-button @click="cateForm=scope.row;cateDialog=true" type="text" size="mini"><{flyLang.edit}></el-button>
<el-button @click="delArticleCate(scope.row.id)" type="text" size="mini"><{flyLang.delete}></el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="flex:1">
<el-button size="mini" style="margin:0px 0px 10px 10px;" @click="article={},articleDialog=true" type="primary" size="small">匹配回复</el-button>
<el-button size="mini" style="margin:0px 0px 10px 10px;" @click="getArticleExcel()" type="primary" size="small">导出EXCEL</el-button>
<br>
<el-input placeholder="搜索知识库" v-model="articles.search" @input="searchArticle" style="width:300px;margin:0px 0px 10px 10px;"></el-input>
<el-table
@sort-change="getSortArticle"
:empty-text="flyLang.nodata"
:data="articles.list"
>
<el-table-column
prop="title"
:label="flyLang.keywords">
<template slot-scope="scope">
<el-tag v-for="item in splitString(scope.row.title,',')" style="margin: 2px"><{item}></el-tag>
</template>
</el-table-column>
<el-table-column
:label="flyLang.replyContent">
<template slot-scope="scope">
<div v-html="scope.row.content">
</div>
<a v-if="scope.row.api_url!=''" :href="scope.row.api_url" target="_blank">
API_URL: <{scope.row.api_url}>
</a>
</template>
</el-table-column>
<el-table-column
sortable="custom"
prop="score"
width="100px"
label="命中次数">
</el-table-column>
<el-table-column
width="100px"
label="匹配方式">
<template slot-scope="scope">
<el-tag v-if="scope.row.search_type=='1'">包含</el-tag>
<el-tag type="success" v-if="scope.row.search_type=='2'">精准</el-tag>
</template>
</el-table-column>
<el-table-column
width="100px"
prop="user_id"
label="user_id">
</el-table-column>
<el-table-column
width="160px;"
prop="id"
:label="flyLang.doIt">
<template slot-scope="scope">
<el-button @click="article=scope.row;articleDialog=true" type="primary" size="small" icon="el-icon-edit" circle></el-button>
<el-button @click="delArticle(scope.row.id)" type="danger" size="small" icon="el-icon-delete" circle></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@current-change="getArticle"
:current-page="articles.page"
layout="prev,pager, next"
:page-size="articles.pagesize"
:total="articles.count">
</el-pagination>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="学习库" name="learnList">
<el-alert
title="提示"
type="info"
description="开启仅机器人接待后,机器人无法回答的问题进入学习库。是否解决列表仅用于后台区分状态,请补充完整知识库内容,并点击已解决按钮">
</el-alert>
<el-table
:empty-text="flyLang.nodata"
:data="learns.list"
>
<el-table-column
prop="content"
label="问题内容">
<template slot-scope="scope">
<div v-html="replaceSpecialTag(scope.row.content)"></div>
</template>
</el-table-column>
<el-table-column
width="100px"
prop="score"
label="匹配次数">
</el-table-column>
<el-table-column
width="180px"
prop="kefu_name"
label="操作账号">
</el-table-column>
<el-table-column
width="100px"
prop="finshed"
label="是否解决">
<template slot-scope="scope">
<el-switch
v-model="scope.row.finshed"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value="2"
:inactive-value="1"
@change="switchLearnStatus(scope.row.finshed,scope.row.id)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
width="160px;"
prop="id"
:label="flyLang.doIt">
<template slot-scope="scope">
<el-button @click="learnToArticle(scope.row.content)" type="primary" size="small" icon="el-icon-edit">添加知识库</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@current-change="getLearns"
:current-page="learns.page"
layout="prev,pager, next"
:page-size="learns.pagesize"
:total="learns.count">
</el-pagination>
</el-tab-pane>
<el-tab-pane label="兜底回复">
<el-alert
title="提示"
type="info"
description="当关键词匹配不到时,会匹配兜底回复。">
</el-alert>
<el-input
v-model="keywordFinalReply"
style="margin: 10px 0px"
type="textarea"
:rows="6"
>
</el-input>
<el-button type="primary" @click="setEntConfigItem('关键词兜底回复','KeywordFinalReply',keywordFinalReply)">保存</el-button>
</el-tab-pane>
</el-tabs>
<el-dialog
:visible.sync="cateDialog"
width="30%"
top="10%"
:close-on-click-modal="false"
>
<el-form label-width="70px">
<el-form-item label="分类名称" prop="cat_name">
<el-input v-model="cateForm.cat_name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="cateDialog = false"><{flyLang.cancel}></el-button>
<el-button type="primary" @click="addArticleCate"><{flyLang.save}></el-button>
</span>
</el-dialog>
<el-dialog
:visible.sync="articleDialog"
width="40%"
height="500px"
top="0"
right="0"
:close-on-click-modal="false"
@opened="initEditor()"
@closed="destoryEditor()"
>
<el-input style="margin-bottom: 10px;" placeholder="多个关键词,可以使用逗号分隔" v-model="article.title"></el-input>
<el-select v-model="article.cat_id" :placeholder="flyLang.selectCate" style="margin-bottom: 10px;">
<el-option
v-for="item in articleCate"
:key="item.id"
:label="item.cat_name"
:value="item.id">
</el-option>
</el-select>
<div>
<el-select placeholder="匹配方式" v-model="article.search_type">
<el-option label="包含" :value="1"></el-option>
<el-option label="精准" :value="2"></el-option>
</el-select>
<div style="padding: 10px;margin:10px 0px;background-color: #fdf6ec; color: #e6a23c;">
包含:<br>如设置包含 “微信”,则顾客发送“可以加一下微信吗?”会触发,而发送“微”或“信”不会触发。<br>
精准:<br>如设置精准 “微信”,则顾客发送“可以加一下微信吗?”,不会触发,只有发送“微信”完全一致才会触发。<br>
仅机器人接待时此项不起作用
</div>
</div>
<el-input style="display: none" placeholder="API URL" v-model="article.api_url"></el-input>
<div style="border:1px solid #dcdfe6;border-radius: 3px;" id="welcomeEditor" v-html="article.content"></div>
<span slot="footer" class="dialog-footer">
<el-button @click="articleDialog = false"><{flyLang.cancel}></el-button>
<el-button @click="addArticle"><{flyLang.save}></el-button>
</span>
</el-dialog>
</template>
</div>
</body>
<script src="/static/js/wangEditor.min.js"></script>
<script src="/static/js/xlsx.full.min.js" type="text/javascript"></script>
{{template "setting_bottom" .}}