全局使用windowSmall、windowLarge

This commit is contained in:
kuaifan 2022-06-06 07:16:15 +08:00
parent ce88fe426b
commit 113c58a057
55 changed files with 136 additions and 164 deletions

File diff suppressed because one or more lines are too long

View File

@ -58,7 +58,7 @@ export default {
},
computed: {
...mapState(['ws', 'userId', 'userToken', 'windowMax768']),
...mapState(['ws']),
},
watch: {
@ -153,7 +153,8 @@ export default {
windowSizeListener() {
this.$store.state.windowWidth = window.innerWidth
this.$store.state.windowHeight = window.innerHeight
this.$store.state.windowMax768 = window.innerWidth <= 768
this.$store.state.windowLarge = window.innerWidth > 768
this.$store.state.windowSmall = window.innerWidth <= 768
},
windowScrollListener() {

View File

@ -14,6 +14,7 @@ import VueClipboard from 'vue-clipboard2'
import ViewUI from 'view-design-hi';
import Language from './language/index'
import store from './store/index'
import mixin from "./store/mixin";
Vue.use(Vuex);
Vue.use(ViewUI, {
@ -98,7 +99,7 @@ Vue.prototype.goForward = function(location, isReplace) {
location = {name: location};
}
// 打开聊天窗口(移动端)
if (app.$store.state.windowMax768
if (app.$store.state.windowSmall
&& location.name === 'manage-messenger'
&& /\d+/.test(location.params.dialogId)) {
app.$store.state.dialogModalId = location.params.dialogId;
@ -143,7 +144,6 @@ $A.Platform = "web";
$A.isMainElectron = false;
$A.isSubElectron = false;
$A.isEEUiApp = isEEUiApp;
$A.isDesktop = $A.isDesktop();
$A.openLog = $A.getStorageString("log::open") === "open";
if (isElectron) {
$A.Electron = electron;
@ -158,10 +158,10 @@ Vue.prototype.$Platform = $A.Platform;
Vue.prototype.$isMainElectron = $A.isMainElectron;
Vue.prototype.$isSubElectron = $A.isSubElectron;
Vue.prototype.$isEEUiApp = $A.isEEUiApp;
Vue.prototype.$isDesktop = $A.isDesktop;
Vue.prototype.$openLog = $A.openLog;
Vue.config.productionTip = false;
Vue.mixin(mixin)
const app = new Vue({
el: '#app',

View File

@ -4,7 +4,7 @@
:placement="placement"
:effect="tooltipTheme"
:delay="delay"
:disabled="!$isDesktop || !showTooltip || disabled"
:disabled="windowSmall || !showTooltip || disabled"
:max-width="tooltipMaxWidth"
transfer>
<span ref="content" @mouseenter="handleTooltipIn" class="common-auto-tip" @click="onClick">

View File

@ -164,8 +164,6 @@
}
},
computed: {
...mapState(['userToken']),
uploadHeaders() {
return {
fd: $A.getSessionStorageString("userWsFd"),

View File

@ -1,5 +1,5 @@
<template>
<ETooltip :disabled="!$isDesktop || content == ''" :content="content">
<ETooltip :disabled="windowSmall || content == ''" :content="content">
<svg viewBox="25 25 50 50" class="common-loading">
<circle cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" class="common-path"></circle>
</svg>

View File

@ -169,8 +169,6 @@
this.content = this.value;
},
computed: {
...mapState(['userToken']),
headers() {
return {
fd: $A.getSessionStorageString("userWsFd"),

View File

@ -1,13 +1,13 @@
<template>
<div class="minder-editor-container">
<div class="quickbar">
<ETooltip :disabled="!$isDesktop" placement="top" effect="light">
<ETooltip :disabled="windowSmall" placement="top" effect="light">
<div><i class="ft icon" :title="$L('缩放')">&#xE7B3;</i></div>
<div slot="content" class="minder-editor-slider">
<Slider v-model="zoom" :min="10" :max="300"></Slider>
</div>
</ETooltip>
<ETooltip v-if="readOnly!==true" :disabled="!$isDesktop" placement="top" effect="light">
<ETooltip v-if="readOnly!==true" :disabled="windowSmall" placement="top" effect="light">
<div><i class="ft icon" :title="$L('图形')">&#xE621;</i></div>
<div slot="content">
<ul class="minder-editor-quickul mold">
@ -20,7 +20,7 @@
</ul>
</div>
</ETooltip>
<ETooltip v-if="readOnly!==true" :disabled="!$isDesktop" placement="top" effect="light">
<ETooltip v-if="readOnly!==true" :disabled="windowSmall" placement="top" effect="light">
<div><i class="ft icon" :title="$L('样式')">&#xE678;</i></div>
<div slot="content">
<ul class="minder-editor-quickul">
@ -36,7 +36,7 @@
</ul>
</div>
</ETooltip>
<ETooltip :disabled="!$isDesktop" placement="top" effect="light">
<ETooltip :disabled="windowSmall" placement="top" effect="light">
<div><i class="ft icon" :title="$L('折叠')">&#xE779;</i></div>
<div slot="content">
<ul class="minder-editor-quickul">
@ -49,10 +49,10 @@
</ul>
</div>
</ETooltip>
<ETooltip :disabled="!$isDesktop" placement="top" :content="$L('居中')">
<ETooltip :disabled="windowSmall" placement="top" :content="$L('居中')">
<div @click="minder.execCommand('camera', minder.getRoot(), 600)"><i class="ft icon">&#xE61F;</i></div>
</ETooltip>
<ETooltip :disabled="!$isDesktop" placement="top" :content="$L('移动')">
<ETooltip :disabled="windowSmall" placement="top" :content="$L('移动')">
<div @click="[minder.execCommand('Hand'),isHand=!isHand]"><i class="ft icon" :class="{active:isHand}">&#xE6CF;</i></div>
</ETooltip>
</div>

View File

@ -44,8 +44,6 @@ export default {
},
computed: {
...mapState(['windowHeight', 'windowScrollY']),
style() {
const offset = 135;
const top = Math.max(offset, this.y) + this.windowScrollY,

View File

@ -80,7 +80,7 @@ export default {
},
computed: {
...mapState(['cacheDialogs', 'userId']),
...mapState(['cacheDialogs']),
...mapGetters(['dashboardTask']),
routeName() {

View File

@ -111,7 +111,7 @@ export default {
},
computed: {
...mapState(['userToken', 'userInfo', 'themeIsDark']),
...mapState(['userInfo', 'themeIsDark']),
fileType() {
return this.getType(this.value.type);

View File

@ -24,11 +24,6 @@ export default {
this.updateTitle()
},
computed: {
...mapState(['userId']),
},
watch: {
title: {
handler() {

View File

@ -5,11 +5,11 @@
:mask-closable="false"
:footer-hide="true"
:transition-names="['', '']"
:class-name="mode === 'desktop' ? 'common-preview-image-view' : 'common-preview-image-swipe'"
:class-name="viewMode === 'desktop' ? 'common-preview-image-view' : 'common-preview-image-swipe'"
fullscreen>
<template v-if="list.length > 0">
<PreviewImageView v-if="mode === 'desktop'" :initial-index="index" :url-list="list" infinite/>
<PreviewImageSwipe v-if="mode === 'mobile'" :initial-index="index" :url-list="list" @on-destroy="show=false"/>
<PreviewImageView v-if="viewMode === 'desktop'" :initial-index="index" :url-list="list" infinite/>
<PreviewImageSwipe v-if="viewMode === 'mobile'" :initial-index="index" :url-list="list" @on-destroy="show=false"/>
</template>
</Modal>
</template>
@ -87,9 +87,7 @@ export default {
},
mode: {
type: String,
default: () => {
return $A.isDesktop ? 'desktop' : 'mobile';
}
default: null
}
},
data() {
@ -104,6 +102,14 @@ export default {
show(v) {
this.value !== v && this.$emit("input", v)
}
},
computed: {
viewMode() {
if (this.mode) {
return this.mode
}
return this.$store.state.windowLarge ? 'desktop' : 'mobile'
}
}
};
</script>

View File

@ -93,7 +93,7 @@ export default {
},
showDown() {
return this.$isDesktop && ['login', 'index', 'manage-dashboard'].includes(this.$route.name)
return this.windowLarge && ['login', 'index', 'manage-dashboard'].includes(this.$route.name)
}
},

View File

@ -166,7 +166,7 @@
$A(this.$refs.myTextarea).show();
},
computed: {
...mapState(['userToken', 'themeIsDark']),
...mapState(['themeIsDark']),
headers() {
return {

View File

@ -12,7 +12,7 @@
v-if="item.hidden !== true"
placement="top"
:key="key"
:disabled="!$isDesktop || !item.title"
:disabled="windowSmall || !item.title"
:content="item.title"
:enterable="false"
:open-delay="600">

View File

@ -3,7 +3,7 @@
v-if="user"
class="common-avatar"
:open-delay="openDelay"
:disabled="!$isDesktop || tooltipDisabled"
:disabled="windowSmall || tooltipDisabled"
:placement="tooltipPlacement">
<div slot="content" class="common-avatar-transfer">
<slot/>
@ -107,7 +107,7 @@
}
},
computed: {
...mapState(["userId", "userInfo", "userOnline", "cacheUserBasic"]),
...mapState(['userInfo', 'userOnline', 'cacheUserBasic']),
boxStyle() {
const style = {};

View File

@ -545,15 +545,6 @@
return (ua.match(/Chrome/i) + '' === 'chrome');
},
/**
* 是否桌面端
* @returns {boolean}
*/
isDesktop(){
let ua = typeof window !== 'undefined' && window.navigator.userAgent;
return !ua.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
},
/**
* 获取对象
* @param obj

View File

@ -190,7 +190,7 @@ export default {
};
},
computed: {
...mapState(['userId', 'windowWidth', 'themeMode', 'themeIsDark', 'themeList',]),
...mapState(['themeMode', 'themeIsDark', 'themeList',]),
isSoftware() {
return this.$Electron || this.$isEEUiApp;

View File

@ -192,7 +192,7 @@
<div class="operate-position" :style="operateStyles">
<Dropdown
trigger="custom"
:placement="$isDesktop ? 'bottom' : 'top'"
:placement="windowLarge ? 'bottom' : 'top'"
:visible="operateVisible"
@on-clickoutside="operateVisible = false"
transfer>
@ -498,7 +498,6 @@ export default {
computed: {
...mapState([
'userId',
'userInfo',
'userIsAdmin',
'cacheTasks',
@ -516,8 +515,6 @@ export default {
'clientNewVersion',
'cacheTaskBrowse',
'windowHeight',
]),
...mapGetters(['taskData', 'dashboardTask']),

View File

@ -88,7 +88,7 @@ export default {
},
computed: {
...mapState(['userId', 'cacheTasks', 'taskCompleteTemps', 'wsOpenNum', 'themeIsDark']),
...mapState(['cacheTasks', 'taskCompleteTemps', 'wsOpenNum', 'themeIsDark']),
...mapGetters(['transforTasks']),
@ -214,7 +214,7 @@ export default {
'month.dayname.borderLeft': '1px solid rgba(0,0,0,0)',
'month.dayname.height': '50px',
}
if (this.$isDesktop) {
if (this.windowLarge) {
this.calendarTheme = {
'common.border': '1px solid #f4f5f5',
'month.dayname.fontSize': '14px',

View File

@ -19,24 +19,24 @@
:visibleArrow="false"
placement="top"
popperClass="chat-input-emoji-popover">
<ETooltip slot="reference" ref="emojiTip" :disabled="!$isDesktop || showEmoji" placement="top" :content="$L('表情')">
<ETooltip slot="reference" ref="emojiTip" :disabled="windowSmall || showEmoji" placement="top" :content="$L('表情')">
<i class="taskfont">&#xe7ad;</i>
</ETooltip>
<ChatEmoji @on-select="onSelectEmoji"/>
</EPopover>
<ETooltip v-else ref="emojiTip" :disabled="!$isDesktop || showEmoji" placement="top" :content="$L('表情')">
<ETooltip v-else ref="emojiTip" :disabled="windowSmall || showEmoji" placement="top" :content="$L('表情')">
<i class="taskfont" @click="showEmoji=!showEmoji">&#xe7ad;</i>
</ETooltip>
</li>
<!-- @ # -->
<li>
<ETooltip placement="top" :disabled="!$isDesktop" :content="$L('选择会员')">
<ETooltip placement="top" :disabled="windowSmall" :content="$L('选择会员')">
<i class="taskfont" @click="onToolbar('user')">&#xe78f;</i>
</ETooltip>
</li>
<li>
<ETooltip placement="top" :disabled="!$isDesktop" :content="$L('选择任务')">
<ETooltip placement="top" :disabled="windowSmall" :content="$L('选择任务')">
<i class="taskfont" @click="onToolbar('task')">&#xe7d6;</i>
</ETooltip>
</li>
@ -48,7 +48,7 @@
:visibleArrow="false"
placement="top"
popperClass="chat-input-more-popover">
<ETooltip slot="reference" ref="moreTip" :disabled="!$isDesktop || showMore" placement="top" :content="$L('展开')">
<ETooltip slot="reference" ref="moreTip" :disabled="windowSmall || showMore" placement="top" :content="$L('展开')">
<i class="taskfont">&#xe790;</i>
</ETooltip>
<div v-if="recordReady" class="chat-input-popover-item" @click="onToolbar('meeting')">
@ -68,7 +68,7 @@
<!-- 发送按钮 -->
<li class="chat-send" :class="sendClass" v-touchmouse="clickSend">
<ETooltip placement="top" :disabled="!$isDesktop" :content="$L('发送')">
<ETooltip placement="top" :disabled="windowSmall" :content="$L('发送')">
<div v-if="loading">
<div class="chat-load">
<Loading/>
@ -157,10 +157,8 @@ export default {
default: false
},
enterSend: {
type: Boolean,
default: () => {
return $A.isDesktop
}
type: [String, Boolean],
default: null
},
emojiBottom: {
type: Boolean,
@ -264,7 +262,15 @@ export default {
}
},
computed: {
...mapState(['dialogInputCache', 'cacheProjects', 'cacheTasks', 'cacheUserBasic', 'userId', 'windowScrollY']),
...mapState(['dialogInputCache', 'cacheProjects', 'cacheTasks', 'cacheUserBasic']),
isEnterSend() {
if (typeof this.enterSend === "boolean") {
return this.enterSend;
} else {
return this.$store.state.windowLarge
}
},
editorStyle() {
const {wrapperWidth, editorHeight} = this;
@ -387,7 +393,7 @@ export default {
if (this.isSpecVersion) {
// ios11.0-11.3 scrollTopscrolIntoViewbug
//
} else if (!this.$isDesktop) {
} else if (this.windowSmall) {
this.timerScroll = setInterval(() => {
if (this.quill?.hasFocus()) {
$A.scrollIntoViewIfNeeded(this.$refs.editor);
@ -426,7 +432,7 @@ export default {
key: 13,
shortKey: true,
handler: _ => {
if (!this.enterSend) {
if (!this.isEnterSend) {
this.onSend();
return false;
}
@ -437,7 +443,7 @@ export default {
key: 13,
shiftKey: false,
handler: _ => {
if (this.enterSend) {
if (this.isEnterSend) {
this.onSend();
return false;
}
@ -778,7 +784,7 @@ export default {
this.quill.insertText(this.rangeIndex, element.innerHTML);
this.rangeIndex += element.innerHTML.length
element = null;
if (this.$isDesktop) {
if (this.windowLarge) {
this.showEmoji = false;
this.quill.setSelection(this.rangeIndex)
}

View File

@ -85,7 +85,7 @@ export default {
},
computed: {
...mapState(['cacheDialogs', 'userId']),
...mapState(['cacheDialogs']),
dialogData() {
return this.cacheDialogs.find(({id}) => id == this.dialogId) || {};

View File

@ -63,8 +63,6 @@ export default {
},
computed: {
...mapState(['userToken']),
headers() {
return {
fd: $A.getSessionStorageString("userWsFd"),

View File

@ -173,7 +173,7 @@ export default {
},
computed: {
...mapState(['userToken', 'userId', 'dialogMsgs', 'audioPlaying']),
...mapState(['dialogMsgs', 'audioPlaying']),
viewClass() {
const {msgData, operateAction, operateEnter} = this;

View File

@ -54,13 +54,13 @@
<ETooltip
v-if="dialogData.group_type === 'user'"
placement="top"
:disabled="!$isDesktop"
:disabled="windowSmall"
:openDelay="600"
:content="$L('群设置')">
<i class="taskfont dialog-create" @click="groupInfoShow = true">&#xe6e9;</i>
</ETooltip>
</template>
<ETooltip v-else-if="dialogData.type === 'user' && !isMyDialog" placement="top" :disabled="!$isDesktop" :content="$L('创建群组')">
<ETooltip v-else-if="dialogData.type === 'user' && !isMyDialog" placement="top" :disabled="windowSmall" :content="$L('创建群组')">
<i class="taskfont dialog-create" @click="openCreateGroup">&#xe646;</i>
</ETooltip>
</div>
@ -124,7 +124,7 @@
ref="input"
v-model="msgText"
:dialog-id="dialogId"
:emoji-bottom="!$isDesktop"
:emoji-bottom="windowSmall"
:maxlength="20000"
@on-focus="onEventFocus"
@on-blur="onEventBlur"
@ -340,11 +340,9 @@ export default {
computed: {
...mapState([
'userId',
'cacheDialogs',
'dialogMsgs',
'wsOpenNum',
'windowScrollY',
'touchBackInProgress'
]),
@ -477,7 +475,7 @@ export default {
setTimeout(this.onToBottom, Math.max(0, 100 - (new Date().getTime() - startTime)));
}).catch(_ => {});
//
if (this.$isDesktop && this.desktopAutoFocus) {
if (this.windowLarge && this.desktopAutoFocus) {
this.$nextTick(_ => {
this.$refs.input.focus()
})
@ -724,7 +722,7 @@ export default {
},
onEventEmojiVisibleChange(val) {
if (val && !this.$isDesktop) {
if (val && this.windowSmall) {
this.onToBottom();
}
},

View File

@ -56,14 +56,14 @@
</Dropdown>
<template v-if="!file.only_view">
<div class="header-icons">
<ETooltip :disabled="!$isDesktop" :content="$L('文件链接')">
<ETooltip :disabled="windowSmall" :content="$L('文件链接')">
<div class="header-icon" @click="handleClick('link')"><i class="taskfont">&#xe785;</i></div>
</ETooltip>
<EPopover v-model="historyShow" trigger="click">
<div class="file-content-history">
<FileHistory :value="historyShow" :file="file" @on-restore="onRestoreHistory"/>
</div>
<ETooltip slot="reference" ref="historyTip" :disabled="!$isDesktop || historyShow" :content="$L('历史版本')">
<ETooltip slot="reference" ref="historyTip" :disabled="windowSmall || historyShow" :content="$L('历史版本')">
<div class="header-icon"><i class="taskfont">&#xe71d;</i></div>
</ETooltip>
</EPopover>
@ -244,7 +244,7 @@ export default {
},
computed: {
...mapState(['wsMsg', 'userId']),
...mapState(['wsMsg']),
fileId() {
return this.file.id || 0

View File

@ -132,8 +132,6 @@ export default {
},
computed: {
...mapState(['userToken', 'windowHeight']),
fileId() {
return this.file.id || 0
},

View File

@ -139,10 +139,6 @@ export default {
}
},
computed: {
...mapState(['userId'])
},
watch: {
meetingShow(val) {
if (val) {

View File

@ -43,7 +43,7 @@
:current="page"
:page-size="pageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -78,9 +78,6 @@ export default {
mounted() {
this.getLists();
},
computed: {
...mapState(['windowMax768'])
},
watch: {
keyIs(v) {
if (!v) {

View File

@ -106,7 +106,7 @@ export default {
},
computed: {
...mapState(['userId', 'windowWidth', 'taskPriority']),
...mapState(['taskPriority']),
...mapGetters(['projectData']),

View File

@ -55,7 +55,7 @@
<div class="operate-position" :style="operateStyles">
<Dropdown
trigger="custom"
:placement="$isDesktop ? 'bottom' : 'top'"
:placement="windowLarge ? 'bottom' : 'top'"
:visible="operateVisible"
@on-clickoutside="operateVisible = false"
transfer>

View File

@ -55,7 +55,7 @@
:current="page"
:page-size="pageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -90,9 +90,6 @@ export default {
mounted() {
this.getLists();
},
computed: {
...mapState(['windowMax768'])
},
watch: {
keyIs(v) {
if (!v) {

View File

@ -21,7 +21,7 @@
</li>
<template v-if="!(windowWidth <= 980 || projectData.cacheParameter.chat) && projectUser.length > 0" v-for="item in projectUser">
<li v-if="item.userid === -1" class="more">
<ETooltip :disabled="!$isDesktop" :content="$L('共' + (projectData.project_user.length) + '个成员')">
<ETooltip :disabled="windowSmall" :content="$L('共' + (projectData.project_user.length) + '个成员')">
<Icon type="ios-more"/>
</ETooltip>
</li>
@ -32,7 +32,7 @@
</ul>
</li>
<li class="project-icon" @click="addTaskOpen(0)">
<ETooltip :disabled="!$isDesktop" :content="$L('添加任务')">
<ETooltip :disabled="windowSmall" :content="$L('添加任务')">
<Icon class="menu-icon" type="md-add" />
</ETooltip>
</li>
@ -96,7 +96,7 @@
<Draggable
:list="columnList"
:animation="150"
:disabled="sortDisabled || !$isDesktop"
:disabled="sortDisabled || windowSmall"
class="column-list"
tag="ul"
draggable=".column-item"
@ -151,7 +151,7 @@
<Draggable
:list="column.tasks"
:animation="150"
:disabled="sortDisabled || !$isDesktop"
:disabled="sortDisabled || windowSmall"
class="task-list"
draggable=".task-draggable"
filter=".complete"
@ -196,7 +196,7 @@
<ETooltip
v-if="item.end_at"
:class="['task-time', item.today ? 'today' : '', item.overdue ? 'overdue' : '']"
:disabled="!$isDesktop"
:disabled="windowSmall"
:open-delay="600"
:content="item.end_at">
<div v-if="!item.complete_at"><i class="taskfont">&#xe71d;</i>{{ expiresFormat(item.end_at) }}</div>
@ -537,9 +537,6 @@ export default {
computed: {
...mapState([
'windowWidth',
'userId',
'cacheDialogs',
'projectId',
@ -847,7 +844,7 @@ export default {
methods: {
showDesc() {
if (this.$isDesktop) {
if (this.windowLarge) {
return;
}
$A.modalInfo({
@ -1424,7 +1421,7 @@ export default {
if (data === 'completedTask') {
this.$store.dispatch("forgetTaskCompleteTemp", true);
} else if (data === 'chat') {
if (!this.$isDesktop) {
if (this.windowSmall) {
this.goForward({name: 'manage-messenger', params: {dialogId: this.projectData.dialog_id}});
return;
}

View File

@ -67,7 +67,7 @@
<Draggable
:list="data.project_flow_item"
:animation="150"
:disabled="!$isDesktop"
:disabled="windowSmall"
class="taskflow-config-table-list-wrapper"
tag="div"
draggable=".column-border"

View File

@ -12,13 +12,13 @@
<Radio label="daily" :disabled="id > 0 && reportData.type =='weekly'">{{ $L("日报") }}</Radio>
</RadioGroup>
<ButtonGroup v-if="id === 0" class="report-buttongroup">
<ETooltip :disabled="!$isDesktop" :content="prevCycleText" placement="bottom">
<ETooltip :disabled="windowSmall" :content="prevCycleText" placement="bottom">
<Button type="primary" @click="prevCycle">
<Icon type="ios-arrow-back" />
</Button>
</ETooltip>
<div class="report-buttongroup-vertical"></div>
<ETooltip :disabled="!$isDesktop || reportData.offset >= 0" :content="nextCycleText" placement="bottom">
<ETooltip :disabled="windowSmall || reportData.offset >= 0" :content="nextCycleText" placement="bottom">
<Button type="primary" @click="nextCycle" :disabled="reportData.offset >= 0">
<Icon type="ios-arrow-forward" />
</Button>
@ -93,9 +93,6 @@ export default {
immediate: true
},
},
computed: {
...mapState(["userId"])
},
mounted() {
//
},

View File

@ -59,7 +59,7 @@
:current="listPage"
:page-size="listPageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -98,9 +98,6 @@ export default {
mounted() {
this.getLists();
},
computed: {
...mapState(['windowMax768'])
},
watch: {
keyIs(v) {
if (!v) {

View File

@ -62,7 +62,7 @@
:current="listPage"
:page-size="listPageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -101,9 +101,6 @@ export default {
mounted() {
this.getLists();
},
computed: {
...mapState(['userId', 'windowMax768'])
},
watch: {
keyIs(v) {
if (!v) {

View File

@ -30,7 +30,7 @@
:plugins="taskPlugins"
:options="taskOptions"
:option-full="taskOptionFull"
:placeholder="$L($isDesktop ? '详细描述,选填...(点击右键使用工具栏)' : '详细描述,选填...')"
:placeholder="$L(windowLarge ? '详细描述,选填...(点击右键使用工具栏)' : '详细描述,选填...')"
:placeholderFull="$L('详细描述...')"
inline/>
</div>
@ -38,7 +38,7 @@
<Button :class="{advanced: advanced}" @click="advanced=!advanced">{{$L('高级选项')}}</Button>
<ul class="advanced-priority">
<li v-for="(item, key) in taskPriority" :key="key">
<ETooltip :disabled="!$isDesktop" :content="taskPriorityContent(item)">
<ETooltip :disabled="windowSmall" :content="taskPriorityContent(item)">
<i
class="taskfont"
:style="{color:item.color}"
@ -86,7 +86,7 @@
:transfer="false"/>
<div v-if="showAddAssist" class="task-add-assist">
<Checkbox v-model="addData.add_assist" :true-value="1" :false-value="0">{{$L('加入任务协助人员列表')}}</Checkbox>
<ETooltip :disabled="!$isDesktop" :content="$L('你不是任务负责人时建议加入任务协助人员列表')">
<ETooltip :disabled="windowSmall" :content="$L('你不是任务负责人时建议加入任务协助人员列表')">
<Icon type="ios-alert-outline" />
</ETooltip>
</div>
@ -232,7 +232,7 @@ export default {
},
computed: {
...mapState(['userId', 'cacheProjects', 'projectId', 'cacheColumns', 'taskPriority']),
...mapState(['cacheProjects', 'projectId', 'cacheColumns', 'taskPriority']),
taskDays() {
const {times} = this.addData;

View File

@ -16,7 +16,7 @@
<div v-if="parentId == 0" class="priority">
<ul>
<li v-for="(item, key) in taskPriority" :key="key">
<ETooltip v-if="active" :disabled="!$isDesktop" :content="taskPriorityContent(item)">
<ETooltip v-if="active" :disabled="windowSmall" :content="taskPriorityContent(item)">
<i
class="taskfont"
:style="{color:item.color}"
@ -55,7 +55,7 @@
<div class="priority">
<ul>
<li v-for="(item, key) in taskPriority" :key="key">
<ETooltip v-if="active" :disabled="!$isDesktop" :content="taskPriorityContent(item)">
<ETooltip v-if="active" :disabled="windowSmall" :content="taskPriorityContent(item)">
<i
class="taskfont"
:style="{color:item.color}"
@ -126,7 +126,7 @@ export default {
},
computed: {
...mapState(['userId', 'taskPriority']),
...mapState(['taskPriority']),
typeName() {
return (this.parentId > 0 ? '子任务' : '任务');

View File

@ -43,7 +43,7 @@
:current="page"
:page-size="pageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -85,7 +85,7 @@ export default {
},
computed: {
...mapState(['cacheTasks', 'windowMax768'])
...mapState(['cacheTasks'])
},
watch: {
projectId: {

View File

@ -43,7 +43,7 @@
:current="page"
:page-size="pageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -85,7 +85,7 @@ export default {
},
computed: {
...mapState(['cacheTasks', 'windowMax768'])
...mapState(['cacheTasks'])
},
watch: {
projectId: {

View File

@ -120,7 +120,7 @@
</div>
<Button slot="reference" :loading="ownerLoad > 0" class="pick" type="primary">{{$L('我要领取任务')}}</Button>
</EPopover>
<ETooltip v-if="$Electron" :disabled="!$isDesktop" :content="$L('新窗口打开')">
<ETooltip v-if="$Electron" :disabled="windowSmall" :content="$L('新窗口打开')">
<i class="taskfont open" @click="openNewWin">&#xe776;</i>
</ETooltip>
<div class="menu">
@ -548,17 +548,12 @@ export default {
computed: {
...mapState([
'userId',
'userToken',
'cacheProjects',
'cacheColumns',
'cacheTasks',
'taskContents',
'taskFiles',
'taskPriority',
'windowMax768',
'windowHeight'
]),
projectName() {
@ -614,7 +609,7 @@ export default {
},
hasOpenDialog() {
return this.taskDetail.dialog_id > 0 && !this.windowMax768;
return this.taskDetail.dialog_id > 0 && this.windowLarge;
},
dialogStyle() {
@ -746,7 +741,7 @@ export default {
this.$refs.owner && this.$refs.owner.handleClose();
this.$refs.assist && this.$refs.assist.handleClose();
this.$refs.chatInput && this.$refs.chatInput.hidePopover();
if (!this.$isDesktop) {
if (this.windowSmall) {
document.activeElement.blur();
}
}
@ -1106,7 +1101,7 @@ export default {
});
} else {
this.$nextTick(() => {
if (this.windowMax768) {
if (this.windowSmall) {
this.$store.state.dialogMsgTransfer = {
time: $A.Time() + 10,
msgText: this.msgText,

View File

@ -86,7 +86,7 @@
<ETooltip
v-if="!item.complete_at && item.end_at"
:class="['task-time', item.today ? 'today' : '', item.overdue ? 'overdue' : '']"
:disabled="!$isDesktop"
:disabled="windowSmall"
:open-delay="600"
:content="item.end_at">
<div @click="openTask(item)">{{expiresFormat(item.end_at)}}</div>

View File

@ -79,7 +79,7 @@
:current="page"
:page-size="pageSize"
:disabled="loadIng > 0"
:simple="windowMax768"
:simple="windowSmall"
:page-size-opts="[10,20,30,50,100]"
show-elevator
show-sizer
@ -157,9 +157,6 @@ export default {
mounted() {
this.getLists();
},
computed: {
...mapState(['windowMax768'])
},
watch: {
keyIs(v) {
if (!v) {

View File

@ -71,7 +71,7 @@
<i class="taskfont">&#xe71f;</i>
<em>{{item.sub_complete}}/{{item.sub_num}}</em>
</div>
<ETooltip v-if="item.end_at" :disabled="!$isDesktop" :content="item.end_at" placement="right">
<ETooltip v-if="item.end_at" :disabled="windowSmall" :content="item.end_at" placement="right">
<div :class="['item-icon', item.today ? 'today' : '', item.overdue ? 'overdue' : '']">
<i class="taskfont">&#xe71d;</i>
<em>{{expiresFormat(item.end_at)}}</em>

View File

@ -516,7 +516,7 @@ export default {
},
computed: {
...mapState(['userId', 'userToken', 'userIsAdmin', 'userInfo', 'files', 'wsOpenNum', 'windowHeight']),
...mapState(['userIsAdmin', 'userInfo', 'files', 'wsOpenNum']),
pid() {
const {folderId} = this.$route.params;

View File

@ -102,7 +102,7 @@
<div class="operate-position" :style="operateStyles">
<Dropdown
trigger="custom"
:placement="$isDesktop ? 'bottom' : 'top'"
:placement="windowLarge ? 'bottom' : 'top'"
:visible="operateVisible"
@on-clickoutside="operateVisible = false"
transfer>
@ -186,7 +186,7 @@ export default {
},
computed: {
...mapState(['userId', 'cacheDialogs', 'loadDialogs', 'windowMax768']),
...mapState(['cacheDialogs', 'loadDialogs']),
dialogId() {
const {dialogId} = this.$route.params;
@ -397,7 +397,7 @@ export default {
},
openContacts(user) {
if (this.$isDesktop) {
if (this.windowLarge) {
this.tabActive = 'dialog';
}
this.$store.dispatch("openDialogUserid", user.userid).then(({data}) => {
@ -508,7 +508,7 @@ export default {
scrollIntoActive() {
this.$nextTick(() => {
if (this.$isDesktop && this.$refs.list) {
if (this.windowLarge && this.$refs.list) {
const active = this.$refs.list.querySelector(".active")
if (active) {
$A.scrollIntoViewIfNeeded(active);

View File

@ -4,7 +4,7 @@
<ProjectPanel/>
<ProjectDialog v-if="projectData.cacheParameter.chat"/>
</template>
<ProjectList v-if="!$isDesktop" v-show="projectId === 0"/>
<ProjectList v-if="windowSmall" v-show="projectId === 0"/>
</div>
</template>

View File

@ -52,7 +52,7 @@
<Radio label="close">{{$L('关闭')}}</Radio>
</RadioGroup>
<div class="form-tip">{{$L('任务完成后自动归档。')}}</div>
<ETooltip v-if="formDatum.auto_archived=='open'" placement="right" :disabled="!$isDesktop">
<ETooltip v-if="formDatum.auto_archived=='open'" placement="right" :disabled="windowSmall">
<div class="setting-auto-day">
<Input v-model="formDatum.archived_day" type="number">
<span slot="append">{{$L('天')}}</span>

View File

@ -4,12 +4,12 @@
<Row class="setting-color">
<Col span="12">{{$L('名称')}}</Col>
<Col span="4">
<ETooltip :disabled="!$isDesktop" :content="$L('数值越小级别越高')" max-width="auto" placement="top" transfer>
<ETooltip :disabled="windowSmall" :content="$L('数值越小级别越高')" max-width="auto" placement="top" transfer>
<div><Icon class="information" type="ios-information-circle-outline" /> {{$L('级别')}}</div>
</ETooltip>
</Col>
<Col span="4">
<ETooltip :disabled="!$isDesktop" :content="$L('任务完成时间')" max-width="auto" placement="top" transfer>
<ETooltip :disabled="windowSmall" :content="$L('任务完成时间')" max-width="auto" placement="top" transfer>
<div><Icon class="information" type="ios-information-circle-outline" /> {{$L('天数')}}</div>
</ETooltip>
</Col>

View File

@ -73,7 +73,7 @@ export default {
{path: 'language', name: '语言设置'},
{path: 'password', name: '密码设置'},
]
if (!this.$isDesktop) {
if (this.windowSmall) {
menu.push({path: 'clearCache', name: '清除缓存'})
}
if (this.userIsAdmin) {
@ -105,7 +105,7 @@ export default {
watch: {
routeName: {
handler(name) {
if (name === 'manage-setting' && this.$isDesktop) {
if (name === 'manage-setting' && this.windowLarge) {
this.goForward({name: 'manage-setting-personal'}, true);
}
},
@ -151,7 +151,7 @@ export default {
classNameRoute(path, divided) {
return {
"active": this.$isDesktop && this.routeName === `manage-setting-${path}`,
"active": this.windowLarge && this.routeName === `manage-setting-${path}`,
"divided": !!divided
};
},

17
resources/assets/js/store/mixin.js vendored Normal file
View File

@ -0,0 +1,17 @@
import {mapState} from "vuex";
export default {
computed: {
...mapState([
'windowWidth',
'windowHeight',
'windowScrollY',
'windowLarge',
'windowSmall',
'userId',
'userToken',
])
}
}

View File

@ -4,8 +4,9 @@ const stateData = {
windowHeight: window.innerHeight,
windowScrollY: 0,
// 浏览器宽度≤768返回true
windowMax768: window.innerWidth <= 768,
// 浏览器窗口类型
windowLarge: window.innerWidth > 768, // 大窗口
windowSmall: window.innerWidth <= 768, // 小窗口
// 播放中的音频地址
audioPlaying: null,

File diff suppressed because one or more lines are too long