diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php index aa911edbe..415916d20 100755 --- a/app/Http/Controllers/Api/DialogController.php +++ b/app/Http/Controllers/Api/DialogController.php @@ -1991,4 +1991,71 @@ class DialogController extends AbstractController } return Base::retSuccess('success', $dialog); } + + /** + * @api {post} api/dialog/msg/wordchain 15. 发送接龙消息 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup dialog + * @apiName msg__wordchain + * + * @apiParam {Number} dialog_id 对话ID + * @apiParam {String} uuid 接龙ID + * @apiParam {String} text 接龙内容 + * @apiParam {Array} list 接龙列表 + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function msg__wordchain() + { + $user = User::auth(); + // + $dialog_id = intval(Request::input('dialog_id')); + $uuid = trim(Request::input('uuid')); + $text = trim(Request::input('text')); + $list = Request::input('list'); + // + $result = []; + // + WebSocketDialog::checkDialog($dialog_id); + $strlen = mb_strlen($text); + $noimglen = mb_strlen(preg_replace("/]*?>/i", "", $text)); + if ($strlen < 1) { + return Base::retError('内容不能为空'); + } + if ($noimglen > 200000) { + return Base::retError('内容最大不能超过200000字'); + } + // + $userid = $user->userid; + if($uuid){ + $dialogMsg = WebSocketDialogMsg::whereDialogId($dialog_id) + ->whereType('word-chain') + ->orderByDesc('created_at') + ->where('msg','like',"%$uuid%") + ->value('msg'); + $list = array_reverse(array_merge($dialogMsg['list'] ?? [], $list)); + $list = array_reduce($list, function ($result, $item) { + $fieldValue = $item['id']; // 指定字段名 + if(!isset($result[$fieldValue])) { + $result[$fieldValue] = $item; + } + return $result; + }, []); + $list = array_reverse(array_values($list)); + } + // + $msgData = [ + 'text' => $text, + 'list' => $list, + 'userid' => $userid, + 'uuid' => $uuid ?: Base::generatePassword(36), + ]; + $result = WebSocketDialogMsg::sendMsg(null, $dialog_id, 'word-chain', $msgData, $user->userid); + // + return $result; + } } diff --git a/language/original-web.txt b/language/original-web.txt index 0bfe56060..ec592cbcb 100644 --- a/language/original-web.txt +++ b/language/original-web.txt @@ -1431,3 +1431,14 @@ APP推送 状态 协助人 未变更移动项 +发起接龙 +由 +发起接龙,参与接龙目前共(*)人 +可填写接龙格式 +重复内容将不再计入接龙结果 +返回编辑 +继续发送 +例 +接龙结果 +选择群组发起接龙 +来自 diff --git a/public/css/fonts/taskfont/iconfont.ttf b/public/css/fonts/taskfont/iconfont.ttf index 05c4de074..003d05467 100644 Binary files a/public/css/fonts/taskfont/iconfont.ttf and b/public/css/fonts/taskfont/iconfont.ttf differ diff --git a/public/css/fonts/taskfont/iconfont.woff b/public/css/fonts/taskfont/iconfont.woff index ea29aae3b..24052176c 100644 Binary files a/public/css/fonts/taskfont/iconfont.woff and b/public/css/fonts/taskfont/iconfont.woff differ diff --git a/public/css/fonts/taskfont/iconfont.woff2 b/public/css/fonts/taskfont/iconfont.woff2 index 562aae244..244be81ff 100644 Binary files a/public/css/fonts/taskfont/iconfont.woff2 and b/public/css/fonts/taskfont/iconfont.woff2 differ diff --git a/public/images/application/word-chain.svg b/public/images/application/word-chain.svg new file mode 100644 index 000000000..c9aa05f06 --- /dev/null +++ b/public/images/application/word-chain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/assets/js/components/ChainReaction.vue b/resources/assets/js/components/ChainReaction.vue deleted file mode 100644 index 03dbc48ce..000000000 --- a/resources/assets/js/components/ChainReaction.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/resources/assets/js/components/UserSelect.vue b/resources/assets/js/components/UserSelect.vue index 2d7115c3f..20e0b3cd8 100755 --- a/resources/assets/js/components/UserSelect.vue +++ b/resources/assets/js/components/UserSelect.vue @@ -30,7 +30,7 @@ ({{selects.length}}/{{multipleMax}}) -
+
{{$L('多选')}}
@@ -145,19 +145,18 @@ @@ -336,6 +335,16 @@ export default { type: Boolean, default: true }, + // 强制单选 + forcedRadio: { + type: Boolean, + default: false + }, + // 只显示群组 + group: { + type: Boolean, + default: false + }, // 提交前的回调 beforeSubmit: Function @@ -379,7 +388,7 @@ export default { }, isWhole: { handler(value) { - if (value) { + if (value || this.group) { this.switchActive = 'recent'; } else { @@ -392,6 +401,9 @@ export default { if (value) { this.searchBefore(); this.showMultiple = this.multipleChoice + if(this.forcedRadio){ + this.showMultiple = false; + } } else { this.searchKey = ""; @@ -413,7 +425,7 @@ export default { return windowWidth < 576; }, isWhole({ projectId, noProjectId, dialogId }) { - return projectId === 0 && noProjectId === 0 && dialogId === 0; + return projectId === 0 && noProjectId === 0 && dialogId === 0 && !this.group; }, lists({ switchActive, searchKey, recents, contacts, projects }) { switch (switchActive) { @@ -528,6 +540,9 @@ export default { }, searchRecent() { this.recents = this.cacheDialogs.filter(dialog => { + if(this.group && dialog.type != 'group'){ + return false; + } if (dialog.name === undefined || dialog.dialog_delete === 1) { return false; } diff --git a/resources/assets/js/components/WordChain.vue b/resources/assets/js/components/WordChain.vue new file mode 100644 index 000000000..3ea471ddd --- /dev/null +++ b/resources/assets/js/components/WordChain.vue @@ -0,0 +1,226 @@ + + + diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index f590666be..ecf1d6b98 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -265,7 +265,7 @@ - + @@ -293,7 +293,7 @@ import ApproveExport from "./manage/components/ApproveExport"; import notificationKoro from "notification-koro1"; import {Store} from "le5le-store"; import MicroApps from "../components/MicroApps.vue"; -import ChainReaction from "../components/ChainReaction.vue"; +import WordChain from "../components/WordChain.vue"; export default { components: { @@ -313,7 +313,7 @@ export default { TeamManagement, ProjectArchived, MicroApps, - ChainReaction + WordChain }, directives: {longpress}, data() { diff --git a/resources/assets/js/pages/manage/application.vue b/resources/assets/js/pages/manage/application.vue index 56645bc6a..43f92cff2 100644 --- a/resources/assets/js/pages/manage/application.vue +++ b/resources/assets/js/pages/manage/application.vue @@ -189,6 +189,19 @@ + + + @@ -279,6 +292,8 @@ export default { scanLoginShow: false, scanLoginLoad: false, scanLoginCode: '', + // + sendData: [] } }, activated() { @@ -311,7 +326,7 @@ export default { { value: "signin", label: "签到" }, { value: "meeting", label: "会议" }, { value: "calendar", label: "日历" }, - { value: "jielong", label: "接龙" }, + { value: "word-chain", label: "接龙" }, ]; // wap模式 let appApplyList = this.windowOrientation != 'portrait' ? ( @@ -401,8 +416,9 @@ export default { case 'scan': $A.eeuiAppScan(this.scanResult); return; - case 'jielong': - // DOTO + case 'word-chain': + this.sendData = []; + this.$refs.wordChain.onSelection() return; } this.$emit("on-click", item.value) @@ -511,7 +527,7 @@ export default { this.scanLoginLoad = false }); }, - // 打开明显 + // 打开明细 openDetail(desc){ $A.modalInfo({ content: desc, @@ -532,6 +548,27 @@ export default { }) }, }); + }, + // + onWordChain(){ + const dialog_id = Number(this.sendData[0].replace('d:', '')) + if(this.windowPortrait){ + this.$store.dispatch("openDialog", dialog_id ).then(() => { + this.$store.state.wordChain = { + type: 'create', + dialog_id: dialog_id + } + }) + }else{ + this.goForward({ name: 'manage-messenger', params: { dialog_id: dialog_id}}); + setTimeout(()=>{ + this.$store.state.wordChain = { + type: 'create', + dialog_id: dialog_id + } + },100) + } + } } } diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index 48d642ffc..e18a0c0e2 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -107,7 +107,7 @@ {{$L('全屏输入')}}
- + {{$L('接龙')}}
@@ -500,7 +500,7 @@ export default { separateSendButton() { return $A.jsonParse(window.localStorage.getItem("__keyboard:data__"))?.separate_send_button === 'open'; }, - + }, watch: { // Watch content change @@ -1234,7 +1234,7 @@ export default { break; case 'chain-reaction': - this.$store.state.chainReaction = { + this.$store.state.wordChain = { type: 'create', dialog_id: this.dialogId } diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index bfaec147a..4e092e47b 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -66,6 +66,17 @@ + +
+

+                    
    +
  • + {{ $L('例') }} {{ item.text }} + {{index}}. {{item.text}} +
  • +
  • {{ $L('参与接龙') }}>
  • +
+
@@ -504,6 +515,14 @@ export default { onShowEmojiUser(item) { this.$emit("on-show-emoji-user", item) }, + + onWordChain(){ + this.$store.state.wordChain = { + type: 'participate', + dialog_id: this.msgData.dialog_id, + msgData: this.msgData, + } + } } } diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 09ac67828..b1b324da9 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -256,7 +256,7 @@ {{ $L(item.label) }} -
  • +
  • {{ $L('转发') }}
  • diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js index 3690d84c2..ac274edf6 100644 --- a/resources/assets/js/store/state.js +++ b/resources/assets/js/store/state.js @@ -210,7 +210,7 @@ export default { }, // 接龙 - chainReaction: {}, + wordChain: {}, // okr窗口 okrWindow: { diff --git a/resources/assets/sass/pages/components/_.scss b/resources/assets/sass/pages/components/_.scss index 85ee4e306..e586845fb 100755 --- a/resources/assets/sass/pages/components/_.scss +++ b/resources/assets/sass/pages/components/_.scss @@ -29,4 +29,4 @@ @import "project-menu"; @import "calendar"; @import "home-calendar"; -@import "chain-reaction"; +@import "word-chain"; diff --git a/resources/assets/sass/pages/components/chain-reaction.scss b/resources/assets/sass/pages/components/chain-reaction.scss deleted file mode 100644 index f81d5798f..000000000 --- a/resources/assets/sass/pages/components/chain-reaction.scss +++ /dev/null @@ -1,14 +0,0 @@ -.chain-reaction-wrapper { - -} - -body.window-portrait { - .chain-reaction-wrapper { - - } - @media (max-width: 640px) { - .chain-reaction-wrapper { - - } - } -} diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index 9c394c3f5..6d629c746 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -956,6 +956,25 @@ text-decoration: underline; color: $primary-title-color; } + + .content-word-chain{ + ul{ + list-style-type:none; + margin-top: 20px; + li{ + margin-top: 5px; + } + li.participate{ + cursor: pointer; + margin-top: 10px; + color: #0bc037; + >span{ + font-size: 12px; + margin-left: 2px; + } + } + } + } } .dialog-emoji { @@ -1205,6 +1224,14 @@ .content-unknown { color: #ffffff; } + + .content-word-chain{ + ul{ + li.participate{ + color: #23241f; + } + } + } } .dialog-emoji { diff --git a/resources/assets/statics/public/css/fonts/taskfont/iconfont.ttf b/resources/assets/statics/public/css/fonts/taskfont/iconfont.ttf index 05c4de074..003d05467 100644 Binary files a/resources/assets/statics/public/css/fonts/taskfont/iconfont.ttf and b/resources/assets/statics/public/css/fonts/taskfont/iconfont.ttf differ diff --git a/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff b/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff index ea29aae3b..24052176c 100644 Binary files a/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff and b/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff differ diff --git a/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff2 b/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff2 index 562aae244..244be81ff 100644 Binary files a/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff2 and b/resources/assets/statics/public/css/fonts/taskfont/iconfont.woff2 differ diff --git a/resources/assets/statics/public/images/application/word-chain.svg b/resources/assets/statics/public/images/application/word-chain.svg new file mode 100644 index 000000000..c9aa05f06 --- /dev/null +++ b/resources/assets/statics/public/images/application/word-chain.svg @@ -0,0 +1 @@ + \ No newline at end of file