<template>
|
<div class="app-container">
|
<el-row :gutter="20">
|
<!--用户数据-->
|
<el-col :span="24" :xs="24">
|
<el-form
|
:model="topqueryParams"
|
ref="queryForm"
|
size="small"
|
:inline="true"
|
v-show="showSearch"
|
label-width="98px"
|
>
|
<el-form-item label="题目文本" prop="text">
|
<el-input
|
v-model="topqueryParams.text"
|
placeholder="请输入"
|
clearable
|
style="width: 200px"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="关联指标" prop="relevance">
|
<el-input
|
v-model="topqueryParams.relevance"
|
placeholder="请输入"
|
clearable
|
style="width: 200px"
|
@keyup.enter.native="handleQuery"
|
/> </el-form-item
|
><el-form-item label="手机号" prop="phonenumber">
|
<el-input
|
v-model="topqueryParams.phonenumber"
|
placeholder="请输入手机号"
|
clearable
|
style="width: 200px"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<br />
|
<el-form-item label="创建时间">
|
<el-date-picker
|
v-model="dateRange"
|
style="width: 240px"
|
value-format="yyyy-MM-dd"
|
type="daterange"
|
range-separator="-"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
></el-date-picker>
|
</el-form-item>
|
|
<el-form-item>
|
<el-button
|
type="primary"
|
icon="el-icon-search"
|
size="medium"
|
@click="handleQuery"
|
>搜索</el-button
|
>
|
<el-button icon="el-icon-refresh" size="medium" @click="resetQuery"
|
>重置</el-button
|
>
|
</el-form-item>
|
</el-form>
|
<el-divider></el-divider>
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-plus"
|
size="medium"
|
@click="handleAdd"
|
v-hasPermi="['system:user:add']"
|
>新增</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="success"
|
plain
|
icon="el-icon-edit"
|
size="medium"
|
:disabled="single"
|
@click="handleUpdate"
|
v-hasPermi="['system:user:edit']"
|
>修改</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="danger"
|
plain
|
icon="el-icon-delete"
|
size="medium"
|
:disabled="multiple"
|
@click="handleDelete"
|
v-hasPermi="['system:user:remove']"
|
>删除</el-button
|
>
|
</el-col>
|
<el-col :span="19">
|
<div class="documentf">
|
<div class="document">
|
<el-button
|
type="warning"
|
plain
|
icon="el-icon-download"
|
size="medium"
|
@click="handleExport"
|
v-hasPermi="['system:user:export']"
|
>导出</el-button
|
>
|
</div>
|
</div>
|
</el-col>
|
<!-- <el-col :span="1.5"> </el-col> -->
|
</el-row>
|
<!-- <right-toolbar
|
:showSearch.sync="showSearch"
|
@queryTable="getList"
|
:columns="columns"
|
></right-toolbar> -->
|
<el-table
|
v-loading="loading"
|
:data="userList"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column
|
label="序号"
|
align="center"
|
key="userId"
|
prop="userId"
|
/>
|
|
<el-table-column
|
label="姓名"
|
align="center"
|
key="userName"
|
prop="userName"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="手机号"
|
align="center"
|
key="phonenumber"
|
prop="phonenumber"
|
/>
|
<el-table-column
|
label="模板名称"
|
align="center"
|
key="templateName"
|
prop="templateName"
|
/>
|
<el-table-column
|
label="问题文本"
|
align="center"
|
key="problem"
|
prop="problem"
|
width="180"
|
/>
|
<el-table-column
|
label="问题回复"
|
align="center"
|
key="replyz"
|
prop="replyz"
|
/>
|
|
<el-table-column
|
label="播放语音"
|
align="center"
|
key="topicnumber"
|
prop="topicnumber"
|
width="350"
|
>
|
<template slot-scope="scope">
|
<my-audio
|
:theUrl="scope.row.url"
|
:theControlList="scope.row.controlList"
|
></my-audio>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="匹配成功语句"
|
align="center"
|
key="replya"
|
prop="replya"
|
/>
|
<el-table-column
|
label="关联指标"
|
align="center"
|
key="replys"
|
prop="replys"
|
/>
|
<el-table-column
|
label="指标值"
|
align="center"
|
key="replyc"
|
prop="replyc"
|
/>
|
<el-table-column
|
label="回复时间"
|
align="center"
|
prop="createTime"
|
width="160"
|
>
|
<template slot-scope="scope">
|
<span>{{ formatTime(scope.row.createTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="操作"
|
align="center"
|
width="180"
|
class-name="small-padding fixed-width"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="medium"
|
type="text"
|
icon="el-icon-edit"
|
class="icon-edit"
|
@click="Referencequestion(scope.row)"
|
v-hasPermi="['system:user:edit']"
|
>编辑话术</el-button
|
>
|
<el-button
|
size="medium"
|
type="text"
|
icon="el-icon-s-claim"
|
class="icon-s-claim"
|
@click="handleUpdate(scope.row)"
|
v-hasPermi="['system:user:edit']"
|
>测试匹配</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="topqueryParams.pageNum"
|
:limit.sync="topqueryParams.pageSize"
|
@pagination="getList"
|
/>
|
</el-col>
|
</el-row>
|
|
<!-- 添加或修改题目配置对话框 -->
|
<!-- 指标编辑 -->
|
<el-dialog :visible.sync="indicatorVisible" width="700px">
|
<div class="headline">
|
<div class="basics">问题配置</div>
|
<div class="headbottom">
|
<el-button
|
type="primary"
|
icon="el-icon-circle-plus-outline"
|
@click="addzbiao"
|
>添加指标</el-button
|
>
|
<el-button type="primary" icon="el-icon-s-claim">保存</el-button>
|
<el-button type="primary" icon="el-icon-document"
|
>更新指标规则至模板</el-button
|
>
|
</div>
|
</div>
|
<div class="valuetop" v-for="(item, index) in deployList" :key="item.id">
|
<div class="val-text">
|
<div>
|
有无复查 <span>{{ item.name }}</span>
|
</div>
|
<div class="text-icon" @click="deletei(index)">
|
<i class="el-icon-delete" />
|
</div>
|
</div>
|
<div class="val-bon">
|
<el-form ref="form" :model="form" label-width="80px">
|
<el-form-item label="指标类型">
|
<el-radio-group v-model="form.resource">
|
<el-radio label="选项"></el-radio>
|
<el-radio label="文本"></el-radio>
|
<el-radio label="数组"></el-radio>
|
</el-radio-group>
|
</el-form-item>
|
<el-form-item label="指标名称">
|
<el-input v-model="form.name"></el-input>
|
</el-form-item>
|
<el-form-item label="指标值">
|
<el-input v-model="item.name"></el-input>
|
</el-form-item>
|
<el-form-item label="特殊资源">
|
<el-radio-group v-model="form.resource">
|
<el-radio label="基础"></el-radio>
|
<el-radio label="自定义"></el-radio>
|
</el-radio-group>
|
</el-form-item>
|
<el-form-item label="基础规则">
|
<el-input type="textarea" v-model="item.valuetop"></el-input>
|
</el-form-item>
|
</el-form>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="indicatorVisible = false">关闭</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import {
|
listUser,
|
delUser,
|
addUser,
|
updateUser,
|
changeUserStatus,
|
} from "@/api/system/user";
|
|
import myAudio from "./myAudio.vue";
|
export default {
|
name: "User",
|
dicts: ["sys_normal_disable", "sys_user_sex"],
|
components: { myAudio },
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 用户表格数据
|
userList: [
|
{
|
userId: 1,
|
userName: "王五",
|
phonenumber: "13802963330",
|
templateName: "乌拉",
|
problem: "最近怎么样",
|
reply: "sas",
|
url: "",
|
controlList: "onlyOnePlaying",
|
},
|
{
|
userId: 1,
|
userName: "张五",
|
phonenumber: "13802963330",
|
templateName: "乌拉",
|
problem: "最近怎么样",
|
reply: "sas",
|
url: "",
|
controlList: "onlyOnePlaying",
|
},
|
],
|
deployList: [
|
{
|
id: 1,
|
name: "有",
|
valuetop:
|
"(?!.*忘|.*不|.*没)^.*(是|有|对|做|作|检|查|复诊|好|参加|复诊|去(过|好|了|完|医院)|来(过|了|医院))|没错|对呀|可能|(已经|早)去了|开了药|腰带|吊带|要的|(?<!没)有的|表带,10;要,5",
|
},
|
{
|
id: 2,
|
name: "不知道",
|
valuetop:
|
"(不|没|谁|鬼|怎么).*(病|可能|知道|了解|清楚|懂|明白|确认|确定|晓得|知晓|认得|识得|印象|熟悉|记|会|关心|关注|注意|告诉|通知|听)",
|
},
|
],
|
// 弹出层标题
|
title: "",
|
|
// 日期范围
|
dateRange: [],
|
|
inputValue: "",
|
indicatorVisible: false, //指标编辑弹框
|
radio: "",
|
radios: [],
|
previewtype: 2, //预览题目类型
|
total: 0, // 总条数
|
ImportQuantity: 999, //导题目数量
|
//预览题目信息
|
previewvalue: {
|
username: "这个医生对你怎么样",
|
},
|
// 表单参数
|
form: {
|
phonenumber: "",
|
totagid: "",
|
types: "",
|
nickName: "",
|
qystatus: "",
|
btstatus: "",
|
},
|
//导入进度
|
dractive: 1,
|
// 导入展示表单
|
uploadingData: {},
|
// 查询参数
|
topqueryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
userName: undefined,
|
tagid: undefined,
|
topic: undefined,
|
},
|
propss: { multiple: true },
|
|
// 表单校验
|
rules: {
|
userName: [
|
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
{
|
min: 2,
|
max: 20,
|
message: "用户名称长度必须介于 2 和 20 之间",
|
trigger: "blur",
|
},
|
],
|
nickName: [
|
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
|
],
|
password: [
|
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
{
|
min: 5,
|
max: 20,
|
message: "用户密码长度必须介于 5 和 20 之间",
|
trigger: "blur",
|
},
|
],
|
email: [
|
{
|
type: "email",
|
message: "请输入正确的邮箱地址",
|
trigger: ["blur", "change"],
|
},
|
],
|
phonenumber: [
|
{
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
message: "请输入正确的手机号码",
|
trigger: "blur",
|
},
|
],
|
IDnumber: [
|
{
|
pattern:
|
/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/,
|
message: "请输入正确的身份证号码",
|
trigger: "blur",
|
},
|
],
|
},
|
};
|
},
|
watch: {},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询题目列表 */
|
getList() {
|
this.loading = true;
|
listUser(this.addDateRange(this.topqueryParams, this.dateRange)).then(
|
(response) => {
|
// this.userList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
}
|
);
|
},
|
// 编辑话术指标
|
Referencequestion(row) {
|
this.indicatorVisible = true;
|
},
|
// 新增指标
|
addzbiao() {
|
const ids = this.deployList.length + 1;
|
console.log(ids);
|
this.deployList.push({
|
id: ids,
|
name: "",
|
valuetop: "",
|
});
|
},
|
// 删除指标
|
deletei(index) {
|
console.log(index);
|
this.deployList.splice(index, 1);
|
},
|
|
// 题目状态修改
|
handleStatusChange(row) {
|
let text = row.status === "0" ? "启用" : "停用";
|
this.$modal
|
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
|
.then(function () {
|
return changeUserStatus(row.userId, row.status);
|
})
|
.then(() => {
|
this.$modal.msgSuccess(text + "成功");
|
})
|
.catch(function () {
|
row.status = row.status === "0" ? "1" : "0";
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
userId: undefined,
|
deptId: undefined,
|
userName: undefined,
|
nickName: undefined,
|
password: undefined,
|
phonenumber: undefined,
|
email: undefined,
|
sex: undefined,
|
status: "0",
|
remark: undefined,
|
postIds: [],
|
roleIds: [],
|
};
|
this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.topqueryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.dateRange = [];
|
this.resetForm("queryForm");
|
this.topqueryParams.deptId = undefined;
|
this.$refs.tree.setCurrentKey(null);
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map((item) => item.userId);
|
this.single = selection.length != 1;
|
this.multiple = !selection.length;
|
},
|
//删除选项
|
handleClose(tag) {
|
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
|
},
|
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.reset();
|
},
|
|
/** 提交按钮 */
|
submitForm: function () {
|
this.$refs["form"].validate((valid) => {
|
if (valid) {
|
if (this.form.userId != undefined) {
|
updateUser(this.form).then((response) => {
|
this.$modal.msgSuccess("修改成功");
|
this.open = false;
|
this.getList();
|
});
|
} else {
|
addUser(this.form).then((response) => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getList();
|
});
|
}
|
}
|
});
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const userIds = row.userId || this.ids;
|
this.$modal
|
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
|
.then(function () {
|
return delUser(userIds);
|
})
|
.then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
})
|
.catch(() => {});
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download(
|
"system/user/export",
|
{
|
...this.topqueryParams,
|
},
|
`user_${new Date().getTime()}.xlsx`
|
);
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.el-button--primary.is-plain {
|
color: #ffffff;
|
background: #409eff;
|
border-color: #4fabe9;
|
}
|
.document {
|
width: 100px;
|
height: 50px;
|
}
|
.documentf {
|
display: flex;
|
justify-content: flex-end;
|
}
|
.download {
|
text-align: center;
|
.el-upload__tip {
|
font-size: 23px;
|
}
|
.el-upload__text {
|
font-size: 23px;
|
}
|
}
|
.uploading {
|
margin-top: 20px;
|
margin: 20px;
|
padding: 30px;
|
background: #ffffff;
|
border: 1px solid #dcdfe6;
|
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
|
0 0 6px 0 rgba(0, 0, 0, 0.04);
|
}
|
.el-tag + .el-tag {
|
margin-left: 10px;
|
}
|
.button-new-tag {
|
margin-left: 10px;
|
height: 32px;
|
line-height: 30px;
|
padding-top: 0;
|
padding-bottom: 0;
|
}
|
.input-new-tag {
|
width: 90px;
|
margin-left: 10px;
|
vertical-align: bottom;
|
}
|
.drexamine {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
padding: 30px;
|
background: #daeaf5;
|
img {
|
width: 100px;
|
height: 100px;
|
}
|
}
|
.qrcode-dialo {
|
// text-align: center;
|
// display: flex;
|
margin: 20px;
|
padding: 30px;
|
background: #edf1f7;
|
border: 1px solid #dcdfe6;
|
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
|
0 0 6px 0 rgba(0, 0, 0, 0.04);
|
.topic-dev {
|
margin-bottom: 25px;
|
font-size: 20px !important;
|
.dev-text {
|
margin-bottom: 10px;
|
}
|
}
|
}
|
.headline {
|
display: flex;
|
height: 50px;
|
margin: 15px;
|
margin-bottom: 0;
|
padding: 0 20px 20px 20px;
|
line-height: 50px;
|
background: #92c5f0;
|
justify-content: space-between;
|
}
|
.valuetop {
|
.val-text {
|
display: flex;
|
height: 50px;
|
margin: 15px;
|
margin-bottom: 0;
|
// padding: 0 20px 20px 20px;
|
padding: 0 20px;
|
align-items: center;
|
background: #92c5f0;
|
justify-content: space-between;
|
.text-icon {
|
width: 35px;
|
height: 35px;
|
line-height: 35px;
|
text-align: center;
|
background: #fafafa;
|
cursor: pointer;
|
border-radius: 5px;
|
}
|
}
|
.val-bon {
|
margin: 15px;
|
margin-top: 0;
|
padding: 30px;
|
background: #f2f5fc;
|
border: 1px solid #dcdfe6;
|
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
|
0 0 6px 0 rgba(0, 0, 0, 0.04);
|
}
|
}
|
.icon-s-claim {
|
color: #409eff;
|
}
|
.icon-edit {
|
color: rgb(5, 212, 212);
|
}
|
::v-deep.el-radio-group {
|
span {
|
font-size: 24px;
|
}
|
}
|
::v-deep.el-checkbox-group {
|
span {
|
font-size: 24px;
|
}
|
}
|
</style>
|