parent
b3a84d0eda
commit
99882f1e5c
@ -1,13 +1,19 @@
|
||||
/*
|
||||
*所有关于Data_Produce类的业务代码接口应在此处编写
|
||||
*/
|
||||
using VOL.Core.BaseProvider;
|
||||
using VOL.Entity.DomainModels;
|
||||
using VOL.Core.Utilities;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
|
||||
namespace VOL.Data.IServices
|
||||
{
|
||||
public partial interface IData_ProduceService
|
||||
{
|
||||
// 根据查询对象获取最新的一条记录
|
||||
Data_Produce getLastProduceData(Func<Data_Produce, bool> query);
|
||||
|
||||
|
||||
// 最近一周生产加工数
|
||||
List<Data_Produce> produceDataGroupByWeekDays();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,175 @@
|
||||
|
||||
<template>
|
||||
<div class="bar" ref="vbar"></div>
|
||||
</template>
|
||||
<script>
|
||||
var echarts = require("echarts");
|
||||
let $chartBar;
|
||||
export default {
|
||||
name: "Bar",
|
||||
props: {
|
||||
option: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultOption: {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
dataView: { show: true, readOnly: false },
|
||||
magicType: { show: true, type: ['line', 'bar'] },
|
||||
restore: { show: true },
|
||||
// saveAsImage: { show: true, name: "近一周加工数" }
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
top: 0,
|
||||
data: ['广数980DI-1', '西门子828D-1'],
|
||||
itemGap: 20, // 标签间距
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '2%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
axisLine: { // 坐标轴
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
axisTick: { // 坐标轴刻度线
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '广数980DI-1',
|
||||
alignTicks: true,
|
||||
min: 0,
|
||||
axisLabel: {
|
||||
formatter: '{value} 件'
|
||||
},
|
||||
axisLine: { // 坐标轴
|
||||
show: false, // 不显示坐标轴轴线。
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
onZero: true
|
||||
},
|
||||
splitLine: { // 坐标轴分隔线
|
||||
show: true,
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: ['#fff','#ff9f7f'],
|
||||
width: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '西门子828D-1',
|
||||
min: 0,
|
||||
// interval: 50,
|
||||
alignTicks: true,
|
||||
axisLabel: {
|
||||
formatter: '{value} 件'
|
||||
},
|
||||
axisLine: { // 坐标轴
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '广数980DI-1',
|
||||
type: 'bar',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 件';
|
||||
}
|
||||
},
|
||||
data: [
|
||||
100, 99, 91, 107, 121, 137, 101
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '西门子828D-1',
|
||||
type: 'bar',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 件';
|
||||
}
|
||||
},
|
||||
data: [
|
||||
120, 117, 99, 100, 111, 127, 101
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log("bar loaded...");
|
||||
this.defaultOption = this.option || this.defaultOption;
|
||||
},
|
||||
mounted() {
|
||||
this.initGauge(this.defaultOption);
|
||||
},
|
||||
methods: {
|
||||
initGauge(option) {
|
||||
console.log(option);
|
||||
this.$nextTick(() => {
|
||||
$chartBar = echarts.init(this.$refs.vbar);
|
||||
$chartBar.setOption(option);
|
||||
});
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
$chartBar = null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.bar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,140 @@
|
||||
|
||||
<template>
|
||||
<div class="gauge" ref="vgauge"></div>
|
||||
</template>
|
||||
<script>
|
||||
var echarts = require("echarts");
|
||||
let $chartGauge;
|
||||
export default {
|
||||
name: "Gauge",
|
||||
props: {
|
||||
option: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultOption: {
|
||||
series: [{
|
||||
radius: '130%',
|
||||
type: 'gauge',
|
||||
startAngle: 180,
|
||||
endAngle: 0,
|
||||
min: 0,
|
||||
max: 1,
|
||||
splitNumber: 10,
|
||||
center: ["50%", "80%"], // 圆心坐标
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
color: [
|
||||
[0.2, '#FF6E76'],
|
||||
[0.4, '#FF9F7F'],
|
||||
[0.6, '#FDDD60'],
|
||||
[0.8, '#58D9F9'],
|
||||
[1.0, '#7CFFB2']
|
||||
]
|
||||
}
|
||||
},
|
||||
pointer: {
|
||||
icon: 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z',
|
||||
length: '12%',
|
||||
width: 20,
|
||||
offsetCenter: [0, '-60%'],
|
||||
itemStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
length: 12,
|
||||
lineStyle: {
|
||||
color: 'auto',
|
||||
width: 2
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
length: 20,
|
||||
lineStyle: {
|
||||
color: 'auto',
|
||||
width: 5
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 20,
|
||||
// distance: -60,
|
||||
rotate: 'tangential',
|
||||
formatter: function (value) {
|
||||
switch(value) {
|
||||
case 0.20:
|
||||
return "差";
|
||||
case 0.50:
|
||||
return "中";
|
||||
case 0.80:
|
||||
return "良";
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
offsetCenter: [0, '-20%'],
|
||||
fontSize: 20,
|
||||
color: '#fff'
|
||||
},
|
||||
detail: {
|
||||
fontSize: 30,
|
||||
offsetCenter: [0, '0%'],
|
||||
valueAnimation: true,
|
||||
formatter: function (value) {
|
||||
return Math.round(value * 100) + '%';
|
||||
},
|
||||
color: 'auto'
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: 0.70,
|
||||
name: '利用率'
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log("gauge loaded...");
|
||||
this.defaultOption = (this.option || this.defaultOption);
|
||||
},
|
||||
mounted() {
|
||||
this.initGauge(this.defaultOption);
|
||||
},
|
||||
methods: {
|
||||
initGauge(option) {
|
||||
console.log(option);
|
||||
this.$nextTick(() => {
|
||||
$chartGauge = echarts.init(this.$refs.vgauge);
|
||||
$chartGauge.setOption(option);
|
||||
});
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
$chartGauge = null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.gauge {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="line" ref="vline"></div>
|
||||
</template>
|
||||
<script>
|
||||
var echarts = require("echarts");
|
||||
let $chartLine;
|
||||
export default {
|
||||
name: "Line",
|
||||
props: {
|
||||
option: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultOption: {
|
||||
title: {
|
||||
text: '产量折线图',
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
color: "#fff"
|
||||
},
|
||||
left: 20
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['工单1', '工单2', '工单3'],
|
||||
itemGap: 20, // 标签间距
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
// 自定义切换按钮,只能以 my 开头
|
||||
mySwitch: {
|
||||
show: true,
|
||||
title: '更多',
|
||||
icon: 'path://M432.45,595.444c0,2.177-4.661,6.82-11.305,6.82c-6.475,0-11.306-4.567-11.306-6.82s4.852-6.812,11.306-6.812C427.841,588.632,432.452,593.191,432.45,595.444L432.45,595.444z M421.155,589.876c-3.009,0-5.448,2.495-5.448,5.572s2.439,5.572,5.448,5.572c3.01,0,5.449-2.495,5.449-5.572C426.604,592.371,424.165,589.876,421.155,589.876L421.155,589.876z M421.146,591.891c-1.916,0-3.47,1.589-3.47,3.549c0,1.959,1.554,3.548,3.47,3.548s3.469-1.589,3.469-3.548C424.614,593.479,423.062,591.891,421.146,591.891L421.146,591.891zM421.146,591.891',
|
||||
onclick: function () {
|
||||
alert('暂未实现!')
|
||||
}
|
||||
},
|
||||
dataView: { show: true, readOnly: false },
|
||||
magicType: { show: true, type: ['line', 'bar'] }
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '2%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false, // 坐标轴两边不留白
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
axisLine: { // 坐标轴
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
axisTick: { // 坐标轴刻度线
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '产量',
|
||||
position: 'left',
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: '{value} 次'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '工单1',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [120, 132, 101, 134, 90, 230, 210]
|
||||
},
|
||||
{
|
||||
name: '工单2',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [220, 182, 191, 234, 290, 330, 310]
|
||||
},
|
||||
{
|
||||
name: '工单3',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [150, 232, 201, 154, 190, 330, 410]
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log("line loaded...");
|
||||
this.defaultOption = this.option || this.defaultOption;
|
||||
},
|
||||
mounted() {
|
||||
this.initLine(this.defaultOption);
|
||||
},
|
||||
methods: {
|
||||
initLine(option) {
|
||||
console.log(option);
|
||||
this.$nextTick(() => {
|
||||
$chartLine = echarts.init(this.$refs.vline);
|
||||
$chartLine.setOption(option);
|
||||
});
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
$chartLine = null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,71 @@
|
||||
|
||||
<template>
|
||||
<div class="number">
|
||||
<dv-digital-flop :config="config" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
var echarts = require("echarts");
|
||||
let $chartBar;
|
||||
export default {
|
||||
name: "Number",
|
||||
props: {
|
||||
number: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 10000
|
||||
},
|
||||
unity: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
toFixed: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
},
|
||||
toFormat: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
number: [this.number],
|
||||
content: '{nt} ',
|
||||
toFixed: this.toFixed
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.config.content += this.unity;
|
||||
if (this.toFormat) {
|
||||
this.config.formatter = this.formatter;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 千分位分隔符格式化
|
||||
formatter(number) {
|
||||
const numbers = number.toString().split('').reverse();
|
||||
const segs = [];
|
||||
while (numbers.length) segs.push(numbers.splice(0, 3).join(''));
|
||||
return segs.join(',').split('').reverse().join('');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.number {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue