Browse Source

样式修改

master
aBin 5 years ago
parent
commit
04251286c2
  1. 6
      src/components/Duration/Duration.js
  2. 41
      src/components/LoadCells/LoadCells.vue
  3. 16
      src/components/Panel/Panel.vue
  4. 37
      src/components/RFID/RFID.vue
  5. 8
      src/components/Sensor/Sensor.js
  6. 2
      src/config/api.js
  7. 2
      src/mixins/socket.js

6
src/components/Duration/Duration.js

@ -16,7 +16,7 @@ const mixin = {
legend: { legend: {
x: 'center', x: 'center',
y: 'bottom', y: 'bottom',
data: ['我院记录', '国际水准', '当前数据'], data: ['我院标准', '国际标准', '当前数据'],
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
color: '#ccc', //标题颜色 color: '#ccc', //标题颜色
@ -80,7 +80,7 @@ const mixin = {
}, },
series: [ series: [
{ {
name: '我院记录', name: '我院标准',
type: 'line', type: 'line',
connectNulls: true, connectNulls: true,
stack: '总量', stack: '总量',
@ -95,7 +95,7 @@ const mixin = {
// }, // },
}, },
{ {
name: '国际准', name: '国际准',
type: 'line', type: 'line',
connectNulls: true, connectNulls: true,
stack: '总量', stack: '总量',

41
src/components/LoadCells/LoadCells.vue

@ -1,20 +1,11 @@
<template> <template>
<!-- <div>数据统计组件</div> --> <!-- <div>数据统计组件</div> -->
<div class="flex-1 flex-column"> <div class="flex-1 flex-column">
<div <div :key="item.id" class="flex-1 flex-nowrap mt-2 align-center justify-space-between box" v-for="item in lists">
:key="item.id"
class="flex-1 flex-nowrap mt-2 align-center justify-space-between box"
v-for="item in lists"
>
<div class="title">{{ item.name }}</div> <div class="title">{{ item.name }}</div>
<div class="number flex-1"> <div class="number flex-1">
<div <div :key="a" :style="item.number[a - 1] === '.' ? 'padding-right:5%' : ''" class="num_item" v-for="a in 7">
:key="a" <span>{{ item.number[a - 1] ? item.number[a - 1] : 0 }}</span>
:style="item.number[a-1] === '.' ? 'padding-right:5%' : '' "
class="num_item"
v-for="a in 7"
>
<span>{{ item.number[a-1] ? item.number[a-1] : 0 }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -41,7 +32,7 @@ export default {
{ {
id: 3, id: 3,
name: '称重传感器3', name: '称重传感器3',
number: ['0', '.', '0'], number: ['0', '0', '.', '0'],
}, },
{ {
id: 4, id: 4,
@ -58,22 +49,46 @@ export default {
weighSensor1: { weighSensor1: {
handler(value) { handler(value) {
this.lists[0].number = value.split(''); this.lists[0].number = value.split('');
if (this.lists[0].number.length < 7) {
var num = 7 - this.lists[0].number.length;
for (var a = 0; a < num; a++) {
this.lists[0].number.unshift('0');
}
}
}, },
deep: true, deep: true,
}, },
weighSensor2(value) { weighSensor2(value) {
if (value) { if (value) {
this.lists[1].number = value.split(''); this.lists[1].number = value.split('');
if (this.lists[1].number.length < 7) {
var num = 7 - this.lists[1].number.length;
for (var a = 0; a < num; a++) {
this.lists[1].number.unshift('0');
}
}
} }
}, },
weighSensor3(value) { weighSensor3(value) {
if (value) { if (value) {
this.lists[2].number = value.split(''); this.lists[2].number = value.split('');
if (this.lists[2].number.length < 7) {
var num = 7 - this.lists[2].number.length;
for (var a = 0; a < num; a++) {
this.lists[2].number.unshift('0');
}
}
} }
}, },
weighSensor4(value) { weighSensor4(value) {
if (value) { if (value) {
this.lists[3].number = value.split(''); this.lists[3].number = value.split('');
if (this.lists[3].number.length < 7) {
var num = 7 - this.lists[3].number.length;
for (var a = 0; a < num; a++) {
this.lists[3].number.unshift('0');
}
}
} }
}, },
}, },

16
src/components/Panel/Panel.vue

@ -28,9 +28,20 @@
<a-icon class="down-icon" type="caret-down" /> <a-icon class="down-icon" type="caret-down" />
</span> </span>
</div> </div>
<a-progress :percent="percent" :show-info="false" :stroke-color="strokeColor" :stroke-width="strokeWidth" status="active" /> <a-progress
:percent="percent"
:show-info="false"
:stroke-color="strokeColor"
:stroke-width="strokeWidth"
status="active"
/>
<div class="flex-1" style="width: 106%; margin-left: -3%"> <div class="flex-1" style="width: 106%; margin-left: -3%">
<div class="flex-1" style="justify-content: center" v-for="(item, index) in lists" :key="index">{{ item }}</div> <div
:key="index"
class="flex-1"
style="justify-content: center"
v-for="(item, index) in lists"
>{{ item }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -77,7 +88,6 @@ export default {
computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose', 'startMessages', 'rfidMessage']), computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose', 'startMessages', 'rfidMessage']),
watch: { watch: {
rfidMessage(val) { rfidMessage(val) {
console.log(val);
if (this.startMessages) { if (this.startMessages) {
this.percent = 0; this.percent = 0;
this.percentA = 0; this.percentA = 0;

37
src/components/RFID/RFID.vue

@ -32,8 +32,8 @@ export default {
{ code: '25', active: false, name: '专用电梯(四楼)' }, { code: '25', active: false, name: '专用电梯(四楼)' },
{ code: '26', active: false, name: 'CCU导管室' }, { code: '26', active: false, name: 'CCU导管室' },
], ],
num: 0, //div num: null, //div
t: null, timer: null,
}; };
}, },
@ -46,11 +46,18 @@ export default {
}, },
watch: { watch: {
rfidMessage: { rfidMessage(value) {
handler(value) { if (value && value.step) {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
this.setLight(value.step); this.setLight(value.step);
}, } else {
deep: true, if (!this.timer && this.num === null) {
this.setTime();
}
}
}, },
}, },
@ -58,8 +65,9 @@ export default {
if (this.rfidMessage && this.rfidMessage.step) { if (this.rfidMessage && this.rfidMessage.step) {
this.setLight(this.rfidMessage.step); this.setLight(this.rfidMessage.step);
} else { } else {
this.setLight(); this.setTime();
} }
// this.setTime();
// this.changePage(); // this.changePage();
}, },
@ -77,9 +85,10 @@ export default {
// //
setTime() { setTime() {
let i = 0; let i = 0;
this.t = setInterval(() => { this.timer = setInterval(() => {
this.lists.forEach((element, j) => { this.lists.forEach((element, j) => {
if (j === i) { if (j === i) {
// debugger;
element.active = true; element.active = true;
// //
for (let a = 0; a < this.newArr.length; a++) { for (let a = 0; a < this.newArr.length; a++) {
@ -113,8 +122,10 @@ export default {
// //
setLight(step) { setLight(step) {
if (step) { if (this.timer) {
clearInterval(this.t); clearInterval(this.timer);
this.timer = null;
}
this.lists.forEach((element, j) => { this.lists.forEach((element, j) => {
if (element.code === step) { if (element.code === step) {
element.active = true; element.active = true;
@ -130,12 +141,6 @@ export default {
element.active = false; element.active = false;
} }
}); });
} else {
// if (this.t) {
// clearInterval(this.t);
// }
this.setTime();
}
}, },
}, },
}; };

8
src/components/Sensor/Sensor.js

@ -14,7 +14,7 @@ const mixin = {
legend: { legend: {
x: 'center', x: 'center',
y: '8%', y: '8%',
data: ['传感器1', '传感器2', '传感器3'], data: ['X轴', 'Y轴', 'Z轴'],
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
color: '#ccc', //标题颜色 color: '#ccc', //标题颜色
@ -53,7 +53,7 @@ const mixin = {
}, },
series: [ series: [
{ {
name: '传感器1', name: 'X轴',
data: this.series1, data: this.series1,
type: 'line', type: 'line',
smooth: true, smooth: true,
@ -82,7 +82,7 @@ const mixin = {
lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } }, lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } },
}, },
{ {
name: '传感器2', name: 'Y轴',
data: this.series2, data: this.series2,
type: 'line', type: 'line',
smooth: true, smooth: true,
@ -116,7 +116,7 @@ const mixin = {
}, },
}, },
{ {
name: '传感器3', name: 'Z轴',
data: this.series3, data: this.series3,
type: 'line', type: 'line',
smooth: true, smooth: true,

2
src/config/api.js

@ -17,5 +17,5 @@ export const record = params => axios.post(`${wisdomcar}/debug/record`, params);
// 急救数量统计图数据 // 急救数量统计图数据
export const selResult = params => axios.post(`${statistics}/get/selResult`, params); export const selResult = params => axios.post(`${statistics}/get/selResult`, params);
// 急救市场分析统计图数据 // 急救时长分析统计图数据
export const getPointTime = params => axios.post(`${statistics}/getPointTime`, params); export const getPointTime = params => axios.post(`${statistics}/getPointTime`, params);

2
src/mixins/socket.js

@ -71,11 +71,11 @@ const mixin = {
case 1: // 体重 case 1: // 体重
// 收到同步消息 // 收到同步消息
// 把消息添加到store 的消息栈中 // 把消息添加到store 的消息栈中
this.setStartMessages(true);
this.messagesAddWeight(data.data.value); this.messagesAddWeight(data.data.value);
break; break;
case 2: // RFID case 2: // RFID
this.messagesAddRfid(data.data); this.messagesAddRfid(data.data);
console.log('data.data: ', data.data);
break; break;
case 3: // 称重传感器一 case 3: // 称重传感器一
this.messagesAddWeighSensor1(data.data.value); this.messagesAddWeighSensor1(data.data.value);

Loading…
Cancel
Save