From b64d4fd96fbebca8a0c77c79a5b3a7b6ceba9e74 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 19 Apr 2025 07:40:10 +0800 Subject: [PATCH] no message --- package.json | 2 +- .../assets/js/components/DropdownMenu.vue | 17 +++++++++-------- resources/assets/js/components/ImgUpload.vue | 4 ++-- .../manage/components/ChatInput/index.vue | 13 +++++++------ .../pages/manage/components/DialogWrapper.vue | 14 ++++++++------ .../js/pages/manage/components/TaskAdd.vue | 4 ++-- .../js/pages/manage/components/TaskDetail.vue | 19 ++++++++++--------- resources/assets/js/store/mutations.js | 5 +++++ .../sass/pages/components/task-detail.scss | 4 ---- 9 files changed, 44 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index b79b118f9..4b3639449 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dayjs": "^1.11.13", "dexie": "^3.2.3", "echarts": "^5.2.2", - "element-sea": "^2.15.10-7", + "element-sea": "^2.15.10-8", "file-loader": "^6.2.0", "highlight.js": "^11.7.0", "inquirer": "^8.2.0", diff --git a/resources/assets/js/components/DropdownMenu.vue b/resources/assets/js/components/DropdownMenu.vue index b60288a9b..85244808e 100644 --- a/resources/assets/js/components/DropdownMenu.vue +++ b/resources/assets/js/components/DropdownMenu.vue @@ -10,17 +10,16 @@ @visible-change="visibleChange">
-
  • +
    • -
      -
      {{item.label}}
      +
      +
      {{language ? $L(item.label) : item.label}}
      @@ -40,13 +39,14 @@ export default { visible: false, list: [], // 数据列表: [{label: '', value: ''}] - active: '', // 当前选中的值 size: 'small', // 下拉框大小 + active: '', // 当前选中的值 activeClick: false, // 当前选中的值是否可以被点击 onUpdate: null, // 选中后的回调函数 scrollHide: true, // 滚动立即隐藏 - tickShow: true, // 是否显示打勾 + tickShow: true, // 是否显示打勾(默认为:true,如果 active === undefined 默认为:false) maxHeight: 0, // 滚动区域最大高度 + language: true, // 是否国际化 item.label element: null, target: null, @@ -83,13 +83,14 @@ export default { height: `${eventRect.height}px`, } this.list = data.list; - this.active = data.active && this.list.find(item => item.value === data.active) ? data.active : ''; this.size = ['small', 'medium', 'large'].includes(data.size) ? data.size : 'small'; + this.active = data.active && this.list.find(item => item.value === data.active) ? data.active : ''; this.activeClick = typeof data.activeClick === "boolean" ? data.activeClick : false; this.onUpdate = typeof data.onUpdate === "function" ? data.onUpdate : null; this.scrollHide = typeof data.scrollHide === "boolean" ? data.scrollHide : true; - this.tickShow = typeof data.tickShow === "boolean" ? data.tickShow : true; + this.tickShow = typeof data.tickShow === "boolean" ? data.tickShow : (typeof data.active !== "undefined"); this.maxHeight = typeof data.maxHeight === "number" ? data.maxHeight : 0; + this.language = typeof data.language === "boolean" ? data.language : true; // this.$refs.icon.focus(); this.show(); diff --git a/resources/assets/js/components/ImgUpload.vue b/resources/assets/js/components/ImgUpload.vue index bb5088c3f..0a83b6c50 100755 --- a/resources/assets/js/components/ImgUpload.vue +++ b/resources/assets/js/components/ImgUpload.vue @@ -240,7 +240,7 @@ export default { } ]) } - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, onUpdate: async (act) => { @@ -259,7 +259,7 @@ export default { break; } } - } + }) }, handleView(item) { //查看 diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index b2e361fa6..ce1172f47 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -1572,22 +1572,23 @@ export default { if (type === 'transcription') { // 语音转文字 list.unshift(...[ - {label: '选择识别语言', value: '', disabled: true}, - {label: '自动识别', value: '', divided: true}, + {label: this.$L('选择识别语言'), value: '', disabled: true}, + {label: this.$L('自动识别'), value: '', divided: true}, ]) active = this.cacheTranscriptionLanguage } else { // 翻译 list.unshift(...[ - {label: '选择翻译结果', value: '', disabled: true}, - {label: '不翻译结果', value: '', divided: true}, + {label: this.$L('选择翻译结果'), value: '', disabled: true}, + {label: this.$L('不翻译结果'), value: '', divided: true}, ]) active = this.recordConvertTranslate } - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, active, + language: false, onUpdate: async (language) => { if (type === 'transcription') { await this.$store.dispatch('setTranscriptionLanguage', language) @@ -1596,7 +1597,7 @@ export default { } this.convertRecord() } - } + }) }, convertSend(type) { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 8731227e2..da5fdec94 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -1874,10 +1874,11 @@ export default { if (!active && item.config?.model) { active = item.config.model } - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, active, + language: false, onUpdate: async model => { this.dialogAiModel = [ ...this.dialogAiModel.filter(({dialog_id}) => dialog_id !== this.dialogId), @@ -1885,7 +1886,7 @@ export default { ] await $A.IDBSet('dialogAiModel', this.dialogAiModel) } - } + }) break; // 开启新会话 @@ -3541,20 +3542,21 @@ export default { value: item })) list.push(...[ - {label: '重新翻译', value: 'retranslation', divided: true}, - {label: '隐藏翻译', value: 'hidden'}, + {label: this.$L('重新翻译'), value: 'retranslation', divided: true}, + {label: this.$L('隐藏翻译'), value: 'hidden'}, ]) - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, active: this.cacheTranslationLanguage, + language: false, onUpdate: async (language) => { if (languageList[language]) { await this.$store.dispatch("setTranslationLanguage", language); } this.onTranslation(language); } - } + }) }, onCopy(data) { diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue index b82c827c2..d98f50e49 100644 --- a/resources/assets/js/pages/manage/components/TaskAdd.vue +++ b/resources/assets/js/pages/manage/components/TaskAdd.vue @@ -555,7 +555,7 @@ export default { {label: '任务人员', value: 2}, {label: '指定成员', value: 3}, ]; - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, size: 'large', @@ -563,7 +563,7 @@ export default { onUpdate: (value) => { this.dropVisible(value) } - } + }) }, visibleUserSelectShowChange(isShow){ diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 06f9c1f01..4e46d87f0 100755 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -1917,7 +1917,7 @@ export default { {label: '任务人员', value: 2}, {label: '指定成员', value: 3}, ]; - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, size: 'large', @@ -1925,7 +1925,7 @@ export default { onUpdate: (value) => { this.dropVisible(value) } - } + }) }, showAtDropdown(event){ @@ -1935,14 +1935,14 @@ export default { {label: '修改时间', value: 2}, {label: '清除时间', value: 3}, ]; - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, size: 'large', onUpdate: (value) => { this.dropDeadline(value) } - } + }) }, visibleUserSelectShowChange(isShow){ @@ -2033,16 +2033,16 @@ export default { const list = [ {label: '查看附件', value: 1}, {label: '下载附件', value: 2}, - {label: '删除附件', value: 3, className: 'task-calc-warn-text'}, + {label: '删除附件', value: 3, style: {color:'#FF7070'}}, ]; - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list, size: 'large', onUpdate: (value) => { this.dropFile(value) } - } + }) }, dropFile(command) { @@ -2113,16 +2113,17 @@ export default { if (this.msgTypes.length === 0) { return } - this.$store.state.menuOperation = { + this.$store.commit('menu/operation', { event, list: this.msgTypes, active: this.msgType, activeClick: true, + language: false, onUpdate: (type) => { this.navActive = 'dialog' this.$refs.dialog?.onMsgType(type) } - } + }) }, autoScrollInto() { diff --git a/resources/assets/js/store/mutations.js b/resources/assets/js/store/mutations.js index 7dba81318..5951f3301 100644 --- a/resources/assets/js/store/mutations.js +++ b/resources/assets/js/store/mutations.js @@ -293,4 +293,9 @@ export default { 'longpress/clear': function(state) { state.longpressData = {type: '', data: null, element: null} }, + + // 通用菜单 + 'menu/operation': function(state, data) { + state.menuOperation = data + }, } diff --git a/resources/assets/sass/pages/components/task-detail.scss b/resources/assets/sass/pages/components/task-detail.scss index c746c126e..c84205679 100644 --- a/resources/assets/sass/pages/components/task-detail.scss +++ b/resources/assets/sass/pages/components/task-detail.scss @@ -947,10 +947,6 @@ } } -.task-calc-warn-text { - color: $flow-status-start-color !important; -} - body.window-portrait { .task-detail { .task-info {