Commit 8fba672b by panjiangyi

修改创建会话的逻辑

parent f14d9d56
......@@ -40,7 +40,7 @@
></el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="hide">取 消</el-button>
<el-button type="primary" @click="createChat">1 </el-button>
<el-button type="primary" @click="createChat">确定</el-button>
</span>
</el-dialog>
</template>
......
......@@ -72,7 +72,6 @@ async function preCacheImgs(msgs: any[]) {
export default {
namespaced: true,
state: () => ({
[ChatStore.STATE_CHAT_CREATOR_VISIBLE]: false,
[ChatStore.STATE_CHAT_DIALOG_VISIBLE]: false,
[ChatStore.STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID]: null,
[ChatStore.STATE_CHAT_MSG_HISTORY]: null,
......@@ -96,12 +95,6 @@ export default {
[ChatStore.MUTATION_HIDE_CHAT](state) {
state[ChatStore.STATE_CHAT_DIALOG_VISIBLE] = false;
},
[ChatStore.MUTATION_SHOW_CHAT_CREATOR](state) {
state[ChatStore.STATE_CHAT_CREATOR_VISIBLE] = true;
},
[ChatStore.MUTATION_HIDE_CHAT_CREATOR](state) {
state[ChatStore.STATE_CHAT_CREATOR_VISIBLE] = false;
},
[ChatStore.MUTATION_SAVE_CHAT_LIST](
state,
data: ChatStore.STATE_MY_CHAT_ROOM_LIST
......@@ -448,7 +441,6 @@ export default {
selected_list: [{ v: 0, id }],
})
.dryExecute();
commit(ChatStore.MUTATION_HIDE_CHAT_CREATOR);
await dispatch(ChatStore.ACTION_GET_MY_CHAT_LIST);
const roomList = state[ChatStore.STATE_MY_CHAT_ROOM_LIST];
if (roomList == null) return;
......
......@@ -13,8 +13,6 @@ export enum ChatMemberType {
export namespace ChatStore {
export const ns = "chatStore";
/* state */
export const STATE_CHAT_CREATOR_VISIBLE = "创建会话弹窗显示状态";
export type STATE_CHAT_CREATOR_VISIBLE = boolean
export const STATE_CHAT_DIALOG_VISIBLE = "会话模块弹窗显示状态";
export type STATE_CHAT_DIALOG_VISIBLE = boolean
export const STATE_MY_CHAT_ROOM_LIST = "我的会话列表";
......@@ -84,10 +82,6 @@ export namespace ChatStore {
export type GETTER_CURRENT_CHAT_PRESENT_MEMBERS = dto.ChatMembers | null
/* mutation */
export const MUTATION_SHOW_CHAT_CREATOR = "打开创建会话弹窗";
export type MUTATION_SHOW_CHAT_CREATOR = () => void
export const MUTATION_HIDE_CHAT_CREATOR = "关闭创建会话弹窗";
export type MUTATION_HIDE_CHAT_CREATOR = () => void
export const MUTATION_SHOW_CHAT = "打开会话弹窗";
export type MUTATION_SHOW_CHAT = () => void
export const MUTATION_HIDE_CHAT = "关闭会话弹窗";
......@@ -266,7 +260,7 @@ export namespace ChatStore {
}
export interface ChatStoreState {
[ChatStore.STATE_CHAT_CREATOR_VISIBLE]: ChatStore.STATE_CHAT_CREATOR_VISIBLE;
[ChatStore.STATE_CHAT_MSG_HISTORY]: ChatStore.STATE_CHAT_MSG_HISTORY;
[ChatStore.STATE_CHAT_SENDING_MESSAGES]: ChatStore.STATE_CHAT_SENDING_MESSAGES;
[ChatStore.STATE_CHAT_CURRENT_CHAT_ID]: ChatStore.STATE_CHAT_CURRENT_CHAT_ID;
......
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