mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
feat: 添加投票功能 30%
This commit is contained in:
parent
bab82dc290
commit
5dfc66fc21
@ -521,6 +521,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
}
|
}
|
||||||
switch ($data['type']) {
|
switch ($data['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
|
case 'word-chain':
|
||||||
return $this->previewTextMsg($data['msg']['text'], $preserveHtml);
|
return $this->previewTextMsg($data['msg']['text'], $preserveHtml);
|
||||||
case 'record':
|
case 'record':
|
||||||
return "[语音]";
|
return "[语音]";
|
||||||
|
|||||||
@ -1434,6 +1434,7 @@ APP推送
|
|||||||
发起接龙
|
发起接龙
|
||||||
由
|
由
|
||||||
发起接龙,参与接龙目前共(*)人
|
发起接龙,参与接龙目前共(*)人
|
||||||
|
请输入接龙内容
|
||||||
可填写接龙格式
|
可填写接龙格式
|
||||||
重复内容将不再计入接龙结果
|
重复内容将不再计入接龙结果
|
||||||
返回编辑
|
返回编辑
|
||||||
|
|||||||
1
resources/assets/js/functions/web.js
vendored
1
resources/assets/js/functions/web.js
vendored
@ -818,6 +818,7 @@
|
|||||||
if ($A.isJson(data)) {
|
if ($A.isJson(data)) {
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
|
case 'word-chain':
|
||||||
return $A.getMsgTextPreview(data.msg.text, imgClassName)
|
return $A.getMsgTextPreview(data.msg.text, imgClassName)
|
||||||
case 'record':
|
case 'record':
|
||||||
return `[${$A.L('语音')}]`
|
return `[${$A.L('语音')}]`
|
||||||
|
|||||||
@ -264,9 +264,6 @@
|
|||||||
<MobileBack :showTabbar="showMobileTabbar"/>
|
<MobileBack :showTabbar="showMobileTabbar"/>
|
||||||
<MobileNotification ref="mobileNotification"/>
|
<MobileNotification ref="mobileNotification"/>
|
||||||
|
|
||||||
<!--接龙-->
|
|
||||||
<WordChain/>
|
|
||||||
|
|
||||||
<!-- okr明细 -->
|
<!-- okr明细 -->
|
||||||
<MicroApps v-show="false" v-if="$route.name != 'manage-apps'" name="okr-details" :url="okrUrl" :datas="okrWindow"/>
|
<MicroApps v-show="false" v-if="$route.name != 'manage-apps'" name="okr-details" :url="okrUrl" :datas="okrWindow"/>
|
||||||
</div>
|
</div>
|
||||||
@ -292,8 +289,7 @@ import TaskExport from "./manage/components/TaskExport";
|
|||||||
import ApproveExport from "./manage/components/ApproveExport";
|
import ApproveExport from "./manage/components/ApproveExport";
|
||||||
import notificationKoro from "notification-koro1";
|
import notificationKoro from "notification-koro1";
|
||||||
import {Store} from "le5le-store";
|
import {Store} from "le5le-store";
|
||||||
import MicroApps from "../components/MicroApps.vue";
|
import MicroApps from "../components/MicroApps";
|
||||||
import WordChain from "../components/WordChain.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -312,8 +308,7 @@ export default {
|
|||||||
ProjectManagement,
|
ProjectManagement,
|
||||||
TeamManagement,
|
TeamManagement,
|
||||||
ProjectArchived,
|
ProjectArchived,
|
||||||
MicroApps,
|
MicroApps
|
||||||
WordChain
|
|
||||||
},
|
},
|
||||||
directives: {longpress},
|
directives: {longpress},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@ -191,7 +191,7 @@
|
|||||||
|
|
||||||
<!-- 发起接龙 -->
|
<!-- 发起接龙 -->
|
||||||
<UserSelect
|
<UserSelect
|
||||||
ref="wordChain"
|
ref="wordChainRef"
|
||||||
v-model="sendData"
|
v-model="sendData"
|
||||||
:multiple-max="50"
|
:multiple-max="50"
|
||||||
:title="$L('选择群组发起接龙')"
|
:title="$L('选择群组发起接龙')"
|
||||||
@ -327,6 +327,7 @@ export default {
|
|||||||
{ value: "meeting", label: "会议" },
|
{ value: "meeting", label: "会议" },
|
||||||
{ value: "calendar", label: "日历" },
|
{ value: "calendar", label: "日历" },
|
||||||
{ value: "word-chain", label: "接龙" },
|
{ value: "word-chain", label: "接龙" },
|
||||||
|
{ value: "vote", label: "投票" },
|
||||||
];
|
];
|
||||||
// wap模式
|
// wap模式
|
||||||
let appApplyList = this.windowOrientation != 'portrait' ? (
|
let appApplyList = this.windowOrientation != 'portrait' ? (
|
||||||
@ -418,7 +419,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
case 'word-chain':
|
case 'word-chain':
|
||||||
this.sendData = [];
|
this.sendData = [];
|
||||||
this.$refs.wordChain.onSelection()
|
this.$refs.wordChainRef.onSelection()
|
||||||
|
return;
|
||||||
|
case 'vote':
|
||||||
|
this.sendData = [];
|
||||||
|
this.$refs.wordChainRef.onSelection()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit("on-click", item.value)
|
this.$emit("on-click", item.value)
|
||||||
@ -549,12 +554,12 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//
|
// 前往接龙
|
||||||
onWordChain(){
|
onWordChain(){
|
||||||
const dialog_id = Number(this.sendData[0].replace('d:', ''))
|
const dialog_id = Number(this.sendData[0].replace('d:', ''))
|
||||||
if(this.windowPortrait){
|
if(this.windowPortrait){
|
||||||
this.$store.dispatch("openDialog", dialog_id ).then(() => {
|
this.$store.dispatch("openDialog", dialog_id ).then(() => {
|
||||||
this.$store.state.wordChain = {
|
this.$store.state.dialogDroupWordChain = {
|
||||||
type: 'create',
|
type: 'create',
|
||||||
dialog_id: dialog_id
|
dialog_id: dialog_id
|
||||||
}
|
}
|
||||||
@ -562,13 +567,12 @@ export default {
|
|||||||
}else{
|
}else{
|
||||||
this.goForward({ name: 'manage-messenger', params: { dialog_id: dialog_id}});
|
this.goForward({ name: 'manage-messenger', params: { dialog_id: dialog_id}});
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.$store.state.wordChain = {
|
this.$store.state.dialogDroupWordChain = {
|
||||||
type: 'create',
|
type: 'create',
|
||||||
dialog_id: dialog_id
|
dialog_id: dialog_id
|
||||||
}
|
}
|
||||||
},100)
|
},100)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,14 +102,18 @@
|
|||||||
<i class="taskfont"></i>
|
<i class="taskfont"></i>
|
||||||
{{$L('匿名消息')}}
|
{{$L('匿名消息')}}
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="dialogData.type == 'group'" class="chat-input-popover-item" @click="onToolbar('word-chain')">
|
||||||
|
<i class="taskfont"></i>
|
||||||
|
{{$L('接龙')}}
|
||||||
|
</div>
|
||||||
|
<div v-if="dialogData.type == 'group'" class="chat-input-popover-item" @click="onToolbar('vote')">
|
||||||
|
<i class="taskfont"></i>
|
||||||
|
{{$L('投票')}}
|
||||||
|
</div>
|
||||||
<div class="chat-input-popover-item" @click="onToolbar('full')">
|
<div class="chat-input-popover-item" @click="onToolbar('full')">
|
||||||
<i class="taskfont"></i>
|
<i class="taskfont"></i>
|
||||||
{{$L('全屏输入')}}
|
{{$L('全屏输入')}}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="dialogData.type == 'group'" class="chat-input-popover-item" @click="onToolbar('chain-reaction')">
|
|
||||||
<i class="taskfont"></i>
|
|
||||||
{{$L('接龙')}}
|
|
||||||
</div>
|
|
||||||
</EPopover>
|
</EPopover>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -1233,12 +1237,20 @@ export default {
|
|||||||
this.$emit('on-more', action)
|
this.$emit('on-more', action)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'chain-reaction':
|
case 'word-chain':
|
||||||
this.$store.state.wordChain = {
|
this.$store.state.dialogDroupWordChain = {
|
||||||
type: 'create',
|
type: 'create',
|
||||||
dialog_id: this.dialogId
|
dialog_id: this.dialogId
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vote':
|
||||||
|
this.$store.state.dialogGroupVote = {
|
||||||
|
type: 'create',
|
||||||
|
dialog_id: this.dialogId
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
238
resources/assets/js/pages/manage/components/DialogGroupVote.vue
Normal file
238
resources/assets/js/pages/manage/components/DialogGroupVote.vue
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
<template>
|
||||||
|
<Modal class-name="dialog-droup-word-chain"
|
||||||
|
v-model="show"
|
||||||
|
:mask-closable="false"
|
||||||
|
:title="dialogGroupVote.type == 'create' ? $L('发起投票') : $L('投票结果')"
|
||||||
|
:closable="!isFullscreen"
|
||||||
|
:fullscreen="isFullscreen"
|
||||||
|
:footer-hide="isFullscreen">
|
||||||
|
<!-- 顶部 -->
|
||||||
|
<template #header>
|
||||||
|
<div v-if="isFullscreen" class="chain-modal-header">
|
||||||
|
<div class="chain-modal-close" @click="show = false">
|
||||||
|
{{ $L('取消') }}
|
||||||
|
</div>
|
||||||
|
<div class="chain-modal-title">
|
||||||
|
{{ dialogGroupVote.type == 'create' ? $L('发起接龙') : $L('接龙结果') }}
|
||||||
|
</div>
|
||||||
|
<div class="chain-modal-submit" :class="{'disabled': !isEdit}" @click="onSend" >
|
||||||
|
<div v-if="loadIng > 0" class="submit-loading"><Loading /></div>
|
||||||
|
{{$L('发送')}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #close>
|
||||||
|
<i class="ivu-icon ivu-icon-ios-close"></i>
|
||||||
|
</template>
|
||||||
|
<div ref="wordChainBodyRef" class="word-chain-body">
|
||||||
|
<div class="source" v-if="dialogGroupVote.type == 'create'">
|
||||||
|
{{$L('来自')}}
|
||||||
|
<span>{{ dialog.name }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="initiate">
|
||||||
|
<span>{{ $L('由') }}</span>
|
||||||
|
<UserAvatar :userid="createId" :size="22" :showName="true" tooltipDisabled/>
|
||||||
|
<span> {{ $L('发起') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="textarea">
|
||||||
|
<Input ref="wordChainTextareaRef"
|
||||||
|
v-model="value"
|
||||||
|
type="textarea"
|
||||||
|
:placeholder="$L('请输入投票主题')"
|
||||||
|
:autosize="{minRows: 3,maxRows: 5}"
|
||||||
|
:disabled="dialogGroupVote.type != 'create'" />
|
||||||
|
</div>
|
||||||
|
<ul ref="wordChainListRef">
|
||||||
|
<li v-for="(item,index) in list">
|
||||||
|
<span>
|
||||||
|
<i class="taskfont" @click="del"></i>
|
||||||
|
</span>
|
||||||
|
<Input v-model="item.text" :disabled="item.userid != userId" :placeholder="$L('请输入选项内容')"/>
|
||||||
|
</li>
|
||||||
|
<li class="add">
|
||||||
|
<i class="taskfont" @click="add"></i>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="default" @click="show=false">{{$L('取消')}}</Button>
|
||||||
|
<Button type="primary" :loading="loadIng > 0" @click="onSend" :disabled="!isEdit">{{$L('发送')}}</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapState} from "vuex";
|
||||||
|
export default {
|
||||||
|
name: 'DialogGroupVote',
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
|
||||||
|
createId: 0,
|
||||||
|
value: "",
|
||||||
|
list: [],
|
||||||
|
|
||||||
|
oldData: '',
|
||||||
|
loadIng: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState(['dialogGroupVote', 'userInfo', 'dialogMsgs', 'cacheDialogs']),
|
||||||
|
|
||||||
|
isFullscreen({ windowWidth }) {
|
||||||
|
return windowWidth < 576;
|
||||||
|
},
|
||||||
|
|
||||||
|
allList(){
|
||||||
|
const msg = this.dialogGroupVote.msgData?.msg || {};
|
||||||
|
let list = JSON.parse(JSON.stringify(msg.list || []));
|
||||||
|
this.dialogMsgs.filter(h=>{
|
||||||
|
return h.type == "word-chain" && h.msg?.uuid == msg.uuid
|
||||||
|
}).forEach((h)=>{
|
||||||
|
(h.msg.list || []).forEach(k=>{
|
||||||
|
if(list.map(j=>j.id).indexOf(k.id) == -1){
|
||||||
|
list.push(k)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
},
|
||||||
|
|
||||||
|
isEdit(){
|
||||||
|
return this.oldData != JSON.stringify(this.list);
|
||||||
|
},
|
||||||
|
|
||||||
|
dialog(){
|
||||||
|
return this.cacheDialogs.find(h=>h.id == this.dialogGroupVote.dialog_id) || {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
show(val){
|
||||||
|
if(!val){
|
||||||
|
this.value = "";
|
||||||
|
this.list = [];
|
||||||
|
}else{
|
||||||
|
if(this.dialogGroupVote.type == 'create'){
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.wordChainTextareaRef.focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.scrollTo();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
dialogGroupVote(data) {
|
||||||
|
if(data.type == 'create' && data.dialog_id){
|
||||||
|
this.show = true;
|
||||||
|
this.createId = this.userId;
|
||||||
|
this.list.push({
|
||||||
|
id: Date.now(),
|
||||||
|
userid: this.userId,
|
||||||
|
text: ""
|
||||||
|
});
|
||||||
|
this.list.push({
|
||||||
|
id: Date.now() + 1,
|
||||||
|
userid: this.userId,
|
||||||
|
text: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(data.type == 'participate' && data.dialog_id && data.msgData){
|
||||||
|
this.show = true;
|
||||||
|
this.createId = data.msgData.msg.userid;
|
||||||
|
this.value = data.msgData.msg.text;
|
||||||
|
this.list = this.allList;
|
||||||
|
this.oldData = JSON.stringify(this.list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
add(){
|
||||||
|
this.list.push({
|
||||||
|
id: Date.now(),
|
||||||
|
type: 'text',
|
||||||
|
userid: this.userId,
|
||||||
|
text: this.userInfo.nickname,
|
||||||
|
});
|
||||||
|
this.scrollTo();
|
||||||
|
},
|
||||||
|
|
||||||
|
del(){
|
||||||
|
this.list.push({
|
||||||
|
id: Date.now(),
|
||||||
|
type: 'text',
|
||||||
|
userid: this.userId,
|
||||||
|
text: this.userInfo.nickname,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
scrollTo(){
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.wordChainListRef.scrollTo(0, 99999);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onSend() {
|
||||||
|
if( !this.isEdit ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const texts = this.list.map(h=> h.text);
|
||||||
|
if( texts.length != [...new Set(texts)].length ){
|
||||||
|
$A.modalConfirm({
|
||||||
|
content: '重复内容将不再计入接龙结果',
|
||||||
|
cancelText: '返回编辑',
|
||||||
|
okText: '继续发送',
|
||||||
|
onOk: () => {
|
||||||
|
this.send()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.send();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息
|
||||||
|
*/
|
||||||
|
send() {
|
||||||
|
const list = [];
|
||||||
|
this.list.forEach(h=>{
|
||||||
|
if( list.map(h=> h.text).indexOf(h.text) == -1){
|
||||||
|
list.push(h);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//
|
||||||
|
this.loadIng++;
|
||||||
|
this.$store.dispatch("call", {
|
||||||
|
url: 'dialog/msg/wordchain',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
dialog_id: this.dialogGroupVote.dialog_id,
|
||||||
|
text: this.value,
|
||||||
|
list: list,
|
||||||
|
uuid: this.dialogGroupVote.msgData?.msg?.uuid || ''
|
||||||
|
}
|
||||||
|
}).then(({data}) => {
|
||||||
|
this.show = false;
|
||||||
|
this.$store.dispatch("saveDialogMsg", data);
|
||||||
|
}).catch(({msg}) => {
|
||||||
|
if( msg.indexOf("System error") !== -1){
|
||||||
|
$A.modalInfo({
|
||||||
|
language: false,
|
||||||
|
title: '版本过低',
|
||||||
|
content: '服务器版本过低,请升级服务器。',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$A.modalError(msg);
|
||||||
|
}).finally(_ => {
|
||||||
|
this.loadIng--;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal class-name="word-chain-wrapper"
|
<Modal class-name="dialog-droup-word-chain"
|
||||||
v-model="show"
|
v-model="show"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
:title="wordChain.type == 'create' ? $L('发起接龙') : $L('接龙结果')"
|
:title="dialogDroupWordChain.type == 'create' ? $L('发起接龙') : $L('接龙结果')"
|
||||||
:closable="!isFullscreen"
|
:closable="!isFullscreen"
|
||||||
:fullscreen="isFullscreen"
|
:fullscreen="isFullscreen"
|
||||||
:footer-hide="isFullscreen">
|
:footer-hide="isFullscreen">
|
||||||
@ -13,7 +13,7 @@
|
|||||||
{{ $L('取消') }}
|
{{ $L('取消') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="chain-modal-title">
|
<div class="chain-modal-title">
|
||||||
{{ wordChain.type == 'create' ? $L('发起接龙') : $L('接龙结果') }}
|
{{ dialogDroupWordChain.type == 'create' ? $L('发起接龙') : $L('接龙结果') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="chain-modal-submit" :class="{'disabled': !isEdit}" @click="onSend" >
|
<div class="chain-modal-submit" :class="{'disabled': !isEdit}" @click="onSend" >
|
||||||
<div v-if="loadIng > 0" class="submit-loading"><Loading /></div>
|
<div v-if="loadIng > 0" class="submit-loading"><Loading /></div>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<i class="ivu-icon ivu-icon-ios-close"></i>
|
<i class="ivu-icon ivu-icon-ios-close"></i>
|
||||||
</template>
|
</template>
|
||||||
<div ref="wordChainBodyRef" class="word-chain-body">
|
<div ref="wordChainBodyRef" class="word-chain-body">
|
||||||
<div class="source" v-if="wordChain.type == 'create'">
|
<div class="source" v-if="dialogDroupWordChain.type == 'create'">
|
||||||
{{$L('来自')}}
|
{{$L('来自')}}
|
||||||
<span>{{ dialog.name }}</span>
|
<span>{{ dialog.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -35,16 +35,16 @@
|
|||||||
<span> {{ $L('发起,参与接龙目前共'+num+'人') }}</span>
|
<span> {{ $L('发起,参与接龙目前共'+num+'人') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<Input ref="wordChainTextareaRef" v-model="value" type="textarea" :autosize="{minRows: 3,maxRows: 5}" :disabled="wordChain.type != 'create'" />
|
<Input ref="wordChainTextareaRef" v-model="value" type="textarea" :autosize="{minRows: 3,maxRows: 5}" :disabled="dialogDroupWordChain.type != 'create'" />
|
||||||
</div>
|
</div>
|
||||||
<ul ref="wordChainListRef">
|
<ul ref="wordChainListRef">
|
||||||
<li v-for="(item,index) in list" :key="index" v-if="item.type == 'case' && (wordChain.type == 'create' || item.text)">
|
<li v-for="(item,index) in list" v-if="item.type == 'case' && (dialogDroupWordChain.type == 'create' || item.text)">
|
||||||
<span>{{ $L('例') }}</span>
|
<span>{{ $L('例') }}</span>
|
||||||
<Input v-model="item.text" :placeholder="$L('可填写接龙格式')" :disabled="wordChain.type != 'create'" />
|
<Input v-model="item.text" :placeholder="$L('可填写接龙格式')" :disabled="dialogDroupWordChain.type != 'create'" />
|
||||||
</li>
|
</li>
|
||||||
<li v-for="(item,index) in list" :key="index" v-if="item.type != 'case'">
|
<li v-for="(item,index) in list.filter(h=>h.type != 'case')">
|
||||||
<span>{{index}}</span>
|
<span>{{index + 1}}</span>
|
||||||
<Input v-model="item.text" :disabled="item.userid != userId"/>
|
<Input v-model="item.text" :disabled="item.userid != userId" :placeholder="$L('请输入接龙内容')"/>
|
||||||
</li>
|
</li>
|
||||||
<li class="add">
|
<li class="add">
|
||||||
<i class="taskfont" @click="add"></i>
|
<i class="taskfont" @click="add"></i>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: 'WordChain',
|
name: 'DialogDroupWordChain',
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -77,7 +77,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['wordChain', 'userInfo', 'dialogMsgs', 'cacheDialogs']),
|
...mapState(['dialogDroupWordChain', 'userInfo', 'dialogMsgs', 'cacheDialogs']),
|
||||||
|
|
||||||
isFullscreen({ windowWidth }) {
|
isFullscreen({ windowWidth }) {
|
||||||
return windowWidth < 576;
|
return windowWidth < 576;
|
||||||
@ -88,9 +88,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
allList(){
|
allList(){
|
||||||
let list = JSON.parse(JSON.stringify(this.wordChain.msgData?.msg?.list)) || [];
|
const msg = this.dialogDroupWordChain.msgData?.msg || {};
|
||||||
|
let list = JSON.parse(JSON.stringify(msg.list || []));
|
||||||
this.dialogMsgs.filter(h=>{
|
this.dialogMsgs.filter(h=>{
|
||||||
return h.type == "word-chain" && h.msg?.uuid == this.wordChain.msgData?.msg?.uuid
|
return h.type == "word-chain" && h.msg?.uuid == msg.uuid
|
||||||
}).forEach((h)=>{
|
}).forEach((h)=>{
|
||||||
(h.msg.list || []).forEach(k=>{
|
(h.msg.list || []).forEach(k=>{
|
||||||
if( k.type != 'case' && list.map(j=>j.id).indexOf(k.id) == -1 ){
|
if( k.type != 'case' && list.map(j=>j.id).indexOf(k.id) == -1 ){
|
||||||
@ -102,11 +103,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isEdit(){
|
isEdit(){
|
||||||
return this.oldData != JSON.stringify(this.list)
|
return this.oldData != JSON.stringify(this.list);
|
||||||
},
|
},
|
||||||
|
|
||||||
dialog(){
|
dialog(){
|
||||||
return this.cacheDialogs.find(h=>h.id == this.wordChain.dialog_id) || {}
|
return this.cacheDialogs.find(h=>h.id == this.dialogDroupWordChain.dialog_id) || {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -116,37 +117,38 @@ export default {
|
|||||||
this.value = "#接龙 \n";
|
this.value = "#接龙 \n";
|
||||||
this.list = [];
|
this.list = [];
|
||||||
}else{
|
}else{
|
||||||
if(this.wordChain.type == 'create'){
|
if(this.dialogDroupWordChain.type == 'create'){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.wordChainTextareaRef.focus()
|
this.$refs.wordChainTextareaRef.focus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.scrollTo();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
wordChain(data) {
|
dialogDroupWordChain(data) {
|
||||||
if(data.type == 'create' && data.dialog_id){
|
if(data.type == 'create' && data.dialog_id){
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.createId = this.userId
|
this.createId = this.userId;
|
||||||
this.list.push({
|
this.list.push({
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
type: 'case',
|
type: "case",
|
||||||
userid: this.userId,
|
userid: this.userId,
|
||||||
text: '',
|
text: ""
|
||||||
})
|
});
|
||||||
this.list.push({
|
this.list.push({
|
||||||
id: Date.now() + 1,
|
id: Date.now() + 1,
|
||||||
type: 'text',
|
type: "text",
|
||||||
userid: this.userId,
|
userid: this.userId,
|
||||||
text: this.userInfo.nickname,
|
text: this.userInfo.nickname
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
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.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -158,10 +160,14 @@ export default {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
userid: this.userId,
|
userid: this.userId,
|
||||||
text: this.userInfo.nickname,
|
text: this.userInfo.nickname,
|
||||||
})
|
});
|
||||||
|
this.scrollTo();
|
||||||
|
},
|
||||||
|
|
||||||
|
scrollTo(){
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.wordChainListRef.scrollTo(0, 99999);
|
this.$refs.wordChainListRef.scrollTo(0, 99999);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSend() {
|
onSend() {
|
||||||
@ -180,7 +186,7 @@ export default {
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.send()
|
this.send();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -188,21 +194,30 @@ export default {
|
|||||||
*/
|
*/
|
||||||
send() {
|
send() {
|
||||||
const list = [];
|
const list = [];
|
||||||
|
let isEmpty = false;
|
||||||
this.list.forEach(h=>{
|
this.list.forEach(h=>{
|
||||||
if( list.map(h=> h.text).indexOf(h.text) == -1){
|
if(!h.text && h.type != "case"){
|
||||||
|
isEmpty = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( h.text && list.map(h=> h.text).indexOf(h.text) == -1){
|
||||||
list.push(h);
|
list.push(h);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(isEmpty){
|
||||||
|
$A.messageError("请输入接龙内容");
|
||||||
|
return;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
this.loadIng++;
|
this.loadIng++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'dialog/msg/wordchain',
|
url: 'dialog/msg/wordchain',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
dialog_id: this.wordChain.dialog_id,
|
dialog_id: this.dialogDroupWordChain.dialog_id,
|
||||||
text: this.value,
|
text: this.value,
|
||||||
list: list,
|
list: list,
|
||||||
uuid: this.wordChain.msgData?.msg?.uuid || ''
|
uuid: this.dialogDroupWordChain.msgData?.msg?.uuid || ''
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
@ -70,13 +70,15 @@
|
|||||||
<div v-else-if="msgData.type === 'word-chain'" class="content-text content-word-chain no-dark-content">
|
<div v-else-if="msgData.type === 'word-chain'" class="content-text content-word-chain no-dark-content">
|
||||||
<pre v-html="$A.formatTextMsg(msgData.msg.text, userId)"></pre>
|
<pre v-html="$A.formatTextMsg(msgData.msg.text, userId)"></pre>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(item,index) in (msgData.msg.list || [])" :key="index">
|
<li v-for="(item) in (msgData.msg.list || []).filter(h=>h.type == 'case')">
|
||||||
<span class="expand" v-if="index == 2 && index != msgData.msg.list.length - 1 && msgData.msg.list.length > 4" @click="unfoldWordChain">
|
{{ $L('例') }} {{ item.text }}
|
||||||
|
</li>
|
||||||
|
<li v-for="(item,index) in (msgData.msg.list || []).filter(h=>h.type != 'case')">
|
||||||
|
<span class="expand" v-if="index == 2 && msgData.msg.list.length > 4" @click="unfoldWordChain">
|
||||||
...{{$L('展开')}}...
|
...{{$L('展开')}}...
|
||||||
</span>
|
</span>
|
||||||
<span :class="{'shrink': index >= 2 && index != msgData.msg.list.length - 1 && msgData.msg.list.length > 4 } ">
|
<span :class="{'shrink': index >= 2 && msgData.msg.list.length > 4 } ">
|
||||||
<span v-if="item.type == 'case' && item.text">{{ $L('例') }} {{ item.text }}</span>
|
{{index + 1}}. {{item.text}}
|
||||||
<span v-else-if="item.type != 'case'">{{index}}. {{item.text}}</span>
|
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li @click="onWordChain" class="participate">{{ $L('参与接龙') }}<span>></span></li>
|
<li @click="onWordChain" class="participate">{{ $L('参与接龙') }}<span>></span></li>
|
||||||
@ -522,7 +524,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onWordChain(){
|
onWordChain(){
|
||||||
this.$store.state.wordChain = {
|
this.$store.state.dialogDroupWordChain = {
|
||||||
type: 'participate',
|
type: 'participate',
|
||||||
dialog_id: this.msgData.dialog_id,
|
dialog_id: this.msgData.dialog_id,
|
||||||
msgData: this.msgData,
|
msgData: this.msgData,
|
||||||
|
|||||||
@ -535,6 +535,13 @@
|
|||||||
<DrawerOverlay v-model="approveDetailsShow" placement="right" :size="600">
|
<DrawerOverlay v-model="approveDetailsShow" placement="right" :size="600">
|
||||||
<ApproveDetails v-if="approveDetailsShow" :data="approveDetails" style="height: 100%;border-radius: 10px;"></ApproveDetails>
|
<ApproveDetails v-if="approveDetailsShow" :data="approveDetails" style="height: 100%;border-radius: 10px;"></ApproveDetails>
|
||||||
</DrawerOverlay>
|
</DrawerOverlay>
|
||||||
|
|
||||||
|
<!-- 群接龙 -->
|
||||||
|
<DialogGroupWordChain/>
|
||||||
|
|
||||||
|
<!-- 群投票 -->
|
||||||
|
<DialogGroupVote/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -554,6 +561,9 @@ import {choiceEmojiOne} from "./ChatInput/one";
|
|||||||
|
|
||||||
import ApproveDetails from "../../../pages/manage/approve/details.vue";
|
import ApproveDetails from "../../../pages/manage/approve/details.vue";
|
||||||
import UserSelect from "../../../components/UserSelect.vue";
|
import UserSelect from "../../../components/UserSelect.vue";
|
||||||
|
import DialogGroupWordChain from "./DialogGroupWordChain";
|
||||||
|
import DialogGroupVote from "./DialogGroupVote";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DialogWrapper",
|
name: "DialogWrapper",
|
||||||
@ -567,7 +577,9 @@ export default {
|
|||||||
DialogGroupInfo,
|
DialogGroupInfo,
|
||||||
DrawerOverlay,
|
DrawerOverlay,
|
||||||
DialogUpload,
|
DialogUpload,
|
||||||
ApproveDetails
|
ApproveDetails,
|
||||||
|
DialogGroupWordChain,
|
||||||
|
DialogGroupVote,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@ -50,7 +50,7 @@
|
|||||||
</EDropdownItem>
|
</EDropdownItem>
|
||||||
<EDropdownItem command="move">
|
<EDropdownItem command="move">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<Icon type="md-move" />{{$L('移动')}}
|
<i class="taskfont movefont"></i>{{$L('移动')}}
|
||||||
</div>
|
</div>
|
||||||
</EDropdownItem>
|
</EDropdownItem>
|
||||||
<EDropdownItem command="remove">
|
<EDropdownItem command="remove">
|
||||||
|
|||||||
5
resources/assets/js/store/state.js
vendored
5
resources/assets/js/store/state.js
vendored
@ -112,6 +112,8 @@ export default {
|
|||||||
dialogDraftTimer: {},
|
dialogDraftTimer: {},
|
||||||
dialogMsgTransfer: {time: 0},
|
dialogMsgTransfer: {time: 0},
|
||||||
dialogSseList: [],
|
dialogSseList: [],
|
||||||
|
dialogDroupWordChain: {},
|
||||||
|
dialogGroupVote: {},
|
||||||
|
|
||||||
// 搜索关键词(主要用于移动端判断滑动返回)
|
// 搜索关键词(主要用于移动端判断滑动返回)
|
||||||
messengerSearchKey: {dialog: '', contacts: ''},
|
messengerSearchKey: {dialog: '', contacts: ''},
|
||||||
@ -209,9 +211,6 @@ export default {
|
|||||||
meetingid: 0
|
meetingid: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
// 接龙
|
|
||||||
wordChain: {},
|
|
||||||
|
|
||||||
// okr窗口
|
// okr窗口
|
||||||
okrWindow: {
|
okrWindow: {
|
||||||
type: 'open',
|
type: 'open',
|
||||||
|
|||||||
@ -29,4 +29,4 @@
|
|||||||
@import "project-menu";
|
@import "project-menu";
|
||||||
@import "calendar";
|
@import "calendar";
|
||||||
@import "home-calendar";
|
@import "home-calendar";
|
||||||
@import "word-chain";
|
@import "dialog-droup-word-chain";
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.word-chain-wrapper {
|
.dialog-droup-word-chain {
|
||||||
.ivu-modal-body{
|
.ivu-modal-body{
|
||||||
max-height: calc(100vh - 365px);
|
max-height: calc(100vh - 365px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@ -57,6 +57,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: calc(100vh - 370px);
|
max-height: calc(100vh - 370px);
|
||||||
.source{
|
.source{
|
||||||
|
padding-top: 10px;
|
||||||
margin-right: 32px;
|
margin-right: 32px;
|
||||||
span{
|
span{
|
||||||
color: #84C56A;
|
color: #84C56A;
|
||||||
@ -120,7 +121,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.window-portrait {
|
body.window-portrait {
|
||||||
.word-chain-wrapper {
|
.dialog-droup-word-chain {
|
||||||
.ivu-modal-body{
|
.ivu-modal-body{
|
||||||
padding-top: 10px !important;
|
padding-top: 10px !important;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
@ -129,9 +130,4 @@ body.window-portrait {
|
|||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 640px) {
|
|
||||||
.word-chain-wrapper {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -980,7 +980,7 @@
|
|||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.expand{
|
&.expand,li:nth-last-child(2){
|
||||||
.expand{
|
.expand{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,11 @@
|
|||||||
&.ivu-icon {
|
&.ivu-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.movefont{
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user