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

no message

上级 3171c565
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</section> </section>
</template> </template>
<script> <script>
import { mapGetters, mapMutations } from 'vuex'; // import { mapGetters, mapMutations } from 'vuex';
let clipboard = null; let clipboard = null;
export default { export default {
props: { props: {
...@@ -91,22 +91,23 @@ export default { ...@@ -91,22 +91,23 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['stickerCacheMap']), // ...mapGetters(['stickerCacheMap']),
}, },
watch: { watch: {
taskLogId(newVal) { taskLogId(newVal) {
if(this.stickerCacheMap[newVal]) { this.getStikerInfo(newVal);
this.stickerIdList = this.stickerCacheMap[newVal]; // if(this.stickerCacheMap[newVal]) {
} else { // this.stickerIdList = this.stickerCacheMap[newVal];
this.stickerIdList = []; // } else {
} // this.stickerIdList = [];
// }
} }
}, },
created() { created() {
this.getStickerList(); this.getStickerList();
}, },
methods: { methods: {
...mapMutations(['SET_STICKER_CACHE_MAP']), // ...mapMutations(['SET_STICKER_CACHE_MAP']),
// 查询所有的问题分类 // 查询所有的问题分类
getStickerList() { getStickerList() {
...@@ -123,6 +124,21 @@ export default { ...@@ -123,6 +124,21 @@ export default {
}); });
}, },
// 根据tasklogid查询问题分类
getStikerInfo(taskLogId) {
this.GET(`/im/sticker/info?taskLogId=${taskLogId}`).then(res => {
if (res.code === "000000") {
this.stickerIdList = res.data || [];
} else {
this.$message({
message: res.message,
type: "error"
});
}
});
},
// 删除时,也要保存
removeTag() { removeTag() {
console.log(this.stickerIdList); console.log(this.stickerIdList);
this.stickerSave(false); this.stickerSave(false);
...@@ -133,7 +149,7 @@ export default { ...@@ -133,7 +149,7 @@ export default {
// 下拉框出现(status==true)或者选项为空时,直接退出 // 下拉框出现(status==true)或者选项为空时,直接退出
// if(status || !this.stickerIdList.length) return; // if(status || !this.stickerIdList.length) return;
if(status) return; if(status) return;
this.SET_STICKER_CACHE_MAP({key: this.taskLogId, idList: this.stickerIdList}); // this.SET_STICKER_CACHE_MAP({key: this.taskLogId, idList: this.stickerIdList});
let params = { let params = {
stickerIdList: this.stickerIdList, stickerIdList: this.stickerIdList,
taskLogId: this.taskLogId, taskLogId: this.taskLogId,
......
...@@ -268,6 +268,22 @@ export default { ...@@ -268,6 +268,22 @@ export default {
} }
}, },
watch: {
// 监听消息列表的变化,添加sessionFlag(会话结束标志)
messageList: {
handler(newMsgList) {
let l = newMsgList.length;
if (l >= 2) {
for (let i = 1; i < l; i++) {
if (newMsgList[i - 1].taskLogId !== newMsgList[i].taskLogId) {
newMsgList[i].sessionFlag = true;
}
}
}
},
deep: true
},
},
created() { created() {
_this = this; _this = this;
this.picakfAccId = getPicaKFAccid(); this.picakfAccId = getPicaKFAccid();
...@@ -288,22 +304,6 @@ export default { ...@@ -288,22 +304,6 @@ export default {
} }
}; };
}, },
watch: {
// 监听消息列表的变化,添加sessionFlag(会话结束标志)
messageList: {
handler(newMsgList) {
let l = newMsgList.length;
if (l >= 2) {
for (let i = 1; i < l; i++) {
if (newMsgList[i - 1].taskLogId !== newMsgList[i].taskLogId) {
newMsgList[i].sessionFlag = true;
}
}
}
},
deep: true
}
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册