| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- // 引入Day.js库
- const dayjs = require('dayjs');
- // 获取本月日期列表的函数
- function getDatesInMonth() {
- let year = dayjs().year()
- let month = dayjs().month()
- const dates = [];
- const startDate = dayjs(new Date(year, month, 1));
- const endDate = dayjs(new Date(year, month + 1, 1)).subtract(1, 'day');
- let currentDate = startDate;
- while (currentDate.isBefore(endDate) || currentDate.isSame(endDate, 'day')) {
- dates.push(currentDate.format('YYYY-MM-DD'));
- currentDate = currentDate.add(1, 'day');
- }
- return dates;
- }
- export const columns = [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'name',
- label: '生产订单名称',
- align: 'center',
- showOverflowTooltip: true,
- },
- {
- prop: 'name',
- label: '生产订单编号',
- align: 'center',
- showOverflowTooltip: true,
- },
- {
- prop: 'name1',
- label: '订单状态',
- align: 'center',
- showOverflowTooltip: true,
- },
- {
- prop: 'qualified',
- label: '计划开始日期',
- minWidth: '120',
- align: 'center',
- showOverflowTooltip: true,
- },
- {
- prop: 'qualified',
- label: '计划完成日期',
- minWidth: '120',
- align: 'center',
- showOverflowTooltip: true,
- },
- {
- prop: 'name12',
- label: '产品名称',
- align: 'center',
- showOverflowTooltip: true,
- }, {
- prop: 'name12',
- label: '产品编码',
- align: 'center',
- showOverflowTooltip: true,
- }, {
- prop: 'name12',
- label: '规格型号',
- align: 'center',
- showOverflowTooltip: true,
- }, {
- prop: 'name12',
- label: '数量(个)',
- align: 'center',
- showOverflowTooltip: true,
- }, {
- prop: 'name12',
- label: '生产单位',
- align: 'center',
- showOverflowTooltip: true,
- }, {
- prop: 'name12',
- label: '交期状态',
- align: 'center',
- showOverflowTooltip: true,
- },
- ];
- export const lineOption = (data, itemStyle = {}) => {
- return {
- tooltip: {
- formatter: (item) => {
- return item.name + ":" + item.seriesName + " " + item.value
- },
- trigger: 'item'
- },
- legend: {
- // bottom: '2%',
- itemGap: window.innerHeight * 0.014,
- textStyle: {
- fontSize: window.innerHeight * 0.013,
- }
- },
- grid: {
- left: 40,
- bottom: "13%"//也可设置left和right设置距离来控制图表的大小
- },
- color: ['#1890ff'],
- xAxis: {
- type: 'category',
- data: ['10/2', '10/3', '10/4', '10/5', '10/6', '10/7', '10/8'],
- axisLabel: {
- fontSize: window.innerHeight * 0.012,
- }
- },
- yAxis: [
- {
- type: 'value',
- max: 100,
- min: 0,
- axisLabel: {
- show: true,
- formatter: "{value}%", //右侧Y轴文字显示
- },
- nameTextStyle: {
- align: 'center',
- color: "#333",
- fontSize: window.innerHeight * 0.012,
- padding: [0, 20, -3, 0]
- },
- },
- ],
- series: [
- {
- name: '过程控',
- symbolSize: 10,
- data: data[0],
- type: 'line',
- itemStyle: {
- // color: '#ffab08'
- },
- }, {
- name: '产品控',
- symbolSize: 10,
- data: data[1],
- type: 'line',
- itemStyle: {
- // color: '#ffab08'
- },
- }
- ]
- }
- }
- export const barOption = ( xData,series) => {
- return {
- tooltip: {
- formatter: (item) => {
- return item.name + ":" + item.seriesName + " " + item.value
- },
- trigger: 'item'
- },
- legend: {
- // bottom: '2%',
- itemGap: window.innerHeight * 0.014,
- textStyle: {
- fontSize: window.innerHeight * 0.013,
- }
- },
- grid: {
- left: 40,
- right: 55,
- bottom: "13%"//也可设置left和right设置距离来控制图表的大小
- },
- color: ['#1890ff'],
- xAxis: {
- type: 'category',
- data:xData ,
- axisLabel: {
- fontSize: window.innerHeight * 0.012,
- }
- },
- yAxis: [
- {
- type: 'value',
- // name: '(个)',
- nameTextStyle: {
- align: 'center',
- color: "#333",
- fontSize: window.innerHeight * 0.012,
- padding: [0, 20, -3, 0]
- },
- },
- {
- type: 'value',
- max: 100,
- min: 0,
- axisLabel: {
- show: true,
- formatter: "{value}%", //右侧Y轴文字显示
- }
- }
- ],
- series
- }
- }
- export const pieOption = (data) => {
- return {
- color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
- tooltip: {
- // formatter: '{b}:{c}' + '%',
- trigger: 'item'
- },
- // legend: {
- // orient: 'horizontal',
- // left: 'right',
- // right: '15%',
- // bottom: '5%',
- // itemGap: window.innerHeight * 0.018,
- // textStyle: {
- // fontSize: window.innerHeight * 0.014,
- // }
- // },
- series: [
- {
- center: ['50%', '50%'],
- label: {
- position: 'outside',
- show: true,
- formatter: (item) => {
- return item.name + ":" + item.value+'/'+item.percent +'%'
- },
- fontSize: window.innerHeight * 0.014,
- // color:"#fff"
- },
- labelLine: {
- show: true,
- },
- type: 'pie',
- radius: '70%',
- itemStyle: {
- borderWidth: 0,
- shadowBlur: 10,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- data
- }
- ]
- }
- }
|