Commit 76d31530 by panjiangyi

创建会话后打开会话失败的问题

parent 137e7c31
......@@ -20,9 +20,13 @@
>
<ChatMembers />
</el-tab-pane>
<el-tab-pane label="工作流" name="three"
>工作流</el-tab-pane
>
<el-tab-pane label="工作流" name="three">
<workflow
:model_name="currentChat.business_data.model_name"
:id="currentChat.business_data.obj_id"
:name="currentChat.business_data.detail_name"
/>
</el-tab-pane>
<el-tab-pane label="备注" name="four">
<remarkList
:modelName="currentChat.business_data.model_name"
......@@ -52,6 +56,7 @@ import ChatTitle from "./components/chat-title.vue";
import MessageList from "./components/message-list.vue";
import ModelDetail from "./components/model-detail.vue";
import MsgShortCut from "./components/msg-shortcut.vue";
import workflow from "./components/workflow.vue";
import buttonThrottle from "./utils/button-throttle";
import { ChatStore, chatStore } from "@/customer-service/store/model";
......@@ -65,6 +70,7 @@ import { ChatStore, chatStore } from "@/customer-service/store/model";
remarkList,
ChatTitle,
ModelDetail,
workflow,
},
})
export default class Chat extends Vue {
......
<template>
<div>
<div v-for="item in mockData" :key="item.id">
<span class="name">{{item.name}}</span>
<span class="state">{{item.state}}</span>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import Chat from "../xim/index";
enum WorkFlowStatus {
idle =0,
processing =1,
done =2,
}
const sdk = Chat.getSdk;
@Component({ components: {} })
export default class WorkFlow extends Vue {
@Prop({
type: String,
required: true,
})
private readonly model_name!: string;
@Prop({
type: String,
required: true,
})
private readonly id!: string;
@Prop({
type: String,
default: null,
})
private readonly name!: string;
private getStatus(status: WorkFlowStatus) {
}
private mockData = [
{
id: null,
associateId: 27,
processName: "333",
state: "无",
status: 0,
isComplete: null,
},
{
id: 51,
associateId: 27,
processName: "bug流程测试",
state: "4",
status: 1,
isComplete: 0,
},
{
id: 153,
associateId: 27,
processName: "工作流演示流程",
state: "待联系",
status: 1,
isComplete: 0,
},
{
id: 55,
associateId: 27,
processName: "工作流演示流程",
state: "已支付111",
status: 2,
isComplete: 1,
},
{
id: 56,
associateId: 27,
processName: "最新工作流程定义",
state: "商议阶段",
status: 1,
isComplete: 0,
},
{
id: 147,
associateId: 27,
processName: "测试流程2",
state: "状态1",
status: 1,
isComplete: 0,
},
{
id: 144,
associateId: 27,
processName: "测试流程2",
state: "终结状态",
status: 2,
isComplete: 1,
},
{
id: 146,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 145,
associateId: 27,
processName: "计划任务",
state: "处理中",
status: 1,
isComplete: 0,
},
{
id: 143,
associateId: 27,
processName: "计划任务",
state: "已取消",
status: 2,
isComplete: 1,
},
{
id: 142,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 131,
associateId: 27,
processName: "计划任务",
state: "处理中",
status: 1,
isComplete: 0,
},
{
id: 130,
associateId: 27,
processName: "计划任务",
state: "处理中",
status: 1,
isComplete: 0,
},
{
id: 129,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 128,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 126,
associateId: 27,
processName: "计划任务",
state: "已取消",
status: 2,
isComplete: 1,
},
{
id: 125,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 124,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 123,
associateId: 27,
processName: "计划任务",
state: "已完成",
status: 2,
isComplete: 1,
},
{
id: 155,
associateId: 27,
processName: "超管演示",
state: "状态1",
status: 1,
isComplete: 0,
},
];
public async created() {
// const workflow = await sdk().model(this.model_name).workflow2().queryProcessByAssociateId(+this.id);
// console.log("workflow", workflow);
}
}
</script>
<style lang="less" scoped></style>
......@@ -413,11 +413,14 @@ export default {
});
await new Promise(resolve => setTimeout(resolve, 500));
await dispatch(ChatStore.ACTION_GET_MY_CHAT_LIST);
console.log("fuck 0");
const newChatInfo = await getChatModelInfo(params.modelName, params.selectedListId);
const roomList = state[ChatStore.STATE_MY_CHAT_ROOM_LIST];
if (roomList == null) return;
console.log("fuck 1");
const newChat = roomList.list.find((k) => k.chat_id === newChatInfo.chat_id);
if (newChat == null) return;
console.log("fuck 2");
commit(ChatStore.MUTATION_SHOW_CHAT);
await dispatch(ChatStore.ACTION_SAVE_CURRENT_CHAT_ID_VERSION, {
chatId: newChat.chat_id,
......
......@@ -8,13 +8,19 @@ const chatInfo: ChatInfo = {};
export const getChatModel = () => chatInfo;
export async function getChatModelInfo(modelName: string, id: string) {
if (chatInfo[id] != null) return chatInfo[id];
if (chatInfo[id] != null) {
return {
uniplatId: chatInfo[id].row.UniplatChatId.value,
chat_id: +chatInfo[id].row.UniplatImChatId.value,
uniplat_version: 0,
};
}
const info = await Chat.getSdk().model(modelName).detail(id).query();
const data = info;
chatInfo[id] = data;
return {
uniplatId: info.row.UniplatChatId.value,
chat_id: info.row.UniplatImBizId.value,
uniplat_version: 0
chat_id: +info.row.UniplatImChatId.value,
uniplat_version: 0,
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment