whychdw
2020-11-25 5eefa71ba75f60b8be81dd66f19310b38e6c6119
修改面板
2个文件已添加
8个文件已修改
164 ■■■■■ 已修改文件
src/assets/js/const/const_font.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/const/index.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PageHeader.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/indexPanel/InfoPanel.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/global/common.js 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/HomeList.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/HomeList.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/theme.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/const/const_font.js
New file
@@ -0,0 +1,3 @@
export default {
    base: 20,
}
src/assets/js/const/index.js
@@ -7,6 +7,7 @@
import const_curing from "@/assets/js/const/const_curing";
import const_plan from "@/assets/js/const/const_plan";
import const_outline from "@/assets/js/const/const_outline";
import const_font from "@/assets/js/const/const_font";
export {
    const_9100,
    const_61850,
@@ -16,5 +17,6 @@
    const_battGroup,
    const_curing,
    const_plan,
    const_outline
    const_outline,
    const_font
};
src/components/PageHeader.vue
@@ -681,12 +681,11 @@
        padding-left: 18px;
        display: flex;
        align-items: center;
        margin-bottom: 6px;
    }
    .header-info-item {
        display: inline-block;
        min-width: 85px;
        min-width: 85Px;
        padding-top: 4px;
        padding-bottom: 2px;
    }
src/components/indexPanel/InfoPanel.vue
@@ -142,12 +142,12 @@
<style scoped>
    .map-panel-content {
        width: 300px;
        width: 300Px;
    }
    .content-item {
        padding: 4px;
        font-size: 12px;
        padding: 4Px;
        font-size: 12Px;
    }
    .content-item-nowrap {
@@ -155,6 +155,6 @@
    }
    .content-detail {
        margin-left: 8px;
        margin-left: 8Px;
    }
</style>
src/global/common.js
New file
@@ -0,0 +1,47 @@
import store from "@/store";
import {
    const_font
} from '@/assets/js/const'
//格式化时间
Date.prototype.format = function(format) {
    var o = {
        "M+": this.getMonth() + 1, //month
        "d+": this.getDate(), //day
        "h+": this.getHours(), //hour
        "m+": this.getMinutes(), //minute
        "s+": this.getSeconds(), //second
        "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
        "S": this.getMilliseconds() //millisecond
    };
    if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
        (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                RegExp.$1.length == 1 ? o[k] :
                    ("00" + o[k]).substr(("" + o[k]).length));
    return format;
};
// 对toFixed数字保留位数二次封装(ps:toFixed返回的是字符串)
Number.prototype.toHold = function(value) {
    var hold = this.toFixed(value);
    hold = Number(hold);
    return hold;
};
/* eslint-disable */
;(function(doc, win) {
    let docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function() {
            let clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            let fontSize = const_font.base * (clientWidth / 1920);
            docEl.style.fontSize = fontSize + 'px';
            store.dispatch('theme/changeFontTimes', fontSize/const_font.base);
        };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
src/main.js
@@ -39,33 +39,7 @@
// 引入vuex
import store from './store'
//格式化时间
Date.prototype.format = function(format) {
    var o = {
        "M+": this.getMonth() + 1, //month
        "d+": this.getDate(), //day
        "h+": this.getHours(), //hour
        "m+": this.getMinutes(), //minute
        "s+": this.getSeconds(), //second
        "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
        "S": this.getMilliseconds() //millisecond
    };
    if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
        (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                RegExp.$1.length == 1 ? o[k] :
                ("00" + o[k]).substr(("" + o[k]).length));
    return format;
};
// 对toFixed数字保留位数二次封装(ps:toFixed返回的是字符串)
Number.prototype.toHold = function(value) {
    var hold = this.toFixed(value);
    hold = Number(hold);
    return hold;
};
import "./global/common"
/**
 * @注册一个全局方法储存skin方法
@@ -87,22 +61,7 @@
        }
    }
    return storage.setItem(key, data);
}
/* eslint-disable */
;(function(doc, win) {
    let docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function() {
            let clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            docEl.style.fontSize = 20 * (clientWidth / 1920) + 'px';
        };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
};
new Vue({
    router,
src/pages/HomeList.vue
@@ -3,7 +3,7 @@
    titleLeft
    toggle
    @toggleChange="toggleChange" 
    style="width:320px">
    class="context-box-w">
        <flex-layout>
            <div slot="header">
                <el-select 
@@ -213,6 +213,9 @@
</script>
<style scoped>
.context-box-w {
    width: 320px;
}
.box-tools {
  width: 200px;
  text-align: right;
src/pages/dataTest/HomeList.vue
@@ -2,9 +2,8 @@
    <content-box title="站点列表"
    titleLeft
    toggle
    @toggleChange="toggleChange"
    style="width:320px"
    class="siteList">
    @toggleChange="toggleChange"
    class="siteList context-box-w">
        <box-tools slot="box-tools" :batt="batt"></box-tools>
        <flex-layout>
            <div slot="header">
@@ -294,6 +293,9 @@
</script>
<style scoped>
.context-box-w {
    width: 320px;
}
.box-tools {
  width: 200px;
  text-align: right;
src/pages/index.vue
@@ -1058,18 +1058,18 @@
        position: absolute;
        background-color: #ffffff;
        color: rgb(0, 0, 0);
        border: 1px solid #999;
        border: 1Px solid #999;
    }
    .infoPanel .infoPanel-Title {
        border-bottom: 1px solid #ccc;
        height: 31px;
        line-height: 30px;
        border-bottom: 1Px solid #ccc;
        height: 31Px;
        line-height: 30Px;
        background-color: #f9f9f9;
        overflow: hidden;
        height: 30px;
        padding: 0 5px;
        font-size: 12px;
        height: 30Px;
        padding: 0 5Px;
        font-size: 12Px;
        position: relative;
    }
@@ -1077,19 +1077,19 @@
        background: url('../assets/images/iw_close1d3.gif') 0 0 no-repeat;
        background-size: 100% 100%;
        position: absolute;
        top: 9px;
        right: 12px;
        width: 10px;
        height: 10px;
        top: 9Px;
        right: 12Px;
        width: 10Px;
        height: 10Px;
        -moz-user-select: none;
        overflow: hidden;
        cursor: pointer;
        line-height: 9999px;
        line-height: 9999Px;
        z-index: 10000;
    }
    .infoPanel .infoPanel-center {
        padding: 3px 5px;
        padding: 3Px 5Px;
        overflow-x: auto;
        overflow-y: hidden;
    }
@@ -1099,10 +1099,10 @@
        display: block;
        z-index: 5;
        position: absolute;
        bottom: -31px;
        width: 58px;
        height: 31px;
        left: 125px;
        bottom: -31Px;
        width: 58Px;
        height: 31Px;
        left: 125Px;
        background: url('../assets/images/iw_tail.png') 0 0 no-repeat;
        background-size: 100% 100%;
    }
src/store/modules/theme.js
@@ -5,16 +5,23 @@
    state() {
        return {
            themeName: "",
            fontTimes: 1,
        }
    },
    mutations: {
        changeThemeName(state, name) {
            state.themeName = name;
        },
        changeFontTimes(state, fontTimes) {
            state.fontTimes = fontTimes;
        }
    },
    actions: {
        changeThemeName(context, name) {
            context.commit('changeThemeName', name);
        },
        changeFontTimes(context, fontTimes) {
            context.commit('changeFontTimes', fontTimes);
        }
    },
}