Compare commits
205 Commits
76cdc34af1
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| be430ebbff | |||
| eb063779b4 | |||
|
|
a2672c1742 | ||
| 4e97989ede | |||
|
|
67200710c9 | ||
| 7e2b75aaa5 | |||
| 8ad9b9d717 | |||
| 3bf2757e42 | |||
|
|
2267444b4a | ||
|
|
fa5a303c08 | ||
|
|
37586a31c5 | ||
|
|
40b023cd8d | ||
| 5dce57e4bb | |||
| 50a75dcb74 | |||
| 9ed4c944c5 | |||
| 6702521f31 | |||
| 61b4bf784b | |||
| b0f10b9002 | |||
| f37bba6747 | |||
| 365aafc21a | |||
| de65afef11 | |||
| a135877df1 | |||
|
|
8d26a9e487 | ||
|
|
76771489da | ||
|
|
27faa04c7a | ||
| c0daa74a84 | |||
| 6e7339bca3 | |||
|
|
904350a4d8 | ||
|
|
4873f750d8 | ||
| 13b522475e | |||
| 1a7e8cfc19 | |||
| a0790a6e19 | |||
| b76b8f4fe9 | |||
| 978291e68a | |||
| a5c17d2276 | |||
| a7b4e72bc2 | |||
| 99f771a445 | |||
| 7201c26792 | |||
| ad56aaf359 | |||
|
|
5033bbb206 | ||
|
|
6fc4794300 | ||
|
|
79c9f1ca66 | ||
| c74269b282 | |||
| 57deff3875 | |||
| 68d3b46bab | |||
| e6b9d75f16 | |||
| 4323982b89 | |||
|
|
c76078214e | ||
|
|
b527589e0f | ||
| 375273419d | |||
| a18929a261 | |||
| 6d465c17c2 | |||
| 669345c983 | |||
| b86094c630 | |||
| 2fdee9cafd | |||
| 4348d66e53 | |||
| 76c2f50bf3 | |||
| 888b5aa91f | |||
|
|
a7f1087775 | ||
|
|
b0efd66a75 | ||
| d9f3434712 | |||
| 51f72ea5d2 | |||
| d5507ec4c0 | |||
| 8802c932e2 | |||
| ee26741e62 | |||
|
|
7f5b9d5228 | ||
|
|
9eea7e049a | ||
| 328b3ff560 | |||
| b3a117f6c6 | |||
| 8929e53724 | |||
| a8fa98cb91 | |||
| db081c1bd1 | |||
| 3e9540bcc9 | |||
| 69ceadab69 | |||
| 601387184e | |||
| 54b63a7f53 | |||
| b625ef0118 | |||
|
|
8004c85c32 | ||
|
|
9041428003 | ||
| 39d06cd902 | |||
| d79ba71bd7 | |||
| 0225be1c94 | |||
| 265024d989 | |||
| 960751a264 | |||
| 978aa3a1d1 | |||
| 2eb1afe9b2 | |||
| 8cd53915c1 | |||
| 571d204d68 | |||
|
|
8dbc1d512d | ||
|
|
8af06c6c42 | ||
|
|
afafbccc0c | ||
|
|
0948737f1a | ||
| 0ce6bc07a0 | |||
| e318aa4f59 | |||
| ab09a2b08c | |||
| d2d5503792 | |||
| 6940155e4f | |||
| dfc758bfae | |||
| de15716b7c | |||
| ec2994e928 | |||
| c736992a34 | |||
|
|
5492666b53 | ||
| cd55b4c860 | |||
|
|
a7f811aa3e | ||
| 33188481bf | |||
| dcbb2c719b | |||
| 0200fc08f1 | |||
|
|
a22da566c3 | ||
|
|
3c99ddc4c0 | ||
| 96705bd4d9 | |||
| ac28476024 | |||
| 1299a56e22 | |||
| b348a31b24 | |||
| bc2940ca99 | |||
| 67d639c413 | |||
| c6d618b2b8 | |||
| aa79d15f52 | |||
| c8fb8d7589 | |||
| 51baca61cc | |||
| 847e34fcc6 | |||
| 32a43fbc3b | |||
| 20975948ef | |||
| c46c4dbf65 | |||
| 685a3308db | |||
| 76938951ed | |||
| ac041c2f4a | |||
| dd23c49ba0 | |||
| 44452f2e89 | |||
| 8ddef0de9d | |||
| 7249abf5b1 | |||
| 76f5385140 | |||
| 27f4e034be | |||
| 75f59c3279 | |||
| bb731dfcd4 | |||
| 8c37647aab | |||
| bad7175f87 | |||
| 231e9227a5 | |||
| d3eb9d8fbc | |||
| 9a7521e691 | |||
| 8b91e7812f | |||
| 9cffa01414 | |||
| e82ee4e542 | |||
| 905479d5f4 | |||
| c1ae248234 | |||
|
|
40e7d6b6d8 | ||
|
|
1d9b97f1d0 | ||
| cfaa17ee28 | |||
| d1cbac481d | |||
| c895975703 | |||
| 6ef90a8eba | |||
| e63b98161f | |||
| c99393dd12 | |||
| 23c1b4b3c6 | |||
| 88615a52a4 | |||
| bc3959412d | |||
|
|
010e51c0f6 | ||
|
|
a6b48280aa | ||
| 9f11fa3e00 | |||
|
|
c4091b7181 | ||
|
|
34e6a73852 | ||
| 79a6a4804a | |||
|
|
7523f98f84 | ||
|
|
b349432eaa | ||
| 4393c0e0e8 | |||
| 42177846e8 | |||
| c5b5de7a78 | |||
| 0884159dd7 | |||
| 87eccc7b25 | |||
| 8a819b84b6 | |||
| d37c5881a5 | |||
| 2b0579dc70 | |||
| 6a10afd04e | |||
| 7c1c61f8f8 | |||
| fb967fb825 | |||
|
|
25d1ac8d90 | ||
|
|
3667b98da9 | ||
| d3c289f11e | |||
| bbdf0a75f0 | |||
| 5339854df4 | |||
| 26658accfc | |||
| 31033dd7e2 | |||
|
|
3832aee028 | ||
|
|
2fbc6ea5e7 | ||
| d0cb4d383e | |||
|
|
4ce62c14ee | ||
|
|
e5966c27a3 | ||
| ea1d981a5a | |||
| 3e9f629888 | |||
|
|
ecabeeeea9 | ||
| 0f7a8fbf73 | |||
| d7366e80ee | |||
| 3da077bdf3 | |||
|
|
aef062b4c9 | ||
|
|
952490f0d4 | ||
| 51d6ce5dbb | |||
| 0ae68aacef | |||
| 2ab686a797 | |||
| a37fa65e8f | |||
| 887390cf91 | |||
| 5d054254f7 | |||
| 0fefe4d432 | |||
|
|
ecc84a1c4b | ||
|
|
95f7004d1c | ||
| 9a1aa047b0 | |||
| de06dfddf4 |
19
.env.dev
@@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2023-11-11 20:50:30
|
||||
# @LastEditTime: 2023-11-21 10:36:47
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
@@ -13,23 +13,24 @@ VUE_APP_TITLE = MES系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
# 多租户的开关
|
||||
VUE_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VUE_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 文档的开关
|
||||
VUE_APP_DOC_ENABLE = true
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
# 多租户的开关
|
||||
VUE_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VUE_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 文档的开关
|
||||
VUE_APP_DOC_ENABLE = true
|
||||
|
||||
|
||||
19
.env.prod
@@ -1,3 +1,10 @@
|
||||
###
|
||||
# @Author: zhp
|
||||
# @Date: 2023-11-07 19:11:40
|
||||
# @LastEditTime: 2023-11-16 16:40:59
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
@@ -7,19 +14,19 @@ VUE_APP_TITLE = MES系统
|
||||
# 芋道管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://10.70.2.2:8080'
|
||||
|
||||
|
||||
# 根据服务器或域名修改
|
||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
||||
PUBLIC_PATH = 'http://192.168.0.33:8889/'
|
||||
PUBLIC_PATH = 'http://10.70.2.32'
|
||||
|
||||
# 二级部署路径
|
||||
VUE_APP_APP_NAME ='yudao-admin'
|
||||
# VUE_APP_APP_NAME ='yudao-admin'
|
||||
|
||||
# 多租户的开关
|
||||
VUE_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VUE_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 文档的开关
|
||||
VUE_APP_DOC_ENABLE = false
|
||||
|
||||
|
||||
25
.env.stage
@@ -1,26 +1,27 @@
|
||||
NODE_ENV = production
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 产线监控系统
|
||||
VUE_APP_TITLE = MES系统
|
||||
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
# 芋道管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 芋道管理系统/测试环境
|
||||
VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn'
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
||||
|
||||
# 静态资源地址
|
||||
PUBLIC_PATH = 'http://static.yudao.iocoder.cn/'
|
||||
|
||||
# 根据服务器或域名修改
|
||||
PUBLIC_PATH = 'http://192.168.0.33:8889/'
|
||||
|
||||
# 二级部署路径
|
||||
# VUE_APP_APP_NAME ='yudao-admin'
|
||||
|
||||
# 多租户的开关
|
||||
VUE_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VUE_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 文档的开关
|
||||
VUE_APP_DOC_ENABLE = false
|
||||
|
||||
# 百度统计
|
||||
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@ VUE_APP_APP_NAME ='/admin-ui-vue2/'
|
||||
# 多租户的开关
|
||||
VUE_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VUE_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 文档的开关
|
||||
VUE_APP_DOC_ENABLE = true
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.2 KiB |
68
src/api/base/coreHotMaterial.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-11-15 15:56:14
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原料
|
||||
export function createHotMaterial(data) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料
|
||||
export function updateHotMaterial(data) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原料
|
||||
export function deleteHotMaterial(id) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料
|
||||
export function getHotMaterial(id) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/core-hot-material/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料分页
|
||||
export function getHotMaterialPage(query) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有列表
|
||||
export function getHotMaterialList(query) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-11-06 17:49:42
|
||||
* @LastEditTime: 2023-11-15 17:19:19
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -67,6 +67,14 @@ export function getCoreWOList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据工单id获得所有列表
|
||||
export function getCoreWOListById(ids) {
|
||||
return request({
|
||||
url: '/base/core-work-order/list?ids='+ ids ,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建工单预使用原料
|
||||
export function createCoreWOMa(data) {
|
||||
return request({
|
||||
@@ -136,3 +144,12 @@ export function statusChange(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建分配产量
|
||||
export function createConCoreWOr(data) {
|
||||
return request({
|
||||
url: '/base/core-order-con-work-order/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,6 +18,15 @@ export function deliveryProgressPage(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取订单列表
|
||||
export function listOrderList(query) {
|
||||
return request({
|
||||
url: '/extend/delivery-log/listOrderList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取发货进度分页
|
||||
export function deliveryLogDetPage(data) {
|
||||
return request({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-26 20:06:29
|
||||
* @LastEditTime: 2023-11-27 17:54:28
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -110,3 +110,11 @@ export function deleteMaterialPBDet(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bom详细
|
||||
export function getMaterialPBDet(id) {
|
||||
return request({
|
||||
url: '/base/material-product-bom-det/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -113,6 +113,15 @@ export function orderMonitor(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取订单绑定的工单和数量信息,可传订单id列表,map索引为订单id
|
||||
export function orderAssignmentList(query) {
|
||||
return request({
|
||||
url: '/base/order/orderAssignmentList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有客户列表
|
||||
export function customerList() {
|
||||
return request({
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 09:26:38
|
||||
* @LastEditTime: 2023-11-20 15:50:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建质量检测信息基础
|
||||
@@ -52,3 +59,11 @@ export function exportQualityInspectionDetExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityInspectionDetList(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-det/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-11 19:52:54
|
||||
* @LastEditTime: 2023-11-16 20:15:02
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -60,3 +60,11 @@ export function getcheckConfigByEqList(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备巡检记录
|
||||
export function deleteEqCheckLog(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-10 09:04:50
|
||||
* @LastEditTime: 2023-11-25 16:22:49
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -58,11 +58,45 @@ export function getCheckDetPage(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得x巡检所有列表
|
||||
// 获得设备巡检所有列表
|
||||
export function getcheckList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check/list',
|
||||
url: '/base/equipment-check/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除巡检内容
|
||||
export function deleteCheck(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检设置code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/equipment-check-config/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建巡检配置
|
||||
export function createCheckConfig(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-config/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新巡检配置
|
||||
export function updateCheckConfig(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-config/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
44
src/api/equipment/base/maintain/record.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-23 19:10:07
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 删除设备保养记录
|
||||
export function deleteEqMaintainLog(id) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备保养计划配置
|
||||
export function deleteEqMaintainPlan(id) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出设备保养监控
|
||||
export function exportMaintainMonitorExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/monitor-export',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出设备保养记录
|
||||
export function exportMaintainLogExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-10 16:09:33
|
||||
* @LastEditTime: 2023-11-10 16:50:08
|
||||
* @LastEditTime: 2023-11-23 20:29:28
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -23,3 +23,21 @@ export function updateEqRepair(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除维修记录
|
||||
export function deleteRepair(id) {
|
||||
return request({
|
||||
url: '/base/equipment-repair-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出设备维修
|
||||
export function exportRepairLogExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-repair-log/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-11 16:18:57
|
||||
* @LastEditTime: 2023-11-11 17:28:54
|
||||
* @LastEditTime: 2023-11-16 20:52:06
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -49,3 +49,20 @@ export function getSparePartList(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备备品备件配置
|
||||
export function deleteConfig(id) {
|
||||
return request({
|
||||
url: '/base/equipment-spare-part-config/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得备品备件分页
|
||||
export function getSparePartPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-spare-part/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
16
src/api/equipment/base/spare-parts/list.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-22 13:59:17
|
||||
* @LastEditTime: 2023-11-22 13:59:45
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 删除设备备品备件
|
||||
export function deleteSparePart(id) {
|
||||
return request({
|
||||
url: '/base/equipment-spare-part/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-07 19:47:48
|
||||
* @LastEditTime: 2023-11-08 16:59:32
|
||||
* @LastEditTime: 2023-11-23 13:57:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@@ -12,7 +12,7 @@ export function processEquMaterialBomPage(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-material-bom/page',
|
||||
method: 'get',
|
||||
data: data
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,3 +104,18 @@ export function getMaterialList(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function getMaterialCode(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-material-bom/getCode',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function createProcessEquMaterialBomDetList(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-material-bom-det/createByList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-09 09:37:14
|
||||
* @LastEditTime: 2023-11-09 14:20:02
|
||||
* @LastEditTime: 2023-11-23 14:15:45
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得能耗统计查询分页
|
||||
|
||||
export function processEquValueBomPage(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-value-bom/page',
|
||||
method: 'get',
|
||||
data: data
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,3 +104,19 @@ export function getValueList(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getValueCode(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-value-bom/getCode',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function createProcessEquValueBomDetList(data) {
|
||||
return request({
|
||||
url: '/extend/process-equ-value-bom-det/createByList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-07 14:10:18
|
||||
* @LastEditTime: 2023-11-07 16:29:55
|
||||
* @LastEditTime: 2023-11-16 17:49:52
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@@ -12,7 +12,7 @@ export function getStatisticalDataPage(query) {
|
||||
return request({
|
||||
url: '/base/statistical-data/getStatisticData',
|
||||
method: 'get',
|
||||
data: query
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-31 15:05:06
|
||||
* @LastEditTime: 2023-11-03 09:05:50
|
||||
* @LastEditTime: 2023-11-28 09:28:05
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@@ -24,6 +24,14 @@ export function getWorkOrderList(query) {
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getCoreProduct(id) {
|
||||
return request({
|
||||
url: '/base/core-product/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出物料信息
|
||||
// export function exportEnergyPlcExcel(query) {
|
||||
// return request({
|
||||
|
||||
12
src/assets/icons/svg/home.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>编组</title>
|
||||
<g id="组件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="icon/banner/home" fill="#000" fill-rule="nonzero">
|
||||
<g id="编组">
|
||||
<rect id="矩形" opacity="0" x="0" y="0" width="24" height="24"></rect>
|
||||
<path d="M11.1710783,2.42919989 C11.7298936,2.09409047 12.4328291,2.12455473 12.9654367,2.52059014 L20.3218013,7.99000647 L20.4665209,8.10559268 C21.0744501,8.62656431 21.4302636,9.40344805 21.4302636,10.227099 L21.4302636,19.0470569 L21.4250327,19.2212289 C21.3382831,20.6611171 20.1833875,21.8011882 18.7715031,21.8011882 L5.2284969,21.8011882 L5.06035624,21.7957697 C3.67032883,21.7059084 2.56973638,20.5095861 2.56973638,19.0470569 L2.56973638,10.2273587 L2.57600507,10.0381789 C2.63012926,9.22282649 3.03207443,8.47038558 3.67819781,7.99000711 L11.034559,2.52059336 Z M12.0713092,3.55793652 C11.9772762,3.53774358 11.8769764,3.55793433 11.7954857,3.6185066 L4.43911542,9.0879271 L4.32641124,9.18150853 C4.04059293,9.44596068 3.87451485,9.82573182 3.87451485,10.2273587 L3.87451485,19.0470569 L3.880713,19.1821318 C3.94632222,19.8933667 4.52470053,20.4496068 5.2284969,20.4496068 L11.2507497,20.4487759 L11.3507364,20.3451977 L11.3512202,14.4627186 L11.3582338,14.3683764 C11.4044406,14.0603828 11.6734228,13.8227675 12,13.8227675 C12.3345637,13.8227675 12.6123182,14.0734451 12.6454705,14.3976012 L12.6489183,14.4681588 L12.6487364,20.3451881 L12.7487231,20.4487759 L18.7714898,20.4496068 L18.9018895,20.4431864 C19.5885066,20.3752237 20.1254851,19.7760987 20.1254851,19.0470569 L20.1254851,10.2273587 L20.1177907,10.0779557 C20.0769951,9.68325297 19.8759128,9.32208831 19.5608746,9.08791971 L12.2045243,3.61851399 L12.1402672,3.58065321 Z" id="形状结合" stroke="#000" stroke-width="0.1"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
20
src/assets/icons/svg/order-monitoring.svg
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>编组 17</title>
|
||||
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.695141">
|
||||
<g id="最新参考" transform="translate(-1780.000000, -57.000000)" fill="#000000" fill-rule="nonzero">
|
||||
<g id="编组-4" transform="translate(1772.000000, 48.000000)">
|
||||
<g id="编组-17" transform="translate(8.000000, 9.000000)">
|
||||
<rect id="矩形备份-2" opacity="0" x="0" y="0" width="16" height="16"></rect>
|
||||
<g id="文档" transform="translate(2.436519, 1.472460)">
|
||||
<path d="M9.61879642,0.990942446 C9.83682412,0.990942446 10.0548518,1.18867806 10.0548518,1.38641367 L10.0548518,11.6686655 C10.0548518,11.8664011 9.83682412,12.0641367 9.61879642,12.0641367 L3.60123204,12.0641367 L1.02850524,9.69130935 L1.02850524,1.38641367 C1.02850524,1.18867806 1.24653294,0.990942446 1.46456063,0.990942446 L9.61879642,0.990942446 M9.61879642,0.2 L1.50816617,0.2 C0.810477546,0.2 0.2,0.753659712 0.2,1.38641367 L0.2,10.0076863 L3.25238773,12.8550791 L9.61879642,12.8550791 C10.316485,12.8550791 10.9269626,12.3014194 10.9269626,11.6686655 L10.9269626,1.38641367 C10.9269626,0.753659712 10.316485,0.2 9.61879642,0.2 Z" id="形状"></path>
|
||||
<path d="M9.61879642,0 C10.4228194,0 11.1269626,0.638607809 11.1269626,1.38641367 L11.1269626,11.6686655 C11.1269626,12.4164713 10.4228194,13.0550791 9.61879642,13.0550791 L3.25238773,13.0550791 L3.11596256,13.0013261 L0.0635748259,10.1539333 L0,10.0076863 L0,1.38641367 C0,0.638607809 0.704143212,0 1.50816617,0 L9.61879642,0 Z M9.61879642,0.4 L1.50816617,0.4 C0.91681188,0.4 0.4,0.868711615 0.4,1.38641367 L0.4,9.921 L3.331,12.6550791 L9.61879642,12.6550791 C10.1707271,12.6550791 10.657723,12.2467792 10.7202028,11.7714283 L10.7269626,11.6686655 L10.7269626,1.38641367 C10.7269626,0.868711615 10.2101507,0.4 9.61879642,0.4 Z M9.61879642,0.790942446 C9.94315845,0.790942446 10.2548518,1.07362615 10.2548518,1.38641367 L10.2548518,11.6686655 C10.2548518,11.981453 9.94315845,12.2641367 9.61879642,12.2641367 L3.60123204,12.2641367 L3.46563766,12.2111542 L0.892910861,9.83832691 L0.828505241,9.69130935 L0.828505241,1.38641367 C0.828505241,1.07362615 1.1401986,0.790942446 1.46456063,0.790942446 L9.61879642,0.790942446 Z M9.69667678,1.08901006 L1.38668992,1.08901006 C1.27286315,1.08901006 1.14612572,1.20395189 1.14612572,1.28821491 L1.14561083,9.66174324 L3.64342649,11.9659298 L9.69667678,11.9660691 C9.79153243,11.9660691 9.8953538,11.8862484 9.92732605,11.8108781 L9.93724098,11.7668642 L9.93724098,1.28821491 C9.93724098,1.20395189 9.81050356,1.08901006 9.69667678,1.08901006 Z" id="形状"></path>
|
||||
<path d="M4.54092961,3.67913093 L2.25985278,3.67913093 C2.22052387,3.67913093 2.22052387,3.65291165 2.22052387,3.65291165 L2.22052387,2.91877199 C2.22052387,2.89255271 2.22052387,2.89255271 2.25985278,2.89255271 L4.54092961,2.89255271 C4.58025852,2.89255271 4.58025852,2.89255271 4.58025852,2.91877199 L4.58025852,3.65291165 L4.54092961,3.67913093 Z M8.86710981,5.44893192 L2.25985278,5.44893192 C2.22052387,5.44893192 2.22052387,5.44893192 2.22052387,5.40960301 L2.22052387,4.70168261 C2.22052387,4.6623537 2.22052387,4.6623537 2.25985278,4.6623537 L8.86710981,4.6623537 C8.90643872,4.6623537 8.90643872,4.6623537 8.90643872,4.70168261 L8.90643872,5.40960301 L8.86710981,5.44893192 Z M8.86710981,7.41537746 L2.25985278,7.41537746 C2.22052387,7.41537746 2.22052387,7.41537746 2.22052387,7.37604855 L2.22052387,6.66812815 C2.22052387,6.62879924 2.22052387,6.62879924 2.25985278,6.62879924 L8.86710981,6.62879924 C8.90643872,6.62879924 8.90643872,6.62879924 8.90643872,6.66812815 L8.90643872,7.37604855 L8.86710981,7.41537746 Z" id="形状"></path>
|
||||
<path d="M8.86710981,6.44841431 C9.00606257,6.44841431 9.08682365,6.5291754 9.08682365,6.66812815 L9.08682365,7.37604855 L9.03399013,7.50359996 L8.99466122,7.54292887 L8.86710981,7.59576239 L2.25985278,7.59576239 C2.12090003,7.59576239 2.04013894,7.51500131 2.04013894,7.37604855 L2.04013894,6.66812815 C2.04013894,6.5291754 2.12090003,6.44841431 2.25985278,6.44841431 L8.86710981,6.44841431 Z M8.72520451,6.80870958 L2.40090881,6.80870958 L2.40090881,7.23441802 L8.72520451,7.23441802 L8.72520451,6.80870958 Z M8.86710981,4.48196877 C9.00606257,4.48196877 9.08682365,4.56272985 9.08682365,4.70168261 L9.08682365,5.40960301 L9.03399013,5.53715441 L8.99466122,5.57648333 L8.86710981,5.62931685 L2.25985278,5.62931685 C2.12090003,5.62931685 2.04013894,5.54855576 2.04013894,5.40960301 L2.04013894,4.70168261 C2.04013894,4.56272985 2.12090003,4.48196877 2.25985278,4.48196877 L8.86710981,4.48196877 Z M8.72520451,4.84251382 L2.40090881,4.84251382 L2.40090881,5.26822226 L8.72520451,5.26822226 L8.72520451,4.84251382 Z M4.54092961,2.71216778 C4.66811215,2.71216778 4.76064346,2.77385532 4.76064346,2.91877199 L4.76064346,3.65291165 L4.68031808,3.80300099 L4.64098917,3.82922026 L4.54092961,3.85951586 L2.25985278,3.85951586 C2.18859958,3.85951586 2.12331983,3.83050264 2.08113204,3.77425225 C2.04130723,3.6964836 2.04130723,3.6964836 2.04013894,3.65291165 L2.04013894,2.91877199 C2.04013894,2.77385532 2.13267025,2.71216778 2.25985278,2.71216778 L4.54092961,2.71216778 Z M4.39957385,3.07293764 L2.40090881,3.07293764 L2.40090881,3.49864608 L4.39957385,3.49864608 L4.39957385,3.07293764 Z" id="形状"></path>
|
||||
<path d="M3.50158987,12.5394187 L3.50158987,9.83587533 L0.88525753,9.83587533 L0.88525753,8.96376455 L3.93764526,8.96376455 C4.19927849,8.96376455 4.37370065,9.1381867 4.37370065,9.39981994 L4.37370065,12.5394187 L3.50158987,12.5394187 Z" id="路径"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
14
src/assets/icons/svg/return.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>rollback</title>
|
||||
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="按钮与选择" transform="translate(-135.000000, -282.000000)" fill-rule="nonzero">
|
||||
<g id="编组-3" transform="translate(127.000000, 274.000000)">
|
||||
<g id="rollback" transform="translate(8.000000, 8.000000)">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
|
||||
<path d="M11.390625,3.78125 L5.71875,3.78125 L5.71875,2.625 C5.71875,2.5203125 5.5984375,2.4625 5.5171875,2.5265625 L3.2984375,4.2765625 C3.234375,4.3265625 3.234375,4.4234375 3.2984375,4.4734375 L5.5171875,6.2234375 C5.5984375,6.2875 5.71875,6.2296875 5.71875,6.125 L5.71875,4.96875 L11.203125,4.96875 C11.7554097,4.96875 12.203125,5.41646525 12.203125,5.96875 L12.203125,11.3125 C12.203125,11.8647847 11.7554097,12.3125 11.203125,12.3125 L2.93775156,12.3125 L2.93775156,12.3125 C2.55569144,12.3125 2.36466138,12.4938859 2.36466138,12.8566576 C2.36466138,13.5 2.93775156,13.5 2.93775156,13.5 C2.93775156,13.5 5.75537604,13.5 11.390625,13.5 C13,13.5 13.390625,12.8986083 13.390625,11.9909216 L13.390625,4.96875 C13.390625,4.06071182 13,3.78125 11.390625,3.78125 Z" id="路径" fill="currentColor"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
14
src/assets/icons/svg/table_edit.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="1_基础资料" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="1-1工厂信息" transform="translate(-1834.000000, -253.000000)">
|
||||
<g id="icon/界面内/编辑" transform="translate(1834.000000, 253.000000)">
|
||||
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
|
||||
<g id="常用购票人/编辑32" fill-rule="nonzero">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
|
||||
<path d="M13.5,7.8285 C13.5,7.55235763 13.7238576,7.3285 14,7.3285 C14.2761424,7.3285 14.5,7.55235763 14.5,7.8285 L14.5,12 C14.5,13.3807119 13.3807119,14.5 12,14.5 L4,14.5 C2.61928813,14.5 1.5,13.3807119 1.5,12 L1.5,4 C1.5,2.61928813 2.61928813,1.5 4,1.5 L8.759,1.5 C8.9376328,1.5 9.10269631,1.59529946 9.19201271,1.75 C9.28132911,1.90470054 9.28132911,2.09529946 9.19201271,2.25 C9.10269631,2.40470054 8.9376328,2.5 8.759,2.5 L4,2.5 C3.17157288,2.5 2.5,3.17157288 2.5,4 L2.5,12 C2.5,12.8284271 3.17157288,13.5 4,13.5 L12,13.5 C12.8284271,13.5 13.5,12.8284271 13.5,12 L13.5,7.8285 Z M13.284,2.312 C13.4738226,2.11757837 13.784168,2.11034095 13.9828473,2.2957025 C14.1815266,2.48106405 14.1958051,2.79116533 14.015,2.994 L8.56,8.845 C8.43817243,8.97566989 8.25588756,9.03141962 8.08181033,8.9912488 C7.90773311,8.95107798 7.76830999,8.82108951 7.71606033,8.65024879 C7.66381067,8.47940808 7.70667243,8.29366989 7.8285,8.163 L13.284,2.312 Z" id="形状" stroke="#0B58FF" stroke-width="0.1" fill="#0B58FF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/assets/img/1.jpg
Normal file
|
After Width: | Height: | Size: 370 KiB |
BIN
src/assets/img/OperationalOverview/back.png
Normal file
|
After Width: | Height: | Size: 2.7 MiB |
BIN
src/assets/img/OperationalOverview/title.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/img/Toughenedfurnace.png
Normal file
|
After Width: | Height: | Size: 310 KiB |
BIN
src/assets/img/back.jpg
Normal file
|
After Width: | Height: | Size: 349 KiB |
BIN
src/assets/img/back.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
src/assets/img/back1.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
src/assets/img/bg-bottom-item.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/img/choicepart/ArtManager.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/assets/img/choicepart/ArticleManager.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
src/assets/img/choicepart/DataAnalysis.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
src/assets/img/choicepart/EquipmentManager.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
src/assets/img/choicepart/MaterialsManage.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
src/assets/img/choicepart/OperationalOverview.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src/assets/img/choicepart/WarehouseManager.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
src/assets/img/choicepart/basicData.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/assets/img/choicepart/choice-item-back.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
src/assets/img/choicepart/choicepart-back.png
Normal file
|
After Width: | Height: | Size: 3.5 MiB |
BIN
src/assets/img/choicepart/energyManage.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/assets/img/choicepart/factoryManage.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/assets/img/choicepart/formManage.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
src/assets/img/choicepart/orderManage.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
src/assets/img/choicepart/packingManage.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
src/assets/img/choicepart/qualityManage.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
src/assets/img/cnbm.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/assets/img/empty.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
src/assets/img/energy.png
Normal file
|
After Width: | Height: | Size: 241 KiB |
BIN
src/assets/img/head-w.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/img/head.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
18
src/assets/img/jiantou.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="26px" viewBox="0 0 30 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 60 (88103) - https://sketch.com -->
|
||||
<title>icon/流程箭头备份 5</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="3_工艺流程" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="3-自定义工艺流程" transform="translate(-633.000000, -397.000000)">
|
||||
<g id="icon/流程箭头" transform="translate(630.000000, 392.000000)">
|
||||
<g id="编组-2" opacity="0.50218564" stroke-width="1" fill-rule="evenodd" transform="translate(3.000000, 5.000000)">
|
||||
<ellipse id="椭圆形" fill="#404040" cx="2.12742382" cy="13.0763435" rx="2.12742382" ry="2.21252078"></ellipse>
|
||||
<ellipse id="椭圆形备份" fill="#404040" cx="8.51227147" cy="13.0763435" rx="2.12742382" ry="2.21252078"></ellipse>
|
||||
<path d="M19.4593901,1.4429655 L21.8675258,3.61583195 C26.9580675,8.25644103 29.2570896,10.731031 29.7057398,12.459385 C29.748906,12.6160198 29.7763246,12.7796115 29.7855806,12.9482608 L29.7881771,13.0128311 L29.7890859,13.0763435 C29.7890859,13.2480738 29.7702733,13.4152344 29.7346744,13.5757179 C29.3077404,15.5566713 26.3837971,18.5124849 19.4593901,24.7097215 C18.5688126,25.5067745 17.2255693,25.4020797 16.4591722,24.4758791 C15.6927751,23.5496785 15.7934432,22.1527055 16.6840207,21.3556525 L18.3602818,19.843801 C20.3525013,18.0317598 21.9577562,16.511737 23.1725229,15.2878856 L14.8971191,15.2888643 C13.7221754,15.2888643 12.7696953,14.298285 12.7696953,13.0763435 C12.7696953,11.9075299 13.6411516,10.9503974 14.7451872,10.869378 L14.8971191,10.8638227 L23.171515,10.8637859 L22.3958746,10.0940454 C20.9337911,8.66258056 19.0284153,6.89523125 16.6840207,4.7970345 C15.7934432,3.9999815 15.6927751,2.60300846 16.4591722,1.67680788 C17.2255693,0.750607307 18.5688126,0.645912508 19.4593901,1.4429655 Z" id="形状结合" fill="#545454" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
<rect id="矩形" x="0" y="0" width="36" height="36"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/img/login-back.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
src/assets/img/login-back.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
src/assets/img/login-new.jpg
Normal file
|
After Width: | Height: | Size: 340 KiB |
BIN
src/assets/img/login.gif
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
BIN
src/assets/img/login1.gif
Normal file
|
After Width: | Height: | Size: 5.3 MiB |
BIN
src/assets/img/logo.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
src/assets/img/medal/champion.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/img/medal/secondPlace.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/img/medal/thirdPlace.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/assets/img/status.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
src/assets/img/uploadIcon.png
Normal file
|
After Width: | Height: | Size: 237 B |
@@ -6,6 +6,7 @@
|
||||
@import './btn.scss';
|
||||
|
||||
body {
|
||||
// min-height: 1024px;
|
||||
height: 100%;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@@ -37,6 +37,9 @@ $tabWidth: $tabW * 1px;
|
||||
$rowHeight: $rowH * 1px;
|
||||
$buttonHeight: $buttonH * 1px;
|
||||
|
||||
// 1080px 高度为基准的 1px
|
||||
$base1px: 0.15vh; // 1px / 1080px;
|
||||
|
||||
// - - - - - 页面基础设置
|
||||
.container {
|
||||
.login-code {
|
||||
@@ -87,16 +90,20 @@ $buttonHeight: $buttonH * 1px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||
// box-shadow: 0px calc(16 * 0.12vh) 40px rgba(0, 0, 0, 0.07);
|
||||
// border-radius: 20px;
|
||||
// 定位
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
.pic {
|
||||
flex: 3;
|
||||
width: 1px;
|
||||
min-width: 800px;
|
||||
// 元素
|
||||
width: $picWidth;
|
||||
// width: $picWidth;
|
||||
height: $picHeight;
|
||||
// height: 10vh;
|
||||
background-image: url($picImage);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
@@ -114,49 +121,86 @@ $buttonHeight: $buttonH * 1px;
|
||||
}
|
||||
}
|
||||
.field {
|
||||
// background: #ccc3;
|
||||
position: relative;
|
||||
padding-top: 196px;
|
||||
flex: 1;
|
||||
margin-top: 14vh;
|
||||
flex: 2;
|
||||
// width: 800px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.pc-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
position: relative;
|
||||
top: -36px;
|
||||
top: calc(-32 * $base1px);
|
||||
height: calc(128 * $base1px);
|
||||
|
||||
// h3.title {
|
||||
// position: relative;
|
||||
.title {
|
||||
margin: 0;
|
||||
margin-left: calc(28 * 0.12vh);
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: #000;
|
||||
font-size: calc(28 * 0.12vh);
|
||||
line-height: calc(40 * 0.12vh);
|
||||
letter-spacing: calc(2 * 0.12vh);
|
||||
|
||||
// &::before {
|
||||
// content: '';
|
||||
// background: url($cnbmLogo) 100% / 100% no-repeat;
|
||||
// height: 48px;
|
||||
// width: 48px;
|
||||
// position: absolute;
|
||||
// left: 0px;
|
||||
// top: 4px;
|
||||
// display: inline-block;
|
||||
// }
|
||||
// }
|
||||
.cnbm_logo {
|
||||
height: calc(40 * 0.12vh);
|
||||
width: calc(40 * 0.12vh);
|
||||
position: relative;
|
||||
top: calc(8 * 0.12vh);
|
||||
right: calc(8 * 0.12vh);
|
||||
}
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
margin: 0;
|
||||
margin-left: calc(28 * 0.12vh);
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: #000;
|
||||
font-size: calc(28 * 0.12vh);
|
||||
line-height: calc(48 * 0.12vh);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-title,
|
||||
.mobile-switch {
|
||||
display: none;
|
||||
}
|
||||
.form {
|
||||
margin-top: 32px;
|
||||
box-sizing: border-box;
|
||||
// width: $formWidth;
|
||||
width: 100%;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__nav) {
|
||||
// background: #f0f3;
|
||||
|
||||
.form-cont {
|
||||
// height: 560px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.footer {
|
||||
user-select: none;
|
||||
// 元素
|
||||
margin: calc(12 * 0.12vh) 0;
|
||||
height: calc(16 * 0.12vh);
|
||||
line-height: calc(16 * 0.12vh);
|
||||
font-size: calc(12 * 0.12vh);
|
||||
color: #8c8c8c;
|
||||
|
||||
a,
|
||||
a:hover,
|
||||
a:active {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.form {
|
||||
margin-top: 0;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
@@ -164,12 +208,13 @@ $buttonHeight: $buttonH * 1px;
|
||||
user-select: none;
|
||||
// 元素
|
||||
width: $tabWidth;
|
||||
height: $rowHeight;
|
||||
// height: $rowHeight;
|
||||
height: calc(54 * 0.12vh);
|
||||
padding: 0;
|
||||
// 文字
|
||||
line-height: $rowHeight;
|
||||
color: #666666;
|
||||
font-size: 18px;
|
||||
font-size: calc(14 * 0.12vh);
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -185,7 +230,8 @@ $buttonHeight: $buttonH * 1px;
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 100%;
|
||||
height: $rowHeight;
|
||||
// height: $rowHeight;
|
||||
height: calc(72 * 0.12vh);
|
||||
background: #f5f5f5;
|
||||
border: 0;
|
||||
border-radius: 28px;
|
||||
@@ -255,7 +301,7 @@ $buttonHeight: $buttonH * 1px;
|
||||
margin-bottom: 20px;
|
||||
// 文字
|
||||
line-height: 26px;
|
||||
font-size: 20px;
|
||||
font-size: calc(18 * 0.12vh);
|
||||
color: #ffffff;
|
||||
}
|
||||
.button-active {
|
||||
@@ -274,39 +320,58 @@ $buttonHeight: $buttonH * 1px;
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 420px;
|
||||
height: 66px;
|
||||
height: calc(52 * 0.12vh);
|
||||
// height: 66px;
|
||||
color: #262626;
|
||||
font-size: 18px;
|
||||
font-size: calc(14 * 0.12vh);
|
||||
}
|
||||
:deep(.el-checkbox__label) {
|
||||
font-size: 18px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
user-select: none;
|
||||
// 元素
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
// 定位
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
a,
|
||||
a:hover,
|
||||
a:active {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: calc(14 * 0.12vh);
|
||||
line-height: calc(12 * 0.12vh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - PC 最小尺寸设置
|
||||
@media screen and (min-width: 1920px) {
|
||||
.container {
|
||||
.content {
|
||||
.field {
|
||||
flex: initial;
|
||||
// width: 800px;
|
||||
width: 40vw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-height: 1024px) {
|
||||
.container {
|
||||
.content {
|
||||
.field {
|
||||
margin-top: 16vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-height: 1024px) {
|
||||
.container {
|
||||
.content {
|
||||
.field {
|
||||
margin-top: 8vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
||||
.container {
|
||||
min-width: 599px;
|
||||
// min-width: 599px;
|
||||
min-width: 42vw;
|
||||
|
||||
.content {
|
||||
// width: 710px;
|
||||
// height: 397px;
|
||||
@@ -317,6 +382,7 @@ $buttonHeight: $buttonH * 1px;
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
// margin-top: 6vh;
|
||||
// width: calc(710px - 314px);
|
||||
// left: 314px;
|
||||
// justify-content: center;
|
||||
@@ -343,6 +409,14 @@ $buttonHeight: $buttonH * 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// @media screen and (max-height: 1080px) {
|
||||
// .container {
|
||||
// .field {
|
||||
// transform: scale(0.74);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/* ===== MOBILE DESIGN ===== */
|
||||
$mobileW: 375;
|
||||
$mobileH: 812;
|
||||
@@ -483,7 +557,7 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
|
||||
.footer {
|
||||
// 元素
|
||||
font-size: 12px;
|
||||
font-size: calc(12 * 0.12vh);
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
@@ -491,7 +565,7 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
opacity: 0.6;
|
||||
// 定位
|
||||
// position: absolute;
|
||||
bottom: -32px;
|
||||
bottom: -calc(32 * 0.12vh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ h6 {
|
||||
word-break: break-word;
|
||||
background-color: #f8f8f9;
|
||||
color: #515a6e;
|
||||
height: 40px;
|
||||
font-size: 13px;
|
||||
// height: 40px;
|
||||
// font-size: 13px;
|
||||
}
|
||||
}
|
||||
.el-table__body-wrapper {
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
v-if="col.subcomponent"
|
||||
:key="col.key"
|
||||
:disabled="disabled"
|
||||
:read-only="disabled"
|
||||
:is="col.subcomponent"
|
||||
v-model="form[col.prop]"
|
||||
:inlineStyle="col.style"
|
||||
@@ -75,6 +76,7 @@
|
||||
class="upload-area"
|
||||
:class="uploadOpen ? '' : 'height-48'"
|
||||
ref="uploadArea"
|
||||
:key="col.prop"
|
||||
v-if="col.upload">
|
||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||
<el-button
|
||||
@@ -86,13 +88,18 @@
|
||||
<el-upload
|
||||
class="upload-in-dialog"
|
||||
v-if="col.upload"
|
||||
:key="col.prop + '__el-upload'"
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
:show-file-list="false"
|
||||
icon="el-icon-upload2"
|
||||
:disabled="disabled"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="handleUploadSuccess"
|
||||
:on-success="
|
||||
(response, file, fileList) => {
|
||||
handleUploadSuccess(response, file, col.prop);
|
||||
}
|
||||
"
|
||||
v-bind="col.bind">
|
||||
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
||||
<svg-icon
|
||||
@@ -107,10 +114,10 @@
|
||||
|
||||
<uploadedFile
|
||||
class="file"
|
||||
v-for="file in form[col.prop] || []"
|
||||
v-for="file in form[col.prop]"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
@delete="!disabled && handleDeleteFile(file)" />
|
||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -135,6 +142,9 @@ function findMaxLabelWidth(rows) {
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
if (opt.label.includes('(')) {
|
||||
max = max - 3
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -151,12 +161,30 @@ const uploadedFile = {
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
async handleDownload() {
|
||||
const data = await this.$axios({
|
||||
url: this.file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
|
||||
await this.$message.success('开始下载');
|
||||
// create download link
|
||||
const url = window.URL.createObjectURL(data);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = this.file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
title={this.file.fileName}
|
||||
onClick={this.handleDownload}
|
||||
style={{
|
||||
background: `url(${tupleImg}) no-repeat`,
|
||||
backgroundSize: '14px',
|
||||
@@ -204,7 +232,7 @@ export default {
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
type: Boolean,
|
||||
type: Boolean | Array,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
@@ -214,7 +242,7 @@ export default {
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -250,7 +278,13 @@ export default {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
@@ -346,6 +380,8 @@ export default {
|
||||
console.log('setting code: ', response.data);
|
||||
// 处理输入框数据
|
||||
this.form[opt.prop] = response.data;
|
||||
// 更新下外部的 dataForm,防止code字段有数据也报空的bug
|
||||
this.$emit('update', this.form);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -374,11 +410,12 @@ export default {
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() {},
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
this.form.files.push({
|
||||
handleUploadSuccess(response, file, prop) {
|
||||
console.log('[handleUploadSuccess]', response, file, prop);
|
||||
this.form[prop].push({
|
||||
fileName: file.name,
|
||||
fileUrl: response.data,
|
||||
fileType: 2,
|
||||
fileType: prop == 'files' ? 2 : 1,
|
||||
});
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
this.$emit('update', this.form);
|
||||
@@ -392,8 +429,8 @@ export default {
|
||||
this.uploadOpen = !this.uploadOpen;
|
||||
},
|
||||
|
||||
handleDeleteFile(file) {
|
||||
this.form.files = this.form.files.filter(
|
||||
handleDeleteFile(file, prop) {
|
||||
this.form[prop] = this.form[prop].filter(
|
||||
(item) => item.fileUrl != file.fileUrl
|
||||
);
|
||||
this.$emit('update', this.form);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div :class="[readOnly ? 'editor-wrapper' : '']">
|
||||
<el-upload
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
@@ -10,27 +10,25 @@
|
||||
:headers="headers"
|
||||
style="display: none"
|
||||
ref="upload"
|
||||
v-if="this.type === 'url'"
|
||||
>
|
||||
</el-upload>
|
||||
v-if="this.type === 'url'"></el-upload>
|
||||
<div class="editor" ref="editor" :style="styles"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
import { getAccessToken } from "@/utils/auth";
|
||||
import Quill from 'quill';
|
||||
import 'quill/dist/quill.core.css';
|
||||
import 'quill/dist/quill.snow.css';
|
||||
import 'quill/dist/quill.bubble.css';
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: "Editor",
|
||||
name: 'Editor',
|
||||
props: {
|
||||
/* 编辑器的内容 */
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: '',
|
||||
},
|
||||
/* 高度 */
|
||||
height: {
|
||||
@@ -55,36 +53,37 @@ export default {
|
||||
/* 类型(base64格式、url格式) */
|
||||
type: {
|
||||
type: String,
|
||||
default: "url",
|
||||
}
|
||||
default: 'url',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||
uploadFileUrl:
|
||||
process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 请求地址
|
||||
headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
|
||||
Quill: null,
|
||||
currentValue: "",
|
||||
currentValue: '',
|
||||
options: {
|
||||
theme: "snow",
|
||||
theme: 'snow',
|
||||
bounds: document.body,
|
||||
debug: "warn",
|
||||
debug: 'warn',
|
||||
modules: {
|
||||
// 工具栏配置
|
||||
toolbar: [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
||||
['blockquote', 'code-block'], // 引用 代码块
|
||||
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
|
||||
[{ indent: '-1' }, { indent: '+1' }], // 缩进
|
||||
[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image", "video"] // 链接、图片、视频
|
||||
['clean'], // 清除文本格式
|
||||
['link', 'image', 'video'], // 链接、图片、视频
|
||||
],
|
||||
},
|
||||
placeholder: "请输入内容",
|
||||
readOnly: true,
|
||||
placeholder: '请输入内容',
|
||||
// readOnly: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -104,7 +103,7 @@ export default {
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val !== this.currentValue) {
|
||||
this.currentValue = val === null ? "" : val;
|
||||
this.currentValue = val === null ? '' : val;
|
||||
if (this.Quill) {
|
||||
this.Quill.pasteHTML(this.currentValue);
|
||||
}
|
||||
@@ -124,41 +123,43 @@ export default {
|
||||
const editor = this.$refs.editor;
|
||||
this.Quill = new Quill(editor, this.options);
|
||||
// 取消自动聚焦 start
|
||||
this.Quill?.enable(false);
|
||||
this.$nextTick(() => {
|
||||
this.Quill.blur();
|
||||
if(!this.readOnly){
|
||||
this.Quill.enable();
|
||||
}
|
||||
this.Quill?.enable(true);
|
||||
this.Quill?.blur();
|
||||
// if (!this.readOnly) {
|
||||
// this.Quill?.enable();
|
||||
// }
|
||||
});
|
||||
// 如果设置了上传地址则自定义图片上传事件
|
||||
if (this.type === 'url') {
|
||||
let toolbar = this.Quill.getModule("toolbar");
|
||||
toolbar.addHandler("image", (value) => {
|
||||
this.uploadType = "image";
|
||||
let toolbar = this.Quill.getModule('toolbar');
|
||||
toolbar.addHandler('image', (value) => {
|
||||
this.uploadType = 'image';
|
||||
if (value) {
|
||||
this.$refs.upload.$children[0].$refs.input.click();
|
||||
} else {
|
||||
this.quill.format("image", false);
|
||||
this.quill.format('image', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.Quill.pasteHTML(this.currentValue);
|
||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
this.Quill.on('text-change', (delta, oldDelta, source) => {
|
||||
const html = this.$refs.editor.children[0].innerHTML;
|
||||
const text = this.Quill.getText();
|
||||
const quill = this.Quill;
|
||||
this.currentValue = html;
|
||||
this.$emit("input", html);
|
||||
this.$emit("on-change", { html, text, quill });
|
||||
this.$emit('input', html);
|
||||
this.$emit('on-change', { html, text, quill });
|
||||
});
|
||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
this.$emit("on-text-change", delta, oldDelta, source);
|
||||
this.Quill.on('text-change', (delta, oldDelta, source) => {
|
||||
this.$emit('on-text-change', delta, oldDelta, source);
|
||||
});
|
||||
this.Quill.on("selection-change", (range, oldRange, source) => {
|
||||
this.$emit("on-selection-change", range, oldRange, source);
|
||||
this.Quill.on('selection-change', (range, oldRange, source) => {
|
||||
this.$emit('on-selection-change', range, oldRange, source);
|
||||
});
|
||||
this.Quill.on("editor-change", (eventName, ...args) => {
|
||||
this.$emit("on-editor-change", eventName, ...args);
|
||||
this.Quill.on('editor-change', (eventName, ...args) => {
|
||||
this.$emit('on-editor-change', eventName, ...args);
|
||||
});
|
||||
},
|
||||
// 上传前校检格式和大小
|
||||
@@ -183,97 +184,112 @@ export default {
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
// edit by 芋道源码
|
||||
quill.insertEmbed(length, "image", res.data);
|
||||
quill.insertEmbed(length, 'image', res.data);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
this.$message.error("图片插入失败");
|
||||
this.$message.error('图片插入失败');
|
||||
}
|
||||
},
|
||||
handleUploadError() {
|
||||
this.$message.error("图片插入失败");
|
||||
this.$message.error('图片插入失败');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.editor, .ql-toolbar {
|
||||
<style lang="scss" scoped>
|
||||
.editor-wrapper {
|
||||
position: relative;
|
||||
cursor: not-allowed;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f5f7fa77;
|
||||
}
|
||||
}
|
||||
.editor,
|
||||
.ql-toolbar {
|
||||
white-space: pre-wrap !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.quill-img {
|
||||
display: none;
|
||||
}
|
||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
||||
content: "请输入链接地址:";
|
||||
.ql-snow .ql-tooltip[data-mode='link']::before {
|
||||
content: '请输入链接地址:';
|
||||
}
|
||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
||||
border-right: 0px;
|
||||
content: "保存";
|
||||
content: '保存';
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip[data-mode="video"]::before {
|
||||
content: "请输入视频地址:";
|
||||
.ql-snow .ql-tooltip[data-mode='video']::before {
|
||||
content: '请输入视频地址:';
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
||||
content: "14px";
|
||||
content: '14px';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
|
||||
content: "10px";
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
|
||||
content: '10px';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
|
||||
content: "18px";
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
|
||||
content: '18px';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
|
||||
content: "32px";
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
|
||||
content: '32px';
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
||||
content: "文本";
|
||||
content: '文本';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
||||
content: "标题1";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
|
||||
content: '标题1';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
||||
content: "标题2";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
|
||||
content: '标题2';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
||||
content: "标题3";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
|
||||
content: '标题3';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
||||
content: "标题4";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
|
||||
content: '标题4';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
||||
content: "标题5";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
|
||||
content: '标题5';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
||||
content: "标题6";
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
|
||||
content: '标题6';
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
||||
content: "标准字体";
|
||||
content: '标准字体';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
||||
content: "衬线字体";
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
|
||||
content: '衬线字体';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
|
||||
content: '等宽字体';
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
<span class="el-icon-document"> {{ fileName }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
||||
<el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
@@ -71,6 +71,11 @@ export default {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//文件名称
|
||||
fName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -81,6 +86,7 @@ export default {
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -105,6 +111,14 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
fName: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
console.log('11', val)
|
||||
this.fileName = val
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -117,6 +131,7 @@ export default {
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
// 校检文件类型
|
||||
this.fileName = file.name
|
||||
if (this.fileType) {
|
||||
let fileExtension = "";
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
@@ -150,7 +165,7 @@ export default {
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.$modal.msgError("上传图片失败,请重试");
|
||||
this.$modal.msgError("上传文件失败,请重试");
|
||||
this.$modal.closeLoading()
|
||||
},
|
||||
// 上传成功回调
|
||||
@@ -180,8 +195,12 @@ export default {
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
this.returnFileName()
|
||||
}
|
||||
},
|
||||
returnFileName() {
|
||||
this.$emit('name', this.fileName)
|
||||
},
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
console.log('你好', name)
|
||||
|
||||
@@ -360,6 +360,7 @@ export default {
|
||||
ts: Date.now(), // 现在的时间戳
|
||||
}
|
||||
reqGet(data).then(res => {
|
||||
console.log(1)
|
||||
if (res.repCode === '0000') {
|
||||
this.backImgBase = res.repData.originalImageBase64
|
||||
this.blockBackImgBase = res.repData.jigsawImageBase64
|
||||
|
||||
@@ -1,978 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="dialog-with-menu" :visible="dialogVisible" :destroy-on-close="false" @close="handleClose"
|
||||
:close-on-click-modal="configs.clickModalToClose ?? true">
|
||||
<!-- title -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<h1 class="">
|
||||
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="dialog-body__inner relative">
|
||||
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
|
||||
<el-button v-if="configs.allowAdd ?? (dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu))" plain
|
||||
type="primary" size="small" class="at-right-top" style="margin-bottom: 16px" @click="handleAddParam()">+
|
||||
添加</el-button>
|
||||
<template v-if="dataForm.id && !detailMode && /附件/.test(activeMenu)">
|
||||
<el-upload style="position: absolute; width: 100%; height: 0" name="files" :action="uploadUrl"
|
||||
:show-file-list="false" :headers="uploadHeaders" :on-success="handleUploadSuccess"
|
||||
:before-upload="handleUploadCheck">
|
||||
<el-button plain type="primary" size="small" class="at-right-top" style=""> <i class="el-icon-upload"></i> 上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
|
||||
<!-- menu -->
|
||||
<el-tabs v-model="activeMenu" type="card" @tab-click="handleTabClick">
|
||||
<!-- <el-tab-pane v-for="(tab, index) in configs.menu" :key="index" :label="tab.name" :name="tab.name"> -->
|
||||
<el-tab-pane v-for="(tab, index) in actualMenus" :key="index" :name="tab.name">
|
||||
<span class="slot" slot="label">
|
||||
<i :class="{
|
||||
'el-icon-edit': tab.key === 'info',
|
||||
'el-icon-s-data': tab.key === 'attr',
|
||||
'el-icon-folder-opened': tab.key === 'attachment',
|
||||
}"></i>
|
||||
{{ tab.name }}
|
||||
</span>
|
||||
|
||||
<!-- 表单标签页 -->
|
||||
<div v-if="tab.key === 'info'">
|
||||
<!-- form -->
|
||||
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
|
||||
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
|
||||
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
|
||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null"
|
||||
v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)">
|
||||
<div v-if="col.forceDisabled && dataForm.id" class="force-disabled">
|
||||
<el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
|
||||
</div>
|
||||
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable
|
||||
:disabled="disableCondition(col.prop)" v-bind="col.elparams" />
|
||||
<el-cascader v-if="col.cascader" v-model="dataForm[col.prop]" :options="col.options"
|
||||
:disabled="detailMode" v-bind="col.elparams"></el-cascader>
|
||||
<el-select v-if="col.select" v-model="dataForm[col.prop]" clearable
|
||||
:disabled="disableCondition(col.prop)" v-bind="col.elparams"
|
||||
@change="handleSelectChange(col, $event)">
|
||||
<el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
<el-switch v-if="col.switch" v-model="dataForm[col.prop]" :active-value="1" :inactive-value="0"
|
||||
@change="handleSwitchChange" :disabled="disableCondition(col.prop)" />
|
||||
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]"
|
||||
:disabled="disableCondition(col.prop)" v-bind="col.elparams" />
|
||||
<quillEditor v-if="col.richInput" ref="quill-editor" v-model="dataForm[col.prop]"
|
||||
:options="col.quillConfig ?? defaultQuillConfig" style="margin-top: 42px"
|
||||
:disabled="disableCondition(col.prop)" />
|
||||
|
||||
<div class="" v-if="col.component" style="margin: 42px 0 0">
|
||||
<!-- 下面这个 component 几乎是为 富文本 quill 定制的了... TODO:后续可能会根据业务需求创建新的版本 -->
|
||||
<component :is="col.component" :key="'component_' + col.prop"
|
||||
@update:modelValue="handleComponentModelUpdate(col.prop, $event)" :modelValue="dataForm[col.prop]"
|
||||
:mode="detailMode ? 'detail' : dataForm.id ? 'edit' : 'create'" />
|
||||
</div>
|
||||
<!-- add more... -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 表格标签页 -->
|
||||
<div v-if="dataForm.id && tab.key === 'attr'" key="attr-list">
|
||||
<BaseListTable :table-config="null" :column-config="filteredTableProps" :table-data="subList"
|
||||
@operate-event="handleTableRowOperate" :current-page="attrPage" :current-size="attrSize"
|
||||
:refresh-layout-key="Math.random()" v-loading="loadingStatus" />
|
||||
<!-- paginator -->
|
||||
<el-pagination class="" style="text-align: left" background @size-change="handleSizeChange"
|
||||
@current-change="handlePageChange" :current-page.sync="attrPage" :page-sizes="[5, 10, 20]"
|
||||
:page-size="attrSize" :total="attrTotal" layout="total, sizes, prev, next"></el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 附件标签页 -->
|
||||
<div v-if="dataForm.id && tab.key === 'attachment'" key="attachment">
|
||||
<div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">文件大小不要超过 2MB</div>
|
||||
<!-- 附件列表 -->
|
||||
<div class="" v-loading="loadingStatus">
|
||||
<ul class="file-list">
|
||||
<li v-for="(file, index) in fileList" :key="index">
|
||||
<span class="file-name">{{ file.name }}</span>
|
||||
<span class="file-operations">
|
||||
<span class="file-icon preview" @click="handleFileClick('view', file)">
|
||||
<i class="el-icon-view" style="cursor: pointer"></i>
|
||||
</span>
|
||||
<span class="file-icon download" @click="handleFileClick('download', file)">
|
||||
<i class="el-icon-download" style="color: #0b58ff; cursor: pointer"></i>
|
||||
</span>
|
||||
<span class="file-icon delete" @click="handleFileClick('delete', file)">
|
||||
<i class="el-icon-delete" style="color: red; cursor: pointer"></i>
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- img preview dialog -->
|
||||
<el-dialog key="image-preview-dialog" class="image-preview-dialog" :visible.sync="imgPreviewDialogVisible"
|
||||
:append-to-body="true">
|
||||
<div class="img-container">
|
||||
<img width="100%" :src="currentImgUrl" alt="" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<!-- sub dialog -->
|
||||
<small-dialog :append-to-body="true" v-if="showSubDialog" ref="subDialog" :url="urls.subase"
|
||||
:configs="configs.subDialog" :related-id="dataForm.id" @refreshDataList="getSubList"></small-dialog>
|
||||
|
||||
<!-- footer -->
|
||||
<div slot="footer">
|
||||
<template v-for="(operate, index) in configs.form.operations">
|
||||
<el-button v-if="showButton(operate)" :key="'operation_' + index" :type="operate.type"
|
||||
@click="handleBtnClick(operate)"
|
||||
:loading="(operate.name === 'add' || operate.name === 'update') && btnLoading">{{ operate.label }}</el-button>
|
||||
</template>
|
||||
<el-button @click="handleBtnClick({ name: 'cancel' })">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { pick as __pick } from "@/utils/filters";
|
||||
import SmallDialog from "@/components/SmallDialog.vue";
|
||||
import BaseListTable from "@/components/BaseListTable.vue";
|
||||
import Cookies from "js-cookie";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
|
||||
function reConstructTreeData(listObj) {
|
||||
const entry = [];
|
||||
Object.keys(listObj).map((key) => {
|
||||
const currentNode = listObj[key];
|
||||
currentNode.label = currentNode.name;
|
||||
currentNode.value = currentNode.id;
|
||||
if (currentNode.parentId === "0") {
|
||||
entry.push(listObj[key]);
|
||||
return; // return { label: currentNode.name, value: currentNode.id, children: currentNode.children ?? [] };
|
||||
}
|
||||
const parentNode = listObj[currentNode.parentId];
|
||||
if (!parentNode.children) {
|
||||
parentNode.children = [];
|
||||
}
|
||||
parentNode.children.push(currentNode);
|
||||
});
|
||||
return entry;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "DialogWithMenu",
|
||||
components: { SmallDialog, BaseListTable, quillEditor },
|
||||
props: {
|
||||
configs: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
inject: ["urls"],
|
||||
data() {
|
||||
const dataForm = {};
|
||||
const autoDisabledQueue = [];
|
||||
const watingToRefreshQueue = [];
|
||||
const cached = {}
|
||||
|
||||
this.configs.form.rows.forEach((row) => {
|
||||
row.forEach((col) => {
|
||||
if (col.upload) dataForm[col.prop] = col.default ?? [];
|
||||
else dataForm[col.prop] = col.default ?? null;
|
||||
|
||||
if (col.autoDisabled) autoDisabledQueue.push(col.prop);
|
||||
if (!!col.refreshOptionsAfterConfirm) watingToRefreshQueue.push(col);
|
||||
|
||||
if (col.fetchData)
|
||||
col.fetchData().then(({ data: res }) => {
|
||||
console.log("[Fetch Data]", "list" in res.data, res.data, res.data.list);
|
||||
if (res.code === 0) {
|
||||
if (col.cacheFetchedData) {
|
||||
// cache fetched data
|
||||
cached[col.prop] = 'list' in res.data ? res.data.list : (Array.isArray(res.data) ? res.data : [])
|
||||
}
|
||||
|
||||
if (!col.options || !col.options.length) {
|
||||
this.$set(
|
||||
col,
|
||||
"options",
|
||||
"list" in res.data
|
||||
? res.data.list.map((i) => ({
|
||||
label: col.optionLabel ? i[col.optionLabel] : i.name,
|
||||
value: col.optionValue ? i[col.optionValue] : i.id,
|
||||
}))
|
||||
: res.data.map((i) => ({
|
||||
label: col.optionLabel ? i[col.optionLabel] : i.name,
|
||||
value: col.optionValue ? i[col.optionValue] : i.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
// col.options = res.data.list;
|
||||
else if (col.options.length) {
|
||||
"list" in res.data ? res.data.list.unshift(...col.options) : res.data.unshift(...col.options);
|
||||
this.$set(
|
||||
col,
|
||||
"options",
|
||||
"list" in res.data
|
||||
? res.data.list.map((i) => ({
|
||||
label: col.optionLabel ? i[col.optionLabel] : i.name,
|
||||
value: col.optionValue ? i[col.optionValue] : i.id,
|
||||
}))
|
||||
: res.data.map((i) => ({
|
||||
label: col.optionLabel ? i[col.optionLabel] : i.name,
|
||||
value: col.optionValue ? i[col.optionValue] : i.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
col.options.splice(0);
|
||||
}
|
||||
// dataForm[col.prop] = col.default ?? null; // not perfect!
|
||||
});
|
||||
else if (col.fetchTreeData) {
|
||||
// 获取设备类型时触发的,用于前端构建属性结构,约定,parentId 为0时是顶级节点
|
||||
col.fetchTreeData().then(({ data: res }) => {
|
||||
console.log("[Fetch Tree Data]", res.data);
|
||||
if (res.code === 0) {
|
||||
// 先把数据先重构成一个对象
|
||||
const obj = {};
|
||||
|
||||
if ("list" in res.data) {
|
||||
res.data.list.map((item) => {
|
||||
obj[item.id] = item;
|
||||
});
|
||||
} else if (Array.isArray(res.data)) {
|
||||
res.data.map((item) => {
|
||||
obj[item.id] = item;
|
||||
});
|
||||
}
|
||||
// 再过滤这个对象
|
||||
let filteredList = reConstructTreeData(obj);
|
||||
console.log("** filteredList **", filteredList);
|
||||
// 最后设置 options
|
||||
this.$set(col, "options", filteredList);
|
||||
} else {
|
||||
col.options.splice(0);
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
// configs,
|
||||
btnLoading: false,
|
||||
loadingStatus: false,
|
||||
activeMenu: this.configs.menu[0].name,
|
||||
dataForm,
|
||||
detailMode: false,
|
||||
autoDisabledQueue,
|
||||
watingToRefreshQueue,
|
||||
cached,
|
||||
showBaseDialog: false,
|
||||
baseDialogConfig: null,
|
||||
subList: [],
|
||||
showSubDialog: false,
|
||||
disableXXX: false,
|
||||
defaultQuillConfig: {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ font: [] }],
|
||||
[{ size: ["small", false, "large", "huge"] }], // custom dropdown
|
||||
["bold", "italic", "underline", "strike"], // toggled buttons
|
||||
[{ color: [] }, { background: [] }], // dropdown with defaults from theme
|
||||
["blockquote", "code-block"],
|
||||
[{ header: 1 }, { header: 2 }], // custom button values
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
// [{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
|
||||
[{ indent: "-1" }, { indent: "+1" }], // outdent/indent
|
||||
// [{ 'direction': 'rtl' }], // text direction
|
||||
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
|
||||
// [{ 'align': [] }],
|
||||
// ['clean'] // remove formatting button
|
||||
],
|
||||
},
|
||||
theme: "snow",
|
||||
readOnly: false,
|
||||
placeholder: "在这里输入描述信息...",
|
||||
scrollingContainer: null,
|
||||
},
|
||||
attrPage: 1,
|
||||
attrSize: 10,
|
||||
attrTotal: 0,
|
||||
fileList: [],
|
||||
imgPreviewDialogVisible: false,
|
||||
currentImgUrl: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.configs.form.rows.forEach((row) => {
|
||||
row.forEach((col) => {
|
||||
if (col.changeReflects && typeof col.changeReflects === 'object' && 'fromKey' in col.changeReflects && 'toProp' in col.changeReflects) {
|
||||
this.$watch(
|
||||
() => this.dataForm[col.prop],
|
||||
val => {
|
||||
if (val && (col.prop in this.cached)) {
|
||||
console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop])
|
||||
if (typeof col.changeReflects.fromKey === 'string') {
|
||||
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)?.[col.changeReflects.fromKey]
|
||||
} else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
|
||||
const foundItem = this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)
|
||||
if (foundItem) {
|
||||
const values = col.changeReflects.fromKey.map(key => foundItem[key])
|
||||
this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter)
|
||||
} else {
|
||||
this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter
|
||||
console.log("[DialogWithMenu] mounted() 没找到对应数据")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: false
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
watch: {
|
||||
dialogVisible: function (val) {
|
||||
if (!!val) {
|
||||
this.attrPage = 1
|
||||
this.attrSize = 10
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
actualMenus() {
|
||||
return this.configs.menu.filter((m) => {
|
||||
if (m.onlyEditMode && !this.dataForm.id) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
},
|
||||
filteredTableProps() {
|
||||
return this.detailMode ? this.configs.table.props.filter((v) => v.prop !== "operations") : this.configs.table.props;
|
||||
},
|
||||
uploadHeaders() {
|
||||
return {
|
||||
token: Cookies.get("token") || "",
|
||||
};
|
||||
},
|
||||
uploadUrl() {
|
||||
return this.configs.menu.find((item) => item.key === "attachment")?.actionUrl || "#";
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
disableCondition(prop) {
|
||||
return this.detailMode || (this.disableXXX && this.autoDisabledQueue.indexOf(prop) !== -1);
|
||||
},
|
||||
/** utitilities */
|
||||
showButton(operate) {
|
||||
const notDetailMode = !this.detailMode;
|
||||
const showAlways = operate.showAlways ?? false;
|
||||
const editMode = operate.showOnEdit && this.dataForm.id;
|
||||
const addMode = !operate.showOnEdit && !this.dataForm.id;
|
||||
const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
|
||||
const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key;
|
||||
return notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info";
|
||||
},
|
||||
|
||||
resetForm(excludeId = false, immediate = false) {
|
||||
setTimeout(
|
||||
() => {
|
||||
Object.keys(this.dataForm).forEach((key) => {
|
||||
if (excludeId && key === "id") return;
|
||||
if ("files" in this.dataForm) this.dataForm.files = [];
|
||||
if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
|
||||
else this.dataForm[key] = null;
|
||||
if (Array.isArray(this.fileList)) {
|
||||
this.fileList = [];
|
||||
}
|
||||
});
|
||||
this.activeMenu = this.configs.menu[0].name;
|
||||
this.$refs.dataForm[0].clearValidate();
|
||||
},
|
||||
immediate ? 0 : 200
|
||||
);
|
||||
},
|
||||
|
||||
updateOptions() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.watingToRefreshQueue.length) {
|
||||
this.watingToRefreshQueue.forEach((opt) => {
|
||||
console.log("[刷新数据, ", opt, "]");
|
||||
if ("fetchData" in opt) {
|
||||
opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$set(
|
||||
opt,
|
||||
"options",
|
||||
"list" in res.data
|
||||
? res.data.list.map((i) => ({ label: i.code, value: i.id }))
|
||||
: res.data.map((i) => ({ label: i.code, value: i.id }))
|
||||
);
|
||||
|
||||
resolve({ done: true });
|
||||
} else {
|
||||
this.$message({
|
||||
message: `${res.code}: ${res.msg}`,
|
||||
type: "error",
|
||||
duration: 1500,
|
||||
});
|
||||
|
||||
resolve({ done: false });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else resolve(null);
|
||||
});
|
||||
},
|
||||
|
||||
/** init **/
|
||||
init(id, detailMode, menu) {
|
||||
// this.dialogVisible = true;
|
||||
if (this.$refs.dataForm && this.$refs.dataForm.length) {
|
||||
// 当不是首次渲染dialog的时候,一开始就清空验证信息,本组件的循环里只有一个 dataForm 所以只用取 [0] 即可
|
||||
this.$refs.dataForm[0].clearValidate();
|
||||
}
|
||||
console.log("[dialog] DialogWithHead init():", id, detailMode);
|
||||
|
||||
this.detailMode = detailMode ?? false;
|
||||
this.$nextTick(() => {
|
||||
this.dataForm.id = id || null;
|
||||
if (this.dataForm.id) {
|
||||
// 如果是编辑
|
||||
this.loadingStatus = true;
|
||||
// 提前获取属性列表
|
||||
this.getSubList();
|
||||
// 获取详情
|
||||
this.updateOptions().then((result) => {
|
||||
if (result === null || (typeof result === "object" && result.done)) {
|
||||
this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
const dataFormKeys = Object.keys(this.dataForm);
|
||||
this.dataForm = __pick(res.data, dataFormKeys);
|
||||
if ("files" in res.data) {
|
||||
console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList);
|
||||
/** 返回的文件列表 */
|
||||
this.fileList = res.data.files
|
||||
? res.data.files.map((file) => ({
|
||||
id: file.id,
|
||||
name: file.fileUrl.split("/").pop(),
|
||||
url: file.fileUrl,
|
||||
typeCode: file.typeCode,
|
||||
}))
|
||||
: [];
|
||||
}
|
||||
}
|
||||
this.loadingStatus = false;
|
||||
// 是否要跳转到附件页
|
||||
if (menu && menu.key) {
|
||||
this.activeMenu = this.configs.menu.find((item) => item.key === menu.key)?.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 如果不是编辑
|
||||
this.updateOptions();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** handlers */
|
||||
handleFileClick(type, file) {
|
||||
switch (type) {
|
||||
case "view": {
|
||||
// 加载图片
|
||||
this.$http
|
||||
.get("/pms/attachment/downloadFile", {
|
||||
params: {
|
||||
attachmentId: file.id,
|
||||
type: 0, // 0 预览,1 下载
|
||||
},
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
console.log("preivew", res);
|
||||
if (/image/i.test(res.type)) {
|
||||
// 显示图片
|
||||
this.currentImgUrl = URL.createObjectURL(res);
|
||||
this.imgPreviewDialogVisible = true;
|
||||
} else if (/pdf/i.test(res.type)) {
|
||||
// 预览pdf
|
||||
let a = document.createElement('a')
|
||||
a.setAttribute('target', '_blank')
|
||||
a.href = URL.createObjectURL(res)
|
||||
a.click()
|
||||
console.log('before remove a ', a)
|
||||
a.remove()
|
||||
console.log('removed a ', a)
|
||||
} else {
|
||||
this.$message({
|
||||
message: "非图片和PDF文件请下载后预览",
|
||||
type: "error",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case "download": {
|
||||
// 下载图片
|
||||
this.$http
|
||||
.get("/pms/attachment/downloadFile", {
|
||||
params: {
|
||||
attachmentId: file.id,
|
||||
type: 1, // 0 预览,1 下载
|
||||
},
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
const blob = new Blob([res]);
|
||||
|
||||
/** 通知 */
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "开始下载",
|
||||
type: "success",
|
||||
duration: 1200,
|
||||
});
|
||||
|
||||
if ("download" in document.createElement("a")) {
|
||||
const alink = document.createElement("a");
|
||||
alink.download = file.name;
|
||||
alink.style.display = "none";
|
||||
alink.target = "_blank";
|
||||
alink.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(alink);
|
||||
alink.click();
|
||||
URL.revokeObjectURL(alink.href);
|
||||
document.body.removeChild(alink);
|
||||
} else {
|
||||
navigator.msSaveBlob(blob, fileName);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "delete": {
|
||||
return this.$confirm(`确定删除图片: ${file.name}`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "我再想想",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.loadingStatus = true;
|
||||
const newFilelist = this.fileList.filter((f) => f.id !== file.id);
|
||||
this.updateRemoteFiles(newFilelist).then((msg) => {
|
||||
if (msg && msg === "success") {
|
||||
this.fileList = newFilelist;
|
||||
this.loadingStatus = false;
|
||||
/** 通知 */
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "已删除",
|
||||
type: "success",
|
||||
duration: 1200,
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => { });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
console.log("[DialogWithMenu] uploadedFileList", response, file, fileList);
|
||||
|
||||
if (response.code === 0) {
|
||||
const uploadedFile = response.data[0];
|
||||
const fileItem = {
|
||||
id: uploadedFile.id,
|
||||
name: uploadedFile.fileUrl.split("/").pop(),
|
||||
url: uploadedFile.fileUrl,
|
||||
typeCode: file.typeCode,
|
||||
};
|
||||
|
||||
this.loadingStatus = true;
|
||||
this.updateRemoteFiles([...this.fileList, fileItem]).then((msg) => {
|
||||
if (msg && msg === "success") {
|
||||
this.fileList.push(fileItem);
|
||||
this.loadingStatus = false;
|
||||
/** 通知 */
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: "上传成功",
|
||||
type: "success",
|
||||
duration: 1200,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
updateRemoteFiles(filelist) {
|
||||
return this.$http
|
||||
.put("/pms/product", {
|
||||
id: "id" in this.dataForm ? this.dataForm.id : "DEFAULT_ID",
|
||||
fileIds: filelist.map((f) => f.id),
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) return "success";
|
||||
});
|
||||
},
|
||||
|
||||
handleUploadCheck(file) {
|
||||
console.log("[before upload]", file);
|
||||
const LIMIT = 2 * 1024 * 1024; // bytes
|
||||
if (file.size > LIMIT) {
|
||||
this.$message({
|
||||
message: "文件大小不能超过 2MB",
|
||||
type: "error",
|
||||
duration: 1500,
|
||||
});
|
||||
return false;
|
||||
} else return true;
|
||||
},
|
||||
|
||||
handleComponentModelUpdate(propName, { subject, payload: { data } }) {
|
||||
this.dataForm[propName] = JSON.stringify(data);
|
||||
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
|
||||
},
|
||||
handleSelectChange(col, eventValue) {
|
||||
console.log("[dialog] select change: ", col, eventValue);
|
||||
},
|
||||
handleSwitchChange(val) {
|
||||
console.log("[dialog] switch change: ", val, this.dataForm);
|
||||
},
|
||||
handleBtnClick(payload) {
|
||||
console.log("btn click payload: ", payload);
|
||||
|
||||
if ("name" in payload) {
|
||||
switch (payload.name) {
|
||||
case "cancel":
|
||||
this.handleClose();
|
||||
break;
|
||||
case "reset":
|
||||
this.resetForm(true, true); // true means exclude id
|
||||
break;
|
||||
case "add":
|
||||
case "update": {
|
||||
this.$refs.dataForm[0].validate((passed, result) => {
|
||||
if (passed) {
|
||||
// 如果通过验证
|
||||
this.btnLoading = true
|
||||
this.loadingStatus = true;
|
||||
const method = payload.name === "add" ? "POST" : "PUT";
|
||||
|
||||
// 判断是否有附件选项
|
||||
const hasAttachment = !!this.configs.menu.find((item) => item.key === "attachment");
|
||||
if (hasAttachment) {
|
||||
const fileIds = this.fileList.map((item) => item.id);
|
||||
this.$set(this.dataForm, "fileIds", fileIds);
|
||||
}
|
||||
|
||||
// 加载额外需要的 id
|
||||
let extraIds = {};
|
||||
if (this.configs.extraIds && typeof this.configs.extraIds === "object") {
|
||||
// 如果配置里,有 extraIds 选项
|
||||
Object.entries(this.configs.extraIds).forEach(([key, value]) => {
|
||||
extraIds[key] = value;
|
||||
});
|
||||
}
|
||||
|
||||
// 实际发送请求
|
||||
this.btnLoading = true
|
||||
this.$http({
|
||||
url: this.urls.base,
|
||||
method,
|
||||
data: {
|
||||
...extraIds,
|
||||
...this.dataForm,
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.btnLoading = false
|
||||
this.loadingStatus = false;
|
||||
console.log("[add&update] res is: ", res);
|
||||
if (res.code === 0) {
|
||||
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
|
||||
this.$emit("refreshDataList");
|
||||
|
||||
// 如果 watingToRefreshQueue 队列里有数据
|
||||
// if (this.watingToRefreshQueue.length) {
|
||||
// // 刷新队列
|
||||
// this.watingToRefreshQueue.forEach((opt) => {
|
||||
// console.log("[刷新数据, ", opt, "]");
|
||||
// if ("fetchData" in opt) {
|
||||
// opt.fetchData().then(({ data: res }) => {
|
||||
// if (res.code === 0) {
|
||||
// this.$set(
|
||||
// opt,
|
||||
// "options",
|
||||
// "list" in res.data
|
||||
// ? res.data.list.map((i) => ({ label: i.name, value: i.id }))
|
||||
// : res.data.map((i) => ({ label: i.name, value: i.id }))
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
this.handleClose();
|
||||
} else {
|
||||
this.$message({
|
||||
message: `${res.code}: ${res.msg}`,
|
||||
type: "error",
|
||||
duration: 2000,
|
||||
});
|
||||
if (this.btnLoading) this.btnLoading = false
|
||||
}
|
||||
})
|
||||
.catch((errMsg) => {
|
||||
this.$message.error("参数错误:" + errMsg);
|
||||
if (this.loadingStatus) this.loadingStatus = false;
|
||||
if (this.btnLoading) this.btnLoading = false
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请核查字段信息");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleTabClick(payload) {
|
||||
// console.log("tab click payload: ", this.activeMenu);
|
||||
// if (this.activeMenu === this.configs.menu[1].name) {
|
||||
// // 获取数据
|
||||
// this.getSubList();
|
||||
// }
|
||||
},
|
||||
|
||||
handlePageChange(val) {
|
||||
this.getSubList(val, this.attrSize);
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.attrPage = 1;
|
||||
this.attrSize = val
|
||||
this.getSubList(1, val);
|
||||
},
|
||||
|
||||
getSubList(page, size) {
|
||||
const params = {};
|
||||
params.page = page ?? this.attrPage;
|
||||
params.limit = size ?? this.attrSize;
|
||||
|
||||
const requiredParams = this.configs.table.extraParams;
|
||||
if (requiredParams) {
|
||||
if (Array.isArray(requiredParams)) {
|
||||
requiredParams.forEach((str) => {
|
||||
if (/id/i.test(str)) {
|
||||
params[str] = this.dataForm.id;
|
||||
} else {
|
||||
params[str] = "";
|
||||
}
|
||||
});
|
||||
} else if (typeof requiredParams === "string") {
|
||||
// 如果需要额外参数,一般肯定需要
|
||||
params[this.configs.table.extraParams] = this.dataForm.id;
|
||||
// 此时 dataForm.id 一定是存在的
|
||||
}
|
||||
}
|
||||
this.$http.get(this.urls.subpage, { params }).then(({ data: res }) => {
|
||||
console.log("[DialogWithMenu] getSubList:", res);
|
||||
if (res.code === 0 && res.data?.list) {
|
||||
// 有数据
|
||||
this.subList = res.data.list;
|
||||
this.attrTotal = res.data.total;
|
||||
} else {
|
||||
this.subList.splice(0);
|
||||
this.attrTotal = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleAddParam(id) {
|
||||
this.showSubDialog = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.subDialog.init(id ?? null);
|
||||
});
|
||||
},
|
||||
|
||||
handleClose() {
|
||||
this.resetForm();
|
||||
this.$emit("update:dialogVisible", false);
|
||||
},
|
||||
|
||||
/** 列表handlers */
|
||||
handleAddItem() {
|
||||
// console.log('[dialog] handleAddItem ot list...');
|
||||
this.showBaseDialog = true;
|
||||
this.$nextTick(() => {
|
||||
console.log("[sub-dialog] ", this.$refs["sub-dialog"].init());
|
||||
});
|
||||
},
|
||||
handleTableRowOperate({ type, data }) {
|
||||
console.log("handleTableRowOperate", type, data);
|
||||
|
||||
switch (type) {
|
||||
case "delete": {
|
||||
// 确认是否删除
|
||||
console.log('delete....', data)
|
||||
const itemName = typeof data === 'object' ? (data.attrName || data.name || data.material || data.id) : data
|
||||
return this.$confirm(`是否删除条目: ${itemName}`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "我再想想",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
// this.$http.delete(this.urls.base + `/${data}`).then((res) => {
|
||||
this.$http({
|
||||
url: this.urls.subase,
|
||||
method: "DELETE",
|
||||
data: [`${data.id}`],
|
||||
}).then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success({
|
||||
message: "删除成功!",
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.getSubList(1, 20);
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => { });
|
||||
}
|
||||
case "edit": {
|
||||
this.handleAddParam(data); /** data is ==> id */
|
||||
break;
|
||||
}
|
||||
// case 'view-detail-action':
|
||||
// this.openDialog(data, true);
|
||||
// break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-menu {
|
||||
margin: 16px 0 !important;
|
||||
}
|
||||
|
||||
.el-menu.el-menu--horizontal {
|
||||
border: none !important;
|
||||
/* background: #0f02 !important; */
|
||||
}
|
||||
|
||||
/* .el-menu--horizontal > .el-menu-item.is-active { */
|
||||
/* border-bottom-color: #0b58ff; */
|
||||
/* } */
|
||||
|
||||
.dialog-with-menu>>>.el-dialog__body {
|
||||
/* padding-top: 16px !important;
|
||||
padding-bottom: 16px !important; */
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
.el-cascader {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dialog-with-menu>>>.el-dialog__header {
|
||||
padding: 10px 20px 10px;
|
||||
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
|
||||
}
|
||||
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.at-right-top {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
ul.file-list,
|
||||
ul.file-list>li {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.file-list {
|
||||
max-height: 20vh;
|
||||
overflow-y: auto;
|
||||
margin-top: 12px;
|
||||
/* width: 240px; */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
ul.file-list>li {
|
||||
border-radius: 4px;
|
||||
background-color: #edededd2;
|
||||
padding: 8px;
|
||||
margin-bottom: 2px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
ul.file-list>li:hover {
|
||||
background-color: #ededed;
|
||||
}
|
||||
|
||||
.file-operations {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
margin-right: 8px;
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
place-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
/* .image-preview-dialog {
|
||||
} */
|
||||
|
||||
.force-disabled {
|
||||
margin-top: 42px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="right-msg" :style="blackTitle ? 'color: #000' : 'color: #fff'">
|
||||
<div class="home-icon" v-if='blackTitle'>
|
||||
<svg-icon icon-class="home" style="font-size: 24px; cursor: pointer;" @click="toHome"/>
|
||||
</div>
|
||||
<div class="time-msg">
|
||||
<div class="line1">{{timeZone}} {{topTime}}</div>
|
||||
<div class="line2">{{topDate}}</div>
|
||||
@@ -45,7 +48,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.getUserMsg()
|
||||
this.getTime()
|
||||
},
|
||||
@@ -73,7 +76,10 @@ export default {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.href = getPath('/');
|
||||
})
|
||||
}).catch(() => {});
|
||||
}).catch(() => {})
|
||||
},
|
||||
toHome() {
|
||||
this.$router.push({ path: "/" })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,13 +89,16 @@ export default {
|
||||
float: right;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
// color: #fff;
|
||||
// padding-top: 15px;
|
||||
// padding-right: 38px;
|
||||
.time-msg {
|
||||
display: inline-block;
|
||||
margin-right: 30px;
|
||||
}
|
||||
.home-icon {
|
||||
display: inline-block;
|
||||
margin-right: 30px;
|
||||
vertical-align: top;
|
||||
padding-top: 7px;
|
||||
}
|
||||
.base-msg {
|
||||
display: inline-block;
|
||||
.avatar {
|
||||
|
||||
@@ -33,6 +33,7 @@ export default {
|
||||
addUrl: '',
|
||||
pageUrl: '',
|
||||
infoUrl: '',
|
||||
deleteUrl: '',
|
||||
basePath: '',
|
||||
form: {}
|
||||
};
|
||||
@@ -60,7 +61,7 @@ export default {
|
||||
return this.$axios({
|
||||
url,
|
||||
method,
|
||||
params: method === 'get' ? payload : null,
|
||||
params: (method === 'get' || method === 'delete') ? payload : null,
|
||||
data: method !== 'get' ? payload : null,
|
||||
})
|
||||
},
|
||||
@@ -77,6 +78,7 @@ export default {
|
||||
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
|
||||
},
|
||||
del(payload) {
|
||||
debugger;
|
||||
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
|
||||
},
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
// 增加三方登陆 update by 芋艿
|
||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee', '/AGVBoard', '/coldBoard', '/processingBoard']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
@@ -19,7 +19,12 @@ router.beforeEach((to, from, next) => {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
}
|
||||
// else if (to.path === '/AGVBoard') {
|
||||
// next({ path: '/AGVBoard' })
|
||||
// NProgress.done()
|
||||
// }
|
||||
else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
isRelogin.show = true
|
||||
// 获取字典数据 add by 芋艿
|
||||
|
||||
@@ -88,6 +88,31 @@ export const constantRoutes = [
|
||||
// // }
|
||||
// // ]
|
||||
// },
|
||||
{
|
||||
path: '/AGVBoard',
|
||||
name: 'AGVBoard',
|
||||
// component: Layout,
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/AGVBoard.vue')
|
||||
},
|
||||
{
|
||||
path: '/coldBoard',
|
||||
name: 'coldBoard',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/coldBoard.vue')
|
||||
},
|
||||
{
|
||||
path: '/processingBoard',
|
||||
name: 'processingBoard',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/processingBoard.vue')
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
|
||||
@@ -163,7 +163,7 @@ input, textarea{
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(144,147,153,.5);
|
||||
background-color: #EDEDED;
|
||||
background-clip: padding-box;
|
||||
min-height: 28px;
|
||||
-webkit-border-radius: 2em;
|
||||
@@ -174,7 +174,7 @@ input, textarea{
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(144,147,153,.3);
|
||||
background-color: #D9D9D9;
|
||||
}
|
||||
|
||||
// 抽屉head区域---start
|
||||
@@ -197,3 +197,7 @@ input, textarea{
|
||||
vertical-align: middle;
|
||||
}
|
||||
// 抽屉head区域---end
|
||||
// 弹出框,上下分布,去掉label的padding-bottom
|
||||
.el-form--label-top .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
@@ -187,19 +187,6 @@ export function getTenantEnable() {
|
||||
return process.env.VUE_APP_TENANT_ENABLE || true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得验证码功能是否开启
|
||||
*/
|
||||
export function getCaptchaEnable() {
|
||||
if (process.env.VUE_APP_CAPTCHA_ENABLE === "true") {
|
||||
return true;
|
||||
}
|
||||
if (process.env.VUE_APP_CAPTCHA_ENABLE === "false") {
|
||||
return false;
|
||||
}
|
||||
return process.env.VUE_APP_CAPTCHA_ENABLE || true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得文档是否开启
|
||||
*/
|
||||
|
||||
1016
src/views/OperationalOverview/AGVBoard.vue
Normal file
1136
src/views/OperationalOverview/coldBoard.vue
Normal file
127
src/views/OperationalOverview/components/BarChart.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div :id="id" :class="className" :style="{ height: height, width:width}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
name: 'OverviewBar',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: 'OverviewLine'
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
legendData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
top: 10,
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
|
||||
}
|
||||
},
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
||||
},
|
||||
yAxis: {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
|
||||
}
|
||||
},
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [120, 200, 150, 80, 70, 110, 130],
|
||||
type: 'bar',
|
||||
showBackground: true,
|
||||
backgroundStyle: {
|
||||
color: 'rgba(180, 180, 180, 0.2)'
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
253
src/views/OperationalOverview/components/LineChart.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-01-24 13:27:41
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<!-- <div :id="id" :class="className" :style="{ height: '65%', width:width}" /> -->
|
||||
<div :id="id" :class="className" :style="{ paddingTop: '1.25em', height: height + 'px', width:width}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
name: 'OverviewBar',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: 'OverviewLine'
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
legendPosition: {
|
||||
type: String,
|
||||
default: 'center'
|
||||
},
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
legendData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '1%',
|
||||
bottom: '0',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
itemHeight: 10,
|
||||
itemWidth: 10,
|
||||
x: this.legendPosition, // 可设定图例在左、右、居中
|
||||
y: 'top', // 可设定图例在上、下、居中
|
||||
show: this.showLegend,
|
||||
data: this.legendData,
|
||||
top: 28,
|
||||
right: '1%',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#ced1d5'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
splitLine: { show: false }, // 去除网格线
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
|
||||
}
|
||||
},
|
||||
data: ['1', '5', '15', '20', '25', '30']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: { show: false }, // 去除网格线
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: this.showLegend ? this.legendData[0].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#3574a8',
|
||||
lineStyle: {
|
||||
color: '#3574a8'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [120, 32, 101, 134, 90, 230, 210]
|
||||
},
|
||||
{
|
||||
name: this.showLegend ? this.legendData[1].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#9f3476',
|
||||
lineStyle: {
|
||||
color: '#9f3476'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [270, 182, 191, 234, 290, 230, 210]
|
||||
},
|
||||
{
|
||||
name: this.showLegend ? this.legendData[2].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#30959d',
|
||||
lineStyle: {
|
||||
color: '#30959d'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [160, 32, 301, 154, 190, 330, 210]
|
||||
},
|
||||
{
|
||||
name: this.showLegend ? this.legendData[3].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#5255be',
|
||||
lineStyle: {
|
||||
color: '#5255be'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [150, 132, 21, 234, 190, 130, 320]
|
||||
},
|
||||
{
|
||||
name: this.showLegend ? this.legendData[4].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#8b4449',
|
||||
lineStyle: {
|
||||
color: '#8b4449'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [210, 332, 201, 34, 290, 230, 320]
|
||||
},
|
||||
{
|
||||
name: this.showLegend ? this.legendData[5].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#a29848',
|
||||
lineStyle: {
|
||||
color: '#a29848'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [20, 62, 101, 34, 190, 30, 120]
|
||||
},
|
||||
{
|
||||
name: this.showLegend && this.legendData[6] ? this.legendData[6].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#a29848',
|
||||
lineStyle: {
|
||||
color: '#a29848'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [20, 62, 101, 34, 190, 30, 120]
|
||||
},
|
||||
{
|
||||
name: this.showLegend && this.legendData[7] ? this.legendData[7].name : '',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#a29848',
|
||||
lineStyle: {
|
||||
color: '#a29848'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [20, 62, 101, 34, 190, 30, 120]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart{
|
||||
margin-top: -3em
|
||||
}
|
||||
</style>
|
||||
221
src/views/OperationalOverview/components/PieChart.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-01-24 09:12:18
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :id="id" :class="className" :style="{ height: computedHeight, width: width }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
name: 'OverviewBar',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: 'DefaultPieChart'
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
showCenterTitle: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
legendConfig: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
seriesConfig: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
seriesData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
barColor: {
|
||||
type: Array,
|
||||
default: () => [
|
||||
'#5fe1d2',
|
||||
'#ffb2b0',
|
||||
'#8e90ff',
|
||||
'#f058aa',
|
||||
'#8652da',
|
||||
'#87fb84',
|
||||
'#61b9ff',
|
||||
'#fdf6a6',
|
||||
'#ffc465',
|
||||
'#98d9ff'
|
||||
]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const lData = this.seriesData
|
||||
return {
|
||||
chart: null,
|
||||
defaultConfig: {
|
||||
// 默认的legend配置
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: '75%',
|
||||
bottom: 0,
|
||||
itemHeight: 10,
|
||||
itemWidth: 10,
|
||||
formatter: function(name) {
|
||||
let pieLegendVale = {}
|
||||
lData.filter((item, index) => {
|
||||
if (item.name === name) {
|
||||
pieLegendVale = item
|
||||
}
|
||||
})
|
||||
const arr = ['{b|' + pieLegendVale.name + '}', '{a|' + pieLegendVale.value + '}']
|
||||
return arr.join(' ')
|
||||
},
|
||||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
align: 'center',
|
||||
fontSize: 10,
|
||||
color: '#f988bf',
|
||||
lineHeight: 16
|
||||
},
|
||||
b: {
|
||||
// verticalAlign: 'top',
|
||||
align: 'center',
|
||||
fontSize: 10,
|
||||
color: '#dddfe1'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 默认的series配置
|
||||
series: {
|
||||
center: ['35%', '50%'],
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: '20',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
computedHeight: function() {
|
||||
if (/[0-9]+%$/.test(this.height)) {
|
||||
// 如果是百分比
|
||||
return this.height
|
||||
}
|
||||
return this.height * this.beilv + 'px'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.chart.setOption({
|
||||
title: this.showCenterTitle
|
||||
? {
|
||||
text: '总共',
|
||||
subtext: this.seriesData.reduce((pre, cur) => pre + cur.value, 0),
|
||||
top: '32%',
|
||||
left: '49%',
|
||||
textAlign: 'center',
|
||||
itemGap: 5,
|
||||
textStyle: {
|
||||
color: '#c0c0c0',
|
||||
fontSize: 16,
|
||||
fontWeight: 'lighter',
|
||||
lineHeight: 15
|
||||
},
|
||||
subtextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 24,
|
||||
lineHeight: 20
|
||||
}
|
||||
}
|
||||
: {},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
grid: {
|
||||
top: '0px',
|
||||
right: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
// 默认配置
|
||||
...this.defaultConfig.legend,
|
||||
// 外部传入配置
|
||||
...this.legendConfig
|
||||
},
|
||||
color: this.barColor,
|
||||
series: [
|
||||
{
|
||||
name: 'default name',
|
||||
type: 'pie',
|
||||
// 默认series配置
|
||||
...this.defaultConfig.series,
|
||||
// 外部传入配置
|
||||
...this.seriesConfig,
|
||||
data: this.seriesData
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* .chart >>> div:first-child{
|
||||
background-color: red;
|
||||
height: 100% !important;
|
||||
} */
|
||||
</style>
|
||||
@@ -0,0 +1,158 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2022-01-23 16:50:39
|
||||
* @LastEditTime: 2022-01-25 15:43:52
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div :id="id" :class="className" :style="{ height: height, width:width}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from '../mixins/resize'
|
||||
|
||||
export default {
|
||||
name: 'OverviewBar',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: 'OverviewLine'
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
legendData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
top: '10%',
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
itemHeight: 10,
|
||||
x: 'right', // 可设定图例在左、右、居中
|
||||
y: 'top', // 可设定图例在上、下、居中
|
||||
itemWidth: 10,
|
||||
show: this.showLegend,
|
||||
data: this.legendData,
|
||||
right: '1%',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#ced1d5'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
}
|
||||
},
|
||||
data: ['钢一线', '钢二线', '钢三线', '钢四线', '钢五线', '钢六线']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
scale: true,
|
||||
max: 12,
|
||||
min: 0,
|
||||
splitNumber: 5,
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
}
|
||||
},
|
||||
boundaryGap: [0.2, 0.2],
|
||||
axisLabel: {
|
||||
formatter: '{value} h',
|
||||
textStyle: {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: this.legendData[0].name,
|
||||
type: 'bar',
|
||||
data: this.legendData[0].data,
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }]
|
||||
},
|
||||
barWidth: '10%',
|
||||
itemStyle: this.legendData[0].itemStyle
|
||||
},
|
||||
{
|
||||
name: this.legendData[1].name,
|
||||
type: 'bar',
|
||||
data: this.legendData[1].data,
|
||||
barWidth: '10%',
|
||||
itemStyle: this.legendData[1].itemStyle
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,158 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2022-01-23 16:50:39
|
||||
* @LastEditTime: 2022-01-25 15:44:26
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div :id="id" :class="className" :style="{ height: height, width:width}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from '../mixins/resize'
|
||||
|
||||
export default {
|
||||
name: 'OverviewBar',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: 'OverviewLine'
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
legendData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
top: '10%',
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
itemHeight: 10,
|
||||
x: 'right', // 可设定图例在左、右、居中
|
||||
y: 'top', // 可设定图例在上、下、居中
|
||||
itemWidth: 10,
|
||||
show: this.showLegend,
|
||||
data: this.legendData,
|
||||
right: '1%',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#ced1d5'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341', // 左边线的颜色
|
||||
width: '1'// 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#666a74' // 坐标值得具体的颜色
|
||||
}
|
||||
},
|
||||
data: ['钢一线', '钢二线', '钢三线', '钢四线', '钢五线', '钢六线']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
scale: true,
|
||||
max: 12,
|
||||
min: 0,
|
||||
splitNumber: 5,
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
}
|
||||
},
|
||||
boundaryGap: [0.2, 0.2],
|
||||
axisLabel: {
|
||||
formatter: '{value} h',
|
||||
textStyle: {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: this.legendData[0].name,
|
||||
type: 'bar',
|
||||
data: this.legendData[0].data,
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }]
|
||||
},
|
||||
barWidth: '10%',
|
||||
itemStyle: this.legendData[0].itemStyle
|
||||
},
|
||||
{
|
||||
name: this.legendData[1].name,
|
||||
type: 'bar',
|
||||
data: this.legendData[1].data,
|
||||
barWidth: '10%',
|
||||
itemStyle: this.legendData[1].itemStyle
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,144 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2022-01-24 09:01:07
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="base-container" :style="{height: height + 'px', fontSize: 12 + 'px'}">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<span>
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" />
|
||||
{{ title }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="bar-content">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
padding: .5em;
|
||||
border: 2px solid;
|
||||
border-image: linear-gradient(90deg, rgba(82, 255, 241, 0.6), rgba(95, 190, 249, 0), rgba(82, 255, 241, 0.6)) 2 2;
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 4px solid #52FFF1;
|
||||
width: 2em;
|
||||
top: -.25em;
|
||||
left: -.25em;
|
||||
&-vertical {
|
||||
top: calc(-5em / 12);
|
||||
left: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
&-right {
|
||||
top: -.25em;
|
||||
right: -.25em;
|
||||
left: inherit;
|
||||
}
|
||||
&-right-vertical {
|
||||
top: calc(-5em / 12);
|
||||
right: calc(-1em / 12);
|
||||
left: inherit;
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
left: -.25em;
|
||||
bottom: -.25em;
|
||||
}
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(-5em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: -.25em;
|
||||
bottom: -.25em;
|
||||
}
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-1em / 12);
|
||||
bottom: calc(-5em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
color: #52FFF1;
|
||||
font-size: 1.5em;
|
||||
padding: .1em;
|
||||
}
|
||||
.bar-content{
|
||||
padding: 1em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,170 @@
|
||||
<!--
|
||||
* @Date: 2020-12-14 09:07:03
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-13 16:41:13
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\ProductionAndOperationCenterCockpit\baseTable.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="visual-base-table-container">
|
||||
<el-table
|
||||
v-loading="isLoading"
|
||||
:header-cell-style="{background:'rgba(79,114,136,0.29)',color:'#fff',height: 28 + 'px',padding: 0}"
|
||||
:row-style="setRowStyle"
|
||||
:data="renderData"
|
||||
border
|
||||
style="width: 100%; background: transparent"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in renderTableHeadList"
|
||||
:key="item.prop"
|
||||
:show-overflow-tooltip="showOverflow"
|
||||
v-bind="item"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
<component :is="item.subcomponent" v-if="item.subcomponent" :inject-data="{...scope.row, ...item}" @emitData="emitData" />
|
||||
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<slot name="content" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { isObject, isString } from 'lodash'
|
||||
export default {
|
||||
name: 'BaseTable',
|
||||
filters: {
|
||||
commonFilter: (source, filterType = a => a) => {
|
||||
return filterType(source)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
tableData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator: val => val.filter(item => !isObject(item)).length === 0
|
||||
},
|
||||
tableConfig: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator: val => val.filter(item => !isString(item.prop) || !isString(item.label)).length === 0
|
||||
},
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 5
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
showOverflow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableConfigBak: [],
|
||||
selectedBox: new Array(20).fill(true)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
renderData() {
|
||||
if (this.tableData && !this.tableData[0]._pageIndex) {
|
||||
this.tableData.forEach((item, index) => {
|
||||
item._pageIndex = (this.page - 1) * this.limit + index + 1
|
||||
})
|
||||
}
|
||||
return this.tableData.slice((this.page - 1) * this.limit, this.page * this.limit)
|
||||
},
|
||||
renderTableHeadList() {
|
||||
return this.tableConfig.filter((item, index) => {
|
||||
return this.selectedBox[index]
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.selectedBox = new Array(20).fill(true)
|
||||
},
|
||||
// mounted() {
|
||||
// this.tableConfigBak = cloneDeep(this.tableConfig).map(item => {
|
||||
// return {
|
||||
// ...item,
|
||||
// selected: true
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
methods: {
|
||||
emitData(val) {
|
||||
this.$emit('emitFun', val)
|
||||
},
|
||||
setRowStyle(v) {
|
||||
if (v.rowIndex % 2 === 0) {
|
||||
return {
|
||||
background: 'rgba(76,97,123,0.2)',
|
||||
color: '#fff',
|
||||
height: 26 * this.beilv + 'px',
|
||||
padding: 0
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
background: 'rgba(79,114,136,0.29)',
|
||||
color: '#fff',
|
||||
height: 26 * this.beilv + 'px',
|
||||
padding: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "~@/styles/index.scss";
|
||||
.visual-base-table-container {
|
||||
.el-table {
|
||||
border: 0;
|
||||
}
|
||||
.el-table::before,.el-table--border::after {
|
||||
background-color: transparent;
|
||||
}
|
||||
.el-table th,td{
|
||||
border-color: #0D1728 !important;
|
||||
padding: 0;
|
||||
}
|
||||
.el-table tr {
|
||||
background: transparent;
|
||||
}
|
||||
.el-table__row:hover > td {
|
||||
background-color: rgba(79,114,136,0.29) !important;
|
||||
}
|
||||
|
||||
.el-table__row--striped:hover > td {
|
||||
background-color: rgba(79,114,136,0.29) !important;
|
||||
}
|
||||
}
|
||||
// .setting {
|
||||
// text-align: right;
|
||||
// padding: 15px;
|
||||
// .setting-box {
|
||||
// width: 100px;
|
||||
// }
|
||||
// i {
|
||||
// color: #aaa;
|
||||
// @extend .pointer;
|
||||
// }
|
||||
// }
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,31 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2022-01-23 21:02:57
|
||||
* @LastEditTime: 2022-01-23 21:08:21
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
style=" width: 1em;
|
||||
height: 1em;
|
||||
border-radius: 50%;
|
||||
margin:auto"
|
||||
:style="{background:injectData.colour}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitClick() {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,60 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2022-01-22 18:05:45
|
||||
* @LastEditTime: 2022-01-23 10:50:29
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div style="width:100%,text-align:center">
|
||||
<div style="text-align:center">
|
||||
<el-radio-group v-model="dateType" size="mini">
|
||||
<el-radio-button v-for="item in labelList" :key="item.index" :label="item.index">
|
||||
{{ item.label }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TopGroup',
|
||||
props: {
|
||||
dateType: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
labelList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-radio-button__inner {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: #133648;
|
||||
margin-bottom: 1em;
|
||||
margin-top: -0.5em;
|
||||
color: white;
|
||||
line-height: 14px;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
||||
background: #3eb0ae;
|
||||
border: none;
|
||||
color: white;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-20 14:12:10
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2022-01-25 16:57:00
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\ProductionLineMonitoringCockpit\nowTeam.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="now-team">
|
||||
<el-row style="margin-bottom: 3em">
|
||||
<p class="now-team-title">- 开始时间 -</p>
|
||||
<p class="now-team-content blue">2021.1.26 13:30:21</p>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 1em">
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 班组名称 -</p>
|
||||
<p style="font-size:2em" class="now-team-content blue">中班执行一组</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 原片投入(片) -</p>
|
||||
<p class="now-team-content blue">122</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 投入面积(㎡) -</p>
|
||||
<p class="now-team-content blue">12000</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 产品规格 -</p>
|
||||
<p class="now-team-content blue">110</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 执行工单 -</p>
|
||||
<p class="now-team-content blue">110</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="now-team-title">- 成品率 -</p>
|
||||
<p class="now-team-content blue">98.8%</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'ProductionMonitoringCockpit',
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.now-team{
|
||||
width: 100%;
|
||||
.now-team-title{
|
||||
font-size: 1em;
|
||||
line-height: 2em;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
.now-team-content{
|
||||
font-size: 2.5em;
|
||||
font-weight: 300;
|
||||
line-height: 1em;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
.blue {
|
||||
color: #52FFF1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
229
src/views/OperationalOverview/components/SimpleLineChart.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<!--
|
||||
* @Author: lb
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-02-07 13:46:05
|
||||
* @Description: 简单折线图
|
||||
-->
|
||||
<template>
|
||||
<div ref="SimpleLineChart" :style="{ height: height ? height + 'px' : '100%', width: '100%' }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons' // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
const AxisLine = {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#123341',
|
||||
width: '1'
|
||||
}
|
||||
}
|
||||
|
||||
const AxisLabel = {
|
||||
textStyle: {
|
||||
color: '#666a74'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2022.8.23 TODO:
|
||||
* 1.一份数据三张表
|
||||
* 2.切换选项卡时只更新一张表的数据
|
||||
* 3.注释掉成品率条形图,改为将“投入、产出”拆分图,与“成品率”合计三张
|
||||
*/
|
||||
|
||||
class ChartOption {
|
||||
constructor() {
|
||||
this.color = [
|
||||
'#3574a8',
|
||||
'#9f3476',
|
||||
'#30959d',
|
||||
'#5255be',
|
||||
'#8b4449',
|
||||
'#a29848',
|
||||
'#FF6600',
|
||||
'#FFFF00',
|
||||
'#91cc75',
|
||||
'#fac858',
|
||||
'#ee6666',
|
||||
'#73c0de',
|
||||
'#3ba272',
|
||||
'#fc8452',
|
||||
'#9a60b4',
|
||||
'#ea7ccc'
|
||||
]
|
||||
this.tooltip = { trigger: 'axis' }
|
||||
this.grid = {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '5%',
|
||||
height: '80%',
|
||||
containLabel: true
|
||||
}
|
||||
this.legend = {
|
||||
itemHeight: 10,
|
||||
itemWidth: 10,
|
||||
y: 'top',
|
||||
x: 'center',
|
||||
top: 0,
|
||||
// right: '1%',
|
||||
data: [
|
||||
/** dynamic */
|
||||
],
|
||||
// right: '1%',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#ced1d5'
|
||||
}
|
||||
}
|
||||
this.xAxis = {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
splitLine: { show: false },
|
||||
axisLine: AxisLine,
|
||||
axisLabel: { ...AxisLabel, rotate: 20 },
|
||||
data: [
|
||||
/** dynamic */
|
||||
]
|
||||
}
|
||||
this.yAxis = {
|
||||
type: 'value',
|
||||
splitLine: { show: false },
|
||||
axisLine: AxisLine,
|
||||
axisLabel: AxisLabel
|
||||
}
|
||||
this.series = [
|
||||
/** dynmaic */
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} rawdata
|
||||
*/
|
||||
setLegend(rawdata) {
|
||||
if (rawdata) {
|
||||
const data = Object.keys(rawdata)
|
||||
this.legend.data = data.map(item => ({ icon: 'roundRect', name: item }))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} rawdata
|
||||
*/
|
||||
setCategory(rawdata) {
|
||||
if (rawdata) {
|
||||
if (Object.keys(rawdata).length > 0) {
|
||||
const first = rawdata[Object.keys(rawdata)[0]]
|
||||
this.xAxis.data = Object.keys(first)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} rawdata
|
||||
*/
|
||||
setData(rawdata) {
|
||||
if (rawdata) {
|
||||
this.series = []
|
||||
for (const key in rawdata) {
|
||||
this.series.push({
|
||||
name: key,
|
||||
type: 'line',
|
||||
data: Object.entries(rawdata[key]).map(([subkey, value]) => value)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearOptions() {
|
||||
this.legend.data.splice(0)
|
||||
this.xAxis.data.splice(0)
|
||||
this.series.splice(0)
|
||||
}
|
||||
// add more...
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'SimpleLineChart',
|
||||
mixins: [resize],
|
||||
props: {
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
legend: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
caty: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
dataList: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
defaultOpts: new ChartOption()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showLegend() {
|
||||
return this.legend.length > 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dataList: {
|
||||
handler: function(val) {
|
||||
this.updateChartOptions()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.chart) {
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
if (!this.chart) {
|
||||
this.chart = echarts.init(this.$refs.SimpleLineChart)
|
||||
this.updateChartOptions()
|
||||
}
|
||||
},
|
||||
|
||||
updateChartOptions() {
|
||||
if (!this.chart) return
|
||||
this.defaultOpts.clearOptions()
|
||||
/** set */
|
||||
this.defaultOpts.setLegend(this.dataList)
|
||||
this.defaultOpts.setCategory(this.dataList)
|
||||
this.defaultOpts.setData(this.dataList)
|
||||
/** log */
|
||||
this.chart.setOption({ ...this.defaultOpts })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart {
|
||||
margin-top: -3em;
|
||||
}
|
||||
</style>
|
||||
51
src/views/OperationalOverview/components/alarmLevel.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<!--
|
||||
* @Date: 2020-12-14 09:07:03
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2022-01-23 00:14:53
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span class="alarm-level">
|
||||
<span
|
||||
style="display: inline-block; height: .6em;width: .6em; border-radius: .3em; position: relative;"
|
||||
:style="{background: colorList[injectData.level].back, boxShadow: `0px 0px 2px 2px ${colorList[injectData.level].border}`}"
|
||||
/>
|
||||
{{ injectData.level }}级
|
||||
</span>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'NextDay',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
colorList: {
|
||||
1: {
|
||||
back: 'rgba(255, 12, 12, 1)',
|
||||
border: 'rgba(255, 12, 12, .5)'
|
||||
},
|
||||
2: {
|
||||
back: 'rgba(255, 183, 12, 1)',
|
||||
border: 'rgba(255, 183, 12, .5)'
|
||||
},
|
||||
3: {
|
||||
back: 'rgba(39, 96, 255, 1)',
|
||||
border: 'rgba(39, 96, 255, .5)'
|
||||
},
|
||||
4: {
|
||||
back: 'rgba(12, 255, 30, 1)',
|
||||
border: 'rgba(12, 255, 30, .5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
195
src/views/OperationalOverview/components/baseContainer/index.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-14 13:28:27
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="base-container" ref="baseContainer" :style="{ height: '100%', fontSize: 12 + 'px', padding: 12 + 'px' }"
|
||||
:class="{ 'no-padding': noPadding, 'border-none': !showLine }">
|
||||
<!-- <div class="base-container" :style="{height: height + 'px', fontSize: 12 + 'px', padding: 12 + 'px'}"> -->
|
||||
<template v-if="showLine">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
</template>
|
||||
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<span>
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" />
|
||||
{{ title }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="bar-content" :class="{ 'p-0': noContentPadding }">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
props: {
|
||||
showLine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
back: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
noContentPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0,
|
||||
// imgUrl: require(`../../../../assets/img/${this.back}.png`),
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// console.log(this.back);
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.baseContainer.style = `background:url('../../../../assets/img/${this.back}.png') no-repeat;)`
|
||||
// })
|
||||
// console.log(this.$refs.baseContainer.style)
|
||||
},
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
// background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
// border: 2px solid;
|
||||
background: url('../../../../assets/img/energy.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// border-radius: 40px 0px 40px 0px;
|
||||
// border-image: linear-gradient(360deg, rgba(157, 246, 254, 0.05), rgba(100, 233, 252, 0.9)) 2 2;
|
||||
// .line {
|
||||
// position: absolute;
|
||||
// border-top: 4px solid #52fff1;
|
||||
// width: 2em;
|
||||
// top: -0.25em;
|
||||
// left: -0.25em;
|
||||
// &-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
// left: calc(-1em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
// &-right {
|
||||
// top: -0.25em;
|
||||
// right: -0.25em;
|
||||
// left: inherit;
|
||||
// }
|
||||
// &-right-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
// right: calc(-1em / 12);
|
||||
// left: inherit;
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
// &-bottom {
|
||||
// top: inherit;
|
||||
// left: -0.25em;
|
||||
// bottom: -0.25em;
|
||||
// }
|
||||
// &-bottom-vertical {
|
||||
// top: inherit;
|
||||
// left: calc(-1em / 12);
|
||||
// bottom: calc(-5em / 12);
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
// &-bottom-right {
|
||||
// top: inherit;
|
||||
// left: inherit;
|
||||
// right: -0.25em;
|
||||
// bottom: -0.25em;
|
||||
// }
|
||||
// &-bottom-right-vertical {
|
||||
// top: inherit;
|
||||
// left: inherit;
|
||||
// right: calc(-1em / 12);
|
||||
// bottom: calc(-5em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
// }
|
||||
|
||||
.bar-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
color: #52fff1;
|
||||
font-size: 1.5em;
|
||||
padding: 0.67em;
|
||||
}
|
||||
|
||||
.bar-content {
|
||||
padding: 1em;
|
||||
flex: 1 auto;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&.border-none {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,187 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-09-21 16:15:14
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="base-container"
|
||||
:style="{ height: '100%', fontSize: 12 + 'px', padding: 12 + 'px' }"
|
||||
:class="{ 'no-padding': noPadding, 'border-none': !showLine }"
|
||||
>
|
||||
<!-- <div class="base-container" :style="{height: height + 'px', fontSize: 12 + 'px', padding: 12 + 'px'}"> -->
|
||||
<template v-if="showLine">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
</template>
|
||||
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<span>
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" />
|
||||
{{ title }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="bar-content" :class="{ 'p-0': noContentPadding }">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
props: {
|
||||
showLine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
noContentPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
// border: 2px solid;
|
||||
background: url('../../../../assets/img/bg-bottom-item.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// border-radius: 40px 0px 40px 0px;
|
||||
// border-image: linear-gradient(360deg, rgba(157, 246, 254, 0.05), rgba(100, 233, 252, 0.9)) 2 2;
|
||||
// .line {
|
||||
// position: absolute;
|
||||
// border-top: 4px solid #52fff1;
|
||||
// width: 2em;
|
||||
// top: -0.25em;
|
||||
// left: -0.25em;
|
||||
// &-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
// left: calc(-1em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
// &-right {
|
||||
// top: -0.25em;
|
||||
// right: -0.25em;
|
||||
// left: inherit;
|
||||
// }
|
||||
// &-right-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
// right: calc(-1em / 12);
|
||||
// left: inherit;
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
// &-bottom {
|
||||
// top: inherit;
|
||||
// left: -0.25em;
|
||||
// bottom: -0.25em;
|
||||
// }
|
||||
// &-bottom-vertical {
|
||||
// top: inherit;
|
||||
// left: calc(-1em / 12);
|
||||
// bottom: calc(-5em / 12);
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
// &-bottom-right {
|
||||
// top: inherit;
|
||||
// left: inherit;
|
||||
// right: -0.25em;
|
||||
// bottom: -0.25em;
|
||||
// }
|
||||
// &-bottom-right-vertical {
|
||||
// top: inherit;
|
||||
// left: inherit;
|
||||
// right: calc(-1em / 12);
|
||||
// bottom: calc(-5em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
// }
|
||||
|
||||
.bar-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
color: #52fff1;
|
||||
font-size: 1.5em;
|
||||
padding: 0.67em;
|
||||
}
|
||||
|
||||
.bar-content {
|
||||
padding: 1em;
|
||||
flex: 1 auto;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&.border-none {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
187
src/views/OperationalOverview/components/baseTable.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<!--
|
||||
* @Date: 2020-12-14 09:07:03
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-14 10:11:09
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="visual-base-table-container">
|
||||
<el-table
|
||||
v-loading="isLoading"
|
||||
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}"
|
||||
:row-style="setRowStyle"
|
||||
:data="renderData"
|
||||
border
|
||||
style="width: 100%; background: transparent"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="page && limit && showIndex"
|
||||
prop="_pageIndex"
|
||||
:label="'tableHeader.index' | i18nFilter"
|
||||
:width="70"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
v-for="item in renderTableHeadList"
|
||||
:key="item.prop"
|
||||
:show-overflow-tooltip="showOverflow"
|
||||
v-bind="item"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
<component
|
||||
:is="item.subcomponent"
|
||||
v-if="item.subcomponent"
|
||||
:inject-data="{...scope.row, ...item}"
|
||||
@emitData="emitData"
|
||||
/>
|
||||
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<slot name="content" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { isObject, isString } from 'lodash'
|
||||
export default {
|
||||
name: 'BaseTable',
|
||||
filters: {
|
||||
commonFilter: (source, filterType = a => a) => {
|
||||
return filterType(source)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
tableData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator: val => val.filter(item => !isObject(item)).length === 0
|
||||
},
|
||||
tableConfig: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator: val => val.filter(item => !isString(item.prop) || !isString(item.label)).length === 0
|
||||
},
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 5
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
showOverflow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showIndex: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableConfigBak: [],
|
||||
selectedBox: new Array(100).fill(true)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
renderData() {
|
||||
if (this.tableData.length && !this.tableData[0]._pageIndex) {
|
||||
this.tableData.forEach((item, index) => {
|
||||
item._pageIndex = (this.page - 1) * this.limit + index + 1
|
||||
})
|
||||
}
|
||||
return this.tableData.slice((this.page - 1) * this.limit, this.page * this.limit)
|
||||
},
|
||||
renderTableHeadList() {
|
||||
return this.tableConfig.filter((item, index) => {
|
||||
return this.selectedBox[index]
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.selectedBox = new Array(100).fill(true)
|
||||
},
|
||||
methods: {
|
||||
emitData(val) {
|
||||
this.$emit('emitFun', val)
|
||||
},
|
||||
setRowStyle(v) {
|
||||
if (v.rowIndex % 2 === 0) {
|
||||
return {
|
||||
background: 'rgba(14, 32, 62, 1)',
|
||||
color: 'rgba(255,255,255,0.5)',
|
||||
height: 26 + 'px',
|
||||
lineHeight: 26 + 'px',
|
||||
padding: 0,
|
||||
fontSize: 12 + 'px'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
background: 'rgba(32, 55, 96, 1)',
|
||||
color: 'rgba(255,255,255,0.5)',
|
||||
height: 26 + 'px',
|
||||
lineHeight: 26 + 'px',
|
||||
padding: 0,
|
||||
fontSize: 12 + 'px'
|
||||
}
|
||||
}
|
||||
},
|
||||
setCellStyle() {
|
||||
return {
|
||||
// lineHeight: 23 + 'px'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "../styles/index.scss";
|
||||
.visual-base-table-container {
|
||||
.el-table {
|
||||
border: 0;
|
||||
}
|
||||
.el-table::before,.el-table--border::after {
|
||||
background-color: transparent;
|
||||
}
|
||||
.el-table th,td{
|
||||
border-color: #0D1728 !important;
|
||||
padding: 0;
|
||||
}
|
||||
.el-table tr {
|
||||
background: transparent;
|
||||
}
|
||||
.el-table__row:hover > td {
|
||||
background-color: rgba(79,114,136,0.29) !important;
|
||||
}
|
||||
|
||||
.el-table__row--striped:hover > td {
|
||||
background-color: rgba(79,114,136,0.29) !important;
|
||||
}
|
||||
}
|
||||
// .setting {
|
||||
// text-align: right;
|
||||
// padding: 15px;
|
||||
// .setting-box {
|
||||
// width: 100px;
|
||||
// }
|
||||
// i {
|
||||
// color: #aaa;
|
||||
// @extend .pointer;
|
||||
// }
|
||||
// }
|
||||
|
||||
</style>
|
||||