提交 5d9387e8 编写于 作者: guangjun.yang's avatar guangjun.yang

接部分接口

上级 0fb20aba
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<article class="left"> <article class="left">
<div class="l-header"> <div class="l-header">
<span>我的任务(3)</span> <span>我的任务(3)</span>
<span>再来一个</span> <span @click="getNextSession">再来一个</span>
</div> </div>
<p class="c-num">当前等待会话:4个</p> <p class="c-num">当前等待会话:4个</p>
<ul class="session-list" :style="{'height': containerHeight + 'px'}"> <ul class="session-list" :style="{'height': containerHeight + 'px'}">
...@@ -101,14 +101,14 @@ ...@@ -101,14 +101,14 @@
<section class="c-bottom"> <section class="c-bottom">
<el-input placeholder="请输入内容" v-model="text"> <el-input placeholder="请输入内容" v-model="text">
<div slot="suffix" class="cb-icon-wrapper"> <div slot="suffix" class="cb-icon-wrapper">
<el-upload <el-upload
class="bg-uploader" class="bg-uploader"
action="#" action="#"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUploadFile" :before-upload="beforeUploadFile"
> >
<img src="../../../assets/image/IM/icon-folder-open.png" alt /> <img src="../../../assets/image/IM/icon-folder-open.png" alt />
</el-upload> </el-upload>
<img <img
src="../../../assets/image/IM/icon-link.png" src="../../../assets/image/IM/icon-link.png"
@click="showSelectDialog = true" @click="showSelectDialog = true"
...@@ -127,7 +127,6 @@ ...@@ -127,7 +127,6 @@
</article> </article>
</section> </section>
<!-- 选择链接弹窗 --> <!-- 选择链接弹窗 -->
<el-dialog <el-dialog
title="选择链接" title="选择链接"
...@@ -194,6 +193,12 @@ export default { ...@@ -194,6 +193,12 @@ export default {
return { return {
curmbFirst: "云鹊客服", curmbFirst: "云鹊客服",
curmbSecond: "当前会话", curmbSecond: "当前会话",
sessionListData: {
myTaskCount: 0,
sessionList: [],
waitingTaskCount: 0
},
userInfo: { userInfo: {
name: "杨Song", name: "杨Song",
mobilePhone: "138****7261", mobilePhone: "138****7261",
...@@ -372,7 +377,9 @@ export default { ...@@ -372,7 +377,9 @@ export default {
return !!this.text; return !!this.text;
} }
}, },
created() {}, created() {
this.getSessionList();
},
mounted: function() {}, mounted: function() {},
methods: { methods: {
// 发送带链接消息 // 发送带链接消息
...@@ -410,7 +417,9 @@ export default { ...@@ -410,7 +417,9 @@ export default {
const isPNG = file.type === "image/png"; const isPNG = file.type === "image/png";
// const isLt2M = file.size / 1024 / 1024 < fileLimit.size; // const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) { if (!isJPG && !isPNG) {
vm.$message.error("图片必须是jpeg或png格式,同时长宽尺寸和图片大小需符合要求"); vm.$message.error(
"图片必须是jpeg或png格式,同时长宽尺寸和图片大小需符合要求"
);
return; return;
} }
// if (!isLt2M) { // if (!isLt2M) {
...@@ -421,15 +430,69 @@ export default { ...@@ -421,15 +430,69 @@ export default {
// 直接上传 // 直接上传
// this.needShowUploadProcess = true; // this.needShowUploadProcess = true;
// vm.uploadProgress = 0; // vm.uploadProgress = 0;
doUpload(vm, file, getFilePath(file, null), "preview4", "progress", "") doUpload(
.then(function(path) { vm,
file,
getFilePath(file, null),
"preview4",
"progress",
""
).then(function(path) {
console.log(path); console.log(path);
let cName = path.name; let cName = path.name;
cName = cName.substr(0, cName.lastIndexOf('.')); cName = cName.substr(0, cName.lastIndexOf("."));
cName = cName.substring(0, 21); cName = cName.substring(0, 21);
console.log('@@@@upload successful@@@@'); console.log("@@@@upload successful@@@@");
});
},
// 给我一个任务吧,如果当前没有任务,则要提示
getNextSession() {
this.GET("/im/session/kf/fetchOneTask").then(res => {
if (res.code === "000000") {
this.getSessionList();
} else {
this.$message({
message: res.message,
type: "warning"
});
}
}); });
}, },
// 获取会话列表
getSessionList() {
this.GET("/im/session/kf/list").then(res => {
if (res.code === "000000") {
console.log("in getSessionList", res);
this.sessionListData = res.data || {
myTaskCount: 0,
sessionList: [],
waitingTaskCount: 0
};
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 根据云信id获取医生信息
getDoctorinfo(accId) {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then(res => {
if (res.code === "000000") {
console.log("in getDoctorinfo", res);
// this.$router.push({ path: `/current-session-list` });
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
}
} }
}; };
</script> </script>
......
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
<el-button type="primary" size="small" @click="getNextSession()">给我一个任务吧</el-button> <el-button type="primary" size="small" @click="getNextSession()">给我一个任务吧</el-button>
</div> </div>
<el-table :data="tableData" style="width: 100%" v-loading="loading"> <el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column prop="id" label="用户名" min-width="50" align="center"></el-table-column> <el-table-column prop="userName" label="用户名" min-width="50" align="center"></el-table-column>
<el-table-column prop="subject" label="等待时间" min-width="100" align="center"></el-table-column> <el-table-column prop="waitTime" label="等待时间" min-width="100" align="center"></el-table-column>
<el-table-column prop="category" label="用户类型" min-width="50" align="center"></el-table-column> <el-table-column prop="idType" label="用户类型" min-width="50" align="center"></el-table-column>
<el-table-column prop="remark" label="认证状况" min-width="100" align="center"></el-table-column> <el-table-column prop="certStatus" label="认证状况" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdusername" label="所属机构" min-width="50" align="center"></el-table-column> <el-table-column prop="hospitalName" label="所属机构" min-width="50" align="center"></el-table-column>
<!-- <el-table-column prop="modifiedUsername" label="备注信息" min-width="100" align="center"></el-table-column> -->
<div slot="empty"> <div slot="empty">
<div class="table-empty"> <div class="table-empty">
<img src="../../../assets/image/IM/no-search-list.png" /> <img src="../../../assets/image/IM/no-search-list.png" />
...@@ -30,6 +29,8 @@ import { validateWord } from "@/utils/validate.js"; ...@@ -30,6 +29,8 @@ import { validateWord } from "@/utils/validate.js";
import { openLoading, closeLoading } from "@/utils/utils"; import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils"; import * as commonUtil from "@/utils/utils";
let vm = null; let vm = null;
let intervalId = null;
export default { export default {
components: { components: {
BreadCrumb BreadCrumb
...@@ -38,32 +39,19 @@ export default { ...@@ -38,32 +39,19 @@ export default {
return { return {
curmbFirst: "云鹊客服", curmbFirst: "云鹊客服",
curmbSecond: "等待会话", curmbSecond: "等待会话",
category: [],
categoryStatus: "",
tableData: [], tableData: [],
loading: false, loading: false,
nextSessionId: '',
}; };
}, },
computed: { computed: {
}, },
filters: { filters: {
filteFun(index) {
let str = "";
if (index == 1) {
str = "未发布";
} else if (index == 2) {
str = "已发布";
} else if (index == 3) {
str = "已下线";
}
return str;
}
}, },
created() { created() {
this.search(); this.getListData();
setTimeout(() => { intervalId = setInterval(() => {
this.search(); this.getListData();
}, 10000); }, 10000);
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
...@@ -71,40 +59,42 @@ export default { ...@@ -71,40 +59,42 @@ export default {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
// 列表查询
search() {
//this.getData();
},
// 获取数据 // 获取数据
getData() { getListData() {
this.loading = true; this.loading = true;
let url = `/interaction/discuss/`; this.GET('/im/task/list?pageNo=1&pageSize=40').then((res) => {
this.GET(url).then(res => {
this.loading = false; this.loading = false;
if (res.code == "000000") { if( res.code === '000000') {
console.log(res.data); this.tableData = res.data.list || [];
this.tableData = res.data.resp.discuss || []; } else {
this.nextSessionId = this.tableData[0] && this.tableData[0].id; this.$message({
console.log('this.nextSessionId', this.nextSessionId); message: res.message,
if (res.data.typeList && res.data.typeList.length) { type: 'warning'
let arr = []; });
for (let i = 0; i < res.data.typeList.length; i++) {
let obj = {};
obj.label = res.data.typeList[i];
obj.value = res.data.typeList[i];
arr.push(obj);
}
this.category = arr;
}
} }
}); })
}, },
// 给我一个任务吧,如果当前没有任务,则 // 给我一个任务吧,如果当前没有任务,则要提示
getNextSession() { getNextSession() {
this.$router.push({ path: `/current-session-list?nextSessionId=${this.nextSessionId}` }); this.GET('/im/session/kf/fetchOneTask').then((res) => {
if( res.code === '000000') {
this.$router.push({ path: `/current-session-list` });
} else {
this.$message({
message: res.message,
type: 'warning'
});
}
})
}, },
} },
// 离开页面时,清除定时器
beforeDestroy() {
intervalId && clearInterval(intervalId);
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册