mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
feat: 键盘设置里面,支持设置回车发送还是按键发送
This commit is contained in:
parent
d541397594
commit
cdc7e671ce
@ -176,7 +176,7 @@ services:
|
||||
|
||||
okr:
|
||||
container_name: "dootask-okr-${APP_ID}"
|
||||
image: "kuaifan/doookr:0.0.21"
|
||||
image: "kuaifan/doookr:0.0.22"
|
||||
environment:
|
||||
TZ: "${TIMEZONE:-PRC}"
|
||||
DOO_TASK_URL: "http://${APP_IPPR}.3"
|
||||
|
||||
@ -1389,4 +1389,6 @@ APP推送
|
||||
文件上传限制
|
||||
包含消息发送的文件
|
||||
特殊设置
|
||||
打包列表
|
||||
打包列表
|
||||
使用独立的发送按钮
|
||||
开启后,键盘上的发送按钮会被替换成换行
|
||||
@ -492,6 +492,11 @@ export default {
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
separateSendButton() {
|
||||
return $A.jsonParse(window.localStorage.getItem("__keyboard:data__"))?.separate_send_button === 'open';
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
// Watch content change
|
||||
@ -663,6 +668,11 @@ export default {
|
||||
shortKey: true,
|
||||
handler: _ => {
|
||||
if (!this.isEnterSend) {
|
||||
if (this.separateSendButton) {
|
||||
const length = this.quill.getSelection(true).index;
|
||||
this.quill.insertText(length, "\r\n");
|
||||
return false;
|
||||
}
|
||||
this.onSend();
|
||||
return false;
|
||||
}
|
||||
@ -674,6 +684,11 @@ export default {
|
||||
shiftKey: false,
|
||||
handler: _ => {
|
||||
if (this.isEnterSend) {
|
||||
if (this.separateSendButton) {
|
||||
const length = this.quill.getSelection(true).index;
|
||||
this.quill.insertText(length, "\r\n");
|
||||
return false;
|
||||
}
|
||||
this.onSend();
|
||||
return false;
|
||||
}
|
||||
@ -786,7 +801,9 @@ export default {
|
||||
this.quill.insertText(length, "\r\n");
|
||||
}
|
||||
});
|
||||
this.quill.root.setAttribute('enterkeyhint', 'send')
|
||||
if (!this.separateSendButton) {
|
||||
this.quill.root.setAttribute('enterkeyhint', 'send')
|
||||
}
|
||||
})
|
||||
|
||||
// Ready event
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
</RadioGroup>
|
||||
<div class="form-tip">{{$L('是否将消息中的网络图片保存到本地服务器。')}}</div>
|
||||
</FormItem>
|
||||
<FormItem v-if="$A.isDooServer()" :label="$L('文件上传限制')" prop="fileUploadLimit">
|
||||
<FormItem :label="$L('文件上传限制')" prop="fileUploadLimit">
|
||||
<div style="width: 192px;">
|
||||
<Input type="number" number v-model="formDatum.file_upload_limit" :placeholder="$L('默认不限制')">
|
||||
<template #append>
|
||||
|
||||
@ -79,7 +79,7 @@ export default {
|
||||
{path: 'theme', name: '主题设置'},
|
||||
]
|
||||
|
||||
if (this.$Electron) {
|
||||
if (this.$Electron || this.$isEEUiApp) {
|
||||
menu.push({path: 'keyboard', name: '键盘设置', desc: ' (Beta)'})
|
||||
}
|
||||
|
||||
|
||||
@ -1,31 +1,42 @@
|
||||
<template>
|
||||
<div class="setting-item submit">
|
||||
<Form ref="formData" :model="formData" :rules="ruleData" label-width="auto" @submit.native.prevent>
|
||||
<FormItem :label="$L('截图快捷键')" prop="screenshot_key">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>Shift<div class="input-box-push">+</div><Input class="input-box-key" v-model="formData.screenshot_key" :maxlength="2"/>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新建项目')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>B
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新建任务')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>N (K)
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新会议')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>J
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('设置')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>,
|
||||
</div>
|
||||
</FormItem>
|
||||
<template v-if="this.$Electron">
|
||||
<FormItem :label="$L('截图快捷键')" prop="screenshot_key">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>Shift<div class="input-box-push">+</div><Input class="input-box-key" v-model="formData.screenshot_key" :maxlength="2"/>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新建项目')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>B
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新建任务')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>N (K)
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('新会议')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>J
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem :label="$L('设置')">
|
||||
<div class="input-box">
|
||||
{{mateName}}<div class="input-box-push">+</div>,
|
||||
</div>
|
||||
</FormItem>
|
||||
</template>
|
||||
<template>
|
||||
<FormItem :label="$L('使用独立的发送按钮')" prop="anonMessage">
|
||||
<RadioGroup v-model="formData.separate_send_button">
|
||||
<Radio label="open">{{$L('开启')}}</Radio>
|
||||
<Radio label="close">{{$L('关闭')}}</Radio>
|
||||
</RadioGroup>
|
||||
<div class="form-tip">{{$L('开启后,键盘上的发送按钮会被替换成换行')}}</div>
|
||||
</FormItem>
|
||||
</template>
|
||||
</Form>
|
||||
<div class="setting-footer">
|
||||
<Button :loading="loadIng > 0" type="primary" @click="submitForm">{{$L('保存')}}</Button>
|
||||
@ -58,6 +69,7 @@ export default {
|
||||
|
||||
formData: {
|
||||
screenshot_key: '',
|
||||
separate_send_button: 'close'
|
||||
},
|
||||
|
||||
ruleData: {
|
||||
@ -90,6 +102,7 @@ export default {
|
||||
initData() {
|
||||
this.formData = Object.assign({
|
||||
screenshot_key: '',
|
||||
separate_send_button: 'close',
|
||||
}, $A.jsonParse(window.localStorage.getItem("__keyboard:data__")) || {});
|
||||
//
|
||||
this.formData_bak = $A.cloneJSON(this.formData);
|
||||
@ -107,7 +120,6 @@ export default {
|
||||
submitForm() {
|
||||
this.$refs.formData.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.formData);
|
||||
window.localStorage.setItem("__keyboard:data__", $A.jsonStringify(this.formData));
|
||||
$A.bindScreenshotKey(this.formData);
|
||||
$A.messageSuccess('保存成功');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user