提交 ac0f8ade authored 作者: 邓文彬's avatar 邓文彬

fix(图表): 图表待完成

上级 cfe5e0c6
export default {
name: 'ElCol',
props: {
span: {
type: Number,
default: 24
},
tag: {
type: String,
default: 'view'
},
offset: Number,
pull: Number,
push: Number,
xs: [Number, Object],
sm: [Number, Object],
md: [Number, Object],
lg: [Number, Object],
xl: [Number, Object]
},
computed: {
gutter() {
let parent = this.$parent;
while (parent && parent.$options.componentName !== 'ElRow') {
parent = parent.$parent;
}
return parent ? parent.gutter : 0;
}
},
render(h) {
let classList = [];
let style = {};
if (this.gutter) {
style.paddingLeft = this.gutter / 2 + 'px';
style.paddingRight = style.paddingLeft;
}
['span', 'offset', 'pull', 'push'].forEach(prop => {
if (this[prop] || this[prop] === 0) {
classList.push(
prop !== 'span'
? `el-col-${prop}-${this[prop]}`
: `el-col-${this[prop]}`
);
}
});
['xs', 'sm', 'md', 'lg', 'xl'].forEach(size => {
if (typeof this[size] === 'number') {
classList.push(`el-col-${size}-${this[size]}`);
} else if (typeof this[size] === 'object') {
let props = this[size];
Object.keys(props).forEach(prop => {
classList.push(
prop !== 'span'
? `el-col-${size}-${prop}-${props[prop]}`
: `el-col-${size}-${props[prop]}`
);
});
}
});
return h(this.tag, {
class: ['el-col', classList],
style
}, this.$slots.default);
}
};
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
/* margin-bottom: 5px; */ /* margin-bottom: 5px; */
margin-right: 20px; margin-right: 20px;
position: relative; position: relative;
padding-left: 12px; padding-left: 4px;
line-height: 18px; line-height: 18px;
font-size: 16px; font-size: 16px;
color: #000000; color: #000000;
...@@ -85,15 +85,15 @@ ...@@ -85,15 +85,15 @@
} }
.title::before { .title::before {
content: ""; // content: "";
position: absolute; // position: absolute;
top: 50%; // top: 50%;
left: 0; // left: 0;
width: 4px; // width: 4px;
height: 90%; // height: 90%;
background: #12ccf5; // background: #12ccf5;
display: block; // display: block;
transform: translateY(-50%); // transform: translateY(-50%);
} }
.title::after { .title::after {
......
export default {
name: 'ElRow',
componentName: 'ElRow',
props: {
tag: {
type: String,
default: 'view'
},
gutter: Number,
type: String,
justify: {
type: String,
default: 'start'
},
align: String
},
computed: {
style() {
const ret = {};
if (this.gutter) {
ret.marginLeft = `-${this.gutter / 2}px`;
ret.marginRight = ret.marginLeft;
}
return ret;
}
},
render(h) {
return h(this.tag, {
class: [
'el-row',
this.justify !== 'start' ? `is-justify-${this.justify}` : '',
this.align ? `is-align-${this.align}` : '',
{ 'el-row--flex': this.type === 'flex' }
],
style: this.style
}, this.$slots.default);
}
};
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="stylesheet" href="./static/iconFont/iconfont.css"> <link rel="stylesheet" href="./static/iconFont/iconfont.css">
<link href="./static/element.css" >
<script> <script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)')) CSS.supports('top: constant(a)'))
......
...@@ -7,6 +7,17 @@ import store from './store' ...@@ -7,6 +7,17 @@ import store from './store'
import Vue from 'vue' import Vue from 'vue'
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
import ElCol from "@/components/col/index.js"
import Row from "@/components/row/index.js"
// import "@/static/element.css"
Vue.component("ElCol", ElCol);
Vue.component("ElRow", Row);
try { try {
function isPromise(obj) { function isPromise(obj) {
......
{ {
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/login/login"
},
{ {
"path": "pages/home/home", "path": "pages/home/home",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "pages/login/login"
},
{ //操作日志 { //操作日志
"path": "pages/index/operLog" "path": "pages/index/operLog"
}, },
//杭州内网机房巡检 //杭州内网机房巡检
{
"path": "pages/inspection/inspFirst"
},
{ {
"path": "pages/report/sampleTable" "path": "pages/report/sampleTable"
...@@ -32,20 +32,10 @@ ...@@ -32,20 +32,10 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "pages/inspectionContent/inspectionContent",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/shaftInspection/shaftInspection",
"style": {
"navigationBarTitleText": ""
}
} }
], ],
"globalStyle": { "globalStyle": {
"pageOrientation": "landscape", "pageOrientation": "landscape",
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<view class="tem1 padding_all_16"> <view class="tem1 padding_all_16">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value"> <view class="value">
<span>{{ item.value || 0 }}</span> <text>{{ item.value || 0 }}</text>
<span class="unit">{{ item.unit || "" }}</span> <text class="unit">{{ item.unit || "" }}</text>
<span class="upValue" v-if="item.upValue">{{ item.upValue }}</span> <text class="upValue" v-if="item.upValue">{{ item.upValue }}</text>
</view> </view>
<el-row v-if="item.children && item.children.length > 0" class="children"> <view
<el-col class="flex-row children"
v-if="item.children && item.children.length > 0"
>
<view
v-for="(child, j) in item.children" v-for="(child, j) in item.children"
:key="child.label + j" :key="child.label + j"
:span="8" :text="8"
class="el-col-8"
> >
<view class="childrenLabel"> <view class="childrenLabel">
<span :style="{ backgroundColor: child.color || '#ccc' }"></span> <text :style="{ backgroundColor: child.color || '#ccc' }"></text>
{{ child.label }} {{ child.label }}
</view> </view>
<view class="childrenValue"> <view class="childrenValue">
{{ child.value || 0 }} {{ child.value || 0 }}
</view> </view>
</el-col> </view>
</el-row> </view>
</view> </view>
</template> </template>
...@@ -73,7 +77,7 @@ export default { ...@@ -73,7 +77,7 @@ export default {
.childrenLabel { .childrenLabel {
font-size: 12px; font-size: 12px;
color: #7c7c7c; color: #7c7c7c;
span { text {
display: inline-block; display: inline-block;
width: 6px; width: 6px;
height: 6px; height: 6px;
...@@ -87,5 +91,15 @@ export default { ...@@ -87,5 +91,15 @@ export default {
color: #000000; color: #000000;
} }
} }
.el-col-8 {
width: 33.33333%;
}
.flex-row {
display: flex;
}
}
.padding_all_16 {
padding: 16px;
} }
</style> </style>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view class="tem2" :style="item.style || ''"> <view class="tem2" :style="item.style || ''">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value"> <view class="value">
<span>{{ item.value || 0 }}</span> <text>{{ item.value || 0 }}</text>
<span class="unit">{{ item.unit || "" }}</span> <text class="unit">{{ item.unit || "" }}</text>
</view> </view>
</view> </view>
</template> </template>
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<view class="tem1 padding_all_16"> <view class="tem1 padding_all_16">
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="value"> <view class="value">
<span>{{ item.value || 0 }}</span> <text>{{ item.value || 0 }}</text>
<span class="unit">{{ item.unit || "" }}</span> <text class="unit">{{ item.unit || "" }}</text>
<span class="upValue" v-if="item.upValue">{{ item.upValue }}</span> <text class="upValue" v-if="item.upValue">{{ item.upValue }}</text>
</view> </view>
</view> </view>
</template> </template>
...@@ -54,4 +54,8 @@ export default { ...@@ -54,4 +54,8 @@ export default {
} }
} }
} }
.padding_all_16 {
padding: 16px;
}
</style> </style>
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论