Compare commits

..

14 Commits

Author SHA1 Message Date
ff98ad35c5 logo图标等 2024-06-04 08:35:23 +08:00
5f2c85e4d7 Merge pull request 'projects/mescc/dy' (#27) from projects/mescc/dy into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #27
2024-06-03 08:53:37 +08:00
helloDy
44283a049b merge 2024-06-03 08:52:30 +08:00
helloDy
da14d9f018 merge 2024-06-03 08:44:28 +08:00
00dd5b4bfe Merge pull request 'projects/mescc/zhp' (#25) from projects/mescc/zhp into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #25
2024-06-03 08:44:02 +08:00
helloDy
fe70138870 生产管理 2024-06-03 08:37:31 +08:00
‘937886381’
a5f8e72a78 Merge branch 'projects/mescc/develop' into projects/mescc/zhp 2024-06-03 08:24:18 +08:00
‘937886381’
38665c38bd 修改 2024-06-03 08:23:40 +08:00
edade214af Merge pull request 'projects/mescc/zhp' (#23) from projects/mescc/zhp into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #23
2024-05-30 22:11:27 +08:00
‘937886381’
91fd1b09d5 工厂驾驶舱 2024-05-30 16:00:18 +08:00
‘937886381’
4569d047d7 解决冲突 2024-05-29 17:07:09 +08:00
‘937886381’
dc1667cdb7 产量和效率 2024-05-29 17:05:55 +08:00
9bd4ac5066 Merge pull request 'projects/mescc/zjl' (#22) from projects/mescc/zjl into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #22
2024-05-29 13:15:23 +08:00
‘937886381’
5c05e6c2e4 修改ui 2024-05-21 09:13:52 +08:00
87 changed files with 16627 additions and 10002 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-05-22 16:29:35 # @LastEditTime: 2024-06-03 08:50:41
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###
@ -9,11 +9,15 @@
ENV = 'development' ENV = 'development'
# 页面标题 # 页面标题
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 发电玻璃智能管控平台
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.1.70:30307' # VUE_APP_BASE_API = 'http://192.168.1.70:30307'
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# sara
# VUE_APP_BASE_API = 'http://192.168.1.63:48080'
# 张一丁
# VUE_APP_BASE_API = 'http://192.168.4.139:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
@ -22,7 +26,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true VUE_APP_CAPTCHA_ENABLE = false
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -2,7 +2,7 @@
ENV = 'development' ENV = 'development'
# 页面标题 # 页面标题
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 发电玻璃智能管控平台
# 芋道管理系统/本地环境 # 芋道管理系统/本地环境
VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn' VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn'
@ -14,7 +14,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true VUE_APP_CAPTCHA_ENABLE = false
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -2,7 +2,7 @@
NODE_ENV = 'production' NODE_ENV = 'production'
# 页面标题 # 页面标题
VUE_APP_TITLE = 玻璃控股信息平台 VUE_APP_TITLE = 发电玻璃智能管控平台
# 芋道管理系统/生产环境 # 芋道管理系统/生产环境
VUE_APP_BASE_API = '' VUE_APP_BASE_API = ''
@ -16,7 +16,7 @@ PUBLIC_PATH = ''
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true VUE_APP_CAPTCHA_ENABLE = false
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@ -1,7 +1,7 @@
NODE_ENV = production NODE_ENV = production
# 页面标题 # 页面标题
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 发电玻璃智能管控平台
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
@ -16,7 +16,7 @@ PUBLIC_PATH = 'http://static.yudao.iocoder.cn/'
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true VUE_APP_CAPTCHA_ENABLE = false
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@ -4,7 +4,7 @@ NODE_ENV = development
ENV = 'staging' ENV = 'staging'
# 页面标题 # 页面标题
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 发电玻璃智能管控平台
# 芋道管理系统/测试环境 # 芋道管理系统/测试环境
VUE_APP_BASE_API = 'http://127.0.0.1:48080' VUE_APP_BASE_API = 'http://127.0.0.1:48080'
@ -18,7 +18,7 @@ VUE_APP_APP_NAME ='/admin-ui-vue2/'
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true VUE_APP_CAPTCHA_ENABLE = false
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@ -51,10 +51,14 @@
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"echarts": "5.4.0", "echarts": "5.4.0",
"element-ui": "2.15.12", "element-ui": "2.15.12",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"fuse.js": "6.6.2", "fuse.js": "6.6.2",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"html2canvas": "^1.4.1",
"js-beautify": "^1.15.1", "js-beautify": "^1.15.1",
"jsencrypt": "3.3.1", "jsencrypt": "3.3.1",
"jspdf": "^2.5.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"moment": "^2.30.1", "moment": "^2.30.1",
@ -69,7 +73,8 @@
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.2" "vuex": "3.6.2",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.5.18", "@vue/cli-plugin-babel": "4.5.18",

View File

@ -1,13 +1,13 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 08:54:59 * @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-22 16:31:08 * @LastEditTime: 2024-06-03 08:52:02
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
// 查询部门列表 // 查询生产数据管理分页
export function getProduceDataPage(data) { export function getProduceDataPage(data) {
return request({ return request({
url: 'ip/prod-output/prodOutputDataPage', url: 'ip/prod-output/prodOutputDataPage',
@ -33,6 +33,15 @@ export function exportOutPutExcel(data) {
}) })
} }
// 获取生产数据管理列表
export function prodOutputDataList(data) {
return request({
url: '/ip/prod-output/prodOutputDataList',
method: 'post',
data: data
})
}
// 获取生产管理生产目标管理碲化镉工厂分页 // 获取生产管理生产目标管理碲化镉工厂分页
export function prodTargetDiPage(data) { export function prodTargetDiPage(data) {
return request({ return request({
@ -110,7 +119,7 @@ export function importToTarget(data) {
return request({ return request({
url: '/ip/prod-target/to-target-import-excel', url: '/ip/prod-target/to-target-import-excel',
method: 'post', method: 'post',
data data: data
}) })
} }
@ -119,7 +128,7 @@ export function importDiTarget(data) {
return request({ return request({
url: '/ip/prod-target/di-target-import-excel', url: '/ip/prod-target/di-target-import-excel',
method: 'post', method: 'post',
data data: data
}) })
} }
@ -138,3 +147,12 @@ export function cockpitDataMonitor(data) {
data: data data: data
}) })
} }
export function exportFactoryDataExcel(data) {
return request({
url: '/ip/prod-output-month/export/excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@ -0,0 +1,52 @@
/*
* @Author: zhp
* @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-31 15:08:27
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 查询工单分页
export function getWorkOrderPage(data) {
return request({
url: '/ip/prod-work-order/page',
method: 'post',
data: data
})
}
// 查询工单趋势数据
export function getDailyTrend(data) {
return request({
url: '/ip/prod-work-order/getDailyTrend',
method: 'post',
data: data
})
}
// 获得工单
export function getWorkOrderDetail(id){
return request({
url: '/ip/prod-work-order/get?id=' + id,
method: 'get'
})
}
// 获得工单设备加工数量
export function getEqNum(id){
return request({
url: '/ip/prod-work-order/getEqNum?workOrderId=' + id,
method: 'get'
})
}
// 导出工单数据
export function exportExcel(data) {
return request({
url: '/ip/prod-work-order/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -49,7 +49,7 @@
</template> </template>
<script> <script>
import logoImg from "@/assets/logo/logo.png"; import logoImg from "@/assets/logo/cnbm.png";
import variables from "@/assets/styles/variables.scss"; import variables from "@/assets/styles/variables.scss";
export default { export default {
@ -70,7 +70,7 @@ export default {
}, },
data() { data() {
return { return {
title: "玻璃控股信息平台", title: "发电玻璃智能管控平台",
logo: logoImg, logo: logoImg,
}; };
}, },
@ -104,7 +104,7 @@ export default {
width: 32px; width: 32px;
height: 32px; height: 32px;
vertical-align: middle; vertical-align: middle;
margin-right: 12px; margin-right: 10px;
} }
& .sidebar-title { & .sidebar-title {
@ -113,7 +113,7 @@ export default {
color: #fff; color: #fff;
font-weight: 600; font-weight: 600;
line-height: 50px; line-height: 50px;
font-size: 14px; font-size: 19px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle; vertical-align: middle;
} }

View File

@ -1,4 +1,3 @@
import axios from "@/utils/request"; import axios from "@/utils/request";
import { deepClone } from "../../utils"; import { deepClone } from "../../utils";
@ -25,10 +24,12 @@ const state = {
chipOee: { chipOee: {
current: [], current: [],
previous: [], previous: [],
target:[]
}, },
transformRate: { transformRate: {
current: [], current: [],
previous: [], previous: [],
target:[]
}, },
chipRate: { chipRate: {
target: [], target: [],
@ -39,6 +40,7 @@ const state = {
stdRate: { stdRate: {
target: [], target: [],
current: [], current: [],
previous: [],
outputNumber:[] outputNumber:[]
}, },
}, },
@ -77,7 +79,7 @@ const mutations = {
state.copilot.energy.elecList = payload.elecList; state.copilot.energy.elecList = payload.elecList;
break; break;
case "efficiency": case "efficiency":
state.copilot.efficiency.chipOee = payload.chipOee; state.copilot.efficiency.chipOeeRate = payload.chipOeeRate;
state.copilot.efficiency.transformRate = payload.transformRate; state.copilot.efficiency.transformRate = payload.transformRate;
state.copilot.efficiency.chipRate = payload.chipRate; state.copilot.efficiency.chipRate = payload.chipRate;
state.copilot.efficiency.stdRate = payload.stdRate; state.copilot.efficiency.stdRate = payload.stdRate;
@ -91,13 +93,14 @@ const actions = {
async initHome({ commit }) { async initHome({ commit }) {
const dataArr = await getHomeInfo(); const dataArr = await getHomeInfo();
console.log('dataArr', dataArr); console.log('dataArr', dataArr);
let preData = dataArr.previousProdOutputOutDO
let preFtoData = dataArr.previousProdOutputFtoDO
// const targetArr = await getHomeInfo(); // const targetArr = await getHomeInfo();
const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO,preData,preFtoData);
);
commit("SET_HOME_INFO", payload); commit("SET_HOME_INFO", payload);
}, },
/** 初始化驾驶舱数据 */ /** 初始化驾驶舱数据 */
async initCopilot({ commit }, { period, source }) { async initCopilot({ commit }, { period,source,than}) {
// if (source == "energy") return; // if (source == "energy") return;
const fetcher = { const fetcher = {
@ -111,25 +114,28 @@ const actions = {
efficiency: splitCurrentAndPreviousA, efficiency: splitCurrentAndPreviousA,
}[source] }[source]
// 获取产量数据 // 获取产量数据
let { data: factoryList, type } = await fetcher(period) let { data: factoryList, type } = await fetcher(period,than)
let targetList = null; // let targetList = null;
if (source === "yield" || source === "efficiency") { // if (source === "yield" || source === "efficiency") {
// 获取目标数据 // // 获取目标数据
let { data } = await fetcher(period, true) // let { data } = await fetcher(period,than, true)
targetList = data // targetList = data
} // }
if (source == "energy") { // if (source == "energy") {
let factoryData = factoryList // let factoryData = factoryList
const payload = handler(factoryData) // const payload = handler(factoryData)
commit("SET_COPILOT_INFO", { type, payload }); // commit("SET_COPILOT_INFO", { type, payload });
} else { // } else {
console.log('factoryList',factoryList)
let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO
let preData = factoryList.previousProdOutputOutDO ? factoryList.previousProdOutputOutDO : factoryList.previousProdOutputRateDO
let preFtoData = factoryList.previousProdOutputFtoDO ? factoryList.previousProdOutputFtoDO : []
let prodOutputFtoDO = factoryList.prodOutputFtoDO ? factoryList.prodOutputFtoDO : [] let prodOutputFtoDO = factoryList.prodOutputFtoDO ? factoryList.prodOutputFtoDO : []
let targetData = targetList.prodTargetDO ? targetList.prodTargetDO : targetList.prodTargetDO let targetData = factoryList.prodTargetOutputDO ? factoryList.prodTargetOutputDO : factoryList.prodTargetRateDO
const payload = handler(factoryData, targetData,prodOutputFtoDO) const payload = handler(factoryData,targetData,prodOutputFtoDO,preData,preFtoData)
commit("SET_COPILOT_INFO", { type, payload }); commit("SET_COPILOT_INFO", { type, payload });
} // }
}, },
}; };
@ -281,11 +287,11 @@ function splitCurrentAndPreviousB(factoryListResponse) {
} }
} }
function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodOutputFtoListRes,preData,preFtoData) {
// console.log('工厂',factoryListResponse); console.log('工厂',targetListResponse);
// 初始数据 // 初始数据
const { chipOee, transformRate, chipRate, stdRate } = initA(); const { chipOeeRate, transformRate, chipRate, stdRate } = initA();
// factoryListResponse = [ // factoryListResponse = [
// { // {
// factory: 0, // factory: 0,
@ -336,6 +342,23 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) {
// componentYieldRate: 0.73, // componentYieldRate: 0.73,
// }, // },
// ]; // ];
if (preData && preData[0] != null) {
for (const factory of preData) {
const fId = getPreFactoryId(factory);
chipInvest.previous[fId] = factory.previousYearInputNumber;
// chipOeeRate.current[fId] = factory.oee;
chipOeeRate.previous[fId] = factory.previousYearOee;
// 转化效率
transformRate.previous[fId] =factory.previousYearComponentConversionEfficiency ;
// 芯片良率 与 标准组件良率
if (![0, 1].includes(factory.glassType)) continue;
const _t = [chipRate, stdRate][factory.glassType]
// _t.current[fId] = factory.yieldRate ;
_t.previous[fId] = factory.previousYearYieldRate ;
// }
// debugger;
}
}
if (factoryListResponse) { if (factoryListResponse) {
for (const factory of factoryListResponse) { for (const factory of factoryListResponse) {
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
@ -347,27 +370,27 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) {
chipOee, chipOee,
componentConversionEfficiency, componentConversionEfficiency,
componentYield componentYield
} = getFactoryTargetValueA(targetListResponse, fId); } = getFactoryTargetValueA(targetListResponse, fId)
stdRate.target[fId] = componentYieldRate stdRate.target[fId] = componentYieldRate
chipRate.target[fId] = chipYieldRate chipRate.target[fId] = chipYieldRate
chipOeeRate.target[fId] = chipOee
transformRate.target[fId] = componentConversionEfficiency
} }
// 芯片OEE // 芯片OEE
chipOee.current[fId] = factory.oee * 100 ; chipOeeRate.current[fId] = factory.oee;
chipOee.previous[fId] = factory.previousYearOee * 100 ; // chipOeeRate.previous[fId] = factory.previousYearOee;
// 转化效率 // 转化效率
transformRate.current[fId] = transformRate.current[fId] = factory.componentConversionEfficiency;
factory.componentConversionEfficiency * 100 ; // transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency ;
transformRate.previous[fId] =
factory.previousYearComponentConversionEfficiency * 100 ;
// 芯片良率 与 标准组件良率 // 芯片良率 与 标准组件良率
if (![0, 1].includes(factory.glassType)) continue; if (![0, 1].includes(factory.glassType)) continue;
const _t = [chipRate, stdRate][factory.glassType] const _t = [chipRate, stdRate][factory.glassType]
_t.current[fId] = factory.yieldRate ; _t.current[fId] = factory.yieldRate ;
_t.previous[fId] = factory.previousYearYieldRate ; // _t.previous[fId] = factory.previousYearYieldRate ;
} }
// console.log('chipOeeRate',chipOeeRate);
return { return {
chipOee, chipOeeRate,
transformRate, transformRate,
chipRate, chipRate,
stdRate, stdRate,
@ -375,21 +398,57 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) {
} }
} }
function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOutputFtoListRes) { function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOutputFtoListRes,preData,preFtoData) {
console.log('prodOutputFtoListRes',prodOutputFtoListRes); console.log('prodOutputFtoListRes',preData);
// 初始数据 // 初始数据
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init() const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init()
if (prodOutputFtoListRes) { if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) { for (const factory of prodOutputFtoListRes) {
console.log(factory); console.log(factory);
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
ftoInvest.current[fId] = factory.chipInput; ftoInvest.current[fId] = factory.chipInput;
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
const fId = getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
ftoInvest.previous[fId] = factory.previousYearChipInput; ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
} }
} }
if (factoryListResponse) { if (preData && preData[0] != null) {
for (const factory of preData) {
const fId = getPreFactoryId(factory);
chipInvest.previous[fId] = factory.previousYearInputNumber;
if (![0, 1, 2].includes(factory.previousGlassType)) continue;
const _t = [chipOutput, stdOutput, bipvOutput][factory.previousGlassType];
// if (fId) {
// _t.current[fId] = factory.outputNumber;
// }
// if (preFId) {
_t.previous[fId] = factory.previousYearOutputNumber
// }
// debugger;
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) { for (const factory of factoryListResponse) {
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// 获取目标值 // 获取目标值
if (targetListResponse) { if (targetListResponse) {
const { chipYield, componentYield, bipvProductOutput } = const { chipYield, componentYield, bipvProductOutput } =
@ -400,22 +459,13 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
} }
// 芯片投入 // 芯片投入
chipInvest.current[fId] = factory.inputNumber; chipInvest.current[fId] = factory.inputNumber;
chipInvest.previous[fId] = factory.previousYearInputNumber;
// FTO投入
// if (factory.chipInput || factory.previousYearChipInput) {
// ftoInvest.current[fId] = factory.chipInput;
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
// 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出 // 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出
// 因为后端写的垃圾数据,所以这里要做一下判断 // 因为后端写的垃圾数据,所以这里要做一下判断
if (![0, 1, 2].includes(factory.glassType)) continue; if (![0, 1, 2].includes(factory.glassType)) continue;
const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType];
_t.current[fId] = factory.outputNumber; _t.current[fId] = factory.outputNumber;
_t.previous[fId] = factory.previousYearOutputNumber;
// debugger;
} }
return { return {
chipInvest, chipInvest,
// ftoInvest, // ftoInvest,
@ -424,27 +474,39 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
stdOutput, stdOutput,
bipvOutput, bipvOutput,
}; };
}else{
return {
chipInvest,
// ftoInvest,
ftoInvest,
chipOutput,
stdOutput,
bipvOutput,
}
} }
} }
function getFactoryId(factory) { function getFactoryId(factory) {
return factory.factory; return factory.factory;
} }
function getPreFactoryId(factory) {
return factory.previousFactory;
}
function getFactoryTargetValue(targetList, factoryId) { function getFactoryTargetValue(targetList, factoryId) {
const target = targetList.find((item) => item.factory === factoryId); const target = targetList.find((item) => item.factory === factoryId);
if (target) { if (target) {
return { return {
// 自带模拟数据了.... random_default // 自带模拟数据了.... random_default
chipYield: target.chipYield ?? random_default(), chipYield: target.chipYield ?? 0,
componentYield: target.componentYield ?? random_default(), componentYield: target.componentYield ?? 0,
bipvProductOutput: target.bipvProductOutput ?? random_default(), bipvProductOutput: target.bipvProductOutput ?? 0,
}; };
} }
return { return {
chipYield: random_default(), chipYield: 0,
componentYield: random_default(), componentYield: 0,
bipvProductOutput: random_default(), bipvProductOutput: 0,
}; };
} }
@ -458,15 +520,18 @@ function getFactoryTargetValueA(targetList, factoryId) {
const target = targetList.find((item) => item.factory === factoryId) const target = targetList.find((item) => item.factory === factoryId)
if (target) { if (target) {
return { return {
chipYieldRate: target.chipYieldRate ?? random_default(), chipYieldRate: target.chipYieldRate ?? 0,
componentYieldRate: target.componentYieldRate ?? random_default(), componentYieldRate: target.componentYieldRate ?? 0,
componentYield: target.componentYield ?? random_default(), componentYield: target.componentYield ?? 0,
// componentYield: target.componentYield ?? 0,
chipOee: target.chipOee ?? 0,
}; };
} }
return { return {
chipYieldRate:0, chipYieldRate:0,
componentYieldRate:0, componentYieldRate:0,
componentYield: 0, componentYield: 0,
chipOee:0,
}; };
} }
@ -480,18 +545,18 @@ function initA() {
previous: Array(7).fill(0), previous: Array(7).fill(0),
}; };
// 芯片OEE // 芯片OEE
const chipOee = deepClone(t_);
// 转化效率 // 转化效率
const transformRate = deepClone(t_);
// 标准组件良率 // 标准组件良率
const stdRate = { const stdRate = {
...deepClone(t_), ...deepClone(t_),
target: Array(7).fill(0), target: Array(7).fill(0),
}; };
// 芯片良率 // 芯片良率
const transformRate = deepClone(stdRate);
const chipRate = deepClone(stdRate); const chipRate = deepClone(stdRate);
const chipOeeRate = deepClone(stdRate);
return { return {
chipOee, chipOeeRate,
transformRate, transformRate,
chipRate, chipRate,
stdRate, stdRate,
@ -544,6 +609,7 @@ async function getHomeInfo() {
const { code, data } = await axios.post("ip/prod-output/cockpitData", { const { code, data } = await axios.post("ip/prod-output/cockpitData", {
factorys: [], factorys: [],
date: 4, date: 4,
mode:0
}); });
if (code == 0) { if (code == 0) {
return data; return data;
@ -609,16 +675,16 @@ async function doFetch(copilot_module = "yield", fetch_target, params) {
* @param {*} target 是否获取目标数据 * @param {*} target 是否获取目标数据
* @returns * @returns
*/ */
function getCopilotYield(period, target = false) { function getCopilotYield(period,than,target = false) {
return getCopilotData("yield", period, target); return getCopilotData("yield", period,than, target);
} }
function getCopilotEnergy(period, target = false) { function getCopilotEnergy(period, target = false) {
return getCopilotData("energy", period, target); return getCopilotData("energy", period,than, target);
} }
function getCopilotEfficiency(period, target = false) { function getCopilotEfficiency(period,than, target = false) {
return getCopilotData("efficiency", period, target); return getCopilotData("efficiency", period,than, target);
} }
/** /**
@ -627,12 +693,13 @@ function getCopilotEfficiency(period, target = false) {
* @param {*} target 是否获取目标数据默认 * @param {*} target 是否获取目标数据默认
* @returns * @returns
*/ */
async function getCopilotData(copilot_module, period, target = false) { async function getCopilotData(copilot_module, period,than, target = false) {
if (!copilot_module) copilot_module = "yield"; if (!copilot_module) copilot_module = "yield";
// 请求参数,直接一次性获取所有工厂 // 请求参数,直接一次性获取所有工厂
let queryParams = { let queryParams = {
factorys: [], factorys: [],
date: 4, date: 4,
mode:0
}; };
switch (period) { switch (period) {
@ -652,7 +719,14 @@ async function getCopilotData(copilot_module, period, target = false) {
queryParams.date = 1; queryParams.date = 1;
break; break;
} }
switch (than) {
case "同比":
queryParams.mode = 0;
break;
case "环比":
queryParams.mode = 1;
break;
}
return { return {
data: await doFetch(copilot_module, target ? true : false, queryParams), data: await doFetch(copilot_module, target ? true : false, queryParams),
type: copilot_module, type: copilot_module,

View File

@ -74,9 +74,9 @@ export const SystemDataScopeEnum = {
/** /**
* 工厂名称 * 工厂名称
*/ */
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'] // export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司']
export const dhgfactoryList =[ export const factoryArray1 =[
{ {
name: '瑞昌中建材光电材料有限公司', name: '瑞昌中建材光电材料有限公司',
id: 0 id: 0
@ -97,12 +97,43 @@ export const dhgfactoryList =[
name: '成都中建材光电材料有限公司', name: '成都中建材光电材料有限公司',
id: 4 id: 4
}, },
{
name: '凯盛光伏材料有限公司',
id: 5
},
{ {
name: '蚌埠兴科玻璃有限公司', name: '蚌埠兴科玻璃有限公司',
id: 6 id: 6
} }
] ]
// export const dhgfactoryList =[
// {
// name: '瑞昌中建材光电材料有限公司',
// id: 0
// },
// {
// name: '邯郸中建材光电材料有限公司',
// id: 1
// },
// {
// name: '中建材株洲光电材料有限公司',
// id: 2
// },
// {
// name: '佳木斯中建材光电材料有限公司',
// id: 3
// },
// {
// name: '成都中建材光电材料有限公司',
// id: 4
// },
// {
// name: '蚌埠兴科玻璃有限公司',
// id: 6
// }
// ]
export const tyjxfactoryList =[ export const tyjxfactoryList =[
{ {
name: '凯盛光伏材料有限公司', name: '凯盛光伏材料有限公司',
@ -110,6 +141,30 @@ export const tyjxfactoryList =[
} }
] ]
// 暂时只有瑞昌邯郸数据
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司']
export const factoryArray =[
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
}
]
export const dhgfactoryList =[
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
}
]
/** /**
* 代码生成模板类型 * 代码生成模板类型
*/ */

View File

@ -11,7 +11,7 @@
<span v-for="item in legend" :key="item.label" class="legend-item" <span v-for="item in legend" :key="item.label" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div> </div>
<div ref="chart" :style="{ height: '95%',width: width}"></div> <div ref="chart" style="height:94%;width:100%"></div>
</chart-container> </chart-container>
</template> </template>
@ -51,7 +51,7 @@ export default {
}, },
data() { data() {
return { return {
width: '', width: '100%',
isFullscreen: false, isFullscreen: false,
actualOptions: null, actualOptions: null,
options: { options: {
@ -184,16 +184,7 @@ export default {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isOpen(val) { isOpen(val) {
// console.log(val) // console.log(val)
if (val === true) {
console.log('ztl')
this.width = 95 + '%'
this.canvasReset() this.canvasReset()
console.log(this.width)
} else {
this.watch = 100 + '%'
this.canvasReset()
}
}, },
isFullscreen(val) { isFullscreen(val) {
this.actualOptions.series.map((item) => { this.actualOptions.series.map((item) => {
@ -203,21 +194,14 @@ export default {
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions); this.initChart(this.actualOptions);
if (val === false && this.isOpen === true) {
console.log(val)
this.width = 97 + '%'
this.canvasReset()
} else if (val === false && this.isOpen === false) {
this.watch = 100 + '%'
this.canvasReset()
}
// this.actualOptions.series.map((item) => { // this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12; // item.barWidth = val ? 18 : 12;
// }); // });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions); // this.initChart(this.actualOptions);
this.canvasReset()
}, },
series(val) { series(val) {
if (!val) { if (!val) {

View File

@ -8,39 +8,30 @@
<template> <template>
<div class="copilot-header"> <div class="copilot-header">
<section class="menu"> <section class="menu">
<CopilotButton <CopilotButton v-for="i in ['产量', '效率']" :key="i" :label="i" :active="i === active"
v-for="i in ['产量', '效率', '综合']" @click="() => $emit('update:active', i)" />
:key="i" <div class="type-name"></div>
:label="i" <CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than"
:active="i === active" @click="() => $emit('update:than', i)" />
@click="() => $emit('update:active', i)"
/>
</section>
<section class="menu">
<CopilotButton
v-for="i in ['日', '周', '月', '年']"
:key="i"
:label="i"
:active="i === period"
@click="() => $emit('update:period', i)"
/>
<div class="btn-group">
<button type="button" class="export-btn" />
<button
type="button"
class="fullscreen-btn"
:class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen"
/>
</div>
</section> </section>
<div class="page-title">{{ active }}驾驶舱</div> <div class="page-title">{{ active }}驾驶舱</div>
<section class="menu" style="width: 24vw;float: right;">
<CopilotButton v-for="i in ['', '', '', '']" :key="i" :label="i" :active="i === period"
@click="() => $emit('update:period', i)" />
<div class="btn-group">
<!-- <button type="button" class="export-btn" @click="handleExport" /> -->
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen" />
<!-- <button class="times-btn"> {{ times }} </button> -->
</div>
</section>
</div> </div>
</template> </template>
<script> <script>
import CopilotButton from "./button.vue"; import CopilotButton from "./button.vue";
import screenfull from "screenfull"; import screenfull from "screenfull";
import { exportFactoryDataExcel } from "@/api/produceData";
export default { export default {
name: "CopilotHeader", name: "CopilotHeader",
@ -52,14 +43,70 @@ export default {
period: { period: {
type: String, type: String,
}, },
than: {
type: String,
},
}, },
data() { data() {
return { return {
times:'',
isFullscreen: false, isFullscreen: false,
}; };
}, },
mounted () {
this.getTimes()
this.getTimesInterval();
},
computed: {}, computed: {},
methods: { methods: {
handleExport() {
exportFactoryDataExcel({
// factoryId: this.companyId,
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
}).then(response => {
this.$download.excel(response, `生产数据.xls`);
// this.exportLoading = false;
}).catch(() => { });
},
getTimes() {
setInterval(this.getTimesInterval, 60000);
},
getTimesInterval() {
var now = new Date();
var weekDay = now.getDay();
var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var week = weeks[weekDay]
let _this = this;
let year = new Date().getFullYear(); //
let month = new Date().getMonth() + 1; //
let day = new Date().getDate(); //
let hours = new Date().getHours(); //
let minutes = new Date().getMinutes(); //
// let seconds = new Date().getSeconds(); //
// 10 0
if (hours < 10) {
hours = '0' + hours;
}
if (minutes < 10) {
minutes = '0' + minutes;
}
// if (seconds < 10) {
// seconds = '0' + seconds;
// }
//
this.times =
year +
'.' +
month +
'.' +
day +
" " + hours +
'.' +
minutes +
'.' +
week
},
toggleFullScreen() { toggleFullScreen() {
this.isFullscreen = !this.isFullscreen; this.isFullscreen = !this.isFullscreen;
screenfull.toggle(document.querySelector(".copilot-layout")) screenfull.toggle(document.querySelector(".copilot-layout"))
@ -82,10 +129,11 @@ export default {
display: flex; display: flex;
gap: 12px; gap: 12px;
align-items: center; align-items: center;
justify-content: space-between;
} }
.copilot-header > section { .copilot-header > section {
width: 24vw; width: 26vw;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
@ -99,6 +147,17 @@ export default {
cursor: pointer; cursor: pointer;
} }
.times-btn {
width: 240px;
height: 32px;
margin-left: 24px;
cursor: pointer;
color: white;
font-size: 20px;
line-height: 30px;
float: right;
/* margin-bottom: 20px; */
}
.export-btn { .export-btn {
background: url(../../../assets/images/export-icon.png) 0 0 / 100% 100% background: url(../../../assets/images/export-icon.png) 0 0 / 100% 100%
no-repeat; no-repeat;
@ -112,15 +171,27 @@ export default {
background: url(../../../assets/images/homeindex/exit-fullscreen.png) 0 0 / 100% 100% background: url(../../../assets/images/homeindex/exit-fullscreen.png) 0 0 / 100% 100%
no-repeat; no-repeat;
} }
.type-name {
/* content: ""; */
display: inline-block;
width: 1px;
height: 59px;
border: 1px solid;
opacity: 0.9;
border-image: linear-gradient(180deg, rgba(0, 176, 243, 0), rgba(88, 194, 255, 1), rgba(0, 120, 228, 0)) 2 2;
/* position: absolute; */
/* left: 0; */
/* top: 10px; */
}
.page-title { .page-title {
flex: 1; width: 25vw;
font-size: 54px; font-size: 54px;
line-height: 70px; line-height: 70px;
letter-spacing: 5px; letter-spacing: 5px;
font-family: 优设标题黑; font-family: 优设标题黑;
color: #6db6ff; color: #6db6ff;
text-align: right; text-align: center;
user-select: none; user-select: none;
background: url(../../../assets/images/homeindex/page-title.png) 0 0 / 100% 100% no-repeat;
} }
</style> </style>

View File

@ -1,38 +1,31 @@
<template> <template>
<div class="factory-header"> <div class="factory-header">
<section class="menu1"> <section class="menu1">
<FactorySelect <!-- <CopilotButton v-for="i in ['产量', '效率']" :key="i" :label="i" :active="i === active"
:companyName="companyName" @click="() => $emit('update:active', i)" />
:companyId="companyId" <div class="type-name"></div> -->
@updateCompany="updateCompany" <CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than"
/> @click="() => $emit('update:than', i)" />
</section>
<section class="menu2">
<CopilotButton
v-for="i in dataList"
:key="i.id"
:label="i.name"
:active="i.id === period"
@click="() => $emit('update:period', i.id)"
/>
<div class="btn-group"> <div class="btn-group">
<button type="button" class="export-btn" /> <button type="button" class="export-btn" @click="handleExport" />
<button <button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']"
type="button" @click="toggleFullScreen" />
class="fullscreen-btn"
:class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen"
/>
</div> </div>
</section> </section>
<div class="page-title">{{ companyName }}</div> <div class="page-title">{{ companyName }}</div>
<section class="menu2">
<CopilotButton v-for="i in dataList" :key="i.id" :label="i.name" :active="i.id === period"
@click="() => $emit('update:period', i.id)" />
</section>
</div> </div>
</template> </template>
<script> <script>
import CopilotButton from "./button.vue"; // import CopilotButton from "./button.vue";
import FactorySelect from "./FactorySelect.vue"; import FactorySelect from "./FactorySelect.vue";
import screenfull from "screenfull"; import screenfull from "screenfull";
import CopilotButton from "./button.vue";
import { exportFactoryDataExcel } from "@/api/produceData";
export default { export default {
name: "FactoryDataHeader", name: "FactoryDataHeader",
@ -47,6 +40,9 @@ export default {
period: { period: {
type: Number, type: Number,
}, },
than: {
type: String,
},
}, },
data() { data() {
return { return {
@ -61,6 +57,15 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
handleExport() {
exportFactoryDataExcel({
factoryId: this.companyId,
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
}).then(response => {
this.$download.excel(response, `${this.companyName}生产数据.xls`);
// this.exportLoading = false;
}).catch(() => { });
},
toggleFullScreen() { toggleFullScreen() {
this.isFullscreen = !this.isFullscreen; this.isFullscreen = !this.isFullscreen;
@ -90,13 +95,13 @@ export default {
} }
.factory-header > .menu1 { .factory-header > .menu1 {
width: 24vw; width: 20vw;
/* display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; */ gap: 8px;
} }
.factory-header > .menu2 { .factory-header > .menu2 {
width: 30vw; width: 26vw;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
@ -125,13 +130,14 @@ export default {
} }
.page-title { .page-title {
flex: 1; flex: 1 1 auto;
font-size: 40px; font-size: 40px;
line-height: 70px; line-height: 70px;
letter-spacing: 5px; letter-spacing: 5px;
font-family: 优设标题黑; font-family: 优设标题黑;
color: #6db6ff; color: #6db6ff;
text-align: right; text-align: center;
user-select: none; user-select: none;
background: url(../../../assets/images/homeindex/page-title-two.png) 0 0 / 100% 100% no-repeat;
} }
</style> </style>

View File

@ -367,7 +367,7 @@ export default {
this.canvasReset() this.canvasReset()
console.log(this.width) console.log(this.width)
} else { } else {
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }
@ -378,7 +378,7 @@ export default {
this.width = 97 + '%' this.width = 97 + '%'
this.canvasReset() this.canvasReset()
} else if (val === false && this.isOpen === false) { } else if (val === false && this.isOpen === false) {
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }

View File

@ -365,7 +365,7 @@ export default {
console.log(this.width) console.log(this.width)
} else { } else {
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }
}, },
@ -376,7 +376,7 @@ export default {
this.width = 97 + '%' this.width = 97 + '%'
this.canvasReset() this.canvasReset()
} else if(val === false && this.isOpen === false) { } else if(val === false && this.isOpen === false) {
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }
// this.actualOptions.series.map((item) => { // this.actualOptions.series.map((item) => {

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 13:26:32
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: button.vue filename: button.vue
author: liubin author: liubin
@ -50,7 +57,7 @@ button {
padding: 12px; padding: 12px;
padding-left: 20px; padding-left: 20px;
color: #fff; color: #fff;
font-size: 22px; font-size: 18px;
letter-spacing: 10px; letter-spacing: 10px;
cursor: pointer; cursor: pointer;
} }

View File

@ -0,0 +1,292 @@
<!--
* @Author: zhp
* @Date: 2024-05-23 15:49:14
* @LastEditTime: 2024-05-31 16:06:50
* @LastEditors: zhp
* @Description:
-->
<template>
<chart-container class="bar-chart-base">
<div class="legend">
<span v-for="item in legend" :key="item.label" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div>
<div ref="ftoChart" style="height:94%;width:100%"></div>
</chart-container>
</template>
<script>
import screenfull from "screenfull";
import ChartContainer from "./ChartContainer.vue";
import { debounce } from "@/utils/debounce";
// import chartMixin from "@/mixins/chart.js";
import * as echarts from "echarts";
export default {
name: "BarChartBase",
components: {
ChartContainer,
},
// mixins: [chartMixin],
props: {
vHeight: {
type: Number,
default: 34,
},
legend: {
type: Array,
required: true,
},
xAxis: {
type: Array,
required: true,
},
series: {
type: Array,
required: true,
},
in: {
type: String,
default: "",
},
},
data() {
return {
width: '100%',
isFullscreen: false,
actualOptions: null,
options: {
grid: {
left: "5%",
right: "4%",
bottom: "3%",
top: "15%",
containLabel: true,
},
tooltip: {},
xAxis: {
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#4561AE",
},
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
data: this.xAxis,
},
yAxis: {
name: "单位/片",
nameTextStyle: {
color: "#fff",
fontSize: 12,
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#4561AE",
},
},
splitLine: {
lineStyle: {
color: "#4561AE",
},
},
},
series: [
{
name: "", // this.series[0].name,
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#12f7f1", // 0%
},
{
offset: 0.35,
color: "#12f7f177", // 100%
},
{
offset: 0.75,
color: "#12f7f133", // 100%
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
{
name: "", // this.series[1].name,
type: "bar",
barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[1].data,
},
],
},
};
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened
},
},
watch: {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isOpen(val) {
// console.log(val)
this.canvasReset()
},
isFullscreen(val) {
this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12;
});
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions);
// this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12;
// });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initChart(this.actualOptions);
this.canvasReset()
},
series(val) {
if (!val) {
this.initChart(this.options);
return;
}
const actualOptions = JSON.parse(JSON.stringify(this.options));
console.log('actualOptions', this.options)
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val[1].data;
actualOptions.series[1].name = val[1].name;
this.actualOptions = actualOptions;
this.initChart(actualOptions);
},
},
mounted() {
if (screenfull.isEnabled) {
screenfull.on("change", () => {
this.isFullscreen = screenfull.isFullscreen;
});
}
this.actualOptions = this.options
this.canvasReset();
window.addEventListener("resize", this.canvasReset);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
destroyed() {
window.removeEventListener("resize", this.canvasReset);
},
methods: {
canvasReset() {
debounce(() => {
this.initChart();
}, 500)();
},
initChart() {
if (this.chart) {
this.chart.dispose();
}
this.chart = echarts.init(this.$refs.ftoChart);
this.chart.setOption(this.actualOptions);
},
},
};
</script>
<style scoped lang="scss">
.bar-chart-base {
// position: relative;
.legend {
position: absolute;
top: 5.2vh;
right: 1vw;
}
.legend-item {
position: relative;
// font-size: 12px;
margin-right: 0.67vw;
&::before {
content: "";
display: inline-block;
width: 0.531vw;
height: 0.531vw;
background-color: #ccc;
border-radius: 2px;
margin-right: 0.22vw;
}
}
.legend-item:nth-child(1):before {
background-color: #12f7f1;
}
.legend-item:nth-child(2):before {
background-color: #58adfa;
}
}
</style>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-13 14:08:51 * @Date: 2024-05-13 14:08:51
* @LastEditTime: 2024-05-17 09:37:01 * @LastEditTime: 2024-05-23 15:18:53
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -191,7 +191,7 @@ export default {
console.log(this.width) console.log(this.width)
} else { } else {
console.log('ryf') console.log('ryf')
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }
}, },
@ -201,7 +201,7 @@ export default {
this.width = 97 + '%' this.width = 97 + '%'
this.canvasReset() this.canvasReset()
} else if (val === false && this.isOpen === false) { } else if (val === false && this.isOpen === false) {
this.watch = 100 + '%' this.width = 100 + '%'
this.canvasReset() this.canvasReset()
} }
// this.actualOptions.series.map((item) => { // this.actualOptions.series.map((item) => {

View File

@ -1,4 +1,3 @@
<!-- <!--
filename: container.vue filename: container.vue
author: liubin author: liubin
@ -8,12 +7,13 @@
<template> <template>
<!-- <div class="copilot-layout" ref="copilot-layout"> --> <!-- <div class="copilot-layout" ref="copilot-layout"> -->
<div class="copilot-layout" ref="copilot-layout" :class="[page == '效率' ? 'other' : 'produce' ]"> <div class="copilot-layout produce" ref="copilot-layout">
<CopilotHeaderVue :active="page" :period="period" @update:active="page = $event" @update:period="period = $event" /> <CopilotHeaderVue :than="than" :active="page" :period="period" @update:active="updateActive" @update:period="period = $event"
@update:than="updateThan" />
<YieldCopilot v-if="page == '产量'" :period="period" /> <YieldCopilot :period="period" :than="than" />
<EnergyCopilot v-if="page == '综合'" :period="period" /> <!-- <EnergyCopilot v-if="page == '综合'" :period="period" /> -->
<EfficiencyCopilot v-if="page == '效率'" :period="period" /> <!-- <EfficiencyCopilot v-if="page == '效率'" :period="period" /> -->
<div class="copilot-footer">© 中建材智能自动化研究院有限公司</div> <div class="copilot-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
</template> </template>
@ -21,24 +21,55 @@
<script> <script>
import CopilotHeaderVue from "./components/CopilotHeader.vue"; import CopilotHeaderVue from "./components/CopilotHeader.vue";
import YieldCopilot from "./yield/index.vue"; import YieldCopilot from "./yield/index.vue";
import EnergyCopilot from "./energy/index.vue"; // import EnergyCopilot from "./energy/index.vue";
import EfficiencyCopilot from "./efficiency/index.vue"; // import EfficiencyCopilot from "./efficiency/index.vue";
export default { export default {
name: "CopilotContainer", name: "CopilotContainer",
components: { components: {
CopilotHeaderVue, CopilotHeaderVue,
YieldCopilot, YieldCopilot,
EnergyCopilot, // EnergyCopilot,
EfficiencyCopilot, // EfficiencyCopilot,
}, },
data() { data() {
return { return {
page: "产量", page: "产量",
period: "日", period: "月",
than:'同比',
currentsStyles: '', currentsStyles: '',
}; };
}, },
methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateActive(val, oldVal) {
console.log(val)
if (val === '效率') {
this.$router.push({
path: 'efficiency-container',
query: {
name: '效率'
}
})
// this.page = oldVal
} else if (val === '产量') {
this.$router.push({
path: 'main',
query: {
name: '产量'
}
})
// this.page = oldVal
}
}
},
// mounted() {
// this.page = this.$route.query.name
// },
// watch: { // watch: {
// page(val) { // page(val) {
// if (val === '') { // if (val === '') {
@ -65,7 +96,6 @@ export default {
}; };
</script> </script>
<style> <style>
.copilot-layout { .copilot-layout {
padding: 16px; padding: 16px;
background: url(../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat; background: url(../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
@ -84,9 +114,11 @@ export default {
.produce { .produce {
height: calc(100% + 38px); height: calc(100% + 38px);
} }
.other { .other {
height: calc(100% + 240px); height: calc(100% + 240px);
} }
.copilot-footer { .copilot-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -25,88 +25,256 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
chipOeeRate: {
type: Object,
default:{}
}
}, },
data() { data() {
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
xAxis: cities, xAxis: cities,
}; };
}, },
computed: { computed: {
legend() { legend() {
switch (this.period) { let items = [];
case "日": var day1 = new Date();
return [{ label: "昨日", color: "#12f7f1" }]; day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
case "周": var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
return [{ label: "本周", color: "#12f7f1" }]; //
case "月": { // var day2 = new Date();
const year = new Date().getFullYear(); // day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return [ const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
{ label: `${year - 1}${month}`, color: "#12f7f1" },
{ label: `${year}${month}`, color: "#58adfa" },
];
}
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
return [ if (this.period === '日' && this.than === '同比') {
items = [
{ label: `去年${month}${today}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `去年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `去年${month}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${lastMonth}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else {
items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
];
}
default:
return [
{ label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] },
]; ];
} }
return items
// switch (this.period) {
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "": {
// const year = new Date().getFullYear();
// const month = new Date().getMonth() + 1;
// return [
// { label: `${year - 1}${month}`, color: "#12f7f1" },
// { label: `${year}${month}`, color: "#58adfa" },
// ];
// }
// case "": {
// const year = new Date().getFullYear();
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
// default:
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
}, },
// chipOeeRate() {
// return this.$store.getters.copilot.efficiency.chipOeeRate
// },
series() { series() {
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee); // console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
const { chipOee } = this.$store.getters.copilot.efficiency; const chipOeeRate = this.chipOeeRate
let dataList = null; // console.log('chipOee', chipOeeRate)
let dataList = null
switch (this.period) { switch (this.period) {
case "日": case "日":
dataList = [];
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current;
case "周": case "周":
dataList = chipOee?.current; dataList = [];
case "周": dataList[0] = chipOeeRate?.previous;
dataList = chipOee?.current; dataList[1] = chipOeeRate?.current;
break;
default: default:
dataList = []; dataList = [];
dataList[0] = chipOee?.previous; dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOee?.current; dataList[1] = chipOeeRate?.current
dataList[2] = chipOeeRate?.target
} }
// console.log(dataList) console.log(dataList)
return getTemplate(this.period, dataList); return getTemplate(this.period, dataList,this.than);
}, },
}, },
methods: {}, methods: {},
}; };
function getTemplate(period, dataList) { function getTemplate(period, dataList, than) {
const year = new Date().getFullYear(); // console.log('dataList',dataList);
let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
// console.log('11111', dataList); const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
return period == "日" || period == "周" const year = new Date().getFullYear();
? [ if (period === '日' && than === '同比') {
items = [
{ {
name: period == "日" ? "昨日" : "本周", name: `去年${month}${today}`,
data: dataList ?? [],
},
]
: [
{
name: period == "年" ? `${year - 1}` : `${year - 1}${month}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: period == "年" ? `${year}` : `${year}${month}`, name: `${month}${today}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
]; ];
} else if (period === '日' && than === '环比') {
items = [
{
name: `${yesterday}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
{
name: `去年本周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
{
name: `上周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [
{
name: `去年${month}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '环比') {
items = [
{
name: `${lastMonth}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else {
items = [
{
name: `${year - 1}`,
data: dataList ? dataList[0] : [],
},
{
name: `${year}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${year}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
}
return items
} }
</script> </script>

View File

@ -1,22 +1,15 @@
<!-- <!--
filename: ChipRate.vue * @Author: zhp
author: liubin * @Date: 2024-05-10 11:10:54
date: 2024-04-29 08:50:54 * @LastEditTime: 2024-05-31 16:19:45
description: 芯片良率 * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
<div class="chip-rate"> <div class="chip-rate">
<ChipRateItem <ChipRateItem :period="period" :than="than" :cities="['邯郸', '瑞昌']" :color="1" />
:period="period" <!-- <ChipRateItem :period="period" :than="than" :cities="['佳木斯', '凯盛光伏', '蚌埠兴科']" :color="2" /> -->
:cities="['成都', '邯郸', '株洲', '瑞昌']"
:color="1"
/>
<ChipRateItem
:period="period"
:cities="['佳木斯', '凯盛光伏', '蚌埠兴科']"
:color="2"
/>
</div> </div>
</template> </template>
@ -30,6 +23,10 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: '同比',
}
}, },
data() { data() {
return {}; return {};
@ -46,15 +43,15 @@ export default {
gap: 5px; gap: 5px;
position: relative; position: relative;
&:after { // &:after {
content: ""; // content: "";
position: absolute; // position: absolute;
left: 50%; // left: 50%;
top: 0; // top: 0;
width: 3px; // width: 3px;
height: 100%; // height: 100%;
transform: translateX(-50%); // transform: translateX(-50%);
background: linear-gradient(to bottom, transparent, #00f2ff, transparent); // background: linear-gradient(to bottom, transparent, #00f2ff, transparent);
} // }
} }
</style> </style>

View File

@ -1,18 +1,19 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:25:10 * @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-05-20 10:04:03 * @LastEditTime: 2024-05-31 16:38:29
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="std-rate"> <!-- <div class="order"> -->
<div class="span-2"> <div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px">
<!-- <div class="span-2">
<StdRateItem :period="period" :city="cities[5]" /> <StdRateItem :period="period" :city="cities[5]" />
</div> </div> -->
<div class="flex-item" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name"> <div class="span-2" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name">
<StdRateItem :period="period" :city="item" /> <StdRateItem :period="period" :than="than" :city="item" />
</div> </div>
</div> </div>
</template> </template>
@ -27,6 +28,10 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
computed: { computed: {
cities() { cities() {
@ -44,8 +49,8 @@ export default {
// break; // break;
// } // }
const _cities = [ const _cities = [
{ name: "瑞昌", target: 0, total: 0, current: 0, componentYield: 0, goodNumber:0,}, { name: "瑞昌", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "邯郸", target: 0, total: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "邯郸",target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
@ -75,7 +80,10 @@ export default {
} }
// //
// _cities.splice(4, 1); // _cities.splice(4, 1);
return _cities; let arr = []
arr.push(_cities[0])
arr.push(_cities[1])
return arr;
}, },
}, },
data() { data() {
@ -99,7 +107,7 @@ export default {
.std-rate { .std-rate {
display: flex; display: flex;
// gap: 1px; // gap: 1px;
flex: 1 1 auto; // flex: 1 1 auto;
// display: -webkit-box; // display: -webkit-box;
flex-wrap: wrap; flex-wrap: wrap;
@ -107,6 +115,9 @@ export default {
// grid-template-columns: repeat(2, 1fr); // grid-template-columns: repeat(2, 1fr);
// grid-template-rows: repeat(4, 1fr); // grid-template-rows: repeat(4, 1fr);
} }
.std-rate::-webkit-scrollbar {
display: none;
}
.flex-item{ .flex-item{
// flex: 1 1 auto; // flex: 1 1 auto;
width: 50%; width: 50%;

View File

@ -16,7 +16,7 @@
</template> </template>
<script> <script>
import BarChartBase from "@/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue"; import BarChartBase from "@/views/copilot/efficiency/components/sub/bar/BarChartChipTrans.vue";
export default { export default {
name: "TransformRate", name: "TransformRate",
components: { BarChartBase }, components: { BarChartBase },
@ -25,85 +25,247 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: '同比',
},
transformRate: {
type: Object,
default: {}
}
}, },
data() { data() {
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
xAxis: cities, xAxis: cities,
}; };
}, },
computed: { computed: {
legend() { legend() {
switch (this.period) { let items = [];
case "日": var day1 = new Date();
return [{ label: "昨日", color: "#12f7f1" }]; day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
case "周": var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
return [{ label: "本周", color: "#12f7f1" }]; //
case "月": { // var day2 = new Date();
const year = new Date().getFullYear(); // day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return [ const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
{ label: `${year - 1}${month}`, color: "#12f7f1" },
{ label: `${year}${month}`, color: "#58adfa" },
];
}
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
return [ if (this.period === '日' && this.than === '同比') {
items = [
{ label: `去年${month}${today}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `去年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `去年${month}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${lastMonth}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else {
items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
];
}
default:
return [
{ label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
];
}
},
series() {
const { transformRate } = this.$store.getters.copilot.efficiency;
let dataList = null;
// { label: `${year}`, value: valueTuple[2] },
];
}
return items
},
// transformRate() {
// return this.$store.getters.copilot.efficiency.transformRate
// },
series() {
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
const transformRate = this.transformRate
// console.log('chipOee', chipOeeRate)
let dataList = null;
switch (this.period) { switch (this.period) {
case "日": case "日":
dataList = [];
dataList[0] = transformRate.previous;
dataList[1] = transformRate.current;
case "周": case "周":
dataList = transformRate?.current; dataList = [];
break; dataList[0] = transformRate.previous;
dataList[1] = transformRate.current;
default: default:
dataList = []; dataList = [];
dataList[0] = transformRate?.previous; dataList[0] = transformRate.previous;
dataList[1] = transformRate?.current; dataList[1] = transformRate.current
dataList[2] = transformRate.target
} }
console.log('transformRate', dataList)
return getTemplate(this.period, dataList); return getTemplate(this.period, dataList, this.than);
}, },
// series() {
// const { transformRate } = this.$store.getters.copilot.efficiency;
// let dataList = null;
// switch (this.period) {
// case "":
// case "":
// dataList = transformRate?.current;
// break;
// default:
// dataList = [];
// dataList[0] = transformRate?.previous;
// dataList[1] = transformRate?.current;
// }
// return getTemplate(this.period, dataList);
// },
}, },
methods: {}, methods: {},
}; };
function getTemplate(period, dataList) { function getTemplate(period, dataList,than) {
const year = new Date().getFullYear(); // console.log('dataList',dataList);
let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return period == "日" || period == "周" const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
? [ const year = new Date().getFullYear();
if (period === '日' && than === '同比') {
items = [
{ {
name: period == "日" ? "昨日" : "本周", name: `去年${month}${today}`,
data: dataList ?? [],
},
]
: [
{
name: period == "年" ? `${year - 1}` : `${year - 1}${month}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: period == "年" ? `${year}` : `${year}${month}`, name: `${month}${today}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
]; ];
} else if (period === '日' && than === '环比') {
items = [
{
name: `${yesterday}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
{
name: `去年本周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
{
name: `上周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [
{
name: `去年${month}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '环比') {
items = [
{
name: `${lastMonth}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else {
items = [
{
name: `${year - 1}`,
data: dataList ? dataList[0] : [],
},
{
name: `${year}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${year}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
}
return items
} }
</script> </script>

View File

@ -1,17 +1,17 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 13:22:43 * @Date: 2024-05-07 13:22:43
* @LastEditTime: 2024-05-14 08:32:44 * @LastEditTime: 2024-05-31 15:55:00
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<chart-container class="bar-chart-base"> <chart-container class="bar-chart-base">
<div class="legend"> <div class="legend">
<span v-for="item in legend" :key="item.label" class="legend-item" <span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div> </div>
<div ref="chart" :style="{ height: '100%',width: width}"></div> <div ref="oeeChart" style="height:100%;width:100%"></div>
</chart-container> </chart-container>
</template> </template>
@ -171,6 +171,41 @@ export default {
}, },
data: [], // this.series[1].data, data: [], // this.series[1].data,
}, },
{
name: "", // "2024",
type: "line",
lineStyle: {
color: "#f3c000",
},
itemStyle: {
color: "#f3c000",
},
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#f3c000", // 0%
},
{
offset: 0.55,
color: "#f3c00033",
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
], ],
}, },
}; };
@ -182,40 +217,57 @@ export default {
}, },
watch: { watch: {
isOpen(val) { isOpen(val) {
if (val === true) {
this.width = '100%-128px'
this.canvasReset() this.canvasReset()
} else {
this.watch = 100 + '%'
this.canvasReset()
}
}, },
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) { // isFullscreen(val) {
this.actualOptions.series.map((item) => { // this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12; // item.barWidth = val ? 18 : 12;
}); // });
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions); // // if (val === false && this.isOpen === true) {
}, // // console.log(val)
// // this.width = 97 + '%'
// // this.canvasReset()
// // } else if (val === false && this.isOpen === false) {
// // this.width = 100 + '%'
// // this.canvasReset()
// // }
// // this.actualOptions.series.map((item) => {
// // item.barWidth = val ? 18 : 12;
// // });
// // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initChart(this.actualOptions)
// this.canvasReset()
// },
series(val) { series(val) {
if (!val) { if (!val) {
this.initChart(this.options); this.initChart(this.options);
return; return;
} }
console.log(val) // console.log('val', val)
const actualOptions = JSON.parse(JSON.stringify(this.options)) const actualOptions = JSON.parse(JSON.stringify(this.options))
console.log(actualOptions)
actualOptions.series[0].data = val[0].data; actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name; actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val?.[1]?.data || []; actualOptions.series[1].data = val?.[1]?.data;
actualOptions.series[1].name = val?.[1]?.name || ""; actualOptions.series[1].name = val?.[1]?.name;
actualOptions.series[2].data = val?.[2]?.data || [];
actualOptions.series[2].name = val?.[2]?.name || "";
this.actualOptions = actualOptions; this.actualOptions = actualOptions;
this.initChart(actualOptions); this.initChart(actualOptions);
}, },
}, },
mounted() { mounted() {
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
// if (screenfull.isEnabled) { // if (screenfull.isEnabled) {
// screenfull.on("change", () => { // screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen; // this.isFullscreen = screenfull.isFullscreen;
@ -243,7 +295,7 @@ export default {
if (this.chart) { if (this.chart) {
this.chart.dispose(); this.chart.dispose();
} }
this.chart = echarts.init(this.$refs.chart); this.chart = echarts.init(this.$refs.oeeChart);
this.chart.setOption(this.actualOptions); this.chart.setOption(this.actualOptions);
}, },
}, },
@ -263,7 +315,7 @@ export default {
.legend-item { .legend-item {
position: relative; position: relative;
// font-size: 12px; // font-size: 12px;
margin-right: 0.67vw; margin-right: 1.3vw;
&::before { &::before {
content: ""; content: "";
@ -275,7 +327,34 @@ export default {
margin-right: 0.22vw; margin-right: 0.22vw;
} }
} }
.legend-item:nth-child(3):before {
// width: 12px;
// height: 2px;
width: 1vw;
height: 0.1064vw;
background-color: #f3c000;
position: absolute;
top: 50%;
// left: -16px;
left: -0.951vw;
transform: translateY(-50%);
}
.legend-item:nth-child(3):after {
background-color: #f3c000;
content: "";
display: inline-block;
position: absolute;
// width: 6px;
// height: 6px;
width: 0.3191vw;
height: 0.3191vw;
border-radius: 100%;
top: 50%;
left: -0.851vw;
// left: -16px;
transform: translateY(-50%) translateX(50%);
}
.legend-item:nth-child(1):before { .legend-item:nth-child(1):before {
background-color: #12f7f1; background-color: #12f7f1;
} }

View File

@ -0,0 +1,366 @@
<!--
* @Author: zhp
* @Date: 2024-05-23 15:50:44
* @LastEditTime: 2024-05-31 15:54:41
* @LastEditors: zhp
* @Description:
-->
<template>
<chart-container class="bar-chart-base">
<div class="legend">
<span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div>
<div ref="oeeChart" style="height:100%;width:100%"></div>
</chart-container>
</template>
<script>
import screenfull from "screenfull";
import ChartContainer from "../../../../components/ChartContainer.vue";
// import chartMixin from "@/mixins/chart.js";
import { debounce } from "@/utils/debounce";
import * as echarts from "echarts";
export default {
name: "BarChartBase",
components: {
ChartContainer,
},
// mixins: [chartMixin],
props: {
vHeight: {
type: Number,
default: 36,
},
legend: {
type: Array,
required: true,
},
xAxis: {
type: Array,
required: true,
},
series: {
type: Array,
required: true,
},
in: {
type: String,
default: "",
},
},
data() {
return {
width: '100%',
isFullscreen: false,
actualOptions: null,
options: {
grid: {
left: "5%",
right: "0%",
bottom: "3%",
top: "15%",
containLabel: true,
},
tooltip: {},
xAxis: {
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#4561AE",
},
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
data: this.xAxis,
},
yAxis: {
name: "单位/%",
nameTextStyle: {
color: "#fff",
fontSize: 12,
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#4561AE",
},
},
splitLine: {
lineStyle: {
color: "#4561AE",
},
},
},
series: [
{
name: "", // this.series[0].name,
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#12f7f1", // 0%
},
{
offset: 0.35,
color: "#12f7f177", // 100%
},
{
offset: 0.75,
color: "#12f7f133", // 100%
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
{
name: "", // this.series[1].name,
type: "bar",
barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[1].data,
},
{
name: "", // "2024",
type: "line",
lineStyle: {
color: "#f3c000",
},
itemStyle: {
color: "#f3c000",
},
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#f3c000", // 0%
},
{
offset: 0.55,
color: "#f3c00033",
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
],
},
};
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened
},
},
watch: {
isOpen(val) {
this.canvasReset()
},
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) {
this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12;
});
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// if (val === false && this.isOpen === true) {
// console.log(val)
// this.width = 97 + '%'
// this.canvasReset()
// } else if (val === false && this.isOpen === false) {
// this.width = 100 + '%'
// this.canvasReset()
// }
// this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12;
// });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initChart(this.actualOptions)
// this.canvasReset()
},
series(val) {
if (!val) {
this.initChart(this.options);
return;
}
console.log(val)
const actualOptions = JSON.parse(JSON.stringify(this.options))
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val?.[1]?.data || [];
actualOptions.series[1].name = val?.[1]?.name || "";
actualOptions.series[2].data = val?.[2]?.data || [];
actualOptions.series[2].name = val?.[2]?.name || "";
this.actualOptions = actualOptions;
this.initChart(actualOptions);
},
},
mounted() {
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
this.actualOptions = this.options
this.canvasReset();
window.addEventListener("resize", this.canvasReset);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
destroyed() {
window.removeEventListener("resize", this.canvasReset);
},
methods: {
canvasReset() {
debounce(() => {
this.initChart();
}, 500)();
},
initChart() {
if (this.chart) {
this.chart.dispose();
}
this.chart = echarts.init(this.$refs.oeeChart);
this.chart.setOption(this.actualOptions);
},
},
};
</script>
<style scoped lang="scss">
.bar-chart-base {
// position: relative;
.legend {
position: absolute;
top: 5.2vh;
right: 1vw;
}
.legend-item {
position: relative;
// font-size: 12px;
margin-right:1.3vw;
&::before {
content: "";
display: inline-block;
width: 0.531vw;
height: 0.531vw;
background-color: #ccc;
border-radius: 2px;
margin-right: 0.22vw;
}
}
.legend-item:nth-child(1):before {
background-color: #12f7f1;
}
.legend-item:nth-child(2):before {
background-color: #58adfa;
}
.legend-item:nth-child(3):before {
// width: 12px;
// height: 2px;
width: 1vw;
height: 0.1064vw;
background-color: #f3c000;
position: absolute;
top: 50%;
// left: -16px;
left: -0.951vw;
transform: translateY(-50%);
}
.legend-item:nth-child(3):after {
background-color: #f3c000;
content: "";
display: inline-block;
position: absolute;
// width: 6px;
// height: 6px;
width: 0.3191vw;
height: 0.3191vw;
border-radius: 100%;
top: 50%;
left: -0.851vw;
// left: -16px;
transform: translateY(-50%) translateX(50%);
}
}
</style>

View File

@ -13,7 +13,7 @@
<!-- <div style="flex:1;padding: 0 20%;"> --> <!-- <div style="flex:1;padding: 0 20%;"> -->
<div class="chart" ref="chart"></div> <div class="chart" ref="chart"></div>
<!-- </div> --> <!-- </div> -->
<div class="legend" v-if="period == '月' || period == '年'"> <div class="legend" >
<div class="legend-item" v-for="lgd in legend" :key="lgd.label"> <div class="legend-item" v-for="lgd in legend" :key="lgd.label">
<span class="legend-item__value">{{ lgd.value }}</span> <span class="legend-item__value">{{ lgd.value }}</span>
<span class="legend-item__label">{{ lgd.label }}</span> <span class="legend-item__label">{{ lgd.label }}</span>
@ -46,6 +46,10 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: '同比',
}
}, },
data() { data() {
return { return {
@ -75,15 +79,64 @@ export default {
]; ];
}, },
options() { options() {
const single = this.period === "日" || this.period === "周"; // const single = this.period === "" || this.period === "";
const today = new Date().getDate();
const year = new Date().getFullYear(); const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const vt = this.valueTuple; const vt = this.valueTuple;
let titleValue = single let items = [];
? (vt[1] != null && `${vt[1] * 100}%`) || "0%" var day1 = new Date();
: vt[0] != null && vt[2] != null && vt[2] !== 0 day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
? `${((vt[1] / vt[2]) * 100).toFixed(0)}%` var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
: "0%", //
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
// const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
// const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
// const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') {
items = [
{ label: `${month}${today}日良率`, },
{ label: `去年${month}${today}日良率` },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${month}${today}日良率` },
{ label: `${yesterday}日良率` },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `本周良率`, },
{ label: `去年本周良率` },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `本周良率`, },
{ label: `上周良率`, },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `${month}月良率`, },
{ label: `去年${month}月良率`, },
{ label: `${month}月目标良率`, },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${month}月良率`, },
{ label: `${lastMonth}月良率`, },
{ label: `${month}月目标良率`, },
];
} else {
items = [
{ label: `${year}年良率`, },
{ label: `${year - 1}年良率` },
{ label: `${year}年目标良率` },
];
}
let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%',
subtitle = { subtitle = {
: "本日良率", : "本日良率",
: "本周良率", : "本周良率",
@ -92,10 +145,12 @@ export default {
}[this.period]; }[this.period];
const t = getOptions({ const t = getOptions({
single, // single,
color: this.color == 1 ? "#4CF0E8" : "#1065ff", color: this.color == 1 ? "#4CF0E8" : "#1065ff",
titleValue, titleValue,
subtitle, subtitle,
currentName: items[0].label,
preName: items[1].label,
previousSum: vt[0], previousSum: vt[0],
currentSum: vt[1], currentSum: vt[1],
targetSum: vt[2], targetSum: vt[2],
@ -103,21 +158,76 @@ export default {
return t; return t;
}, },
legend() { legend() {
const year = new Date().getFullYear(); let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return [ const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
{ const year = new Date().getFullYear();
label: if (this.period === '日' && this.than === '同比') {
this.period == "月" items = [
? `${year - 1}${month}月良率` { label: `去年${month}${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" },
: `${year - 1}年良率`, { label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
value: isNaN((this.valueTuple[0] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[0] * 100).toFixed(0) + "%"
},
{
label: this.period == "月" ? `${month}月良率` : `${year}年良率`,
value: isNaN((this.valueTuple[1] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[1] * 100).toFixed(0) + "%"
},
]; ];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else {
items = [
{ label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
{ label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
{ label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
}
return items
// [
// {
// label:
// this.period == ""
// ? `${year - 1}${month}`
// : `${year - 1}`,
// value: isNaN((this.valueTuple[0] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[0] * 100).toFixed(0) + "%"
// },
// {
// label: this.period == "" ? `${month}` : `${year}`,
// value: isNaN((this.valueTuple[1] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[1] * 100).toFixed(0) + "%"
// },
// ];
}, },
}, },
mounted() { mounted() {
@ -136,6 +246,15 @@ export default {
}, },
}, },
methods: { methods: {
formatNumber(num) {
//
if (Number.isInteger(num)) {
return num; //
} else {
//
return num.toFixed(2);
}
},
handleCityUpdate(id) { handleCityUpdate(id) {
this.factoryId = id; this.factoryId = id;
}, },
@ -161,12 +280,11 @@ export default {
.chart { .chart {
// margin-left: 5%; // margin-left: 5%;
// width: 290px; // width: 290px;
align-self: stretch; flex: 1 1 auto;
// flex: 1 1 auto; padding: 0 15%;
// padding: 0 10%;
/* margin: 10%; */ /* margin: 10%; */
/* min-width: 300px; */ /* min-width: 300px; */
height: 200px; align-self: stretch;
} }
.legend { .legend {
height: 80px; height: 80px;

View File

@ -6,7 +6,7 @@
--> -->
<template> <template>
<div class="progress-bar" :data-title="titleYear" :data-rate="number"> <div class="progress-bar" :data-title="title" :data-rate="value + '%'">
<div class="progress-bar__rate" :style="{ width: dataRate == '-' ? 0 : dataRate }"></div> <div class="progress-bar__rate" :style="{ width: dataRate == '-' ? 0 : dataRate }"></div>
</div> </div>
</template> </template>
@ -20,52 +20,25 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
target: { // total: {
type: Number, // type: Number,
default: 0, // default: 0,
}, // },
goodNumber: {
type: Number,
default:0
},
componentYield: {
type: Number,
default:0
},
period: {
type: String,
default:'日',
},
title: { title: {
type: String, type: String,
default: "", default: "",
}, },
city: {
type: String,
default:""
}
}, },
data() { data() {
return { return {};
number: 0,
titleYear:'',
};
}, },
computed: { computed: {
dataRate() { dataRate() {
if ((this.period === '年' || this.period === '月') && this.target != 0) {
// console.log(this.componentYield)
this.titleYear = this.title + ' ' + `${(this.target * 100).toFixed(0)}%`
} else {
this.titleYear = this.title
}
this.number = this.value == 0
? "-"
: `${(this.value * 100).toFixed(0)}%`
// console.log(this.period)
return this.value == 0 return this.value == 0
? "-" ? "-"
: this.value >1 ? 100 + '%' :`${(this.value * 100).toFixed(0)}%` : this.value > 1
? 100 + '%'
: `${(parseFloat(this.value)).toFixed(0)}%`;
}, },
}, },
methods: {}, methods: {},
@ -95,7 +68,7 @@ export default {
color: #fff; color: #fff;
position: absolute; position: absolute;
bottom: -200%; bottom: -200%;
right: 10px; right: 0;
font-size: 12px; font-size: 12px;
} }
@ -104,6 +77,7 @@ export default {
color: #11eae3; color: #11eae3;
} }
} }
&:nth-child(2) { &:nth-child(2) {
&:after { &:after {
color: #0e65fd; color: #0e65fd;
@ -116,17 +90,20 @@ export default {
height: 100%; height: 100%;
width: 0; width: 0;
border-radius: 4px; border-radius: 4px;
background: linear-gradient(to right,
#004c5e11 10%,
#004c5e,
#0ac0c0,
#11eae3);
} }
&:first-child { &:first-child {
.progress-bar__rate { .progress-bar__rate {
background: linear-gradient( background: linear-gradient(to right,
to right,
#004c5e11 10%, #004c5e11 10%,
#004c5e, #004c5e,
#0ac0c0, #0ac0c0,
#11eae3 #11eae3);
);
} }
} }

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:25:10 * @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-05-20 09:46:19 * @LastEditTime: 2024-05-29 17:03:00
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -11,28 +11,30 @@
<CityName :value="city.name" /> <CityName :value="city.name" />
<div class="std-rate-item__value"> <div class="std-rate-item__value">
<ProgressBar :period="period" :title="title" :value="city.current" /> <ProgressBar :period="period" :title="title" :value="city.current" />
<!-- <ProgressBar title="24年累计" :total="city.target" :value="city.thisYear" /> --> <ProgressBar :period="period" :title="titlePre" :value="city.previous" />
</div> </div>
</div> </div>
<div v-else-if="period == ''" class="std-rate-item"> <div v-else-if="period == ''" class="std-rate-item">
<CityName :value="city.name" /> <CityName :value="city.name" />
<div class="std-rate-item__value"> <div class="std-rate-item__value">
<ProgressBar :period="period" :title="title" :value="city.current" /> <ProgressBar :period="period" :title="title" :value="city.current" />
<!-- <ProgressBar title="24年累计" :total="city.target" :value="city.thisYear" /> --> <ProgressBar :period="period" :title="titlePre" :value="city.previous" />
</div> </div>
</div> </div>
<div v-else-if="period == ''" class="std-rate-item"> <div v-else-if="period == ''" class="std-rate-item">
<CityName :value="city.name" /> <CityName :value="city.name" />
<div class="std-rate-item__value"> <div class="std-rate-item__value">
<ProgressBar :period="period" :title="titleEnd" :target="city.target" :value="city.current" /> <ProgressBar :period="period" :title="titleTarget" :value="city.target" />
<ProgressBar :period="period" :title="title" :value="city.previous" /> <ProgressBar :period="period" :title="titlePre" :value="city.previous" />
<ProgressBar :period="period" :title="title" :value="city.current" />
</div> </div>
</div> </div>
<div v-else="period == '年'" class="std-rate-item"> <div v-else="period == '年'" class="std-rate-item">
<CityName :value="city.name" /> <CityName :value="city.name" />
<div class="std-rate-item__value"> <div class="std-rate-item__value">
<ProgressBar :period="period" :title="titleEnd" :target="city.target" :value="city.current" /> <ProgressBar :period="period" :title="titleTarget" :value="city.target" />
<ProgressBar :period="period" :title="title" :value="city.previous" /> <ProgressBar :period="period" :title="titlePre" :value="city.previous" />
<ProgressBar :period="period" :title="title" :value="city.current" />
</div> </div>
</div> </div>
</template> </template>
@ -52,7 +54,11 @@ export default {
period: { period: {
type: String, type: String,
default: "日", default: "日",
} },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return { return {
@ -60,45 +66,66 @@ export default {
}; };
}, },
computed: { computed: {
title() { titlePre() {
switch (this.period) { console.log(this.city);
case "日": var day1 = new Date();
return "今日" day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
case "周": var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
return "本周" const today = new Date().getDate();
case "月":
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return `${year - 1}${month}月累计` const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// return [ if (this.period === '日' && this.than === '同比') {
return `${year - 1}年累计` return `去年${month}${today}`
// ]; } else if (this.period === '日' && this.than === '环比') {
} return `${yesterday}`
default: } else if (this.period === '周' && this.than === '同比') {
return "今日" return `去年本周`
} else if (this.period === '周' && this.than === '环比') {
return `上周`
} else if (this.period === '月' && this.than === '同比') {
return `去年${month}`
} else if (this.period === '月' && this.than === '环比') {
return `${lastMonth}`
} else {
return `${year - 1}`
} }
}, },
titleEnd() { title() {
switch (this.period) { var day1 = new Date();
// case "": day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
// return "" const today = new Date().getDate();
// case "":
// return ""
case "月":
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return `${year}${month}月目标`
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// return [ if (this.period === '日' && this.than === '同比') {
return `${month}${today}`
} else if (this.period === '日' && this.than === '环比') {
return `${month}${today}`
} else if (this.period === '周' && this.than === '同比') {
return `本周`
} else if (this.period === '周' && this.than === '环比') {
return `本周`
} else if (this.period === '月' && this.than === '同比') {
return `${month}`
} else if (this.period === '月' && this.than === '环比') {
return `${month}`
} else {
return `${year}`
}
},
titleTarget() {
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
const today = new Date().getDate();
const month = new Date().getMonth() + 1;
const year = new Date().getFullYear();
if (this.period === '月') {
return `${month}月目标`
} else if (this.period === '年') {
return `${year}年目标` return `${year}年目标`
// ];
}
}
} }
}, },
},
}; };
</script> </script>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:04:53 * @Date: 2024-05-07 10:04:53
* @LastEditTime: 2024-05-17 17:05:36 * @LastEditTime: 2024-05-31 13:19:34
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -9,16 +9,16 @@
<template> <template>
<div class="efficiency-copilot"> <div class="efficiency-copilot">
<Container title="芯片良率" icon="chip2"> <Container title="芯片良率" icon="chip2">
<ChipRate :period="period" /> <ChipRate :period="period" :than="than" />
</Container> </Container>
<Container title="标准组件良率" icon="std"> <Container title="标准组件良率" icon="std">
<StdRate :period="period" /> <StdRate :period="period" :than="than" />
</Container> </Container>
<Container title="芯片OEE" icon="chip"> <Container title="芯片OEE" icon="chip">
<ChipOee :period="period" /> <ChipOee :chipOeeRate="chipOeeRate" :period="period" :than="than" />
</Container> </Container>
<Container title="转化效率" icon="cube"> <Container title="转化效率" icon="cube">
<TransformRate :period="period" /> <TransformRate :transformRate="transformRate" :period="period" :than="than" />
</Container> </Container>
</div> </div>
</template> </template>
@ -44,25 +44,45 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return {}; return {
chipOeeRate: {},
transformRate:{}
};
}, },
watch: { watch: {
period: { period: {
handler(val) { handler(val) {
val && this.fetchData(val); val && this.fetchData(val,this.than);
},
immediate: true,
},
than: {
handler(val) {
console.log(val)
val && this.fetchData(this.period, val);
}, },
immediate: true, immediate: true,
}, },
}, },
methods: { methods: {
fetchData(period = "日") { fetchData(period = "日",than) {
console.log(`效率驾驶舱,获取${period}数据`); console.log(`效率驾驶舱,获取${period}数据`);
this.$store.dispatch("copilot/initCopilot", { this.$store.dispatch("copilot/initCopilot", {
period, period,
source: "efficiency", source: "efficiency",
}); than
}).then(() => {
this.$nextTick(() => {
this.chipOeeRate = this.$store.getters.copilot.efficiency.chipOeeRate
this.transformRate = this.$store.getters.copilot.efficiency.transformRate
})
})
}, },
}, },
}; };

View File

@ -1,13 +1,12 @@
export default function ({ export default ({
single = false,
color,
titleValue, titleValue,
subtitle, subtitle,
previousSum, previousSum,
currentSum, currentSum,
targetSum, targetSum,
}) { currentName,
return { preName,
}) => ({
grid: { grid: {
left: 0, left: 0,
right: 0, right: 0,
@ -15,15 +14,11 @@ export default function ({
top: 0, top: 0,
containLabel: true, containLabel: true,
}, },
tooltip: { tooltip: {},
// formatter(params) {
// return `${params.name}: ${(params.value * 100).toFixed(0)}%`;
// }
},
title: { title: {
text: titleValue, text: titleValue,
left: "49%", left: "44%",
top: "39%", top: "37%",
textAlign: "center", textAlign: "center",
textStyle: { textStyle: {
fontWeight: 600, fontWeight: 600,
@ -42,18 +37,18 @@ export default function ({
// 背景 series // 背景 series
{ {
type: "pie", type: "pie",
name: "当前目标", name: "当前良率",
radius: ["70%", "85%"], radius: ["70%", "85%"],
center: ["50%", "52%"], center: ["45%", "52%"],
emptyCircleStyle: { emptyCircleStyle: {
color: "#040c5f45", color: "#042c5f33",
}, },
}, },
// 数据 series // 数据 series
{ {
type: "pie", type: "pie",
radius: ["70%", "85%"], radius: ["70%", "85%"],
center: ["50%", "52%"], center: ["45%", "52%"],
avoidLabelOvervlap: false, avoidLabelOvervlap: false,
label: { label: {
show: false, show: false,
@ -64,7 +59,7 @@ export default function ({
data: [ data: [
{ {
value: currentSum, value: currentSum,
name: "当前良率", name: currentName,
selected: false, selected: false,
itemStyle: { itemStyle: {
borderJoin: "round", borderJoin: "round",
@ -77,12 +72,7 @@ export default function ({
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: single colorStops: [
? [
{ offset: 0, color: `${color}11` },
{ offset: 1, color: `${color}` },
]
: [
{ offset: 0, color: "#4CF0E811" }, { offset: 0, color: "#4CF0E811" },
{ offset: 1, color: "#4CF0E8" }, { offset: 1, color: "#4CF0E8" },
], ],
@ -90,28 +80,20 @@ export default function ({
}, },
}, },
{ {
value: value:currentSum == 0
targetSum > currentSum
? targetSum - currentSum
: targetSum == 0
? currentSum == 0
? 1 ? 1
: 0 : 0,
: targetSum, name: "未达成良率",
name: "未达成",
itemStyle: { color: "transparent" }, itemStyle: { color: "transparent" },
label: { show: false }, label: { show: false },
}, },
], ],
}, },
// 数据 series2 - 2023累计 // 数据 series2 - 2023累计
single {
? null
: {
type: "pie", type: "pie",
radius: ["55%", "70%"], radius: ["55%", "70%"],
center: ["50%", "52%"], center: ["45%", "52%"],
avoidLabelOvervlap: false, avoidLabelOvervlap: false,
label: { label: {
show: false, show: false,
@ -122,7 +104,7 @@ export default function ({
data: [ data: [
{ {
value: previousSum, value: previousSum,
name: "上期良率", name: preName,
selected: false, selected: false,
itemStyle: { itemStyle: {
borderJoin: "round", borderJoin: "round",
@ -143,21 +125,14 @@ export default function ({
}, },
}, },
{ {
value: value:previousSum == 0
targetSum > previousSum
? targetSum - previousSum
: previousSum == 0
? 1 ? 1
: 0, : 0,
name: "-", name: "-",
formatter: {
show: false
},
itemStyle: { color: "transparent" }, itemStyle: { color: "transparent" },
label: { show: false }, label: { show: false },
}, },
], ],
}, },
], ],
}; });
}

View File

@ -6,7 +6,7 @@ export default ({
targetSum, targetSum,
}) => ({ }) => ({
grid: { grid: {
left: 0, left: '50%',
right: 0, right: 0,
bottom: 0, bottom: 0,
top: 0, top: 0,

View File

@ -0,0 +1,131 @@
<!--
* @Author: zhp
* @Date: 2024-05-20 16:04:18
* @LastEditTime: 2024-05-31 13:16:26
* @LastEditors: zhp
* @Description:
-->
<template>
<!-- <div class="copilot-layout" ref="copilot-layout"> -->
<div class="copilot-layout" ref="copilot-layout">
<CopilotHeaderVue :than="than" :active="page" :period="period" @update:active="updateActive"
@update:period="period = $event" @update:than="updateThan" />
<!-- <YieldCopilot v-if="page == '产量'" :period="period" /> -->
<!-- <EnergyCopilot v-if="page == '综合'" :period="period" /> -->
<EfficiencyCopilot :period="period" :than="than" />
<div class="copilot-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import CopilotHeaderVue from "./components/CopilotHeader.vue";
// import YieldCopilot from "./yield/index.vue";
// import EnergyCopilot from "./energy/index.vue";
import EfficiencyCopilot from "./efficiency/index.vue";
export default {
name: "CopilotContainer",
components: {
CopilotHeaderVue,
EfficiencyCopilot,
},
data() {
return {
than:'同比',
page: "效率",
period: "月",
currentsStyles: '',
};
},
methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateActive(val, oldVal) {
console.log(val)
if (val === '效率') {
this.$router.push({
path: 'efficiency-container',
query: {
name: '效率'
}
})
// this.page = oldVal
} else if (val === '产量') {
this.$router.push({
path: 'main',
query: {
name: '产量'
}
})
// this.page = oldVal
}
}
},
// mounted() {
// this.page = this.$route.query.name
// },
// watch: {
// page(val) {
// if (val === '') {
// console.log(val)
// this.currentsStyles =
// 'height: calc(100% + 38px)'
// console.log(this.currentsStyles)
// } else {
// console.log(val)
// this.currentsStyles = 'height:100%+38px'
// console.log(this.currentsStyles)
// }
// immediate: true
// }
// }
// mounted() {
// document.body.style.minHeight = "1024px";
// document.body.style.minWidth = "1550px";
// },
// destroyed() {
// document.body.style.minHeight = "1024px";
// document.body.style.minWidth = "1550px";
// },
};
</script>
<style>
.copilot-layout {
padding: 16px;
background: url(../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
left: -16px;
/* top: -8px; */
height: calc(100% + 240px);
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
}
.produce{
height: calc(100% + 38px);
}
.other {
/* height: calc(100% + 240px); */
}
.copilot-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
</style>

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 6,
companyName: "蚌埠中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
}else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 4,
companyName: "成都中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -0,0 +1,417 @@
<template>
<div class="left-chart-base">
<!-- <div class="legend">
<span v-for="item in legend" :key="item.label" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.85vw' : '0.73vw' }">{{ item.label }}</span>
</div> -->
<div id="factoryEnergyChart" style="width: 100%; height: 100%"></div>
</div>
</template>
<script>
import { debounce } from "@/utils/debounce";
import * as echarts from "echarts";
export default {
name: "Energy",
props: {
// legend: {
// type: Array,
// required: true,
// },
energyCockpits: {
type: Array,
required: true,
},
},
data() {
return {
isFullscreen: false,
actualOptions: null,
chart: "",
options: {
color: ["#FFD160", "#2760FF", "#12FFF5"],
grid: {
left: "7%",
right: "7%",
bottom: "8%",
top: "15%",
},
tooltip: {
trigger: "axis",
},
xAxis: {
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#4561AE",
},
},
axisLabel: {
color: "rgba(255, 255, 255, 0.7)",
fontSize: 12,
},
data: [],
},
yAxis: {
type: "value",
name: "单位/片",
nameTextStyle: {
color: "rgba(255, 255, 255, 0.7)",
fontSize: 12,
align: "right",
},
axisTick: {
show: false,
},
axisLabel: {
color: "rgba(255, 255, 255, 0.7)",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#4561AE",
},
},
splitLine: {
lineStyle: {
color: "#4561AE",
},
},
},
series: [
// {
// name: "",
// data: [],
// type: "line",
// areaStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// { offset: 0, color: "#FFD160" + "80" },
// { offset: 0.5, color: "#FFD160" + "20" },
// { offset: 1, color: "#FFD160" + "00" },
// ]),
// },
// lineStyle: {
// width: 2,
// },
// symbol: "circle",
// symbolSize: 8,
// emphasis: {
// focus: "series",
// },
// },
// {
// name: "",
// data: [],
// type: "line",
// yAxisIndex: 1,
// areaStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// { offset: 0, color: "#2760FF" + "80" },
// { offset: 0.5, color: "#2760FF" + "20" },
// { offset: 1, color: "#2760FF" + "00" },
// ]),
// },
// lineStyle: {
// width: 2,
// },
// symbol: "circle",
// symbolSize: 8,
// emphasis: {
// focus: "series",
// },
// },
{
name: "",
data: [],
type: "bar",
// yAxisIndex: 1,
// areaStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// { offset: 0, color: "#12FFF5" + "80" },
// { offset: 0.5, color: "#12FFF5" + "20" },
// { offset: 1, color: "#12FFF5" + "00" },
// ]),
// },
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
},
symbol: "circle",
symbolSize: 8,
emphasis: {
focus: "series",
},
},
],
},
};
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened;
},
},
watch: {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
// isFullscreen(val) {
// this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12;
// });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initOptions(this.actualOptions);
// },
// series(val) {
// if (!val) {
// this.initOptions(this.options);
// return;
// }
// const actualOptions = JSON.parse(JSON.stringify(this.options));
// actualOptions.series[0].data = val[0].data;
// actualOptions.series[0].name = val[0].name;
// actualOptions.series[1].data = val[1].data;
// actualOptions.series[1].name = val[1].name;
// actualOptions.series[2].data = val[2].data;
// actualOptions.series[2].name = val[2].name;
// this.actualOptions = actualOptions;
// this.initOptions(actualOptions);
// },
energyCockpits() {
this.initChart();
},
isOpen(val) {
this.canvasReset();
},
},
mounted() {
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
this.canvasReset();
window.addEventListener("resize", this.canvasReset);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
destroyed() {
window.removeEventListener("resize", this.canvasReset);
},
methods: {
canvasReset() {
debounce(() => {
this.initChart();
}, 500)();
},
initChart() {
console.log("this.energyCockpits", this.energyCockpits);
let orderXAxis = ['目标产量', '计划投入量', '实际投入量', '实际产出量', '废品数量', '待再加工数量'];
// let n = 0;
let seriesArr =[]
seriesArr[0] = this.energyCockpits.length != 0 && this.energyCockpits[0].targetProduction ? this.energyCockpits[0].targetProduction :0
seriesArr[1] = this.energyCockpits.length != 0 && this.energyCockpits[0].plannedInvestment ? this.energyCockpits[0].plannedInvestment : 0
seriesArr[2] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualInvestment ? this.energyCockpits[0].actualInvestment : 0
seriesArr[3] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualProduction ? this.energyCockpits[0].actualProduction : 0
seriesArr[4] = this.energyCockpits.length != 0 && this.energyCockpits[0].wasteNum ? this.energyCockpits[0].wasteNum : 0
seriesArr[5] = this.energyCockpits.length != 0 && this.energyCockpits[0].reworkNum ? this.energyCockpits[0].reworkNum : 0
console.log(seriesArr);
// let seriesArr = [
// {
// name: "",
// energyType: 1,
// data: [],
// },
// {
// name: "",
// energyType: 2,
// data: [],
// },
// {
// name: "",
// energyType: 3,
// data: [],
// },
// ];
// if (this.energyCockpits.length > 0) {
// let dataArr = this.energyCockpits.map((item) => {
// return item.groupName;
// });
// energyxAxis = Array.from(new Set(dataArr));
// n = energyxAxis.length;
// seriesArr[0].data = Array.from({ length: n }, () => 0);
// seriesArr[1].data = Array.from({ length: n }, () => 0);
// seriesArr[2].data = Array.from({ length: n }, () => 0);
// for (let i = 0; i < this.energyCockpits.length; i++) {
// for (let j = 0; j < energyxAxis.length; j++) {
// if (this.energyCockpits[i].groupName === energyxAxis[j]) {
// if (this.energyCockpits[i].energyType === 1) {
// seriesArr[0].data[j] = this.energyCockpits[i].totalEnergyValue;
// } else if (this.energyCockpits[i].energyType === 2) {
// seriesArr[1].data[j] = this.energyCockpits[i].totalEnergyValue;
// } else if (this.energyCockpits[i].energyType === 3) {
// seriesArr[2].data[j] = this.energyCockpits[i].totalEnergyValue;
// }
// }
// }
// }
// }
if (this.chart) {
this.chart.dispose();
}
this.chart = echarts.init(document.getElementById("factoryEnergyChart"));
const actualOptions = JSON.parse(JSON.stringify(this.options));
actualOptions.xAxis.data = orderXAxis;
actualOptions.series[0].data = seriesArr;
// actualOptions.series[0].name = seriesArr[0].name;
// actualOptions.series[1].data = seriesArr[1].data;
// actualOptions.series[1].name = seriesArr[1].name;
// actualOptions.series[2].data = seriesArr[2].data;
// actualOptions.series[2].name = seriesArr[2].name;
this.actualOptions = actualOptions;
this.chart.setOption(actualOptions);
},
},
};
</script>
<style scoped lang="scss">
.left-chart-base {
// position: relative;
height: 100%;
.legend {
position: absolute;
top: 5.2vh;
right: 4vw;
}
.legend-item {
position: relative;
// font-size: 12px;
margin-right: 1.34vw;
&::before {
content: "";
display: inline-block;
// width: 10px;
// height: 10px;
width: 0.531vw;
height: 0.531vw;
background-color: #ccc;
border-radius: 2px;
margin-right: 0.22vw;
}
}
.legend-item:nth-child(1):before {
// width: 12px;
// height: 2px;
width: 0.638vw;
height: 0.1064vw;
background-color: #ffd160;
position: absolute;
top: 50%;
// left: -16px;
left: -0.851vw;
transform: translateY(-50%);
}
.legend-item:nth-child(1):after {
background-color: #ffd160;
content: "";
display: inline-block;
position: absolute;
// width: 6px;
// height: 6px;
width: 0.3191vw;
height: 0.3191vw;
border-radius: 100%;
top: 50%;
left: -0.851vw;
// left: -16px;
transform: translateY(-50%) translateX(50%);
}
.legend-item:nth-child(2):before {
// width: 12px;
// height: 2px;
width: 0.638vw;
height: 0.1064vw;
background-color: #2760ff;
position: absolute;
top: 50%;
// left: -16px;
left: -0.851vw;
transform: translateY(-50%);
}
.legend-item:nth-child(2):after {
background-color: #2760ff;
content: "";
display: inline-block;
position: absolute;
// width: 6px;
// height: 6px;
width: 0.3191vw;
height: 0.3191vw;
border-radius: 100%;
top: 50%;
left: -0.851vw;
// left: -16px;
transform: translateY(-50%) translateX(50%);
}
.legend-item:nth-child(3):before {
// width: 12px;
// height: 2px;
width: 0.638vw;
height: 0.1064vw;
background-color: #12fff5;
position: absolute;
top: 50%;
// left: -16px;
left: -0.851vw;
transform: translateY(-50%);
}
.legend-item:nth-child(3):after {
background-color: #12fff5;
content: "";
display: inline-block;
position: absolute;
// width: 6px;
// height: 6px;
width: 0.3191vw;
height: 0.3191vw;
border-radius: 100%;
top: 50%;
left: -0.851vw;
// left: -16px;
transform: translateY(-50%) translateX(50%);
}
}
</style>

View File

@ -0,0 +1,343 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 08:58:39
* @LastEditTime: 2024-05-31 15:52:28
* @LastEditors: zhp
* @Description:
-->
<template>
<chart-container class="bar-chart-base">
<div class="legend">
<span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div>
<div ref="oeeChart" style="height:100%"></div>
</chart-container>
</template>
<script>
import screenfull from "screenfull";
import ChartContainer from "./ChartContainer.vue";
// import chartMixin from "@/mixins/chart.js";
import { debounce } from "@/utils/debounce";
import * as echarts from "echarts";
export default {
name: "BarChartBase",
components: {
ChartContainer,
},
// mixins: [chartMixin],
props: {
vHeight: {
type: Number,
default: 36,
},
legend: {
type: Array,
required: true,
},
xAxis: {
type: Array,
required: true,
},
series: {
type: Array,
required: true,
},
in: {
type: String,
default: "",
},
},
data() {
return {
width: '100%',
isFullscreen: false,
actualOptions: null,
options: {
grid: {
left: "5%",
right: "0%",
bottom: "3%",
top: "15%",
containLabel: true,
},
tooltip: {},
xAxis: {
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#4561AE",
},
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
data: this.xAxis,
},
yAxis: {
name: "单位/片",
nameTextStyle: {
color: "#fff",
fontSize: 12,
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#4561AE",
},
},
splitLine: {
lineStyle: {
color: "#4561AE",
},
},
},
series: [
{
name: "fto", // this.series[0].name,
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#12f7f1", // 0%
},
{
offset: 0.35,
color: "#12f7f177", // 100%
},
{
offset: 0.75,
color: "#12f7f133", // 100%
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
{
name: "", // this.series[1].name,
type: "bar",
barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[1].data,
},
{
name: "", // "2024",
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#f3c000", // 0%
},
{
offset: 1,
color: "#f3c00033",
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
],
},
};
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened
},
},
watch: {
xAxis(val) {
this.options.xAxis.data = val
this.canvasReset()
},
isOpen(val) {
this.canvasReset()
},
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) {
this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12;
});
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// if (val === false && this.isOpen === true) {
// console.log(val)
// this.width = 97 + '%'
// this.canvasReset()
// } else if (val === false && this.isOpen === false) {
// this.width = 100 + '%'
// this.canvasReset()
// }
// this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12;
// });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions)
this.canvasReset()
},
series(val) {
if (!val) {
this.initChart(this.options);
return;
}
// console.log('val', val)
const actualOptions = JSON.parse(JSON.stringify(this.options))
// actualOptions.xAxis.data = val
console.log(actualOptions)
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val?.[1]?.data;
actualOptions.series[1].name = val?.[1]?.name;
actualOptions.series[2].data = val?.[2]?.data || [];
actualOptions.series[2].name = val?.[2]?.name || "";
this.actualOptions = actualOptions;
this.initChart(actualOptions);
},
},
mounted() {
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
this.actualOptions = this.options
this.canvasReset();
window.addEventListener("resize", this.canvasReset);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
destroyed() {
window.removeEventListener("resize", this.canvasReset);
},
methods: {
canvasReset() {
debounce(() => {
this.initChart();
}, 500)();
},
initChart() {
if (this.chart) {
this.chart.dispose();
}
this.chart = echarts.init(this.$refs.oeeChart);
this.chart.setOption(this.actualOptions);
},
},
};
</script>
<style scoped lang="scss">
.bar-chart-base {
// position: relative;
.legend {
position: absolute;
top: 5.2vh;
right: 1vw;
}
.legend-item {
position: relative;
// font-size: 12px;
margin-right: 1.3vw;
&::before {
content: "";
display: inline-block;
width: 0.531vw;
height: 0.531vw;
background-color: #ccc;
border-radius: 2px;
margin-right: 0.22vw;
}
}
.legend-item:nth-child(1):before {
background-color: #12f7f1;
}
.legend-item:nth-child(2):before {
background-color: #58adfa;
}
.legend-item:nth-child(3):before {
background-color: #f3c000;
}
}
</style>

View File

@ -0,0 +1,69 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 09:00:01
* @LastEditTime: 2024-05-30 09:50:02
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="chart-container" :class="{ 'no-scroll': noScroll }">
<slot />
</div>
</template>
<script>
export default {
name: "ChartContainer",
components: {},
props: {
noScroll: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.chart-container {
height: 0;
flex: 1;
overflow-x: scroll;
}
.no-scroll::-webkit-scrollbar {
width: 0;
height: 0;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-button {
width: 0;
height: 0;
// width: 10px;
// height: 10px;
// background: #14305f;
}
::-webkit-scrollbar-track {
background: #14305f;
border: 0 none;
border-radius: 0;
}
::-webkit-scrollbar-thumb {
background: #004798;
border: 0 none;
border-radius: 6px;
}
</style>

View File

@ -0,0 +1,278 @@
<!--
* @Author: zhp
* @Date: 2024-05-29 14:48:06
* @LastEditTime: 2024-05-30 10:54:00
* @LastEditors: zhp
* @Description:
-->
<template>
<BarChartBase
:legend="legend"
:series="series"
:xAxis="xAxis"
in="chipOEE"
class="chip-oee"
/>
</template>
<script>
import BarChartBase from "./BarChartChipOEE.vue";
export default {
name: "ChipOEE",
components: { BarChartBase },
props: {
period: {
type: Number,
default:1,
},
than: {
type: String,
default: "同比",
},
companyId: {
type: Number,
default: 0
},
data: {
type: Object,
default:{}
}
},
data() {
//
const cities = ["fto投入", "芯片产量", "标准组件产量"];
return {
// xAxis: cities,
};
},
computed: {
xAxis() {
console.log(' this.companyId', this.companyId);
return this.companyId === 0 ? ["fto投入", "芯片产量", "标准组件产量"] : ["fto投入", "芯片产量", "标准组件产量", 'BIPV产量'];
},
legend() {
let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
const year = new Date().getFullYear();
if (this.period === 1 && this.than === '同比') {
items = [
{ label: `去年${month}${today}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period ===1 && this.than === '环比') {
items = [
{ label: `${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === 2 && this.than === '同比') {
items = [
{ label: `去年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === 2 && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === 3 && this.than === '同比') {
items = [
{ label: `去年${month}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else if (this.period === 3 && this.than === '环比') {
items = [
{ label: `${lastMonth}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
{ label: `${month}月目标`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else {
items = [
{ label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" },
{ label: `${year}年目标`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] },
];
}
return items
// switch (this.period) {
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "": {
// const year = new Date().getFullYear();
// const month = new Date().getMonth() + 1;
// return [
// { label: `${year - 1}${month}`, color: "#12f7f1" },
// { label: `${year}${month}`, color: "#58adfa" },
// ];
// }
// case "": {
// const year = new Date().getFullYear();
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
// default:
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
},
// chipOeeRate() {
// return this.$store.getters.copilot.efficiency.chipOeeRate
// },
series() {
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
// const chipOeeRate = this.data
// console.log('chipOee', chipOeeRate)
let dataList = []
dataList[0] = this.data.preDataDetail
dataList[1] = this.data.currentDataDetail
dataList[2] = this.data.targetDataDetail
console.log(dataList)
return getTemplate(this.period, dataList,this.than);
},
},
methods: {},
};
function getTemplate(period, dataList, than) {
// console.log('dataList',dataList);
let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
const year = new Date().getFullYear();
if (period === 1 && than === '同比') {
items = [
{
name: `去年${month}${today}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period ===1 && than === '环比') {
items = [
{
name: `${yesterday}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === 2 && than === '同比') {
items = [
{
name: `去年本周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === 2&& than === '环比') {
items = [
{
name: `上周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === 3 && than === '同比') {
items = [
{
name: `去年${month}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === 3 && than === '环比') {
items = [
{
name: `${lastMonth}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${month}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else {
items = [
{
name: `${year - 1}`,
data: dataList ? dataList[0] : [],
},
{
name: `${year}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${year}目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
}
return items
}
</script>
<style scoped lang="scss">
</style>

View File

@ -1,27 +1,38 @@
<template> <template>
<dv-scroll-board <div class="order-container">
v-if="showTable" <div class="table">
:config="config" <dv-scroll-board v-if="showTable" :config="config" style="width: 100%; height: 100%" ref="orderScrollBoard" />
style="width: 100%; height: 100%" </div>
ref="orderScrollBoard" <div class="chart">
/> <div class="chart-title">
<span class="title">工单情况</span>
<span class="line"></span>
</div>
<barChartBase :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1"></barChartBase>
</div>
</div>
</template> </template>
<script> <script>
import { debounce } from "@/utils/debounce"; import { debounce } from "@/utils/debounce";
import barChartBase from './BarChartBase'
export default { export default {
name: "Order", name: "Order",
components: {
barChartBase,
},
data() { data() {
return { return {
showTable: true, showTable: true,
config: { config: {
header: ["序号", "客户名称", "产品名称", "计划加工数量", "加工进度"], header: ["工单号", "工单状态", "计划投入", "实际投入", "目标产量", "实际产量", "生产进度"],
headerBGC: "rgba(0, 106, 205, 0.22)", headerBGC: "rgba(0, 106, 205, 0.22)",
oddRowBGC: "rgba(0, 106, 205, 0.22)", oddRowBGC: "rgba(0, 106, 205, 0.22)",
evenRowBGC: "rgba(rgba(2, 13, 45, 0.18)", evenRowBGC: "rgba(rgba(2, 13, 45, 0.18)",
data: [], data: [],
rowNum: 12, rowNum: 12,
waitTime: 3000, waitTime: 3000,
columnWidth: [50], columnWidth: [100],
align: ["center"], align: ["center"],
carousel: "page", carousel: "page",
}, },
@ -64,20 +75,32 @@ export default {
if (this.prodOrder.length > 0) { if (this.prodOrder.length > 0) {
for (let i = 0; i < this.prodOrder.length; i++) { for (let i = 0; i < this.prodOrder.length; i++) {
let arr = []; let arr = [];
arr.push(i + 1); // arr.push(i + 1);
arr.push( arr.push(
`<span title=${this.prodOrder[i].customerName || ""}>${ `<span title=${this.prodOrder[i].workOrderNumber || ""}>${
this.prodOrder[i].customerName || "" this.prodOrder[i].workOrderNumber || ""
}</span>` }</span>`
); );
arr.push( arr.push(
`<span title=${this.prodOrder[i].productName || ""}>${ `<span title=${this.prodOrder[i].inStatus || ""}>${
this.prodOrder[i].productName || "" this.prodOrder[i].inStatus || ""
}</span>` }</span>`
); );
arr.push( arr.push(
`<span title=${this.prodOrder[i].plannedProductionQuantity || ""}>${ `<span title=${this.prodOrder[i].plannedInvestment || ""}>${
this.prodOrder[i].plannedProductionQuantity || "" this.prodOrder[i].plannedInvestment || ""
}</span>`
);
arr.push(
`<span title=${this.prodOrder[i].actualInvestment || ""}>${this.prodOrder[i].actualInvestment || ""
}</span>`
);
arr.push(
`<span title=${this.prodOrder[i].targetProduction || ""}>${this.prodOrder[i].targetProduction || ""
}</span>`
);
arr.push(
`<span title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || ""
}</span>` }</span>`
); );
arr.push(`<span style="display:inline-block;width:45px;">${ arr.push(`<span style="display:inline-block;width:45px;">${
@ -112,3 +135,55 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped>
.order-container{
display: flex;
flex-direction: column;
height: 100%;
.table{
flex: 1;
}
.chart {
flex: 1;
display: flex;
flex-direction: column;
// gap: 6px;
.chart-title {
margin-top: 5px;
// flex: 1;
// gap: 6px;
height: 1.5vw;
width: 100%;
display: flex;
align-items: center;
// flex-direction: column;
// flex-wrap: nowrap;
// justify-content: end
// margin-top: 10px;
.title {
// flex: 1;
font-weight: 400;
font-size: 24px;
// width: 5vw;
color: #FFFFFF;
line-height: 24px;
text-align: left;
font-style: normal;
display: inline-block;
}
.line {
flex: 1;
// width: 80%;
height: 1px; // display: inline-block;
border: 1px solid;
// display: inline-block;
border-image: linear-gradient(90deg, rgba(25, 146, 255, 0) 10%, rgba(95, 190, 249, 1), rgba(0, 120, 228, 0) 90%, ) 2 2;
backdrop-filter: blur(3px);
}
}
}
}
</style>

View File

@ -1,12 +1,10 @@
<template> <template>
<div class="prod-monitor"> <div class="prod-monitor">
<div class="data">
<div class="fto-box"> <div class="fto-box">
<div class="icon"> <div class="icon">
<img <img src="./../assets/images/fto.png" alt="" style="width: 2.1875vw; height: 2.2875vw" />
src="./../assets/images/fto.png"
alt=""
style="width: 2.1875vw; height: 2.2875vw"
/>
</div> </div>
<div class="middle-box"> <div class="middle-box">
<span class="type">玻璃类型</span> <span class="type">玻璃类型</span>
@ -19,11 +17,7 @@
</div> </div>
<div class="std-box"> <div class="std-box">
<div class="icon"> <div class="icon">
<img <img src="./../assets/images/std.png" alt="" style="width: 2.1875vw; height: 2.1875vw" />
src="./../assets/images/std.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div> </div>
<div class="middle-box"> <div class="middle-box">
<div class="separate"> <div class="separate">
@ -49,20 +43,14 @@
</div> </div>
<div> <div>
<span class="type1">良品率</span> <span class="type1">良品率</span>
<span class="num" <span class="num">{{ msgObj.stand.yieldRate ? msgObj.stand.yieldRate : 0 }}%</span>
>{{ msgObj.stand.yieldRate ? msgObj.stand.yieldRate : 0 }}%</span
>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="chip-box"> <div class="chip-box">
<div class="icon"> <div class="icon">
<img <img src="./../assets/images/chip.png" alt="" style="width: 2.1875vw; height: 2.1875vw" />
src="./../assets/images/chip.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div> </div>
<div class="middle-box"> <div class="middle-box">
<div class="separate"> <div class="separate">
@ -88,20 +76,14 @@
</div> </div>
<div> <div>
<span class="type1">良品率</span> <span class="type1">良品率</span>
<span class="num" <span class="num">{{ msgObj.chip.yieldRate ? msgObj.chip.yieldRate : 0 }}%</span>
>{{ msgObj.chip.yieldRate ? msgObj.chip.yieldRate : 0 }}%</span
>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="bipv-box"> <div class="bipv-box" v-if="companyId != 0">
<div class="icon"> <div class="icon">
<img <img src="./../assets/images/bipv.png" alt="" style="width: 2.1875vw; height: 2.1875vw" />
src="./../assets/images/bipv.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div> </div>
<div class="middle-box"> <div class="middle-box">
<div class="separate"> <div class="separate">
@ -127,20 +109,35 @@
</div> </div>
<div> <div>
<span class="type1">良品率</span> <span class="type1">良品率</span>
<span class="num" <span class="num">{{ msgObj.bipv.yieldRate ? msgObj.bipv.yieldRate : 0 }}%</span>
>{{ msgObj.bipv.yieldRate ? msgObj.bipv.yieldRate : 0 }}%</span
>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="chart">
<div class="chart-title">
<span class="title">生产情况</span>
<span class="line"></span>
</div>
<barChartBase :companyId="companyId" :than="than" :period="period" :data="factoryData" ref="barChart"
style="height: 0;flex:1">
</barChartBase>
</div>
</div>
</template> </template>
<script> <script>
import { number } from 'echarts';
import barChartBase from './ChipOee'
export default { export default {
name: "ProdMonitor", name: "ProdMonitor",
components: {
barChartBase,
},
data() { data() {
return { return {
bipvVis:false,
msgObj: { msgObj: {
stand: {}, stand: {},
chip: {}, chip: {},
@ -149,6 +146,18 @@ export default {
}; };
}, },
props: { props: {
period: {
type: Number,
default: 1,
},
companyId: {
type: Number,
default:0
},
than: {
type: String,
default: '同比',
},
prodOutPut: { prodOutPut: {
type: Array, type: Array,
default: [], default: [],
@ -157,6 +166,14 @@ export default {
type: Array, type: Array,
default: [], default: [],
}, },
factoryData: {
type: Object,
default: {},
},
showBipv: {
type: Boolean,
default:true,
}
}, },
watch: { watch: {
prodOutPut() { prodOutPut() {
@ -168,6 +185,7 @@ export default {
}, },
methods: { methods: {
makeData() { makeData() {
console.log('msgObj', this.msgObj);
this.msgObj.chip = {}; this.msgObj.chip = {};
this.msgObj.stand = {}; this.msgObj.stand = {};
this.msgObj.bipv = {}; this.msgObj.bipv = {};
@ -189,6 +207,50 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.prod-monitor { .prod-monitor {
height: 100%; height: 100%;
display: flex;
flex-direction: column;
.chart{
flex: 1;
display: flex;
flex-direction: column;
position: relative;
// gap: 6px;
.chart-title{
margin-top: 5px;
// flex: 1;
// gap: 6px;
height: 1.5vw;
width: 100%;
display: flex;
align-items: center;
// flex-direction: column;
// flex-wrap: nowrap;
// justify-content: end
// margin-top: 10px;
.title{
// flex: 1;
font-weight: 400;
font-size: 24px;
// width: 5vw;
color: #FFFFFF;
line-height: 24px;
text-align: left;
font-style: normal;
display: inline-block;
}
.line{
flex: 1;
// width: 80%;
height: 1px; // display: inline-block;
border: 1px solid;
// display: inline-block;
border-image: linear-gradient(90deg, rgba(25, 146, 255, 0) 10%, rgba(95, 190, 249, 1), rgba(0, 120, 228, 0) 90%,) 2 2;
backdrop-filter: blur(3px);
}
}
}
.data{
flex: 1;
display: flex; display: flex;
gap: 6px; gap: 6px;
flex-direction: column; flex-direction: column;
@ -200,18 +262,22 @@ export default {
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
.icon { .icon {
flex: 1; flex: 1;
text-align: center; text-align: center;
} }
.middle-box { .middle-box {
flex: 2.086; flex: 2.086;
position: relative; position: relative;
} }
.right-box { .right-box {
flex: 2.424; flex: 2.424;
position: relative; position: relative;
} }
.type { .type {
display: inline-block; display: inline-block;
font-size: 0.9375vw; font-size: 0.9375vw;
@ -222,6 +288,7 @@ export default {
letter-spacing: 2px; letter-spacing: 2px;
width: 6.25vw; width: 6.25vw;
} }
.type1 { .type1 {
display: inline-block; display: inline-block;
font-size: 0.9375vw; font-size: 0.9375vw;
@ -234,6 +301,7 @@ export default {
text-align: justify; text-align: justify;
text-align-last: justify; text-align-last: justify;
} }
.type-name { .type-name {
font-size: 1.042vw; font-size: 1.042vw;
color: #fff; color: #fff;
@ -241,22 +309,21 @@ export default {
text-align: left; text-align: left;
padding-left: 0.573vw; padding-left: 0.573vw;
} }
.type-name::before { .type-name::before {
content: ""; content: "";
display: inline-block; display: inline-block;
width: 1px; width: 1px;
height: 1.042vw; height: 1.042vw;
border: 1px solid; border: 1px solid;
border-image: linear-gradient( border-image: linear-gradient(180deg,
180deg,
rgba(0, 176, 243, 0), rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1) rgba(31, 143, 255, 1)) 2 2;
)
2 2;
position: absolute; position: absolute;
left: 0; left: 0;
top: 4px; top: 4px;
} }
.num { .num {
font-size: 1.042vw; font-size: 1.042vw;
color: #fff; color: #fff;
@ -264,52 +331,53 @@ export default {
text-align: left; text-align: left;
padding-left: 0.573vw; padding-left: 0.573vw;
} }
.num::before { .num::before {
content: ""; content: "";
display: inline-block; display: inline-block;
width: 1px; width: 1px;
height: 1.042vw; height: 1.042vw;
border: 1px solid; border: 1px solid;
border-image: linear-gradient( border-image: linear-gradient(180deg,
180deg,
rgba(0, 176, 243, 0), rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1) rgba(31, 143, 255, 1)) 2 2;
)
2 2;
position: absolute; position: absolute;
left: 0; left: 0;
top: 4px; top: 4px;
} }
} }
.fto-box { .fto-box {
flex: 1; flex: 1;
.type::before { .type::before {
content: ""; content: "";
display: inline-block; display: inline-block;
width: 1px; width: 1px;
height: 1.6146vw; height: 1.6146vw;
border: 1px solid; border: 1px solid;
border-image: linear-gradient( border-image: linear-gradient(135deg,
135deg,
rgba(0, 176, 243, 0), rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1), rgba(31, 143, 255, 1),
rgba(31, 143, 255, 0) rgba(31, 143, 255, 0)) 2 2;
)
2 2;
position: absolute; position: absolute;
left: 0; left: 0;
top: -2px; top: -2px;
} }
} }
.std-box { .std-box {
flex: 1.3; flex: 1.3;
} }
.chip-box { .chip-box {
flex: 1.3; flex: 1.3;
} }
.bipv-box { .bipv-box {
flex: 1.3; flex: 1.3;
} }
.std-box, .std-box,
.chip-box, .chip-box,
.bipv-box { .bipv-box {
@ -319,17 +387,16 @@ export default {
width: 1px; width: 1px;
height: 3.125vw; height: 3.125vw;
border: 1px solid; border: 1px solid;
border-image: linear-gradient( border-image: linear-gradient(135deg,
135deg,
rgba(0, 176, 243, 0), rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1), rgba(31, 143, 255, 1),
rgba(31, 143, 255, 0) rgba(31, 143, 255, 0)) 2 2;
)
2 2;
position: absolute; position: absolute;
left: 0; left: 0;
top: -2px; top: -2px;
} }
} }
} }
}
</style> </style>

View File

@ -0,0 +1,342 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 14:25:19
* @LastEditTime: 2024-05-21 14:25:19
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="prod-monitor">
<div class="fto-box">
<div class="icon">
<img
src="./../assets/images/fto.png"
alt=""
style="width: 2.1875vw; height: 2.2875vw"
/>
</div>
<div class="middle-box">
<span class="type">玻璃类型</span>
<span class="type-name">FTO投入</span>
</div>
<div class="right-box">
<span class="type">投入数量</span>
<span class="num">{{ prodFto[0] ? prodFto[0].chipInput : 0 }}</span>
</div>
</div>
<div class="std-box">
<div class="icon">
<img
src="./../assets/images/std.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div>
<div class="middle-box">
<div class="separate">
<div>
<span class="type">玻璃类型</span>
<span class="type-name">标准组检产量</span>
</div>
<div>
<span class="type">良品数量</span>
<span class="type-name">{{
msgObj.stand.goodNumber ? msgObj.stand.goodNumber : 0
}}</span>
</div>
</div>
</div>
<div class="right-box">
<div class="separate">
<div>
<span class="type">生产数量</span>
<span class="num">{{
msgObj.stand.outputNumber ? msgObj.stand.outputNumber : 0
}}</span>
</div>
<div>
<span class="type1">良品率</span>
<span class="num"
>{{ msgObj.stand.yieldRate ? msgObj.stand.yieldRate : 0 }}%</span
>
</div>
</div>
</div>
</div>
<div class="chip-box">
<div class="icon">
<img
src="./../assets/images/chip.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div>
<div class="middle-box">
<div class="separate">
<div>
<span class="type">玻璃类型</span>
<span class="type-name">芯片产量</span>
</div>
<div>
<span class="type">良品数量</span>
<span class="type-name">{{
msgObj.chip.goodNumber ? msgObj.chip.goodNumber : 0
}}</span>
</div>
</div>
</div>
<div class="right-box">
<div class="separate">
<div>
<span class="type">生产数量</span>
<span class="num">{{
msgObj.chip.outputNumber ? msgObj.chip.outputNumber : 0
}}</span>
</div>
<div>
<span class="type1">良品率</span>
<span class="num"
>{{ msgObj.chip.yieldRate ? msgObj.chip.yieldRate : 0 }}%</span
>
</div>
</div>
</div>
</div>
<div class="bipv-box">
<div class="icon">
<img
src="./../assets/images/bipv.png"
alt=""
style="width: 2.1875vw; height: 2.1875vw"
/>
</div>
<div class="middle-box">
<div class="separate">
<div>
<span class="type">玻璃类型</span>
<span class="type-name">BIPV产量</span>
</div>
<div>
<span class="type">良品数量</span>
<span class="type-name">{{
msgObj.bipv.goodNumber ? msgObj.bipv.goodNumber : 0
}}</span>
</div>
</div>
</div>
<div class="right-box">
<div class="separate">
<div>
<span class="type">生产数量</span>
<span class="num">{{
msgObj.bipv.outputNumber ? msgObj.bipv.outputNumber : 0
}}</span>
</div>
<div>
<span class="type1">良品率</span>
<span class="num"
>{{ msgObj.bipv.yieldRate ? msgObj.bipv.yieldRate : 0 }}%</span
>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "ProdMonitor",
data() {
return {
msgObj: {
stand: {},
chip: {},
bipv: {},
},
};
},
props: {
prodOutPut: {
type: Array,
default: [],
},
prodFto: {
type: Array,
default: [],
},
},
watch: {
prodOutPut() {
this.makeData();
},
},
mounted() {
this.makeData();
},
methods: {
makeData() {
this.msgObj.chip = {};
this.msgObj.stand = {};
this.msgObj.bipv = {};
if (this.prodOutPut.length > 0) {
this.prodOutPut.map((item) => {
if (item.glassType === 0) {
this.msgObj.chip = item;
} else if (item.glassType === 1) {
this.msgObj.stand = item;
} else if (item.glassType === 2) {
this.msgObj.bipv = item;
}
});
}
},
},
};
</script>
<style lang="scss" scoped>
.prod-monitor {
height: 100%;
display: flex;
gap: 6px;
flex-direction: column;
.fto-box,
.std-box,
.chip-box,
.bipv-box {
box-shadow: inset 0 0 12px 2px #fff3;
border-radius: 4px;
display: flex;
align-items: center;
.icon {
flex: 1;
text-align: center;
}
.middle-box {
flex: 2.086;
position: relative;
}
.right-box {
flex: 2.424;
position: relative;
}
.type {
display: inline-block;
font-size: 0.9375vw;
color: #6db6ff;
position: relative;
text-align: right;
padding-right: 0.417vw;
letter-spacing: 2px;
width: 6.25vw;
}
.type1 {
display: inline-block;
font-size: 0.9375vw;
color: #6db6ff;
position: relative;
text-align: right;
padding-right: 0.6vw;
width: 6.25vw;
padding-left: 1.6vw;
text-align: justify;
text-align-last: justify;
}
.type-name {
font-size: 1.042vw;
color: #fff;
position: relative;
text-align: left;
padding-left: 0.573vw;
}
.type-name::before {
content: "";
display: inline-block;
width: 1px;
height: 1.042vw;
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1)
)
2 2;
position: absolute;
left: 0;
top: 4px;
}
.num {
font-size: 1.042vw;
color: #fff;
position: relative;
text-align: left;
padding-left: 0.573vw;
}
.num::before {
content: "";
display: inline-block;
width: 1px;
height: 1.042vw;
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1)
)
2 2;
position: absolute;
left: 0;
top: 4px;
}
}
.fto-box {
flex: 1;
.type::before {
content: "";
display: inline-block;
width: 1px;
height: 1.6146vw;
border: 1px solid;
border-image: linear-gradient(
135deg,
rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1),
rgba(31, 143, 255, 0)
)
2 2;
position: absolute;
left: 0;
top: -2px;
}
}
.std-box {
flex: 1.3;
}
.chip-box {
flex: 1.3;
}
.bipv-box {
flex: 1.3;
}
.std-box,
.chip-box,
.bipv-box {
.separate::before {
content: "";
display: inline-block;
width: 1px;
height: 3.125vw;
border: 1px solid;
border-image: linear-gradient(
135deg,
rgba(0, 176, 243, 0),
rgba(31, 143, 255, 1),
rgba(31, 143, 255, 0)
)
2 2;
position: absolute;
left: 0;
top: -2px;
}
}
}
</style>

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 1,
companyName: "邯郸中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -1,29 +1,25 @@
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
:companyName="companyName" @update:than="updateThan" @update:period="updatePeriod" />
:companyId="companyId"
:period="period"
@updateCompany="updateCompany"
@update:period="updatePeriod"
/>
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="仓库监控.当前" icon="store"> <db-container title="工单监控" icon="order">
<store :stock="stock" />
</db-container>
</section>
<section class="bottom flex">
<db-container title="能源监控" icon="energy">
<energy :legend="energyLegend" :energyCockpits="energyCockpits" />
</db-container>
<db-container title="订单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -32,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -42,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -51,10 +48,18 @@ export default {
companyId: 0, companyId: 0,
companyName: "瑞昌中建材光电材料有限公司", companyName: "瑞昌中建材光电材料有限公司",
period: 1, period: 1,
show:false,
than: '同比',
data:{},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -73,6 +78,11 @@ export default {
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -81,13 +91,74 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode:this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
console.log(' this.factoryData', this.factoryData);
}); });
}, },
}, },

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 3,
companyName: "佳木斯中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 5,
companyName: "凯盛中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -0,0 +1,146 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 13:24:03
* @LastEditTime: 2024-05-21 13:24:03
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="factory-layout">
<FactoryDataHeader
:companyName="companyName"
:companyId="companyId"
:period="period"
@updateCompany="updateCompany"
@update:period="updatePeriod"
/>
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" />
</db-container>
<db-container title="仓库监控.当前" icon="store">
<store :stock="stock" />
</db-container>
</section>
<section class="bottom flex">
<db-container title="能源监控" icon="energy">
<energy :legend="energyLegend" :energyCockpits="energyCockpits" />
</db-container>
<db-container title="订单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
</section>
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue";
import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
Store,
Energy,
Order,
},
data() {
return {
companyId: 0,
companyName: "邯郸中建材光电材料有限公司",
period: 1,
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {};
this.energyCockpits = res.data.energyCockpitsDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || [];
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top > div,
.bottom > div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -0,0 +1,216 @@
<template>
<div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@update:than="updateThan" @update:period="updatePeriod" />
<div class="factory-section">
<section class="top flex">
<db-container title="生产监控" icon="prod">
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container>
<db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" />
</db-container>
<!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> -->
<!-- </db-container> -->
</section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData";
export default {
name: "factoryData",
components: {
FactoryDataHeader,
DbContainer: Container,
ProdMonitor,
// Store,
// Energy,
Order,
},
data() {
return {
companyId: 2,
companyName: "株洲中建材光电材料有限公司",
period: 1,
show: false,
than: '同比',
data: {},
//
prodOutPut: [], //
prodFto: [], //
stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], //
prodOrder: [], //
energyLegend: [
{ label: "电", color: "#FFD160" },
{ label: "水", color: "#2760FF" },
{ label: "气", color: "#12FFF5" },
],
};
},
mounted() {
this.getMes();
},
methods: {
updateCompany(obj) {
this.companyId = obj.companyId;
this.companyName = obj.companyName;
this.getMes();
},
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) {
this.period = val;
this.getMes();
},
getMes() {
cockpitDataMonitor({
factorys: [this.companyId],
date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => {
console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
});
},
},
};
</script>
<style lang="scss" scoped>
.factory-layout {
padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
position: absolute;
height: calc(100% + 38px);
left: -16px;
top: -8px;
width: calc(100% + 30px);
z-index: 1001;
color: #fff;
display: flex;
flex-direction: column;
gap: 8px;
.factory-section {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
.flex {
display: flex;
gap: 16px;
flex: 1;
}
.top>div,
.bottom>div {
height: 100%;
}
}
.factory-footer {
/** position: absolute;
bottom: 10px; **/
height: 10px;
width: 100%;
color: rgb(80, 80, 80);
user-select: none;
font-size: 14px;
letter-spacing: 1px;
display: grid;
place-content: center;
}
}
</style>

View File

@ -1,28 +1,37 @@
<!-- <!--
filename: BipvOutput.vue * @Author: zhp
author: liubin * @Date: 2024-05-07 10:04:53
date: 2024-04-17 09:55:12 * @LastEditTime: 2024-05-29 13:17:38
description: * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
<DoubleRingWrapperVue data-source="BIPV产出" :period="period" /> <noDoubleRingWrapper data-source="BIPV产出" :period="period" :than="than" />
</template> </template>
<script> <script>
import DoubleRingWrapperVue from "./sub/ring/DoubleRingWrapper.vue"; // import DoubleRingWrapperVue from "./sub/ring/DoubleRingWrapper.vue";
import noDoubleRingWrapper from "./sub/ring/noDoubleRingWrapper.vue";
export default { export default {
name: "BipvOutput", name: "BipvOutput",
components: { DoubleRingWrapperVue }, components: { noDoubleRingWrapper },
props: { props: {
period: { period: {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return {}; return {
show: false,
};
}, },
}; };
</script> </script>

View File

@ -23,7 +23,10 @@ export default {
components: { BarChartBase }, components: { BarChartBase },
data() { data() {
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
xAxis: cities, xAxis: cities,
}; };
@ -33,74 +36,215 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
computed: { computed: {
legend() { legend() {
switch (this.period) { let items = [];
case "日": var day1 = new Date();
return [{ label: "昨日", color: "#12f7f1" }]; day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
case "周": var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
return [{ label: "本周", color: "#12f7f1" }]; //
case "月": { // var day2 = new Date();
const year = new Date().getFullYear(); // day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return [ const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
{ label: `${year - 1}${month}`, color: "#12f7f1" },
{ label: `${year}${month}`, color: "#58adfa" },
];
}
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
return [ if (this.period === '日' && this.than === '同比') {
{ label: `${year - 1}`, color: "#12f7f1" }, items = [
{ label: `${year}`, color: "#58adfa" }, { label: `去年${month}${today}`, color: "#12f7f1" },
]; { label: `${month}${today}`, color: "#58adfa" },
} ];
default: } else if (this.period === '日' && this.than === '环比') {
return [ items = [
{ label: `${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `去年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `去年${month}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${lastMonth}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else {
items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] },
]; ];
} }
return items
// switch (this.period) {
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "": {
// const year = new Date().getFullYear();
// const month = new Date().getMonth() + 1;
// return [
// { label: `${year - 1}${month}`, color: "#12f7f1" },
// { label: `${year}${month}`, color: "#58adfa" },
// ];
// }
// case "": {
// const year = new Date().getFullYear();
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
// default:
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
}, },
series() { series() {
const { chipInvest } = this.$store.getters.copilot.yield; const { chipInvest } = this.$store.getters.copilot.yield;
let dataList = null; let dataList = null;
switch (this.period) { switch (this.period) {
case "日": case "日":
dataList = [];
dataList[0] = chipInvest?.previous;
dataList[1] = chipInvest?.current;
case "周": case "周":
dataList = chipInvest?.current; dataList = []
dataList[0] = chipInvest?.previous;
dataList[1] = chipInvest?.current;
break; break;
default: default:
dataList = []; dataList = [];
dataList[0] = chipInvest?.previous; dataList[0] = chipInvest?.previous;
dataList[1] = chipInvest?.current; dataList[1] = chipInvest?.current;
} }
return getTemplate(this.period, dataList); return getTemplate(this.period, dataList,this.than);
}, },
}, },
}; };
function getTemplate(period, dataList) { function getTemplate(period, dataList,than) {
const year = new Date().getFullYear(); let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return period == "日" || period == "周" const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
? [ const year = new Date().getFullYear();
if (period === '日' && than === '同比') {
items = [
{ {
name: period == "日" ? "昨日" : "本周", name: `去年${month}${today}`,
data: dataList ?? [],
},
]
: [
{
name: period == "年" ? `${year - 1}` : `${year - 1}${month}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: period == "年" ? `${year}` : `${year}${month}`, name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '日' && than === '环比') {
items = [
{
name: `${yesterday}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
{
name: `去年本周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
{
name: `上周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [
{
name: `去年${month}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '环比') {
items = [
{
name: `${lastMonth}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else {
items = [
{
name: `${year - 1}`,
data: dataList ? dataList[0] : [],
},
{
name: `${year}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
]; ];
} }
return items
}
</script> </script>

View File

@ -1,12 +1,13 @@
<!-- <!--
filename: ChipOutput.vue * @Author: zhp
author: liubin * @Date: 2024-05-07 10:04:53
date: 2024-04-17 09:55:12 * @LastEditTime: 2024-05-27 16:36:29
description: * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
<DoubleRingWrapperVue data-source="芯片产出" :period="period" /> <DoubleRingWrapperVue data-source="芯片产出" :period="period" :than="than" />
</template> </template>
<script> <script>
@ -20,6 +21,10 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return {}; return {};

View File

@ -16,14 +16,17 @@
</template> </template>
<script> <script>
import BarChartBase from "@/views/copilot/components/BarChartBase.vue"; import BarChartBase from "@/views/copilot/components/ftoBarChartBase.vue";
export default { export default {
name: "FtoInvest", name: "FtoInvest",
components: { BarChartBase }, components: { BarChartBase },
data() { data() {
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
xAxis: cities, xAxis: cities,
}; };
@ -33,77 +36,217 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
computed: { computed: {
legend() { legend() {
switch (this.period) { let items = [];
case "日": var day1 = new Date();
return [{ label: "昨日", color: "#12f7f1" }]; day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
case "周": var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
return [{ label: "本周", color: "#12f7f1" }]; //
case "月": { // var day2 = new Date();
const year = new Date().getFullYear(); // day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return [ const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
{ label: `${year - 1}${month}`, color: "#12f7f1" },
{ label: `${year}${month}`, color: "#58adfa" },
];
}
case "年": {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
return [ if (this.period === '日' && this.than === '同比') {
{ label: `${year - 1}`, color: "#12f7f1" }, items = [
{ label: `${year}`, color: "#58adfa" }, { label: `去年${month}${today}`, color: "#12f7f1" },
]; { label: `${month}${today}`, color: "#58adfa" },
} ];
default: } else if (this.period === '日' && this.than === '环比') {
return [ items = [
{ label: `${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `去年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `去年${month}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${lastMonth}`, color: "#12f7f1" },
{ label: `${month}`, color: "#58adfa" },
// { label: `${month}`, value: valueTuple[2] },
];
} else {
items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] },
]; ];
} }
return items
// switch (this.period) {
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "":
// return [{ label: "", color: "#12f7f1" }];
// case "": {
// const year = new Date().getFullYear();
// const month = new Date().getMonth() + 1;
// return [
// { label: `${year - 1}${month}`, color: "#12f7f1" },
// { label: `${year}${month}`, color: "#58adfa" },
// ];
// }
// case "": {
// const year = new Date().getFullYear();
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
// default:
// return [
// { label: `${year - 1}`, color: "#12f7f1" },
// { label: `${year}`, color: "#58adfa" },
// ];
// }
}, },
series() { series() {
const { ftoInvest } = this.$store.getters.copilot.yield; const { ftoInvest } = this.$store.getters.copilot.yield;
console.log('ftoInvest', this.$store.getters.copilot.yield); // console.log('ftoInvest', this.$store.getters.copilot.yield);
let dataList = null; let dataList = null;
// console.log(ftoInvest)
switch (this.period) { switch (this.period) {
case "日": case "日":
dataList = [];
dataList[0] = ftoInvest?.previous;
dataList[1] = ftoInvest?.current;
case "周": case "周":
dataList = ftoInvest?.current; dataList = [];
dataList[0] = ftoInvest?.previous;
dataList[1] = ftoInvest?.current;
break; break;
default: default:
dataList = []; dataList = [];
dataList[0] = ftoInvest?.previous; dataList[0] = ftoInvest?.previous;
dataList[1] = ftoInvest?.current; dataList[1] = ftoInvest?.current;
} }
return getTemplate(this.period, dataList,this.than);
return getTemplate(this.period, dataList);
}, },
}, },
}; };
function getTemplate(period, dataList) { function getTemplate(period, dataList,than) {
const year = new Date().getFullYear(); let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
return period == "日" || period == "周" const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
? [ const year = new Date().getFullYear();
if (period === '日' && than === '同比') {
items = [
{ {
name: period == "日" ? "昨日" : "本周", name: `去年${month}${today}`,
data: dataList ?? [],
},
]
: [
{
name: period == "年" ? `${year - 1}` : `${year - 1}${month}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: period == "年" ? `${year}` : `${year}${month}`, name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '日' && than === '环比') {
items = [
{
name: `${yesterday}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}${today}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
{
name: `去年本周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
{
name: `上周`,
data: dataList ? dataList[0] : [],
},
{
name: `本周`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [
{
name: `去年${month}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '环比') {
items = [
{
name: `${lastMonth}`,
data: dataList ? dataList[0] : [],
},
{
name: `${month}`,
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else {
items = [
{
name: `${year - 1}`,
data: dataList ? dataList[0] : [],
},
{
name: `${year}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
]; ];
} }
return items
}
</script> </script>

View File

@ -1,12 +1,13 @@
<!-- <!--
filename: StdOutput.vue * @Author: zhp
author: liubin * @Date: 2024-05-07 10:04:53
date: 2024-04-17 09:55:12 * @LastEditTime: 2024-05-27 14:25:57
description: * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
<DoubleRingWrapperVue data-source="标准组件产出" :period="period" /> <DoubleRingWrapperVue data-source="标准组件产出" :period="period" :than="than" />
</template> </template>
<script> <script>
@ -20,6 +21,10 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return {}; return {};

View File

@ -1,8 +1,9 @@
<!-- <!--
filename: DoubleRingChart.vue * @Author: zhp
author: liubin * @Date: 2024-05-20 13:32:59
date: 2024-04-17 11:01:55 * @LastEditTime: 2024-05-31 15:05:20
description: * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
@ -45,6 +46,10 @@ export default {
type: String, type: String,
default: null, default: null,
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return { return {
@ -89,27 +94,84 @@ export default {
}, },
options() { options() {
const today = new Date().getDate();
const year = new Date().getFullYear(); const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const vt = this.valueTuple; const vt = this.valueTuple;
let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
// const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
// const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
// const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') {
items = [
{ label: `${month}${today}日累计`,},
{ label: `去年${month}${today}日累计` },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${month}${today}日累计`},
{ label: `${yesterday}日累计`},
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `本周累计`,},
{ label: `去年本周累计`},
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `本周累计`,},
{ label: `上周累计`,},
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `${month}月累计`,},
{ label: `去年${month}月累计`, },
{ label: `${month}月目标`,},
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${month}月累计`, },
{ label: `${lastMonth}月累计`,},
{ label: `${month}月目标`, },
];
} else {
items = [
{ label: `${year}年累计`, },
{ label: `${year - 1}年累计` },
{ label: `${year}年目标` },
];
}
let titleValue = let titleValue =
vt[0] != null && vt[2] != null && vt[2] !== 0 vt[1] != null && vt[2] !== 0
? `${vt[1] / vt[2]}%` ? this.formatNumber((vt[1] / vt[2] * 100)) + '%'
: "0%", : (vt[1] != 0 && vt[1] != null) && vt[2] == 0
? "100%" : '0%',
subtitle = subtitle =
this.period == "月" ? `${month}月累计产出` : `${year}年累计产出`; this.period == "日" ? `${month}${today}日累计` : this.period == "周" ? `本周` : this.period == "月" ? `${month}月累计产出` : `${year}年累计产出`;
console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],)
console.log(items)
return getOptions({ return getOptions({
titleValue, titleValue,
subtitle, subtitle,
currentName: items[0].label,
preName: items[1].label,
previousSum: this.valueTuple[0], previousSum: this.valueTuple[0],
currentSum: this.valueTuple[1], currentSum: this.valueTuple[1],
targetSum: this.valueTuple[2], targetSum: this.valueTuple[2] ? this.valueTuple[2] :0 ,
}); });
}, },
legendItems() { legendItems() {
return calculateItems(this.period, this.valueTuple); return calculateItems(this.period, this.valueTuple,this.than);
}, },
}, },
watch: { watch: {
@ -135,6 +197,15 @@ export default {
} }
}, },
methods: { methods: {
formatNumber(num) {
//
if (Number.isInteger(num)) {
return num; //
} else {
//
return num.toFixed(2);
}
}
// fullscreen mixin // fullscreen mixin
// fullscreenCallback(isFullscreen) { // fullscreenCallback(isFullscreen) {
// console.log("isFullscreen--->", isFullscreen); // console.log("isFullscreen--->", isFullscreen);
@ -142,39 +213,68 @@ export default {
}, },
}; };
function calculateItems(period, valueTuple) { function calculateItems(period, valueTuple,than) {
let items = []; let items = [];
var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
const today = new Date().getDate(); const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 -1;
const year = new Date().getFullYear(); const year = new Date().getFullYear();
switch (period) { if (period === '日' && than === '同比') {
case "日":
items = [ items = [
{ label: `${month}${today}日累计`, value: valueTuple[1] },
{ label: `去年${month}${today}日累计`, value: valueTuple[0] }, { label: `去年${month}${today}日累计`, value: valueTuple[0] },
{ label: `${month}${today}日累计`, value: valueTuple[1] },
]; ];
break; } else if (period === '日' && than === '环比') {
case "周": items = [
{ label: `${yesterday}日累计`, value: valueTuple[0] },
{ label: `${month}${today}日累计`, value: valueTuple[1] },
];
} else if (period === '周' && than === '同比') {
items = [ items = [
{ label: `本周累计`, value: valueTuple[1] },
{ label: `去年本周累计`, value: valueTuple[0] }, { label: `去年本周累计`, value: valueTuple[0] },
{ label: `本周累计`, value: valueTuple[1] },
]; ];
break; } else if (period === '周' && than === '环比') {
case "月": items = [
{ label: `上周累计`, value: valueTuple[0] },
{ label: `本周累计`, value: valueTuple[1] },
];
} else if (period === '月' && than === '同比') {
items = [ items = [
{ label: `${month}月累计`, value: valueTuple[1] },
{ label: `去年${month}月累计`, value: valueTuple[0] }, { label: `去年${month}月累计`, value: valueTuple[0] },
{ label: `${month}月累计`, value: valueTuple[1] },
{ label: `${month}月目标`, value: valueTuple[2] }, { label: `${month}月目标`, value: valueTuple[2] },
]; ];
break; } else if (period === '月' && than === '环比') {
case "年": items = [
{ label: `${lastMonth}月累计`, value: valueTuple[0] },
{ label: `${month}月累计`, value: valueTuple[1] },
{ label: `${month}月目标`, value: valueTuple[2] },
];
} else {
items = [ items = [
{ label: `${year}年累计`, value: valueTuple[1] },
{ label: `${year - 1}年累计`, value: valueTuple[0] }, { label: `${year - 1}年累计`, value: valueTuple[0] },
{ label: `${year}年累计`, value: valueTuple[1] },
{ label: `${year}年目标`, value: valueTuple[2] }, { label: `${year}年目标`, value: valueTuple[2] },
]; ];
break;
} }
// switch (period) {
// case "":
// items = [
// { label: `${year}`, value: valueTuple[1] },
// { label: `${year - 1}`, value: valueTuple[0] },
// { label: `${year}`, value: valueTuple[2] },
// ];
// break;
// }
return items; return items;
} }
</script> </script>
@ -191,6 +291,7 @@ function calculateItems(period, valueTuple) {
padding: 0 10%; padding: 0 10%;
/* margin: 10%; */ /* margin: 10%; */
/* min-width: 300px; */ /* min-width: 300px; */
align-self: stretch;
height: 0; height: 0;
} }
@ -223,17 +324,17 @@ function calculateItems(period, valueTuple) {
left: -18px; left: -18px;
} }
.legend-item:nth-child(1) .legend-item__label::before { .legend-item:nth-child(2) .legend-item__label::before {
background: #12fff5; background: #12fff5;
} }
.legend-item:nth-child(1) .legend-item__value { .legend-item:nth-child(2) .legend-item__value {
color: #12fff5; color: #12fff5;
} }
.legend-item:nth-child(2) .legend-item__label::before { .legend-item:nth-child(1) .legend-item__label::before {
background: #0f65ff; background: #0f65ff;
} }
.legend-item:nth-child(2) .legend-item__value { .legend-item:nth-child(1) .legend-item__value {
color: #0f65ff; color: #0f65ff;
} }

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 16:00:50
* @LastEditTime: 2024-05-31 16:15:51
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: DoubleRingWrapper.vue filename: DoubleRingWrapper.vue
author: liubin author: liubin
@ -7,22 +14,12 @@
<template> <template>
<div class="double-ring-wrapper"> <div class="double-ring-wrapper">
<template v-if="period == '月' || period == '年'"> <template>
<copilot-select <copilot-select @update:active="handleActiveUpdate" :options="cityOptions" />
@update:active="handleActiveUpdate"
:options="cityOptions"
/>
<div class="flex-1 stretch"> <div class="flex-1 stretch">
<DoubleRingChartVue <DoubleRingChartVue :data-source="dataSource" :period="period" :than="than" :factoryId="factoryId" />
:data-source="dataSource"
:period="period"
:factoryId="factoryId"
/>
</div> </div>
</template> </template>
<template v-else>
<CityData :data-source="dataSource" :period="period" />
</template>
</div> </div>
</template> </template>
@ -43,18 +40,22 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return { return {
factoryId: 4, // factoryId: 4, //
cityOptions: [ cityOptions: [
"成都", // "",
"邯郸", "邯郸",
"株洲", // "",
"瑞昌", "瑞昌",
"佳木斯", // "",
"凯盛光伏", // "",
"蚌埠兴科", // "",
], ],
}; };
}, },

View File

@ -0,0 +1,91 @@
<!--
* @Author: zhp
* @Date: 2024-05-24 15:15:00
* @LastEditTime: 2024-05-31 16:16:16
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="double-ring-wrapper">
<template >
<copilot-select
@update:active="handleActiveUpdate"
:options="cityOptions"
/>
<div class="flex-1 stretch">
<DoubleRingChartVue
:data-source="dataSource"
:than="than"
:period="period"
:factoryId="factoryId"
/>
</div>
</template>
<!-- <template v-else>
<CityData :data-source="dataSource" :period="period" />
</template> -->
</div>
</template>
<script>
import CopilotSelect from "@/views/copilot/components/select.vue";
import DoubleRingChartVue from "./DoubleRingChart.vue";
import CityData from "../city/CityData.vue";
export default {
name: "DoubleRingWrapper",
components: { CopilotSelect, DoubleRingChartVue, CityData },
props: {
dataSource: {
type: String,
default: null,
},
period: {
type: String,
default: "日",
},
than: {
type: String,
default: "同比",
},
},
data() {
return {
factoryId: 4, //
cityOptions: [
// "",
"邯郸",
// "",
// "",
// "",
// "",
],
};
},
methods: {
handleActiveUpdate(index) {
this.factoryId = index;
},
},
};
</script>
<style scoped lang="scss">
.double-ring-wrapper {
height: 100%;
padding: 12px 24px;
display: flex;
gap: 12px;
flex-direction: column;
align-items: center;
}
.flex-1 {
flex: 1;
}
.stretch {
align-self: stretch;
}
</style>

View File

@ -1,29 +1,30 @@
<!-- <!--
filename: index.vue * @Author: zhp
author: liubin * @Date: 2024-05-10 11:10:54
date: 2024-04-16 14:40:15 * @LastEditTime: 2024-05-28 13:36:07
description: 产量驾驶舱 * @LastEditors: zhp
* @Description:
--> -->
<template> <template>
<div class="yield-copilot"> <div class="yield-copilot">
<section class="top flex"> <section class="top flex">
<db-container class="std-yield" title="标准组件产出" icon="std"> <db-container class="std-yield" title="标准组件产出" icon="std">
<std-output :period="period" /> <std-output v-if="show" :period="period" :than="than" />
</db-container> </db-container>
<db-container class="chip-yield" title="芯片产出" icon="chip2"> <db-container class="chip-yield" title="芯片产出" icon="chip2">
<chip-output :period="period" /> <chip-output v-if="show" :period="period" :than="than" />
</db-container> </db-container>
<db-container class="bipv-yield" title="BIPV产出" icon="bipv"> <db-container class="bipv-yield" title="BIPV产出" icon="bipv">
<bipv-output :period="period" /> <bipv-output v-if="show" :period="period" :than="than" />
</db-container> </db-container>
</section> </section>
<section class="bottom flex"> <section class="bottom flex">
<db-container class="fto-involve" title="FTO投入"> <db-container class="fto-involve" title="FTO投入">
<fto-invest :period="period" /> <fto-invest :period="period" :than="than" />
</db-container> </db-container>
<db-container class="chip-involve" title="芯片投入" icon="chip"> <db-container class="chip-involve" title="芯片投入" icon="chip">
<chip-invest :period="period" /> <chip-invest :period="period" :than="than" />
</db-container> </db-container>
</section> </section>
</div> </div>
@ -52,22 +53,40 @@ export default {
type: String, type: String,
default: "日", default: "日",
}, },
than: {
type: String,
default: "同比",
},
}, },
data() { data() {
return {}; return {
show:false,
};
}, },
watch: { watch: {
period: { period: {
handler(val) { handler(val) {
val && this.fetchData(val); val && this.fetchData(val,this.than);
},
immediate: true,
},
than: {
handler(val) {
console.log(val)
val && this.fetchData(this.period,val);
}, },
immediate: true, immediate: true,
}, },
}, },
methods: { methods: {
fetchData(period = "日") { fetchData(period = "日", than) {
// this.$store.commit('copilot/clearState')
console.log(`产量驾驶舱,获取${period}数据`); console.log(`产量驾驶舱,获取${period}数据`);
this.$store.dispatch("copilot/initCopilot", { period, source: "yield" }); this.$store.dispatch("copilot/initCopilot", { period, source: "yield", than }).then(() => {
this.$nextTick(() => {
this.show = true
})
})
}, },
}, },
}; };

View File

@ -4,6 +4,8 @@ export default ({
previousSum, previousSum,
currentSum, currentSum,
targetSum, targetSum,
currentName,
preName,
}) => ({ }) => ({
grid: { grid: {
left: 0, left: 0,
@ -57,7 +59,7 @@ export default ({
data: [ data: [
{ {
value: currentSum, value: currentSum,
name: "当前累计产出", name: currentName,
selected: false, selected: false,
itemStyle: { itemStyle: {
borderJoin: "round", borderJoin: "round",
@ -78,15 +80,9 @@ export default ({
}, },
}, },
{ {
value: value:currentSum == 0
targetSum > currentSum
? targetSum - currentSum
: targetSum == 0
? currentSum == 0
? 1 ? 1
: 0
: 0, : 0,
name: "未达成累计", name: "未达成累计",
itemStyle: { color: "transparent" }, itemStyle: { color: "transparent" },
label: { show: false }, label: { show: false },
@ -108,7 +104,7 @@ export default ({
data: [ data: [
{ {
value: previousSum, value: previousSum,
name: "上期累计产出", name: preName,
selected: false, selected: false,
itemStyle: { itemStyle: {
borderJoin: "round", borderJoin: "round",
@ -129,10 +125,7 @@ export default ({
}, },
}, },
{ {
value: value:previousSum == 0
targetSum > previousSum
? targetSum - previousSum
: previousSum == 0
? 1 ? 1
: 0, : 0,
name: "-", name: "-",

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:14:09
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: Bipv.vue filename: Bipv.vue
author: liubin author: liubin
@ -24,7 +31,10 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
legend: [ legend: [
{ label: `${year}年目标值`, color: "#f3c000" }, { label: `${year}年目标值`, color: "#f3c000" },

View File

@ -23,7 +23,9 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
legend: [ legend: [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },

View File

@ -11,24 +11,24 @@
<section class="right-part"> <section class="right-part">
<div class="yield-location"> <div class="yield-location">
<section class="btn-group"> <section class="btn-group">
<button <!-- <button
@click="activeLoc = '1'" @click="activeLoc = '1'"
:class="activeLoc === '1' ? 'active' : ''" :class="activeLoc === '1' ? 'active' : ''"
> >
成都 成都
</button> </button> -->
<button <button
@click="activeLoc = '2'" @click="activeLoc = '2'"
:class="activeLoc === '2' ? 'active' : ''" :class="activeLoc === '2' ? 'active' : ''"
> >
邯郸 邯郸
</button> </button>
<button <!-- <button
@click="activeLoc = '3'" @click="activeLoc = '3'"
:class="activeLoc === '3' ? 'active' : ''" :class="activeLoc === '3' ? 'active' : ''"
> >
株洲 株洲
</button> </button> -->
<button <button
@click="activeLoc = '4'" @click="activeLoc = '4'"
:class="activeLoc === '4' ? 'active' : ''" :class="activeLoc === '4' ? 'active' : ''"
@ -37,7 +37,7 @@
</button> </button>
</section> </section>
<section class="btn-group"> <section class="btn-group">
<button <!-- <button
@click="activeLoc = '5'" @click="activeLoc = '5'"
:class="activeLoc === '5' ? 'active' : ''" :class="activeLoc === '5' ? 'active' : ''"
class="fixwidth" class="fixwidth"
@ -55,7 +55,7 @@
:class="activeLoc === '7' ? 'active' : ''" :class="activeLoc === '7' ? 'active' : ''"
> >
蚌埠兴科 蚌埠兴科
</button> </button> -->
</section> </section>
</div> </div>
<div class="yield-summary"> <div class="yield-summary">
@ -85,13 +85,14 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
activeLoc: "1", activeLoc: "2",
}; };
}, },
computed: { computed: {
output() { output() {
// ["", "", "", "", "", "", ""] // ["", "", "", "", "", "", ""]
const chipOutput = this.$store.getters.home.chipOutput; const chipOutput = this.$store.getters.home.chipOutput;
console.log('chipOutput', chipOutput);
if ( if (
!chipOutput || !chipOutput ||
!chipOutput.target || !chipOutput.target ||

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:11:56
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: ChipYield.vue filename: ChipYield.vue
author: liubin author: liubin

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:11:06
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: fto.vue filename: fto.vue
author: liubin author: liubin
@ -23,7 +30,9 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
legend: [ legend: [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },

View File

@ -113,6 +113,16 @@ export default {
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
borderRadius: [10, 10, 0, 0], borderRadius: [10, 10, 0, 0],
normal: {
label: {
show: true, //
position: 'top', //
textStyle: { //
color: '#DFF1FE',
fontSize: 16
}
}
},
color: { color: {
type: "linear", type: "linear",
x: 0, x: 0,
@ -146,11 +156,6 @@ export default {
name: '', // this.series[1].name, name: '', // this.series[1].name,
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: { itemStyle: {
borderRadius: [10, 10, 0, 0], borderRadius: [10, 10, 0, 0],
color: { color: {

View File

@ -1,3 +1,10 @@
<!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:13:47
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: right-chart-base filename: right-chart-base
author: liubin author: liubin

View File

@ -25,7 +25,9 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["瑞昌", "邯郸",
// "", "", "", "", ""
];
return { return {
legend: [ legend: [
{ label: `${year}年目标值`, color: "#f3c000" }, { label: `${year}年目标值`, color: "#f3c000" },

View File

@ -6,7 +6,7 @@
--> -->
<template> <template>
<div class="company-info" :style="styles"> <div class="company-info" @click="handleChangeRoute()" :style="styles">
<div class="corner bl"></div> <div class="corner bl"></div>
<div class="corner br"></div> <div class="corner br"></div>
<h2>{{ info.companyName }}</h2> <h2>{{ info.companyName }}</h2>
@ -31,7 +31,7 @@ export default {
position: { position: {
type: Object, type: Object,
required: true, required: true,
default: () => ({ x: 0, y: 0 }), default: () => ({ tx: 0, ty: 0 }),
}, },
}, },
filters: { filters: {
@ -49,16 +49,23 @@ export default {
computed: { computed: {
styles() { styles() {
return { return {
left: `${this.position.x}%`, left: `${this.position.tx}%`,
top: `${this.position.y}%`, top: `${this.position.ty}%`,
}; };
}, },
}, },
methods: {}, methods: {
handleChangeRoute() {
this.$router.push({
path: this.position.path
})
}
},
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@font-face { @font-face {
font-family: 优设标题黑; font-family: 优设标题黑;
src: url(../../../assets/YouSheBiaoTiHei-2.ttf); src: url(../../../assets/YouSheBiaoTiHei-2.ttf);
@ -71,18 +78,25 @@ export default {
z-index: 9999; z-index: 9999;
// padding: 14px; // padding: 14px;
padding: 0.745vw; padding: 0.745vw;
backdrop-filter: blur(2px); // padding: 0 vw;
border-radius: 4px; cursor: pointer;
// backdrop-filter: blur(2px);
// border-radius: 4px;
transform: translate(-50%, -100%); transform: translate(-50%, -100%);
box-shadow: inset 0 0 12px 2px #fff3; box-shadow: inset 0 0 12px 2px #fff3;
background: url(../../../assets/images/homeindex/info.png) no-repeat 0 0 / 100% 100%;
// background: radial-gradient(circle farthest-corner at bottom center,rgba(255,239,162,.7) 10%, #021842 30%);
// //
font-size: 1vw; font-size: 1vw;
// filter: blur(13);
} }
h2 { h2 {
padding: 0 1vw;
margin: 6px 0; margin: 6px 0;
font-family: 优设标题黑; font-family: 优设标题黑;
color: #fff; color: #fff;
letter-spacing:5px;
// font-size: 24px; // font-size: 24px;
font-size: 1.276em; font-size: 1.276em;
} }

View File

@ -1,60 +1,50 @@
<template> <template>
<div class="dashboard-factory-all"> <div class="dashboard-factory-all">
<div id="map-container"> <div id="map-container">
<!-- <div v-if="visible" class="cdLine"></div> -->
<!-- <div v-if="visible" class="zzLine"></div> -->
<div v-if="visible" class="rcLine"></div>
<div v-if="visible" class="rcLineTwo"></div>
<div v-if="visible" class="hdLine"></div>
<div v-if="visible" class="hdLineTwo"></div>
<!-- <div v-if="visible" class="ksLine"></div> -->
<!-- <div v-if="visible" class="bbLine"></div> -->
<!-- <div v-if="visible" class="bbLineTwo"></div> -->
<!-- <div v-if="visible" class="bbLineThree"></div> -->
<!-- <div v-if="visible" class="jmsLine"></div> -->
<!-- <div v-if="visible" class="jmsLineTwo"></div> -->
<div class="databoard"> <div class="databoard">
<db-header class="db-header"></db-header> <db-header class="db-header"></db-header>
<div class="db-body"> <div class="db-body">
<div class="db-left"> <div class="db-left">
<db-container <db-container icon="cube" title="FTO投入" @refresh="() => (ftoKey = Math.random())">
icon="cube"
title="FTO投入"
@refresh="() => (ftoKey = Math.random())"
>
<fto-chart :key="ftoKey" /> <fto-chart :key="ftoKey" />
</db-container> </db-container>
<db-container <db-container icon="chip2" title="芯片投入" @refresh="() => (chipInvestKey = Math.random())">
icon="chip2"
title="芯片投入"
@refresh="() => (chipInvestKey = Math.random())"
>
<chip-invest-chart :key="chipInvestKey" /> <chip-invest-chart :key="chipInvestKey" />
</db-container> </db-container>
</div> </div>
<div class="db-right"> <div class="db-right">
<db-container <db-container side="right" icon="chip" title="芯片产出" @refresh="() => (chipYieldKey = Math.random())">
side="right"
icon="chip"
title="芯片产出"
@refresh="() => (chipYieldKey = Math.random())"
>
<chip-yield-chart :key="chipYieldKey" /> <chip-yield-chart :key="chipYieldKey" />
</db-container> </db-container>
<db-container <db-container side="right" icon="std" title="标准组件产出" @refresh="() => (stdKey = Math.random())">
side="right"
icon="std"
title="标准组件产出"
@refresh="() => (stdKey = Math.random())"
>
<std-chart :key="stdKey" /> <std-chart :key="stdKey" />
</db-container> </db-container>
<db-container <db-container side="right" icon="bipv" title="BIPV产出" @refresh="() => (bipvKey = Math.random())">
side="right"
icon="bipv"
title="BIPV产出"
@refresh="() => (bipvKey = Math.random())"
>
<bipv-chart :key="bipvKey" /> <bipv-chart :key="bipvKey" />
</db-container> </db-container>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<company-info <company-info v-if="visible" :info="info" :position="rcHintPosition" />
v-if="visible" <ks-company-info v-if="visible" :info="ksInfo" :position="ksHintPosition" />
:info="info" <jms-company-info v-if="visible" :info="jmsInfo" :position="jmsHintPosition" />
:position="hintPosition" <hd-company-info v-if="visible" :info="hdInfo" :position="hdHintPosition" />
@close="closeHint" <bb-company-info v-if="visible" :info="bbInfo" :position="bbHintPosition" />
/> <cd-company-info v-if="visible" :info="cdInfo" :position="cdHintPosition" />
<zz-company-info v-if="visible" :info="zzInfo" :position="zzHintPosition" />
</div> </div>
</template> </template>
@ -71,25 +61,31 @@ import StdChart from "./dashboard/charts/StdChart.vue";
const LOCATIONS = [ const LOCATIONS = [
// //
{ x: 67, y: 20 }, // { x: 67, y: 20, tx: 60, ty: 29, path: 'factoryData/jmsIndex' },
// //
{ x: 46, y: 56 }, // { x: 46, y: 56, tx: 46, ty: 93, path: 'factoryData/cdIndex' },
// 1 // 1
{ x: 60, y: 52 }, // { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'factoryData/bbIndex' },
// 2 // 2
{ x: 61, y: 53 }, // { x: 61, y: 53, tx: 39, ty: 68, path: 'factoryData/ksIndex' },
// 西 // 西
{ x: 60, y: 58 }, { x: 60, y: 58, tx: 68, ty: 52, path: 'factoryData/factory-data' },
// //
{ x: 56, y: 60 }, // { x: 56, y: 60, tx: 60, ty: 95, path: 'factoryData/zzIndex' },
// //
{ x: 58, y: 45 }, { x: 58, y: 45, tx: 47, ty: 34, path: 'factoryData/hdIndex' },
]; ];
export default { export default {
name: "Index", name: "Index",
components: { components: {
CompanyInfo, CompanyInfo,
ksCompanyInfo: CompanyInfo,
hdCompanyInfo: CompanyInfo,
bbCompanyInfo: CompanyInfo,
cdCompanyInfo: CompanyInfo,
zzCompanyInfo: CompanyInfo,
jmsCompanyInfo: CompanyInfo,
DbHeader: DashboardHeader, DbHeader: DashboardHeader,
DbContainer: Container, DbContainer: Container,
FtoChart, FtoChart,
@ -100,8 +96,15 @@ export default {
}, },
data() { data() {
return { return {
// homeStore:undefined,
visible: false, visible: false,
hintPosition: null, hintPosition: null,
zzHintPosition: null,
ksHintPosition: null,
bbHintPosition: null,
hdHintPosition: null,
cdHintPosition: null,
jmsHintPosition: null,
ftoKey: Math.random(), ftoKey: Math.random(),
chipInvestKey: Math.random(), chipInvestKey: Math.random(),
chipYieldKey: Math.random(), chipYieldKey: Math.random(),
@ -109,15 +112,28 @@ export default {
bipvKey: Math.random(), bipvKey: Math.random(),
}; };
}, },
computed: {
homeStore() {
return this.$store.getters.home
}
},
mounted() { mounted() {
this.$store.dispatch("copilot/initHome"); // var w = window.screen.width;
// var zoom = w / 1920;
// let screen = document.getElementById("map-container")
// console.log(screen);
// screen.style.zoom = zoom
// // "zoom": ,
// screen.style.transform = `scale(" + ${zoom} + ")`
// };
this.$store.dispatch("copilot/initHome").then((res) => {
this.$nextTick(() => { this.$nextTick(() => {
this.initPins(); this.initPins();
// echarts // echarts
window.onresize = () => { }; window.onresize = () => { };
}); })
})
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next((vm) => { next((vm) => {
@ -126,17 +142,60 @@ export default {
}, },
methods: { methods: {
initPins() { initPins() {
// const cdLine = document.createElement("div");
// const zzLine = document.createElement("div");
// const rcLine = document.createElement("div");
// const rcLineTwo = document.createElement("div");
// const hdLine = document.createElement("div");
// const ksLine = document.createElement("div");
// const bbLine = document.createElement("div");
// const bbLineTwo = document.createElement("div");
// const bbLineThree = document.createElement("div");
// cdLine.className = "cdLine";
// cdLine.style.left = `46.71%`;
// cdLine.style.top = `59%`;
// zzLine.className = "zzLine";
// zzLine.style.left = `56.8%`;
// zzLine.style.top = `60.8%`;
// rcLine.className = "rcLine";
// rcLine.style.left = `66.8%`;
// rcLine.style.top = `52%`;
// rcLineTwo.className = "rcLineTwo";
// rcLineTwo.style.left = `58.7%`;
// rcLineTwo.style.top = `34%`;
// hdLine.className = "hdLine";
// ksLine.className = "ksLine";
// bbLine.className = "bbLine";
// bbLineTwo.className = "bbLineTwo";
// bbLineThree.className = "bbLineThree";
// document.getElementById("map-container").appendChild(cdLine);
// document.getElementById("map-container").appendChild(zzLine);
// document.getElementById("map-container").appendChild(rcLine);
// document.getElementById("map-container").appendChild(rcLineTwo);
// document.getElementById("map-container").appendChild(hdLine);
// document.getElementById("map-container").appendChild(ksLine);
// document.getElementById("map-container").appendChild(bbLine);
// document.getElementById("map-container").appendChild(bbLineTwo);
// document.getElementById("map-container").appendChild(bbLineThree);
// console.log(" this.homeStore", this.$store.getters.home);
LOCATIONS.map((loc) => { LOCATIONS.map((loc) => {
console.log("loc", loc);
const pin = document.createElement("div"); const pin = document.createElement("div");
pin.className = "pin"; pin.className = "pin";
pin.style.left = `${loc.x}%`; pin.style.left = `${loc.x}%`;
pin.style.top = `${loc.y}%`; pin.style.top = `${loc.y}%`;
pin.addEventListener("mouseenter", () => { // pin.addEventListener("mouseenter", () => {
this.showHint(loc); this.showHint(loc);
}); // });
pin.addEventListener("mouseleave", () => { // pin.addEventListener("mouseleave", () => {
this.closeHint(); // this.closeHint();
}); // });
// pin.addEventListener("click", () => {
// this.$router.push({
// path:loc.path
// })
// });
document.getElementById("map-container").appendChild(pin); document.getElementById("map-container").appendChild(pin);
}); });
}, },
@ -145,8 +204,6 @@ export default {
this.hintPosition = null; this.hintPosition = null;
}, },
showHint(position) { showHint(position) {
const homeStore = this.$store.getters.home;
this.hintPosition = position;
const templateInfo = { const templateInfo = {
companyName: "", companyName: "",
items: [ items: [
@ -156,53 +213,65 @@ export default {
{ label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) }, { label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) },
], ],
}; };
if
if (position === LOCATIONS[0]) { // (position === LOCATIONS[0]) {
templateInfo.companyName = "佳木斯中建材光电材料有限公司"; // templateInfo.companyName = "";
templateInfo.items[0].value = homeStore.ftoInvest.current[3]; // this.jmsHintPosition = position;
templateInfo.items[2].value = homeStore.chipInvest.current[3]; // templateInfo.items[0].value = this.homeStore.ftoInvest.current[3];
templateInfo.items[1].value = homeStore.chipOutput.current[3]; // templateInfo.items[2].value = this.homeStore.chipInvest.current[3];
templateInfo.items[3].value = homeStore.stdOutput.current[3]; // templateInfo.items[1].value = this.homeStore.chipOutput.current[3];
} else if (position === LOCATIONS[1]) { // templateInfo.items[3].value = this.homeStore.stdOutput.current[3];
templateInfo.companyName = "成都中建材光电材料有限公司"; // this.jmsInfo = templateInfo;
templateInfo.items[0].value = homeStore.ftoInvest.current[4]; // } else if (position === LOCATIONS[1]) {
templateInfo.items[2].value = homeStore.chipInvest.current[4]; // this.cdHintPosition = position;
templateInfo.items[1].value = homeStore.chipOutput.current[4]; // templateInfo.companyName = "";
templateInfo.items[3].value = homeStore.stdOutput.current[4]; // templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4];
} else if (position === LOCATIONS[2]) { // templateInfo.items[2].value = this.homeStore.chipInvest.current[4];
templateInfo.companyName = "蚌埠兴科玻璃有限公司"; // templateInfo.items[1].value = this.homeStore.chipOutput.current[4];
templateInfo.items[0].value = homeStore.ftoInvest.current[6]; // templateInfo.items[3].value = this.homeStore.stdOutput.current[4];
templateInfo.items[2].value = homeStore.chipInvest.current[6]; // this.cdInfo = templateInfo;
templateInfo.items[1].value = homeStore.chipOutput.current[6]; // } else if (position === LOCATIONS[2]) {
templateInfo.items[3].value = homeStore.stdOutput.current[6]; // this.bbHintPosition = position;
} else if (position === LOCATIONS[3]) { // templateInfo.companyName = "";
templateInfo.companyName = "凯盛光伏材料有限公司(本部)"; // templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6];
templateInfo.items[0].value = homeStore.ftoInvest.current[5]; // templateInfo.items[2].value = this.homeStore.chipInvest.current[6];
templateInfo.items[2].value = homeStore.chipInvest.current[5]; // templateInfo.items[1].value = this.homeStore.chipOutput?.current[6];
templateInfo.items[1].value = homeStore.chipOutput.current[5]; // templateInfo.items[3].value = this.homeStore.stdOutput.current[6];
templateInfo.items[3].value = homeStore.stdOutput.current[5]; // this.bbInfo = templateInfo;
} else if (position === LOCATIONS[4]) { // } else if (position === LOCATIONS[3]) {
templateInfo.companyName = "瑞昌中建材光电材料有限公司"; // this.ksHintPosition = position;
templateInfo.items[0].value = homeStore.ftoInvest.current[0]; // templateInfo.companyName = "";
templateInfo.items[2].value = homeStore.chipInvest.current[0]; // templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5];
templateInfo.items[1].value = homeStore.chipOutput.current[0]; // templateInfo.items[2].value = this.homeStore.chipInvest.current[5];
templateInfo.items[3].value = homeStore.stdOutput.current[0]; // templateInfo.items[1].value = this.homeStore.chipOutput.current[5];
} else if (position === LOCATIONS[5]) { // templateInfo.items[3].value = this.homeStore.stdOutput.current[5];
templateInfo.companyName = "中建材(株洲)光电材料有限公司"; // this.ksInfo = templateInfo;
templateInfo.items[0].value = homeStore.ftoInvest.current[2]; // }
templateInfo.items[2].value = homeStore.chipInvest.current[2]; (position === LOCATIONS[0]) {
templateInfo.items[1].value = homeStore.chipOutput.current[2]; this.rcHintPosition = position;
templateInfo.items[3].value = homeStore.stdOutput.current[2]; templateInfo.companyName = "瑞昌中建材";
} else if (position === LOCATIONS[6]) { templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0];
templateInfo.companyName = "中建材(邯郸)光电材料有限公司"; templateInfo.items[2].value = this.homeStore.chipInvest.current[0];
templateInfo.items[0].value = homeStore.ftoInvest.current[1]; templateInfo.items[1].value = this.homeStore.chipOutput.current[0];
templateInfo.items[2].value = homeStore.chipInvest.current[1]; templateInfo.items[3].value = this.homeStore.stdOutput.current[0];
templateInfo.items[1].value = homeStore.chipOutput.current[1];
templateInfo.items[3].value = homeStore.stdOutput.current[1];
}
this.info = templateInfo; this.info = templateInfo;
// } else if (position === LOCATIONS[5]) {
// this.zzHintPosition = position;
// templateInfo.companyName = "";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[2];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[2];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[2];
// this.zzInfo = templateInfo;
} else if (position === LOCATIONS[1]) {
this.hdHintPosition = position;
templateInfo.companyName = "邯郸中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1];
templateInfo.items[2].value = this.homeStore.chipInvest.current[1];
templateInfo.items[1].value = this.homeStore.chipOutput.current[1];
templateInfo.items[3].value = this.homeStore.stdOutput.current[1];
this.hdInfo = templateInfo
}
this.$nextTick(() => { this.$nextTick(() => {
this.visible = true; this.visible = true;
}); });
@ -225,8 +294,8 @@ export default {
#map-container { #map-container {
height: 100%; height: 100%;
background: url(../assets/bgearth.png) no-repeat 0 0 / 100% 100%; background: url(../assets/bgearth.png) no-repeat 0 0 / 100% 100%;
// background-size: cover;
position: relative; position: relative;
.databoard { .databoard {
position: absolute; position: absolute;
top: 0; top: 0;
@ -257,6 +326,133 @@ export default {
</style> </style>
<style> <style>
.cdLine {
display: inline-block;
position: absolute;
left: 46.71%;
width: 2px;
top: 59%;
height: 148px;
border: 2px dashed #FFCF00;
}
.zzLine {
display: inline-block;
position: absolute;
left: 56.8%;
width: 2px;
top: 60.8%;
/* x: 60, y: 58, */
height: 148px;
border: 2px dashed #FFCF00;
}
.rcLine {
display: inline-block;
position: absolute;
left: 61%;
width: 100px;
top: 61.5%;
/* x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.rcLineTwo {
position: absolute;
left: 66.8%;
width: 1px;
top: 52%;
display: inline-block;
/* // x: 60, y: 58, */
height: 90px;
border: 2px dashed #FFCF00;
}
.hdLine {
position: absolute;
left: 58.7%;
width: 1px;
top: 34%;
display: inline-block;
/* // x: 60, y: 58, */
height: 100px;
border: 2px dashed #FFCF00;
}
.hdLineTwo {
position: absolute;
left: 53%;
width: 90px;
top: 34%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.ksLine {
position: absolute;
left: 43.2%;
width: 350px;
top: 56.8%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLine {
position: absolute;
left: 42.4%;
width: 350px;
top: 55.5%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLineTwo {
position: absolute;
left: 42.4%;
width: 1px;
top: 48%;
display: inline-block;
/* // x: 60, y: 58, */
height: 70px;
border: 2px dashed #FFCF00;
}
.jmsLine {
position: absolute;
left: 67.8%;
width: 1px;
top: 24%;
display: inline-block;
/* // x: 60, y: 58, */
height: 40px;
border: 2px dashed #FFCF00;
}
.jmsLineTwo {
position: absolute;
left: 65.4%;
width: 50px;
top: 28.5%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLineThree {
position: absolute;
left: 40%;
width: 40px;
top: 48%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.pin { .pin {
display: inline-block; display: inline-block;
position: absolute; position: absolute;

View File

@ -218,7 +218,7 @@ export default {
data() { data() {
return { return {
codeUrl: "", codeUrl: "",
captchaEnable: true, captchaEnable: false,
tenantEnable: true, tenantEnable: true,
mobileCodeTimer: 0, mobileCodeTimer: 0,
loginForm: { loginForm: {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-22 15:25:11 * @LastEditTime: 2024-05-31 19:14:05
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -10,17 +10,17 @@
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="date"> <el-form-item label="时间维度" prop="date">
<el-select size="small" clearable v-model="listQuery.date" placeholder="请选择"> <el-select size="small" clearable v-model="listQuery.mode" placeholder="请选择">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.mode === 0 || listQuery.mode === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator=""
start-placeholder="开始日期" value-format="timestamp" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="timestamp" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.mode === 1" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
@ -32,12 +32,12 @@
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.mode === 2" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator=""
start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.mode === 3" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year" <el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
@ -48,7 +48,7 @@
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="factorys"> <el-form-item label="工厂名称" prop="factorys">
<el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple > <el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple >
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in factoryArray" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -59,7 +59,7 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="玻璃类型" prop="type"> <el-form-item label="玻璃类型" prop="type">
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择玻璃类型"> <el-select size="small" clearable v-model="listQuery.type" multiple placeholder="请选择玻璃类型">
<el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -94,7 +94,7 @@
@pagination="getDataList" @pagination="getDataList"
/> />
</div> </div>
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.mode" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
<!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" /> --> :type="listQuery.reportType" @refreshDataList="getDataList" /> -->
<!-- <pagination <!-- <pagination
@ -107,27 +107,29 @@
<script> <script>
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
import { getProduceDataPage, exportOutPutExcel } from '@/api/produceData'; import { getProduceDataPage, prodOutputDataList, exportOutPutExcel } from '@/api/produceData';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import lineChart from './lineChart'; import lineChart from './lineChart';
import moment from 'moment' import moment from 'moment'
import ButtonNav from '@/components/ButtonNav' import ButtonNav from '@/components/ButtonNav'
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata'
import { factoryList, factoryArray, factoryArray1 } from "@/utils/constants";
// import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx'
export default { export default {
components: { lineChart, ButtonNav, AddOrUpdate }, components: { lineChart, ButtonNav, AddOrUpdate },
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
factoryList,
factoryArray,
factoryArray1,
listQuery: { listQuery: {
size: 20, size: 20,
current: 1, current: 1,
factorys: [], factorys: undefined,
total: 0, total: 0,
date: 1, mode: 0,
type:undefined, type:undefined,
// reportType: 2, // reportType: 2,
beginTime: undefined, beginTime: undefined,
@ -163,31 +165,6 @@ export default {
id: 2, id: 2,
}, },
], ],
// weekNum: undefined,
dataList: [
{
id:'first',
},
{
id: 'second',
},
{
id: 'third',
},
{
id: 'fourth',
},
{
id: 'fifth',
},
{
id: 'sixth',
},
],
urlOptions: {
// getDataListURL: getGlassPage,
// exportURL: exportGlasscExcel
},
formConfig: [ formConfig: [
{ {
type: 'title', type: 'title',
@ -218,36 +195,6 @@ export default {
label: '年' label: '年'
} }
], ],
factoryList: [
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
},
{
name: '中建材株洲光电材料有限公司',
id: 2
},
{
name: '佳木斯中建材光电材料有限公司',
id: 3
},
{
name: '成都中建材光电材料有限公司',
id: 4
},
{
name: '凯盛光伏材料有限公司',
id: 5
},
{
name: '蚌埠兴科玻璃有限公司',
id: 6
}
],
tableProps: [ tableProps: [
{ {
prop: 'tableTime', prop: 'tableTime',
@ -258,7 +205,7 @@ export default {
{ {
prop: 'factory', prop: 'factory',
label: '工厂名称', label: '工厂名称',
filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val], filter: (val) => factoryList[val],
minWidth: 200, minWidth: 200,
showOverflowtooltip: true showOverflowtooltip: true
}, },
@ -282,10 +229,13 @@ export default {
{ {
prop: 'yieldRate', prop: 'yieldRate',
label: '良品率%', label: '良品率%',
filter: (val) => val + '%'
}, },
], ],
tableData: [], tableData: [],
xAxis: [] lineData: [],
chart: null,
seriesList: []
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
@ -295,8 +245,14 @@ export default {
return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1 return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1
}, },
}, },
created() {
const today = new Date()
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
this.listQuery.beginTime = sevenDaysAgo.getTime()
this.listQuery.endTime = today.getTime()
this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime]
},
mounted() { mounted() {
this.getDataList()
}, },
methods: { methods: {
otherMethods(val) { otherMethods(val) {
@ -306,9 +262,6 @@ export default {
this.$refs.detailOrUpdate.init(val.data.id); this.$refs.detailOrUpdate.init(val.data.id);
}); });
}, },
// buttonClick() {
// },
getYear(e) { getYear(e) {
if (this.listQuery.end - this.listQuery.start > 10*365*24*60*60*1000) { if (this.listQuery.end - this.listQuery.start > 10*365*24*60*60*1000) {
this.$message({ this.$message({
@ -380,75 +333,100 @@ export default {
console.log(this.listQuery.reportTime[0]) console.log(this.listQuery.reportTime[0])
} }
}, },
// async getDict() {
// 线
// const res = await getCorePLList();
// this.proLineList = res.data;
// },
//
multipliedByHundred(str) {
console.log(str);
// console.log(str)
if ( str != 0) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
async getDataList() { async getDataList() {
const res = await getProduceDataPage(this.listQuery) // const res = await getProduceDataPage(this.listQuery)
console.log(res) // console.log(res)
this.tableData = res.data.records // if (res.code === 0) {
this.tableData.forEach(item => { // this.tableData = res.data.records
item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--' // this.listQuery.total = res.data.total
// if (this.listQuery.total > 0) {
// this.tableData.forEach(item => {
// item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--'
// })
// }
// }
//
await prodOutputDataList({
current: 1,
size: 99,
beginTime: this.listQuery.beginTime,
endTime: this.listQuery.endTime,
factorys: this.listQuery.factorys,
mode: this.listQuery.mode,
type: this.listQuery.type
}).then(resp => {
console.log('Aaa', resp.data)
this.lineData = resp?.data || []
if (this.lineData.length > 0) {
this.buildChart(this.lineData)
}
}) })
this.listQuery.total = res.data.total // this.buildChart(this.tableData)
this.buildChart(this.tableData)
}, },
buildChart(list) { buildChart(list) {
const chartList = Object.groupBy(list, (item) => item.tableTime) let temp = []
this.xAxis = [] let xAxisData = []
this.seriesList = [] list.forEach(item => {
for (const keyIndex in chartList) { temp.push(item.groupTime)
// X })
this.xAxis.push(keyIndex) // x
} xAxisData = Array.from(new Set(temp))
// y // y
for (const y of this.factoryList) { for (const y of this.factoryArray1) {
// y: {name: , id: } for (const type of this.typeList) {
const seriesItem = { const seriesItem = {
name: y.name, name: y.name,
record: type.name,
type: 'bar', type: 'bar',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: Array(this.xAxis.length).fill(0) data: Array(xAxisData.length).fill(0)
} }
for (const a in chartList) { list.forEach(data => {
for (const z of chartList[a]) { xAxisData.forEach((x, index) => {
this.xAxis.forEach((item, index) => { if (x === data.groupTime && y.id === data.factory && type.id === data.glassType) {
if (z.factory === y.id && a === item) { seriesItem.data[index] = data.goodNumber
seriesItem.data[index] = z.goodNumber
} }
}) })
} })
}
this.seriesList.push(seriesItem) this.seriesList.push(seriesItem)
} }
this.$refs.lineChart.initChart(this.xAxis, this.seriesList) }
console.log('啊啊', this.seriesList)
this.$refs.lineChart.initChart(xAxisData, this.seriesList)
// const chartList = Object.groupBy(list, (item) => item.tableTime)
// this.xAxis = []
// this.seriesList = []
// for (const keyIndex in chartList) {
// // X
// this.xAxis.push(keyIndex)
// }
// // y
// for (const y of this.factoryArray) {
// // y: {name: , id: }
// const seriesItem = {
// name: y.name,
// type: 'bar',
// emphasis: {
// focus: 'series'
// },
// data: Array(this.xAxis.length).fill(0)
// }
// for (const a in chartList) {
// for (const z of chartList[a]) {
// this.xAxis.forEach((item, index) => {
// if (z.factory === y.id && a === item) {
// seriesItem.data[index] = z.goodNumber
// }
// })
// }
// }
// this.seriesList.push(seriesItem)
// }
// this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
}, },
buttonClick(val) { buttonClick(val) {
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-05-22 13:48:58 * @LastEditTime: 2024-05-30 14:52:05
* @Description: * @Description:
--> -->
<template> <template>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-17 16:31:51 * @Date: 2024-04-17 16:31:51
* @LastEditTime: 2024-05-20 18:09:09 * @LastEditTime: 2024-05-29 14:06:16
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -29,20 +29,30 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="时间维度" prop="targetType"> <el-form-item label="时间维度" prop="targetType">
<el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable @change="clearTime"> <el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable>
<!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> --> <!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> -->
<el-option label="月" :value="0" /> <el-option label="日" :value="0" />
<el-option label="年" :value="1" /> <el-option label="周" :value="1" />
<el-option label="月" :value="2" />
<el-option label="年" :value="3" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item v-show="dataForm.targetType !== 1" label="时间" prop="reportTime"> <el-form-item v-show="dataForm.targetType === 0 || dataForm.targetType === ''" label="时间" prop="reportTime">
<el-date-picker v-model="dataForm.reportTime" value-format="yyyy-MM" type="month" placeholder="选择月份"> <el-date-picker v-model="reportTime" value-format="yyyyMMdd" type="date" placeholder="选择日">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="dataForm.targetType === 1" label="时间" prop="targetYear"> <el-form-item v-show="dataForm.targetType === 1" label="时间" prop="week">
<el-date-picker clearable v-model="dataForm.showYear" value-format="yyyy" type="year" placeholder="开始时间"> <el-date-picker v-model="week" type="week" format="yyyy 第 WW 周" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-form-item v-show="dataForm.targetType === 2" label="时间" prop="reportTime">
<el-date-picker v-model="reportTime" value-format="yyyyMM" type="month" placeholder="选择月份">
</el-date-picker>
</el-form-item>
<el-form-item v-show="dataForm.targetType === 3" label="时间" prop="reportTime">
<el-date-picker clearable v-model="reportTime" value-format="yyyy" type="year" placeholder="开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -225,6 +235,7 @@
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData'; import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData';
import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants"; import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants";
import moment from 'moment'
export default { export default {
components: { components: {
@ -247,57 +258,16 @@ export default {
workOrderList: [], workOrderList: [],
detList: [], detList: [],
teamList: [], teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
// factoryList: [
// {
// name: '',
// id: 0
// },
// {
// name: '',
// id: 1
// },
// {
// name: '',
// id: 2
// },
// {
// name: '',
// id: 3
// },
// {
// name: '',
// id: 4
// },
// {
// name: '',
// id: 5
// },
// {
// name: '',
// id: 6
// }
// ],
sectionList: [], sectionList: [],
visible: false, visible: false,
reportTime: undefined,
week: undefined,
dataForm: { dataForm: {
factoryType: 0, factoryType: 0,
id: undefined, id: undefined,
reportTime: undefined, //
factory: undefined, factory: undefined,
targetType: undefined, targetTime: undefined,
targetYear: undefined, targetType: 0,
showYear: undefined,
targetMonth: undefined,
chipYield: undefined, chipYield: undefined,
chipYieldRate: undefined, chipYieldRate: undefined,
chipBom: undefined, chipBom: undefined,
@ -345,31 +315,20 @@ export default {
this.$refs.dataForm.resetFields() this.$refs.dataForm.resetFields()
} }
}, },
clearTime() { // clearTime() {
this.dataForm.targetYear = undefined // this.dataForm.targetTime = undefined
this.dataForm.targetMonth = undefined // },
},
handleClose() { handleClose() {
// //
if (this.dataForm.targetType === 0) {
const timeArray = this.dataForm.reportTime.split('-')
this.dataForm.targetYear = Number(timeArray[0])
this.dataForm.targetMonth = Number(timeArray[1])
}
if (this.dataForm.targetType === 1) { if (this.dataForm.targetType === 1) {
this.dataForm.targetYear = Number(this.dataForm.showYear) this.dataForm.targetTime = this.week ? Number(moment(this.week.getTime()).format('YYYYWW')) : undefined
} else {
this.dataForm.targetTime = this.reportTime ? Number(this.reportTime) : undefined
} }
// if (this.dataForm.factory === 5) {
// this.dataForm.factoryType = 1
// } else {
// this.dataForm.factoryType = 0
// }
if (this.dataForm.id) { if (this.dataForm.id) {
// //
updateProduceTarget({ updateProduceTarget({
...this.dataForm, ...this.dataForm
showYear: undefined,
reportTime: undefined
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('修改成功!') this.$message.success('修改成功!')
@ -380,9 +339,7 @@ export default {
} else { } else {
// //
createProduce({ createProduce({
...this.dataForm, ...this.dataForm
showYear: undefined,
reportTime: undefined
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('新增成功!') this.$message.success('新增成功!')
@ -399,19 +356,16 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
getProduceTargetDetail(this.dataForm.id).then(res => { getProduceTargetDetail(this.dataForm.id).then(res => {
this.dataForm = res.data this.dataForm = res.data
if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) {
this.reportTime = String(this.dataForm.targetTime)
}
if (this.dataForm.targetType === 1) { if (this.dataForm.targetType === 1) {
if (this.dataForm.targetYear) { const date = new Date()
this.$set(this.dataForm, 'showYear', String(this.dataForm.targetYear)) date.setFullYear(String(this.dataForm.targetTime).slice(0, 4))
} date.setMonth(0)
} date.setDate((Number(String(this.dataForm.targetTime).slice(4)) - 1)* 7 + 1)
if (this.dataForm.targetType === 0) { // console.log('', date, moment(date).format('yyyyWW'), String(this.dataForm.targetTime).slice(4))
if (this.dataForm.targetYear && this.dataForm.targetMonth !== null) { this.week = date
if (this.dataForm.targetMonth < 10) {
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-0' + String(this.dataForm.targetMonth))
} else {
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-' + String(this.dataForm.targetMonth))
}
}
} }
}) })
} }
@ -424,6 +378,7 @@ export default {
position: absolute; position: absolute;
bottom: 1%; bottom: 1%;
right: 2%; right: 2%;
z-index: 999;
} }
.drawer-footer { .drawer-footer {
width: 100%; width: 100%;

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-22 16:22:57 * @LastEditTime: 2024-05-31 16:41:12
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px"> <ButtonNav v-show="false" :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px">
</ButtonNav> </ButtonNav>
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
@ -29,34 +29,34 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item v-show="timeSelect === 'day'" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 1 || listQuery.date === ''" label="时间范围" prop="reportTime">
<el-date-picker v-model="listQuery.reportTime" type="datetimerange" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator=""
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="yyyyMMdd" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> --> </el-form-item>
<!-- <el-form-item v-show="timeSelect === 'week'" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime">
<el-date-picker v-model="listQuery.reportTime[0]" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<el-date-picker v-model="listQuery.reportTime[1]" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<span v-if="listQuery.reportTime[0] && listQuery.reportTime[1]" style="margin-left: 10px"> <span v-if="start && end" style="margin-left: 10px">
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span>
</el-form-item> --> </el-form-item>
<el-form-item v-show="listQuery.date !== 4" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="" start-placeholder="开始月份" <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyyMM" range-separator="" start-placeholder="开始月份"
end-placeholder="结束月份" @change="changeTime"> end-placeholder="结束月份" @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime">
<el-date-picker size="small" clearable v-model="start" value-format="timestamp" type="year" <el-date-picker size="small" clearable v-model="start" value-format="yyyy" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker size="small" clearable v-model="end" value-format="timestamp" type="year" placeholder="结束时间" <el-date-picker size="small" clearable v-model="end" value-format="yyyy" type="year" placeholder="结束时间"
@change="getYear"> @change="getYear">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -173,7 +173,7 @@ export default {
current: 1, current: 1,
factorys: null, factorys: null,
total: 0, total: 0,
date: undefined, date: 1,
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
reportTime: [] reportTime: []
@ -314,6 +314,14 @@ export default {
}, },
], ],
timeList: [ timeList: [
{
value: 1,
label: '日'
},
{
value: 2,
label: '周'
},
{ {
value: 3, value: 3,
label: '月' label: '月'
@ -332,13 +340,13 @@ export default {
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'tagertTime', prop: 'targetTime',
label: '目标时间', label: '目标时间',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'createTime', prop: 'updateTime',
label: '提交时间', label: '提交时间',
filter: parseTime, filter: parseTime,
minWidth: 150, minWidth: 150,
@ -418,11 +426,11 @@ export default {
// all: {} // all: {}
}; };
}, },
// computed: { computed: {
// weekNum() { weekNum() {
// return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1 return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
// }, },
// }, },
watch: { watch: {
facType(value) { facType(value) {
if (value === 0) { if (value === 0) {
@ -569,36 +577,75 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id); this.$refs.detailOrUpdate.init(val.data.id);
}); });
},
buttonClick() {
}, },
getYear(e) { getYear(e) {
if (this.end && e - this.start > 10 * 365*24*60*60*1000) { if (this.end && Number(this.end) - Number(this.start) > 10) {
this.$message({ this.$message({
message: '年份起止时间不能超过十年', message: '年份起止时间不能超过十年',
type: 'warning' type: 'warning'
}); });
this.start = undefined
this.end = undefined
// console.log(); // console.log();
} else { } else {
if (this.end < this.start) { if (Number(this.end) < Number(this.start)) {
this.$message({ this.$message({
message: '结束年份不能小于开始年份', message: '结束年份不能小于开始年份',
type: 'warning' type: 'warning'
}); });
this.start = undefined
this.end = undefined
} else {
this.listQuery.beginTime = Number(this.start)
this.listQuery.endTime = Number(this.end)
} }
} }
// console.log(e); // console.log(e);
}, },
changeTime() { changeTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0] const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
if (numDays > 2*365*24*60*60*1000) { if (numDays > 24) {
this.$message({ this.$message({
message: '时间范围不能超过24个月', message: '时间范围不能超过24个月',
type: 'warning' type: 'warning'
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1])
}
}
},
onValueChange(picker, k) { // k
if (this.start && this.end) {
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
if (numDays > 168) {
console.log(numDays)
this.$message({
message: '周范围不能超过24周',
type: 'warning'
});
} else {
this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW'))
this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
}
}
},
changeDayTime() {
if (this.listQuery.reportTime) {
const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
if (numDays > 30) {
this.$message({
message: '时间范围不能超过30天',
type: 'warning'
});
this.listQuery.reportTime = [];
} else {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1])
} }
} }
}, },
@ -626,27 +673,22 @@ export default {
}, },
async getDataList() { async getDataList() {
if (this.listQuery.date === 3) { // if (this.listQuery.date === 3) {
if (this.listQuery.reportTime?.length > 0) { // if (this.listQuery.reportTime?.length > 0) {
this.listQuery.beginTime = this.listQuery.reportTime[0] ? this.listQuery.reportTime[0] : undefined // this.listQuery.beginTime = this.listQuery.reportTime[0] ? Number(this.listQuery.reportTime[0]) : undefined
this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined // this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined
} // }
} // }
if (this.listQuery.date === 4) { // if (this.listQuery.date === 4) {
if (this.listQuery.reportTime?.length > 0) { // if (this.listQuery.reportTime?.length > 0) {
this.listQuery.beginTime = this.start ? this.start : undefined // this.listQuery.beginTime = this.start ? this.start : undefined
this.listQuery.endTime = this.end ? this.end : undefined // this.listQuery.endTime = this.end ? this.end : undefined
} // }
} // }
if (this.currentMenu === '碲化镉工厂') { if (this.currentMenu === '碲化镉工厂') {
await prodTargetDiPage(this.listQuery).then(res => { await prodTargetDiPage(this.listQuery).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.records this.tableData = res.data.records
this.tableData.forEach(item => {
const year = item.targetYear ? item.targetYear + '年' : ''
const month = item.targetMonth ? item.targetMonth + '月' : ''
item.tagertTime = year + month
})
this.listQuery.total = res.data.total this.listQuery.total = res.data.total
} }
}) })

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,399 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-05-31 16:13:22
* @LastEditors: DY
* @Description:
-->
<template>
<el-drawer class="drawer" :visible.sync="visible" size="85%" @closed="$emit('destroy')">
<small-title slot="title" :no-padding="true">
{{ '详情' }}
<el-button type="primary" plain size="small" style="float: right" @click="exportDetail">导出</el-button>
</small-title>
<div ref="detail" class="detailBox">
<el-row :gutter="20">
<el-col :span="3">
<p class="title">工单号</p>
<p class="text">{{ dataForm.workOrderNumber }}</p>
</el-col>
<el-col :span="3">
<p class="title">订单号</p>
<p class="text">{{ dataForm.orderNumber }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单类型</p>
<p class="text">{{ ['', '芯片订单', '组件类型', 'bipv类型'][dataForm.workOrderType] }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单来源</p>
<p class="text">{{ ['', '手动', 'ERP'][dataForm.source] }}</p>
</el-col>
<el-col :span="3">
<p class="title">工艺流程</p>
<p class="text">{{ dataForm.process }}</p>
</el-col>
<el-col :span="3">
<p class="title">BOM</p>
<p class="text">{{ dataForm.bom }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单状态</p>
<p class="text">{{ ['未开始', '生产中', '已完成'][dataForm.orderStatus] }}</p>
</el-col>
<el-col :span="3">
<p class="title">投入状态</p>
<p class="text">{{ dataForm.inStatus }}</p>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<p class="title">计划投入量</p>
<p class="text">{{ dataForm.plannedInvestment }}</p>
</el-col>
<el-col :span="3">
<p class="title">目标产量</p>
<p class="text">{{ dataForm.targetProduction }}</p>
</el-col>
<el-col :span="3">
<p class="title">实际投入</p>
<p class="text">{{ dataForm.actualInvestment }}</p>
</el-col>
<el-col :span="3">
<p class="title">实际产出</p>
<p class="text">{{ dataForm.actualProduction }}</p>
</el-col>
<el-col :span="3">
<p class="title">创建时间</p>
<p class="text">{{ parseTime(dataForm.createTime) }}</p>
</el-col>
<el-col :span="3">
<p class="title">开始时间</p>
<p class="text">{{ dataForm.startDate?.length > 0 ? dataForm.startDate[0] + '-' + dataForm.startDate[1] + '-' + dataForm.startDate[2] : '' }}</p>
</el-col>
<el-col :span="3">
<p class="title">完成时间</p>
<p class="text">{{ dataForm.endDate?.length > 0 ? dataForm.endDate[0] + '-' + dataForm.endDate[1] + '-' + dataForm.endDate[2] : '' }}</p>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="chartDiv">
<div ref="bar" :style="{ height: '30vh', width: '40vw' }" />
<div ref="pie" :style="{ height: '30vh', width: '40vw' }" />
</div>
<div class="chartDiv">
<div ref="equipmentLine" :style="{ height: '30vh', width: '40vw' }" />
<div ref="line" v-show="dataForm.orderStatus === 1" :style="{ height: '30vh', width: '40vw' }" />
</div>
</div>
</el-drawer>
</template>
<script>
// import basicAdd from './basic-add';
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
import { getWorkOrderDetail, getEqNum, getDailyTrend } from '@/api/produceData/order';
import SmallTitle from './SmallTitle';
import jsPDF from 'jspdf';
import html2canvas from 'html2canvas';
export default {
components: {
SmallTitle,
},
mixins: [resize],
props: {
date: {
type: Number,
default: 0
}
},
data() {
return {
lineChart: null,
pieChart: null,
barChart: null,
equipmentLineChart: null,
visible: false,
dataForm: {}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
mounted() {
// this.getCurrentTime()
},
methods: {
exportDetail() {
//
const pdf = new jsPDF('l', 'pt', 'a4');
const options = {
scale: 2
};
const element = this.$refs['detail'];
html2canvas(element, options).then((canvas) => {
const imgData = canvas.toDataURL('image/png');
pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight());
pdf.save(this.dataForm.workOrderNumber + '详情.pdf');
});
},
init(id) {
this.visible = true
this.$nextTick(() => {
this.initLineChart()
})
if (id) {
getWorkOrderDetail(id).then(res => {
this.dataForm = res.data
this.buildChart(this.dataForm)
if (this.dataForm.orderStatus === 1) {
this.trend()
}
})
getEqNum(id).then(response => {
if (response.code === 0) {
const xAxisList = Object.keys(response.data)
const yAxisList = Object.values(response.data)
this.initEqLineChart(xAxisList, yAxisList)
}
})
}
},
trend() {
//
getDailyTrend({ factory: this.dataForm.id }).then(trendRes => {
if (trendRes?.data.length > 0) {
const seriesList = []
const dateList = []
trendRes.data.forEach(element => {
seriesList.push(element.actualProduction)
dateList.push(element.recordTime[0] + '-' + element.recordTime[1] + '-' + element.recordTime[2])
})
this.initLineChart(dateList, seriesList)
}
})
},
buildChart(data) {
//
const barList = [data.targetProduction, data.plannedInvestment, data.actualInvestment, data.actualProduction, data.wasteNum, data.reworkNum]
this.initChart(barList)
//
const pieList = [
{ value: data.actualProduction, name: '实际产出' },
{ value: data.wasteNum, name: '废品数量' },
{ value: data.reworkNum, name: '待再加工数量' }
]
this.initPieChart(pieList)
},
initChart(barData) {
this.barChart = echarts.init(this.$refs['bar'])
this.barChart.setOption({
title: {
text: '生产明细',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
calculable: true,
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
xAxis: {
type: 'category',
data: ['目标产量', '计划投入量', '实际投入', '实际产出', '废品数量', '待再加工数量'],
axisLabel: {
rotate:45
}
},
yAxis: {
type: 'value'
},
series: [
{
data: barData,
type: 'bar',
barWidth: '40%'
}
]
}, true)
},
initPieChart(pieData) {
this.pieChart = echarts.init(this.$refs['pie'])
this.pieChart.setOption({
title: {
text: '产品良率',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'right',
orient: 'vertical'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: pieData
}
]
}, true)
},
initEqLineChart(xAxisList, yAxisList) {
this.equipmentLineChart = echarts.init(this.$refs['equipmentLine'])
this.equipmentLineChart.setOption({
title: {
text: '在制品分布',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
calculable: true,
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
xAxis: {
type: 'category',
data: xAxisList,
axisLabel: {
rotate:45,
// width: '10%'
}
},
yAxis: {
type: 'value'
},
series: [
{
data: yAxisList,
type: 'bar',
barWidth: '40px'
}
]
}, true)
},
initLineChart(xAxisList, seriesList) {
this.lineChart = echarts.init(this.$refs['line'])
this.lineChart.setOption({
title: {
text: '历史趋势',
left: 'center' //
},
xAxis: {
type: 'category',
data: xAxisList,
axisLabel: {
rotate:45
}
},
yAxis: {
type: 'value'
},
series: [
{
data: seriesList,
type: 'line'
}
]
}, true)
}
// getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
// this.dataForm.logTime = new Date()
// // this.dataForm.logTime = year + "-" + month + "-" + day;
// console.log(this.dataForm.logTime);
// },
},
};
</script>
<style scoped>
.chartDiv {
display: flex;
justify-content: space-between;
width: 100%;
padding: 5px;
padding-left: 30px;
}
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
/* margin-bottom: 30px; */
}
.detailBox p {
margin: 0;
padding: 0 32px;
}
.detailBox .title {
/* width: 56px; */
/* height: 14px; */
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
line-height: 16px;
text-align: left;
font-style: normal;
text-transform: none;
}
.detailBox .text {
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
padding-bottom: 20px;
}
.detailBox {
padding-top: 30px;
width: 99%;
}
</style>

View File

@ -0,0 +1,320 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 17:13:56
* @LastEditors: DY
* @Description:
-->
<template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<div class="app-container" style="margin-top: 8px;padding: 16px; height: auto;">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
</div>
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;">
<search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
:method-list="tableBtn" @clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList"
/>
</div>
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
</div>
</template>
<script>
// import { parseTime } from '../../core/mixins/code-filter';
import { getWorkOrderPage, exportExcel } from '@/api/produceData/order';
// import inputTable from './inputTable.vue';
import lineChart from './lineChart';
import moment from 'moment'
// import ButtonNav from '@/components/ButtonNav'
import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata';
import { factoryList, factoryArray } from "@/utils/constants";
// import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx'
export default {
components: { lineChart, AddOrUpdate },
mixins: [basicPage],
data() {
return {
factoryList,
factoryArray,
listQuery: {
pageSize: 20,
pageNo: 1,
factorys: undefined,
total: 0,
time: undefined,
orderStatus:undefined
},
detailOrUpdateVisible:false,
tableBtn: [
{
type: 'detail',
btnName: '详情',
},
// {
// type: 'delete',
// btnName: '',
// },
].filter((v) => v),
typeList: [
{
name: '芯片',
id: 0,
},
{
name: '标准组件',
id: 1,
},
{
name: 'BIPV产品',
id: 2,
},
],
formConfig: [
{
type: "select",
label: "工厂名称",
selectOptions: factoryArray,
labelField: 'name',
valueField: 'id',
param: "factory",
multiple: true,
filterable: true
},
{
type: "select",
label: "工单状态",
selectOptions: [
{
label: '未开始',
value: 0
},
{
label: '生产中',
value: 1
},
{
label: '已完成',
value: 2
}
],
labelField: "label",
valueField: "value",
param: "orderStatus",
multiple: true,
filterable: true
},
{
type: "datePicker",
label: "时间段",
dateType: "daterange",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
rangeSeparator: "-",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
param: "timeSlot",
defaultSelect: [],
defaultTime: ["00:00:00", "23:59:59"],
width: 250,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "separate",
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true
},
],
formConfig2: [
{
type: 'title',
label: '工厂信息',
},
],
formConfig1: [
{
type: 'title',
label: '良品数量',
},
],
tableProps: [
{
prop: 'factory',
label: '工厂名称',
filter: (val) => factoryList[val],
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'workOrderNumber',
label: '工单号',
// filter: (val) => ['', '', 'BIPV', ''][val]
},
{
prop: 'workOrderType',
label: '工单类型',
filter: (val) => ['', '芯片订单', '组件类型', 'bipv类型'][val],
},
{
prop: 'plannedInvestment',
label: '计划投入',
},
{
prop: 'actualInvestment',
label: '实际投入',
},
{
prop: 'targetProduction',
label: '目标产量',
},
{
prop: 'actualProduction',
label: '实际产量',
},
{
prop: 'productionProgress',
label: '生产进度',
filter: (val) => (val * 100) + '%'
},
{
prop: 'orderStatus',
label: '工单状态',
filter: (val) => ['未开始', '生产中', '已完成'][val],
},
{
prop: 'startTime',
label: '开始时间',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'endTime',
label: '完成时间',
minWidth: 100,
showOverflowtooltip: true
}
],
tableData: [],
xAxis: [],
lineData: {}
// proLineList: [],
// all: {}
};
},
created() {
const today = new Date()
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')]
this.formConfig[2].defaultSelect = this.listQuery.time
},
methods: {
otherMethods(val) {
this.detailOrUpdateVisible = true;
// this.addOrEditTitle = "";
this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id);
});
},
async getDataList() {
const res = await getWorkOrderPage(this.listQuery)
this.tableData = res.data.list
this.listQuery.total = res.data.total
if (this.listQuery.total > 0) {
this.tableData.forEach(item => {
item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--'
item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--'
})
}
},
buttonClick(val) {
this.listQuery.factorys = val.factory?.length > 0 ? val.factory : undefined
this.listQuery.orderStatus = val.orderStatus?.length > 0 ? val.orderStatus : undefined
this.listQuery.time = val.timeSlot?.length > 0 ? val.timeSlot : undefined
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
if (this.listQuery.time) {
this.getDataList();
} else {
this.$message.warning('请选择时间范围!')
}
break;
case 'export':
if (this.listQuery.time) {
this.handleExport();
} else {
this.$message.warning('请选择时间范围!')
}
break;
default:
console.log(val);
}
},
/** 导出按钮操作 */
handleExport() {
this.$modal.confirm('是否确认导出工单数据?').then(() => {
//
// let params = {...this.listQuery};
// params.current = 1;
// params.size = 999;
this.exportLoading = true;
return exportExcel({
factorys: this.listQuery.factorys,
orderStatus: this.listQuery.orderStatus,
time: this.listQuery.time
});
}).then(response => {
this.$download.excel(response, '工单数据.xls');
this.exportLoading = false;
}).catch(() => {})
},
},
};
</script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
/* .blueTi */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
.app-container {
margin: 0 0px 0;
background-color: #fff;
border-radius: 4px;
padding: 16px 16px 0;
height: calc(100vh - 134px);
overflow: auto;
}
</style>

View File

@ -0,0 +1,169 @@
<!--
* @Author: zwq
* @Date: 2022-01-21 14:43:06
* @LastEditors: DY
* @LastEditTime: 2024-05-30 09:51:16
* @Description:
-->
<template>
<!-- <div> -->
<!-- <div :id="id" :class="className" :style="{ height: '65%', width:width}" /> -->
<div :id="id" :class="className" :style="{ height: height, width: width }" />
<!-- </div> -->
</template>
<script>
import * as echarts from 'echarts'
import 'echarts/theme/macarons' // echarts theme
import resize from '@/mixins/resize'
export default {
name: 'LineChart',
mixins: [resize],
props: {
id: {
type: String,
default: 'reportChart'
},
className: {
type: String,
default: 'reportChart'
},
width: {
type: String,
default: '100%'
},
beilv: {
type: Number,
default: 1
},
height: {
type: String,
default: '30vh'
},
legendPosition: {
type: String,
default: 'center'
},
showLegend: {
type: Boolean,
default: false
},
legendData: {
type: Array,
default: () => []
}
},
data() {
return {
chart: null
}
},
// mounted() {
// this.$nextTick(() => {
// this.initChart()
// })
// },
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart(xAxis, seriesList) {
this.chart = echarts.init(document.getElementById(this.id))
console.log(this.$parent);
this.chart.setOption({
title: {
text: '',
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
legend: {
// data: ['1', '2'],
right: '90px',
top: '0%',
icon: 'rect',
itemWidth: 10,
itemHeight: 10,
itemGap: 40,
},
// toolbox: {
// show: true,
// feature: {
// dataView: { show: true, readOnly: false },
// magicType: { show: true, type: ['line', 'bar'] },
// restore: { show: true },
// saveAsImage: { show: true }
// }
// },
calculable: true,
xAxis: [
{
type: 'category',
// prettier-ignore
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis: [
{
type: 'value'
}
],
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
}, true)
}
}
}
</script>
<style scoped>
/* .reportChart {
position: absolute;
height: 100%;
width: 100%;
top: 10px;
} */
</style>

View File

@ -6,60 +6,143 @@
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div
<div class="app-container" style="padding: 16px 24px 0; max-height: 45vh; flex-grow: 1;"> style="
display: flex;
flex-direction: column;
min-height: calc(100vh - 96px - 31px);
"
>
<div
class="app-container"
style="padding: 16px; max-height: 45vh; flex-grow: 1"
>
<!-- <div style="position: relative;z-index: 999;"> --> <!-- <div style="position: relative;z-index: 999;"> -->
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="reportTime"> <el-form-item label="时间维度" prop="reportTime">
<el-select clearable v-model="timeSelect" placeholder="请选择"> <el-select
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> clearable
v-model="timeSelect"
placeholder="请选择"
style="width: 80px"
>
<el-option
v-for="item in timeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="timeSelect === 'month'" label="时间范围" prop="reportTime"> <el-form-item
<el-date-picker clearable v-model="listQuery.reportTime" type="monthrange" range-separator="" v-show="timeSelect === 'month'"
start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> label="时间范围"
prop="reportTime"
>
<el-date-picker
clearable
v-model="listQuery.reportTime"
type="monthrange"
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
@change="changeTime"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="timeSelect === 'year'" label="时间范围" prop="reportTime"> <el-form-item
<el-date-picker clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year" v-show="timeSelect === 'year'"
placeholder="开始时间"> label="时间范围"
prop="reportTime"
>
<el-date-picker
clearable
v-model="listQuery.reportTime[0]"
value-format="yyyy"
type="year"
placeholder="开始时间"
>
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker v-model="listQuery.reportTime[1]" value-format="yyyy" type="year" placeholder="结束时间" <el-date-picker
@change="getYear"> v-model="listQuery.reportTime[1]"
value-format="yyyy"
type="year"
placeholder="结束时间"
@change="getYear"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="factoryId"> <el-form-item label="工厂名称" prop="factoryId">
<el-select clearable v-model="listQuery.factoryId" placeholder="请选择工厂名称"> <el-select
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> multiple
collapse-tags
v-model="listQuery.factoryId"
placeholder="请选择工厂名称"
>
<el-option
v-for="item in factoryList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="玻璃类型" prop="type"> <el-form-item label="玻璃类型" prop="type">
<el-select clearable v-model="listQuery.type" placeholder="请选择玻璃类型"> <el-select
<el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> clearable
v-model="listQuery.type"
placeholder="请选择玻璃类型"
style="width: 120px"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getDataList">查询</el-button> <el-button type="primary" size="small" @click="getDataList"
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button> >查询</el-button
>
<el-button type="primary" size="small" plain @click="handleExport"
>导出</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- </div> --> <!-- </div> -->
<!-- <el-row style="height: 500px;"> --> <!-- <el-row style="height: 500px;"> -->
<!-- <div> --> <!-- <div> -->
<line-chart class="yearChart" ref="lineChart" style="height: 35vh;width: 100%"></line-chart> <line-chart
class="yearChart"
ref="lineChart"
style="height: 35vh; width: 100%"
></line-chart>
<!-- </div> --> <!-- </div> -->
<!-- </el-row> --> <!-- </el-row> -->
</div> </div>
<!-- <el-row style="height: 400px;"> --> <!-- <el-row style="height: 400px;"> -->
<!-- </el-row> --> <!-- </el-row> -->
<div class="app-container" style="margin-top: 18px; height: unset; flex-grow: 1; padding: 16px;"> <div
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> class="app-container"
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" style="margin-top: 18px; height: unset; flex-grow: 1; padding: 16px"
:table-data="tableData"> >
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
>
</base-table> </base-table>
</div> </div>
</div> </div>
@ -69,9 +152,9 @@
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import { getGlassPage, exportGlasscExcel } from '@/api/report/glass'; // import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import { report } from 'process'; import { report } from "process";
import lineChart from './lineChart'; import lineChart from "./lineChart";
import moment from 'moment' import moment from "moment";
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
@ -85,50 +168,62 @@ export default {
total: 0, total: 0,
type: null, type: null,
// reportType: 2, // reportType: 2,
reportTime: [] reportTime: [],
}, },
// startDatePicker: this.beginDate(), // startDatePicker: this.beginDate(),
// endDatePicker: this.processDate(), // endDatePicker: this.processDate(),
yeartsStart: '', yeartsStart: "",
yeartsEnd: '', yeartsEnd: "",
urlOptions: { urlOptions: {
// getDataListURL: getGlassPage, // getDataListURL: getGlassPage,
// exportURL: exportGlasscExcel // exportURL: exportGlasscExcel
}, },
timeList: [ timeList: [
{ {
value: 'month', value: "day",
label:'月' label: "日",
}, },
{ {
value: 'year', value: "week",
label: '年' label: "周",
} },
{
value: "month",
label: "月",
},
{
value: "year",
label: "年",
},
], ],
factoryList: [ factoryList: [
{ {
name: '测试', name: "瑞昌",
id:1
}
],
typeList: [
{
name: '芯片',
id:0,
},
{
name: '标准组件',
id: 1, id: 1,
}, },
{ {
name: 'BIPV产品', name: "邯郸",
id: 2,
},
],
typeList: [
{
name: "芯片",
id: 0,
},
{
name: "标准组件",
id: 1,
},
{
name: "BIPV产品",
id: 2, id: 2,
}, },
], ],
formConfig: [ formConfig: [
{ {
type: 'title', type: "title",
label: '报表管理', label: "报表管理",
}, },
], ],
tableProps: [ tableProps: [
@ -140,69 +235,72 @@ export default {
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// }, // },
{ {
prop: 'userName', prop: "userName",
label: '科目', label: "科目",
}, },
{ {
prop: 'nickName', prop: "nickName",
label: '类别', label: "类别",
}, },
{ {
prop: 'datas', prop: "datas",
label: '数值', label: "数值",
// subcomponent: row // subcomponent: row
}, },
{ {
prop: 'unit', prop: "unit",
label: '单位', label: "单位",
// subcomponent: row // subcomponent: row
}, },
{ {
prop: 'remark', prop: "remark",
label: '备注', label: "备注",
// subcomponent: row // subcomponent: row
} },
], ],
timeSelect:'month', timeSelect: "month",
startTimeStamp: null, // startTimeStamp: null, //
endTimeStamp: null, // endTimeStamp: null, //
date:'凯盛玻璃控股成员企业2024生产数据', date: "凯盛玻璃控股成员企业2024生产数据",
// reportTime: '', // reportTime: '',
startTimeStamp: '', startTimeStamp: "",
endTimeStamp: '', endTimeStamp: "",
tableData: [ tableData: [
{ {
userName: 'userName', userName: "userName",
nickName: '用户名', nickName: "用户名",
datas:'111111' datas: "111111",
}, },
{ {
userName: 'userName', userName: "userName",
nickName: '用户名', nickName: "用户名",
datas: '111111' datas: "111111",
}, },
{ {
userName: 'userName', userName: "userName",
nickName: '用户名', nickName: "用户名",
datas: '111111' datas: "111111",
// subcomponent: row // subcomponent: row
} },
], ],
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
}, },
mounted() { mounted() {
this.getDict() this.getDict();
// this.getCurrentYearFirst() // this.getCurrentYearFirst()
// this.getDataList() // this.getDataList()
}, },
methods: { methods: {
getYear(e) { getYear(e) {
if (this.listQuery.reportTime[0] && e - this.listQuery.reportTime[0] > 10) { if (
this.listQuery.reportTime[0] &&
e - this.listQuery.reportTime[0] > 10
) {
this.$message({ this.$message({
message: '年份起止时间不能超过十年', message: "年份起止时间不能超过十年",
type: 'warning' type: "warning",
}); });
// console.log(); // console.log();
} }
@ -210,24 +308,34 @@ export default {
}, },
changeTime() { changeTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss'); this.createStartDate = moment(
this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss'); new Date(this.listQuery.reportTime[0]),
const numDays = (new Date(this.listQuery.reportTime[1]).getTime() - new Date(this.listQuery.reportTime[0]).getTime()) / (24 * 3600 * 1000); if (numDays > 730) { "yyyy-MM-dd hh:mm:ss"
);
this.createEndDate = moment(
new Date(this.listQuery.reportTime[1]),
"yyyy-MM-dd hh:mm:ss"
);
const numDays =
(new Date(this.listQuery.reportTime[1]).getTime() -
new Date(this.listQuery.reportTime[0]).getTime()) /
(24 * 3600 * 1000);
if (numDays > 730) {
this.$message({ this.$message({
message: '时间范围不能超过24个月', message: "时间范围不能超过24个月",
type: 'warning' type: "warning",
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
this.createStartDate = ''; this.createStartDate = "";
this.createEndDate = ''; this.createEndDate = "";
} }
} else { } else {
this.createStartDate = ''; this.createStartDate = "";
this.createEndDate = ''; this.createEndDate = "";
} }
}, },
async getDict() { async getDict() {
this.$refs.lineChart.initChart() this.$refs.lineChart.initChart();
// 线 // 线
// const res = await getCorePLList(); // const res = await getCorePLList();
// this.proLineList = res.data; // this.proLineList = res.data;
@ -243,26 +351,24 @@ export default {
} }
floatVal = Math.round(str * 10000) / 100; floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString(); let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.'); let searchVal = strVal.indexOf(".");
if (searchVal < 0) { if (searchVal < 0) {
searchVal = strVal.length; searchVal = strVal.length;
strVal += '.'; strVal += ".";
} }
while (strVal.length <= searchVal + 2) { while (strVal.length <= searchVal + 2) {
strVal += '0'; strVal += "0";
} }
return parseFloat(strVal); return parseFloat(strVal);
} }
},
async getDataList() {
}, },
async getDataList() {},
add0(m) { add0(m) {
return m < 10 ? '0' + m : m return m < 10 ? "0" + m : m;
}, },
format(shijianchuo) { format(shijianchuo) {
//shijianchuoparseInt //shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss') var time = moment(new Date(shijianchuo)).format("YYYY-MM-DD HH:mm:ss");
// console.log(time) // console.log(time)
// var y = time.getFullYear(); // var y = time.getFullYear();
// var m = time.getMonth() + 1; // var m = time.getMonth() + 1;
@ -270,7 +376,7 @@ export default {
// var h = time.getHours(); // var h = time.getHours();
// var mm = time.getMinutes(); // var mm = time.getMinutes();
// var s = time.getSeconds(); // var s = time.getSeconds();
return time return time;
}, },
// changeTime(val) { // changeTime(val) {
// if (val) { // if (val) {
@ -295,17 +401,23 @@ export default {
var year = 1900 + unixtimestamp.getYear(); var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1); var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate(); var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) return (
year +
"-" +
month.substring(month.length - 2, month.length) +
"-" +
date.substring(date.length - 2, date.length)
);
}, },
buttonClick(val) { buttonClick(val) {
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
switch (val.btnName) { switch (val.btnName) {
case 'search': case "search":
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.getDataList(); this.getDataList();
break; break;
case 'export': case "export":
this.handleExport(); this.handleExport();
break; break;
default: default:
@ -344,7 +456,6 @@ export default {
// return wbout; // return wbout;
// //do something...... // //do something......
// }) // })
}, },
}, },
}; };
@ -353,16 +464,15 @@ export default {
<style scoped> <style scoped>
.blueTip::before { .blueTip::before {
display: inline-block; display: inline-block;
content: ''; content: "";
width: 4px; width: 4px;
height: 18px; height: 18px;
background: #0B58FF; background: #0b58ff;
border-radius: 1px; border-radius: 1px;
margin-right: 8PX; margin-right: 8px;
margin-top: 8px; margin-top: 8px;
} }
.app-container { .app-container {
margin: 0 16px 0;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
padding: 16px 16px 0; padding: 16px 16px 0;

View File

@ -714,7 +714,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
username: undefined, username: undefined,
mobile: undefined, mobile: undefined,
status: undefined, status: undefined,

16674
yarn.lock

File diff suppressed because it is too large Load Diff