mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-17 06:32:51 +00:00
Merge commit '6c2d8fc16313234bbacb4ad4d7f8637b71025a26' into pro
This commit is contained in:
commit
0be6c70e92
@ -2195,6 +2195,8 @@ class DialogController extends AbstractController
|
|||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
->where('msg', 'like', "%$uuid%")
|
->where('msg', 'like', "%$uuid%")
|
||||||
->value('msg');
|
->value('msg');
|
||||||
|
//
|
||||||
|
$createId = $dialogMsg['createid'] ?? $user->userid;
|
||||||
// 新增
|
// 新增
|
||||||
$msgList = $dialogMsg['list'] ?? [];
|
$msgList = $dialogMsg['list'] ?? [];
|
||||||
$addList = array_udiff($list, $msgList, function($a, $b) {
|
$addList = array_udiff($list, $msgList, function($a, $b) {
|
||||||
@ -2213,6 +2215,7 @@ class DialogController extends AbstractController
|
|||||||
}
|
}
|
||||||
$list = $msgList;
|
$list = $msgList;
|
||||||
} else {
|
} else {
|
||||||
|
$createId = $user->userid;
|
||||||
$uuid = Base::generatePassword(36);
|
$uuid = Base::generatePassword(36);
|
||||||
foreach ($list as $key => $item) {
|
foreach ($list as $key => $item) {
|
||||||
$list[$key]['id'] = intval(round(microtime(true) * 1000)) + $key;
|
$list[$key]['id'] = intval(round(microtime(true) * 1000)) + $key;
|
||||||
@ -2227,6 +2230,7 @@ class DialogController extends AbstractController
|
|||||||
'text' => $text,
|
'text' => $text,
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
'userid' => $user->userid,
|
'userid' => $user->userid,
|
||||||
|
'createid' => $createId,
|
||||||
'uuid' => $uuid,
|
'uuid' => $uuid,
|
||||||
];
|
];
|
||||||
return WebSocketDialogMsg::sendMsg(null, $dialog_id, 'word-chain', $msgData, $user->userid);
|
return WebSocketDialogMsg::sendMsg(null, $dialog_id, 'word-chain', $msgData, $user->userid);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
return list;
|
return list.filter(h=>(h.text || '').trim());
|
||||||
},
|
},
|
||||||
|
|
||||||
isEdit(){
|
isEdit(){
|
||||||
@ -152,7 +152,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if(data.type == 'participate' && data.dialog_id && data.msgData){
|
if(data.type == 'participate' && data.dialog_id && data.msgData){
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.createId = data.msgData.msg.userid;
|
this.createId = data.msgData.msg.createid || data.msgData.msg.userid;
|
||||||
this.value = data.msgData.msg.text;
|
this.value = data.msgData.msg.text;
|
||||||
this.list = this.allList;
|
this.list = this.allList;
|
||||||
this.oldData = JSON.stringify(this.list);
|
this.oldData = JSON.stringify(this.list);
|
||||||
@ -181,15 +181,10 @@ export default {
|
|||||||
if (!this.isEdit) {
|
if (!this.isEdit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
if (!this.value) {
|
if (!this.value) {
|
||||||
$A.messageError("请输入接龙主题");
|
$A.messageError("请输入接龙主题");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( this.list.find(h=> !h.text && h.type != "case") ){
|
|
||||||
$A.messageError("请输入接龙内容");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
const texts = this.list.map(h=> h.text);
|
const texts = this.list.map(h=> h.text);
|
||||||
if( texts.length != [...new Set(texts)].length ){
|
if( texts.length != [...new Set(texts)].length ){
|
||||||
@ -212,7 +207,7 @@ export default {
|
|||||||
send() {
|
send() {
|
||||||
const list = [];
|
const list = [];
|
||||||
this.list.forEach(h=>{
|
this.list.forEach(h=>{
|
||||||
if(h.text && list.map(h=> h.text).indexOf(h.text) == -1){
|
if ((h.text || h.type != "case") && list.map(h=> h.text).indexOf(h.text) == -1) {
|
||||||
list.push(h);
|
list.push(h);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
<li v-for="(item) in (msgData.msg.list || []).filter(h=>h.type == 'case')">
|
<li v-for="(item) in (msgData.msg.list || []).filter(h=>h.type == 'case')">
|
||||||
{{ $L('例') }} {{ item.text }}
|
{{ $L('例') }} {{ item.text }}
|
||||||
</li>
|
</li>
|
||||||
<li v-for="(item,index) in (msgData.msg.list || []).filter(h=>h.type != 'case')">
|
<li v-for="(item,index) in (msgData.msg.list || []).filter(h=>h.type != 'case' && h.text)">
|
||||||
<span class="expand" v-if="index == 2 && msgData.msg.list.length > 4" @click="unfoldWordChain(msgData)">
|
<span class="expand" v-if="index == 2 && msgData.msg.list.length > 4" @click="unfoldWordChain(msgData)">
|
||||||
...{{$L('展开')}}...
|
...{{$L('展开')}}...
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user