提交 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 @@
/* margin-bottom: 5px; */
margin-right: 20px;
position: relative;
padding-left: 12px;
padding-left: 4px;
line-height: 18px;
font-size: 16px;
color: #000000;
......@@ -85,15 +85,15 @@
}
.title::before {
content: "";
position: absolute;
top: 50%;
left: 0;
width: 4px;
height: 90%;
background: #12ccf5;
display: block;
transform: translateY(-50%);
// content: "";
// position: absolute;
// top: 50%;
// left: 0;
// width: 4px;
// height: 90%;
// background: #12ccf5;
// display: block;
// transform: translateY(-50%);
}
.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 @@
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./static/iconFont/iconfont.css">
<link href="./static/element.css" >
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
......
......@@ -7,6 +7,17 @@ import store from './store'
import Vue from 'vue'
Vue.config.productionTip = false
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 {
function isPromise(obj) {
......
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/login/login"
},
{
"path": "pages/home/home",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/login/login"
},
{ //操作日志
"path": "pages/index/operLog"
},
//杭州内网机房巡检
{
"path": "pages/inspection/inspFirst"
},
{
"path": "pages/report/sampleTable"
......@@ -32,20 +32,10 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/inspectionContent/inspectionContent",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/shaftInspection/shaftInspection",
"style": {
"navigationBarTitleText": ""
}
}
],
"globalStyle": {
"pageOrientation": "landscape",
......
......@@ -2,25 +2,29 @@
<view class="tem1 padding_all_16">
<view class="label">{{ item.label }}</view>
<view class="value">
<span>{{ item.value || 0 }}</span>
<span class="unit">{{ item.unit || "" }}</span>
<span class="upValue" v-if="item.upValue">{{ item.upValue }}</span>
<text>{{ item.value || 0 }}</text>
<text class="unit">{{ item.unit || "" }}</text>
<text class="upValue" v-if="item.upValue">{{ item.upValue }}</text>
</view>
<el-row v-if="item.children && item.children.length > 0" class="children">
<el-col
<view
class="flex-row children"
v-if="item.children && item.children.length > 0"
>
<view
v-for="(child, j) in item.children"
:key="child.label + j"
:span="8"
:text="8"
class="el-col-8"
>
<view class="childrenLabel">
<span :style="{ backgroundColor: child.color || '#ccc' }"></span>
<text :style="{ backgroundColor: child.color || '#ccc' }"></text>
{{ child.label }}
</view>
<view class="childrenValue">
{{ child.value || 0 }}
</view>
</el-col>
</el-row>
</view>
</view>
</view>
</template>
......@@ -73,7 +77,7 @@ export default {
.childrenLabel {
font-size: 12px;
color: #7c7c7c;
span {
text {
display: inline-block;
width: 6px;
height: 6px;
......@@ -87,5 +91,15 @@ export default {
color: #000000;
}
}
.el-col-8 {
width: 33.33333%;
}
.flex-row {
display: flex;
}
}
.padding_all_16 {
padding: 16px;
}
</style>
......@@ -2,8 +2,8 @@
<view class="tem2" :style="item.style || ''">
<view class="label">{{ item.label }}</view>
<view class="value">
<span>{{ item.value || 0 }}</span>
<span class="unit">{{ item.unit || "" }}</span>
<text>{{ item.value || 0 }}</text>
<text class="unit">{{ item.unit || "" }}</text>
</view>
</view>
</template>
......
......@@ -2,9 +2,9 @@
<view class="tem1 padding_all_16">
<view class="label">{{ item.label }}</view>
<view class="value">
<span>{{ item.value || 0 }}</span>
<span class="unit">{{ item.unit || "" }}</span>
<span class="upValue" v-if="item.upValue">{{ item.upValue }}</span>
<text>{{ item.value || 0 }}</text>
<text class="unit">{{ item.unit || "" }}</text>
<text class="upValue" v-if="item.upValue">{{ item.upValue }}</text>
</view>
</view>
</template>
......@@ -54,4 +54,8 @@ export default {
}
}
}
.padding_all_16 {
padding: 16px;
}
</style>
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论