perf: 兼容iPad端
This commit is contained in:
parent
5324861f16
commit
feed984ba8
@ -45,13 +45,14 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'isDesktop',
|
||||
'wsOpenNum',
|
||||
]),
|
||||
repoTitle() {
|
||||
return this.repoStatus == 2 ? '更新客户端' : '客户端下载';
|
||||
},
|
||||
showButton() {
|
||||
return this.repoStatus && !this.$store.state.windowMax768 && ['login', 'manage-dashboard'].includes(this.$route.name)
|
||||
return this.repoStatus && this.isDesktop && ['login', 'manage-dashboard'].includes(this.$route.name)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -520,6 +520,15 @@
|
||||
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
|
||||
|
@ -159,10 +159,10 @@ export default {
|
||||
|
||||
computed: {
|
||||
...mapState([
|
||||
'isDesktop',
|
||||
'userId',
|
||||
'cacheDialogs',
|
||||
'dialogMsgs',
|
||||
'windowMax768',
|
||||
]),
|
||||
|
||||
dialogData() {
|
||||
@ -181,7 +181,7 @@ export default {
|
||||
},
|
||||
|
||||
isAutoBottom() {
|
||||
if (this.windowMax768 && this.inputFocus) {
|
||||
if (this.inputFocus && !this.isDesktop) {
|
||||
return false;
|
||||
}
|
||||
return this.autoBottom
|
||||
@ -268,7 +268,7 @@ export default {
|
||||
text: this.msgText,
|
||||
},
|
||||
});
|
||||
if (this.windowMax768) {
|
||||
if (!this.isDesktop) {
|
||||
this.$refs.input.blur();
|
||||
}
|
||||
this.autoToBottom();
|
||||
@ -368,7 +368,7 @@ export default {
|
||||
userid: this.userId,
|
||||
msg: { },
|
||||
});
|
||||
if (this.windowMax768) {
|
||||
if (!this.isDesktop) {
|
||||
this.$refs.input.blur();
|
||||
}
|
||||
this.autoToBottom();
|
||||
|
@ -91,7 +91,7 @@
|
||||
<Draggable
|
||||
:list="columnList"
|
||||
:animation="150"
|
||||
:disabled="sortDisabled || windowMax768"
|
||||
:disabled="sortDisabled || !isDesktop"
|
||||
class="column-list"
|
||||
tag="ul"
|
||||
draggable=".column-item"
|
||||
@ -146,7 +146,7 @@
|
||||
<Draggable
|
||||
:list="column.tasks"
|
||||
:animation="150"
|
||||
:disabled="sortDisabled || windowMax768"
|
||||
:disabled="sortDisabled || !isDesktop"
|
||||
class="task-list"
|
||||
draggable=".task-draggable"
|
||||
group="task"
|
||||
@ -528,8 +528,8 @@ export default {
|
||||
|
||||
computed: {
|
||||
...mapState([
|
||||
'isDesktop',
|
||||
'windowWidth',
|
||||
'windowMax768',
|
||||
|
||||
'userId',
|
||||
'cacheDialogs',
|
||||
|
@ -61,6 +61,7 @@
|
||||
<Draggable
|
||||
:list="data.project_flow_item"
|
||||
:animation="150"
|
||||
:disabled="!isDesktop"
|
||||
class="taskflow-config-table-list-wrapper"
|
||||
tag="div"
|
||||
draggable=".column-border"
|
||||
@ -172,6 +173,7 @@
|
||||
<script>
|
||||
import Draggable from "vuedraggable";
|
||||
import UserInput from "../../../components/UserInput";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ProjectWorkflow",
|
||||
@ -199,7 +201,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
...mapState(['isDesktop'])
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
@ -30,7 +30,7 @@
|
||||
:plugins="taskPlugins"
|
||||
:options="taskOptions"
|
||||
:option-full="taskOptionFull"
|
||||
:placeholder="$L($store.state.windowMax768 ? '详细描述,选填...' : '详细描述,选填...(点击右键使用工具栏)')"
|
||||
:placeholder="$L(isDesktop ? '详细描述,选填...(点击右键使用工具栏)' : '详细描述,选填...')"
|
||||
:placeholderFull="$L('详细描述...')"
|
||||
inline/>
|
||||
</div>
|
||||
@ -232,7 +232,7 @@ export default {
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userId', 'cacheProjects', 'projectId', 'cacheColumns', 'taskPriority']),
|
||||
...mapState(['isDesktop', 'userId', 'cacheProjects', 'projectId', 'cacheColumns', 'taskPriority']),
|
||||
|
||||
taskDays() {
|
||||
const {times} = this.addData;
|
||||
|
@ -1,4 +1,7 @@
|
||||
const stateData = {
|
||||
// 是否桌面端
|
||||
isDesktop: $A.isDesktop(),
|
||||
|
||||
// 浏览器宽度
|
||||
windowWidth: window.innerWidth,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user