Compare commits
	
		
			3 Commits
		
	
	
		
			projects/r
			...
			f8baaa8955
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f8baaa8955 | |||
| 416d4bb390 | |||
| fe7821cbd8 | 
							
								
								
									
										9
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								.env.dev
									
									
									
									
									
								
							| @@ -1,19 +1,18 @@ | |||||||
| ### | ### | ||||||
|  # @Author: Do not edit |  # @Author: Do not edit | ||||||
|  # @Date: 2023-08-29 09:40:39 |  # @Date: 2023-08-29 09:40:39 | ||||||
|  # @LastEditTime: 2024-11-25 14:31:39 |  # @LastEditTime: 2023-10-16 09:22:52 | ||||||
|  # @LastEditors: zwq |  # @LastEditors: DY | ||||||
|  # @Description:  |  # @Description:  | ||||||
| ###  | ###  | ||||||
| # 开发环境配置 | # 开发环境配置 | ||||||
| ENV = 'development' | ENV = 'development' | ||||||
|  |  | ||||||
| # 页面标题 | # 页面标题 | ||||||
| VUE_APP_TITLE = 智能监控分析系统 | VUE_APP_TITLE = 产线监控系统 | ||||||
|  |  | ||||||
| # 芋道管理系统/开发环境 | # 芋道管理系统/开发环境 | ||||||
| # VUE_APP_BASE_API = 'http://192.168.8.22:48080' | VUE_APP_BASE_API = 'http://192.168.0.33:48082' | ||||||
| VUE_APP_BASE_API = 'http://172.16.32.79:48082' |  | ||||||
|  |  | ||||||
| # 路由懒加载 | # 路由懒加载 | ||||||
| VUE_CLI_BABEL_TRANSPILE_MODULES = true | VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								.env.prod
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								.env.prod
									
									
									
									
									
								
							| @@ -1,24 +1,15 @@ | |||||||
| ### |  | ||||||
|  # @Author: zwq |  | ||||||
|  # @Date: 2024-03-27 15:49:55 |  | ||||||
|  # @LastEditors: zwq |  | ||||||
|  # @LastEditTime: 2024-10-30 11:08:47 |  | ||||||
|  # @Description: |  | ||||||
| ### |  | ||||||
| # 生产环境配置 | # 生产环境配置 | ||||||
| ENV = 'production' | ENV = 'production' | ||||||
|  |  | ||||||
| # 页面标题 | # 页面标题 | ||||||
| VUE_APP_TITLE = 智能监控分析系统 | VUE_APP_TITLE = 产线监控系统 | ||||||
|  |  | ||||||
| # 芋道管理系统/生产环境 | # 芋道管理系统/生产环境 | ||||||
| # VUE_APP_BASE_API = '/prod-api' | VUE_APP_BASE_API = '/prod-api' | ||||||
| VUE_APP_BASE_API = '' |  | ||||||
|  |  | ||||||
| # 根据服务器或域名修改 | # 根据服务器或域名修改 | ||||||
| # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' | # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' | ||||||
| # PUBLIC_PATH = 'http://192.168.0.33:8888/' | PUBLIC_PATH = 'http://192.168.0.33:8888/' | ||||||
| PUBLIC_PATH = '' |  | ||||||
|  |  | ||||||
| # 二级部署路径 | # 二级部署路径 | ||||||
| VUE_APP_APP_NAME ='yudao-admin' | VUE_APP_APP_NAME ='yudao-admin' | ||||||
|   | |||||||
| @@ -6,9 +6,9 @@ | |||||||
|   "license": "MIT", |   "license": "MIT", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "local": "vue-cli-service serve --mode local", |     "local": "vue-cli-service serve --mode local", | ||||||
|     "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev", |     "dev": "vue-cli-service serve --mode dev", | ||||||
|     "front": "vue-cli-service serve --mode front", |     "front": "vue-cli-service serve --mode front", | ||||||
|     "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod", |     "build:prod": "vue-cli-service build --mode prod", | ||||||
|     "build:stage": "vue-cli-service build --mode stage", |     "build:stage": "vue-cli-service build --mode stage", | ||||||
|     "build:dev": "vue-cli-service build --mode dev", |     "build:dev": "vue-cli-service build --mode dev", | ||||||
|     "build:static": "vue-cli-service build --mode static", |     "build:static": "vue-cli-service build --mode static", | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| @@ -1,86 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-11 15:00:03 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-12 10:25:30 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 获得分页数据 |  | ||||||
| export function energyQuantityManualPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 创建 |  | ||||||
| export function energyQuantityManualCreate(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新 |  | ||||||
| export function energyQuantityManualUpdate(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| //获得能源抄表(手动) |  | ||||||
| export function energyQuantityManualGet(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/get', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| //删除 |  | ||||||
| export function energyQuantityManualDelete(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/delete', |  | ||||||
|     method: 'delete', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| //导出 |  | ||||||
| export function energyQuantityManualExport(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-quantity-manual/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得能源表名配置分页 |  | ||||||
| export function energyTablePage() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-type-meter-bind/list', |  | ||||||
|     method: 'get', |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得能源表名配置 |  | ||||||
| export function energyTableGet(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-type-meter-bind/list', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新能源表名配置 |  | ||||||
| export function energyTableUpdate(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/energy-type-meter-bind/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -3,7 +3,7 @@ import request from '@/utils/request' | |||||||
| // 创建设备 | // 创建设备 | ||||||
| export function createEquipment(data) { | export function createEquipment(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/create', |     url: '/base/core-equipment/create', | ||||||
|     method: 'post', |     method: 'post', | ||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| @@ -12,7 +12,7 @@ export function createEquipment(data) { | |||||||
| // 更新设备 | // 更新设备 | ||||||
| export function updateEquipment(data) { | export function updateEquipment(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/update', |     url: '/base/core-equipment/update', | ||||||
|     method: 'put', |     method: 'put', | ||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| @@ -21,7 +21,7 @@ export function updateEquipment(data) { | |||||||
| // 删除设备 | // 删除设备 | ||||||
| export function deleteEquipment(id) { | export function deleteEquipment(id) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/delete?id=' + id, |     url: '/base/core-equipment/delete?id=' + id, | ||||||
|     method: 'delete' |     method: 'delete' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -29,7 +29,7 @@ export function deleteEquipment(id) { | |||||||
| // 获得设备 | // 获得设备 | ||||||
| export function getEquipment(id) { | export function getEquipment(id) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/get?id=' + id, |     url: '/base/core-equipment/get?id=' + id, | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -37,7 +37,7 @@ export function getEquipment(id) { | |||||||
| // 获得设备分页 | // 获得设备分页 | ||||||
| export function getEquipmentPage(query) { | export function getEquipmentPage(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/page', |     url: '/base/core-equipment/page', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| @@ -46,7 +46,7 @@ export function getEquipmentPage(query) { | |||||||
| // 导出设备 Excel | // 导出设备 Excel | ||||||
| export function exportEquipmentExcel(query) { | export function exportEquipmentExcel(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/export-excel', |     url: '/base/core-equipment/export-excel', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query, |     params: query, | ||||||
|     responseType: 'blob' |     responseType: 'blob' | ||||||
| @@ -55,7 +55,7 @@ export function exportEquipmentExcel(query) { | |||||||
| // 获得所有设备列表 | // 获得所有设备列表 | ||||||
| export function getEquipmentAll() { | export function getEquipmentAll() { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment/listAll', |     url: '/base/core-equipment/listAll', | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: Do not edit |  | ||||||
|  * @Date: 2024-02-21 13:43:02 |  | ||||||
|  * @LastEditTime: 2024-04-30 10:07:59 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 获得关联表名 |  | ||||||
| export function getplcAllList(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/equipment-plc/listAll', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得设备 |  | ||||||
| export function getEquipmentList(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/core-equipment/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 根据产线获得工段 |  | ||||||
| export function listByParentId(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/core-workshop-section/listByParentId', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得产线工段设备树形结构 |  | ||||||
| export function getTree(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/factory/getTree', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得设备分组列表 |  | ||||||
| export function getgroupAllList(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/equipment-group/listAll', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,10 +1,3 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-10-29 09:47:40 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-02-26 16:27:48 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
|  |  | ||||||
| // 创建实时数据采集配置 | // 创建实时数据采集配置 | ||||||
| @@ -59,11 +52,3 @@ export function exportEquipmentPlcExcel(query) { | |||||||
|     responseType: 'blob' |     responseType: 'blob' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得code |  | ||||||
| export function getCode() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/equipment-group/getCode', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ import request from '@/utils/request' | |||||||
| // 创建设备类型 | // 创建设备类型 | ||||||
| export function createEquipmentType(data) { | export function createEquipmentType(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/create', |     url: '/base/core-equipment-type/create', | ||||||
|     method: 'post', |     method: 'post', | ||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| @@ -12,7 +12,7 @@ export function createEquipmentType(data) { | |||||||
| // 更新设备类型 | // 更新设备类型 | ||||||
| export function updateEquipmentType(data) { | export function updateEquipmentType(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/update', |     url: '/base/core-equipment-type/update', | ||||||
|     method: 'put', |     method: 'put', | ||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| @@ -21,7 +21,7 @@ export function updateEquipmentType(data) { | |||||||
| // 删除设备类型 | // 删除设备类型 | ||||||
| export function deleteEquipmentType(id) { | export function deleteEquipmentType(id) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/delete?id=' + id, |     url: '/base/core-equipment-type/delete?id=' + id, | ||||||
|     method: 'delete' |     method: 'delete' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -29,7 +29,7 @@ export function deleteEquipmentType(id) { | |||||||
| // 获得设备类型 | // 获得设备类型 | ||||||
| export function getEquipmentType(id) { | export function getEquipmentType(id) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/get?id=' + id, |     url: '/base/core-equipment-type/get?id=' + id, | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -37,7 +37,7 @@ export function getEquipmentType(id) { | |||||||
| // 获得设备类型分页 | // 获得设备类型分页 | ||||||
| export function getEquipmentTypePage(query) { | export function getEquipmentTypePage(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/page', |     url: '/base/core-equipment-type/page', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| @@ -46,7 +46,7 @@ export function getEquipmentTypePage(query) { | |||||||
| // 导出设备类型 Excel | // 导出设备类型 Excel | ||||||
| export function exportEquipmentTypeExcel(query) { | export function exportEquipmentTypeExcel(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/equipment-type/export-excel', |     url: '/base/core-equipment-type/export-excel', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query, |     params: query, | ||||||
|     responseType: 'blob' |     responseType: 'blob' | ||||||
|   | |||||||
| @@ -1,10 +1,3 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-10-29 09:47:40 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-02-12 09:25:11 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| // 获得工厂产线工段设备树形结构 | // 获得工厂产线工段设备树形结构 | ||||||
| export function getTree() { | export function getTree() { | ||||||
|   | |||||||
| @@ -51,13 +51,6 @@ export function getCode() { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得可用的班次列表 |  | ||||||
| export function listClassesEnabled() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-classes/listEnable', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出班次基础信息 Excel | // 导出班次基础信息 Excel | ||||||
| export function exportGroupClassesExcel(query) { | export function exportGroupClassesExcel(query) { | ||||||
|   return request({ |   return request({ | ||||||
|   | |||||||
| @@ -1,125 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建排班计划配置基础信息 |  | ||||||
| export function createGroupPlan(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新排班计划配置基础信息 |  | ||||||
| export function updateGroupPlan(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除排班计划配置基础信息 |  | ||||||
| export function deleteGroupPlan(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得排班计划配置基础信息 |  | ||||||
| export function getGroupPlan(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得排班计划配置基础信息分页 |  | ||||||
| export function getGroupPlanPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得所有排班计划列表 |  | ||||||
| export function groupPlanList() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得排班计划相关班组列表 |  | ||||||
| export function groupPlanTeamList(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得排班计划相关班次列表 |  | ||||||
| export function groupPlanClassesList(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获取code |  | ||||||
| export function getCode() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/getCode', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出排班计划配置基础信息 Excel |  | ||||||
| export function exportGroupPlanExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得产线工段树形结构 |  | ||||||
| export function getGroupPlanTree() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan/getLineSectionTree', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 创建排班计划产线工段 |  | ||||||
| export function createGroupPlanLine(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-line-section/createPlanLineSection', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新排班计划产线工段 |  | ||||||
| export function updateGroupPlanLine(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-line-section/updatePlanLineSection', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得排班计划配置基础信息 |  | ||||||
| export function getGroupPlanLine(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得当前登录用户所在部门id |  | ||||||
| export function getLoginUserDeptId() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,60 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建排班规则基础信息 |  | ||||||
| export function createGroupRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 作废排班规则 |  | ||||||
| export function disableGroupRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/disable?id=' + id, |  | ||||||
|     method: 'post', |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新排班规则基础信息 |  | ||||||
| export function updateGroupRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除排班规则基础信息 |  | ||||||
| export function deleteGroupRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得排班规则基础信息 |  | ||||||
| export function getGroupRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得排班规则基础信息分页 |  | ||||||
| export function getGroupRulePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出排班规则基础信息 Excel |  | ||||||
| export function exportGroupRuleExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-scheduling-rule/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -58,49 +58,3 @@ export function listEnabled() { | |||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得班组组员信息分页 |  | ||||||
| export function groupTeamPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得班组组员信息 |  | ||||||
| export function groupTeamDet(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/get', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| // 创建班组组员信息 |  | ||||||
| export function teamDetCreate(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新班组组员信息 |  | ||||||
| export function teamDetUpdate(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除班组组员信息 |  | ||||||
| export function teamDetDelete(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/delete', |  | ||||||
|     method: 'delete', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -8,14 +8,7 @@ export function getPreset(query) { | |||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获取某月预排班 |  | ||||||
| export function getScheduling(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-scheduling/getScheduling', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 批量创建-更新排班信息 | // 批量创建-更新排班信息 | ||||||
| export function createOrUpdateList(data) { | export function createOrUpdateList(data) { | ||||||
|   return request({ |   return request({ | ||||||
| @@ -33,22 +26,3 @@ export function autoSet(query) { | |||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得排班信息分页 |  | ||||||
| export function schedulingPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-scheduling/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出Excel |  | ||||||
| export function exportSchedulingExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-scheduling/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -1,75 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-09 16:42:19 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-10 14:33:52 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建原料 |  | ||||||
| export function createMaterial(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新原料 |  | ||||||
| export function updateMaterial(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获取code |  | ||||||
| export function getCode() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/autoCode', |  | ||||||
|     method: 'POST' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 删除原料 |  | ||||||
| export function deleteMaterial(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原料 |  | ||||||
| export function getMaterial(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原料分页 |  | ||||||
| export function getMaterialPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原料列表 |  | ||||||
| export function getMaterialList() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/list', |  | ||||||
|     method: 'get', |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原料 Excel |  | ||||||
| export function exportMaterialExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,68 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-09 16:42:19 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-10 14:31:46 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建原料 |  | ||||||
| export function createMaterialPricing(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新原料 |  | ||||||
| export function updateMaterialPricing(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获取code |  | ||||||
| export function getCode() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/autoCode', |  | ||||||
|     method: 'POST' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 删除原料 |  | ||||||
| export function deleteMaterialPricing(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原料 |  | ||||||
| export function getMaterialPricing(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原料分页 |  | ||||||
| export function getMaterialPricingPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原料 Excel |  | ||||||
| export function exportMaterialPricingExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/material-pricing/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,10 +1,3 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-03-27 15:49:55 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-10 14:36:19 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| // 获得所有工厂产线列表 | // 获得所有工厂产线列表 | ||||||
| export function getLineAll() { | export function getLineAll() { | ||||||
| @@ -13,11 +6,3 @@ export function getLineAll() { | |||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获得产线分页 |  | ||||||
| export function getLinePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/production-line/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -1,26 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
| // 获得所有员工列表 |  | ||||||
| export function getWorkerList() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/core-worker/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得员工 |  | ||||||
| export function getWorker(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/core-worker/get', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得该班组其他可选组员列表(除去现有组员) |  | ||||||
| export function otherWorkerList(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-det/otherWorkerList', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| /* | /* | ||||||
|  * @Author: zhp |  * @Author: zhp | ||||||
|  * @Date: 2023-09-12 14:07:04 |  * @Date: 2023-09-12 14:07:04 | ||||||
|  * @LastEditTime: 2025-01-08 15:47:17 |  * @LastEditTime: 2023-09-13 09:53:45 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: zhp | ||||||
|  * @Description: |  * @Description: | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| @@ -22,26 +22,3 @@ export function getCT(data) { | |||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获取产线平衡分析数据(new) |  | ||||||
| export function getNewCTNow(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/analysis/production-analysis/getNewCTNow', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获取产线平衡分析数据趋势图(new) |  | ||||||
| export function getNewCTCharts(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/analysis/production-analysis/getNewCTCharts', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获取产线平衡分析数据设备list(new) |  | ||||||
| export function getNewCTDet(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/analysis/production-analysis/getNewCTDet?lineId='+id, |  | ||||||
|     method: 'get', |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -58,12 +58,3 @@ export function exportFactoryExcel(query) { | |||||||
|     responseType: 'blob' |     responseType: 'blob' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获取产线设备状态 |  | ||||||
| export function getLineEqStatus(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/production-line/getLineEqStatus', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,28 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
|  |  | ||||||
| // 切换工艺 |  | ||||||
| export function switchLineBindProcess(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/line-bind-process/switch', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得产线工艺目前生产工艺 |  | ||||||
| export function getLineBindProcessPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/line-bind-process/nowList', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得产线工艺log分页 |  | ||||||
| export function getLineBindProcessLogPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/line-bind-process/logPage', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -16,14 +16,6 @@ export function switchLineBindProduct(data) { | |||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 切换产线是否可以自动 |  | ||||||
| export function switchAutoProduct(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/line-bind-product/switchAuto', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新产线目前生产产品表 主要为更新 | // 更新产线目前生产产品表 主要为更新 | ||||||
| export function updateLineBindProduct(data) { | export function updateLineBindProduct(data) { | ||||||
|   return request({ |   return request({ | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| /* | /* | ||||||
|  * @Author: Do not edit |  * @Author: Do not edit | ||||||
|  * @Date: 2023-09-12 09:44:53 |  * @Date: 2023-09-12 09:44:53 | ||||||
|  * @LastEditTime: 2025-01-07 09:57:36 |  * @LastEditTime: 2023-09-13 16:11:41 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @Description:  |  * @Description:  | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| @@ -17,52 +17,9 @@ export function getPdlAutoReport(data) { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 获得所有工厂产线列表 | // 获得所有工厂产线列表 | ||||||
| export function getPdList(id) { | export function getPdList() { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/production-line/listAll' + (id ? '?id=' + id : ''), |     url: '/base/production-line/listAll', | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获得产线自动报表 |  | ||||||
| export function getLineAuto(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/production-monitor/getPdlAutoReportNew', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得产品自动报表 |  | ||||||
| export function getProductAuto(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/production-monitor/getProcessAutoReportNew', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 班组自动报表分页 |  | ||||||
| export function getTeamReportPage(data) { |  | ||||||
|   return request({ |  | ||||||
| 		url: '/monitoring/group-off-record/page', |  | ||||||
| 		method: 'post', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 班组自动报表分页详细 |  | ||||||
| export function getTeamReportPageDet(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/group-off-record/get?id=' + id, |  | ||||||
|     method: 'get', |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| export function exportGroupProductReportExcel(data) { |  | ||||||
|   return request({ |  | ||||||
| 		url: '/monitoring/group-off-record/export-det-excel', |  | ||||||
| 		method: 'get', |  | ||||||
| 		params: data, |  | ||||||
| 		responseType: 'blob', |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| /* | /* | ||||||
|  * @Author: Do not edit |  * @Author: Do not edit | ||||||
|  * @Date: 2023-09-12 09:44:53 |  * @Date: 2023-09-12 09:44:53 | ||||||
|  * @LastEditTime: 2025-03-03 10:43:34 |  * @LastEditTime: 2023-09-14 10:25:46 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @Description:  |  * @Description:  | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| @@ -23,21 +23,3 @@ export function getPdList() { | |||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 产线统计数据查询-历史 |  | ||||||
| export function getPdlAutoReportNewSearch(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/production-monitor/getPdlAutoReportNewSearch', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 产线统计数据查询-当前 |  | ||||||
| export function getPdlAutoReportNewSearchNow(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/production-monitor/getPdlAutoReportNewSearchNow', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data, |  | ||||||
|     timeout: 60000, |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -1,54 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 14:35:13 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 获得总成本统计-按日期分页 |  | ||||||
| export function getCostSumPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-sum/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新总成本统计-按日期 |  | ||||||
| export function updateCostSum(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-sum/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原片成本统计成本查询分页 |  | ||||||
| export function getRawCostStatisticsRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-sum/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出总成本统计-按日期 Excel |  | ||||||
| export function exportCostSumExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-sum/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片成本统计-历史成本 Excel |  | ||||||
| export function exportRawCostStatisticsHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-sum/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,55 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 15:00:09 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新深加工良品率 |  | ||||||
| export function updateDeepRatioHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-ratio-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得深加工产线良品率 |  | ||||||
| export function getDeepPDRatioHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-ratio-his/page-pd', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得深加工工段良品率 |  | ||||||
| export function getDeepWSRatioHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-ratio-his/page-ws', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工工段良品率 Excel |  | ||||||
| export function exportDeepWSRatioHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-ratio-his/export-excel-ws', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| // 导出深加工产线良品率 Excel |  | ||||||
| export function exportDeepPDRatioHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-ratio-his/export-excel-pd', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-19 16:11:19 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新原片能源历史 |  | ||||||
| export function updateEnergyHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-energy-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原片能源历史分页 |  | ||||||
| export function getEnergyHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-energy-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片能源-成本查询分页 |  | ||||||
| export function getEnergyRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-energy-realtime/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出能源成本成本查询 Excel |  | ||||||
| export function exportEnergyRealtimeExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-energy-realtime/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出能源成本历史 Excel |  | ||||||
| export function exportEnergyHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-energy-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 15:19:24 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新深加工能源历史 |  | ||||||
| export function updateEnergyHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-energy-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得深加工能源历史分页 |  | ||||||
| export function getEnergyHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-energy-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工能源-成本查询分页 |  | ||||||
| export function getEnergyRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-energy-realtime/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工能源成本成本查询 Excel |  | ||||||
| export function exportEnergyRealtimeExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-energy-realtime/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工能源成本历史 Excel |  | ||||||
| export function exportEnergyHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-energy-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-05 13:55:30 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新原料成本-历史 |  | ||||||
| export function updateMaterialHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-material-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原料成本-历史分页 |  | ||||||
| export function getMaterialHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-material-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原料成本-成本查询分页 |  | ||||||
| export function getMaterialRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-material-realtime/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原料成本成本查询 Excel |  | ||||||
| export function exportMaterialRealtimeExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-material-realtime/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原料成本历史 Excel |  | ||||||
| export function exportMaterialHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-material-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,36 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-22 10:53:55 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新原片良品率 |  | ||||||
| export function updatecostOriginRatioHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origin-ratio-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原片良品率 |  | ||||||
| export function getcostOriginRatioHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origin-ratio-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片良品率 Excel |  | ||||||
| export function exportcostOriginRatioHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origin-ratio-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-19 14:24:17 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新原片其他成本-历史 |  | ||||||
| export function updateRawOthercostHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原片其他成本-历史分页 |  | ||||||
| export function getRawOthercostHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片其他成本-成本查询分页 |  | ||||||
| export function getRawOthercostSunPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/page-sum', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出原片其他成本-成本查询 Excel |  | ||||||
| export function exportRawOthercostSunExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片其他成本-历史 Excel |  | ||||||
| export function exportRawOthercostHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 15:13:20 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
| // 更新深加工其他成本-历史 |  | ||||||
| export function updateRawOthercostHis(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得深加工其他成本-历史分页 |  | ||||||
| export function getRawOthercostHisPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工其他成本-成本查询分页 |  | ||||||
| export function getRawOthercostSunPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/page-sum', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出深加工其他成本-成本查询 Excel |  | ||||||
| export function exportRawOthercostSunExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工其他成本-历史 Excel |  | ||||||
| export function exportRawOthercostHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,68 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-15 17:01:20 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 14:12:09 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建原片其他成本-记录 |  | ||||||
| export function createRawOthercostLog(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新原片其他成本-记录 |  | ||||||
| export function updateRawOthercostLog(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除原片其他成本-记录 |  | ||||||
| export function deleteRawOthercostLog(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片其他成本-记录 |  | ||||||
| export function getRawOthercostLog(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片其他成本-记录分页 |  | ||||||
| export function getRawOthercostLogPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片其他成本-记录 Excel |  | ||||||
| export function exportRawOthercostLogExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/export-log-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得所有原片其他成本-记录列表 |  | ||||||
| export function getRawOthercostLogAll() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-log/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,68 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-15 17:01:20 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-22 14:59:35 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建深加工其他成本-记录 |  | ||||||
| export function createRawOthercostLog(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新深加工其他成本-记录 |  | ||||||
| export function updateRawOthercostLog(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除深加工其他成本-记录 |  | ||||||
| export function deleteRawOthercostLog(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工其他成本-记录 |  | ||||||
| export function getRawOthercostLog(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工其他成本-记录分页 |  | ||||||
| export function getRawOthercostLogPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工其他成本-记录 Excel |  | ||||||
| export function exportRawOthercostLogExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/export-log-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得所有深加工其他成本-记录列表 |  | ||||||
| export function getRawOthercostLogAll() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-log/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-02 14:43:30 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 获得深加工成本分页 |  | ||||||
| export function getDeepCostStatisticsPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-cost-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新深加工成本-历史 |  | ||||||
| export function updateDeepCostStatistics(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-cost-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得深加工成本统计成本查询分页 |  | ||||||
| export function getDeepCostStatisticsRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-cost-realtime/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工成本统计成本查询 Excel |  | ||||||
| export function exportDeepStatisticsRealtimeExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-cost-realtime/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出深加工成本统计-历史成本 Excel |  | ||||||
| export function exportDeepCostStatisticsHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-cost-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,68 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-15 17:01:20 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-22 14:55:00 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建深加工其他成本-配置 |  | ||||||
| export function createRawOthercostRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新深加工其他成本-配置 |  | ||||||
| export function updateRawOthercostRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除深加工其他成本-配置 |  | ||||||
| export function deleteRawOthercostRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工其他成本-配置 |  | ||||||
| export function getRawOthercostRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得深加工其他成本-配置分页 |  | ||||||
| export function getRawOthercostRulePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出深加工其他成本-配置 Excel |  | ||||||
| export function exportRawOthercostRuleExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得所有深加工其他成本-配置列表 |  | ||||||
| export function getRawOthercostRuleAll() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-deep-othercost-rule/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-18 16:53:17 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-06 14:35:13 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 获得原片成本分页 |  | ||||||
| export function getRawCostStatisticsPage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origincost-his/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 更新原片成本-历史 |  | ||||||
| export function updateRawCostStatistics(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origincost-his/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得原片成本统计成本查询分页 |  | ||||||
| export function getRawCostStatisticsRealtimePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origin-cost-realtime/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片成本统计成本查询 Excel |  | ||||||
| export function exportRawStatisticsRealtimeExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origin-cost-realtime/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片成本统计-历史成本 Excel |  | ||||||
| export function exportRawCostStatisticsHisExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-origincost-his/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,68 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2024-04-15 17:01:20 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-18 15:39:12 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| // 创建原片其他成本-配置 |  | ||||||
| export function createRawOthercostRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/create', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 更新原片其他成本-配置 |  | ||||||
| export function updateRawOthercostRule(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/update', |  | ||||||
|     method: 'put', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 删除原片其他成本-配置 |  | ||||||
| export function deleteRawOthercostRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片其他成本-配置 |  | ||||||
| export function getRawOthercostRule(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/get?id=' + id, |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 获得原片其他成本-配置分页 |  | ||||||
| export function getRawOthercostRulePage(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/page', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 导出原片其他成本-配置 Excel |  | ||||||
| export function exportRawOthercostRuleExcel(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/export-excel', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query, |  | ||||||
|     responseType: 'blob' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 获得所有原片其他成本-配置列表 |  | ||||||
| export function getRawOthercostRuleAll() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/cost-othercost-rule/listAll', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
| // 获得工厂分页 |  | ||||||
| export function getMaterialReceiptIssuePageData(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/material-warehouse-his/page', |  | ||||||
| 		method: 'post', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| export function createMaterialIssue(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/material-warehouse-his/create', |  | ||||||
| 		method: 'post', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
| @@ -43,14 +43,6 @@ export function getEnergyOverlimitLogPage(data) { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得手动抄表记录分页 |  | ||||||
| export function getEnergyManualLogPage(data) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/monitoring/energy-overlimit-log/pageManual', |  | ||||||
|     method: 'post', |  | ||||||
|     data: data |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出能源超限记录 Excel | // 导出能源超限记录 Excel | ||||||
| export function exportEnergyOverlimitLogExcel(query) { | export function exportEnergyOverlimitLogExcel(query) { | ||||||
|   return request({ |   return request({ | ||||||
|   | |||||||
| @@ -1,45 +0,0 @@ | |||||||
| import request from '@/utils/request' |  | ||||||
|  |  | ||||||
| export function getOrderPage(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/core-work-order/page', |  | ||||||
| 		method: 'post', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| export function updateOrderData(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/core-work-order/updatee', |  | ||||||
| 		method: 'put', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| export function createOrderData(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/core-work-order/create', |  | ||||||
| 		method: 'post', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
| export function getOrderData(id) { |  | ||||||
|   return request({ |  | ||||||
| 		url: '/base/core-work-order/get?id=' + id, |  | ||||||
| 		method: 'get', |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
| export function getOrderCode(data) { |  | ||||||
| 	return request({ |  | ||||||
| 		url: '/base/core-work-order/getCode', |  | ||||||
| 		method: 'get', |  | ||||||
| 		data: data, |  | ||||||
| 	}); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| export function deleteOrder(id) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/core-work-order/delete?id=' + id, |  | ||||||
|     method: 'delete' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 137 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 1.9 KiB | 
| @@ -1,13 +1,10 @@ | |||||||
| /* ===== PC DESIGN ===== */ | /* ===== PC DESIGN ===== */ | ||||||
| $W: 1080; | $W: 1000; | ||||||
| $H: 1920; | $H: 1920; | ||||||
| // $picW: 438; | $picW: 438; | ||||||
| // $picH: 560; | $picH: 560; | ||||||
| $picW: 1080; | $formW: 320; | ||||||
| $picH: 1118; |  | ||||||
| $formW: 420; |  | ||||||
| $tabW: $formW / 2; | $tabW: $formW / 2; | ||||||
| // $rowH: 56; |  | ||||||
| $rowH: 56; | $rowH: 56; | ||||||
| $buttonH: 50; | $buttonH: 50; | ||||||
|  |  | ||||||
| @@ -18,7 +15,6 @@ $containerBgImage: '../assets/images/bg.png'; | |||||||
| $logoWidth: 417px; | $logoWidth: 417px; | ||||||
| $logoHeight: 64px; | $logoHeight: 64px; | ||||||
| $logoImage: '../assets/logo/login-logo.png'; | $logoImage: '../assets/logo/login-logo.png'; | ||||||
| $cnbmLogo: '../assets/logo/cnbm.png'; |  | ||||||
| // container-content | // container-content | ||||||
| $contentWidth: round($W / $H * 100) * 1vw; | $contentWidth: round($W / $H * 100) * 1vw; | ||||||
| $contentHeight: round($picH / $W * 100) / 100 * $contentWidth; | $contentHeight: round($picH / $W * 100) / 100 * $contentWidth; | ||||||
| @@ -26,8 +22,7 @@ $contentBgColor: #ffffff; | |||||||
| // container-content-pic | // container-content-pic | ||||||
| $picWidth: round($picW / $H * 100) * 1vw; | $picWidth: round($picW / $H * 100) * 1vw; | ||||||
| $picHeight: inherit; | $picHeight: inherit; | ||||||
| // $picImage: '../assets/images/pic.png'; | $picImage: '../assets/images/pic.png'; | ||||||
| $picImage: '../assets/images/login-bg.png'; |  | ||||||
| // container-content-field | // container-content-field | ||||||
| $fieldWidth: $contentWidth - $picWidth; | $fieldWidth: $contentWidth - $picWidth; | ||||||
| $fieldHeight: inherit; | $fieldHeight: inherit; | ||||||
| @@ -45,9 +40,7 @@ $buttonHeight: $buttonH * 1px; | |||||||
|     float: right; |     float: right; | ||||||
|     img { |     img { | ||||||
|       cursor: pointer; |       cursor: pointer; | ||||||
| 			width: 100%; |       width:100%;max-width:100px; height:auto; | ||||||
| 			max-width: 100px; |  | ||||||
| 			height: auto; |  | ||||||
|       vertical-align: middle; |       vertical-align: middle; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @@ -57,7 +50,7 @@ $buttonHeight: $buttonH * 1px; | |||||||
|   min-width: 1080px; |   min-width: 1080px; | ||||||
|   min-height: 620px; |   min-height: 620px; | ||||||
|   background-color: $containerBgColor; |   background-color: $containerBgColor; | ||||||
| 	// background-image: url($containerBgImage); |   background-image: url($containerBgImage); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   // 定位 |   // 定位 | ||||||
|   position: relative; |   position: relative; | ||||||
| @@ -82,87 +75,49 @@ $buttonHeight: $buttonH * 1px; | |||||||
|   } |   } | ||||||
|   .content { |   .content { | ||||||
|     // 元素 |     // 元素 | ||||||
| 		// width: $contentWidth; |     width: $contentWidth; | ||||||
| 		// height: $contentHeight; |     height: $contentHeight; | ||||||
| 		width: 100%; |  | ||||||
| 		height: 100%; |  | ||||||
|     background-color: #ffffff; |     background-color: #ffffff; | ||||||
| 		// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07); |     box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07); | ||||||
| 		// border-radius: 20px; |     border-radius: 20px; | ||||||
|     // 定位 |     // 定位 | ||||||
|     position: relative; |     position: relative; | ||||||
| 		display: flex; |  | ||||||
|  |  | ||||||
|     .pic { |     .pic { | ||||||
|       // 元素 |       // 元素 | ||||||
|       width: $picWidth; |       width: $picWidth; | ||||||
|       height: $picHeight; |       height: $picHeight; | ||||||
|       background-image: url($picImage); |       background-image: url($picImage); | ||||||
|       background-repeat: no-repeat; |       background-repeat: no-repeat; | ||||||
| 			background-size: 100% 100%; |       background-size: cover; | ||||||
| 			background-position: 0 0; |       border-radius: 20px 0 0 20px; | ||||||
| 			position: relative; |       // 定位 | ||||||
|  |  | ||||||
| 			&::after { |  | ||||||
|         content: ''; |  | ||||||
|       position: absolute; |       position: absolute; | ||||||
|       top: 0; |       top: 0; | ||||||
|       left: 0; |       left: 0; | ||||||
| 				width: 100%; |  | ||||||
| 				height: 100%; |  | ||||||
|         // background: #f003; |  | ||||||
|         display: inline-block; |  | ||||||
| 			} |  | ||||||
|     } |     } | ||||||
|     .field { |     .field { | ||||||
| 			// background: #ccc3; |       width: $fieldWidth; | ||||||
| 			position: relative; |       height: $fieldHeight; | ||||||
| 			padding-top: 196px; |       // 定位 | ||||||
| 			flex: 1; |       position: absolute; | ||||||
| 			display: flex; |       top: 0; | ||||||
| 			flex-direction: column; |       left: $picWidth; | ||||||
| 			// justify-content: center; |       display:flex; | ||||||
|  |       justify-content: center; | ||||||
|       align-items: center; |       align-items: center; | ||||||
| 			.pc-title { |       .pc-title{ width: 100%; clear: both;} | ||||||
| 				width: 100%; |  | ||||||
| 				text-align: center; |  | ||||||
| 				clear: both; |  | ||||||
| 				position: relative; |  | ||||||
| 				top: -36px; |  | ||||||
|  |  | ||||||
| 				// h3.title { |  | ||||||
| 				// 	position: relative; |  | ||||||
|  |  | ||||||
| 				// 	&::before { |  | ||||||
| 				// 		content: ''; |  | ||||||
| 				// 		background: url($cnbmLogo) 100% / 100% no-repeat; |  | ||||||
| 				// 		height: 48px; |  | ||||||
| 				// 		width: 48px; |  | ||||||
| 				// 		position: absolute; |  | ||||||
| 				// 		left: 0px; |  | ||||||
| 				// 		top: 4px; |  | ||||||
| 				// 		display: inline-block; |  | ||||||
| 				// 	} |  | ||||||
| 				// } |  | ||||||
| 			} |  | ||||||
|       .mobile-title, |       .mobile-title, | ||||||
|       .mobile-switch { |       .mobile-switch { | ||||||
|         display: none; |         display: none; | ||||||
|       } |       } | ||||||
|       .form { |       .form { | ||||||
| 				margin-top: 32px; |  | ||||||
|         box-sizing: border-box; |         box-sizing: border-box; | ||||||
| 				// width: $formWidth; |         width: $formWidth; | ||||||
| 				width: 100%; |  | ||||||
|         // - - - tab |         // - - - tab | ||||||
| 				:deep(.el-tabs__nav) { |  | ||||||
| 					// background: #f0f3; |  | ||||||
| 				} |  | ||||||
|         :deep(.el-tabs__content) { |         :deep(.el-tabs__content) { | ||||||
|           padding: 20px 0 0; |           padding: 20px 0 0; | ||||||
|         } |         } | ||||||
|         :deep(.el-tabs__item) { |         :deep(.el-tabs__item) { | ||||||
| 					user-select: none; |  | ||||||
|           // 元素 |           // 元素 | ||||||
|           width: $tabWidth; |           width: $tabWidth; | ||||||
|           height: $rowHeight; |           height: $rowHeight; | ||||||
| @@ -170,13 +125,10 @@ $buttonHeight: $buttonH * 1px; | |||||||
|           // 文字 |           // 文字 | ||||||
|           line-height: $rowHeight; |           line-height: $rowHeight; | ||||||
|           color: #666666; |           color: #666666; | ||||||
| 					font-size: 18px; |  | ||||||
| 					font-weight: 400; |  | ||||||
| 					text-align: center; |  | ||||||
|         } |         } | ||||||
|         :deep(.el-tabs__item.is-active) { |         :deep(.el-tabs__item.is-active) { | ||||||
| 					font-weight: 500; |           font-weight: bold; | ||||||
| 					color: #2f53eb; |           color: #2F53EB; | ||||||
|         } |         } | ||||||
|         :deep(.el-tabs__active-bar) { |         :deep(.el-tabs__active-bar) { | ||||||
|           height: 3px; |           height: 3px; | ||||||
| @@ -200,26 +152,22 @@ $buttonHeight: $buttonH * 1px; | |||||||
|           // 文字 |           // 文字 | ||||||
|           text-align: left; |           text-align: left; | ||||||
|         } |         } | ||||||
| 				:deep(.el-input__inner::-webkit-input-placeholder) { |         :deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */ | ||||||
| 					/* WebKit browsers */ |  | ||||||
|           font-weight: 400; |           font-weight: 400; | ||||||
| 					color: #8c8c8c; |           color: #8C8C8C; | ||||||
|         } |         } | ||||||
| 				:deep(.el-input__inner:-moz-placeholder) { |         :deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */ | ||||||
| 					/* Mozilla Firefox 4 to 18 */ |  | ||||||
|           font-weight: 400; |           font-weight: 400; | ||||||
| 					color: #8c8c8c; |           color: #8C8C8C; | ||||||
|         } |         } | ||||||
| 				:deep(.el-input__inner::-moz-placeholder) { |         :deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */ | ||||||
| 					/* Mozilla Firefox 19+ */ |  | ||||||
|           font-weight: 400; |           font-weight: 400; | ||||||
| 					color: #8c8c8c; |           color: #8C8C8C; | ||||||
| 					opacity: 1; |           opacity:1; | ||||||
|         } |         } | ||||||
| 				:deep(.el-input__inner:-ms-input-placeholder) { |         :deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */ | ||||||
| 					/* Internet Explorer 10+ */ |  | ||||||
|           font-weight: 400; |           font-weight: 400; | ||||||
| 					color: #8c8c8c !important; |           color: #8C8C8C !important; | ||||||
|         } |         } | ||||||
|         :deep(.el-form-item) { |         :deep(.el-form-item) { | ||||||
|           position: relative; |           position: relative; | ||||||
| @@ -237,10 +185,10 @@ $buttonHeight: $buttonH * 1px; | |||||||
|             font-size: 14px; |             font-size: 14px; | ||||||
|             font-family: PingFang SC; |             font-family: PingFang SC; | ||||||
|             font-weight: 400; |             font-weight: 400; | ||||||
| 						color: #2f53eb; |             color: #2F53EB; | ||||||
|             span { |             span { | ||||||
|               padding-left: 15px; |               padding-left: 15px; | ||||||
| 							border-left: 2px solid #d9d9d9; |               border-left: 2px solid #D9D9D9; | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
| @@ -257,36 +205,16 @@ $buttonHeight: $buttonH * 1px; | |||||||
|           // 文字 |           // 文字 | ||||||
|           line-height: 26px; |           line-height: 26px; | ||||||
|           font-size: 20px; |           font-size: 20px; | ||||||
| 					color: #ffffff; |           color: #FFFFFF; | ||||||
|         } |         } | ||||||
|         .button-active { |         .button-active { | ||||||
| 					background: #2f53eb; |           background: #2F53EB; | ||||||
|           box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2); |           box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| 	.login-form { |  | ||||||
| 		* { |  | ||||||
| 			user-select: none; |  | ||||||
| 		} |  | ||||||
| 		// - - - input |  | ||||||
| 		:deep(.el-input__inner) { |  | ||||||
| 			// 元素 |  | ||||||
| 			width: 420px; |  | ||||||
| 			height: 66px; |  | ||||||
| 			color: #262626; |  | ||||||
| 			font-size: 18px; |  | ||||||
| 		} |  | ||||||
| 		:deep(.el-checkbox__label) { |  | ||||||
| 			font-size: 18px; |  | ||||||
| 			line-height: 14px; |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
|   .footer { |   .footer { | ||||||
| 		user-select: none; |  | ||||||
|     // 元素 |     // 元素 | ||||||
|     height: 16px; |     height: 16px; | ||||||
|     line-height: 16px; |     line-height: 16px; | ||||||
| @@ -307,30 +235,17 @@ $buttonHeight: $buttonH * 1px; | |||||||
| // - - - - - PC 最小尺寸设置 | // - - - - - PC 最小尺寸设置 | ||||||
| @media screen and (min-width: 599px) and (max-width: 1366px) { | @media screen and (min-width: 599px) and (max-width: 1366px) { | ||||||
|   .container { |   .container { | ||||||
| 		min-width: 599px; |  | ||||||
|     .content { |     .content { | ||||||
| 			// width: 710px; |       width: 710px; | ||||||
| 			// height: 397px; |       height: 397px; | ||||||
| 			width: 100%; |  | ||||||
| 			height: 100%; |  | ||||||
|       .pic { |       .pic { | ||||||
| 				// width: 314px; |         width: 314px; | ||||||
| 				display: none; |  | ||||||
|       } |       } | ||||||
|       .field { |       .field { | ||||||
| 				// width: calc(710px - 314px); |         width: calc(710px - 314px); | ||||||
| 				// left: 314px; |         left: 314px; | ||||||
| 				// justify-content: center; |  | ||||||
| 				width: 100%; |  | ||||||
|  |  | ||||||
| 				.pc-title { |  | ||||||
| 					h3 { |  | ||||||
| 						font-size: 2.4rem !important; |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
|  |  | ||||||
|         .form { |         .form { | ||||||
| 					// width: 320px; |           width: 320px; | ||||||
|           :deep(.el-input__inner) { |           :deep(.el-input__inner) { | ||||||
|             width: 320px; |             width: 320px; | ||||||
|             height: 56px; |             height: 56px; | ||||||
| @@ -344,6 +259,7 @@ $buttonHeight: $buttonH * 1px; | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| /* ===== MOBILE DESIGN ===== */ | /* ===== MOBILE DESIGN ===== */ | ||||||
| $mobileW: 375; | $mobileW: 375; | ||||||
| $mobileH: 812; | $mobileH: 812; | ||||||
| @@ -357,10 +273,9 @@ $mobileButtonH: 48; | |||||||
| $mobileContainerBgImage: '../assets/images/bg-mobile.png'; | $mobileContainerBgImage: '../assets/images/bg-mobile.png'; | ||||||
| // container-content | // container-content | ||||||
| $mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw; | $mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw; | ||||||
| $mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * | $mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * $mobileContentWidth; | ||||||
| 	$mobileContentWidth; |  | ||||||
| // container-content-field-form | // container-content-field-form | ||||||
| $mobileFormWidth: round($mobileFormW / $mobileW * 100) * 1vw; | $mobileFormWidth: round($mobileFormW / $mobileW *100) * 1vw; | ||||||
| $mobileRowHeight: $mobileRowH * 1px; | $mobileRowHeight: $mobileRowH * 1px; | ||||||
| $mobileButtonHeight: $mobileButtonH * 1px; | $mobileButtonHeight: $mobileButtonH * 1px; | ||||||
| $iconBgImage: '../assets/images/icon.png'; | $iconBgImage: '../assets/images/icon.png'; | ||||||
| @@ -373,17 +288,13 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|     min-width: 280px; |     min-width: 280px; | ||||||
|     min-height: 568px; |     min-height: 568px; | ||||||
|     // 文字 |     // 文字 | ||||||
| 		font-size: 14px; |     font-size: 17px; | ||||||
|     font-family: PingFang SC; |     font-family: PingFang SC; | ||||||
|     font-weight: bold; |     font-weight: bold; | ||||||
|     .logo { |     .logo { | ||||||
|       display: none; |       display: none; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| 		.pc-title { |  | ||||||
| 			display: none; |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
|     .content { |     .content { | ||||||
|       // 元素 |       // 元素 | ||||||
|       width: $mobileContentWidth; |       width: $mobileContentWidth; | ||||||
| @@ -398,7 +309,6 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|         display: none; |         display: none; | ||||||
|       } |       } | ||||||
|       .field { |       .field { | ||||||
|         padding: 0; |  | ||||||
|         // 元素 |         // 元素 | ||||||
|         width: inherit; |         width: inherit; | ||||||
|         min-height: inherit; |         min-height: inherit; | ||||||
| @@ -406,15 +316,12 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|         left: 0; |         left: 0; | ||||||
|         display: flex; |         display: flex; | ||||||
|         flex-direction: column; |         flex-direction: column; | ||||||
|  |  | ||||||
|         .mobile-title { |         .mobile-title { | ||||||
|           // 元素 |           // 元素 | ||||||
| 					margin: 0; |           margin: 0 0 20px; | ||||||
|           display: block; |           display: block; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         .form { |         .form { | ||||||
|           margin: 0; |  | ||||||
|           width: $mobileFormWidth; |           width: $mobileFormWidth; | ||||||
|           // - - - tab |           // - - - tab | ||||||
|           :deep(.el-tabs__header) { |           :deep(.el-tabs__header) { | ||||||
| @@ -440,25 +347,7 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|           .button { |           .button { | ||||||
|             height: $mobileButtonHeight; |             height: $mobileButtonHeight; | ||||||
|             line-height: 24px; |             line-height: 24px; | ||||||
| 						color: #ffffff; |             color: #FFFFFF; | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
|  |  | ||||||
| 				.login-form { |  | ||||||
| 					:deep(.el-input__inner) { |  | ||||||
| 						height: $mobileRowHeight; |  | ||||||
| 						line-height: 24px; |  | ||||||
| 						// 文字 |  | ||||||
| 						text-align: center; |  | ||||||
| 						color: #262626; |  | ||||||
| 					} |  | ||||||
|  |  | ||||||
|           :deep(#button-form-item) { |  | ||||||
|             margin: 0 !important; |  | ||||||
| 						button { |  | ||||||
| 							// 元素 |  | ||||||
| 							height: $mobileRowHeight; |  | ||||||
| 						} |  | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         .mobile-switch { |         .mobile-switch { | ||||||
| @@ -481,7 +370,6 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     .footer { |     .footer { | ||||||
|       // 元素 |       // 元素 | ||||||
|       font-size: 12px; |       font-size: 12px; | ||||||
| @@ -491,8 +379,9 @@ $iconBgImage: '../assets/images/icon.png'; | |||||||
|       color: #333333; |       color: #333333; | ||||||
|       opacity: 0.6; |       opacity: 0.6; | ||||||
|       // 定位 |       // 定位 | ||||||
| 			// position: absolute; |       position: absolute; | ||||||
| 			bottom: -32px; |       bottom: 20px; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,141 +0,0 @@ | |||||||
| <template> |  | ||||||
|   <!-- 按钮切换 --> |  | ||||||
|   <div v-if="buttonMode" class="button-nav"> |  | ||||||
|     <button v-for="m in menus" :key="m" @click="handleClick(m)" |  | ||||||
|       :data-text="m" |  | ||||||
|       :class="[m === currentMenu ? 'active' : '']" |  | ||||||
|       ></button> |  | ||||||
|   </div> |  | ||||||
|   <!-- 标签切换 --> |  | ||||||
|   <div v-else class="custom-tabs" style="height: 100%; width: 100%"> |  | ||||||
|     <el-tabs class="tag-nav" v-model="currentMenu" style="height: 100%" @tab-click="handleTabClick"> |  | ||||||
|       <el-tab-pane v-for="(m, idx) in menus" :key="m" :label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`" |  | ||||||
|         :name="m"> |  | ||||||
|         <slot :name="`tab${idx + 1}`"></slot> |  | ||||||
|       </el-tab-pane> |  | ||||||
|     </el-tabs> |  | ||||||
|   </div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| export default { |  | ||||||
|   name: "ButtonNav", |  | ||||||
|   props: { |  | ||||||
|     menus: { |  | ||||||
|       type: Array, |  | ||||||
|       required: true, |  | ||||||
|       default: () => [], |  | ||||||
|       validator: (val) => val.length > 0, |  | ||||||
|     }, |  | ||||||
|     buttonMode: { |  | ||||||
|       type: Boolean, |  | ||||||
|       default: true, |  | ||||||
|     }, |  | ||||||
|     // 新增:支持外部传入选中值(v-model 绑定) |  | ||||||
|     value: { |  | ||||||
|       type: String, |  | ||||||
|       default: "", |  | ||||||
|     }, |  | ||||||
|   }, |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       currentMenu: "", |  | ||||||
|     }; |  | ||||||
|   }, |  | ||||||
|   created() { |  | ||||||
|     // 优先使用外部传入的 value,否则默认第一个 |  | ||||||
|     this.currentMenu = this.value || this.menus[0]; |  | ||||||
|   }, |  | ||||||
|   watch: { |  | ||||||
|     // 监听外部 value 变化,同步到内部 currentMenu |  | ||||||
|     value(newVal) { |  | ||||||
|       this.currentMenu = newVal; |  | ||||||
|     }, |  | ||||||
|     // 监听内部 currentMenu 变化,通知外部 |  | ||||||
|     currentMenu(val) { |  | ||||||
|       this.$emit("input", val); // 触发 v-model 同步 |  | ||||||
|       this.$emit("change", val); // 保留原 change 事件 |  | ||||||
|     }, |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     // 按钮点击事件 |  | ||||||
|     handleClick(m) { |  | ||||||
|       this.currentMenu = m; |  | ||||||
|     }, |  | ||||||
|     // 标签点击事件(el-tabs 自带) |  | ||||||
|     handleTabClick(tab) { |  | ||||||
|       this.currentMenu = tab.name; |  | ||||||
|     }, |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <!-- 样式不变 --> |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .button-nav { |  | ||||||
|   width: 100%; |  | ||||||
|   display: flex; |  | ||||||
|   gap: 12px; |  | ||||||
|  |  | ||||||
|   * { |  | ||||||
|     user-select: none; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   button { |  | ||||||
|     cursor: pointer; |  | ||||||
|     appearance: none; |  | ||||||
|     outline: none; |  | ||||||
|     border: none; |  | ||||||
|     background: #fff; |  | ||||||
|     border-radius: 8px; |  | ||||||
|     padding: 15px; |  | ||||||
|     color: #888; |  | ||||||
|     letter-spacing: 2px; |  | ||||||
|     flex: 1; |  | ||||||
|     box-sizing: padding-box; |  | ||||||
|     position: relative; |  | ||||||
|  |  | ||||||
|     &::after { |  | ||||||
|       content: attr(data-text); |  | ||||||
|       position: absolute; |  | ||||||
|       top: 5px; |  | ||||||
|       left: 50%; |  | ||||||
|       font-size: 16px; |  | ||||||
|       font-weight: 500; |  | ||||||
|       transform: translate(-50%); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     &.active { |  | ||||||
|       color: #111; |  | ||||||
|       //border-bottom: 2px solid #0b58ff; |  | ||||||
|       box-shadow: 0px 2px 1px 1px #0b58ff; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
|  |  | ||||||
| <style scoped> |  | ||||||
| .custom-tabs>>>.el-tabs__header { |  | ||||||
|   margin-bottom: 8px; |  | ||||||
|   display: inline-block; |  | ||||||
|   /* transform: translateY(-12px); */ |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .custom-tabs>>>.el-tabs__item { |  | ||||||
|   padding-left: 0px !important; |  | ||||||
|   padding-right: 0px !important; |  | ||||||
|   line-height: 36px !important; |  | ||||||
|   height: 36px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .custom-tabs>>>.el-tabs__content { |  | ||||||
|   height: calc(100% - 42px); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .custom-tabs>>>.el-tab-pane { |  | ||||||
|   box-sizing: border-box; |  | ||||||
|   height: 100%; |  | ||||||
|   padding: 20px; |  | ||||||
|   border: 10px solid #f002; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -92,13 +92,13 @@ | |||||||
| 								{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }} | 								{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }} | ||||||
| 							</div> | 							</div> | ||||||
| 						</el-upload> | 						</el-upload> | ||||||
|  |  | ||||||
| 						<uploadedFile | 						<uploadedFile | ||||||
| 							class="file" | 							class="file" | ||||||
| 							v-for="file in form[col.prop] || []" | 							v-for="file in form[col.prop] || []" | ||||||
| 							:file="file" | 							:file="file" | ||||||
| 							:key="file.fileUrl" | 							:key="file.fileUrl" | ||||||
| 							@delete="handleDeleteFile(file)" | 							@delete="handleDeleteFile(file)" /> | ||||||
| 							@Preview="handlePreview(file)" /> |  | ||||||
| 					</div> | 					</div> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| @@ -138,9 +138,6 @@ const uploadedFile = { | |||||||
| 		handleDelete() { | 		handleDelete() { | ||||||
| 			this.$emit('delete', this.file); | 			this.$emit('delete', this.file); | ||||||
| 		}, | 		}, | ||||||
| 		handlePreview() { |  | ||||||
| 			this.$emit('Preview', this.file); |  | ||||||
| 		}, |  | ||||||
| 	}, | 	}, | ||||||
| 	mounted() {}, | 	mounted() {}, | ||||||
| 	render: function (h) { | 	render: function (h) { | ||||||
| @@ -159,7 +156,7 @@ const uploadedFile = { | |||||||
| 					cursor: 'pointer', | 					cursor: 'pointer', | ||||||
| 					display: 'inline-block', | 					display: 'inline-block', | ||||||
| 				}}> | 				}}> | ||||||
| 				<el-button onClick={this.handlePreview}>{this.file.fileName}</el-button> | 				{this.file.fileName} | ||||||
| 				<el-button | 				<el-button | ||||||
| 					type="text" | 					type="text" | ||||||
| 					icon="el-icon-close" | 					icon="el-icon-close" | ||||||
| @@ -193,10 +190,6 @@ export default { | |||||||
| 			type: Boolean, | 			type: Boolean, | ||||||
| 			default: false, | 			default: false, | ||||||
| 		}, | 		}, | ||||||
| 		hasFile: { |  | ||||||
| 			type: Boolean, |  | ||||||
| 			default: false, |  | ||||||
| 		}, |  | ||||||
| 		labelPosition: { | 		labelPosition: { | ||||||
| 			type: String, | 			type: String, | ||||||
| 			default: 'right', | 			default: 'right', | ||||||
| @@ -239,9 +232,7 @@ export default { | |||||||
| 		dataForm: { | 		dataForm: { | ||||||
| 			handler(val) { | 			handler(val) { | ||||||
| 				this.form = JSON.parse(JSON.stringify(val)); | 				this.form = JSON.parse(JSON.stringify(val)); | ||||||
| 				if (this.hasFile) { |  | ||||||
| 				this.form.files = this.form.files ?? []; | 				this.form.files = this.form.files ?? []; | ||||||
| 				} |  | ||||||
| 			}, | 			}, | ||||||
| 			deep: true, | 			deep: true, | ||||||
| 			immediate: true, | 			immediate: true, | ||||||
| @@ -259,20 +250,6 @@ export default { | |||||||
| 		resetFields(args) { | 		resetFields(args) { | ||||||
| 			return this.$refs.form.resetFields(args); | 			return this.$refs.form.resetFields(args); | ||||||
| 		}, | 		}, | ||||||
| 		async handlePreview(file) { |  | ||||||
| 			const data = await this.$axios({ |  | ||||||
| 				url: file.fileUrl, |  | ||||||
| 				method: 'get', |  | ||||||
| 				responseType: 'blob', |  | ||||||
| 			}); |  | ||||||
| 			const link = document.createElement('a'); |  | ||||||
| 			link.href = window.URL.createObjectURL(new Blob([data])); |  | ||||||
| 			link.download = file.fileName; |  | ||||||
| 			document.body.appendChild(link); |  | ||||||
| 			link.click(); |  | ||||||
| 			document.body.removeChild(link); |  | ||||||
| 			window.URL.revokeObjectURL(link.href); |  | ||||||
| 		}, |  | ||||||
| 		// getCode | 		// getCode | ||||||
| 		async getCode(url) { | 		async getCode(url) { | ||||||
| 			const response = await this.$axios(url); | 			const response = await this.$axios(url); | ||||||
| @@ -372,9 +349,7 @@ export default { | |||||||
| 			if (!promiseList.length) this.formLoading = false; | 			if (!promiseList.length) this.formLoading = false; | ||||||
| 		}, | 		}, | ||||||
| 		// 上传成功的特殊处理 | 		// 上传成功的特殊处理 | ||||||
| 		beforeUpload(file) { | 		beforeUpload() {}, | ||||||
|       console.log(file) |  | ||||||
|     }, |  | ||||||
| 		// 上传前的验证规则可通过 bind 属性传入 | 		// 上传前的验证规则可通过 bind 属性传入 | ||||||
| 		handleUploadSuccess(response, file, fileList) { | 		handleUploadSuccess(response, file, fileList) { | ||||||
| 			this.form.files.push({ | 			this.form.files.push({ | ||||||
|   | |||||||
| @@ -1,94 +0,0 @@ | |||||||
|  |  | ||||||
| /* |  | ||||||
|  * @Date: 2020-12-29 16:49:28 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-09-11 13:40:48 |  | ||||||
|  * @FilePath: \basic-admin\src\filters\basicData\index.js |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| const table = { |  | ||||||
|   lineStatus: { |  | ||||||
|     1: '生产中', |  | ||||||
|     2: '停止', |  | ||||||
|     3: '未知', |  | ||||||
|   }, |  | ||||||
|   deactivate: { |  | ||||||
|     1: '启用', |  | ||||||
|     0: '停用', |  | ||||||
|   }, |  | ||||||
|   wareType: { |  | ||||||
|     1: '缓存', |  | ||||||
|     2: '活动', |  | ||||||
|     3: '其它', |  | ||||||
|   }, |  | ||||||
|   reportType: { |  | ||||||
|     2: '日', |  | ||||||
|     3: '周', |  | ||||||
|     4: '月', |  | ||||||
|     5: '年', |  | ||||||
|   }, |  | ||||||
|   manual: { |  | ||||||
|     1: '手动', |  | ||||||
|     0: '自动', |  | ||||||
|   }, |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // 日期格式化 |  | ||||||
| export function parseTime(time, pattern) { |  | ||||||
|   if (arguments.length === 0 || !time) { |  | ||||||
|     return null |  | ||||||
|   } |  | ||||||
|   const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' |  | ||||||
|   let date |  | ||||||
|   if (typeof time === 'object') { |  | ||||||
|     date = time |  | ||||||
|   } else { |  | ||||||
|     if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { |  | ||||||
|       time = parseInt(time) |  | ||||||
|     } else if (typeof time === 'string') { |  | ||||||
|       time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), ''); |  | ||||||
|     } |  | ||||||
|     if ((typeof time === 'number') && (time.toString().length === 10)) { |  | ||||||
|       time = time * 1000 |  | ||||||
|     } |  | ||||||
|     date = new Date(time) |  | ||||||
|   } |  | ||||||
|   const formatObj = { |  | ||||||
|     y: date.getFullYear(), |  | ||||||
|     m: date.getMonth() + 1, |  | ||||||
|     d: date.getDate(), |  | ||||||
|     h: date.getHours(), |  | ||||||
|     i: date.getMinutes(), |  | ||||||
|     s: date.getSeconds(), |  | ||||||
|     a: date.getDay(), |  | ||||||
|     w: '', |  | ||||||
|   } |  | ||||||
|   const time_str = format.replace(/{([ymdhisaw])+}/g, (result, key) => { |  | ||||||
|     let value = formatObj[key] |  | ||||||
|     // Note: getDay() returns 0 on Sunday |  | ||||||
|     if (key === 'a') { |  | ||||||
|       return ['日', '一', '二', '三', '四', '五', '六'][value] |  | ||||||
|     } |  | ||||||
|     if (key === 'w') { |  | ||||||
|       const current = new Date(time); |  | ||||||
|       current.setHours(0, 0, 0); |  | ||||||
|       current.setDate(current.getDate() + 4 - (current.getDay() || 7)); |  | ||||||
|       const firstThursday = new Date(current.getFullYear(), 0, 4); |  | ||||||
|       firstThursday.setDate(firstThursday.getDate() + 4 - (firstThursday.getDay() || 7)); |  | ||||||
|       const time1 = current.getTime() - firstThursday.getTime(); |  | ||||||
|       const weeks = Math.ceil(time1 / (7 * 24 * 3600 * 1000)); |  | ||||||
|       return (weeks + 1) |  | ||||||
|     } |  | ||||||
|     if (result.length > 0 && value < 10) { |  | ||||||
|       value = '0' + value |  | ||||||
|     } |  | ||||||
|     return value || 0 |  | ||||||
|   }) |  | ||||||
|   return time_str |  | ||||||
| } |  | ||||||
| export default function (dictTable) { |  | ||||||
|   return function (val) { |  | ||||||
|     return table?.[dictTable]?.[val] |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @@ -1,122 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2022-08-24 11:19:43 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-10 15:46:19 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| import { listData } from "@/api/system/dict/data"; //数据字典接口 |  | ||||||
| export default { |  | ||||||
|   data() { |  | ||||||
|     /* eslint-disable */ |  | ||||||
|     return { |  | ||||||
|       urlOptions: { |  | ||||||
|         createURL: '', //新增接口 |  | ||||||
|         updateURL: '', //编辑提交接口 |  | ||||||
|         infoURL: '', //编辑时获取单条数据接口 |  | ||||||
|         codeURL: '', //获取code接口(返回结果为dataForm.code字段) |  | ||||||
|         optionArrUrl: [], //需要获取下拉框的方法数组 |  | ||||||
|         optionArr: {}, //需要获取下拉框的方法数组的返回结果 |  | ||||||
|         dictNameList: [], //数据字典name数组 |  | ||||||
|         dictArr: {}, //需要获取数据字典的方法数组的返回结果 |  | ||||||
|       }, |  | ||||||
|       visible: false, |  | ||||||
|       setData: false, // 是否需要【编辑时获取单条数据接口】返回的数据操作 |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   created() { |  | ||||||
|   }, |  | ||||||
|   activated() { |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     init(id) { |  | ||||||
|       this.dataForm.id = id || null; |  | ||||||
|       this.visible = true; |  | ||||||
|       if (this.urlOptions.optionArrUrl.length > 0) { |  | ||||||
|         this.getArr() |  | ||||||
|       } |  | ||||||
|       if (this.urlOptions.dictNameList.length > 0) { |  | ||||||
|         this.getDict() |  | ||||||
|       } |  | ||||||
|       this.$nextTick(() => { |  | ||||||
|         this.$refs["dataForm"].resetFields(); |  | ||||||
|         if (this.dataForm.id) { |  | ||||||
|           this.urlOptions.infoURL(id).then(response => { |  | ||||||
|             this.dataForm = response.data; |  | ||||||
|             if (this.setData) { |  | ||||||
|               this.setDataForm() |  | ||||||
|             } |  | ||||||
|           }); |  | ||||||
|         } else { |  | ||||||
|           if (this.urlOptions.codeURL) { |  | ||||||
|             this.getCode() |  | ||||||
|           } |  | ||||||
| 				} |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     /** 获取code */ |  | ||||||
| 		getCode() { |  | ||||||
| 			this.urlOptions.codeURL() |  | ||||||
| 				.then(({ data: res }) => { |  | ||||||
| 					this.dataForm.code = res; |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
|     /** 获取下拉框数组 */ |  | ||||||
|     getArr() { |  | ||||||
|       const params = { |  | ||||||
|         pageSize: 100, |  | ||||||
|         pageNo: 1, |  | ||||||
|       } |  | ||||||
|       this.urlOptions.optionArrUrl.forEach((item, index) => { |  | ||||||
|         item(params).then(({ data: res }) => { |  | ||||||
|           this.$set(this.urlOptions.optionArr, `arr${index}`, res.list) |  | ||||||
|         }) |  | ||||||
|           .catch(() => { |  | ||||||
|           }); |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     /** 查询字典数据列表 */ |  | ||||||
|     getDict() { |  | ||||||
|       this.urlOptions.dictNameList.forEach((item,index)=>{ |  | ||||||
|         const queryParams = { |  | ||||||
|           pageNo: 1, |  | ||||||
|           pageSize: 99, |  | ||||||
|           dictType: item, |  | ||||||
|         } |  | ||||||
|         listData(queryParams).then(response => { |  | ||||||
|           this.$set(this.urlOptions.dictArr, `dict${index}`, response.data.list) |  | ||||||
|         }); |  | ||||||
|       }) |  | ||||||
|     }, |  | ||||||
|     // 表单提交 |  | ||||||
|     dataFormSubmit() { |  | ||||||
|       this.$refs["dataForm"].validate((valid) => { |  | ||||||
|         if (!valid) { |  | ||||||
|           return false; |  | ||||||
|         } |  | ||||||
|         // 修改的提交 |  | ||||||
|         if (this.dataForm.id) { |  | ||||||
|           this.urlOptions.updateURL(this.dataForm).then(response => { |  | ||||||
|             this.$modal.msgSuccess("修改成功"); |  | ||||||
|             this.visible = false; |  | ||||||
|             this.$emit("refreshDataList"); |  | ||||||
|           }); |  | ||||||
|           return; |  | ||||||
|         } |  | ||||||
|         // 添加的提交 |  | ||||||
|         this.urlOptions.createURL(this.dataForm).then(response => { |  | ||||||
|           this.$modal.msgSuccess("新增成功"); |  | ||||||
|           this.visible = false; |  | ||||||
|           this.$emit("refreshDataList"); |  | ||||||
|         }); |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     /** 清空form */ |  | ||||||
|     formClear() { |  | ||||||
|       if (this.$refs.dataForm!==undefined) { |  | ||||||
|           this.$refs.dataForm.resetFields(); |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @@ -1,128 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2022-08-24 11:19:43 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-02 09:33:29 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| export default { |  | ||||||
|   data() { |  | ||||||
|     /* eslint-disable */ |  | ||||||
|     return { |  | ||||||
|       urlOptions: { |  | ||||||
|         getDataListURL: '', //获取table接口 |  | ||||||
|         deleteURL: '', //删除接口 |  | ||||||
|         exportURL: '' //导出接口 |  | ||||||
|       }, |  | ||||||
|       tableData: [], //table数据 |  | ||||||
|       listQuery: { //分页 |  | ||||||
|         pageSize: 10, |  | ||||||
|         pageNo: 1, |  | ||||||
|         total: 1, |  | ||||||
|       }, |  | ||||||
|       exportLoading: false, //导出完成的加载状态是否开启 |  | ||||||
|       dataListLoading: false, //获取table的加载状态是否开启 |  | ||||||
|       addOrEditTitle: '', //dialog的title |  | ||||||
|       addOrUpdateVisible: false, //dialog状态 |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   created() { |  | ||||||
|   }, |  | ||||||
|   mounted() { |  | ||||||
|     this.getDataList() |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     // 获取数据列表 |  | ||||||
|     getDataList() { |  | ||||||
|       this.dataListLoading = true; |  | ||||||
|       this.urlOptions.getDataListURL(this.listQuery).then(response => { |  | ||||||
|         this.tableData = response.data.list; |  | ||||||
|         this.listQuery.total = response.data.total; |  | ||||||
|         this.dataListLoading = false; |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     // 每页数 |  | ||||||
|     sizeChangeHandle(val) { |  | ||||||
|       this.listQuery.pageSize = val; |  | ||||||
|       this.listQuery.pageNo = 1; |  | ||||||
|       this.getDataList(); |  | ||||||
|     }, |  | ||||||
|     // 当前页 |  | ||||||
|     currentChangeHandle(val) { |  | ||||||
|       this.listQuery.pageNo = val; |  | ||||||
|       this.getDataList(); |  | ||||||
|     }, |  | ||||||
|     // 新增 |  | ||||||
|     addOrUpdateHandle(id) { |  | ||||||
|       this.addOrEditTitle = "新增"; |  | ||||||
|       this.addOrUpdateVisible = true; |  | ||||||
|       this.$nextTick(() => { |  | ||||||
|         this.$refs.addOrUpdate.init(id); |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     //tableBtn点击 |  | ||||||
|     handleClick(val) { |  | ||||||
|       if (val.type === "edit") { |  | ||||||
|         this.addOrUpdateVisible = true; |  | ||||||
|         this.addOrEditTitle = "编辑"; |  | ||||||
|         this.$nextTick(() => { |  | ||||||
|           this.$refs.addOrUpdate.init(val.data.id); |  | ||||||
|         }); |  | ||||||
|       } else if (val.type === "delete") { |  | ||||||
|         this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) |  | ||||||
|       } else { |  | ||||||
|         this.otherMethods(val) |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     // 删除 |  | ||||||
|     deleteHandle(id, name, index) { |  | ||||||
|       this.$confirm(`是否确认删除${name ? '名称为"' + name + '"' : '序号为"' + index + '"'}的数据项?`, "系统提示", { |  | ||||||
|         confirmButtonText: "确定", |  | ||||||
|         cancelButtonText: "取消", |  | ||||||
|         type: "warning", |  | ||||||
|       }) |  | ||||||
|         .then(() => { |  | ||||||
|           this.urlOptions.deleteURL(id).then(({ data }) => { |  | ||||||
|             this.$message({ |  | ||||||
|               message: "操作成功", |  | ||||||
|               type: "success", |  | ||||||
|               duration: 1500, |  | ||||||
|               onClose: () => { |  | ||||||
|                 this.getDataList(); |  | ||||||
|               }, |  | ||||||
|             }); |  | ||||||
|           }); |  | ||||||
|         }) |  | ||||||
|         .catch(() => { }); |  | ||||||
|     }, |  | ||||||
|     // dialog取消 |  | ||||||
|     handleCancel() { |  | ||||||
|       this.$refs.addOrUpdate.formClear() |  | ||||||
|       this.addOrUpdateVisible = false |  | ||||||
|       this.addOrEditTitle = '' |  | ||||||
|     }, |  | ||||||
|     // dialog确定 |  | ||||||
|     handleConfirm() { |  | ||||||
|       this.$refs.addOrUpdate.dataFormSubmit() |  | ||||||
|     }, |  | ||||||
|     // dialog的父组件方法this.$emit("refreshDataList"); |  | ||||||
|     successSubmit() { |  | ||||||
|       this.handleCancel() |  | ||||||
|       this.getDataList() |  | ||||||
|     }, |  | ||||||
|     /** 导出按钮操作 */ |  | ||||||
|     handleExport() { |  | ||||||
|       // 处理查询参数 |  | ||||||
|       let params = { ...this.queryParams }; |  | ||||||
|       params.pageNo = undefined; |  | ||||||
|       params.pageSize = undefined; |  | ||||||
|       this.$modal.confirm('是否确认导出所有数据项?').then(() => { |  | ||||||
|         this.exportLoading = true; |  | ||||||
|         return this.urlOptions.exportURL(params); |  | ||||||
|       }).then(response => { |  | ||||||
|         this.$download.excel(response, '报表.xls'); |  | ||||||
|         this.exportLoading = false; |  | ||||||
|       }).catch(() => { }); |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| export default { |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			tableH: this.tableHeight(260), |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); |  | ||||||
| 		window.addEventListener('resize', this._setTableHeight); |  | ||||||
| 	}, |  | ||||||
| 	destroyed() { |  | ||||||
| 		window.removeEventListener('resize', this._setTableHeight); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		_setTableHeight() { |  | ||||||
| 			this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); |  | ||||||
| 			// this.tableH = this.tableHeight(260); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| export default { |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			tableH: this.tableHeight(260), |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); |  | ||||||
| 		window.addEventListener('resize', this._setTableHeight); |  | ||||||
| 	}, |  | ||||||
| 	destroyed() { |  | ||||||
| 		window.removeEventListener('resize', this._setTableHeight); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		_setTableHeight() { |  | ||||||
| 			this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); |  | ||||||
| 			// this.tableH = this.tableHeight(260); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| @@ -70,18 +70,17 @@ export const constantRoutes = [ | |||||||
|     hidden: true |     hidden: true | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     path: "", |     path: '/', | ||||||
|     component: Layout, |     component: Layout, | ||||||
|     redirect: "index", |     // redirect: 'core/base/factory', | ||||||
|     children: [ |     children: [{ | ||||||
|       { |       path: 'index', | ||||||
|         path: "index", |       // redirect: 'core/base/factory', | ||||||
|         component: (resolve) => require(["@/views/core/base/factory/index"], resolve), |       component: (resolve) => require(['@/views/index'], resolve), | ||||||
|         name: "首页", |       name: '首页', | ||||||
|         meta: { title: "首页", icon: "dashboard", affix: true }, |       meta: { title: '首页', icon: 'dashboard', affix: true } | ||||||
|         hidden: true |     } | ||||||
|       }, |     ] | ||||||
|     ], |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     path: '/user', |     path: '/user', | ||||||
|   | |||||||
| @@ -86,7 +86,6 @@ export const DICT_TYPE = { | |||||||
|   // ============== PRODUCT - 产品模块 ============= |   // ============== PRODUCT - 产品模块 ============= | ||||||
|   UNIT_DICT: 'unit_dict', |   UNIT_DICT: 'unit_dict', | ||||||
|   PRODUCT_TYPE: 'product_type', |   PRODUCT_TYPE: 'product_type', | ||||||
|   PROCESS_TYPE: 'process_type', |  | ||||||
|  |  | ||||||
|   // ============== ENERGY - 能源模块 ============= |   // ============== ENERGY - 能源模块 ============= | ||||||
|   ENERGY_UNIT: 'energy_unit', |   ENERGY_UNIT: 'energy_unit', | ||||||
|   | |||||||
| @@ -48,50 +48,6 @@ export function parseTime(time, pattern) { | |||||||
|   return time_str |   return time_str | ||||||
| } | } | ||||||
|  |  | ||||||
| // 日期格式化(仅适用表格) |  | ||||||
| export function parseTimeTable(pattern) { |  | ||||||
|   return function(time){ |  | ||||||
|     if (arguments.length === 0 || !time) { |  | ||||||
|       return null |  | ||||||
|     } |  | ||||||
|     const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' |  | ||||||
|     let date |  | ||||||
|     if (typeof time === 'object') { |  | ||||||
|       date = time |  | ||||||
|     } else { |  | ||||||
|       if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { |  | ||||||
|         time = parseInt(time) |  | ||||||
|       } else if (typeof time === 'string') { |  | ||||||
|         time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),''); |  | ||||||
|       } |  | ||||||
|       if ((typeof time === 'number') && (time.toString().length === 10)) { |  | ||||||
|         time = time * 1000 |  | ||||||
|       } |  | ||||||
|       date = new Date(time) |  | ||||||
|     } |  | ||||||
|     const formatObj = { |  | ||||||
|       y: date.getFullYear(), |  | ||||||
|       m: date.getMonth() + 1, |  | ||||||
|       d: date.getDate(), |  | ||||||
|       h: date.getHours(), |  | ||||||
|       i: date.getMinutes(), |  | ||||||
|       s: date.getSeconds(), |  | ||||||
|       a: date.getDay() |  | ||||||
|     } |  | ||||||
|     const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { |  | ||||||
|       let value = formatObj[key] |  | ||||||
|       // Note: getDay() returns 0 on Sunday |  | ||||||
|       if (key === 'a') { |  | ||||||
|         return ['日', '一', '二', '三', '四', '五', '六'][value] |  | ||||||
|       } |  | ||||||
|       if (result.length > 0 && value < 10) { |  | ||||||
|         value = '0' + value |  | ||||||
|       } |  | ||||||
|       return value || 0 |  | ||||||
|     }) |  | ||||||
|     return time_str |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| // 表单重置 | // 表单重置 | ||||||
| export function resetForm(refName) { | export function resetForm(refName) { | ||||||
|   if (this.$refs[refName]) { |   if (this.$refs[refName]) { | ||||||
|   | |||||||
| @@ -6,9 +6,7 @@ | |||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| 	<div ref="dataBoard" class="data-board"> | 	<div ref="dataBoard" class=""></div> | ||||||
| 		<el-button type="text" @click="goback" class="go-back--btn">返回</el-button> |  | ||||||
| 	</div> |  | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| @@ -26,42 +24,39 @@ export default { | |||||||
| 			mainFooter: null, // dom | 			mainFooter: null, // dom | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	// mounted() { | 	mounted() { | ||||||
| 	// 	this.$nextTick(() => { | 		this.$nextTick(() => { | ||||||
| 	// 		this.modify(); | 			this.modify(); | ||||||
| 	// 	}); | 		}); | ||||||
| 	// }, | 	}, | ||||||
| 	// activated() { | 	activated() { | ||||||
| 	// 	this.modify(); | 		this.modify(); | ||||||
| 	// }, | 	}, | ||||||
| 	// deactivated() { | 	deactivated() { | ||||||
| 	// 	this.recover(); | 		this.recover(); | ||||||
| 	// }, | 	}, | ||||||
| 	// beforeDestroy() { | 	beforeDestroy() { | ||||||
| 	// 	this.recover(); | 		this.recover(); | ||||||
| 	// }, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		// modify() { | 		modify() { | ||||||
| 		// 	// 在这个页面临时修改下父类的margin,结束时需还原 | 			// 在这个页面临时修改下父类的margin,结束时需还原 | ||||||
| 		// 	this.appMain = document.querySelector('.app-main'); | 			this.appMain = document.querySelector('.app-main'); | ||||||
| 		// 	// this.appMain.style.minHeight = 'calc(100vh - 90px)'; | 			// this.appMain.style.minHeight = 'calc(100vh - 90px)'; | ||||||
| 		// 	this.appMain.style.margin = 0; | 			this.appMain.style.margin = 0; | ||||||
| 		// 	// 在这个页面临时删除 main-footer 元素,结束时需还原 | 			// 在这个页面临时删除 main-footer 元素,结束时需还原 | ||||||
| 		// 	// this.mainFooter = document.querySelector('.main-footer').cloneNode(true); | 			// this.mainFooter = document.querySelector('.main-footer').cloneNode(true); | ||||||
| 		// 	// document.querySelector('.main-footer').remove(); | 			// document.querySelector('.main-footer').remove(); | ||||||
|         //     this.$refs.dataBoard.classList.add('data-board'); |             this.$refs.dataBoard.classList.add('data-board'); | ||||||
| 		// }, | 		}, | ||||||
| 		// recover() { | 		recover() { | ||||||
|         //     this.$refs.dataBoard.classList.remove('data-board'); |             this.$refs.dataBoard.classList.remove('data-board'); | ||||||
| 		// 	this.$nextTick(() => { | 			this.$nextTick(() => { | ||||||
| 		// 		this.appMain.style.margin = this.parentStyle.margin; | 				this.appMain.style.margin = this.parentStyle.margin; | ||||||
| 		// 		// this.appMain.style.minHeight = this.parentStyle.minHeight; | 				// this.appMain.style.minHeight = this.parentStyle.minHeight; | ||||||
| 		// 		// this.appMain.insertAdjacentElement('afterend', this.mainFooter); | 				// this.appMain.insertAdjacentElement('afterend', this.mainFooter); | ||||||
| 		// 	}); | 			}); | ||||||
| 		// }, | 		}, | ||||||
| 		goback() { |  | ||||||
| 			this.$router.go(-1); |  | ||||||
| 		} |  | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| @@ -76,25 +71,4 @@ export default { | |||||||
| 	background: url('../../../assets/images/DataBoard.png') 100% 100% / contain | 	background: url('../../../assets/images/DataBoard.png') 100% 100% / contain | ||||||
| 		no-repeat; | 		no-repeat; | ||||||
| } | } | ||||||
|  |  | ||||||
| .go-back--btn { |  | ||||||
| 	position: fixed; |  | ||||||
| 	top: 28px; |  | ||||||
| 	left: 24px; |  | ||||||
| 	color: #fff; |  | ||||||
| 	font-size: 18px; |  | ||||||
| 	letter-spacing: 6px; |  | ||||||
|  |  | ||||||
| 	&:hover { |  | ||||||
| 		text-decoration: underline; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	&::after { |  | ||||||
| 		content: "\2BAA"; |  | ||||||
| 		position: absolute; |  | ||||||
| 		top: 6px; |  | ||||||
| 		right: -26px; |  | ||||||
| 		font-size: 24px; |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -320,7 +320,7 @@ export default { | |||||||
|  |  | ||||||
| 		// 新增属性 | 		// 新增属性 | ||||||
| 		handleAddAttr() { | 		handleAddAttr() { | ||||||
| 			if (!this.dataId) return this.$message.warning('请先创建设备分组信息'); | 			if (!this.dataId) return this.$message.error('请先创建设备分组信息'); | ||||||
| 			this.attrForm = { | 			this.attrForm = { | ||||||
| 				id: null, | 				id: null, | ||||||
| 				equipmentGroupId: this.dataId, | 				equipmentGroupId: this.dataId, | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> | 			<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" /> | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
|  |  | ||||||
| 		<!-- 抽屉 详情 --> | 		<!-- 抽屉 详情 --> | ||||||
| @@ -219,7 +219,7 @@ export default { | |||||||
| 					{ | 					{ | ||||||
| 						select: true, | 						select: true, | ||||||
| 						label: '设备', | 						label: '设备', | ||||||
| 						url: '/base/equipment/page?pageNo=1&pageSize=100', | 						url: '/base/core-equipment/page?pageNo=1&pageSize=100', | ||||||
| 						prop: 'equipmentId', | 						prop: 'equipmentId', | ||||||
| 						bind: { | 						bind: { | ||||||
| 							filterable: true, | 							filterable: true, | ||||||
| @@ -278,7 +278,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '设备分组编码', | 						label: '设备分组编码', | ||||||
| 						prop: 'code', | 						prop: 'code', | ||||||
| 						// url: '/base/equipment/getCode', | 						// url: '/base/core-equipment/getCode', | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 			], | 			], | ||||||
|   | |||||||
| @@ -71,14 +71,14 @@ | |||||||
| 			</el-col> | 			</el-col> | ||||||
|  |  | ||||||
| 			<el-col :span="12"> | 			<el-col :span="12"> | ||||||
| 				<el-form-item label="工段设备排序" prop="sort"> | 				<el-form-item label="工段排序" prop="sort"> | ||||||
| 					<el-input-number | 					<el-input-number | ||||||
| 						v-model="dataForm.sort" | 						v-model="dataForm.sort" | ||||||
| 						filterable | 						filterable | ||||||
| 						min="0" | 						min="0" | ||||||
| 						max="100" | 						max="100" | ||||||
| 						@change="$emit('update', dataForm)" | 						@change="$emit('update', dataForm)" | ||||||
| 						placeholder="请输入工段设备排序" /> | 						placeholder="请输入工段排序" /> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 		</el-row> | 		</el-row> | ||||||
| @@ -112,7 +112,6 @@ | |||||||
| 								{ label: '无类型', value: 0 }, | 								{ label: '无类型', value: 0 }, | ||||||
| 								{ label: '进口统计', value: 1 }, | 								{ label: '进口统计', value: 1 }, | ||||||
| 								{ label: '出口统计', value: 2 }, | 								{ label: '出口统计', value: 2 }, | ||||||
|                 { label: '进出口计数', value: 3 }, |  | ||||||
| 							]" | 							]" | ||||||
| 							:key="opt.value" | 							:key="opt.value" | ||||||
| 							:label="opt.label" | 							:label="opt.label" | ||||||
| @@ -192,7 +191,7 @@ export default { | |||||||
| 		// 获取设备列表 | 		// 获取设备列表 | ||||||
| 		async getEquipmentList() { | 		async getEquipmentList() { | ||||||
| 			const response = await this.$axios( | 			const response = await this.$axios( | ||||||
| 				'/base/equipment/page?pageNo=1&pageSize=100' | 				'/base/core-equipment/page?pageNo=1&pageSize=100' | ||||||
| 			); | 			); | ||||||
| 			this.equipmentList = response.data.list.map((item) => ({ | 			this.equipmentList = response.data.list.map((item) => ({ | ||||||
| 				label: item.name, | 				label: item.name, | ||||||
|   | |||||||
| @@ -4,8 +4,7 @@ | |||||||
| 		<SearchBar | 		<SearchBar | ||||||
| 			:formConfigs="searchBarFormConfig" | 			:formConfigs="searchBarFormConfig" | ||||||
| 			ref="search-bar" | 			ref="search-bar" | ||||||
| 			@select-changed="handleSearchBarChanged" | 			@headBtnClick="handleSearchBarBtnClick" /> | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> | 		<!-- 列表 --> | ||||||
| 		<base-table | 		<base-table | ||||||
| @@ -53,8 +52,6 @@ import { | |||||||
| 	getEquipmentBindSectionPage, | 	getEquipmentBindSectionPage, | ||||||
| 	exportEquipmentBindSectionExcel, | 	exportEquipmentBindSectionExcel, | ||||||
| } from '@/api/base/equipmentBindSection'; | } from '@/api/base/equipmentBindSection'; | ||||||
| import { getPdList } from '@/api/core/monitoring/auto'; |  | ||||||
| import { getFactoryPage } from '@/api/core/base/factory'; |  | ||||||
| import moment from 'moment'; | import moment from 'moment'; | ||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||||
| import DialogForm from './dialogForm.vue'; | import DialogForm from './dialogForm.vue'; | ||||||
| @@ -64,7 +61,7 @@ export default { | |||||||
| 	mixins: [basicPageMixin], | 	mixins: [basicPageMixin], | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			searchBarKeys: ['factoryId','productionLineId','workshopSectionId', 'equipmentName'], | 			searchBarKeys: ['workshopSectionId', 'equipmentName'], | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('base:equipment-bind-section:update') | 				this.$auth.hasPermi('base:equipment-bind-section:update') | ||||||
| 					? { | 					? { | ||||||
| @@ -87,9 +84,8 @@ export default { | |||||||
| 					width: 180, | 					width: 180, | ||||||
| 					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | 					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | ||||||
| 				}, | 				}, | ||||||
| 				{ prop: 'factoryName', label: '工厂' }, | 				{ prop: 'productionLine', label: '产线名称' }, | ||||||
| 				{ prop: 'productionLine', label: '产线' }, | 				{ prop: 'workshopSection', label: '工段名称' }, | ||||||
| 				{ prop: 'workshopSection', label: '工段' }, |  | ||||||
| 				{ prop: 'equipment', label: '设备名称' }, | 				{ prop: 'equipment', label: '设备名称' }, | ||||||
| 				{ prop: 'sort', label: '工段中排序' }, | 				{ prop: 'sort', label: '工段中排序' }, | ||||||
| 				{ | 				{ | ||||||
| @@ -102,7 +98,7 @@ export default { | |||||||
| 					prop: 'sectionDataType', | 					prop: 'sectionDataType', | ||||||
| 					label: '工段数据类型', | 					label: '工段数据类型', | ||||||
| 					filter: (val) => | 					filter: (val) => | ||||||
| 						val != null ? ['无类型', '进口计数', '出口计数', '进出口计数'][val] : '-', | 						val != null ? ['无类型', '进口计数', '出口计数'][val] : '-', | ||||||
| 				}, | 				}, | ||||||
| 				// { | 				// { | ||||||
| 				// 	action: 'show-alert', | 				// 	action: 'show-alert', | ||||||
| @@ -133,20 +129,6 @@ export default { | |||||||
| 				// }, | 				// }, | ||||||
| 			], | 			], | ||||||
| 			searchBarFormConfig: [ | 			searchBarFormConfig: [ | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '工厂', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'factoryId', |  | ||||||
| 					onchange: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '产线', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'productionLineId', |  | ||||||
| 					multiple: true, |  | ||||||
| 				}, |  | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| 					label: '工段', | 					label: '工段', | ||||||
| @@ -210,7 +192,7 @@ export default { | |||||||
| 					{ | 					{ | ||||||
| 						select: true, | 						select: true, | ||||||
| 						label: '设备', | 						label: '设备', | ||||||
| 						url: '/base/equipment/page?pageNo=1&pageSize=100', | 						url: '/base/core-equipment/page?pageNo=1&pageSize=100', | ||||||
| 						prop: 'equipmentId', | 						prop: 'equipmentId', | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| @@ -227,8 +209,8 @@ export default { | |||||||
| 						label: '产线数据类型', | 						label: '产线数据类型', | ||||||
| 						options: [ | 						options: [ | ||||||
| 							{ label: '无类型', value: 0 }, | 							{ label: '无类型', value: 0 }, | ||||||
| 							{ label: '进口计数', value: 1 }, | 							{ label: '进口统计', value: 1 }, | ||||||
| 							{ label: '出口计数', value: 2 }, | 							{ label: '出口统计', value: 2 }, | ||||||
| 						], | 						], | ||||||
| 						prop: 'lineDataType', | 						prop: 'lineDataType', | ||||||
| 					}, | 					}, | ||||||
| @@ -237,9 +219,8 @@ export default { | |||||||
| 						label: '工段数据类型', | 						label: '工段数据类型', | ||||||
| 						options: [ | 						options: [ | ||||||
| 							{ label: '无类型', value: 0 }, | 							{ label: '无类型', value: 0 }, | ||||||
| 							{ label: '进口计数', value: 1 }, | 							{ label: '进口统计', value: 1 }, | ||||||
| 							{ label: '出口计数', value: 2 }, | 							{ label: '出口统计', value: 2 }, | ||||||
| 							{ label: '进出口计数', value: 3 }, |  | ||||||
| 						], | 						], | ||||||
| 						prop: 'sectionDataType', | 						prop: 'sectionDataType', | ||||||
| 					}, | 					}, | ||||||
| @@ -253,9 +234,6 @@ export default { | |||||||
| 				pageSize: 10, | 				pageSize: 10, | ||||||
| 				workshopSectionId: null, | 				workshopSectionId: null, | ||||||
| 				equipmentId: null, | 				equipmentId: null, | ||||||
|         equipmentName: null, |  | ||||||
|         factoryId: null, |  | ||||||
| 				productionLineId: [], |  | ||||||
| 			}, | 			}, | ||||||
| 			// 表单参数 | 			// 表单参数 | ||||||
| 			form: {}, | 			form: {}, | ||||||
| @@ -264,7 +242,6 @@ export default { | |||||||
| 	created() { | 	created() { | ||||||
| 		this.getList(); | 		this.getList(); | ||||||
| 		this.initWorksection(); | 		this.initWorksection(); | ||||||
| 		this.getPdLineList(); |  | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		/** 准备工段数据 */ | 		/** 准备工段数据 */ | ||||||
| @@ -274,7 +251,7 @@ export default { | |||||||
| 				method: 'get', | 				method: 'get', | ||||||
| 			}); | 			}); | ||||||
| 			if (code == 0) { | 			if (code == 0) { | ||||||
| 				this.searchBarFormConfig[2].selectOptions = data.map((item) => { | 				this.searchBarFormConfig[0].selectOptions = data.map((item) => { | ||||||
| 					return { | 					return { | ||||||
| 						name: item.name, | 						name: item.name, | ||||||
| 						id: item.id, | 						id: item.id, | ||||||
| @@ -282,51 +259,6 @@ export default { | |||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		getPdLineList() { |  | ||||||
| 			getPdList().then((res) => { |  | ||||||
| 				this.searchBarFormConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
| 			const params = { |  | ||||||
| 				pageSize: 100, |  | ||||||
| 				pageNo: 1, |  | ||||||
| 			}; |  | ||||||
| 			getFactoryPage(params).then((res) => { |  | ||||||
| 				this.searchBarFormConfig[0].selectOptions = res.data.list || []; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		handleSearchBarChanged({ param, value }) { |  | ||||||
| 			this.queryParams.productionLineId = []; |  | ||||||
| 			this.$refs['search-bar'].formInline.productionLineId = undefined; |  | ||||||
| 			getPdList(value).then((res) => { |  | ||||||
| 				this.searchBarFormConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.queryParams.pageNo = 1; |  | ||||||
| 					this.queryParams.pageSize = 10; |  | ||||||
| 					this.queryParams.name = val.name; |  | ||||||
| 					this.queryParams.workshopSectionId = val.workshopSectionId || undefined; |  | ||||||
| 					this.queryParams.equipmentName = val.equipmentName || undefined; |  | ||||||
| 					this.queryParams.factoryId = val.factoryId || undefined; |  | ||||||
| 					this.queryParams.productionLineId = val.productionLineId || []; |  | ||||||
| 					this.handleQuery(); |  | ||||||
| 					break; |  | ||||||
| 				case 'add': |  | ||||||
| 					this.handleAdd(); |  | ||||||
| 					break; |  | ||||||
| 				case 'export': |  | ||||||
| 					this.handleExport(); |  | ||||||
| 					break; |  | ||||||
| 				case 'reset': |  | ||||||
| 					this.$refs['search-bar'].resetForm(); |  | ||||||
| 					this.resetQuery(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		/** 查询列表 */ | 		/** 查询列表 */ | ||||||
| 		getList() { | 		getList() { | ||||||
| 			this.loading = true; | 			this.loading = true; | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ | |||||||
| 							v-if="showForm" | 							v-if="showForm" | ||||||
| 							ref="form" | 							ref="form" | ||||||
| 							:disabled="mode.includes('detail')" | 							:disabled="mode.includes('detail')" | ||||||
| 							v-model="form" | 							:dataForm="form" | ||||||
| 							:rows="formRows" /> | 							:rows="formRows" /> | ||||||
| 					</div> | 					</div> | ||||||
|  |  | ||||||
| @@ -320,7 +320,7 @@ export default { | |||||||
|  |  | ||||||
| 		// 新增属性 | 		// 新增属性 | ||||||
| 		handleAddAttr() { | 		handleAddAttr() { | ||||||
| 			if (!this.dataId) return this.$message.warning('请先创建设备分组信息'); | 			if (!this.dataId) return this.$message.error('请先创建设备分组信息'); | ||||||
| 			this.attrForm = { | 			this.attrForm = { | ||||||
| 				id: null, | 				id: null, | ||||||
| 				equipmentGroupId: this.dataId, | 				equipmentGroupId: this.dataId, | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows"/> | 			<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" /> | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
|  |  | ||||||
| 		<!-- 抽屉 详情 --> | 		<!-- 抽屉 详情 --> | ||||||
| @@ -192,7 +192,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '设备分组编码', | 						label: '设备分组编码', | ||||||
| 						prop: 'code', | 						prop: 'code', | ||||||
| 						// url: '/base/equipment/getCode', | 						// url: '/base/core-equipment/getCode', | ||||||
| 					} | 					} | ||||||
| 				] | 				] | ||||||
| 			], | 			], | ||||||
|   | |||||||
| @@ -280,7 +280,7 @@ export default { | |||||||
| 		/** 新增按钮操作 */ | 		/** 新增按钮操作 */ | ||||||
| 		handleAdd() { | 		handleAdd() { | ||||||
| 			if (this.queryParams.equipmentGroupId == null) | 			if (this.queryParams.equipmentGroupId == null) | ||||||
| 				return this.$message.warning('没有检测到设备分组信息'); | 				return this.$message.error('没有检测到设备分组信息'); | ||||||
| 			this.reset(); | 			this.reset(); | ||||||
| 			this.open = true; | 			this.open = true; | ||||||
| 			this.title = '添加设备分组报警明细'; | 			this.title = '添加设备分组报警明细'; | ||||||
|   | |||||||
| @@ -1,109 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2021-11-18 14:16:25 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-02-26 16:37:29 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<el-row :gutter="20"> |  | ||||||
| 		<el-form |  | ||||||
| 			:model="dataForm" |  | ||||||
| 			:rules="dataRule" |  | ||||||
| 			ref="dataForm" |  | ||||||
| 			@keyup.enter.native="dataFormSubmit()" |  | ||||||
| 			label-width="80px"> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="关联表名" prop="plcTableName"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.plcTableName" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入关联表名" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="编码" prop="code"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.code" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入编码" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="标识" prop="name"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.name" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入标识" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="英文名" prop="enName"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.enName" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入英文名" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="是否采集" prop="collection"> |  | ||||||
| 					<el-switch |  | ||||||
| 						v-model="dataForm.collection" |  | ||||||
| 						:active-value="1" |  | ||||||
| 						:inactive-value="0"></el-switch> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="描述" prop="description"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.description" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入描述" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 		</el-form> |  | ||||||
| 	</el-row> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicAdd from '@/mixins/basic-add'; |  | ||||||
|  |  | ||||||
| import { |  | ||||||
| 	createEquipmentPlc, |  | ||||||
| 	updateEquipmentPlc, |  | ||||||
| 	getEquipmentPlc, |  | ||||||
| 	getCode, |  | ||||||
| } from '@/api/base/equipmentPlc'; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicAdd], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				isGetCode: true, |  | ||||||
| 				codeURL: getCode, |  | ||||||
| 				createURL: createEquipmentPlc, |  | ||||||
| 				updateURL: updateEquipmentPlc, |  | ||||||
| 				infoURL: getEquipmentPlc, |  | ||||||
| 			}, |  | ||||||
| 			dataForm: { |  | ||||||
| 				id: undefined, |  | ||||||
| 				plcTableName: undefined, |  | ||||||
| 				code: undefined, |  | ||||||
| 				name: undefined, |  | ||||||
| 				enName: undefined, |  | ||||||
| 				collection: 1, |  | ||||||
| 				description: undefined, |  | ||||||
| 			}, |  | ||||||
| 			dataRule: { |  | ||||||
| 				plcTableName: [ |  | ||||||
| 					{ required: true, message: '关联表名不能为空', trigger: 'blur' }, |  | ||||||
| 				], |  | ||||||
| 				code: [{ required: true, message: '编码不能为空', trigger: 'blur' }], |  | ||||||
| 				name: [{ required: true, message: '标识不能为空', trigger: 'blur' }], |  | ||||||
| 			}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	methods: {}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,53 +1,59 @@ | |||||||
| <template> | <template> | ||||||
| 	<div class="app-container"> | 	<div class="app-container"> | ||||||
| 		<search-bar | 		<!-- 搜索工作栏 --> | ||||||
| 			:formConfigs="formConfig" | 		<SearchBar | ||||||
| 			ref="searchBarForm" | 			:formConfigs="searchBarFormConfig" | ||||||
| 			@headBtnClick="buttonClick" /> | 			ref="search-bar" | ||||||
|  | 			@headBtnClick="handleSearchBarBtnClick" /> | ||||||
|  |  | ||||||
|  | 		<!-- 列表 --> | ||||||
| 		<base-table | 		<base-table | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" | 			:table-props="tableProps" | ||||||
| 			:page="listQuery.pageNo" | 			:page="queryParams.pageNo" | ||||||
| 			:limit="listQuery.pageSize" | 			:limit="queryParams.pageSize" | ||||||
| 			:table-data="tableData" | 			:table-data="list" | ||||||
|  | 			ref="pageTable" | ||||||
| 			@emitFun="handleEmitFun"> | 			@emitFun="handleEmitFun"> | ||||||
| 			<method-btn | 			<method-btn | ||||||
| 				v-if="tableBtn.length" | 				v-if="tableBtn.length" | ||||||
| 				slot="handleBtn" | 				slot="handleBtn" | ||||||
| 				:width="120" |  | ||||||
| 				label="操作" | 				label="操作" | ||||||
| 				:method-list="tableBtn" | 				:method-list="tableBtn" | ||||||
| 				@clickBtn="handleClick" /> | 				@clickBtn="handleTableBtnClick" /> | ||||||
| 		</base-table> | 		</base-table> | ||||||
|  |  | ||||||
|  | 		<!-- 分页组件 --> | ||||||
| 		<pagination | 		<pagination | ||||||
| 			:limit.sync="listQuery.pageSize" | 			v-show="total > 0" | ||||||
| 			:page.sync="listQuery.pageNo" | 			:total="total" | ||||||
| 			:total="listQuery.total" | 			:page.sync="queryParams.pageNo" | ||||||
| 			@pagination="getDataList" /> | 			:limit.sync="queryParams.pageSize" | ||||||
|  | 			@pagination="getList" /> | ||||||
|  |  | ||||||
|  | 		<!-- 对话框(添加 / 修改) --> | ||||||
| 		<base-dialog | 		<base-dialog | ||||||
| 			:dialogTitle="addOrEditTitle" | 			:dialogTitle="title" | ||||||
| 			:dialogVisible="addOrUpdateVisible" | 			:dialogVisible="open" | ||||||
| 			@cancel="handleCancel" | 			width="700px" | ||||||
| 			@confirm="handleConfirm" | 			@close="cancel" | ||||||
| 			:before-close="handleCancel" | 			@cancel="cancel" | ||||||
| 			width="50%"> | 			@confirm="submitForm"> | ||||||
| 			<add-or-update | 			<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" /> | ||||||
| 				ref="addOrUpdate" |  | ||||||
| 				@refreshDataList="successSubmit"></add-or-update> |  | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| import AddOrUpdate from './add-or-updata'; |  | ||||||
| import basicPage from '@/mixins/basic-page'; |  | ||||||
| import { parseTime } from '@/filter/code-filter'; |  | ||||||
| import { | import { | ||||||
|  | 	createEquipmentPlc, | ||||||
|  | 	updateEquipmentPlc, | ||||||
| 	deleteEquipmentPlc, | 	deleteEquipmentPlc, | ||||||
|  | 	getEquipmentPlc, | ||||||
| 	getEquipmentPlcPage, | 	getEquipmentPlcPage, | ||||||
| 	exportEquipmentPlcExcel, | 	exportEquipmentPlcExcel, | ||||||
| 	updateEquipmentPlc, |  | ||||||
| } from '@/api/base/equipmentPlc'; | } from '@/api/base/equipmentPlc'; | ||||||
|  | import moment from 'moment'; | ||||||
|  | import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||||
|  |  | ||||||
| const switchBtn = { | const switchBtn = { | ||||||
| 	name: 'SwitchBtn', | 	name: 'SwitchBtn', | ||||||
| @@ -84,8 +90,38 @@ const switchBtn = { | |||||||
| 		); | 		); | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| const tableProps = [ |  | ||||||
| 	{ prop: 'code', label: '编码', width: 220 }, | export default { | ||||||
|  | 	name: 'EquipmentPlc', | ||||||
|  | 	mixins: [basicPageMixin], | ||||||
|  | 	components: {}, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			tableKey: Math.random(), | ||||||
|  | 			searchBarKeys: ['name', 'plcTableName'], | ||||||
|  | 			tableBtn: [ | ||||||
|  | 				this.$auth.hasPermi('base:equipment-plc:update') | ||||||
|  | 					? { | ||||||
|  | 							type: 'edit', | ||||||
|  | 							btnName: '修改', | ||||||
|  | 					  } | ||||||
|  | 					: undefined, | ||||||
|  | 				this.$auth.hasPermi('base:equipment-plc:delete') | ||||||
|  | 					? { | ||||||
|  | 							type: 'delete', | ||||||
|  | 							btnName: '删除', | ||||||
|  | 					  } | ||||||
|  | 					: undefined, | ||||||
|  | 			].filter((v) => v), | ||||||
|  | 			tableProps: [ | ||||||
|  | 				// { | ||||||
|  | 				// 	prop: 'createTime', | ||||||
|  | 				// 	label: '添加时间', | ||||||
|  | 				// 	fixed: true, | ||||||
|  | 				// 	width: 180, | ||||||
|  | 				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | ||||||
|  | 				// }, | ||||||
|  | 				{ prop: 'code', label: '编码' }, | ||||||
| 				{ prop: 'plcTableName', label: '关联表名' }, | 				{ prop: 'plcTableName', label: '关联表名' }, | ||||||
| 				{ prop: 'name', label: '标识名称' }, | 				{ prop: 'name', label: '标识名称' }, | ||||||
| 				{ prop: 'enName', label: '英文名称' }, | 				{ prop: 'enName', label: '英文名称' }, | ||||||
| @@ -95,34 +131,8 @@ const tableProps = [ | |||||||
| 					subcomponent: switchBtn, | 					subcomponent: switchBtn, | ||||||
| 				}, | 				}, | ||||||
| 				{ prop: 'description', label: '描述' }, | 				{ prop: 'description', label: '描述' }, | ||||||
| ]; | 			], | ||||||
|  | 			searchBarFormConfig: [ | ||||||
| export default { |  | ||||||
| 	mixins: [basicPage], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getEquipmentPlcPage, |  | ||||||
| 				deleteURL: deleteEquipmentPlc, |  | ||||||
| 				exportURL: exportEquipmentPlcExcel, |  | ||||||
| 			}, |  | ||||||
| 			tableProps, |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				this.$auth.hasPermi(`base:equipment-plc:update`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'edit', |  | ||||||
| 							btnName: '编辑', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 				this.$auth.hasPermi(`base:equipment-plc:delete`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'delete', |  | ||||||
| 							btnName: '删除', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			tableData: [], |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ | 				{ | ||||||
| 					type: 'input', | 					type: 'input', | ||||||
| 					label: '表名', | 					label: '表名', | ||||||
| @@ -137,86 +147,231 @@ export default { | |||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: 'button', | ||||||
| 					btnName: '搜索', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				// { |  | ||||||
| 				// 	type: 'separate', |  | ||||||
| 				// }, |  | ||||||
| 				// { |  | ||||||
| 				// 	type: 'button', |  | ||||||
| 				// 	btnName: '重置', |  | ||||||
| 				// 	name: 'reset', |  | ||||||
| 				// }, |  | ||||||
| 				{ | 				{ | ||||||
| 					type: 'separate', | 					type: 'separate', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:factory:create') ? 'button' : '', | 					// type: this.$auth.hasPermi('base:equipment-plc:create') | ||||||
|  | 					// 	? 'button' | ||||||
|  | 					// 	: '', | ||||||
|  | 					type: 'button', | ||||||
| 					btnName: '新增', | 					btnName: '新增', | ||||||
| 					name: 'add', | 					name: 'add', | ||||||
| 					color: 'success', |  | ||||||
| 					plain: true, | 					plain: true, | ||||||
|  | 					color: 'success', | ||||||
| 				}, | 				}, | ||||||
| 				// { | 				// { | ||||||
| 				// 	type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '', | 				// 	type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '', | ||||||
| 				// }, |  | ||||||
| 				// { |  | ||||||
| 				// 	type: this.$auth.hasPermi('base:factory:export') ? 'button' : '', |  | ||||||
| 				// 	btnName: '导出', | 				// 	btnName: '导出', | ||||||
| 				// 	name: 'export', | 				// 	name: 'export', | ||||||
| 				// 	color: 'warning', | 				// 	color: 'warning', | ||||||
| 				// }, | 				// }, | ||||||
| 			], | 			], | ||||||
|  | 			rows: [ | ||||||
|  | 				[ | ||||||
|  | 					{ | ||||||
|  | 						input: true, | ||||||
|  | 						label: '关联表名', | ||||||
|  | 						prop: 'plcTableName', | ||||||
|  | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
|  | 						// bind: { | ||||||
|  | 						// 	disabled: true, // some condition, like detail mode... | ||||||
|  | 						// } | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						input: true, | ||||||
|  | 						label: '编码', | ||||||
|  | 						prop: 'code', | ||||||
|  | 						url: '/base/equipment-group/getCode', | ||||||
|  | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				[ | ||||||
|  | 					{ | ||||||
|  | 						input: true, | ||||||
|  | 						label: '标识', | ||||||
|  | 						prop: 'name', | ||||||
|  | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
|  | 						// bind: { | ||||||
|  | 						// 	disabled: true, // some condition, like detail mode... | ||||||
|  | 						// } | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						input: true, | ||||||
|  | 						label: '英文名', | ||||||
|  | 						prop: 'enName', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				[ | ||||||
|  | 					{ | ||||||
|  | 						switch: true, | ||||||
|  | 						label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集 | ||||||
|  | 						prop: 'collection', | ||||||
|  | 						value: 1, | ||||||
|  | 						bind: { | ||||||
|  | 							'active-value': 1, | ||||||
|  | 							'inactive-value': 0, | ||||||
|  | 						}, | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				[ | ||||||
|  | 					{ | ||||||
|  | 						textarea: true, | ||||||
|  | 						label: '描述', | ||||||
|  | 						prop: 'description', | ||||||
|  | 						bind: { | ||||||
|  | 							placeholder: '请输入备注', | ||||||
|  | 						}, | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 			], | ||||||
|  | 			// 是否显示弹出 | ||||||
|  | 			open: false, | ||||||
|  | 			// 查询参数 | ||||||
|  | 			queryParams: { | ||||||
|  | 				pageNo: 1, | ||||||
|  | 				pageSize: 10, | ||||||
|  | 				plcTableName: null, | ||||||
|  | 				name: null, | ||||||
|  | 			}, | ||||||
|  | 			// 表单参数 | ||||||
|  | 			form: {}, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	components: { | 	created() { | ||||||
| 		AddOrUpdate, | 		this.getList(); | ||||||
| 	}, | 	}, | ||||||
| 	created() {}, |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		/** 覆盖 handleEmitFun 的默认实现 */ | 		/** 覆盖 handleEmitFun 的默认实现 */ | ||||||
| 		handleEmitFun({ action, payload }) { | 		handleEmitFun({ action, payload }) { | ||||||
|       console.log(payload) |  | ||||||
| 			switch (action) { | 			switch (action) { | ||||||
| 				case 'update-collect': | 				case 'update-collect': | ||||||
| 					updateEquipmentPlc(payload).then((response) => { | 					this.reset(); | ||||||
|  | 					const tempForm = {}; | ||||||
|  | 					Object.keys(this.form).forEach((key) => { | ||||||
|  | 						tempForm[key] = payload[key]; | ||||||
|  | 					}); | ||||||
|  | 					updateEquipmentPlc(tempForm).then((response) => { | ||||||
| 						this.$modal.msgSuccess('修改成功'); | 						this.$modal.msgSuccess('修改成功'); | ||||||
| 						this.getDataList(); | 						this.open = false; | ||||||
|  | 						this.getList(); | ||||||
| 					}); | 					}); | ||||||
| 					break; | 					break; | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		buttonClick(val) { | 		/** 查询列表 */ | ||||||
| 			switch (val.btnName) { | 		getList() { | ||||||
| 				case 'search': | 			this.loading = true; | ||||||
| 					this.listQuery.pageNo = 1; | 			// 执行查询 | ||||||
| 					this.listQuery.pageSize = 10; | 			getEquipmentPlcPage(this.queryParams).then((response) => { | ||||||
| 					this.listQuery.name = val.name; | 				this.list = response.data.list; | ||||||
| 					this.listQuery.plcTableName = val.plcTableName; | 				this.total = response.data.total; | ||||||
| 					this.getDataList(); | 				this.loading = false; | ||||||
| 					break; | 				// this.tableKey = Math.random(); // method 1 | ||||||
| 				case 'reset': | 			}); | ||||||
| 					this.$refs.searchBarForm.resetForm(); | 		}, | ||||||
| 					this.listQuery = { | 		/** 取消按钮 */ | ||||||
| 						pageSize: 10, | 		cancel() { | ||||||
| 						pageNo: 1, | 			this.open = false; | ||||||
| 						total: 1, | 			this.reset(); | ||||||
|  | 		}, | ||||||
|  | 		/** 表单重置 */ | ||||||
|  | 		reset() { | ||||||
|  | 			this.form = { | ||||||
|  | 				id: undefined, | ||||||
|  | 				plcTableName: undefined, | ||||||
|  | 				code: undefined, | ||||||
|  | 				name: undefined, | ||||||
|  | 				enName: undefined, | ||||||
|  | 				description: undefined, | ||||||
|  | 				collection: undefined, | ||||||
| 			}; | 			}; | ||||||
| 					this.getDataList(); | 			this.resetForm('form'); | ||||||
| 					break; | 		}, | ||||||
| 				case 'add': | 		/** 搜索按钮操作 */ | ||||||
| 					this.addOrEditTitle = '新增'; | 		handleQuery() { | ||||||
| 					this.addOrUpdateVisible = true; | 			this.queryParams.pageNo = 1; | ||||||
| 					this.addOrUpdateHandle(); | 			this.getList(); | ||||||
| 					break; | 		}, | ||||||
| 				case 'export': | 		/** 重置按钮操作 */ | ||||||
| 					this.handleExport(); | 		resetQuery() { | ||||||
| 					break; | 			this.resetForm('queryForm'); | ||||||
| 				default: | 			this.handleQuery(); | ||||||
| 					console.log(val); | 		}, | ||||||
|  | 		/** 新增按钮操作 */ | ||||||
|  | 		handleAdd() { | ||||||
|  | 			this.reset(); | ||||||
|  | 			this.open = true; | ||||||
|  | 			this.title = '添加实时数据采集配置'; | ||||||
|  | 		}, | ||||||
|  | 		/** 修改按钮操作 */ | ||||||
|  | 		handleUpdate(row) { | ||||||
|  | 			this.reset(); | ||||||
|  | 			const id = row.id; | ||||||
|  | 			getEquipmentPlc(id).then((response) => { | ||||||
|  | 				this.form = response.data; | ||||||
|  | 				this.open = true; | ||||||
|  | 				this.title = '修改实时数据采集配置'; | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 		/** 提交按钮 */ | ||||||
|  | 		submitForm() { | ||||||
|  | 			this.$refs['form'].validate((valid) => { | ||||||
|  | 				if (!valid) { | ||||||
|  | 					return; | ||||||
| 				} | 				} | ||||||
|  | 				// 修改的提交 | ||||||
|  | 				if (this.form.id != null) { | ||||||
|  | 					updateEquipmentPlc(this.form).then((response) => { | ||||||
|  | 						this.$modal.msgSuccess('修改成功'); | ||||||
|  | 						this.open = false; | ||||||
|  | 						this.getList(); | ||||||
|  | 					}); | ||||||
|  | 					return; | ||||||
|  | 				} | ||||||
|  | 				// 添加的提交 | ||||||
|  | 				createEquipmentPlc(this.form).then((response) => { | ||||||
|  | 					this.$modal.msgSuccess('新增成功'); | ||||||
|  | 					this.open = false; | ||||||
|  | 					this.getList(); | ||||||
|  | 				}); | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 		/** 删除按钮操作 */ | ||||||
|  | 		handleDelete(row) { | ||||||
|  | 			const id = row.id; | ||||||
|  | 			this.$modal | ||||||
|  | 				.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?') | ||||||
|  | 				.then(function () { | ||||||
|  | 					return deleteEquipmentPlc(id); | ||||||
|  | 				}) | ||||||
|  | 				.then(() => { | ||||||
|  | 					this.getList(); | ||||||
|  | 					this.$modal.msgSuccess('删除成功'); | ||||||
|  | 				}) | ||||||
|  | 				.catch(() => {}); | ||||||
|  | 		}, | ||||||
|  | 		/** 导出按钮操作 */ | ||||||
|  | 		handleExport() { | ||||||
|  | 			// 处理查询参数 | ||||||
|  | 			let params = { ...this.queryParams }; | ||||||
|  | 			params.pageNo = undefined; | ||||||
|  | 			params.pageSize = undefined; | ||||||
|  | 			this.$modal | ||||||
|  | 				.confirm('是否确认导出所有实时数据采集配置数据项?') | ||||||
|  | 				.then(() => { | ||||||
|  | 					this.exportLoading = true; | ||||||
|  | 					return exportEquipmentPlcExcel(params); | ||||||
|  | 				}) | ||||||
|  | 				.then((response) => { | ||||||
|  | 					this.$download.excel(response, '实时数据采集配置.xls'); | ||||||
|  | 					this.exportLoading = false; | ||||||
|  | 				}) | ||||||
|  | 				.catch(() => {}); | ||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -1,388 +0,0 @@ | |||||||
| <!--  |  | ||||||
|     filename: TableConfig.vue |  | ||||||
|     author: liubin |  | ||||||
|     date: 2023-10-30 10:09:03 |  | ||||||
|     description:  |  | ||||||
| --> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<!-- 搜索工作栏 --> |  | ||||||
| 		<SearchBar |  | ||||||
| 			:formConfigs="searchBarFormConfig" |  | ||||||
| 			ref="search-bar" |  | ||||||
| 			@headBtnClick="handleSearchBarBtnClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> |  | ||||||
| 		<base-table |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="queryParams.pageNo" |  | ||||||
| 			:limit="queryParams.pageSize" |  | ||||||
| 			:table-data="list" |  | ||||||
| 			ref="pageTable" |  | ||||||
| 			@emitFun="handleEmitFun" |  | ||||||
| 			:max-height="tableH"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableBtn.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				label="操作" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleTableBtnClick" /> |  | ||||||
| 		</base-table> |  | ||||||
|  |  | ||||||
| 		<!-- 分页组件 --> |  | ||||||
| 		<pagination |  | ||||||
| 			v-show="total > 0" |  | ||||||
| 			:total="total" |  | ||||||
| 			:page.sync="queryParams.pageNo" |  | ||||||
| 			:limit.sync="queryParams.pageSize" |  | ||||||
| 			@pagination="getList" /> |  | ||||||
|  |  | ||||||
| 		<!-- 对话框(添加 / 修改) --> |  | ||||||
| 		<base-dialog |  | ||||||
| 			:dialogTitle="title" |  | ||||||
| 			:dialogVisible="open" |  | ||||||
| 			width="700px" |  | ||||||
| 			@close="cancel" |  | ||||||
| 			@cancel="cancel" |  | ||||||
| 			@confirm="submitForm"> |  | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> |  | ||||||
| 		</base-dialog> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import { |  | ||||||
| 	createEquipmentPlc, |  | ||||||
| 	updateEquipmentPlc, |  | ||||||
| 	deleteEquipmentPlc, |  | ||||||
| 	getEquipmentPlc, |  | ||||||
| 	getEquipmentPlcPage, |  | ||||||
| 	exportEquipmentPlcExcel, |  | ||||||
| } from '@/api/base/equipmentPlc'; |  | ||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; |  | ||||||
| import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; |  | ||||||
|  |  | ||||||
| const switchBtn = { |  | ||||||
| 	name: 'SwitchBtn', |  | ||||||
| 	props: ['injectData'], |  | ||||||
| 	data() { |  | ||||||
| 		return {}; |  | ||||||
| 	}, |  | ||||||
| 	computed: { |  | ||||||
| 		active() { |  | ||||||
| 			return +this.injectData[this.injectData.prop] == 1 ? true : false; |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	methods: {}, |  | ||||||
| 	render: function (h) { |  | ||||||
| 		return h( |  | ||||||
| 			'el-switch', |  | ||||||
| 			{ |  | ||||||
| 				props: { |  | ||||||
| 					value: this.active, |  | ||||||
| 				}, |  | ||||||
| 				on: { |  | ||||||
| 					change: (newVal) => { |  | ||||||
| 						this.$emit('emitData', { |  | ||||||
| 							action: 'update-collect', |  | ||||||
| 							payload: { |  | ||||||
| 								...this.injectData, |  | ||||||
| 								collection: newVal ? 1 : 0, |  | ||||||
| 							}, |  | ||||||
| 						}); |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 			}, |  | ||||||
| 			null |  | ||||||
| 		); |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	name: 'EquipmentPlc', |  | ||||||
| 	mixins: [basicPageMixin, tableHeightMixin], |  | ||||||
| 	components: {}, |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			tableKey: Math.random(), |  | ||||||
| 			searchBarKeys: ['name', 'plcTableName'], |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				this.$auth.hasPermiAnd([ |  | ||||||
| 					'base:equipment-plc:update', |  | ||||||
| 					'base:equipment-plc:query' |  | ||||||
| 					]) |  | ||||||
| 					? { |  | ||||||
| 							type: 'edit', |  | ||||||
| 							btnName: '修改', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 				this.$auth.hasPermi('base:equipment-plc:delete') |  | ||||||
| 					? { |  | ||||||
| 							type: 'delete', |  | ||||||
| 							btnName: '删除', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			tableProps: [ |  | ||||||
| 				// { |  | ||||||
| 				// 	prop: 'createTime', |  | ||||||
| 				// 	label: '添加时间', |  | ||||||
| 				// 	fixed: true, |  | ||||||
| 				// 	width: 180, |  | ||||||
| 				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), |  | ||||||
| 				// }, |  | ||||||
| 				{ prop: 'code', label: '编码', width: 180, showOverflowtooltip: true }, |  | ||||||
| 				{ prop: 'plcTableName', label: '关联表名', width: 150, showOverflowtooltip: true }, |  | ||||||
| 				{ prop: 'name', label: '标识名称', width: 150, showOverflowtooltip: true }, |  | ||||||
| 				{ prop: 'enName', label: '英文名称', width: 150, showOverflowtooltip: true }, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'collection', |  | ||||||
| 					label: '是否采集', |  | ||||||
| 					subcomponent: switchBtn, |  | ||||||
| 				}, |  | ||||||
| 				{ prop: 'description', label: '描述', minWidth: 150, showOverflowtooltip: true }, |  | ||||||
| 			], |  | ||||||
| 			searchBarFormConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'input', |  | ||||||
| 					label: '表名', |  | ||||||
| 					placeholder: '请输入表名', |  | ||||||
| 					param: 'plcTableName', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'input', |  | ||||||
| 					label: '标识', |  | ||||||
| 					placeholder: '请输入标识', |  | ||||||
| 					param: 'name', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:equipment-plc:create') |  | ||||||
| 						?  'separate' : '', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:equipment-plc:create') |  | ||||||
| 						? 'button' : '', |  | ||||||
| 					btnName: '新增', |  | ||||||
| 					name: 'add', |  | ||||||
| 					plain: true, |  | ||||||
| 					color: 'success', |  | ||||||
| 				}, |  | ||||||
| 				// { |  | ||||||
| 				// 	type: this.$auth.hasPermi('equipment:realtime-table-config:export') ? 'button' : '', |  | ||||||
| 				// 	btnName: '导出', |  | ||||||
| 				// 	name: 'export', |  | ||||||
| 				// 	color: 'warning', |  | ||||||
| 				// }, |  | ||||||
| 			], |  | ||||||
| 			rows: [ |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '关联表名', |  | ||||||
| 						prop: 'plcTableName', |  | ||||||
| 						rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }], |  | ||||||
| 						// bind: { |  | ||||||
| 						// 	disabled: true, // some condition, like detail mode... |  | ||||||
| 						// } |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '编码', |  | ||||||
| 						prop: 'code', |  | ||||||
| 						url: '/base/energy-plc/getCode', |  | ||||||
| 						rules: [{ required: true, message: '编码不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '标识', |  | ||||||
| 						prop: 'name', |  | ||||||
| 						rules: [{ required: true, message: '标识不能为空', trigger: 'blur' }], |  | ||||||
| 						// bind: { |  | ||||||
| 						// 	disabled: true, // some condition, like detail mode... |  | ||||||
| 						// } |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '英文名', |  | ||||||
| 						prop: 'enName', |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						switch: true, |  | ||||||
| 						label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集 |  | ||||||
| 						prop: 'collection', |  | ||||||
| 						bind: { |  | ||||||
|               'active-value': 1, |  | ||||||
| 							'inactive-value': 0, |  | ||||||
|               value: 1, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						textarea: true, |  | ||||||
| 						label: '描述', |  | ||||||
| 						prop: 'description', |  | ||||||
| 						bind: { |  | ||||||
| 							placeholder: '请输入备注', |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			], |  | ||||||
| 			// 是否显示弹出 |  | ||||||
| 			open: false, |  | ||||||
| 			// 查询参数 |  | ||||||
| 			queryParams: { |  | ||||||
| 				pageNo: 1, |  | ||||||
| 				pageSize: 20, |  | ||||||
| 				plcTableName: null, |  | ||||||
| 				name: null, |  | ||||||
| 			}, |  | ||||||
| 			// 表单参数 |  | ||||||
| 			form: {}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.getList(); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		/** 覆盖 handleEmitFun 的默认实现 */ |  | ||||||
| 		handleEmitFun({ action, payload }) { |  | ||||||
| 			switch (action) { |  | ||||||
| 				case 'update-collect': |  | ||||||
| 					this.reset(); |  | ||||||
| 					const tempForm = {}; |  | ||||||
| 					Object.keys(this.form).forEach((key) => { |  | ||||||
| 						tempForm[key] = payload[key]; |  | ||||||
| 					}); |  | ||||||
| 					updateEquipmentPlc(tempForm).then((response) => { |  | ||||||
| 						this.$modal.msgSuccess('修改成功'); |  | ||||||
| 						this.open = false; |  | ||||||
| 						this.getList(); |  | ||||||
| 					}); |  | ||||||
| 					break; |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		/** 查询列表 */ |  | ||||||
| 		getList() { |  | ||||||
| 			this.loading = true; |  | ||||||
| 			// 执行查询 |  | ||||||
| 			getEquipmentPlcPage(this.queryParams).then((response) => { |  | ||||||
| 				this.list = response.data.list; |  | ||||||
| 				this.total = response.data.total; |  | ||||||
| 				this.loading = false; |  | ||||||
| 				// this.tableKey = Math.random(); // method 1 |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 取消按钮 */ |  | ||||||
| 		cancel() { |  | ||||||
| 			this.open = false; |  | ||||||
| 			this.reset(); |  | ||||||
| 		}, |  | ||||||
| 		/** 表单重置 */ |  | ||||||
| 		reset() { |  | ||||||
| 			this.form = { |  | ||||||
| 				id: undefined, |  | ||||||
| 				plcTableName: undefined, |  | ||||||
| 				code: undefined, |  | ||||||
| 				name: undefined, |  | ||||||
| 				enName: undefined, |  | ||||||
| 				description: undefined, |  | ||||||
| 				collection: 1, |  | ||||||
| 			}; |  | ||||||
| 			this.resetForm('form'); |  | ||||||
| 		}, |  | ||||||
| 		/** 搜索按钮操作 */ |  | ||||||
| 		handleQuery() { |  | ||||||
| 			this.queryParams.pageNo = 1; |  | ||||||
| 			this.getList(); |  | ||||||
| 		}, |  | ||||||
| 		/** 重置按钮操作 */ |  | ||||||
| 		resetQuery() { |  | ||||||
| 			this.resetForm('queryForm'); |  | ||||||
| 			this.handleQuery(); |  | ||||||
| 		}, |  | ||||||
| 		/** 新增按钮操作 */ |  | ||||||
| 		handleAdd() { |  | ||||||
| 			this.reset(); |  | ||||||
| 			this.open = true; |  | ||||||
| 			this.title = '添加实时数据采集配置'; |  | ||||||
| 		}, |  | ||||||
| 		/** 修改按钮操作 */ |  | ||||||
| 		handleUpdate(row) { |  | ||||||
| 			this.reset(); |  | ||||||
| 			const id = row.id; |  | ||||||
| 			getEquipmentPlc(id).then((response) => { |  | ||||||
| 				this.form = response.data; |  | ||||||
| 				this.open = true; |  | ||||||
| 				this.title = '修改实时数据采集配置'; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 提交按钮 */ |  | ||||||
| 		submitForm() { |  | ||||||
| 			this.$refs['form'].validate((valid) => { |  | ||||||
| 				if (!valid) { |  | ||||||
| 					return; |  | ||||||
| 				} |  | ||||||
| 				// 修改的提交 |  | ||||||
| 				if (this.form.id != null) { |  | ||||||
| 					updateEquipmentPlc(this.form).then((response) => { |  | ||||||
| 						this.$modal.msgSuccess('修改成功'); |  | ||||||
| 						this.open = false; |  | ||||||
| 						this.getList(); |  | ||||||
| 					}); |  | ||||||
| 					return; |  | ||||||
| 				} |  | ||||||
| 				// 添加的提交 |  | ||||||
| 				createEquipmentPlc(this.form).then((response) => { |  | ||||||
| 					this.$modal.msgSuccess('新增成功'); |  | ||||||
| 					this.open = false; |  | ||||||
| 					this.getList(); |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 删除按钮操作 */ |  | ||||||
| 		handleDelete(row) { |  | ||||||
| 			const id = row.id; |  | ||||||
| 			this.$modal |  | ||||||
| 				.confirm('是否确认删除该配置?') |  | ||||||
| 				.then(function () { |  | ||||||
| 					return deleteEquipmentPlc(id); |  | ||||||
| 				}) |  | ||||||
| 				.then(() => { |  | ||||||
| 					this.getList(); |  | ||||||
| 					this.$modal.msgSuccess('删除成功'); |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
| 		/** 导出按钮操作 */ |  | ||||||
| 		handleExport() { |  | ||||||
| 			// 处理查询参数 |  | ||||||
| 			let params = { ...this.queryParams }; |  | ||||||
| 			params.pageNo = undefined; |  | ||||||
| 			params.pageSize = undefined; |  | ||||||
| 			this.$modal |  | ||||||
| 				.confirm('是否确认导出所有实时数据采集配置数据项?') |  | ||||||
| 				.then(() => { |  | ||||||
| 					this.exportLoading = true; |  | ||||||
| 					return exportEquipmentPlcExcel(params); |  | ||||||
| 				}) |  | ||||||
| 				.then((response) => { |  | ||||||
| 					this.$download.excel(response, '实时数据采集配置.xls'); |  | ||||||
| 					this.exportLoading = false; |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,151 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2021-11-18 14:16:25 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-02-25 16:11:14 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<el-form |  | ||||||
| 		:model="dataForm" |  | ||||||
| 		:rules="dataRule" |  | ||||||
| 		ref="dataForm" |  | ||||||
| 		@keyup.enter.native="dataFormSubmit()" |  | ||||||
| 		label-width="100px"> |  | ||||||
| 		<el-form-item label="设备" prop="equipmentId"> |  | ||||||
| 			<el-cascader |  | ||||||
| 				placeholder="请选择设备" |  | ||||||
| 				v-model="dataForm.equipmentId" |  | ||||||
| 				:options="plLineList" |  | ||||||
| 				:props="{value: 'id', label: 'name', children: 'children'}" |  | ||||||
| 				style="width: 100%" |  | ||||||
| 				filterable /> |  | ||||||
| 		</el-form-item> |  | ||||||
| 		<el-form-item label="关联表名" prop="plcId"> |  | ||||||
| 			<el-select |  | ||||||
| 				v-model="dataForm.plcId" |  | ||||||
| 				filterable |  | ||||||
| 				placeholder="请选择关联表" |  | ||||||
| 				style="width: 100%"> |  | ||||||
| 				<el-option |  | ||||||
| 					v-for="dict in plcList" |  | ||||||
| 					:key="dict.id" |  | ||||||
| 					:label="dict.plcTableName" |  | ||||||
| 					:value="dict.id" /> |  | ||||||
| 			</el-select> |  | ||||||
| 		</el-form-item> |  | ||||||
| 	</el-form> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicAdd from './components/basic-add'; |  | ||||||
| import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect'; |  | ||||||
| import { getplcAllList, getTree } from "@/api/base/equipmentConfig"; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicAdd], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				createURL: createEquipmentPlcConnect, |  | ||||||
| 				updateURL: updateEquipmentPlcConnect, |  | ||||||
| 			}, |  | ||||||
| 			dataForm: { |  | ||||||
|         id: undefined, |  | ||||||
|         equipmentId: undefined, |  | ||||||
|         plcId: undefined |  | ||||||
| 			}, |  | ||||||
| 			plcList: [], |  | ||||||
| 			plLineList: [], |  | ||||||
| 			dataRule: { |  | ||||||
|         equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }], |  | ||||||
| 				plcId: [{ required: true, message: "关联表名不能为空", trigger: "blur" }] |  | ||||||
|       }, |  | ||||||
| 			options: [{ |  | ||||||
|           value: 'zhinan', |  | ||||||
|           label: '指南', |  | ||||||
|           children: [{ |  | ||||||
|             value: 'shejiyuanze', |  | ||||||
|             label: '设计原则', |  | ||||||
|             children: [{ |  | ||||||
|               value: 'yizhi', |  | ||||||
|               label: '一致' |  | ||||||
|             }, { |  | ||||||
|               value: 'fankui', |  | ||||||
|               label: '反馈' |  | ||||||
|             }, { |  | ||||||
|               value: 'xiaolv', |  | ||||||
|               label: '效率' |  | ||||||
|             }, { |  | ||||||
|               value: 'kekong', |  | ||||||
|               label: '可控' |  | ||||||
|             }] |  | ||||||
|           }, { |  | ||||||
|             value: 'daohang', |  | ||||||
|             label: '导航' |  | ||||||
|           }] |  | ||||||
|         }] |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.getDict() |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		init() { |  | ||||||
| 			this.$nextTick(() => { |  | ||||||
| 				this.$refs['dataForm'].resetFields() |  | ||||||
| 			}) |  | ||||||
| 		}, |  | ||||||
| 		async getDict() { |  | ||||||
| 			// 关联表名列表 |  | ||||||
| 			const res = await getplcAllList(); |  | ||||||
| 			this.plcList = res.data; |  | ||||||
| 			// 树形结构 |  | ||||||
| 			const res1 = await getTree(); |  | ||||||
| 			this.plLineList = res1.data; |  | ||||||
| 			// const res1 = await getCorePLList(); |  | ||||||
| 			// this.plLineList = res1.data; |  | ||||||
| 			// this.plLineList.forEach(item => { |  | ||||||
| 			// 	listByParentId({ id: item.id }).then(resp => { |  | ||||||
| 			// 		if (resp.data.length > 0) { |  | ||||||
| 			// 			// item.children = resp.data |  | ||||||
| 			// 			this.$set(item, 'children', resp.data) |  | ||||||
| 			// 			// this.$forceUpdate() |  | ||||||
| 			// 		} |  | ||||||
| 			// 	}) |  | ||||||
| 			// }) |  | ||||||
| 		}, |  | ||||||
| 		// 表单提交 |  | ||||||
|     dataFormSubmit() { |  | ||||||
|       this.$refs["dataForm"].validate((valid) => { |  | ||||||
|         if (!valid) { |  | ||||||
|           return false; |  | ||||||
|         } |  | ||||||
|         // 修改的提交 |  | ||||||
|         if (this.dataForm.id) { |  | ||||||
|           updateEquipmentPlcConnect({ |  | ||||||
| 						id: this.dataForm.id, |  | ||||||
| 						equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length], |  | ||||||
| 						plcId: this.dataForm.plcId |  | ||||||
| 					}).then(response => { |  | ||||||
|             this.$modal.msgSuccess("修改成功"); |  | ||||||
|             this.visible = false; |  | ||||||
|             this.$emit("refreshDataList"); |  | ||||||
|           }); |  | ||||||
|           return; |  | ||||||
|         } |  | ||||||
|         // 添加的提交 |  | ||||||
|         createEquipmentPlcConnect({ |  | ||||||
| 						id: this.dataForm.id, |  | ||||||
| 						equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length - 1], |  | ||||||
| 						plcId: this.dataForm.plcId |  | ||||||
| 					}).then(response => { |  | ||||||
|           this.$modal.msgSuccess("新增成功"); |  | ||||||
|           this.visible = false; |  | ||||||
|           this.$emit("refreshDataList"); |  | ||||||
|         }); |  | ||||||
|       }); |  | ||||||
|     } |  | ||||||
| 	} |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,574 +0,0 @@ | |||||||
| <!-- |  | ||||||
|     filename: EquipmentDrawer.vue |  | ||||||
|     author: liubin |  | ||||||
|     date: 2023-08-22 14:38:56 |  | ||||||
|     description: |  | ||||||
| --> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
| 	<el-drawer |  | ||||||
| 		:visible="visible" |  | ||||||
| 		:show-close="false" |  | ||||||
| 		:wrapper-closable="false" |  | ||||||
| 		class="drawer" |  | ||||||
| 		custom-class="mes-drawer" |  | ||||||
| 		size="60%" |  | ||||||
| 		@closed="$emit('destroy')"> |  | ||||||
| 		<SmallTitle slot="title"> |  | ||||||
| 			{{ |  | ||||||
| 				mode.includes('detail') |  | ||||||
| 					? '详情' |  | ||||||
| 					: mode.includes('edit') |  | ||||||
| 					? '编辑' |  | ||||||
| 					: '新增' |  | ||||||
| 			}} |  | ||||||
| 		</SmallTitle> |  | ||||||
|  |  | ||||||
| 		<div class="drawer-body flex"> |  | ||||||
| 			<div class="drawer-body__content"> |  | ||||||
| 				<section v-for="(section, index) in sections" :key="section.key"> |  | ||||||
| 					<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle> |  | ||||||
|  |  | ||||||
| 					<div class="form-part" v-if="section.key == 'base'"> |  | ||||||
| 						<el-skeleton v-if="!showForm" animated /> |  | ||||||
| 						<BaseInfoForm |  | ||||||
| 							key="drawer-dialog-form" |  | ||||||
| 							v-if="showForm" |  | ||||||
| 							ref="form" |  | ||||||
| 							:disabled="mode.includes('detail')" |  | ||||||
| 							v-model="form" |  | ||||||
| 							:rows="formRows" /> |  | ||||||
| 					</div> |  | ||||||
|  |  | ||||||
| 					<div v-if="section.key == 'attrs'" style="margin-top: 12px"> |  | ||||||
| 						<base-table |  | ||||||
| 							v-loading="attrListLoading" |  | ||||||
| 							:table-props="section.props" |  | ||||||
| 							:page="attrQuery?.params.pageNo || 1" |  | ||||||
| 							:limit="attrQuery?.params.pageSize || 10" |  | ||||||
| 							:table-data="list" |  | ||||||
| 							:add-button-show="mode.includes('detail') ? null : '添加属性'" |  | ||||||
| 							@emitButtonClick="handleAddAttr" |  | ||||||
| 							@emitFun="handleEmitFun"> |  | ||||||
| 							<method-btn |  | ||||||
| 								v-if="section.tableBtn" |  | ||||||
| 								slot="handleBtn" |  | ||||||
| 								label="操作" |  | ||||||
| 								:method-list="tableBtn" |  | ||||||
| 								@clickBtn="handleTableBtnClick" /> |  | ||||||
| 						</base-table> |  | ||||||
|  |  | ||||||
| 						<!-- 分页组件 --> |  | ||||||
| 						<pagination |  | ||||||
| 							v-show="total > 0" |  | ||||||
| 							:total="total" |  | ||||||
| 							:page.sync="attrQuery.params.pageNo" |  | ||||||
| 							:limit.sync="attrQuery.params.pageSize" |  | ||||||
| 							@pagination="getAttrList" /> |  | ||||||
| 					</div> |  | ||||||
| 				</section> |  | ||||||
| 			</div> |  | ||||||
|  |  | ||||||
| 			<div class="drawer-body__footer"> |  | ||||||
| 				<el-button style="" @click="handleCancel">取消</el-button> |  | ||||||
| 				<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> |  | ||||||
| 					编辑 |  | ||||||
| 				</el-button> |  | ||||||
| 				<el-button v-else type="primary" @click="handleCancel">确定</el-button> |  | ||||||
| 				<!-- sections的第二项必须是 属性列表  --> |  | ||||||
| 				<!-- <el-button |  | ||||||
| 						v-if="sections[1].allowAdd" |  | ||||||
| 						type="primary" |  | ||||||
| 						@click="handleAddAttr"> |  | ||||||
| 						添加属性 |  | ||||||
| 					</el-button> --> |  | ||||||
| 			</div> |  | ||||||
| 		</div> |  | ||||||
|  |  | ||||||
| 		<!-- 属性对话框 --> |  | ||||||
| 		<base-dialog |  | ||||||
| 			v-if="sections[1].allowAdd" |  | ||||||
| 			:dialogTitle="attrTitle" |  | ||||||
| 			:dialogVisible="attrFormVisible" |  | ||||||
| 			width="45%" |  | ||||||
| 			:append-to-body="true" |  | ||||||
| 			custom-class="baseDialog" |  | ||||||
| 			@close="closeAttrForm" |  | ||||||
| 			@cancel="closeAttrForm" |  | ||||||
| 			@confirm="submitAttrForm"> |  | ||||||
| 			<DialogForm |  | ||||||
| 				v-if="attrFormVisible" |  | ||||||
| 				ref="attrForm" |  | ||||||
| 				:disabled="mode.includes('detail')" |  | ||||||
| 				v-model="attrForm" |  | ||||||
| 				:rows="attrRows" /> |  | ||||||
| 		</base-dialog> |  | ||||||
| 	</el-drawer> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import BaseInfoForm from '@/components/DialogForm'; |  | ||||||
|  |  | ||||||
| const SmallTitle = { |  | ||||||
| 	name: 'SmallTitle', |  | ||||||
| 	props: ['size'], |  | ||||||
| 	data() { |  | ||||||
| 		return {}; |  | ||||||
| 	}, |  | ||||||
| 	methods: {}, |  | ||||||
| 	render: function (h) { |  | ||||||
| 		return h( |  | ||||||
| 			'span', |  | ||||||
| 			{ |  | ||||||
| 				class: 'small-title', |  | ||||||
| 				style: { |  | ||||||
| 					fontSize: '18px', |  | ||||||
| 					lineHeight: |  | ||||||
| 						this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px', |  | ||||||
| 					fontWeight: 500, |  | ||||||
| 					fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif', |  | ||||||
| 				}, |  | ||||||
| 			}, |  | ||||||
| 			this.$slots.default |  | ||||||
| 		); |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, |  | ||||||
| 	props: ['sections', 'defaultMode', 'infoData'], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			mode: '', |  | ||||||
| 			visible: false, |  | ||||||
| 			showForm: false, |  | ||||||
| 			total: 0, |  | ||||||
| 			form: {}, |  | ||||||
| 			list: [], |  | ||||||
| 			attrTitle: '', |  | ||||||
| 			attrForm: { |  | ||||||
| 				id: null, |  | ||||||
| 				name: '', |  | ||||||
| 				plcParamName: '', |  | ||||||
| 				unit: '', |  | ||||||
| 				collection: 1, |  | ||||||
| 				minValue: '', |  | ||||||
| 				maxValue: '', |  | ||||||
| 				defaultValue: '', |  | ||||||
| 				description: '', |  | ||||||
| 				remark: '', |  | ||||||
| 				alarmContent: '', |  | ||||||
| 				equipmentParamType: '', |  | ||||||
| 				productionParamType: '', |  | ||||||
| 			}, |  | ||||||
| 			attrFormVisible: false, |  | ||||||
| 			attrRows: [ |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '参数列名', |  | ||||||
| 						prop: 'plcParamName', |  | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '参数名称', |  | ||||||
| 						prop: 'name', |  | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '单位', |  | ||||||
| 						prop: 'unit', |  | ||||||
| 						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT), |  | ||||||
| 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						switch: true, |  | ||||||
| 						label: '是否采集', |  | ||||||
| 						prop: 'collection', |  | ||||||
| 						bind: { |  | ||||||
| 							'active-value': 1, |  | ||||||
| 							'inactive-value': 0, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '设备参数类型', |  | ||||||
| 						prop: 'equipmentParamType', |  | ||||||
| 						options: [ |  | ||||||
| 							{ label: '一般参数', value: 1 }, |  | ||||||
| 							{ label: '工艺参数', value: 2 }, |  | ||||||
| 							{ label: '报警参数', value: 3 }, |  | ||||||
| 						], |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								required: true, |  | ||||||
| 								message: '设备参数类型不能为空', |  | ||||||
| 								trigger: 'blur', |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '生产参数类型', |  | ||||||
| 						prop: 'productionParamType', |  | ||||||
| 						options: [ |  | ||||||
| 							// { label: '进片数量', value: 1 }, |  | ||||||
| 							// { label: '出片数量', value: 2 }, |  | ||||||
| 							// { label: '破损数量', value: 3 }, |  | ||||||
| 							// { label: '无类型', value: 4 }, |  | ||||||
| 							{ label: '进口计数', value: 1 }, |  | ||||||
| 							{ label: '出口计数', value: 2 }, |  | ||||||
| 							{ label: '损耗计数', value: 3 }, |  | ||||||
| 							{ label: '无类型', value: 4 }, |  | ||||||
| 						], |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								required: true, |  | ||||||
| 								message: '生产参数类型不能为空', |  | ||||||
| 								trigger: 'blur', |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '最小值', |  | ||||||
| 						prop: 'minValue', |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								type: 'number', |  | ||||||
| 								message: '请输入正确的数字', |  | ||||||
| 								trigger: 'change', |  | ||||||
| 								transform: (val) => Number(val), |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '最大值', |  | ||||||
| 						prop: 'maxValue', |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								required: false, |  | ||||||
| 							}, |  | ||||||
| 							{ |  | ||||||
| 								type: 'number', |  | ||||||
| 								message: '请输入正确的数字', |  | ||||||
| 								trigger: 'change', |  | ||||||
| 								transform: (val) => Number(val), |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '标准值', |  | ||||||
| 						prop: 'defaultValue', |  | ||||||
| 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '描述', |  | ||||||
| 						prop: 'description', |  | ||||||
| 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '备注', |  | ||||||
| 						prop: 'remark', |  | ||||||
| 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			], |  | ||||||
| 			attrQuery: { |  | ||||||
| 				params: { |  | ||||||
| 					pageNo: 1, |  | ||||||
| 					pageSize: 10, |  | ||||||
| 				}, |  | ||||||
| 			}, // 属性列表的请求 |  | ||||||
| 			infoQuery: null, // 基本信息的请求 |  | ||||||
| 			attrFormSubmitting: false, |  | ||||||
| 			attrListLoading: false, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	computed: { |  | ||||||
| 		formRows() { |  | ||||||
| 			return this.sections[0].rows.map((row) => { |  | ||||||
| 				return row.map((col) => { |  | ||||||
| 					return { |  | ||||||
| 						...col, |  | ||||||
| 						bind: { |  | ||||||
| 							// 详情 模式下,禁用各种输入 |  | ||||||
| 							// disabled: this.mode == 'detail', |  | ||||||
| 							disabled: true, |  | ||||||
| 						}, |  | ||||||
| 					}; |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		tableBtn() { |  | ||||||
| 			return this.mode == 'detail' ? [] : this.sections[1].tableBtn; |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	mounted() { |  | ||||||
| 		this.mode = this.defaultMode || 'detail'; |  | ||||||
| 		for (const section of this.sections) { |  | ||||||
| 			// 请求具体信息 |  | ||||||
| 			if ('url' in section) { |  | ||||||
| 				const query = { |  | ||||||
| 					url: section.url, |  | ||||||
| 					method: section.method || 'get', |  | ||||||
| 					params: section.queryParams || null, |  | ||||||
| 					data: section.data || null, |  | ||||||
| 				}; |  | ||||||
| 				// debugger; |  | ||||||
| 				this.$axios(query).then(({ data }) => { |  | ||||||
| 					if (section.key == 'base') { |  | ||||||
| 						this.form = data; |  | ||||||
| 						this.showForm = true; |  | ||||||
| 						this.infoQuery = query; |  | ||||||
| 					} else if (section.key == 'attrs') { |  | ||||||
| 						this.attrQuery = query; |  | ||||||
| 						this.list = data.list; |  | ||||||
| 						this.total = data.total; |  | ||||||
| 					} |  | ||||||
| 				}); |  | ||||||
| 			} else if (section.key == 'base') { |  | ||||||
| 				this.form = this.infoData; |  | ||||||
| 				this.showForm = true; |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		handleTableBtnClick({ type, data }) { |  | ||||||
| 			switch (type) { |  | ||||||
| 				case 'edit': |  | ||||||
| 					this.handleEditAttr(data.id); |  | ||||||
| 					break; |  | ||||||
| 				case 'delete': |  | ||||||
| 					this.handleDeleteAttr(data.id); |  | ||||||
| 					break; |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		handleEmitFun(val) { |  | ||||||
| 			console.log('handleEmitFun', val); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		init() { |  | ||||||
| 			this.visible = true; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		async getAttrList() { |  | ||||||
| 			this.attrListLoading = true; |  | ||||||
| 			const res = await this.$axios(this.attrQuery); |  | ||||||
| 			if (res.code == 0) { |  | ||||||
| 				this.list = res.data.list; |  | ||||||
| 				this.total = res.data.total; |  | ||||||
| 			} |  | ||||||
| 			this.attrListLoading = false; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 保存表单 |  | ||||||
| 		handleSave() { |  | ||||||
| 			this.$refs['form'][0].validate(async (valid) => { |  | ||||||
| 				if (valid) { |  | ||||||
| 					const isEdit = this.mode == 'edit'; |  | ||||||
| 					await this.$axios({ |  | ||||||
| 						url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], |  | ||||||
| 						method: isEdit ? 'put' : 'post', |  | ||||||
| 						data: this.form, |  | ||||||
| 					}); |  | ||||||
| 					this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`); |  | ||||||
| 					this.visible = false; |  | ||||||
| 					this.$emit('refreshDataList'); |  | ||||||
| 				} |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		handleCancel() { |  | ||||||
| 			this.visible = false; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 开启编辑 |  | ||||||
| 		toggleEdit() { |  | ||||||
| 			this.mode = 'edit'; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 新增属性 |  | ||||||
| 		handleAddAttr() { |  | ||||||
| 			this.attrForm = { |  | ||||||
| 				id: null, |  | ||||||
| 				name: '', |  | ||||||
| 				plcParamName: '', |  | ||||||
| 				unit: '', |  | ||||||
| 				collection: 1, |  | ||||||
| 				minValue: '', |  | ||||||
| 				maxValue: '', |  | ||||||
| 				defaultValue: '', |  | ||||||
| 				description: '', |  | ||||||
| 				remark: '', |  | ||||||
| 				alarmContent: '', |  | ||||||
| 			}; |  | ||||||
| 			this.attrTitle = '添加设备绑定信息'; |  | ||||||
| 			this.attrFormVisible = true; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 编辑属性 |  | ||||||
| 		async handleEditAttr(attrId) { |  | ||||||
| 			const res = await this.$axios({ |  | ||||||
| 				url: this.sections[1].urlDetail, |  | ||||||
| 				method: 'get', |  | ||||||
| 				params: { id: attrId }, |  | ||||||
| 			}); |  | ||||||
| 			if (res.code == 0) { |  | ||||||
| 				this.attrForm = res.data; |  | ||||||
| 				this.attrTitle = '编辑设备绑定信息'; |  | ||||||
| 				this.attrFormVisible = true; |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 删除属性 |  | ||||||
| 		handleDeleteAttr(attrId) { |  | ||||||
| 			this.$confirm('确定删除该分组报警?', '提示', { |  | ||||||
| 				confirmButtonText: '确定', |  | ||||||
| 				cancelButtonText: '取消', |  | ||||||
| 				type: 'warning', |  | ||||||
| 			}) |  | ||||||
| 				.then(async () => { |  | ||||||
| 					const res = await this.$axios({ |  | ||||||
| 						url: this.sections[1].urlDelete, |  | ||||||
| 						method: 'delete', |  | ||||||
| 						params: { id: attrId }, |  | ||||||
| 					}); |  | ||||||
| 					if (res.code == 0) { |  | ||||||
| 						this.$message({ |  | ||||||
| 							message: '删除成功', |  | ||||||
| 							type: 'success', |  | ||||||
| 							duration: 1500, |  | ||||||
| 							onClose: () => { |  | ||||||
| 								this.getAttrList(); |  | ||||||
| 							}, |  | ||||||
| 						}); |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 提交属性表 |  | ||||||
| 		async submitAttrForm() { |  | ||||||
| 			this.$refs['attrForm'].validate((valid) => { |  | ||||||
| 				if (!valid) { |  | ||||||
|           return false; |  | ||||||
| 				} |  | ||||||
| 			}); |  | ||||||
| 			const isEdit = this.attrForm.id != null; |  | ||||||
| 			this.attrFormSubmitting = true; |  | ||||||
| 			const res = await this.$axios({ |  | ||||||
| 				url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, |  | ||||||
| 				method: isEdit ? 'put' : 'post', |  | ||||||
| 				data: { |  | ||||||
| 					...this.attrForm, |  | ||||||
| 					connectId: this.infoData.id |  | ||||||
| 				}, |  | ||||||
| 			}); |  | ||||||
|  |  | ||||||
| 			if (res.code == 0) { |  | ||||||
| 				this.closeAttrForm(); |  | ||||||
| 				this.$message({ |  | ||||||
| 					message: `${isEdit ? '更新' : '创建'}成功`, |  | ||||||
| 					type: 'success', |  | ||||||
| 					duration: 1500, |  | ||||||
| 					onClose: () => { |  | ||||||
| 						this.getAttrList(); |  | ||||||
| 					}, |  | ||||||
| 				}); |  | ||||||
| 			} |  | ||||||
| 			this.attrFormSubmitting = false; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		closeAttrForm() { |  | ||||||
| 			this.attrFormVisible = false; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		handleClick(raw) { |  | ||||||
| 			if (raw.type === 'delete') { |  | ||||||
| 				this.$confirm(`确定删除该报警?`, '提示', { |  | ||||||
| 					confirmButtonText: '确定', |  | ||||||
| 					cancelButtonText: '取消', |  | ||||||
| 					type: 'warning', |  | ||||||
| 				}) |  | ||||||
| 					.then(() => { |  | ||||||
| 						deleteProductAttr(raw.data.id).then(({ data }) => { |  | ||||||
| 							this.$message({ |  | ||||||
| 								message: '操作成功', |  | ||||||
| 								type: 'success', |  | ||||||
| 								duration: 1500, |  | ||||||
| 								onClose: () => { |  | ||||||
| 									this.getList(); |  | ||||||
| 								}, |  | ||||||
| 							}); |  | ||||||
| 						}); |  | ||||||
| 					}) |  | ||||||
| 					.catch(() => {}); |  | ||||||
| 			} else { |  | ||||||
| 				this.addNew(raw.data.id); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <style scoped> |  | ||||||
| .drawer >>> .el-drawer { |  | ||||||
| 	border-radius: 8px 0 0 8px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .drawer >>> .el-drawer__header { |  | ||||||
| 	margin: 0; |  | ||||||
| 	padding: 32px 32px 24px; |  | ||||||
| 	border-bottom: 1px solid #dcdfe6; |  | ||||||
| 	margin-bottom: 0px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .small-title::before { |  | ||||||
| 	content: ''; |  | ||||||
| 	display: inline-block; |  | ||||||
| 	vertical-align: top; |  | ||||||
| 	width: 4px; |  | ||||||
| 	height: 22px; |  | ||||||
| 	border-radius: 1px; |  | ||||||
| 	margin-right: 8px; |  | ||||||
| 	background-color: #0b58ff; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .drawer-body { |  | ||||||
| 	display: flex; |  | ||||||
| 	flex-direction: column; |  | ||||||
| 	height: 100%; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .drawer-body__content { |  | ||||||
| 	flex: 1; |  | ||||||
| 	/* background: #eee; */ |  | ||||||
| 	padding: 20px 30px; |  | ||||||
| 	overflow-y: auto; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .drawer-body__footer { |  | ||||||
| 	display: flex; |  | ||||||
| 	justify-content: flex-end; |  | ||||||
| 	padding: 18px; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -12,7 +12,7 @@ | |||||||
| 		:wrapper-closable="false" | 		:wrapper-closable="false" | ||||||
| 		class="drawer" | 		class="drawer" | ||||||
| 		custom-class="mes-drawer" | 		custom-class="mes-drawer" | ||||||
| 		:size="size || '50%'" | 		size="60%" | ||||||
| 		@closed="$emit('destroy')"> | 		@closed="$emit('destroy')"> | ||||||
| 		<SmallTitle slot="title"> | 		<SmallTitle slot="title"> | ||||||
| 			{{ | 			{{ | ||||||
| @@ -29,107 +29,29 @@ | |||||||
| 				<section v-for="(section, index) in sections" :key="section.key"> | 				<section v-for="(section, index) in sections" :key="section.key"> | ||||||
| 					<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle> | 					<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle> | ||||||
|  |  | ||||||
| 					<div | 					<div class="form-part" v-if="section.key == 'base'"> | ||||||
| 						class="form-part" |  | ||||||
| 						v-if="section.key == 'base'" |  | ||||||
| 						style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px"> |  | ||||||
| 						<el-skeleton v-if="!showForm" animated /> | 						<el-skeleton v-if="!showForm" animated /> | ||||||
| 						<!-- <BaseInfoForm | 						<BaseInfoForm | ||||||
| 							key="drawer-dialog-form" | 							key="drawer-dialog-form" | ||||||
| 							v-if="showForm" | 							v-if="showForm" | ||||||
| 							ref="form" | 							ref="form" | ||||||
| 							:disabled="mode.includes('detail')" | 							:disabled="mode.includes('detail')" | ||||||
| 							v-model="form" | 							:dataForm="form" | ||||||
| 							:rows="formRows" /> --> | 							:rows="formRows" /> | ||||||
|  |  | ||||||
| 						<!-- if  --> |  | ||||||
| 						<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> |  | ||||||
| 							<el-col :span="8"> |  | ||||||
| 								<div |  | ||||||
| 									class="title" |  | ||||||
| 									style="font-weight: 700; font-size: 16px; margin: 8px 0"> |  | ||||||
| 									设备名 |  | ||||||
| 								</div> |  | ||||||
| 								<div class="value" style="font-size: 14px"> |  | ||||||
| 									{{ form.equipmentName }} |  | ||||||
| 								</div> |  | ||||||
| 							</el-col> |  | ||||||
| 							<el-col :span="8"> |  | ||||||
| 								<div |  | ||||||
| 									class="title" |  | ||||||
| 									style="font-weight: 700; font-size: 16px; margin: 8px 0"> |  | ||||||
| 									关联表名 |  | ||||||
| 								</div> |  | ||||||
| 								<div class="value" style="font-size: 14px"> |  | ||||||
| 									{{ form.plcName }} |  | ||||||
| 								</div> |  | ||||||
| 							</el-col> |  | ||||||
| 						</el-row> |  | ||||||
| 						<!-- else  --> |  | ||||||
| 						<el-row v-else style="margin-bottom: 24px" :gutter="20"> |  | ||||||
| 							<el-form ref="form" :model="form"> |  | ||||||
| 								<el-col :span="8"> |  | ||||||
| 									<el-form-item |  | ||||||
| 										class="title" |  | ||||||
| 										label="设备名" |  | ||||||
| 										style="font-size: 16px; margin: 8px 0"> |  | ||||||
| 										<el-select |  | ||||||
| 											v-model="form.equipmentId" |  | ||||||
| 											filterable |  | ||||||
| 											clearable |  | ||||||
| 											placeholder="请选择设备"> |  | ||||||
| 											<el-option |  | ||||||
| 												v-for="eq in eqList" |  | ||||||
| 												:key="eq.id" |  | ||||||
| 												:label="eq.name" |  | ||||||
| 												:value="eq.id"></el-option> |  | ||||||
| 										</el-select> |  | ||||||
| 									</el-form-item> |  | ||||||
| 								</el-col> |  | ||||||
| 								<el-col :span="8"> |  | ||||||
| 									<el-form-item |  | ||||||
| 										class="title" |  | ||||||
| 										label="设备关联表名" |  | ||||||
| 										style="font-size: 16px; margin: 8px 0"> |  | ||||||
| 										<el-select |  | ||||||
| 											v-model="form.plcId" |  | ||||||
| 											filterable |  | ||||||
| 											clearable |  | ||||||
| 											placeholder="请选择关联表"> |  | ||||||
| 											<el-option |  | ||||||
| 												v-for="plc in plcList" |  | ||||||
| 												:key="plc.id" |  | ||||||
| 												:label="plc.plcTableName" |  | ||||||
| 												:value="plc.id"></el-option> |  | ||||||
| 										</el-select> |  | ||||||
| 									</el-form-item> |  | ||||||
| 								</el-col> |  | ||||||
| 							</el-form> |  | ||||||
| 						</el-row> |  | ||||||
| 					</div> | 					</div> | ||||||
|  |  | ||||||
| 					<div | 					<div v-if="section.key == 'attrs'" style="margin-top: 12px"> | ||||||
| 						v-if="section.key == 'attrs'" |  | ||||||
| 						style="position: relative; margin-top: 12px"> |  | ||||||
| 						<div |  | ||||||
| 							v-if="!mode.includes('detail')" |  | ||||||
| 							style="position: absolute; top: -40px; right: 0"> |  | ||||||
| 							<el-button @click="handleAddAttr" type="text"> |  | ||||||
| 								<i class="el-icon-plus"></i> |  | ||||||
| 								添加参数 |  | ||||||
| 							</el-button> |  | ||||||
| 						</div> |  | ||||||
| 						<base-table | 						<base-table | ||||||
| 							v-loading="attrListLoading" | 							v-loading="attrListLoading" | ||||||
| 							:table-props="section.props" | 							:table-props="section.props" | ||||||
| 							:page="attrQuery?.params.pageNo || 1" | 							:page="attrQuery?.params.pageNo || 1" | ||||||
| 							:limit="attrQuery?.params.pageSize || 10" | 							:limit="attrQuery?.params.pageSize || 10" | ||||||
| 							:table-data="list" | 							:table-data="list" | ||||||
|  | 							:add-button-show="mode.includes('detail') ? null : '添加属性'" | ||||||
|  | 							@emitButtonClick="handleAddAttr" | ||||||
| 							@emitFun="handleEmitFun"> | 							@emitFun="handleEmitFun"> | ||||||
| 							<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" |  | ||||||
| 							@emitButtonClick="handleAddAttr" --> |  | ||||||
| 							<method-btn | 							<method-btn | ||||||
| 								v-if="section.tableBtn && !mode.includes('detail')" | 								v-if="section.tableBtn" | ||||||
| 								slot="handleBtn" | 								slot="handleBtn" | ||||||
| 								label="操作" | 								label="操作" | ||||||
| 								:method-list="tableBtn" | 								:method-list="tableBtn" | ||||||
| @@ -149,12 +71,17 @@ | |||||||
|  |  | ||||||
| 			<div class="drawer-body__footer"> | 			<div class="drawer-body__footer"> | ||||||
| 				<el-button style="" @click="handleCancel">取消</el-button> | 				<el-button style="" @click="handleCancel">取消</el-button> | ||||||
| 				<el-button | 				<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> | ||||||
| 					type="primary" | 					编辑 | ||||||
| 					v-if="!mode.includes('detail')" |  | ||||||
| 					@click="handleSave"> |  | ||||||
| 					保存 |  | ||||||
| 				</el-button> | 				</el-button> | ||||||
|  | 				<el-button v-else type="primary" @click="handleCancel">确定</el-button> | ||||||
|  | 				<!-- sections的第二项必须是 属性列表  --> | ||||||
|  | 				<!-- <el-button | ||||||
|  | 						v-if="sections[1].allowAdd" | ||||||
|  | 						type="primary" | ||||||
|  | 						@click="handleAddAttr"> | ||||||
|  | 						添加属性 | ||||||
|  | 					</el-button> --> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|  |  | ||||||
| @@ -169,10 +96,10 @@ | |||||||
| 			@close="closeAttrForm" | 			@close="closeAttrForm" | ||||||
| 			@cancel="closeAttrForm" | 			@cancel="closeAttrForm" | ||||||
| 			@confirm="submitAttrForm"> | 			@confirm="submitAttrForm"> | ||||||
| 			<!-- :disabled="mode.includes('detail')" --> |  | ||||||
| 			<DialogForm | 			<DialogForm | ||||||
| 				v-if="attrFormVisible" | 				v-if="attrFormVisible" | ||||||
| 				ref="attrForm" | 				ref="attrForm" | ||||||
|  | 				:disabled="mode.includes('detail')" | ||||||
| 				v-model="attrForm" | 				v-model="attrForm" | ||||||
| 				:rows="attrRows" /> | 				:rows="attrRows" /> | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
| @@ -209,7 +136,7 @@ const SmallTitle = { | |||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, | 	components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, | ||||||
| 	props: ['sections', 'defaultMode', 'infoData', 'size'], | 	props: ['sections', 'defaultMode', 'infoData'], | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			mode: '', | 			mode: '', | ||||||
| @@ -218,8 +145,6 @@ export default { | |||||||
| 			total: 0, | 			total: 0, | ||||||
| 			form: {}, | 			form: {}, | ||||||
| 			list: [], | 			list: [], | ||||||
| 			eqList: [], |  | ||||||
| 			plcList: [], |  | ||||||
| 			attrTitle: '', | 			attrTitle: '', | ||||||
| 			attrForm: { | 			attrForm: { | ||||||
| 				id: null, | 				id: null, | ||||||
| @@ -241,17 +166,13 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '参数列名', | 						label: '参数列名', | ||||||
| 						prop: 'plcParamName', | 						prop: 'plcParamName', | ||||||
| 						rules: [ | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 							{ required: true, message: '参数列名不能为空', trigger: 'blur' }, |  | ||||||
| 						], |  | ||||||
| 					}, | 					}, | ||||||
| 					{ | 					{ | ||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '参数名称', | 						label: '参数名称', | ||||||
| 						prop: 'name', | 						prop: 'name', | ||||||
| 						rules: [ | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 							{ required: true, message: '参数名称不能为空', trigger: 'blur' }, |  | ||||||
| 						], |  | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 				[ | 				[ | ||||||
| @@ -260,6 +181,7 @@ export default { | |||||||
| 						label: '单位', | 						label: '单位', | ||||||
| 						prop: 'unit', | 						prop: 'unit', | ||||||
| 						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT), | 						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT), | ||||||
|  | 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| 					{ | 					{ | ||||||
| 						switch: true, | 						switch: true, | ||||||
| @@ -271,47 +193,6 @@ export default { | |||||||
| 						}, | 						}, | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '设备参数类型', |  | ||||||
| 						prop: 'equipmentParamType', |  | ||||||
| 						options: [ |  | ||||||
| 							{ label: '一般参数', value: 1 }, |  | ||||||
| 							{ label: '工艺参数', value: 2 }, |  | ||||||
| 							{ label: '报警参数', value: 3 }, |  | ||||||
| 						], |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								required: true, |  | ||||||
| 								message: '设备参数类型不能为空', |  | ||||||
| 								trigger: 'blur', |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '生产参数类型', |  | ||||||
| 						prop: 'productionParamType', |  | ||||||
| 						options: [ |  | ||||||
| 							// { label: '进片数量', value: 1 }, |  | ||||||
| 							// { label: '出片数量', value: 2 }, |  | ||||||
| 							// { label: '破损数量', value: 3 }, |  | ||||||
| 							// { label: '无类型', value: 4 }, |  | ||||||
| 							{ label: '进口计数', value: 1 }, |  | ||||||
| 							{ label: '出口计数', value: 2 }, |  | ||||||
| 							{ label: '损耗计数', value: 3 }, |  | ||||||
| 							{ label: '无类型', value: 4 }, |  | ||||||
| 						], |  | ||||||
| 						rules: [ |  | ||||||
| 							{ |  | ||||||
| 								required: true, |  | ||||||
| 								message: '生产参数类型不能为空', |  | ||||||
| 								trigger: 'blur', |  | ||||||
| 							}, |  | ||||||
| 						], |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ | 				[ | ||||||
| 					{ | 					{ | ||||||
| 						input: true, | 						input: true, | ||||||
| @@ -341,6 +222,7 @@ export default { | |||||||
| 								transform: (val) => Number(val), | 								transform: (val) => Number(val), | ||||||
| 							}, | 							}, | ||||||
| 						], | 						], | ||||||
|  | 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 				[ | 				[ | ||||||
| @@ -348,11 +230,13 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '标准值', | 						label: '标准值', | ||||||
| 						prop: 'defaultValue', | 						prop: 'defaultValue', | ||||||
|  | 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| 					{ | 					{ | ||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '描述', | 						label: '描述', | ||||||
| 						prop: 'description', | 						prop: 'description', | ||||||
|  | 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 				[ | 				[ | ||||||
| @@ -360,6 +244,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '备注', | 						label: '备注', | ||||||
| 						prop: 'remark', | 						prop: 'remark', | ||||||
|  | 						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 			], | 			], | ||||||
| @@ -372,7 +257,6 @@ export default { | |||||||
| 			infoQuery: null, // 基本信息的请求 | 			infoQuery: null, // 基本信息的请求 | ||||||
| 			attrFormSubmitting: false, | 			attrFormSubmitting: false, | ||||||
| 			attrListLoading: false, | 			attrListLoading: false, | ||||||
| 			shouldRefreshPageView: false, |  | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	computed: { | 	computed: { | ||||||
| @@ -391,24 +275,11 @@ export default { | |||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		tableBtn() { | 		tableBtn() { | ||||||
| 			return this.sections[1].tableBtn; | 			return this.mode == 'detail' ? [] : this.sections[1].tableBtn; | ||||||
| 			// return this.mode == 'detail' ? [] : this.sections[1].tableBtn; |  | ||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.shouldRefreshPageView = false; |  | ||||||
| 		this.mode = this.defaultMode || 'detail'; | 		this.mode = this.defaultMode || 'detail'; | ||||||
|  |  | ||||||
| 		if (this.mode != 'detail') { |  | ||||||
| 			this.$axios('/base/equipment/listAll').then(({ code, data }) => { |  | ||||||
| 				this.eqList = data; |  | ||||||
| 			}); |  | ||||||
| 			this.$axios({ |  | ||||||
| 				url: '/base/equipment-plc/listAll', |  | ||||||
| 			}).then(({ code, data }) => { |  | ||||||
| 				this.plcList = data; |  | ||||||
| 			}); |  | ||||||
| 		} |  | ||||||
| 		for (const section of this.sections) { | 		for (const section of this.sections) { | ||||||
| 			// 请求具体信息 | 			// 请求具体信息 | ||||||
| 			if ('url' in section) { | 			if ('url' in section) { | ||||||
| @@ -470,7 +341,7 @@ export default { | |||||||
| 		handleSave() { | 		handleSave() { | ||||||
| 			this.$refs['form'][0].validate(async (valid) => { | 			this.$refs['form'][0].validate(async (valid) => { | ||||||
| 				if (valid) { | 				if (valid) { | ||||||
| 					const isEdit = !this.mode.includes('detail'); | 					const isEdit = this.mode == 'edit'; | ||||||
| 					await this.$axios({ | 					await this.$axios({ | ||||||
| 						url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], | 						url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], | ||||||
| 						method: isEdit ? 'put' : 'post', | 						method: isEdit ? 'put' : 'post', | ||||||
| @@ -484,9 +355,6 @@ export default { | |||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		handleCancel() { | 		handleCancel() { | ||||||
| 			if (this.shouldRefreshPageView) { |  | ||||||
| 				this.$emit('refreshDataList'); |  | ||||||
| 			} |  | ||||||
| 			this.visible = false; | 			this.visible = false; | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| @@ -508,11 +376,9 @@ export default { | |||||||
| 				defaultValue: '', | 				defaultValue: '', | ||||||
| 				description: '', | 				description: '', | ||||||
| 				remark: '', | 				remark: '', | ||||||
| 				equipmentParamType: '', |  | ||||||
| 				productionParamType: '', |  | ||||||
| 				alarmContent: '', | 				alarmContent: '', | ||||||
| 			}; | 			}; | ||||||
| 			this.attrTitle = '添加参数绑定信息'; | 			this.attrTitle = '添加设备绑定信息'; | ||||||
| 			this.attrFormVisible = true; | 			this.attrFormVisible = true; | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| @@ -525,14 +391,14 @@ export default { | |||||||
| 			}); | 			}); | ||||||
| 			if (res.code == 0) { | 			if (res.code == 0) { | ||||||
| 				this.attrForm = res.data; | 				this.attrForm = res.data; | ||||||
| 				this.attrTitle = '编辑参数绑定信息'; | 				this.attrTitle = '编辑设备绑定信息'; | ||||||
| 				this.attrFormVisible = true; | 				this.attrFormVisible = true; | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		// 删除属性 | 		// 删除属性 | ||||||
| 		handleDeleteAttr(attrId) { | 		handleDeleteAttr(attrId) { | ||||||
| 			this.$confirm('确定删除该参数?', '提示', { | 			this.$confirm('确定删除该分组报警?', '提示', { | ||||||
| 				confirmButtonText: '确定', | 				confirmButtonText: '确定', | ||||||
| 				cancelButtonText: '取消', | 				cancelButtonText: '取消', | ||||||
| 				type: 'warning', | 				type: 'warning', | ||||||
| @@ -544,7 +410,6 @@ export default { | |||||||
| 						params: { id: attrId }, | 						params: { id: attrId }, | ||||||
| 					}); | 					}); | ||||||
| 					if (res.code == 0) { | 					if (res.code == 0) { | ||||||
| 						this.shouldRefreshPageView = true; |  | ||||||
| 						this.$message({ | 						this.$message({ | ||||||
| 							message: '删除成功', | 							message: '删除成功', | ||||||
| 							type: 'success', | 							type: 'success', | ||||||
| @@ -559,12 +424,12 @@ export default { | |||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		// 提交属性表 | 		// 提交属性表 | ||||||
| 		submitAttrForm() { | 		async submitAttrForm() { | ||||||
| 			this.$refs['attrForm'].validate(async (valid) => { | 			this.$refs['attrForm'].validate((valid) => { | ||||||
| 				if (!valid) { | 				if (!valid) { | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
|  | 			}); | ||||||
| 			const isEdit = this.attrForm.id != null; | 			const isEdit = this.attrForm.id != null; | ||||||
| 			this.attrFormSubmitting = true; | 			this.attrFormSubmitting = true; | ||||||
| 			const res = await this.$axios({ | 			const res = await this.$axios({ | ||||||
| @@ -572,7 +437,7 @@ export default { | |||||||
| 				method: isEdit ? 'put' : 'post', | 				method: isEdit ? 'put' : 'post', | ||||||
| 				data: { | 				data: { | ||||||
| 					...this.attrForm, | 					...this.attrForm, | ||||||
| 						connectId: this.infoData.id, | 					connectId: this.infoData.id | ||||||
| 				}, | 				}, | ||||||
| 			}); | 			}); | ||||||
|  |  | ||||||
| @@ -584,12 +449,10 @@ export default { | |||||||
| 					duration: 1500, | 					duration: 1500, | ||||||
| 					onClose: () => { | 					onClose: () => { | ||||||
| 						this.getAttrList(); | 						this.getAttrList(); | ||||||
| 							this.shouldRefreshPageView = true; |  | ||||||
| 					}, | 					}, | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 			this.attrFormSubmitting = false; | 			this.attrFormSubmitting = false; | ||||||
| 			}); |  | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		closeAttrForm() { | 		closeAttrForm() { | ||||||
| @@ -598,7 +461,7 @@ export default { | |||||||
|  |  | ||||||
| 		handleClick(raw) { | 		handleClick(raw) { | ||||||
| 			if (raw.type === 'delete') { | 			if (raw.type === 'delete') { | ||||||
| 				this.$confirm(`确定删除该参数?`, '提示', { | 				this.$confirm(`确定删除该报警?`, '提示', { | ||||||
| 					confirmButtonText: '确定', | 					confirmButtonText: '确定', | ||||||
| 					cancelButtonText: '取消', | 					cancelButtonText: '取消', | ||||||
| 					type: 'warning', | 					type: 'warning', | ||||||
|   | |||||||
| @@ -1,100 +0,0 @@ | |||||||
| /* |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2022-08-24 11:19:43 |  | ||||||
|  * @LastEditors: zhp |  | ||||||
|  * @LastEditTime: 2023-12-13 15:52:53 |  | ||||||
|  * @Description: |  | ||||||
|  */ |  | ||||||
| export default { |  | ||||||
|   data() { |  | ||||||
|     /* eslint-disable */ |  | ||||||
|     return { |  | ||||||
|       urlOptions: { |  | ||||||
|         createURL: '', |  | ||||||
|         updateURL: '', |  | ||||||
|         infoURL: '', |  | ||||||
|         codeURL: '', |  | ||||||
|         getOption: false, |  | ||||||
|         isGetCode: false, |  | ||||||
|         optionArrUrl: [], |  | ||||||
|         optionArr: {} |  | ||||||
|       }, |  | ||||||
|       visible: false, |  | ||||||
|       setData: false |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   created() { |  | ||||||
|   }, |  | ||||||
|   activated() { |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     init(id) { |  | ||||||
|       this.dataForm.id = id || ""; |  | ||||||
|       this.visible = true; |  | ||||||
|       if (this.urlOptions.getOption) { |  | ||||||
|         this.getArr() |  | ||||||
|       } |  | ||||||
|       this.$nextTick(() => { |  | ||||||
|         this.$refs["dataForm"].resetFields(); |  | ||||||
|         if (this.dataForm.id) { |  | ||||||
|           this.urlOptions.infoURL(id).then(response => { |  | ||||||
|             this.dataForm = response.data |  | ||||||
|             if (this.setData) { |  | ||||||
|               this.setDataForm() |  | ||||||
|             } |  | ||||||
|           }); |  | ||||||
|         } else { |  | ||||||
|           if (this.urlOptions.isGetCode) { |  | ||||||
|             this.getCode() |  | ||||||
|           } |  | ||||||
| 				} |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
| 		getCode() { |  | ||||||
| 			this.urlOptions.codeURL() |  | ||||||
| 				.then(({ data: res }) => { |  | ||||||
| 					this.dataForm.code = res; |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
|     getArr() { |  | ||||||
|       const params = { |  | ||||||
|         pageSize: 100, |  | ||||||
|         pageNo: 1, |  | ||||||
|       } |  | ||||||
|       this.urlOptions.optionArrUrl.forEach((item, index) => { |  | ||||||
|         item(params).then(({ data: res }) => { |  | ||||||
|           this.$set(this.urlOptions.optionArr, `arr${index}`, res.list) |  | ||||||
|         }) |  | ||||||
|           .catch(() => { |  | ||||||
|           }); |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     // 表单提交 |  | ||||||
|     dataFormSubmit() { |  | ||||||
|       this.$refs["dataForm"].validate((valid) => { |  | ||||||
|         if (!valid) { |  | ||||||
|           return false; |  | ||||||
|         } |  | ||||||
|         // 修改的提交 |  | ||||||
|         if (this.dataForm.id) { |  | ||||||
|           this.urlOptions.updateURL(this.dataForm).then(response => { |  | ||||||
|             this.$modal.msgSuccess("修改成功"); |  | ||||||
|             this.visible = false; |  | ||||||
|             this.$emit("refreshDataList"); |  | ||||||
|           }); |  | ||||||
|           return; |  | ||||||
|         } |  | ||||||
|         // 添加的提交 |  | ||||||
|         this.urlOptions.createURL(this.dataForm).then(response => { |  | ||||||
|           this.$modal.msgSuccess("新增成功"); |  | ||||||
|           this.visible = false; |  | ||||||
|           this.$emit("refreshDataList"); |  | ||||||
|         }); |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     formClear() { |  | ||||||
|       this.$refs.dataForm.resetFields() |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @@ -1,535 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<!-- 搜索工作栏 --> |  | ||||||
| 		<SearchBar |  | ||||||
| 			:formConfigs="searchBarFormConfig" |  | ||||||
| 			ref="search-bar" |  | ||||||
| 			@headBtnClick="handleSearchBarBtnClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> |  | ||||||
| 		<base-table |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="queryParams.pageNo" |  | ||||||
| 			:limit="queryParams.pageSize" |  | ||||||
| 			:table-data="list" |  | ||||||
| 			@emitFun="handleEmitFun"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableBtn.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				label="操作" |  | ||||||
| 				:width="120" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleTableBtnClick" /> |  | ||||||
| 		</base-table> |  | ||||||
|  |  | ||||||
| 		<!-- 分页组件 --> |  | ||||||
| 		<pagination |  | ||||||
| 			v-show="total > 0" |  | ||||||
| 			:total="total" |  | ||||||
| 			:page.sync="queryParams.pageNo" |  | ||||||
| 			:limit.sync="queryParams.pageSize" |  | ||||||
| 			@pagination="getList" /> |  | ||||||
|  |  | ||||||
| 		<!-- 对话框(添加 / 修改) --> |  | ||||||
| 		<base-dialog |  | ||||||
| 			:dialogTitle="title" |  | ||||||
| 			:dialogVisible="open" |  | ||||||
| 			width="700px" |  | ||||||
| 			@close="cancel" |  | ||||||
| 			@cancel="cancel" |  | ||||||
| 			@confirm="submitForm"> |  | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> |  | ||||||
| 		</base-dialog> |  | ||||||
|  |  | ||||||
| 		<!-- 抽屉 详情 --> |  | ||||||
| 		<BasicDrawer |  | ||||||
| 			v-if="editVisible" |  | ||||||
| 			ref="drawer" |  | ||||||
| 			:default-mode="editMode" |  | ||||||
| 			:info-data="alarmForm" |  | ||||||
| 			:sections="[ |  | ||||||
| 				{ |  | ||||||
| 					name: '基本信息', |  | ||||||
| 					key: 'base', |  | ||||||
| 					rows: drawerBaseInfoRows, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					name: '属性列表', |  | ||||||
| 					key: 'attrs', |  | ||||||
| 					props: drawerListProps, |  | ||||||
| 					url: '/base/equipment-plc-param/page', |  | ||||||
| 					urlCreate: '/base/equipment-plc-param/create', |  | ||||||
| 					urlUpdate: '/base/equipment-plc-param/update', |  | ||||||
| 					urlDelete: '/base/equipment-plc-param/delete', |  | ||||||
| 					urlDetail: '/base/equipment-plc-param/get', |  | ||||||
| 					queryParams: { |  | ||||||
| 						connectId: alarmForm.id, |  | ||||||
| 						pageNo: 1, |  | ||||||
| 						pageSize: 10, |  | ||||||
| 					}, |  | ||||||
| 					tableBtn: [ |  | ||||||
| 						this.$auth.hasPermi('base:equipment-plc-param:update') |  | ||||||
| 							? { |  | ||||||
| 									type: 'edit', |  | ||||||
| 									btnName: '修改', |  | ||||||
| 							  } |  | ||||||
| 							: undefined, |  | ||||||
| 						this.$auth.hasPermi('base:equipment-plc-param:delete') |  | ||||||
| 							? { |  | ||||||
| 									type: 'delete', |  | ||||||
| 									btnName: '删除', |  | ||||||
| 							  } |  | ||||||
| 							: undefined, |  | ||||||
| 					].filter((v) => v), |  | ||||||
| 					allowAdd: true, |  | ||||||
| 				}, |  | ||||||
| 			]" |  | ||||||
| 			@refreshDataList="getList" |  | ||||||
| 			@cancel="editVisible = false" |  | ||||||
| 			@destroy="editVisible = false" /> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import { |  | ||||||
| 	createEquipmentPlcConnect, |  | ||||||
| 	updateEquipmentPlcConnect, |  | ||||||
| 	deleteEquipmentPlcConnect, |  | ||||||
| 	getEquipmentPlcConnect, |  | ||||||
| 	getEquipmentPlcConnectPage, |  | ||||||
| 	exportEquipmentPlcConnectExcel, |  | ||||||
| } from '@/api/base/equipmentPlcConnect'; |  | ||||||
| import moment from 'moment'; |  | ||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; |  | ||||||
| // import './http'; |  | ||||||
| import BasicDrawer from './components/BasicDrawer.vue'; |  | ||||||
| import { publicFormatter } from '@/utils/dict'; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	name: 'EquipmentPlcConnect', |  | ||||||
| 	mixins: [basicPageMixin], |  | ||||||
| 	components: { BasicDrawer }, |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			searchBarKeys: ['equipmentId', 'plcId'], |  | ||||||
| 			// tableBtn: [ |  | ||||||
| 			// 	this.$auth.hasPermi('base:equipment-plc:update') |  | ||||||
| 			// 		? { |  | ||||||
| 			// 				type: 'edit', |  | ||||||
| 			// 				btnName: '修改', |  | ||||||
| 			// 		  } |  | ||||||
| 			// 		: undefined, |  | ||||||
| 			// 	this.$auth.hasPermi('base:equipment-plc:delete') |  | ||||||
| 			// 		? { |  | ||||||
| 			// 				type: 'delete', |  | ||||||
| 			// 				btnName: '删除', |  | ||||||
| 			// 		  } |  | ||||||
| 			// 		: undefined, |  | ||||||
| 			// ].filter((v) => v), |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'detail', |  | ||||||
| 					btnName: '参数绑定', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'edit', |  | ||||||
| 					btnName: '修改', |  | ||||||
| 				}, |  | ||||||
| 				// { |  | ||||||
| 				// 	type: 'params-bind', |  | ||||||
| 				// 	btnName: '参数绑定', |  | ||||||
| 				// }, |  | ||||||
| 				{ |  | ||||||
| 					type: 'delete', |  | ||||||
| 					btnName: '删除', |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 			tableProps: [ |  | ||||||
| 				// { |  | ||||||
| 				// 	prop: 'createTime', |  | ||||||
| 				// 	label: '添加时间', |  | ||||||
| 				// 	fixed: true, |  | ||||||
| 				// 	width: 180, |  | ||||||
| 				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), |  | ||||||
| 				// }, |  | ||||||
| 				{ prop: 'productionLine', label: '产线' }, |  | ||||||
| 				{ prop: 'workshopSection', label: '工段' }, |  | ||||||
| 				{ prop: 'equipmentName', label: '设备名' }, |  | ||||||
| 				{ prop: 'equipmentCode', label: '设备编码' }, |  | ||||||
| 				{ prop: 'plcCode', label: '关联表编码' }, |  | ||||||
| 				{ prop: 'plcTableName', label: '关联表名' }, |  | ||||||
| 				{ prop: 'plcName', label: '标识名称' }, |  | ||||||
| 				{ prop: 'bindingParameters', label: '绑定参数数量' }, |  | ||||||
| 				// { |  | ||||||
| 				// 	_action: 'params-bind', |  | ||||||
| 				// 	label: '查看绑定', |  | ||||||
| 				// 	subcomponent: { |  | ||||||
| 				// 		props: ['injectData'], |  | ||||||
| 				// 		render: function (h) { |  | ||||||
| 				// 			const _this = this; |  | ||||||
| 				// 			return h( |  | ||||||
| 				// 				'el-button', |  | ||||||
| 				// 				{ |  | ||||||
| 				// 					props: { type: 'text' }, |  | ||||||
| 				// 					on: { |  | ||||||
| 				// 						click: function () { |  | ||||||
| 				// 							console.log('inejctdata', _this.injectData); |  | ||||||
| 				// 							_this.$emit('emitData', { |  | ||||||
| 				// 								action: _this.injectData._action, |  | ||||||
| 				// 								payload: _this.injectData, |  | ||||||
| 				// 							}); |  | ||||||
| 				// 						}, |  | ||||||
| 				// 					}, |  | ||||||
| 				// 				}, |  | ||||||
| 				// 				'查看绑定' |  | ||||||
| 				// 			); |  | ||||||
| 				// 		}, |  | ||||||
| 				// 	}, |  | ||||||
| 				// }, |  | ||||||
| 			], |  | ||||||
| 			searchBarFormConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '设备名', |  | ||||||
| 					placeholder: '请选择设备', |  | ||||||
| 					param: 'equipmentId', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '编码', |  | ||||||
| 					placeholder: '请选择编码', |  | ||||||
| 					param: 'plcId', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'separate', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					// type: this.$auth.hasPermi('base:equipment-plc:create') |  | ||||||
| 					// 	? 'button' |  | ||||||
| 					// 	: '', |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '新增', |  | ||||||
| 					name: 'add', |  | ||||||
| 					plain: true, |  | ||||||
| 					color: 'success', |  | ||||||
| 				}, |  | ||||||
| 				// { |  | ||||||
| 				// 	type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '', |  | ||||||
| 				// 	btnName: '导出', |  | ||||||
| 				// 	name: 'export', |  | ||||||
| 				// 	color: 'warning', |  | ||||||
| 				// }, |  | ||||||
| 			], |  | ||||||
| 			rows: [ |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '关联表名', |  | ||||||
| 						prop: 'plcId', |  | ||||||
| 						labelKey: `plcTableName`, |  | ||||||
| 						url: '/base/equipment-plc/listAll', |  | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 						bind: { |  | ||||||
| 							filterable: true, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						select: true, |  | ||||||
| 						label: '设备', |  | ||||||
| 						prop: 'equipmentId', |  | ||||||
| 						url: '/base/equipment/page?pageNo=1&pageSize=99', |  | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 						bind: { |  | ||||||
| 							filterable: true, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			], |  | ||||||
| 			open: false, |  | ||||||
| 			// 查询参数 |  | ||||||
| 			queryParams: { |  | ||||||
| 				pageNo: 1, |  | ||||||
| 				pageSize: 10, |  | ||||||
| 				plcId: null, |  | ||||||
| 				equipmentId: null, |  | ||||||
| 			}, |  | ||||||
| 			// 表单参数 |  | ||||||
| 			form: {}, |  | ||||||
| 			// 查看绑定配置 |  | ||||||
| 			editVisible: false, |  | ||||||
| 			editMode: '', |  | ||||||
| 			drawerBaseInfoRows: [ |  | ||||||
| 				[ |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '设备名', |  | ||||||
| 						prop: 'equipmentName', |  | ||||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], |  | ||||||
| 						// bind: { |  | ||||||
| 						// 	disabled: this.editMode == 'detail', // some condition, like detail mode... |  | ||||||
| 						// } |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						input: true, |  | ||||||
| 						label: '关联表名', |  | ||||||
| 						prop: 'plcTableName', |  | ||||||
| 						// url: '/base/equipment/getCode', |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			], |  | ||||||
| 			drawerListProps: [ |  | ||||||
| 				{ prop: 'plcParamName', label: '参数列名' }, |  | ||||||
| 				{ prop: 'name', label: '参数名称' }, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'unit', |  | ||||||
| 					label: '单位', |  | ||||||
| 					filter: publicFormatter('unit_dict'), |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'equipmentParamType', |  | ||||||
| 					label: '设备参数类型', |  | ||||||
| 					filter: (val) => |  | ||||||
| 						val != null |  | ||||||
| 							? ['', '一般参数', '工艺参数', '报警参数', ''][val] |  | ||||||
| 							: '-', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'productionParamType', |  | ||||||
| 					label: '生产参数类型', |  | ||||||
| 					filter: (val) => |  | ||||||
| 						val != null |  | ||||||
| 							? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val] |  | ||||||
| 							  ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val] |  | ||||||
| 							: '-', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'collection', |  | ||||||
| 					label: '是否采集', |  | ||||||
| 					filter: (val) => (val != null ? ['否', '是'][val] : '-'), |  | ||||||
| 				}, |  | ||||||
| 				{ prop: 'minValue', label: '最小值' }, |  | ||||||
| 				{ prop: 'maxValue', label: '最大值' }, |  | ||||||
| 				{ prop: 'defaultValue', label: '标准值' }, |  | ||||||
| 				{ prop: 'description', label: '描述' }, |  | ||||||
| 				{ prop: 'remark', label: '备注' }, |  | ||||||
| 			], |  | ||||||
| 			alarmForm: { |  | ||||||
| 				id: undefined, |  | ||||||
| 				equipmentName: undefined, |  | ||||||
| 				plcTableName: undefined, |  | ||||||
| 			}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.getList(); |  | ||||||
| 		this.initSearchOptions(); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		async getEquipmentOptions() { |  | ||||||
| 			const res = await this.$axios({ |  | ||||||
| 				url: '/base/equipment/listAll', |  | ||||||
| 				method: 'get', |  | ||||||
| 			}); |  | ||||||
| 			return res.data; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		async getPlcOptions() { |  | ||||||
| 			const res = await this.$axios({ |  | ||||||
| 				url: '/base/equipment-plc/listAll', |  | ||||||
| 				method: 'get', |  | ||||||
| 			}); |  | ||||||
| 			return res.data; |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		/** 初始化查询条件 */ |  | ||||||
| 		async initSearchOptions() { |  | ||||||
| 			Promise.all([this.getEquipmentOptions(), this.getPlcOptions()]).then( |  | ||||||
| 				([eqList, plcList]) => { |  | ||||||
| 					this.searchBarFormConfig[0].selectOptions = eqList.map((item) => { |  | ||||||
| 						return { |  | ||||||
| 							name: item.name, |  | ||||||
| 							id: item.id, |  | ||||||
| 						}; |  | ||||||
| 					}); |  | ||||||
| 					this.searchBarFormConfig[1].selectOptions = plcList.map((item) => { |  | ||||||
| 						return { |  | ||||||
| 							name: item.name, |  | ||||||
| 							id: item.id, |  | ||||||
| 						}; |  | ||||||
| 					}); |  | ||||||
| 				} |  | ||||||
| 			); |  | ||||||
| 		}, |  | ||||||
| 		/** 覆盖 handleEmitFun 的默认实现 */ |  | ||||||
| 		handleEmitFun({ action, payload }) { |  | ||||||
| 			switch (action) { |  | ||||||
| 				case 'params-bind': |  | ||||||
| 					this.reset(); |  | ||||||
| 					const { |  | ||||||
| 						id, |  | ||||||
| 						equipmentName, |  | ||||||
| 						equipmentId, |  | ||||||
| 						plcId, |  | ||||||
| 						plcName, |  | ||||||
| 						plcTableName, |  | ||||||
| 					} = payload; |  | ||||||
| 					// console.log('Cha看绑定参数弹窗', id, equipmentName, plcTableName); |  | ||||||
| 					this.$router.push({ |  | ||||||
| 						name: 'EquipmentPlcParam', |  | ||||||
| 						params: { |  | ||||||
| 							id, |  | ||||||
| 							equipmentName, |  | ||||||
| 							plcTableName, |  | ||||||
| 						}, |  | ||||||
| 					}); |  | ||||||
| 					break; |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		/** 查询列表 */ |  | ||||||
| 		getList() { |  | ||||||
| 			this.loading = true; |  | ||||||
| 			// 执行查询 |  | ||||||
| 			getEquipmentPlcConnectPage(this.queryParams).then((response) => { |  | ||||||
| 				this.list = response.data.list; |  | ||||||
| 				this.total = response.data.total; |  | ||||||
| 				this.loading = false; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 取消按钮 */ |  | ||||||
| 		cancel() { |  | ||||||
| 			this.open = false; |  | ||||||
| 			this.reset(); |  | ||||||
| 		}, |  | ||||||
| 		/** 表单重置 */ |  | ||||||
| 		reset() { |  | ||||||
| 			this.form = { |  | ||||||
| 				id: undefined, |  | ||||||
| 				plcId: undefined, |  | ||||||
| 				equipmentId: undefined, |  | ||||||
| 			}; |  | ||||||
| 			this.resetForm('form'); |  | ||||||
| 		}, |  | ||||||
| 		/** 搜索按钮操作 */ |  | ||||||
| 		handleQuery() { |  | ||||||
| 			this.queryParams.pageNo = 1; |  | ||||||
| 			this.getList(); |  | ||||||
| 		}, |  | ||||||
| 		/** 重置按钮操作 */ |  | ||||||
| 		resetQuery() { |  | ||||||
| 			this.resetForm('queryForm'); |  | ||||||
| 			this.handleQuery(); |  | ||||||
| 		}, |  | ||||||
| 		/** 新增按钮操作 */ |  | ||||||
| 		handleAdd() { |  | ||||||
| 			this.reset(); |  | ||||||
| 			this.open = true; |  | ||||||
| 			this.title = '添加设备与实时采集关系表(一对多)'; |  | ||||||
| 		}, |  | ||||||
| 		/** 修改按钮操作 */ |  | ||||||
| 		handleUpdate(row) { |  | ||||||
| 			this.reset(); |  | ||||||
| 			const id = row.id; |  | ||||||
| 			getEquipmentPlcConnect(id).then((response) => { |  | ||||||
| 				this.form = response.data; |  | ||||||
| 				this.open = true; |  | ||||||
| 				this.title = '修改设备与实时采集关系表(一对多)'; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 提交按钮 */ |  | ||||||
| 		submitForm() { |  | ||||||
| 			this.$refs['form'].validate((valid) => { |  | ||||||
| 				if (!valid) { |  | ||||||
| 					return; |  | ||||||
| 				} |  | ||||||
| 				// 修改的提交 |  | ||||||
| 				if (this.form.id != null) { |  | ||||||
| 					updateEquipmentPlcConnect(this.form).then((response) => { |  | ||||||
| 						this.$modal.msgSuccess('修改成功'); |  | ||||||
| 						this.open = false; |  | ||||||
| 						this.getList(); |  | ||||||
| 					}); |  | ||||||
| 					return; |  | ||||||
| 				} |  | ||||||
| 				// 添加的提交 |  | ||||||
| 				createEquipmentPlcConnect(this.form).then((response) => { |  | ||||||
| 					this.$modal.msgSuccess('新增成功'); |  | ||||||
| 					this.open = false; |  | ||||||
| 					this.getList(); |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		// 查看报警 |  | ||||||
| 		handleDetail(row) { |  | ||||||
| 			// debugger; |  | ||||||
| 			const { |  | ||||||
| 				id, |  | ||||||
| 				bindingParameters, |  | ||||||
| 				equipmentCode, |  | ||||||
| 				equipmentId, |  | ||||||
| 				equipmentName, |  | ||||||
| 				plcCode, |  | ||||||
| 				plcId, |  | ||||||
| 				plcName, |  | ||||||
| 				plcTableName, |  | ||||||
| 				productionLine, |  | ||||||
| 				workshopSection, |  | ||||||
| 			} = row; |  | ||||||
| 			// 打开抽屉 |  | ||||||
| 			this.editMode = 'detail'; |  | ||||||
| 			this.alarmForm.id = id; |  | ||||||
| 			this.alarmForm.plcTableName = plcTableName; // 关联表名 |  | ||||||
| 			this.alarmForm.equipmentName = equipmentName; |  | ||||||
| 			this.editVisible = true; |  | ||||||
| 			this.$nextTick(() => { |  | ||||||
| 				this.$refs['drawer'].init(); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		/** 删除按钮操作 */ |  | ||||||
| 		handleDelete(row) { |  | ||||||
| 			const id = row.id; |  | ||||||
| 			this.$modal |  | ||||||
| 				.confirm('是否删除该配置?') |  | ||||||
| 				.then(function () { |  | ||||||
| 					return deleteEquipmentPlcConnect(id); |  | ||||||
| 				}) |  | ||||||
| 				.then(() => { |  | ||||||
| 					this.getList(); |  | ||||||
| 					this.$modal.msgSuccess('删除成功'); |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
|  |  | ||||||
| 		/** 导出按钮操作 */ |  | ||||||
| 		handleExport() { |  | ||||||
| 			// 处理查询参数 |  | ||||||
| 			let params = { ...this.queryParams }; |  | ||||||
| 			params.pageNo = undefined; |  | ||||||
| 			params.pageSize = undefined; |  | ||||||
| 			this.$modal |  | ||||||
| 				.confirm('是否确认导出所有设备与实时采集关系表(一对多)数据项?') |  | ||||||
| 				.then(() => { |  | ||||||
| 					this.exportLoading = true; |  | ||||||
| 					return exportEquipmentPlcConnectExcel(params); |  | ||||||
| 				}) |  | ||||||
| 				.then((response) => { |  | ||||||
| 					this.$download.excel(response, '设备与实时采集关系表(一对多).xls'); |  | ||||||
| 					this.exportLoading = false; |  | ||||||
| 				}) |  | ||||||
| 				.catch(() => {}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,10 +1,3 @@ | |||||||
| <!-- |  | ||||||
|     filename: CollectionConfig.vue |  | ||||||
|     author: liubin |  | ||||||
|     date: 2023-10-30 10:09:03 |  | ||||||
|     description: |  | ||||||
| --> |  | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| 	<div class="app-container"> | 	<div class="app-container"> | ||||||
| 		<!-- 搜索工作栏 --> | 		<!-- 搜索工作栏 --> | ||||||
| @@ -19,8 +12,7 @@ | |||||||
| 			:page="queryParams.pageNo" | 			:page="queryParams.pageNo" | ||||||
| 			:limit="queryParams.pageSize" | 			:limit="queryParams.pageSize" | ||||||
| 			:table-data="list" | 			:table-data="list" | ||||||
| 			@emitFun="handleEmitFun" | 			@emitFun="handleEmitFun"> | ||||||
| 			:max-height="tableH"> |  | ||||||
| 			<method-btn | 			<method-btn | ||||||
| 				v-if="tableBtn.length" | 				v-if="tableBtn.length" | ||||||
| 				slot="handleBtn" | 				slot="handleBtn" | ||||||
| @@ -42,21 +34,17 @@ | |||||||
| 		<base-dialog | 		<base-dialog | ||||||
| 			:dialogTitle="title" | 			:dialogTitle="title" | ||||||
| 			:dialogVisible="open" | 			:dialogVisible="open" | ||||||
| 			width="30%" | 			width="700px" | ||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> --> | 			<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" /> | ||||||
| 			<add-or-update |  | ||||||
| 				ref="addOrUpdate" |  | ||||||
| 				@refreshDataList="successSubmit" /> |  | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
|  |  | ||||||
| 		<!-- 抽屉 详情 --> | 		<!-- 抽屉 详情 --> | ||||||
| 		<BasicDrawer | 		<BasicDrawer | ||||||
| 			v-if="editVisible" | 			v-if="editVisible" | ||||||
| 			ref="drawer" | 			ref="drawer" | ||||||
| 			size="45%" |  | ||||||
| 			:default-mode="editMode" | 			:default-mode="editMode" | ||||||
| 			:info-data="alarmForm" | 			:info-data="alarmForm" | ||||||
| 			:sections="[ | 			:sections="[ | ||||||
| @@ -64,13 +52,9 @@ | |||||||
| 					name: '基本信息', | 					name: '基本信息', | ||||||
| 					key: 'base', | 					key: 'base', | ||||||
| 					rows: drawerBaseInfoRows, | 					rows: drawerBaseInfoRows, | ||||||
| 					url: '/base/equipment-plc-connect/get', |  | ||||||
| 					urlUpdate: '/base/equipment-plc-connect/update', |  | ||||||
| 					urlCreate: '/base/equipment-plc-connect/create', |  | ||||||
| 					queryParams: { id: alarmForm.id }, |  | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					name: '采集参数', | 					name: '属性列表', | ||||||
| 					key: 'attrs', | 					key: 'attrs', | ||||||
| 					props: drawerListProps, | 					props: drawerListProps, | ||||||
| 					url: '/base/equipment-plc-param/page', | 					url: '/base/equipment-plc-param/page', | ||||||
| @@ -84,26 +68,18 @@ | |||||||
| 						pageSize: 10, | 						pageSize: 10, | ||||||
| 					}, | 					}, | ||||||
| 					tableBtn: [ | 					tableBtn: [ | ||||||
| 						{ | 						this.$auth.hasPermi('base:equipment-plc-param:update') | ||||||
|  | 							? { | ||||||
| 									type: 'edit', | 									type: 'edit', | ||||||
| 									btnName: '修改', | 									btnName: '修改', | ||||||
| 						}, | 							  } | ||||||
| 						{ | 							: undefined, | ||||||
|  | 						this.$auth.hasPermi('base:equipment-plc-param:delete') | ||||||
|  | 							? { | ||||||
| 									type: 'delete', | 									type: 'delete', | ||||||
| 									btnName: '删除', | 									btnName: '删除', | ||||||
| 						}, | 							  } | ||||||
| 						// this.$auth.hasPermi('equipment:collection-config-param:update') | 							: undefined, | ||||||
| 						// 	? { |  | ||||||
| 						// 			type: 'edit', |  | ||||||
| 						// 			btnName: '修改', |  | ||||||
| 						// 	  } |  | ||||||
| 						// 	: undefined, |  | ||||||
| 						// this.$auth.hasPermi('equipment:collection-config-param:delete') |  | ||||||
| 						// 	? { |  | ||||||
| 						// 			type: 'delete', |  | ||||||
| 						// 			btnName: '删除', |  | ||||||
| 						// 	  } |  | ||||||
| 						// 	: undefined, |  | ||||||
| 					].filter((v) => v), | 					].filter((v) => v), | ||||||
| 					allowAdd: true, | 					allowAdd: true, | ||||||
| 				}, | 				}, | ||||||
| @@ -123,60 +99,67 @@ import { | |||||||
| 	getEquipmentPlcConnectPage, | 	getEquipmentPlcConnectPage, | ||||||
| 	exportEquipmentPlcConnectExcel, | 	exportEquipmentPlcConnectExcel, | ||||||
| } from '@/api/base/equipmentPlcConnect'; | } from '@/api/base/equipmentPlcConnect'; | ||||||
|  | import moment from 'moment'; | ||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||||
| // import './http'; | // import './http'; | ||||||
| import BasicDrawer from './components/BasicDrawer.vue'; | import BasicDrawer from './components/BasicDrawer.vue'; | ||||||
| import { publicFormatter } from '@/utils/dict'; | import { publicFormatter } from '@/utils/dict'; | ||||||
| import AddOrUpdate from './add-or-updata'; |  | ||||||
| import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; |  | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	name: 'EquipmentPlcConnect', | 	name: 'EquipmentPlcConnect', | ||||||
| 	mixins: [basicPageMixin, tableHeightMixin], | 	mixins: [basicPageMixin], | ||||||
| 	components: { BasicDrawer, AddOrUpdate }, | 	components: { BasicDrawer }, | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			searchBarKeys: ['equipmentId', 'plcId'], | 			searchBarKeys: ['equipmentId', 'plcId'], | ||||||
| 			// tableBtn: [ | 			// tableBtn: [ | ||||||
|  | 			// 	this.$auth.hasPermi('base:equipment-plc:update') | ||||||
|  | 			// 		? { | ||||||
|  | 			// 				type: 'edit', | ||||||
|  | 			// 				btnName: '修改', | ||||||
|  | 			// 		  } | ||||||
|  | 			// 		: undefined, | ||||||
|  | 			// 	this.$auth.hasPermi('base:equipment-plc:delete') | ||||||
|  | 			// 		? { | ||||||
|  | 			// 				type: 'delete', | ||||||
|  | 			// 				btnName: '删除', | ||||||
|  | 			// 		  } | ||||||
|  | 			// 		: undefined, | ||||||
| 			// ].filter((v) => v), | 			// ].filter((v) => v), | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermiAnd([ | 				{ | ||||||
| 					'base:equipment-plc-connect:query', |  | ||||||
| 					'base:equipment-plc-param:query' |  | ||||||
| 				]) |  | ||||||
| 				? { |  | ||||||
| 					type: 'detail', | 					type: 'detail', | ||||||
| 					btnName: '参数绑定', | 					btnName: '参数绑定', | ||||||
| 					} : undefined, | 				}, | ||||||
| 				this.$auth.hasPermiAnd([ | 				{ | ||||||
| 						'base:equipment-plc-connect:update', |  | ||||||
| 						'base:equipment-plc-connect:query', |  | ||||||
| 						'base:equipment-plc-param:create', |  | ||||||
| 						'base:equipment-plc-param:update', |  | ||||||
| 						'base:equipment-plc-param:delete', |  | ||||||
| 						'base:equipment-plc-param:query' |  | ||||||
| 					]) |  | ||||||
| 					? { |  | ||||||
| 					type: 'edit', | 					type: 'edit', | ||||||
| 					btnName: '修改', | 					btnName: '修改', | ||||||
| 					  } | 				}, | ||||||
| 					: undefined, | 				// { | ||||||
| 				this.$auth.hasPermi('base:equipment-plc-connect:delete') | 				// 	type: 'params-bind', | ||||||
| 					? { | 				// 	btnName: '参数绑定', | ||||||
|  | 				// }, | ||||||
|  | 				{ | ||||||
| 					type: 'delete', | 					type: 'delete', | ||||||
| 					btnName: '删除', | 					btnName: '删除', | ||||||
| 					  } | 				}, | ||||||
| 					: undefined, | 			], | ||||||
| 			].filter((v) => v), |  | ||||||
| 			tableProps: [ | 			tableProps: [ | ||||||
| 				{ prop: 'productionLine', label: '产线', minWidth: 120, showOverflowtooltip: true }, | 				// { | ||||||
| 				{ prop: 'workshopSection', label: '工段', minWidth: 120, showOverflowtooltip: true }, | 				// 	prop: 'createTime', | ||||||
| 				{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true }, | 				// 	label: '添加时间', | ||||||
| 				{ prop: 'equipmentCode', label: '设备编码', minWidth: 200, showOverflowtooltip: true }, | 				// 	fixed: true, | ||||||
| 				{ prop: 'plcCode', label: '关联表编码', minWidth: 220, showOverflowtooltip: true }, | 				// 	width: 180, | ||||||
| 				{ prop: 'plcTableName', label: '关联表名', minWidth: 150, showOverflowtooltip: true }, | 				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | ||||||
| 				{ prop: 'plcName', label: '标识名称', minWidth: 150, showOverflowtooltip: true }, | 				// }, | ||||||
| 				{ prop: 'bindingParameters', label: '绑定参数数量', minWidth: 120, showOverflowtooltip: true }, | 				{ prop: 'productionLine', label: '产线' }, | ||||||
|  | 				{ prop: 'workshopSection', label: '工段' }, | ||||||
|  | 				{ prop: 'equipmentName', label: '设备名' }, | ||||||
|  | 				{ prop: 'equipmentCode', label: '设备编码' }, | ||||||
|  | 				{ prop: 'plcCode', label: '关联表编码' }, | ||||||
|  | 				{ prop: 'plcTableName', label: '关联表名' }, | ||||||
|  | 				{ prop: 'plcName', label: '标识名称' }, | ||||||
|  | 				{ prop: 'bindingParameters', label: '绑定参数数量' }, | ||||||
| 				// { | 				// { | ||||||
| 				// 	_action: 'params-bind', | 				// 	_action: 'params-bind', | ||||||
| 				// 	label: '查看绑定', | 				// 	label: '查看绑定', | ||||||
| @@ -211,15 +194,13 @@ export default { | |||||||
| 					placeholder: '请选择设备', | 					placeholder: '请选择设备', | ||||||
| 					param: 'equipmentId', | 					param: 'equipmentId', | ||||||
| 					selectOptions: [], | 					selectOptions: [], | ||||||
| 					filterable: true, |  | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| 					label: '关联表编码', | 					label: '编码', | ||||||
| 					placeholder: '请选择关联表编码', | 					placeholder: '请选择编码', | ||||||
| 					param: 'plcId', | 					param: 'plcId', | ||||||
| 					selectOptions: [], | 					selectOptions: [], | ||||||
| 					filterable: true, |  | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: 'button', | ||||||
| @@ -228,21 +209,20 @@ export default { | |||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:equipment-plc-connect:create') | 					type: 'separate', | ||||||
| 						? 'separate' : '', |  | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:equipment-plc-connect:create') | 					// type: this.$auth.hasPermi('base:equipment-plc:create') | ||||||
| 						? 'button' | 					// 	? 'button' | ||||||
| 						: '', | 					// 	: '', | ||||||
| 					// type: 'button', | 					type: 'button', | ||||||
| 					btnName: '新增', | 					btnName: '新增', | ||||||
| 					name: 'add', | 					name: 'add', | ||||||
| 					plain: true, | 					plain: true, | ||||||
| 					color: 'success', | 					color: 'success', | ||||||
| 				}, | 				}, | ||||||
| 				// { | 				// { | ||||||
| 				// 	type: this.$auth.hasPermi('equipment:collection-config:export') ? 'button' : '', | 				// 	type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '', | ||||||
| 				// 	btnName: '导出', | 				// 	btnName: '导出', | ||||||
| 				// 	name: 'export', | 				// 	name: 'export', | ||||||
| 				// 	color: 'warning', | 				// 	color: 'warning', | ||||||
| @@ -256,9 +236,7 @@ export default { | |||||||
| 						prop: 'plcId', | 						prop: 'plcId', | ||||||
| 						labelKey: `plcTableName`, | 						labelKey: `plcTableName`, | ||||||
| 						url: '/base/equipment-plc/listAll', | 						url: '/base/equipment-plc/listAll', | ||||||
| 						rules: [ | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 							{ required: true, message: '关联表名不能为空', trigger: 'blur' }, |  | ||||||
| 						], |  | ||||||
| 						bind: { | 						bind: { | ||||||
| 							filterable: true, | 							filterable: true, | ||||||
| 						}, | 						}, | ||||||
| @@ -270,9 +248,7 @@ export default { | |||||||
| 						label: '设备', | 						label: '设备', | ||||||
| 						prop: 'equipmentId', | 						prop: 'equipmentId', | ||||||
| 						url: '/base/core-equipment/page?pageNo=1&pageSize=99', | 						url: '/base/core-equipment/page?pageNo=1&pageSize=99', | ||||||
| 						rules: [ | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 							{ required: true, message: '设备不能为空', trigger: 'blur' }, |  | ||||||
| 						], |  | ||||||
| 						bind: { | 						bind: { | ||||||
| 							filterable: true, | 							filterable: true, | ||||||
| 						}, | 						}, | ||||||
| @@ -283,7 +259,7 @@ export default { | |||||||
| 			// 查询参数 | 			// 查询参数 | ||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				pageNo: 1, | 				pageNo: 1, | ||||||
| 				pageSize: 20, | 				pageSize: 10, | ||||||
| 				plcId: null, | 				plcId: null, | ||||||
| 				equipmentId: null, | 				equipmentId: null, | ||||||
| 			}, | 			}, | ||||||
| @@ -298,9 +274,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '设备名', | 						label: '设备名', | ||||||
| 						prop: 'equipmentName', | 						prop: 'equipmentName', | ||||||
| 						rules: [ | 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||||
| 							{ required: true, message: '设备名不能为空', trigger: 'blur' }, |  | ||||||
| 						], |  | ||||||
| 						// bind: { | 						// bind: { | ||||||
| 						// 	disabled: this.editMode == 'detail', // some condition, like detail mode... | 						// 	disabled: this.editMode == 'detail', // some condition, like detail mode... | ||||||
| 						// } | 						// } | ||||||
| @@ -321,23 +295,6 @@ export default { | |||||||
| 					label: '单位', | 					label: '单位', | ||||||
| 					filter: publicFormatter('unit_dict'), | 					filter: publicFormatter('unit_dict'), | ||||||
| 				}, | 				}, | ||||||
| 				{ |  | ||||||
| 					prop: 'equipmentParamType', |  | ||||||
| 					label: '设备参数类型', |  | ||||||
| 					filter: (val) => |  | ||||||
| 						val != null |  | ||||||
| 							? ['', '一般参数', '工艺参数', '报警参数', ''][val] |  | ||||||
| 							: '-', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'productionParamType', |  | ||||||
| 					label: '生产参数类型', |  | ||||||
| 					filter: (val) => |  | ||||||
| 						val != null |  | ||||||
| 							? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val] |  | ||||||
| 							  ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val] |  | ||||||
| 							: '-', |  | ||||||
| 				}, |  | ||||||
| 				{ | 				{ | ||||||
| 					prop: 'collection', | 					prop: 'collection', | ||||||
| 					label: '是否采集', | 					label: '是否采集', | ||||||
| @@ -361,17 +318,14 @@ export default { | |||||||
| 		this.initSearchOptions(); | 		this.initSearchOptions(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		successSubmit() { |  | ||||||
|       this.cancel() |  | ||||||
|       this.getList() |  | ||||||
|     }, |  | ||||||
| 		async getEquipmentOptions() { | 		async getEquipmentOptions() { | ||||||
| 			const res = await this.$axios({ | 			const res = await this.$axios({ | ||||||
| 				url: '/base/equipment/listAll', | 				url: '/base/core-equipment/listAll', | ||||||
| 				method: 'get', | 				method: 'get', | ||||||
| 			}); | 			}); | ||||||
| 			return res.data; | 			return res.data; | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		async getPlcOptions() { | 		async getPlcOptions() { | ||||||
| 			const res = await this.$axios({ | 			const res = await this.$axios({ | ||||||
| 				url: '/base/equipment-plc/listAll', | 				url: '/base/equipment-plc/listAll', | ||||||
| @@ -392,7 +346,7 @@ export default { | |||||||
| 					}); | 					}); | ||||||
| 					this.searchBarFormConfig[1].selectOptions = plcList.map((item) => { | 					this.searchBarFormConfig[1].selectOptions = plcList.map((item) => { | ||||||
| 						return { | 						return { | ||||||
| 							name: item.code, | 							name: item.name, | ||||||
| 							id: item.id, | 							id: item.id, | ||||||
| 						}; | 						}; | ||||||
| 					}); | 					}); | ||||||
| @@ -449,19 +403,6 @@ export default { | |||||||
| 			}; | 			}; | ||||||
| 			this.resetForm('form'); | 			this.resetForm('form'); | ||||||
| 		}, | 		}, | ||||||
| 		handleTableBtnClick({ data, type }) { |  | ||||||
| 			switch (type) { |  | ||||||
| 				case 'edit': |  | ||||||
| 					this.handleDetail(data, 'edit'); |  | ||||||
| 					break; |  | ||||||
| 				case 'delete': |  | ||||||
| 					this.handleDelete(data); |  | ||||||
| 					break; |  | ||||||
| 				case 'detail': |  | ||||||
| 					this.handleDetail(data); |  | ||||||
| 					break; |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		/** 搜索按钮操作 */ | 		/** 搜索按钮操作 */ | ||||||
| 		handleQuery() { | 		handleQuery() { | ||||||
| 			this.queryParams.pageNo = 1; | 			this.queryParams.pageNo = 1; | ||||||
| @@ -476,10 +417,7 @@ export default { | |||||||
| 		handleAdd() { | 		handleAdd() { | ||||||
| 			this.reset(); | 			this.reset(); | ||||||
| 			this.open = true; | 			this.open = true; | ||||||
| 			this.title = '添加设备采集配置'; | 			this.title = '添加设备与实时采集关系表(一对多)'; | ||||||
| 			this.$nextTick(() => { |  | ||||||
| 				this.$refs.addOrUpdate.init() |  | ||||||
| 			}) |  | ||||||
| 		}, | 		}, | ||||||
| 		/** 修改按钮操作 */ | 		/** 修改按钮操作 */ | ||||||
| 		handleUpdate(row) { | 		handleUpdate(row) { | ||||||
| @@ -488,16 +426,35 @@ export default { | |||||||
| 			getEquipmentPlcConnect(id).then((response) => { | 			getEquipmentPlcConnect(id).then((response) => { | ||||||
| 				this.form = response.data; | 				this.form = response.data; | ||||||
| 				this.open = true; | 				this.open = true; | ||||||
| 				this.title = '修改设备采集配置'; | 				this.title = '修改设备与实时采集关系表(一对多)'; | ||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		/** 提交按钮 */ | 		/** 提交按钮 */ | ||||||
| 		submitForm() { | 		submitForm() { | ||||||
| 			this.$refs.addOrUpdate.dataFormSubmit() | 			this.$refs['form'].validate((valid) => { | ||||||
|  | 				if (!valid) { | ||||||
|  | 					return; | ||||||
|  | 				} | ||||||
|  | 				// 修改的提交 | ||||||
|  | 				if (this.form.id != null) { | ||||||
|  | 					updateEquipmentPlcConnect(this.form).then((response) => { | ||||||
|  | 						this.$modal.msgSuccess('修改成功'); | ||||||
|  | 						this.open = false; | ||||||
|  | 						this.getList(); | ||||||
|  | 					}); | ||||||
|  | 					return; | ||||||
|  | 				} | ||||||
|  | 				// 添加的提交 | ||||||
|  | 				createEquipmentPlcConnect(this.form).then((response) => { | ||||||
|  | 					this.$modal.msgSuccess('新增成功'); | ||||||
|  | 					this.open = false; | ||||||
|  | 					this.getList(); | ||||||
|  | 				}); | ||||||
|  | 			}); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		// 查看报警 | 		// 查看报警 | ||||||
| 		handleDetail(row, mode = 'detail') { | 		handleDetail(row) { | ||||||
| 			// debugger; | 			// debugger; | ||||||
| 			const { | 			const { | ||||||
| 				id, | 				id, | ||||||
| @@ -513,7 +470,7 @@ export default { | |||||||
| 				workshopSection, | 				workshopSection, | ||||||
| 			} = row; | 			} = row; | ||||||
| 			// 打开抽屉 | 			// 打开抽屉 | ||||||
| 			this.editMode = mode; | 			this.editMode = 'detail'; | ||||||
| 			this.alarmForm.id = id; | 			this.alarmForm.id = id; | ||||||
| 			this.alarmForm.plcTableName = plcTableName; // 关联表名 | 			this.alarmForm.plcTableName = plcTableName; // 关联表名 | ||||||
| 			this.alarmForm.equipmentName = equipmentName; | 			this.alarmForm.equipmentName = equipmentName; | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> | 			<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" /> | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
|   | |||||||
| @@ -1,94 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-08-01 13:52:10 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-10 09:30:06 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<el-form |  | ||||||
| 		:model="dataForm" |  | ||||||
| 		:rules="dataRule" |  | ||||||
| 		ref="dataForm" |  | ||||||
| 		v-if="visible" |  | ||||||
| 		@keyup.enter.native="dataFormSubmit()" |  | ||||||
| 		label-width="100px" |  | ||||||
| 		label-position="top"> |  | ||||||
| 		<el-row :gutter="20"> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="原料名称" prop="name"> |  | ||||||
| 					<el-input v-model="dataForm.name" clearable |  | ||||||
| 						placeholder="请输入原料名称" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="原料等级" prop="level"> |  | ||||||
| 					<el-input v-model="dataForm.level" clearable |  | ||||||
| 						placeholder="请输入原料等级" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="原料编码" prop="code"> |  | ||||||
| 					<el-input v-model="dataForm.code" readonly /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="单位" prop="unit"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="dataForm.unit" |  | ||||||
| 						filterable |  | ||||||
| 						clearable |  | ||||||
| 						:style="{ width: '100%' }" |  | ||||||
| 						placeholder="请选择单位"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="item in urlOptions.dictArr.dict0" |  | ||||||
| 							:key="item.id" |  | ||||||
| 							:label="item.label" |  | ||||||
| 							:value="item.value"></el-option> |  | ||||||
| 					</el-select> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 		</el-row> |  | ||||||
| 	</el-form> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicAdd from '@/mixins/basic-add'; |  | ||||||
| import { |  | ||||||
| 	createMaterial, |  | ||||||
| 	updateMaterial, |  | ||||||
| 	getMaterial, |  | ||||||
|   getCode |  | ||||||
| } from '@/api/base/material'; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicAdd], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				createURL: createMaterial, |  | ||||||
| 				updateURL: updateMaterial, |  | ||||||
| 				infoURL: getMaterial, |  | ||||||
|         codeURL: getCode, //获取code接口(返回结果为dataForm.code字段) |  | ||||||
|         dictNameList: ['unit_dict'], //数据字典name数组 |  | ||||||
| 			}, |  | ||||||
| 			dataForm: { |  | ||||||
| 				id: undefined, |  | ||||||
| 				code: '', |  | ||||||
| 				name: '', |  | ||||||
| 				unit: '', |  | ||||||
| 				level: '', |  | ||||||
| 			}, |  | ||||||
| 			dataRule: { |  | ||||||
| 				name: [ |  | ||||||
| 					{ required: true, message: '原料不能为空', trigger: 'blur' }, |  | ||||||
| 				], |  | ||||||
| 				code: [{ required: true, message: '编码不能为空', trigger: 'blur' }], |  | ||||||
| 			}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() {}, |  | ||||||
| 	methods: { |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,180 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<!-- 搜索工作栏 --> |  | ||||||
| 		<search-bar |  | ||||||
| 			:formConfigs="formConfig" |  | ||||||
| 			ref="searchBarForm" |  | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> |  | ||||||
| 		<base-table |  | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="listQuery.pageNo" |  | ||||||
| 			:limit="listQuery.pageSize" |  | ||||||
| 			:table-data="tableData"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableBtn.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				:width="90" |  | ||||||
| 				label="操作" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleClick" /> |  | ||||||
| 		</base-table> |  | ||||||
| 		<pagination |  | ||||||
| 			:limit.sync="listQuery.pageSize" |  | ||||||
| 			:page.sync="listQuery.pageNo" |  | ||||||
| 			:total="listQuery.total" |  | ||||||
| 			@pagination="getDataList" /> |  | ||||||
|  |  | ||||||
| 		<!-- 对话框(添加 / 修改) --> |  | ||||||
| 		<base-dialog |  | ||||||
| 			:dialogTitle="addOrEditTitle" |  | ||||||
| 			:dialogVisible="addOrUpdateVisible" |  | ||||||
| 			@cancel="handleCancel" |  | ||||||
| 			@confirm="handleConfirm" |  | ||||||
| 			:before-close="handleCancel" |  | ||||||
| 			width="40%"> |  | ||||||
| 			<add-or-update |  | ||||||
| 				ref="addOrUpdate" |  | ||||||
| 				@refreshDataList="successSubmit"></add-or-update> |  | ||||||
| 		</base-dialog> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import AddOrUpdate from './add-or-updata'; |  | ||||||
| import basicPage from '@/mixins/basic-page'; |  | ||||||
| import { parseTime } from '@/filter/code-filter'; |  | ||||||
| import { publicFormatter } from "@/utils/dict"; |  | ||||||
| import { |  | ||||||
| 	deleteMaterial, |  | ||||||
| 	getMaterialPage, |  | ||||||
| } from '@/api/base/material'; |  | ||||||
|  |  | ||||||
| const tableProps = [ |  | ||||||
|   { |  | ||||||
|     prop: 'createTime', |  | ||||||
|     label: '添加时间', |  | ||||||
|     filter: parseTime, |  | ||||||
|     minWidth: 150 |  | ||||||
|   }, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'name', |  | ||||||
| 		label: '原料名称', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'code', |  | ||||||
| 		label: '原料编码', |  | ||||||
| 		width: 180, |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'unit', |  | ||||||
| 		label: '单位', |  | ||||||
| 		filter: publicFormatter('unit_dict'), |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicPage], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getMaterialPage, |  | ||||||
| 				deleteURL: deleteMaterial, |  | ||||||
| 			}, |  | ||||||
| 			tableProps, |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				this.$auth.hasPermi(`base:material:update`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'edit', |  | ||||||
| 							btnName: '编辑', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 				this.$auth.hasPermi(`base:material:delete`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'delete', |  | ||||||
| 							btnName: '删除', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			tableData: [], |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ |  | ||||||
|           type: 'input', |  | ||||||
|           label: '原料名称', |  | ||||||
|           placeholder: '原料名称', |  | ||||||
|           param: 'name' |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
|           type: 'input', |  | ||||||
|           label: '原料编码', |  | ||||||
|           placeholder: '原料编码', |  | ||||||
|           param: 'code' |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:material:query') |  | ||||||
| 						? 'button' |  | ||||||
| 						: '', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: |  | ||||||
| 						this.$auth.hasPermi('base:material:create') && |  | ||||||
| 						this.$auth.hasPermi('base:material:query') |  | ||||||
| 							? 'separate' |  | ||||||
| 							: '', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:material:create') |  | ||||||
| 						? 'button' |  | ||||||
| 						: '', |  | ||||||
| 					btnName: '新增', |  | ||||||
| 					name: 'add', |  | ||||||
| 					color: 'success', |  | ||||||
| 					plain: true, |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	components: { |  | ||||||
| 		AddOrUpdate, |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.listQuery.pageNo = 1; |  | ||||||
| 					this.listQuery.pageSize = 10; |  | ||||||
| 					this.listQuery.name = val.name; |  | ||||||
| 					this.listQuery.code = val.code; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				case 'reset': |  | ||||||
| 					this.$refs.searchBarForm.resetForm(); |  | ||||||
| 					this.listQuery = { |  | ||||||
| 						pageSize: 20, |  | ||||||
| 						pageNo: 1, |  | ||||||
| 						total: 1, |  | ||||||
| 					}; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				case 'add': |  | ||||||
| 					this.addOrEditTitle = '新增'; |  | ||||||
| 					this.addOrUpdateVisible = true; |  | ||||||
| 					this.addOrUpdateHandle(); |  | ||||||
| 					break; |  | ||||||
| 				case 'export': |  | ||||||
| 					this.handleExport(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,156 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-08-01 13:52:10 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-11 09:05:16 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<el-form |  | ||||||
| 		:model="dataForm" |  | ||||||
| 		:rules="dataRule" |  | ||||||
| 		ref="dataForm" |  | ||||||
| 		v-if="visible" |  | ||||||
| 		@keyup.enter.native="dataFormSubmit()" |  | ||||||
| 		label-width="100px" |  | ||||||
| 		label-position="top"> |  | ||||||
| 		<el-row :gutter="20"> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="原料名称" prop="materialId"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="dataForm.materialId" |  | ||||||
| 						filterable |  | ||||||
| 						@change="setCode" |  | ||||||
| 						:style="{ width: '100%' }" |  | ||||||
| 						placeholder="请选择原料名称"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="item in MaterialList" |  | ||||||
| 							:key="item.id" |  | ||||||
| 							:label="item.name" |  | ||||||
| 							:value="item.id"></el-option> |  | ||||||
| 					</el-select> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="原料编码" prop="code"> |  | ||||||
| 					<el-input v-model="dataForm.code" clearable readonly /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="生效开始时间" prop="startTime"> |  | ||||||
| 					<el-date-picker |  | ||||||
| 						v-model="dataForm.startTime" |  | ||||||
| 						type="date" |  | ||||||
| 						value-format="timestamp" |  | ||||||
| 						:style="{ width: '100%' }" |  | ||||||
| 						placeholder="选择开始时间"></el-date-picker> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="生效结束时间" prop="endTime"> |  | ||||||
| 					<el-date-picker |  | ||||||
| 						v-model="dataForm.endTime" |  | ||||||
| 						type="date" |  | ||||||
| 						value-format="timestamp" |  | ||||||
| 						:style="{ width: '100%' }" |  | ||||||
| 						placeholder="选择结束时间"></el-date-picker> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="单价" prop="price"> |  | ||||||
| 					<el-input-number |  | ||||||
| 						:min="0" |  | ||||||
| 						style="width: 75%" |  | ||||||
| 						v-model="dataForm.price" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入允许留存时间" /> |  | ||||||
| 					{{ unit }} |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="12"> |  | ||||||
| 				<el-form-item label="备注" prop="remark"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.remark" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入备注" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 		</el-row> |  | ||||||
| 	</el-form> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicAdd from '@/mixins/basic-add'; |  | ||||||
| import { |  | ||||||
| 	createMaterialPricing, |  | ||||||
| 	updateMaterialPricing, |  | ||||||
| 	getMaterialPricing, |  | ||||||
| } from '@/api/base/materialPricing'; |  | ||||||
| import { getMaterialPage } from '@/api/base/material'; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicAdd], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				createURL: createMaterialPricing, |  | ||||||
| 				updateURL: updateMaterialPricing, |  | ||||||
| 				infoURL: getMaterialPricing, |  | ||||||
| 				optionArrUrl: [getMaterialPage], //需要获取下拉框的方法数组 |  | ||||||
| 				dictNameList: ['unit_dict'], //数据字典name数组 |  | ||||||
| 			}, |  | ||||||
| 			dataForm: { |  | ||||||
| 				id: null, |  | ||||||
| 				code: '', |  | ||||||
| 				materialId: '', |  | ||||||
| 				price: '', |  | ||||||
| 				startTime: new Date().getTime(), |  | ||||||
| 				endTime: null, |  | ||||||
| 				remark: '', |  | ||||||
| 			}, |  | ||||||
| 			setData: true, |  | ||||||
| 			MaterialList: [], |  | ||||||
| 			unit: '元/吨', |  | ||||||
| 			dataRule: { |  | ||||||
| 				materialId: [ |  | ||||||
| 					{ required: true, message: '原料不能为空', trigger: 'blur' }, |  | ||||||
| 				], |  | ||||||
| 				price: [{ required: true, message: '单价不能为空', trigger: 'blur' }], |  | ||||||
| 				startTime: [ |  | ||||||
| 					{ |  | ||||||
| 						required: true, |  | ||||||
| 						message: '生效开始时间不能为空', |  | ||||||
| 						trigger: 'change', |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() {}, |  | ||||||
| 	methods: { |  | ||||||
| 		getArr() { |  | ||||||
| 			getMaterialPage({ pageSize: 100, pageNo: 1 }).then((response) => { |  | ||||||
| 				this.MaterialList = response.data.list; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		setDataForm() { |  | ||||||
| 			if (this.MaterialList.length > 0) { |  | ||||||
| 				this.setCode(); |  | ||||||
| 			} else { |  | ||||||
| 				setTimeout(this.setCode(), 1000); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		setCode() { |  | ||||||
| 			this.MaterialList.forEach((item) => { |  | ||||||
| 				if (item.id === this.dataForm.materialId) { |  | ||||||
| 					this.dataForm.code = item.code; |  | ||||||
| 					this.unit = |  | ||||||
| 						'元/' + |  | ||||||
| 						this.urlOptions.dictArr.dict0.find((d) => d.value === item.unit) |  | ||||||
| 							.label; |  | ||||||
| 				} |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,23 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-12-05 13:45:59 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-04-10 15:20:11 |  | ||||||
|  * @Description |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<div> |  | ||||||
| 		<span>{{ parseTime(injectData.startTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.endTime)?parseTime(injectData.endTime,'{y}年{m}月{d}日'):'永久') }}</span> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
| <script> |  | ||||||
| export default { |  | ||||||
| 	name: '', |  | ||||||
| 	props: { |  | ||||||
| 		injectData: { |  | ||||||
| 			type: Object, |  | ||||||
| 			default: () => ({}), |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,182 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<!-- 搜索工作栏 --> |  | ||||||
| 		<search-bar |  | ||||||
| 			:formConfigs="formConfig" |  | ||||||
| 			ref="searchBarForm" |  | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> |  | ||||||
| 		<base-table |  | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="listQuery.pageNo" |  | ||||||
| 			:limit="listQuery.pageSize" |  | ||||||
| 			:table-data="tableData"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableBtn.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				:width="90" |  | ||||||
| 				label="操作" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleClick" /> |  | ||||||
| 		</base-table> |  | ||||||
| 		<pagination |  | ||||||
| 			:limit.sync="listQuery.pageSize" |  | ||||||
| 			:page.sync="listQuery.pageNo" |  | ||||||
| 			:total="listQuery.total" |  | ||||||
| 			@pagination="getDataList" /> |  | ||||||
|  |  | ||||||
| 		<!-- 对话框(添加 / 修改) --> |  | ||||||
| 		<base-dialog |  | ||||||
| 			:dialogTitle="addOrEditTitle" |  | ||||||
| 			:dialogVisible="addOrUpdateVisible" |  | ||||||
| 			@cancel="handleCancel" |  | ||||||
| 			@confirm="handleConfirm" |  | ||||||
| 			:before-close="handleCancel" |  | ||||||
| 			width="40%"> |  | ||||||
| 			<add-or-update |  | ||||||
| 				ref="addOrUpdate" |  | ||||||
| 				@refreshDataList="successSubmit"></add-or-update> |  | ||||||
| 		</base-dialog> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import AddOrUpdate from './add-or-updata'; |  | ||||||
| import connectTime from './connectTime'; |  | ||||||
| import basicPage from '@/mixins/basic-page'; |  | ||||||
| import { parseTime } from '@/filter/code-filter'; |  | ||||||
| import { |  | ||||||
| 	deleteMaterialPricing, |  | ||||||
| 	getMaterialPricingPage, |  | ||||||
| } from '@/api/base/materialPricing'; |  | ||||||
| import { getMaterialPage } from '@/api/base/material'; |  | ||||||
|  |  | ||||||
| const tableProps = [ |  | ||||||
| 	{ |  | ||||||
| 		prop: 'name', |  | ||||||
| 		label: '原料名称', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'code', |  | ||||||
| 		label: '原料编码', |  | ||||||
| 		width: 180, |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'price', |  | ||||||
| 		label: '单价(元/吨)', |  | ||||||
| 		align: 'right', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'createTime', |  | ||||||
| 		label: '生效时间', |  | ||||||
| 		width: 235, |  | ||||||
| 		subcomponent: connectTime, |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'remark', |  | ||||||
| 		label: '备注', |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicPage], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getMaterialPricingPage, |  | ||||||
| 				deleteURL: deleteMaterialPricing, |  | ||||||
| 			}, |  | ||||||
| 			tableProps, |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				this.$auth.hasPermi(`base:material-pricing:update`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'edit', |  | ||||||
| 							btnName: '编辑', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 				this.$auth.hasPermi(`base:material-pricing:delete`) |  | ||||||
| 					? { |  | ||||||
| 							type: 'delete', |  | ||||||
| 							btnName: '删除', |  | ||||||
| 					  } |  | ||||||
| 					: undefined, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			tableData: [], |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '原料名称', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'name', |  | ||||||
| 					filterable: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:material-pricing:query') |  | ||||||
| 						? 'button' |  | ||||||
| 						: '', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: |  | ||||||
| 						this.$auth.hasPermi('base:material-pricing:create') && |  | ||||||
| 						this.$auth.hasPermi('base:material-pricing:query') |  | ||||||
| 							? 'separate' |  | ||||||
| 							: '', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: this.$auth.hasPermi('base:material-pricing:create') |  | ||||||
| 						? 'button' |  | ||||||
| 						: '', |  | ||||||
| 					btnName: '新增', |  | ||||||
| 					name: 'add', |  | ||||||
| 					color: 'success', |  | ||||||
| 					plain: true, |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	components: { |  | ||||||
| 		AddOrUpdate, |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		getMaterialPage({ pageSize: 100, pageNo: 1 }).then((response) => { |  | ||||||
| 			this.formConfig[0].selectOptions = response.data.list; |  | ||||||
| 		}); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.listQuery.pageNo = 1; |  | ||||||
| 					this.listQuery.pageSize = 10; |  | ||||||
| 					this.listQuery.materialId = val.name; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				case 'reset': |  | ||||||
| 					this.$refs.searchBarForm.resetForm(); |  | ||||||
| 					this.listQuery = { |  | ||||||
| 						pageSize: 20, |  | ||||||
| 						pageNo: 1, |  | ||||||
| 						total: 1, |  | ||||||
| 					}; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				case 'add': |  | ||||||
| 					this.addOrEditTitle = '新增'; |  | ||||||
| 					this.addOrUpdateVisible = true; |  | ||||||
| 					this.addOrUpdateHandle(); |  | ||||||
| 					break; |  | ||||||
| 				case 'export': |  | ||||||
| 					this.handleExport(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -299,7 +299,7 @@ export default { | |||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
|     clipboard.on('error', e => { |     clipboard.on('error', e => { | ||||||
|       this.$message.warning('代码复制失败') |       this.$message.error('代码复制失败') | ||||||
|     }) |     }) | ||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
|   | |||||||
| @@ -42,7 +42,7 @@ export default { | |||||||
|   created() { |   created() { | ||||||
|     this.leaveId = this.id || this.$route.query.id; |     this.leaveId = this.id || this.$route.query.id; | ||||||
|     if (!this.leaveId) { |     if (!this.leaveId) { | ||||||
|       this.$message.warning('未传递 id 参数,无法查看 OA 请假信息'); |       this.$message.error('未传递 id 参数,无法查看 OA 请假信息'); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     this.getDetail(); |     this.getDetail(); | ||||||
|   | |||||||
| @@ -167,7 +167,7 @@ export default { | |||||||
|   created() { |   created() { | ||||||
|     this.id = this.$route.query.id; |     this.id = this.$route.query.id; | ||||||
|     if (!this.id) { |     if (!this.id) { | ||||||
|       this.$message.warning('未传递 id 参数,无法查看流程信息'); |       this.$message.error('未传递 id 参数,无法查看流程信息'); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     this.getDetail(); |     this.getDetail(); | ||||||
| @@ -185,7 +185,7 @@ export default { | |||||||
|       this.processInstanceLoading = true; |       this.processInstanceLoading = true; | ||||||
|       getProcessInstance(this.id).then(response => { |       getProcessInstance(this.id).then(response => { | ||||||
|         if (!response.data) { |         if (!response.data) { | ||||||
|           this.$message.warning('查询不到流程信息!'); |           this.$message.error('查询不到流程信息!'); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         // 设置流程信息 |         // 设置流程信息 | ||||||
|   | |||||||
| @@ -1,197 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div |  | ||||||
| 		ref="lineChart" |  | ||||||
| 		:id="id" |  | ||||||
| 		:class="className" |  | ||||||
| 		:style="{ height: height, width: width, marginLeft: '10px' }" /> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import * as echarts from 'echarts'; |  | ||||||
| require('echarts/theme/macarons'); // echarts theme |  | ||||||
| import resize from '@/utils/chartMixins/resize'; |  | ||||||
| import { parseTime } from '../../mixins/code-filter'; |  | ||||||
|  |  | ||||||
| const animationDuration = 1000; |  | ||||||
| export default { |  | ||||||
| 	name: 'lineChart', |  | ||||||
| 	mixins: [resize], |  | ||||||
| 	props: { |  | ||||||
| 		id: { |  | ||||||
| 			type: String, |  | ||||||
| 			default: 'chart', |  | ||||||
| 		}, |  | ||||||
| 		className: { |  | ||||||
| 			type: String, |  | ||||||
| 			default: 'chart', |  | ||||||
| 		}, |  | ||||||
| 		title: { |  | ||||||
| 			type: String, |  | ||||||
| 			default: '', |  | ||||||
| 		}, |  | ||||||
| 		width: { |  | ||||||
| 			type: String, |  | ||||||
| 			default: '100%', |  | ||||||
| 		}, |  | ||||||
| 		height: { |  | ||||||
| 			type: String, |  | ||||||
| 			default: '300px', |  | ||||||
| 		}, |  | ||||||
| 		barData: { |  | ||||||
| 			type: Object, |  | ||||||
| 			default: () => {}, |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			chart: null, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	mounted() { |  | ||||||
| 		if (!this.chart) { |  | ||||||
| 			this.chart = echarts.init(this.$refs.lineChart); |  | ||||||
| 			this.$nextTick(() => { |  | ||||||
| 				this.initChart(); |  | ||||||
| 			}); |  | ||||||
| 		} |  | ||||||
| 	}, |  | ||||||
| 	beforeDestroy() { |  | ||||||
| 		if (!this.chart) { |  | ||||||
| 			return; |  | ||||||
| 		} |  | ||||||
| 		this.chart.dispose(); |  | ||||||
| 		this.chart = null; |  | ||||||
| 	}, |  | ||||||
| 	watch: { |  | ||||||
| 		barData: { |  | ||||||
| 			handler() { |  | ||||||
| 				if (this.chart) { |  | ||||||
| 					this.$nextTick(() => { |  | ||||||
| 						this.initChart(); |  | ||||||
| 					}); |  | ||||||
| 				} else { |  | ||||||
| 					this.$nextTick(() => { |  | ||||||
| 						this.chart = echarts.init(this.$refs.lineChart); |  | ||||||
| 						this.initChart(); |  | ||||||
| 					}); |  | ||||||
| 				} |  | ||||||
| 			}, |  | ||||||
| 			deep: true, |  | ||||||
| 			immediate: true, |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		initChart() { |  | ||||||
| 			const _this = this; |  | ||||||
| 			this.chart.setOption({ |  | ||||||
| 				title: { |  | ||||||
| 					text: this.title |  | ||||||
| 						? '{space|}{tip|}{space|}{value|' + this.title + '}' |  | ||||||
| 						: '', |  | ||||||
| 					textStyle: { |  | ||||||
| 						rich: { |  | ||||||
| 							tip: { |  | ||||||
| 								width: 6, |  | ||||||
| 								height: 6, |  | ||||||
| 								borderRadius: 50, |  | ||||||
| 								backgroundColor: '#288AFF', |  | ||||||
| 							}, |  | ||||||
| 							space: { |  | ||||||
| 								width: 8, |  | ||||||
| 							}, |  | ||||||
| 							value: { |  | ||||||
| 								fontSize: 14, |  | ||||||
| 								color: 'black', |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				color: ['#288AFF', '#8EF0AB', '#FFDC94'], |  | ||||||
| 				tooltip: { |  | ||||||
| 					trigger: 'axis', |  | ||||||
| 					axisPointer: { |  | ||||||
| 						type: 'cross', |  | ||||||
| 						crossStyle: { |  | ||||||
| 							color: '#999', |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				legend: { |  | ||||||
| 					data: ['磨边节拍', '钢化节拍', '下片节拍'], |  | ||||||
| 				}, |  | ||||||
| 				grid: { |  | ||||||
| 					containLabel: true, |  | ||||||
| 				}, |  | ||||||
| 				xAxis: { |  | ||||||
| 					type: 'category', |  | ||||||
| 					data: this.barData.edgeCt.map((item) => { |  | ||||||
| 						return parseTime(item.recordTime, '{m}-{d} {h}:{i}'); |  | ||||||
| 					}), |  | ||||||
| 					axisPointer: { |  | ||||||
| 						type: 'shadow', |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				yAxis: [ |  | ||||||
| 					{ |  | ||||||
| 						type: 'value', |  | ||||||
| 						name: '节拍 pcs/min', |  | ||||||
| 						min: 0, |  | ||||||
| 						axisLabel: { |  | ||||||
| 							formatter: '{value}', |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				dataZoom: [ |  | ||||||
| 					{ |  | ||||||
| 						type: 'inside', |  | ||||||
| 						start: 0, |  | ||||||
| 						end: 100, |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						start: 0, |  | ||||||
| 						end: 100, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				series: [ |  | ||||||
| 					{ |  | ||||||
| 						name: '磨边节拍', |  | ||||||
| 						type: 'line', |  | ||||||
| 						tooltip: { |  | ||||||
| 							valueFormatter: function (value) { |  | ||||||
| 								return value + 'pcs/min'; |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 						data: this.barData.edgeCt.map((item) => { |  | ||||||
| 							return item.ct; |  | ||||||
| 						}), |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						name: '钢化节拍', |  | ||||||
| 						type: 'line', |  | ||||||
| 						tooltip: { |  | ||||||
| 							valueFormatter: function (value) { |  | ||||||
| 								return value + 'pcs/min'; |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 						data: this.barData.temperCt.map((item) => { |  | ||||||
| 							return item.ct; |  | ||||||
| 						}), |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						name: '下片节拍', |  | ||||||
| 						type: 'line', |  | ||||||
| 						tooltip: { |  | ||||||
| 							valueFormatter: function (value) { |  | ||||||
| 								return value + 'pcs/min'; |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 						data: this.barData.downCt.map((item) => { |  | ||||||
| 							return item.ct; |  | ||||||
| 						}), |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,273 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-08-24 14:47:58 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-01-09 10:04:17 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<div> |  | ||||||
| 		<base-table |  | ||||||
| 			:page="1" |  | ||||||
| 			:limit="999" |  | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			max-height="400" |  | ||||||
| 			:table-data="tableData"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableData.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				:width="80" |  | ||||||
| 				label="操作" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleClick" /> |  | ||||||
| 		</base-table> |  | ||||||
| 		<div v-if="eqChartData.length > 0" style="margin-top: 10px"> |  | ||||||
| 			<search-bar |  | ||||||
| 				:formConfigs="formConfig" |  | ||||||
| 				ref="searchBarForm1" |  | ||||||
| 				@headBtnClick="buttonClick" /> |  | ||||||
| 			<div |  | ||||||
| 				ref="lineChart" |  | ||||||
| 				id="chart" |  | ||||||
| 				:style="{ height: '400px', width: '100%', marginLeft: '10px' }" /> |  | ||||||
| 		</div> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import { getNewCTDet, getNewCTCharts } from '@/api/core/analysis/index'; |  | ||||||
| import * as echarts from 'echarts'; |  | ||||||
| require('echarts/theme/macarons'); // echarts theme |  | ||||||
| import resize from '@/utils/chartMixins/resize'; |  | ||||||
| import { parseTime } from '../../mixins/code-filter'; |  | ||||||
|  |  | ||||||
| const tableProps = [ |  | ||||||
| 	{ |  | ||||||
| 		prop: 'equipmentName', |  | ||||||
| 		label: '设备', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'size', |  | ||||||
| 		label: '规格', |  | ||||||
| 		showOverflowtooltip: true, |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'process', |  | ||||||
| 		label: '产品工艺', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'standardCt', |  | ||||||
| 		label: '标准节拍pcs/min', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'ct', |  | ||||||
| 		label: '当前节拍pcs/min', |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
| export default { |  | ||||||
| 	mixins: [resize], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			tableProps, |  | ||||||
| 			tableData: [], |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'eqChart', |  | ||||||
| 					btnName: '趋势图', |  | ||||||
| 				}, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			dataListLoading: false, |  | ||||||
| 			time: {}, |  | ||||||
| 			eqChartData: [], |  | ||||||
| 			eqName: null, |  | ||||||
| 			equipmentId: null, |  | ||||||
| 			chart: null, |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'datePicker', |  | ||||||
| 					label: '时间范围', |  | ||||||
| 					dateType: 'datetimerange', |  | ||||||
| 					format: 'yyyy-MM-dd HH:mm:ss', |  | ||||||
| 					valueFormat: 'timestamp', |  | ||||||
| 					rangeSeparator: '-', |  | ||||||
| 					startPlaceholder: '开始时间', |  | ||||||
| 					endPlaceholder: '结束时间', |  | ||||||
| 					defaultTime: ['00:00:00', '23:59:59'], |  | ||||||
| 					param: 'timeVal', |  | ||||||
| 					width: 350, |  | ||||||
| 					clearable: false, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	components: {}, |  | ||||||
| 	created() {}, |  | ||||||
| 	mounted() {}, |  | ||||||
| 	beforeDestroy() { |  | ||||||
| 		if (!this.chart) { |  | ||||||
| 			return; |  | ||||||
| 		} |  | ||||||
| 		this.chart.dispose(); |  | ||||||
| 		this.chart = null; |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		// 获取数据列表 |  | ||||||
| 		init(lineId, startTime, endTime) { |  | ||||||
| 			this.eqChartData = []; |  | ||||||
| 			this.time.startTime = startTime; |  | ||||||
| 			this.time.endTime = endTime; |  | ||||||
| 			this.dataListLoading = true; |  | ||||||
| 			getNewCTDet(lineId).then((response) => { |  | ||||||
| 				this.tableData = response.data; |  | ||||||
| 				this.dataListLoading = false; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		handleClick(val) { |  | ||||||
| 			const data = { |  | ||||||
| 				...this.time, |  | ||||||
| 				equipmentId: val.data.equipmentId, |  | ||||||
| 			}; |  | ||||||
| 			this.eqName = val.data.equipmentName; |  | ||||||
| 			this.equipmentId = val.data.equipmentId; |  | ||||||
| 			getNewCTCharts(data).then((response) => { |  | ||||||
| 				this.eqChartData = response.data; |  | ||||||
| 				this.$nextTick(() => { |  | ||||||
| 					this.$refs.searchBarForm1.formInline.timeVal = [ |  | ||||||
| 						this.time.startTime, |  | ||||||
| 						this.time.endTime, |  | ||||||
| 					]; |  | ||||||
| 					this.initChart(); |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.time.startTime = val.timeVal ? val.timeVal[0] : undefined; |  | ||||||
| 					this.time.endTime = val.timeVal ? val.timeVal[1] : undefined; |  | ||||||
| 					const data = { |  | ||||||
| 						...this.time, |  | ||||||
| 						equipmentId: this.equipmentId, |  | ||||||
| 					}; |  | ||||||
| 					getNewCTCharts(data).then((response) => { |  | ||||||
| 						this.eqChartData = response.data; |  | ||||||
| 						this.$nextTick(() => { |  | ||||||
| 							this.initChart(); |  | ||||||
| 						}); |  | ||||||
| 					}); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		initChart() { |  | ||||||
| 			this.chart = echarts.init(this.$refs.lineChart); |  | ||||||
| 			const _this = this; |  | ||||||
| 			this.chart.setOption({ |  | ||||||
| 				title: { |  | ||||||
| 					text: this.eqName |  | ||||||
| 						? '{space|}{tip|}{space|}{value|' + this.eqName + ' 节拍趋势图' + '}' |  | ||||||
| 						: '', |  | ||||||
| 					textStyle: { |  | ||||||
| 						rich: { |  | ||||||
| 							tip: { |  | ||||||
| 								width: 6, |  | ||||||
| 								height: 6, |  | ||||||
| 								borderRadius: 50, |  | ||||||
| 								backgroundColor: '#288AFF', |  | ||||||
| 							}, |  | ||||||
| 							space: { |  | ||||||
| 								width: 8, |  | ||||||
| 							}, |  | ||||||
| 							value: { |  | ||||||
| 								fontSize: 14, |  | ||||||
| 								color: 'black', |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				color: ['#288AFF', '#8EF0AB', '#FFDC94'], |  | ||||||
| 				tooltip: { |  | ||||||
| 					trigger: 'axis', |  | ||||||
| 					axisPointer: { |  | ||||||
| 						type: 'cross', |  | ||||||
| 						crossStyle: { |  | ||||||
| 							color: '#999', |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				legend: { |  | ||||||
| 					data: ['当前节拍', '标准节拍'], |  | ||||||
| 				}, |  | ||||||
| 				grid: { |  | ||||||
| 					containLabel: true, |  | ||||||
| 				}, |  | ||||||
| 				xAxis: { |  | ||||||
| 					type: 'category', |  | ||||||
| 					data: this.eqChartData[0].ct.map((item) => { |  | ||||||
| 						return parseTime(item.recordTime, '{m}-{d} {h}:{i}'); |  | ||||||
| 					}), |  | ||||||
| 					axisPointer: { |  | ||||||
| 						type: 'shadow', |  | ||||||
| 					}, |  | ||||||
| 				}, |  | ||||||
| 				yAxis: [ |  | ||||||
| 					{ |  | ||||||
| 						type: 'value', |  | ||||||
| 						name: '节拍', |  | ||||||
| 						min: 0, |  | ||||||
| 						interval: 20, |  | ||||||
| 						axisLabel: { |  | ||||||
| 							formatter: '{value} pcs/min', |  | ||||||
| 						}, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				dataZoom: [ |  | ||||||
| 					{ |  | ||||||
| 						type: 'inside', |  | ||||||
| 						start: 0, |  | ||||||
| 						end: 100, |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						start: 0, |  | ||||||
| 						end: 100, |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 				series: [ |  | ||||||
| 					{ |  | ||||||
| 						name: '标准节拍', |  | ||||||
| 						type: 'line', |  | ||||||
| 						tooltip: { |  | ||||||
| 							valueFormatter: function (value) { |  | ||||||
| 								return value + 'pcs/min'; |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 						data: this.eqChartData[0].ct.map((item) => { |  | ||||||
| 							return item.standardCt; |  | ||||||
| 						}), |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						name: '当前节拍', |  | ||||||
| 						type: 'line', |  | ||||||
| 						tooltip: { |  | ||||||
| 							valueFormatter: function (value) { |  | ||||||
| 								return value + 'pcs/min'; |  | ||||||
| 							}, |  | ||||||
| 						}, |  | ||||||
| 						data: this.eqChartData[0].ct.map((item) => { |  | ||||||
| 							return item.ct; |  | ||||||
| 						}), |  | ||||||
| 					}, |  | ||||||
| 				], |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,296 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<search-bar |  | ||||||
| 			:formConfigs="formConfig" |  | ||||||
| 			ref="searchBarForm" |  | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
| 		<div v-if="tableData.length"> |  | ||||||
| 			<base-table |  | ||||||
| 				v-loading="dataListLoading" |  | ||||||
| 				:span-method="mergeColumnHandler" |  | ||||||
| 				:max-height="tableH" |  | ||||||
| 				:table-props="tableProps" |  | ||||||
| 				:table-data="tableData" /> |  | ||||||
| 			<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> |  | ||||||
| 			<balance-chart ref="lineChart" /> |  | ||||||
| 		</div> |  | ||||||
| 		<div v-else class="no-data-bg"></div> |  | ||||||
| 		<!-- <pagination |  | ||||||
| 			:limit.sync="listQuery.pageSize" |  | ||||||
| 			:page.sync="listQuery.pageNo" |  | ||||||
| 			:total="listQuery.total" |  | ||||||
| 			@pagination="getDataList" /> --> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| // import basicPage from '../../mixins/basic-page'; |  | ||||||
| import { parseTime } from '../../mixins/code-filter'; |  | ||||||
| import { getCT } from '@/api/core/analysis/index'; |  | ||||||
| import { getProductionLinePage } from '@/api/core/base/productionLine'; |  | ||||||
| import BalanceChart from '../balanceChart'; |  | ||||||
| import { time } from 'echarts'; |  | ||||||
| import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; |  | ||||||
| // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; |  | ||||||
|  |  | ||||||
| // const tableProps = [ |  | ||||||
| // 	// { |  | ||||||
| //   //   prop: 'lineName', |  | ||||||
| // 	// 	label: '产线', |  | ||||||
| // 	// 	align: 'center', |  | ||||||
| // 	// }, |  | ||||||
| //   // { |  | ||||||
| //   //   prop: 'sum', |  | ||||||
| //   //   label: '合计', |  | ||||||
| //   //   align: 'center', |  | ||||||
| //   // }, |  | ||||||
| //   // { |  | ||||||
| //   //   prop: 'dynamicValue', |  | ||||||
| //   //   label: 'dynamicName', |  | ||||||
| //   //   align: 'center', |  | ||||||
| //   //   children:[ |  | ||||||
|  |  | ||||||
| //   //   ] |  | ||||||
| //   // } |  | ||||||
| // ]; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	components: { |  | ||||||
| 		BalanceChart, |  | ||||||
| 	}, |  | ||||||
| 	mixins: [tableHeightMixin], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getCT, |  | ||||||
| 			}, |  | ||||||
| 			tableProps: [], |  | ||||||
| 			dataListLoading: false, |  | ||||||
| 			tableData: [], |  | ||||||
| 			listQuery: { |  | ||||||
| 				// time: '' |  | ||||||
| 				endTime: undefined, |  | ||||||
| 				lineId: undefined, |  | ||||||
| 				startTime: undefined, |  | ||||||
| 			}, |  | ||||||
| 			timeList: [], |  | ||||||
| 			spanArr: [], |  | ||||||
| 			xData: [], |  | ||||||
| 			yData: [], |  | ||||||
| 			optionArrUrl: [getProductionLinePage], |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '产线', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'lineIds', |  | ||||||
| 					defaultSelect: '', |  | ||||||
| 					multiple: false, |  | ||||||
| 					filterable: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'datePicker', |  | ||||||
| 					label: '时间', |  | ||||||
| 					dateType: 'datetimerange', |  | ||||||
| 					format: 'yyyy-MM-dd', |  | ||||||
| 					valueFormat: 'yyyy-MM-dd HH:mm:ss', |  | ||||||
| 					rangeSeparator: '-', |  | ||||||
| 					startPlaceholder: '开始时间', |  | ||||||
| 					endPlaceholder: '结束时间', |  | ||||||
| 					width: 350, |  | ||||||
| 					param: 'time', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '查询', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	created() { |  | ||||||
| 		this.getArr(); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		getArr() { |  | ||||||
| 			const params = { |  | ||||||
| 				page: 1, |  | ||||||
| 				limit: 500, |  | ||||||
| 			}; |  | ||||||
| 			this.optionArrUrl.forEach((item, index) => { |  | ||||||
| 				item(params).then((response) => { |  | ||||||
| 					this.formConfig[index].selectOptions = response.data.list; |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		setRowSpan(arr) { |  | ||||||
| 			let count = 0; |  | ||||||
| 			arr.forEach((item, index) => { |  | ||||||
| 				if (index === 0) { |  | ||||||
| 					this.spanArr.push(1); |  | ||||||
| 				} else { |  | ||||||
| 					if (item === arr[index - 1]) { |  | ||||||
| 						this.spanArr[count] += 1; |  | ||||||
| 						this.spanArr.push(0); |  | ||||||
| 					} else { |  | ||||||
| 						count = index; |  | ||||||
| 						this.spanArr.push(1); |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		/** 合并table列的规则 */ |  | ||||||
| 		mergeColumnHandler({ row, column, rowIndex, columnIndex }) { |  | ||||||
| 			if (columnIndex == 0) { |  | ||||||
| 				if (this.spanArr[rowIndex]) { |  | ||||||
| 					return [ |  | ||||||
| 						this.spanArr[rowIndex], // row span |  | ||||||
| 						1, // col span |  | ||||||
| 					]; |  | ||||||
| 				} else { |  | ||||||
| 					return [0, 0]; |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		getData() { |  | ||||||
| 			// this.listQuery.lineId = '1672847052717821953' |  | ||||||
| 			// this.listQuery.startTime = '1693497600000'; |  | ||||||
| 			// this.listQuery.endTime = '1693843200000'; |  | ||||||
| 			this.urlOptions.getDataListURL(this.listQuery).then((res) => { |  | ||||||
| 				console.log(res); |  | ||||||
| 				let arr = [ |  | ||||||
| 					{ |  | ||||||
| 						prop: 'sectionName', |  | ||||||
| 						label: '工段', |  | ||||||
| 						align: 'center', |  | ||||||
| 					}, |  | ||||||
| 					{ |  | ||||||
| 						prop: 'equName', |  | ||||||
| 						label: '设备', |  | ||||||
| 						align: 'center', |  | ||||||
|             width: 150 |  | ||||||
| 					}, |  | ||||||
| 				]; |  | ||||||
| 				let sectionArr = []; |  | ||||||
| 				res.data.data.forEach((ele, index) => { |  | ||||||
| 					let tempData = []; |  | ||||||
| 					let ggData = []; |  | ||||||
| 					let sbluData = []; |  | ||||||
| 					let sbsjData = []; |  | ||||||
| 					let cxluData = []; |  | ||||||
| 					let cxsjData = []; |  | ||||||
| 					ele.data.forEach((item, index) => { |  | ||||||
| 						item.children.forEach((params) => { |  | ||||||
| 							if (params.dynamicName === '生产规格') { |  | ||||||
| 								tempData[item.dynamicName + '_gg'] = params.dynamicValue; |  | ||||||
| 								ggData[index] = params.dynamicValue; |  | ||||||
| 							} else if (params.dynamicName === '设备理论速度') { |  | ||||||
| 								tempData[item.dynamicName + '_sblu'] = params.dynamicValue; |  | ||||||
| 								sbluData[index] = params.dynamicValue; |  | ||||||
| 							} else if (params.dynamicName === '设备实际速度') { |  | ||||||
| 								tempData[item.dynamicName + '_sbsj'] = params.dynamicValue; |  | ||||||
| 								sbsjData[index] = params.dynamicValue; |  | ||||||
| 							} else if (params.dynamicName === '产线理论速度') { |  | ||||||
| 								tempData[item.dynamicName + '_cxlu'] = params.dynamicValue; |  | ||||||
| 								cxluData[index] = params.dynamicValue; |  | ||||||
| 							} else if(params.dynamicName === '产线实际速度') { |  | ||||||
| 								tempData[item.dynamicName + '_cxsj'] = params.dynamicValue; |  | ||||||
| 								cxsjData[index] = params.dynamicValue; |  | ||||||
| 							} |  | ||||||
| 						}); |  | ||||||
| 					}); |  | ||||||
| 					const equipment = { |  | ||||||
| 						name: ele.equName, |  | ||||||
| 						ggData: ggData, |  | ||||||
| 						sbluData: sbluData, |  | ||||||
| 						sbsjData: sbsjData, |  | ||||||
| 						cxluData: cxluData, |  | ||||||
| 						cxsjData: cxsjData, |  | ||||||
| 					}; |  | ||||||
| 					tempData['equName'] = ele.equName; |  | ||||||
| 					tempData['sectionName'] = ele.sectionName; |  | ||||||
| 					this.tableData.push(tempData); |  | ||||||
| 					const { sectionName } = tempData; |  | ||||||
| 					sectionArr.push(sectionName); |  | ||||||
| 					this.yData.push(equipment); |  | ||||||
| 				}); |  | ||||||
| 				this.setRowSpan(sectionArr); |  | ||||||
| 				res.data.nameData.forEach((item) => { |  | ||||||
| 					this.timeList.push(item.name); |  | ||||||
| 				}); |  | ||||||
| 				const timeArray = Array.from(new Set(this.timeList)); |  | ||||||
|         console.log(timeArray) |  | ||||||
| 				for (const times of timeArray) { |  | ||||||
| 					if (times !== '生产规格' && times !== '设备理论速度' && times !== '设备实际速度' |  | ||||||
|              && times !== '产线理论速度' && times !== '产线实际速度' |  | ||||||
|           ) { |  | ||||||
| 						const subprop = { |  | ||||||
| 							label: times, |  | ||||||
| 							align: 'center', |  | ||||||
| 							children: [ |  | ||||||
| 								{ prop: times + '_gg', label: '生产规格', align: 'center' }, |  | ||||||
| 								{ prop: times + '_sblu', label: '设备理论速度[片/min]', align: 'center' }, |  | ||||||
| 								{ prop: times + '_sbsj', label: '设备实际速度[片/min]', align: 'center' }, |  | ||||||
| 								{ prop: times + '_cxlu', label: '产线理论速度[片/min]', align: 'center' }, |  | ||||||
| 								{ prop: times + '_cxsj', label: '产线实际速度[片/min]', align: 'center' }, |  | ||||||
| 							], |  | ||||||
| 						}; |  | ||||||
| 						arr.push(subprop); |  | ||||||
| 						this.xData.push(times); |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
| 				this.tableProps = arr; |  | ||||||
|  |  | ||||||
|         console.log(this.$refs) |  | ||||||
|         this.$nextTick(()=>{ |  | ||||||
|           this.$refs.lineChart.initChart(this.xData, this.yData); |  | ||||||
|         }) |  | ||||||
| 				// this.total = response.data.total; |  | ||||||
| 				// this.dataListLoading = false; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			// console.log(val) |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					// this.listQuery.pageNo = 1; |  | ||||||
| 					// this.listQuery.pageSize = 10; |  | ||||||
| 					this.listQuery.lineId = val.lineIds; |  | ||||||
| 					this.listQuery.startTime = val.time |  | ||||||
| 						? String(new Date(val.time[0]).getTime()) |  | ||||||
| 						: undefined; |  | ||||||
| 					this.listQuery.endTime = val.time |  | ||||||
| 						? String(new Date(val.time[1]).getTime()) |  | ||||||
| 						: undefined; |  | ||||||
| 					if (val.time && val.lineIds) { |  | ||||||
| 						this.tableData = []; |  | ||||||
| 						this.xData = []; |  | ||||||
| 						this.yData = []; |  | ||||||
| 						this.tableProps = []; |  | ||||||
| 						this.spanArr = []; |  | ||||||
| 						this.timeList = []; |  | ||||||
| 						this.getData(); |  | ||||||
| 					} else { |  | ||||||
| 						this.$message({ |  | ||||||
| 							message: '请选择产线和时间', |  | ||||||
| 							type: 'warning', |  | ||||||
| 						}); |  | ||||||
| 					} |  | ||||||
| 					break; |  | ||||||
| 				case 'reset': |  | ||||||
| 					this.$refs.searchBarForm.resetForm(); |  | ||||||
| 					this.listQuery = { |  | ||||||
| 						pageSize: 10, |  | ||||||
| 						pageNo: 1, |  | ||||||
| 						total: 1, |  | ||||||
| 					}; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,302 +1,260 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: Do not edit |  | ||||||
|  * @Date: 2023-08-29 14:59:29 |  | ||||||
|  * @LastEditTime: 2025-01-09 10:27:53 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> | <template> | ||||||
|   <div class="app-container"> |   <div class="app-container"> | ||||||
| 		<search-bar |     <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | ||||||
| 			:formConfigs="formConfig" |     <div v-if="tableData.length"> | ||||||
| 			ref="searchBarForm" |       <base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" /> | ||||||
| 			@select-changed="handleSearchBarChanged" |       <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> | ||||||
| 			@headBtnClick="buttonClick" /> |       <balance-chart ref="lineChart" /> | ||||||
| 		<div v-if="showData.length"> |  | ||||||
| 			<base-table |  | ||||||
| 				class="right-aside" |  | ||||||
| 				v-loading="dataListLoading" |  | ||||||
| 				:table-props="tableProps" |  | ||||||
| 				:page="1" |  | ||||||
| 				:limit="999" |  | ||||||
| 				:table-data="showData"> |  | ||||||
| 				<method-btn |  | ||||||
| 					v-if="showData.length" |  | ||||||
| 					slot="handleBtn" |  | ||||||
| 					:width="80" |  | ||||||
| 					label="操作" |  | ||||||
| 					:method-list="tableBtn" |  | ||||||
| 					@clickBtn="handleClick" /> |  | ||||||
| 			</base-table> |  | ||||||
| 			<barChart |  | ||||||
| 				v-for="item in chartData" |  | ||||||
| 				:key="item.name + 'echart'" |  | ||||||
| 				style="margin-top: 50px" |  | ||||||
| 				height="600px" |  | ||||||
| 				:id="item.name + 'echart'" |  | ||||||
| 				:title="item.name + ' 节拍趋势图'" |  | ||||||
| 				:bar-data="item" /> |  | ||||||
|     </div> |     </div> | ||||||
|     <div v-else class="no-data-bg"></div> |     <div v-else class="no-data-bg"></div> | ||||||
| 		<base-dialog |     <!-- <pagination | ||||||
| 			:dialogTitle="addOrEditTitle" | 			:limit.sync="listQuery.pageSize" | ||||||
| 			:dialogVisible="addOrUpdateVisible" | 			:page.sync="listQuery.pageNo" | ||||||
| 			@cancel="handleCancel" | 			:total="listQuery.total" | ||||||
| 			@confirm="handleConfirm" | 			@pagination="getDataList" /> --> | ||||||
| 			:before-close="handleCancel" |  | ||||||
| 			close-on-click-modal |  | ||||||
|       top="0" |  | ||||||
| 			width="50%"> |  | ||||||
| 			<eq-detail ref="eqDetail" /> |  | ||||||
| 			<slot name="footer"> |  | ||||||
| 				<el-row slot="footer" type="flex" justify="end"> |  | ||||||
| 					<el-col :span="24"> |  | ||||||
| 						<el-button size="small" class="btnTextStyle" @click="handleCancel"> |  | ||||||
| 							取消 |  | ||||||
| 						</el-button> |  | ||||||
| 					</el-col> |  | ||||||
| 				</el-row> |  | ||||||
| 			</slot> |  | ||||||
| 		</base-dialog> |  | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| import eqDetail from './eq-detail'; | // import basicPage from '../../mixins/basic-page'; | ||||||
| import { parseTime } from '../../mixins/code-filter'; | import { parseTime } from '../../mixins/code-filter'; | ||||||
| import { getPdList } from '@/api/core/monitoring/auto'; | import { getCT } from '@/api/core/analysis/index'; | ||||||
| import { getNewCTNow, getNewCTCharts } from '@/api/core/analysis/index'; | import { getProductionLinePage } from '@/api/core/base/productionLine'; | ||||||
| import { getFactoryPage } from '@/api/core/base/factory'; | import BalanceChart from '../balanceChart' | ||||||
| // import codeFilter from '../../mixins/code-filter' | import { time } from 'echarts'; | ||||||
| import * as XLSX from 'xlsx'; | // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; | ||||||
| import FileSaver from 'file-saver'; |  | ||||||
| import barChart from './BarChart.vue'; |  | ||||||
|  |  | ||||||
| const tableProps = [ | // const tableProps = [ | ||||||
| 	{ | // 	// { | ||||||
| 		prop: 'factoryName', | //   //   prop: 'lineName', | ||||||
| 		label: '工厂', | // 	// 	label: '产线', | ||||||
| 	}, | // 	// 	align: 'center', | ||||||
| 	{ | // 	// }, | ||||||
| 		prop: 'lineName', | //   // { | ||||||
| 		label: '产线', | //   //   prop: 'sum', | ||||||
| 	}, | //   //   label: '合计', | ||||||
| 	{ | //   //   align: 'center', | ||||||
| 		prop: 'size', | //   // }, | ||||||
| 		label: '规格', | //   // { | ||||||
| 		showOverflowtooltip: true, | //   //   prop: 'dynamicValue', | ||||||
| 	}, | //   //   label: 'dynamicName', | ||||||
| 	{ | //   //   align: 'center', | ||||||
| 		prop: 'process', | //   //   children:[ | ||||||
| 		label: '产品工艺', |  | ||||||
| 	}, | //   //   ] | ||||||
| 	{ | //   // } | ||||||
| 		prop: 'edgeCt', | // ]; | ||||||
| 		label: '磨边当前节拍pcs/min', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'temperCt', |  | ||||||
| 		label: '钢化当前节拍pcs/min', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'downCt', |  | ||||||
| 		label: '下片当前节拍pcs/min', |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   components: { |   components: { | ||||||
| 		barChart, |     BalanceChart | ||||||
| 		eqDetail, |  | ||||||
|   }, |   }, | ||||||
|  |   // mixins: [basicPage], | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|       urlOptions: { |       urlOptions: { | ||||||
| 				getDataListURL: getNewCTNow, |         getDataListURL: getCT, | ||||||
|       }, |       }, | ||||||
| 			listQuery: { |       tableProps: [], | ||||||
| 				lineId: [], |  | ||||||
| 			}, |  | ||||||
| 			fileName: '', |  | ||||||
|       dataListLoading: false, |       dataListLoading: false, | ||||||
| 			tableProps, |  | ||||||
| 			tableBtn: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'eq', |  | ||||||
| 					btnName: '详情', |  | ||||||
| 				}, |  | ||||||
| 			].filter((v) => v), |  | ||||||
| 			showData: [], |  | ||||||
|       tableData: [], |       tableData: [], | ||||||
| 			chartData: [], |       listQuery: { | ||||||
| 			formConfig: [ |         // time: '' | ||||||
| 				{ |         endTime: undefined, | ||||||
| 					type: 'select', |         lineId:undefined, | ||||||
| 					label: '工厂', |         startTime:undefined | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'factoryId', |  | ||||||
| 					onchange: true, |  | ||||||
|       }, |       }, | ||||||
|  |       timeList: [], | ||||||
|  |       spanArr: [],  | ||||||
|  |       xData: [], | ||||||
|  |       yData: [], | ||||||
|  |       optionArrUrl: [getProductionLinePage], | ||||||
|  |       formConfig: [ | ||||||
|         { |         { | ||||||
|           type: 'select', |           type: 'select', | ||||||
|           label: '产线', |           label: '产线', | ||||||
|           selectOptions: [], |           selectOptions: [], | ||||||
| 					param: 'lineId', |           param: 'lineIds', | ||||||
| 					multiple: true, |           defaultSelect: '', | ||||||
|  |           multiple: false, | ||||||
|  |           filterable: true, | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           type: 'datePicker', |           type: 'datePicker', | ||||||
| 					label: '时间范围', |           label: '时间', | ||||||
|           dateType: 'datetimerange', |           dateType: 'datetimerange', | ||||||
| 					format: 'yyyy-MM-dd HH:mm:ss', |           format: 'yyyy-MM-dd', | ||||||
| 					valueFormat: 'timestamp', |           valueFormat: 'yyyy-MM-dd HH:mm:ss', | ||||||
|           rangeSeparator: '-', |           rangeSeparator: '-', | ||||||
|           startPlaceholder: '开始时间', |           startPlaceholder: '开始时间', | ||||||
|           endPlaceholder: '结束时间', |           endPlaceholder: '结束时间', | ||||||
| 					defaultTime: ['00:00:00', '23:59:59'], |  | ||||||
| 					param: 'timeVal', |  | ||||||
|           width: 350, |           width: 350, | ||||||
| 					clearable: false, |           param: 'time', | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           type: 'button', |           type: 'button', | ||||||
|           btnName: '查询', |           btnName: '查询', | ||||||
|           name: 'search', |           name: 'search', | ||||||
|           color: 'primary', |           color: 'primary', | ||||||
| 				}, |         } | ||||||
| 				// { |  | ||||||
| 				// 	type: 'separate', |  | ||||||
| 				// }, |  | ||||||
| 				// { |  | ||||||
| 				// 	// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '', |  | ||||||
| 				// 	type: 'button', |  | ||||||
| 				// 	btnName: '导出', |  | ||||||
| 				// 	name: 'export', |  | ||||||
| 				// 	color: 'warning', |  | ||||||
| 				// }, |  | ||||||
|       ], |       ], | ||||||
| 			addOrEditTitle: '', |  | ||||||
| 			addOrUpdateVisible: false, |  | ||||||
|     }; |     }; | ||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
| 		// 获取当前时间 |     this.getArr(); | ||||||
| 		const now = new Date(); |  | ||||||
| 		// 获取前一天的同一时间 |  | ||||||
| 		const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000); |  | ||||||
| 		// 设置为00:00:00 |  | ||||||
| 		yesterday.setHours(0, 0, 0, 0); |  | ||||||
| 		// 设置为23:59:59 |  | ||||||
| 		const end = new Date(yesterday.getTime()); |  | ||||||
| 		end.setHours(23, 59, 59, 59); |  | ||||||
| 		this.listQuery.startTime = yesterday.getTime(); |  | ||||||
| 		this.listQuery.endTime = end.getTime(); |  | ||||||
| 		this.$nextTick(() => { |  | ||||||
| 			this.$refs.searchBarForm.formInline.timeVal = [ |  | ||||||
| 				yesterday.getTime(), |  | ||||||
| 				end.getTime(), |  | ||||||
| 			]; |  | ||||||
| 		}); |  | ||||||
| 		this.getDataList(); |  | ||||||
| 		this.getPdLineList(); |  | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
| 		handleExport() { |     getArr() { | ||||||
| 			let tables = document.querySelector('.el-table').cloneNode(true); |  | ||||||
| 			const fix = tables.querySelector('.el-table__fixed'); |  | ||||||
| 			const fixRight = tables.querySelector('.el-table__fixed-right'); |  | ||||||
| 			if (fix) { |  | ||||||
| 				tables.removeChild(tables.querySelector('.el-table__fixed')); |  | ||||||
| 			} |  | ||||||
| 			if (fixRight) { |  | ||||||
| 				tables.removeChild(tables.querySelector('.el-table__fixed-right')); |  | ||||||
| 			} |  | ||||||
| 			let exportTable = XLSX.utils.table_to_book(tables); |  | ||||||
|  |  | ||||||
| 			var exportTableOut = XLSX.write(exportTable, { |  | ||||||
| 				bookType: 'xlsx', |  | ||||||
| 				bookSST: true, |  | ||||||
| 				type: 'array', |  | ||||||
| 			}); |  | ||||||
| 			// sheetjs.xlsx为导出表格的标题名称 |  | ||||||
| 			try { |  | ||||||
| 				FileSaver.saveAs( |  | ||||||
| 					new Blob([exportTableOut], { |  | ||||||
| 						type: 'application/octet-stream', |  | ||||||
| 					}), |  | ||||||
| 					this.fileName + '产线自动报表.xlsx' |  | ||||||
| 				); |  | ||||||
| 			} catch (e) { |  | ||||||
| 				if (typeof console !== 'undefined') console.log(e, exportTableOut); |  | ||||||
| 			} |  | ||||||
| 			return exportTableOut; |  | ||||||
| 		}, |  | ||||||
| 		getPdLineList() { |  | ||||||
| 			getPdList().then((res) => { |  | ||||||
| 				this.formConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
|       const params = { |       const params = { | ||||||
| 				pageSize: 100, |         page: 1, | ||||||
| 				pageNo: 1, |         limit: 500 | ||||||
| 			}; |       } | ||||||
| 			getFactoryPage(params).then((res) => { |       this.optionArrUrl.forEach((item, index) => { | ||||||
| 				this.formConfig[0].selectOptions = res.data.list || []; |         item(params).then((response) => { | ||||||
|  |           this.formConfig[index].selectOptions = response.data.list | ||||||
|  |         }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     setRowSpan(arr) { | ||||||
|  |       let count = 0 | ||||||
|  |       arr.forEach((item, index) => { | ||||||
|  |         if(index === 0) { | ||||||
|  |           this.spanArr.push(1) | ||||||
|  |         } else { | ||||||
|  |           if (item === arr[index - 1]) { | ||||||
|  |             this.spanArr[count] += 1 | ||||||
|  |             this.spanArr.push(0) | ||||||
|  |           } else { | ||||||
|  |             count = index | ||||||
|  |             this.spanArr.push(1) | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     /** 合并table列的规则 */ | ||||||
|  | 		mergeColumnHandler({ row, column, rowIndex, columnIndex }) { | ||||||
|  | 			if (columnIndex == 0) { | ||||||
|  | 				if (this.spanArr[rowIndex]) { | ||||||
|  | 					return [ | ||||||
|  | 						this.spanArr[rowIndex], // row span | ||||||
|  | 						1, // col span | ||||||
|  | 					]; | ||||||
|  | 				} else { | ||||||
|  | 					return [0, 0]; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		}, | ||||||
|  |     getData() { | ||||||
|  |       // this.listQuery.lineId = '1672847052717821953' | ||||||
|  |       // this.listQuery.startTime = '1693497600000'; | ||||||
|  |       // this.listQuery.endTime = '1693843200000'; | ||||||
|  |       this.urlOptions.getDataListURL(this.listQuery).then(res => { | ||||||
|  |         console.log(res) | ||||||
|  |         let arr = [ | ||||||
|  |           { | ||||||
|  |             prop: 'sectionName', | ||||||
|  |             label: '工段', | ||||||
|  |             align: 'center', | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             prop: 'equName', | ||||||
|  |             label: '设备', | ||||||
|  |             align: 'center', | ||||||
|  |           } | ||||||
|  |         ] | ||||||
|  |         let sectionArr= [] | ||||||
|  |         res.data.data.forEach((ele, index) => { | ||||||
|  |           let tempData = [] | ||||||
|  |           let eqData = [] | ||||||
|  |             let plData = [] | ||||||
|  |           ele.data.forEach((item, index) => { | ||||||
|  |             item.children.forEach(params => { | ||||||
|  |               if (params.dynamicName === '设备CT') { | ||||||
|  |                 tempData[item.dynamicName + '_eq'] = params.dynamicValue | ||||||
|  |                 eqData[index] = params.dynamicValue | ||||||
|  |               } else { | ||||||
|  |                 tempData[item.dynamicName + '_pl'] = params.dynamicValue | ||||||
|  |                 plData[index] = params.dynamicValue | ||||||
|  |               } | ||||||
|  |             }) | ||||||
|  |           }) | ||||||
|  |           const equipment = { | ||||||
|  |             name: ele.equName, | ||||||
|  |             eqData: eqData, | ||||||
|  |             plData: plData | ||||||
|  |           } | ||||||
|  |           tempData['equName'] = ele.equName | ||||||
|  |           tempData['sectionName'] = ele.sectionName | ||||||
|  |           this.tableData.push(tempData) | ||||||
|  |           const { sectionName } = tempData | ||||||
|  |           sectionArr.push(sectionName) | ||||||
|  |           this.yData.push(equipment) | ||||||
|  |           console.log('看看equ', this.yData) | ||||||
|  |         }) | ||||||
|  |         this.setRowSpan(sectionArr) | ||||||
|  |         res.data.nameData.forEach(item => { | ||||||
|  |           this.timeList.push(item.name) | ||||||
|  |         }) | ||||||
|  |         const timeArray = Array.from(new Set(this.timeList)) | ||||||
|  |         for (const times of timeArray) { | ||||||
|  |           if (times !== '设备CT' && times !== '产线CT') { | ||||||
|  |             const subprop = { | ||||||
|  |               label: times, | ||||||
|  |               align: 'center', | ||||||
|  |               children: [ | ||||||
|  |                 { prop: times + '_eq', label: '设备CT', align: 'center' }, | ||||||
|  |                 { prop: times + '_pl', label: '产线CT', align: 'center' } | ||||||
|  |               ] | ||||||
|  |             } | ||||||
|  |             arr.push(subprop) | ||||||
|  |             this.xData.push(times) | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         this.tableProps = arr | ||||||
|  |  | ||||||
|  |         console.log('表格横坐标', this.xData) | ||||||
|  |         this.$refs.lineChart.initChart(this.xData, this.yData) | ||||||
|  |         // this.total = response.data.total; | ||||||
|  |         // this.dataListLoading = false; | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     buttonClick(val) { |     buttonClick(val) { | ||||||
|  |       // console.log(val) | ||||||
|       switch (val.btnName) { |       switch (val.btnName) { | ||||||
|         case 'search': |         case 'search': | ||||||
| 					this.listQuery.factoryId = val.factoryId || undefined; |           // this.listQuery.pageNo = 1; | ||||||
| 					this.listQuery.lineId = val.lineId ? val.lineId : []; |           // this.listQuery.pageSize = 10; | ||||||
| 					this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined; |           this.listQuery.lineId = val.lineIds | ||||||
| 					this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined; |           this.listQuery.startTime = val.time ? String(new Date(val.time[0]).getTime()) : undefined; | ||||||
| 					this.getDataList(); |           this.listQuery.endTime = val.time ? String(new Date(val.time[1]).getTime()) : undefined; | ||||||
|  |           if (val.time && val.lineIds) { | ||||||
|  |             this.tableData = [] | ||||||
|  |             this.xData = [] | ||||||
|  |             this.yData = [] | ||||||
|  |             this.tableProps = [] | ||||||
|  |             this.spanArr = [] | ||||||
|  |             this.timeList = [] | ||||||
|  |             this.getData() | ||||||
|  |           } else { | ||||||
|  |             this.$message({ | ||||||
|  |               message: '请选择产线和时间', | ||||||
|  |               type: 'warning' | ||||||
|  |             }); | ||||||
|  |           } | ||||||
|           break; |           break; | ||||||
| 				case 'export': |         case 'reset': | ||||||
| 					this.handleExport(); |           this.$refs.searchBarForm.resetForm(); | ||||||
|  |           this.listQuery = { | ||||||
|  |             pageSize: 10, | ||||||
|  |             pageNo: 1, | ||||||
|  |             total: 1, | ||||||
|  |           }; | ||||||
|  |           this.getDataList(); | ||||||
|           break; |           break; | ||||||
|         default: |         default: | ||||||
|           console.log(val); |           console.log(val); | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
| 		// 获取数据列表 |  | ||||||
| 		getDataList() { |  | ||||||
| 			this.dataListLoading = true; |  | ||||||
| 			this.urlOptions.getDataListURL(this.listQuery).then((response) => { |  | ||||||
| 				this.tableData = response.data; |  | ||||||
| 				this.dataListLoading = false; |  | ||||||
| 				this.showData = this.tableData; |  | ||||||
| 			}); |  | ||||||
| 			getNewCTCharts(this.listQuery).then((response) => { |  | ||||||
| 				this.chartData = response.data; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		handleSearchBarChanged({ param, value }) { |  | ||||||
| 			this.listQuery.lineId = []; |  | ||||||
| 			this.$refs.searchBarForm.formInline.lineId = undefined; |  | ||||||
| 			getPdList(value).then((res) => { |  | ||||||
| 				this.formConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		handleClick(val) { |  | ||||||
| 			this.addOrUpdateVisible = true; |  | ||||||
| 			this.addOrEditTitle = |  | ||||||
| 				val.data?.factoryName + '-' + val.data?.lineName + ' 详情'; |  | ||||||
| 			this.$nextTick(() => { |  | ||||||
| 				this.$refs.eqDetail.init( |  | ||||||
| 					val.data.lineId, |  | ||||||
| 					this.listQuery.startTime, |  | ||||||
| 					this.listQuery.endTime |  | ||||||
| 				); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		handleCancel() { |  | ||||||
| 			this.addOrUpdateVisible = false; |  | ||||||
| 			this.addOrEditTitle = ''; |  | ||||||
| 		}, |  | ||||||
| 		handleConfirm() { |  | ||||||
| 			this.handleCancel(); |  | ||||||
| 		}, |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!-- | <!-- | ||||||
|  * @Author: zhp |  * @Author: zhp | ||||||
|  * @Date: 2023-09-13 09:02:25 |  * @Date: 2023-09-13 09:02:25 | ||||||
|  * @LastEditTime: 2024-11-26 15:52:29 |  * @LastEditTime: 2023-10-08 16:36:37 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| @@ -108,28 +108,13 @@ export default { | |||||||
|         }, |         }, | ||||||
|         series: [ |         series: [ | ||||||
|           { |           { | ||||||
|             name: '生产规格', |             name: '设备CT', | ||||||
|             data: dataList.ggData, |             data: dataList.eqData, | ||||||
|             type: 'line', |             type: 'line', | ||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             name: '设备理论速度', |             name: '产线CT', | ||||||
|             data: dataList.sbluData, |             data: dataList.plData, | ||||||
|             type: 'line', |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             name: '设备实际速度', |  | ||||||
|             data: dataList.sbsjData, |  | ||||||
|             type: 'line', |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             name: '产线理论速度', |  | ||||||
|             data: dataList.cxluData, |  | ||||||
|             type: 'line', |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             name: '产线实际速度', |  | ||||||
|             data: dataList.cxsjData, |  | ||||||
|             type: 'line', |             type: 'line', | ||||||
|           } |           } | ||||||
|         ] |         ] | ||||||
|   | |||||||
| @@ -1,15 +1,8 @@ | |||||||
| <template> | <template> | ||||||
|   <div class="app-container"> |   <div class="app-container"> | ||||||
| 		<search-bar |     <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | ||||||
| 			:formConfigs="formConfig" |  | ||||||
| 			ref="searchBarForm" |  | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
|     <div v-if="tableData.length"> |     <div v-if="tableData.length"> | ||||||
| 			<base-table |       <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData" /> | ||||||
| 				v-loading="dataListLoading" |  | ||||||
| 				:table-props="tableProps" |  | ||||||
| 				:max-height="tableH" |  | ||||||
| 				:table-data="tableData" /> |  | ||||||
|       <SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" /> |       <SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" /> | ||||||
|       <line-chart ref="lineChart" /> |       <line-chart ref="lineChart" /> | ||||||
|     </div> |     </div> | ||||||
| @@ -27,8 +20,7 @@ | |||||||
| import { parseTime } from '../../mixins/code-filter'; | import { parseTime } from '../../mixins/code-filter'; | ||||||
| import { getYieldAnalysisPageData } from '@/api/core/analysis/index'; | import { getYieldAnalysisPageData } from '@/api/core/analysis/index'; | ||||||
| import { getProductionLinePage } from '@/api/core/base/productionLine'; | import { getProductionLinePage } from '@/api/core/base/productionLine'; | ||||||
| import lineChart from '../LineChart'; | import lineChart from '../LineChart' | ||||||
| import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; |  | ||||||
| // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; | // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; | ||||||
|  |  | ||||||
| // const tableProps = [ | // const tableProps = [ | ||||||
| @@ -56,37 +48,36 @@ export default { | |||||||
|   components: { |   components: { | ||||||
|     lineChart, |     lineChart, | ||||||
|   }, |   }, | ||||||
| 	mixins: [tableHeightMixin], | 	// mixins: [basicPage], | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			urlOptions: { | 			urlOptions: { | ||||||
|         getDataListURL: getYieldAnalysisPageData, |         getDataListURL: getYieldAnalysisPageData, | ||||||
| 			}, | 			}, | ||||||
| 			tableProps: [], |       tableProps:[], | ||||||
| 			dataListLoading: false, |       dataListLoading:false, | ||||||
|       tableData: [], |       tableData: [], | ||||||
|       listQuery: { |       listQuery: { | ||||||
|         lineIds: [], |         lineIds: [], | ||||||
| 				time: '', |         time: '' | ||||||
|       }, |       }, | ||||||
|       dateLabelList: [], |       dateLabelList: [], | ||||||
| 			optionArrUrl: [getProductionLinePage], |       optionArrUrl: [getProductionLinePage ], | ||||||
| 			formConfig: [ | 			formConfig: [ | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| 					label: '产线', | 					label: '产线', | ||||||
| 					selectOptions: [], | 					selectOptions: [], | ||||||
|           param: 'lineIds', |           param: 'lineIds', | ||||||
| 					defaultSelect: [], |           defaultSelect: '', | ||||||
| 					multiple: true, |           multiple:true, | ||||||
| 					filterable: true, | 					filterable: true, | ||||||
| 					width: 400, |  | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'datePicker', | 					type: 'datePicker', | ||||||
| 					label: '时间', | 					label: '时间', | ||||||
| 					dateType: 'month', | 					dateType: 'month', | ||||||
| 					format: 'yyyy-MM', | 					format: 'yyyy-MM-dd', | ||||||
| 					valueFormat: 'yyyy-MM-dd HH:mm:ss', | 					valueFormat: 'yyyy-MM-dd HH:mm:ss', | ||||||
| 					rangeSeparator: '-', | 					rangeSeparator: '-', | ||||||
| 					startPlaceholder: '开始时间', | 					startPlaceholder: '开始时间', | ||||||
| @@ -98,7 +89,7 @@ export default { | |||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, | 				} | ||||||
| 			], | 			], | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| @@ -113,9 +104,9 @@ export default { | |||||||
| 			}; | 			}; | ||||||
| 			this.optionArrUrl.forEach((item, index) => { | 			this.optionArrUrl.forEach((item, index) => { | ||||||
| 				item(params).then((response) => { | 				item(params).then((response) => { | ||||||
| 					this.formConfig[index].selectOptions = response.data.list; | 					this.formConfig[index].selectOptions = response.data.list | ||||||
|           // this.formConfig[0].defaultSelect = response.data.list[0].id |           // this.formConfig[0].defaultSelect = response.data.list[0].id | ||||||
| 					// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id) |           this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id) | ||||||
| 				}); | 				}); | ||||||
| 			}); | 			}); | ||||||
|     }, |     }, | ||||||
| @@ -123,49 +114,51 @@ export default { | |||||||
|       // this.listQuery.lineIds = ['1672847052717821953'] |       // this.listQuery.lineIds = ['1672847052717821953'] | ||||||
|       // this.listQuery.productId = val.productId; |       // this.listQuery.productId = val.productId; | ||||||
|       // this.listQuery.time = '1694486098000'; |       // this.listQuery.time = '1694486098000'; | ||||||
| 			this.urlOptions.getDataListURL(this.listQuery).then((res) => { |       this.urlOptions.getDataListURL(this.listQuery).then(res => { | ||||||
|         let arr = [ |         let arr = [ | ||||||
|           	{ |           	{ | ||||||
|               prop: 'lineName', |               prop: 'lineName', | ||||||
|           		label: '产线', |           		label: '产线', | ||||||
| 						fixed: 'left', |               fixed: 'left' | ||||||
|           	}, |           	}, | ||||||
|             { |             { | ||||||
|               prop: 'sum', |               prop: 'sum', | ||||||
| 						label: '合计[片]', |               label: '合计', | ||||||
| 						fixed: 'left', |               fixed: 'left' | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|               prop: res.data ? res.data.nameData[0].name : undefined, |               prop: res.data ? res.data.nameData[0].name : undefined, | ||||||
|               label: res.data ? res.data.nameData[0].name : undefined, |               label: res.data ? res.data.nameData[0].name : undefined, | ||||||
|               align: 'center', |               align: 'center', | ||||||
| 						children: [], |               children:[ | ||||||
| 					}, |  | ||||||
| 				]; |  | ||||||
| 				// console.log(res.data.nameData.slice(1)) |  | ||||||
| 				let xData = []; |  | ||||||
| 				let yAllData = []; |  | ||||||
| 				let lineName = []; |  | ||||||
| 				if (res.data) { |  | ||||||
| 					let tempDateList = []; |  | ||||||
| 					res.data.nameData.forEach((date) => { |  | ||||||
| 						tempDateList.push(date.name); |  | ||||||
| 					}); |  | ||||||
| 					this.dateLabelList = Array.from(new Set(tempDateList)); |  | ||||||
|  |  | ||||||
| 					this.dateLabelList.forEach((item) => { |               ] | ||||||
|  |             } | ||||||
|  |         ] | ||||||
|  |         // console.log(res.data.nameData.slice(1)) | ||||||
|  |         let xData = [] | ||||||
|  |         let yAllData = [] | ||||||
|  |         let lineName = [] | ||||||
|  |         if (res.data) { | ||||||
|  |           let tempDateList = [] | ||||||
|  |           res.data.nameData.forEach(date => { | ||||||
|  |             tempDateList.push(date.name) | ||||||
|  |           }) | ||||||
|  |           this.dateLabelList = Array.from(new Set(tempDateList)) | ||||||
|  |  | ||||||
|  |           this.dateLabelList.forEach(item => { | ||||||
|             if (item.indexOf('年') === -1) { |             if (item.indexOf('年') === -1) { | ||||||
|               // 构造表头 |               // 构造表头 | ||||||
|               const props = { |               const props = { | ||||||
| 								prop: item, |                 'prop': item, | ||||||
| 								label: item, |                 'label': item | ||||||
| 							}; |               } | ||||||
| 							arr[2].children.push(props); |               arr[2].children.push(props) | ||||||
|  |  | ||||||
|               // 构造echarts横坐标 |               // 构造echarts横坐标 | ||||||
| 							xData.push(item); |               xData.push(item) | ||||||
|             } |             } | ||||||
| 					}); |           }) | ||||||
|           // res.data.nameData.slice(1).forEach(item => { |           // res.data.nameData.slice(1).forEach(item => { | ||||||
|           //   const props = { |           //   const props = { | ||||||
|           //     'prop': item.name, |           //     'prop': item.name, | ||||||
| @@ -174,23 +167,23 @@ export default { | |||||||
|           //   } |           //   } | ||||||
|           //   arr[2].children.push(props) |           //   arr[2].children.push(props) | ||||||
|           // }) |           // }) | ||||||
| 					let tableDataArr = []; |           let tableDataArr =[] | ||||||
| 					res.data.data.forEach((item) => { |           res.data.data.forEach(item => { | ||||||
| 						let obj = {}; |             let obj = {} | ||||||
| 						(obj.lineName = item.lineName), |             obj.lineName= item.lineName, | ||||||
| 							(obj.sum = item.sum), |             obj.sum= item.sum, | ||||||
|             item.data.forEach((ele, index) => { |             item.data.forEach((ele, index) => { | ||||||
|               // console.log(ele) |               // console.log(ele) | ||||||
|               ele.children.forEach((e) => { |               ele.children.forEach((e) => { | ||||||
| 									console.log(e.dynamicName); |                 console.log(e.dynamicName) | ||||||
| 									obj['' + e.dynamicName + ''] = e.dynamicValue; |                 obj['' + e.dynamicName + ''] = e.dynamicValue | ||||||
|                 console.log(obj['' + e.dynamicName + '']); |                 console.log(obj['' + e.dynamicName + '']); | ||||||
|  |               }) | ||||||
|  |             }) | ||||||
|  |             tableDataArr.push(obj) | ||||||
|           }); |           }); | ||||||
| 							}); |           this.tableData = tableDataArr | ||||||
| 						tableDataArr.push(obj); |           this.tableProps = arr | ||||||
| 					}); |  | ||||||
| 					this.tableData = tableDataArr; |  | ||||||
| 					this.tableProps = arr; |  | ||||||
|            |            | ||||||
|           // let tempList = [] |           // let tempList = [] | ||||||
|           // res.data.nameData.slice(1).forEach(item => { |           // res.data.nameData.slice(1).forEach(item => { | ||||||
| @@ -199,9 +192,9 @@ export default { | |||||||
|           // }) |           // }) | ||||||
|           // xData = Array.from(new Set(tempList)) |           // xData = Array.from(new Set(tempList)) | ||||||
|            |            | ||||||
| 					res.data.data.forEach((item) => { |           res.data.data.forEach(item => { | ||||||
| 						let yData = []; |             let yData = [] | ||||||
| 						lineName.push(item.lineName); |             lineName.push(item.lineName) | ||||||
|             // let obj = {} |             // let obj = {} | ||||||
|             // obj.lineName = item.lineName, |             // obj.lineName = item.lineName, | ||||||
|             //   obj.sum = item.sum, |             //   obj.sum = item.sum, | ||||||
| @@ -209,18 +202,18 @@ export default { | |||||||
|                 // console.log(ele) |                 // console.log(ele) | ||||||
|               ele.children.forEach((e) => { |               ele.children.forEach((e) => { | ||||||
|                 // let yData = [] |                 // let yData = [] | ||||||
| 								yData.push(e.dynamicValue); |                 yData.push(e.dynamicValue) | ||||||
|  |                 }) | ||||||
|  |               }) | ||||||
|  |             yAllData.push(yData) | ||||||
|           }); |           }); | ||||||
| 						}); |           console.log(lineName) | ||||||
| 						yAllData.push(yData); |  | ||||||
| 					}); |  | ||||||
| 					console.log(lineName); |  | ||||||
|         } else { |         } else { | ||||||
| 					this.tableProps = arr; |           this.tableProps = arr | ||||||
| 					this.tableData = []; |           this.tableData = [] | ||||||
| 					xData = []; |           xData = [] | ||||||
| 					yAllData = []; |           yAllData = [] | ||||||
| 					lineName = []; |           lineName = [] | ||||||
|         } |         } | ||||||
|         // res.data.data[0].data[0].children.forEach((item, index) => { |         // res.data.data[0].data[0].children.forEach((item, index) => { | ||||||
|         //   // console.log(item) |         //   // console.log(item) | ||||||
| @@ -229,9 +222,7 @@ export default { | |||||||
|         //   // obj['' + item.dynamicName + ''] = item.dynamicValue |         //   // obj['' + item.dynamicName + ''] = item.dynamicValue | ||||||
|         // }) |         // }) | ||||||
|         // console.log(this.yData) |         // console.log(this.yData) | ||||||
| 				this.$nextTick(() => { |         this.$refs.lineChart.initChart(xData, yAllData, lineName) | ||||||
| 					this.$refs.lineChart.initChart(xData, yAllData, lineName); |  | ||||||
| 				}); |  | ||||||
|         // this.total = response.data.total; |         // this.total = response.data.total; | ||||||
|         // this.dataListLoading = false; |         // this.dataListLoading = false; | ||||||
|       }); |       }); | ||||||
| @@ -239,19 +230,17 @@ export default { | |||||||
|     buttonClick(val) { |     buttonClick(val) { | ||||||
| 			switch (val.btnName) { | 			switch (val.btnName) { | ||||||
|         case 'search': |         case 'search': | ||||||
| 					this.listQuery.lineIds = val.lineIds ? val.lineIds : undefined; |           this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined | ||||||
|           // this.listQuery.productId = val.productId; |           // this.listQuery.productId = val.productId; | ||||||
| 					this.listQuery.time = val.time |           this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined | ||||||
| 						? new Date(val.time).getTime() |  | ||||||
| 						: undefined; |  | ||||||
| 					// this.listQuery.pageNo = 1; | 					// this.listQuery.pageNo = 1; | ||||||
|           // this.listQuery.pageSize = 10; |           // this.listQuery.pageSize = 10; | ||||||
|           if (val.time) { |           if (val.time) { | ||||||
| 						this.getData(); |             this.getData() | ||||||
|           } else { |           } else { | ||||||
|             this.$message({ |             this.$message({ | ||||||
|               message: '请选择时间', |               message: '请选择时间', | ||||||
| 							type: 'warning', |               type: 'warning' | ||||||
|             }); |             }); | ||||||
|           } |           } | ||||||
| 					break; | 					break; | ||||||
|   | |||||||
| @@ -27,7 +27,6 @@ | |||||||
| 			}"> | 			}"> | ||||||
| 			<el-upload | 			<el-upload | ||||||
| 				class="equipment-upload" | 				class="equipment-upload" | ||||||
| 				:style="{ marginBottom: isPicMode ? '48px' : '24px' }" |  | ||||||
| 				:disabled="disabled" | 				:disabled="disabled" | ||||||
| 				drag | 				drag | ||||||
| 				:action="uploadUrl" | 				:action="uploadUrl" | ||||||
| @@ -59,12 +58,9 @@ | |||||||
| 				<i class="el-icon-delete"></i> | 				<i class="el-icon-delete"></i> | ||||||
| 			</div> --> | 			</div> --> | ||||||
| 			<div | 			<div | ||||||
|  | 				class="file-list__item" | ||||||
| 				v-for="(file, index) in files" | 				v-for="(file, index) in files" | ||||||
| 				:key="file.fileName" | 				:key="file.fileName" | ||||||
| 				style="width: 100%"> |  | ||||||
| 				<div |  | ||||||
| 					class="file-list__item" |  | ||||||
| 					v-if="!isPicMode" |  | ||||||
| 				:style="{ | 				:style="{ | ||||||
| 					background: isPicMode | 					background: isPicMode | ||||||
| 						? `url(${file.fileUrl}) no-repeat` | 						? `url(${file.fileUrl}) no-repeat` | ||||||
| @@ -72,7 +68,6 @@ | |||||||
| 					backgroundSize: isPicMode ? '100% 100%' : '64px', | 					backgroundSize: isPicMode ? '100% 100%' : '64px', | ||||||
| 					backgroundPosition: isPicMode ? '0% 0%' : 'center', | 					backgroundPosition: isPicMode ? '0% 0%' : 'center', | ||||||
| 				}" | 				}" | ||||||
| 					@click="handleDownload(file)" |  | ||||||
| 				:data-name="file.fileName"> | 				:data-name="file.fileName"> | ||||||
| 				<el-button | 				<el-button | ||||||
| 					v-if="!disabled" | 					v-if="!disabled" | ||||||
| @@ -81,14 +76,6 @@ | |||||||
| 					style="padding: 0" | 					style="padding: 0" | ||||||
| 					@click="(e) => handleDelete(file)" /> | 					@click="(e) => handleDelete(file)" /> | ||||||
| 			</div> | 			</div> | ||||||
|  |  | ||||||
| 				<el-image |  | ||||||
| 					v-else |  | ||||||
| 					class="file-list__item" |  | ||||||
| 					style="width: 100%" |  | ||||||
| 					:src="file.fileUrl" |  | ||||||
| 					:preview-src-list="files.map((item) => item.fileUrl)"></el-image> |  | ||||||
|         </div> |  | ||||||
| 		</section> | 		</section> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| @@ -229,7 +216,7 @@ export default { | |||||||
| 				response.data == null || | 				response.data == null || | ||||||
| 				response.data.trim() == '' | 				response.data.trim() == '' | ||||||
| 			) { | 			) { | ||||||
| 				this.$message.warning('上传出错了!'); | 				this.$message.error('上传出错了!'); | ||||||
| 				return; | 				return; | ||||||
| 			} | 			} | ||||||
| 			this.files.push({ | 			this.files.push({ | ||||||
| @@ -289,32 +276,6 @@ export default { | |||||||
| 			// Array | 			// Array | ||||||
| 			this.$emit('update-filelist', this.appendFilelist); | 			this.$emit('update-filelist', this.appendFilelist); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		async handleDownload(file) { |  | ||||||
| 			if (this.isPicMode) { |  | ||||||
| 				// this.$emit('preview', file); |  | ||||||
| 				const link = document.createElement('a'); |  | ||||||
| 				link.href = file.fileUrl; |  | ||||||
| 				link.target = '_blank'; |  | ||||||
| 				document.body.appendChild(link); |  | ||||||
| 				link.click(); |  | ||||||
| 				document.body.removeChild(link); |  | ||||||
| 			} else { |  | ||||||
| 				// this.$emit('download', file); |  | ||||||
| 				const data = await this.$axios({ |  | ||||||
| 					url: file.fileUrl, |  | ||||||
| 					method: 'get', |  | ||||||
| 					responseType: 'blob', |  | ||||||
| 				}); |  | ||||||
| 				const link = document.createElement('a'); |  | ||||||
| 				link.href = window.URL.createObjectURL(new Blob([data])); |  | ||||||
| 				link.download = file.fileName; |  | ||||||
| 				document.body.appendChild(link); |  | ||||||
| 				link.click(); |  | ||||||
| 				document.body.removeChild(link); |  | ||||||
| 				window.URL.revokeObjectURL(link.href); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ | |||||||
| 					<el-date-picker | 					<el-date-picker | ||||||
| 						v-if="col.datetime" | 						v-if="col.datetime" | ||||||
| 						v-model="form[col.prop]" | 						v-model="form[col.prop]" | ||||||
| 						type="date" | 						type="datetime" | ||||||
| 						:placeholder="`请选择${col.label}`" | 						:placeholder="`请选择${col.label}`" | ||||||
| 						value-format="timestamp" | 						value-format="timestamp" | ||||||
| 						v-bind="col.bind"></el-date-picker> | 						v-bind="col.bind"></el-date-picker> | ||||||
|   | |||||||
| @@ -308,7 +308,6 @@ export default { | |||||||
| 				}); | 				}); | ||||||
| 				if (code == 0) { | 				if (code == 0) { | ||||||
| 					this.$modal.msgSuccess('更新成功'); | 					this.$modal.msgSuccess('更新成功'); | ||||||
|           this.$emit('refreshDataList'); |  | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				this.btnLoading = false; | 				this.btnLoading = false; | ||||||
| @@ -362,7 +361,7 @@ export default { | |||||||
|  |  | ||||||
| 		// 新增属性 | 		// 新增属性 | ||||||
| 		handleAddAttr() { | 		handleAddAttr() { | ||||||
| 			if (!this.dataId) return this.$message.warning('请先创建设备信息'); | 			if (!this.dataId) return this.$message.error('请先创建设备信息'); | ||||||
| 			this.attrForm = { | 			this.attrForm = { | ||||||
| 				id: null, | 				id: null, | ||||||
| 				equipmentId: this.dataId, | 				equipmentId: this.dataId, | ||||||
|   | |||||||
| @@ -57,7 +57,6 @@ | |||||||
| 						v-model="form.equipmentTypeId" | 						v-model="form.equipmentTypeId" | ||||||
| 						:disabled="disabled" | 						:disabled="disabled" | ||||||
| 						filterable | 						filterable | ||||||
|             clearable |  | ||||||
| 						placeholder="请选择设备类型"> | 						placeholder="请选择设备类型"> | ||||||
| 						<el-option | 						<el-option | ||||||
| 							v-for="eqType in eqTypeList" | 							v-for="eqType in eqTypeList" | ||||||
| @@ -80,9 +79,9 @@ | |||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| 				<el-form-item label="生产日期" prop="productionTime" :rules="[]"> | 				<el-form-item label="生产日期" prop="productionTime" :rules="[]"> | ||||||
| 					<el-date-picker | 					<el-date-picker | ||||||
| 						v-model="form.productionTime" | 						v-model="form.enterTime" | ||||||
| 						:disabled="disabled" | 						:disabled="disabled" | ||||||
| 						type="date" | 						type="datetime" | ||||||
| 						placeholder="请选择生产日期" | 						placeholder="请选择生产日期" | ||||||
| 						value-format="timestamp"></el-date-picker> | 						value-format="timestamp"></el-date-picker> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| @@ -92,14 +91,14 @@ | |||||||
| 					<el-date-picker | 					<el-date-picker | ||||||
| 						v-model="form.enterTime" | 						v-model="form.enterTime" | ||||||
| 						:disabled="disabled" | 						:disabled="disabled" | ||||||
| 						type="date" | 						type="datetime" | ||||||
| 						placeholder="请选择进场日期" | 						placeholder="请选择进场日期" | ||||||
| 						value-format="timestamp"></el-date-picker> | 						value-format="timestamp"></el-date-picker> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| 				<el-form-item | 				<el-form-item | ||||||
| 					label="设备理论生产能效(片/min)" | 					label="设备TT值" | ||||||
| 					prop="tvalue" | 					prop="tvalue" | ||||||
| 					:rules="[ | 					:rules="[ | ||||||
| 						{ required: true, message: '不能为空', trigger: 'blur' }, | 						{ required: true, message: '不能为空', trigger: 'blur' }, | ||||||
| @@ -113,7 +112,7 @@ | |||||||
| 					<el-input | 					<el-input | ||||||
| 						v-model="form.tvalue" | 						v-model="form.tvalue" | ||||||
| 						:disabled="disabled" | 						:disabled="disabled" | ||||||
| 						placeholder="请输入"></el-input> | 						placeholder="请输入设备TT值"></el-input> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 		</el-row> | 		</el-row> | ||||||
| @@ -284,7 +283,7 @@ export default { | |||||||
| 		async getEqTypeList() { | 		async getEqTypeList() { | ||||||
| 			this.formLoading = true; | 			this.formLoading = true; | ||||||
| 			const { code, data } = await this.$axios( | 			const { code, data } = await this.$axios( | ||||||
| 				'/base/equipment-type/page?pageNo=1&pageSize=100' | 				'/base/core-equipment-type/page?pageNo=1&pageSize=100' | ||||||
| 			); | 			); | ||||||
| 			// debugger; | 			// debugger; | ||||||
| 			if (code == 0) { | 			if (code == 0) { | ||||||
| @@ -317,7 +316,7 @@ export default { | |||||||
| 				this.form | 				this.form | ||||||
| 			); | 			); | ||||||
| 			// 保存原始文件名 | 			// 保存原始文件名 | ||||||
| 			if ('fileNames' in this.form) this.form.fileNames.push(file.name+Date.now()); | 			if ('fileNames' in this.form) this.form.fileNames.push(file.name); | ||||||
| 			// 保存完整地址 | 			// 保存完整地址 | ||||||
| 			if ('fileUrls' in this.form) this.form.fileUrls.push(response.data); | 			if ('fileUrls' in this.form) this.form.fileUrls.push(response.data); | ||||||
| 			this.$modal.msgSuccess('上传成功'); | 			this.$modal.msgSuccess('上传成功'); | ||||||
|   | |||||||
| @@ -38,15 +38,14 @@ | |||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			width="60%" | 			width="60%" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm1 | 			<DialogForm | ||||||
| 				v-if="open" | 				v-if="open" | ||||||
| 				key="index-dialog-form" | 				key="index-dialog-form" | ||||||
| 				ref="form" | 				ref="form" | ||||||
| 				label-position="top" | 				label-position="top" | ||||||
| 				size="small" | 				size="small" | ||||||
| 				v-model="form" | 				:dataForm="form" | ||||||
| 				:rows="computedRows" | 				:rows="computedRows" /> | ||||||
| 				:has-file="true" /> |  | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
|  |  | ||||||
| 		<!-- 设备 详情 - 编辑 --> | 		<!-- 设备 详情 - 编辑 --> | ||||||
| @@ -61,9 +60,9 @@ | |||||||
| 					name: '基本信息', | 					name: '基本信息', | ||||||
| 					key: 'base', | 					key: 'base', | ||||||
| 					rows: computedRows, | 					rows: computedRows, | ||||||
| 					url: '/base/equipment/get', | 					url: '/base/core-equipment/get', | ||||||
| 					urlUpdate: '/base/equipment/update', | 					urlUpdate: '/base/core-equipment/update', | ||||||
| 					urlCreate: '/base/equipment/create', | 					urlCreate: '/base/core-equipment/create', | ||||||
| 					queryParams: { id: form.id }, | 					queryParams: { id: form.id }, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| @@ -78,7 +77,7 @@ | |||||||
| 					queryParams: { | 					queryParams: { | ||||||
| 						equipmentId: form.id, | 						equipmentId: form.id, | ||||||
| 						pageNo: 1, | 						pageNo: 1, | ||||||
| 						pageSize: 20, | 						pageSize: 10, | ||||||
| 					}, | 					}, | ||||||
| 					tableBtn: [ | 					tableBtn: [ | ||||||
| 						this.$auth.hasPermi('base:equipment-attr:update') | 						this.$auth.hasPermi('base:equipment-attr:update') | ||||||
| @@ -107,7 +106,6 @@ | |||||||
| import moment from 'moment'; | import moment from 'moment'; | ||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||||
| import EquipmentDrawer from './components/EquipmentDrawer'; | import EquipmentDrawer from './components/EquipmentDrawer'; | ||||||
| import DialogForm1 from './components/DialogForm'; |  | ||||||
|  |  | ||||||
| import { | import { | ||||||
| 	createEquipment, | 	createEquipment, | ||||||
| @@ -125,7 +123,6 @@ export default { | |||||||
| 	components: { | 	components: { | ||||||
| 		Editor, | 		Editor, | ||||||
| 		EquipmentDrawer, | 		EquipmentDrawer, | ||||||
| 		DialogForm1, |  | ||||||
| 	}, | 	}, | ||||||
| 	mixins: [basicPageMixin], | 	mixins: [basicPageMixin], | ||||||
| 	data() { | 	data() { | ||||||
| @@ -159,12 +156,7 @@ export default { | |||||||
| 					width: 180, | 					width: 180, | ||||||
| 					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | 					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ prop: 'name', label: '设备名称' }, | ||||||
| 					width: 200, |  | ||||||
| 					showOverflowtooltip: true, |  | ||||||
| 					prop: 'name', |  | ||||||
| 					label: '设备名称', |  | ||||||
| 				}, |  | ||||||
| 				{ width: 256, prop: 'code', label: '设备编码' }, | 				{ width: 256, prop: 'code', label: '设备编码' }, | ||||||
| 				{ prop: 'equipmentType', label: '设备类型' }, | 				{ prop: 'equipmentType', label: '设备类型' }, | ||||||
| 				{ prop: 'enName', label: '英文名称' }, | 				{ prop: 'enName', label: '英文名称' }, | ||||||
| @@ -222,7 +214,8 @@ export default { | |||||||
| 					type: this.$auth.hasPermi('base:equipment:export') ? 'button' : '', | 					type: this.$auth.hasPermi('base:equipment:export') ? 'button' : '', | ||||||
| 					btnName: '导出', | 					btnName: '导出', | ||||||
| 					name: 'export', | 					name: 'export', | ||||||
| 					color: 'warning', | 					plain: true, | ||||||
|  | 					color: 'primary', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: this.$auth.hasPermi('base:equipment:create') ? 'button' : '', | 					type: this.$auth.hasPermi('base:equipment:create') ? 'button' : '', | ||||||
| @@ -247,7 +240,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '设备编码', | 						label: '设备编码', | ||||||
| 						prop: 'code', | 						prop: 'code', | ||||||
| 						url: '/base/equipment/getCode', | 						url: '/base/core-equipment/getCode', | ||||||
| 					}, | 					}, | ||||||
| 					{ | 					{ | ||||||
| 						input: true, | 						input: true, | ||||||
| @@ -274,10 +267,9 @@ export default { | |||||||
| 						select: true, | 						select: true, | ||||||
| 						label: '设备类型', | 						label: '设备类型', | ||||||
| 						prop: 'equipmentTypeId', | 						prop: 'equipmentTypeId', | ||||||
| 						url: '/base/equipment-type/page?pageNo=1&pageSize=100', | 						url: '/base/core-equipment-type/page?pageNo=1&pageSize=100', | ||||||
| 						bind: { | 						bind: { | ||||||
| 							filterable: true, | 							filterable: true, | ||||||
| 							clearable: true, |  | ||||||
| 						}, | 						}, | ||||||
| 					}, | 					}, | ||||||
| 					// { | 					// { | ||||||
| @@ -302,7 +294,7 @@ export default { | |||||||
| 					{ | 					{ | ||||||
| 						input: true, | 						input: true, | ||||||
| 						prop: 'tvalue', | 						prop: 'tvalue', | ||||||
| 						label: '设备理论生产能效(片/min)', | 						label: '设备TT值', | ||||||
| 						rules: [ | 						rules: [ | ||||||
| 							{ required: true, message: '不能为空', trigger: 'blur' }, | 							{ required: true, message: '不能为空', trigger: 'blur' }, | ||||||
| 							{ | 							{ | ||||||
| @@ -443,7 +435,7 @@ export default { | |||||||
| 			// 查询参数 | 			// 查询参数 | ||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				pageNo: 1, | 				pageNo: 1, | ||||||
| 				pageSize: 20, | 				pageSize: 10, | ||||||
| 				code: '', | 				code: '', | ||||||
| 				name: '', | 				name: '', | ||||||
| 			}, | 			}, | ||||||
| @@ -569,7 +561,6 @@ export default { | |||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
| 				// 添加的提交 | 				// 添加的提交 | ||||||
| 				this.form.files = []; |  | ||||||
| 				createEquipment(this.form).then((response) => { | 				createEquipment(this.form).then((response) => { | ||||||
| 					this.$modal.msgSuccess('新增成功'); | 					this.$modal.msgSuccess('新增成功'); | ||||||
| 					this.open = false; | 					this.open = false; | ||||||
|   | |||||||
| @@ -37,12 +37,7 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm | 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> | ||||||
| 				v-if="open" |  | ||||||
| 				ref="form" |  | ||||||
| 				v-model="form" |  | ||||||
| 				:rows="rows" |  | ||||||
| 				:has-file="true" /> |  | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| @@ -144,7 +139,7 @@ export default { | |||||||
| 						input: true, | 						input: true, | ||||||
| 						label: '设备类型编码', | 						label: '设备类型编码', | ||||||
| 						prop: 'code', | 						prop: 'code', | ||||||
| 						url: '/base/equipment-type/getCode', | 						url: '/base/core-equipment-type/getCode', | ||||||
| 					}, | 					}, | ||||||
| 				], | 				], | ||||||
| 				[ | 				[ | ||||||
| @@ -152,10 +147,7 @@ export default { | |||||||
| 						select: true, | 						select: true, | ||||||
| 						label: '父类', | 						label: '父类', | ||||||
| 						prop: 'parentId', | 						prop: 'parentId', | ||||||
| 						url: '/base/equipment-type/page?pageNo=1&pageSize=100', | 						url: '/base/core-equipment-type/page?pageNo=1&pageSize=100', | ||||||
| 						bind: { |  | ||||||
| 							clearable: true, // some condition, like detail mode... |  | ||||||
| 						} |  | ||||||
| 					}, | 					}, | ||||||
| 					{}, | 					{}, | ||||||
| 				], | 				], | ||||||
| @@ -240,6 +232,25 @@ export default { | |||||||
| 			const id = row.id; | 			const id = row.id; | ||||||
| 			getEquipmentType(id).then((response) => { | 			getEquipmentType(id).then((response) => { | ||||||
| 				this.form = response.data; | 				this.form = response.data; | ||||||
|  | 				// this.form = { | ||||||
|  | 				// 	code: 'SBLX20230925184444000041', | ||||||
|  | 				// 	name: '测试131', | ||||||
|  | 				// 	remark: '测试可删除', | ||||||
|  | 				// 	id: '1706258479729336322', | ||||||
|  | 				// 	files: [ | ||||||
|  | 				// 		{ fileName: '1.png', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: '1.asdfaslkjfkasdf.png', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: '2.txt', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: '1.rar', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: '1.kkk', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: 'test.file', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: '222', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 		{ fileName: 'g', fileUrl: '', fileType: 2 }, | ||||||
|  | 				// 	], | ||||||
|  | 				// 	createTime: 1695638697000, | ||||||
|  | 				// 	parentId: '1701869972319584257', | ||||||
|  | 				// }; | ||||||
|  | 				// debugger; | ||||||
| 				this.open = true; | 				this.open = true; | ||||||
| 				this.title = '修改设备类型'; | 				this.title = '修改设备类型'; | ||||||
| 			}); | 			}); | ||||||
|   | |||||||
| @@ -1,99 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-08-02 15:12:42 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2024-11-29 13:25:51 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<search-bar |  | ||||||
| 			:formConfigs="[{ label: '产线在制工艺', type: 'title' }]" |  | ||||||
| 			ref="searchBarForm" /> |  | ||||||
| 		<base-table |  | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="listQuery.pageNo" |  | ||||||
| 			:limit="listQuery.pageSize" |  | ||||||
| 			:table-data="tableData" |  | ||||||
| 			@emitFun="inputChange" /> |  | ||||||
| 		<pagination |  | ||||||
| 			:limit.sync="listQuery.pageSize" |  | ||||||
| 			:page.sync="listQuery.pageNo" |  | ||||||
| 			:total="listQuery.total" |  | ||||||
| 			@pagination="getDataList" /> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicPage from '../../mixins/basic-page'; |  | ||||||
| import { parseTime } from '../../mixins/code-filter'; |  | ||||||
| import { getLineBindProcessPage } from '@/api/core/base/lineBindProcess'; |  | ||||||
| import selectProduct from './selectProduct'; |  | ||||||
|  |  | ||||||
| const tableProps = [ |  | ||||||
| 	{ |  | ||||||
| 		prop: 'lineName', |  | ||||||
| 		label: '产线' |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'processDictName', |  | ||||||
| 		label: '在制工艺', |  | ||||||
| 		list: [], |  | ||||||
| 		subcomponent: selectProduct, |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'recordTime', |  | ||||||
| 		label: '开始时间', |  | ||||||
| 		filter: parseTime, |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicPage, selectProduct], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getLineBindProcessPage, |  | ||||||
| 			}, |  | ||||||
| 			tableProps, |  | ||||||
| 			tableData: [], |  | ||||||
| 			// formConfig: [ |  | ||||||
| 			// 	{ |  | ||||||
| 			// 		type: 'button', |  | ||||||
| 			// 		btnName: '同步', |  | ||||||
| 			// 		name: 'search', |  | ||||||
| 			// 		color: 'primary', |  | ||||||
| 			// 	}, |  | ||||||
| 			// ], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	components: {}, |  | ||||||
| 	created() { |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
|     // 获取数据列表 |  | ||||||
|     getDataList() { |  | ||||||
|       this.dataListLoading = true; |  | ||||||
|       this.urlOptions.getDataListURL(this.listQuery).then(response => { |  | ||||||
|         this.tableData = response.data; |  | ||||||
|         this.dataListLoading = false; |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.listQuery.pageNo = 1; |  | ||||||
| 					this.listQuery.pageSize = 10; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		inputChange() { |  | ||||||
| 			this.getDataList(); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,83 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zwq |  | ||||||
|  * @Date: 2023-08-03 14:09:18 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @LastEditTime: 2025-02-24 15:21:07 |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<div class="tableInner"> |  | ||||||
| 		<el-popover |  | ||||||
| 			placement="top" |  | ||||||
| 			title="切换在制工艺" |  | ||||||
| 			width="160" |  | ||||||
| 			v-model="visible"> |  | ||||||
| 			<el-select v-model="list.processDict" style="margin: 5px" filterable> |  | ||||||
| 				<el-option |  | ||||||
| 					v-for="opt in getDictDatas(DICT_TYPE.PROCESS_TYPE)" |  | ||||||
| 					:key="opt.value" |  | ||||||
| 					:label="opt.label" |  | ||||||
| 					:value="opt.value"></el-option> |  | ||||||
| 			</el-select> |  | ||||||
| 			<div style="text-align: right; margin: 0"> |  | ||||||
| 				<el-button size="mini" type="text" @click="visible = false"> |  | ||||||
| 					取消 |  | ||||||
| 				</el-button> |  | ||||||
| 				<el-button type="primary" size="mini" @click="changeInput"> |  | ||||||
| 					确定 |  | ||||||
| 				</el-button> |  | ||||||
| 			</div> |  | ||||||
| 			<el-button type="text" slot="reference"> |  | ||||||
| 				<svg-icon icon-class="changelogo" /> |  | ||||||
| 			</el-button> |  | ||||||
| 		</el-popover> |  | ||||||
| 		<el-input |  | ||||||
| 			readonly |  | ||||||
| 			v-model="list.processDictName" |  | ||||||
| 			style="width: 50%; margin-left: 5px"></el-input> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
| <script> |  | ||||||
| import { switchLineBindProcess } from '@/api/core/base/lineBindProcess'; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	props: { |  | ||||||
| 		injectData: { |  | ||||||
| 			type: Object, |  | ||||||
| 			default: () => ({}), |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			list: this.injectData, |  | ||||||
| 			visible: false, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	mounted() { |  | ||||||
|   }, |  | ||||||
| 	methods: { |  | ||||||
| 		changeInput() { |  | ||||||
|       const processDictName = this.getDictDatas(this.DICT_TYPE.PROCESS_TYPE).find(item=> |  | ||||||
|         item.value == this.list.processDict |  | ||||||
|     ) |  | ||||||
| 			const data = { |  | ||||||
| 				id: this.list.id, |  | ||||||
| 				processDict: this.list.processDict, |  | ||||||
| 				processDictName: processDictName.label, |  | ||||||
| 			}; |  | ||||||
| 			switchLineBindProcess(data).then((response) => { |  | ||||||
| 				this.$modal.msgSuccess('修改成功'); |  | ||||||
| 				this.visible = false; |  | ||||||
| 				this.$emit('emitData'); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| <style scoped> |  | ||||||
| .tableInner .el-input__inner { |  | ||||||
| 	border: none; |  | ||||||
| 	padding: 0; |  | ||||||
| 	height: 33px; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,164 +0,0 @@ | |||||||
| <template> |  | ||||||
| 	<div class="app-container"> |  | ||||||
| 		<search-bar |  | ||||||
| 			:formConfigs="formConfig" |  | ||||||
| 			ref="searchBarForm" |  | ||||||
| 			@select-changed="handleSearchBarChanged" |  | ||||||
| 			@headBtnClick="buttonClick" /> |  | ||||||
| 		<base-table |  | ||||||
| 			v-loading="dataListLoading" |  | ||||||
| 			:table-props="tableProps" |  | ||||||
| 			:page="listQuery.pageNo" |  | ||||||
| 			:limit="listQuery.pageSize" |  | ||||||
| 			:table-data="tableData" /> |  | ||||||
| 		<pagination |  | ||||||
| 			:limit.sync="listQuery.pageSize" |  | ||||||
| 			:page.sync="listQuery.pageNo" |  | ||||||
| 			:total="listQuery.total" |  | ||||||
| 			@pagination="getDataList" /> |  | ||||||
| 	</div> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import basicPage from '../../mixins/basic-page'; |  | ||||||
| import { parseTime } from '../../mixins/code-filter'; |  | ||||||
| import { getLineBindProcessLogPage } from '@/api/core/base/lineBindProcess'; |  | ||||||
| import { getProductionLinePage } from '@/api/core/base/productionLine'; |  | ||||||
| import { getPdList } from '@/api/core/monitoring/auto'; |  | ||||||
| import { getFactoryPage } from '@/api/core/base/factory'; |  | ||||||
|  |  | ||||||
| const tableProps = [ |  | ||||||
| 	{ |  | ||||||
| 		prop: 'factoryName', |  | ||||||
| 		label: '工厂' |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'lineName', |  | ||||||
| 		label: '产线', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'processDictName', |  | ||||||
| 		label: '在制工艺', |  | ||||||
| 	}, |  | ||||||
| 	{ |  | ||||||
| 		prop: 'recordTime', |  | ||||||
| 		label: '开始时间', |  | ||||||
| 		filter: parseTime, |  | ||||||
| 	}, |  | ||||||
| ]; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
| 	mixins: [basicPage], |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				getDataListURL: getLineBindProcessLogPage, |  | ||||||
| 			}, |  | ||||||
| 			tableProps, |  | ||||||
| 			tableData: [], |  | ||||||
| 			optionArrUrl: [getFactoryPage,getProductionLinePage], |  | ||||||
| 			listQuery: { |  | ||||||
| 				productionLineId: [], |  | ||||||
| 			}, |  | ||||||
| 			formConfig: [ |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '工厂', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'factoryId', |  | ||||||
| 					onchange: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '产线', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'productionLineId', |  | ||||||
| 					multiple: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '在制工艺', |  | ||||||
| 					selectOptions: this.getDictDatas(this.DICT_TYPE.PROCESS_TYPE), |  | ||||||
| 					labelField: 'label', |  | ||||||
| 					valueField: 'value', |  | ||||||
| 					param: 'processDict', |  | ||||||
| 					defaultSelect: '', |  | ||||||
| 					filterable: true, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'datePicker', |  | ||||||
| 					label: '时间', |  | ||||||
| 					dateType: 'daterange', |  | ||||||
| 					format: 'yyyy-MM-dd', |  | ||||||
| 					valueFormat: 'yyyy-MM-dd HH:mm:ss', |  | ||||||
| 					rangeSeparator: '-', |  | ||||||
| 					startPlaceholder: '开始时间', |  | ||||||
| 					endPlaceholder: '结束时间', |  | ||||||
| 					param: 'startTime', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '搜索', |  | ||||||
| 					name: 'search', |  | ||||||
| 					color: 'primary', |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					type: 'button', |  | ||||||
| 					btnName: '重置', |  | ||||||
| 					name: 'reset', |  | ||||||
| 				}, |  | ||||||
| 			], |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	components: {}, |  | ||||||
| 	created() { |  | ||||||
| 		this.getArr(); |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		handleSearchBarChanged({ param, value }) { |  | ||||||
| 			this.listQuery.productionLineId = []; |  | ||||||
| 			this.$refs.searchBarForm.formInline.productionLineId = undefined; |  | ||||||
| 			getPdList(value).then((res) => { |  | ||||||
| 				this.formConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		getArr() { |  | ||||||
| 			const params = { |  | ||||||
| 				page: 1, |  | ||||||
| 				limit: 500, |  | ||||||
| 			}; |  | ||||||
| 			this.optionArrUrl.forEach((item, index) => { |  | ||||||
| 				item(params).then((response) => { |  | ||||||
| 					this.formConfig[index].selectOptions = response.data.list; |  | ||||||
| 				}); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		buttonClick(val) { |  | ||||||
| 			switch (val.btnName) { |  | ||||||
| 				case 'search': |  | ||||||
| 					this.listQuery.pageNo = 1; |  | ||||||
| 					this.listQuery.pageSize = 10; |  | ||||||
| 					this.listQuery.factoryId = val.factoryId || undefined; |  | ||||||
| 					this.listQuery.productionLineId = val.productionLineId || []; |  | ||||||
| 					this.listQuery.processDict = val.processDict; |  | ||||||
| 					this.listQuery.recordTime = val.startTime |  | ||||||
| 						? [val.startTime[0], val.startTime[1].substr(0, 10) + ' 23:59:59'] |  | ||||||
| 						: null; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				case 'reset': |  | ||||||
| 					this.$refs.searchBarForm.resetForm(); |  | ||||||
| 					this.listQuery = { |  | ||||||
| 						pageSize: 10, |  | ||||||
| 						pageNo: 1, |  | ||||||
| 						total: 1, |  | ||||||
| 					}; |  | ||||||
| 					this.getDataList(); |  | ||||||
| 					break; |  | ||||||
| 				default: |  | ||||||
| 					console.log(val); |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| <!-- |  | ||||||
|  * @Author: zhp |  | ||||||
|  * @Date: 2023-01-31 14:12:10 |  | ||||||
|  * @LastEditTime: 2024-11-29 10:49:37 |  | ||||||
|  * @LastEditors: zwq |  | ||||||
|  * @Description: |  | ||||||
| --> |  | ||||||
| <template> |  | ||||||
| 	<span> |  | ||||||
| 		<el-switch |  | ||||||
| 			@change="changeStatus" |  | ||||||
| 			v-model="injectData.allowAuto" |  | ||||||
| 			:active-value="true" |  | ||||||
| 			:inactive-value="false"></el-switch> |  | ||||||
| 	</span> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <script> |  | ||||||
| import { switchAutoProduct } from '@/api/core/base/lineBindProduct'; |  | ||||||
| export default { |  | ||||||
| 	props: { |  | ||||||
| 		injectData: { |  | ||||||
| 			type: Object, |  | ||||||
| 			default: () => ({}), |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	data() { |  | ||||||
| 		return { |  | ||||||
| 			urlOptions: { |  | ||||||
| 				submitURL: switchAutoProduct, |  | ||||||
| 			}, |  | ||||||
| 		}; |  | ||||||
| 	}, |  | ||||||
| 	methods: { |  | ||||||
| 		// 子级 |  | ||||||
| 		changeStatus() { |  | ||||||
| 			// 路由参数 |  | ||||||
| 			let obj = { |  | ||||||
| 				allowAuto: this.injectData.allowAuto, |  | ||||||
| 				id: this.injectData.id, |  | ||||||
| 			}; |  | ||||||
| 			this.urlOptions.submitURL(obj).then((res) => { |  | ||||||
|         console.log(res) |  | ||||||
| 				if (res.code !== 0) { |  | ||||||
| 					return this.$message.error(res.msg); |  | ||||||
| 				} |  | ||||||
| 				this.$modal.msgSuccess('切换状态成功'); |  | ||||||
| 				this.$emit('emitData'); |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!-- | <!-- | ||||||
|  * @Author: zwq |  * @Author: zwq | ||||||
|  * @Date: 2023-08-02 15:12:42 |  * @Date: 2023-08-02 15:12:42 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @LastEditTime: 2024-11-29 10:47:46 |  * @LastEditTime: 2023-10-13 16:35:03 | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| @@ -30,7 +30,6 @@ import basicPage from '../../mixins/basic-page'; | |||||||
| import { parseTime } from '../../mixins/code-filter'; | import { parseTime } from '../../mixins/code-filter'; | ||||||
| import { getLineBindProductPage } from '@/api/core/base/lineBindProduct'; | import { getLineBindProductPage } from '@/api/core/base/lineBindProduct'; | ||||||
| import selectProduct from './selectProduct'; | import selectProduct from './selectProduct'; | ||||||
| import changeStatus from './changeStatus'; |  | ||||||
| import { getProductPage } from '@/api/core/base/product'; | import { getProductPage } from '@/api/core/base/product'; | ||||||
|  |  | ||||||
| const tableProps = [ | const tableProps = [ | ||||||
| @@ -44,11 +43,6 @@ const tableProps = [ | |||||||
| 		list: [], | 		list: [], | ||||||
| 		subcomponent: selectProduct, | 		subcomponent: selectProduct, | ||||||
| 	}, | 	}, | ||||||
| 	{ |  | ||||||
| 		prop: 'allowAuto', |  | ||||||
| 		label: '允许自动', |  | ||||||
| 		subcomponent: changeStatus, |  | ||||||
| 	}, |  | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'recordTime', | 		prop: 'recordTime', | ||||||
| 		label: '开始时间', | 		label: '开始时间', | ||||||
|   | |||||||
| @@ -3,7 +3,6 @@ | |||||||
| 		<search-bar | 		<search-bar | ||||||
| 			:formConfigs="formConfig" | 			:formConfigs="formConfig" | ||||||
| 			ref="searchBarForm" | 			ref="searchBarForm" | ||||||
| 			@select-changed="handleSearchBarChanged" |  | ||||||
| 			@headBtnClick="buttonClick" /> | 			@headBtnClick="buttonClick" /> | ||||||
| 		<base-table | 		<base-table | ||||||
| 			v-loading="dataListLoading" | 			v-loading="dataListLoading" | ||||||
| @@ -25,21 +24,15 @@ import { parseTime } from '../../mixins/code-filter'; | |||||||
| import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog'; | import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog'; | ||||||
| import { getProductionLinePage } from '@/api/core/base/productionLine'; | import { getProductionLinePage } from '@/api/core/base/productionLine'; | ||||||
| import { getProductPage } from '@/api/core/base/product'; | import { getProductPage } from '@/api/core/base/product'; | ||||||
| import { getFactoryPage } from '@/api/core/base/factory'; |  | ||||||
| import { getPdList } from '@/api/core/monitoring/auto'; |  | ||||||
|  |  | ||||||
| const tableProps = [ | const tableProps = [ | ||||||
| 	{ |  | ||||||
| 		prop: 'factoryName', |  | ||||||
| 		label: '工厂' |  | ||||||
| 	}, |  | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'productionLineName', | 		prop: 'productionLineName', | ||||||
| 		label: '产线', | 		label: '产线' | ||||||
| 	}, | 	}, | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'productName', | 		prop: 'productName', | ||||||
| 		label: '在制产品', | 		label: '在制产品' | ||||||
| 	}, | 	}, | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'startTime', | 		prop: 'startTime', | ||||||
| @@ -62,24 +55,15 @@ export default { | |||||||
| 			}, | 			}, | ||||||
| 			tableProps, | 			tableProps, | ||||||
| 			tableData: [], | 			tableData: [], | ||||||
| 			listQuery: { | 			optionArrUrl: [getProductionLinePage, getProductPage], | ||||||
| 				productionLineId: [], |  | ||||||
| 			}, |  | ||||||
| 			optionArrUrl: [getFactoryPage,getProductionLinePage, getProductPage], |  | ||||||
| 			formConfig: [ | 			formConfig: [ | ||||||
| 				{ |  | ||||||
| 					type: 'select', |  | ||||||
| 					label: '工厂', |  | ||||||
| 					selectOptions: [], |  | ||||||
| 					param: 'factoryId', |  | ||||||
| 					onchange: true, |  | ||||||
| 				}, |  | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| 					label: '产线', | 					label: '产线', | ||||||
| 					selectOptions: [], | 					selectOptions: [], | ||||||
| 					param: 'productionLineId', | 					param: 'productionLineId', | ||||||
| 					multiple: true, | 					defaultSelect: '', | ||||||
|  | 					filterable: true, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| @@ -99,7 +83,7 @@ export default { | |||||||
| 					startPlaceholder: '开始时间', | 					startPlaceholder: '开始时间', | ||||||
| 					endPlaceholder: '结束时间', | 					endPlaceholder: '结束时间', | ||||||
| 					param: 'startTime', | 					param: 'startTime', | ||||||
| 					valueFormat: 'timestamp', | 					valueFormat: 'timestamp' | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: 'button', | ||||||
| @@ -115,18 +99,12 @@ export default { | |||||||
| 			], | 			], | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	components: {}, | 	components: { | ||||||
|  | 	}, | ||||||
| 	created() { | 	created() { | ||||||
| 		this.getArr(); | 		this.getArr(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		handleSearchBarChanged({ param, value }) { |  | ||||||
| 			this.listQuery.productionLineId = []; |  | ||||||
| 			this.$refs.searchBarForm.formInline.productionLineId = undefined; |  | ||||||
| 			getPdList(value).then((res) => { |  | ||||||
| 				this.formConfig[1].selectOptions = res.data || []; |  | ||||||
| 			}); |  | ||||||
| 		}, |  | ||||||
| 		getArr() { | 		getArr() { | ||||||
| 			const params = { | 			const params = { | ||||||
| 				page: 1, | 				page: 1, | ||||||
| @@ -143,10 +121,9 @@ export default { | |||||||
| 				case 'search': | 				case 'search': | ||||||
| 					this.listQuery.pageNo = 1; | 					this.listQuery.pageNo = 1; | ||||||
| 					this.listQuery.pageSize = 10; | 					this.listQuery.pageSize = 10; | ||||||
| 					this.listQuery.factoryId = val.factoryId || undefined; | 					this.listQuery.productionLineId = val.productionLineId; | ||||||
| 					this.listQuery.productionLineId = val.productionLineId || []; |  | ||||||
| 					this.listQuery.productId = val.productId; | 					this.listQuery.productId = val.productId; | ||||||
| 					this.listQuery.startTime = val.startTime ? val.startTime : null; | 					this.listQuery.startTime = val.startTime; | ||||||
| 					this.getDataList(); | 					this.getDataList(); | ||||||
| 					break; | 					break; | ||||||
| 				case 'reset': | 				case 'reset': | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user