Compare commits
12 Commits
106d0ed89c
...
projects/z
| Author | SHA1 | Date | |
|---|---|---|---|
| 10219fd841 | |||
| 74a2a3b8e5 | |||
| c3b4223e5b | |||
| 070e01c2c4 | |||
| 2665b6a0b0 | |||
| a71fb90e6a | |||
| ac85c83cf9 | |||
| c2e987aee4 | |||
| 0e4ed597cd | |||
| 3e7914ac91 | |||
| 9c19a6197a | |||
| 074b35b6a6 |
6
.env.dev
6
.env.dev
@@ -12,8 +12,10 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = 产线监控系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# 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:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
"url": "https://github.com/YunaiV/ruoyi-vue-pro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/x6": "^2.15.3",
|
||||
"@babel/parser": "7.18.4",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.27.2",
|
||||
|
||||
BIN
public/static/videos/login.webm
Normal file
BIN
public/static/videos/login.webm
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 创建设备
|
||||
export function createEquipment(data) {
|
||||
return request({
|
||||
url: '/base/core-equipment/create',
|
||||
url: '/base/equipment/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function createEquipment(data) {
|
||||
// 更新设备
|
||||
export function updateEquipment(data) {
|
||||
return request({
|
||||
url: '/base/core-equipment/update',
|
||||
url: '/base/equipment/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export function updateEquipment(data) {
|
||||
// 删除设备
|
||||
export function deleteEquipment(id) {
|
||||
return request({
|
||||
url: '/base/core-equipment/delete?id=' + id,
|
||||
url: '/base/equipment/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function deleteEquipment(id) {
|
||||
// 获得设备
|
||||
export function getEquipment(id) {
|
||||
return request({
|
||||
url: '/base/core-equipment/get?id=' + id,
|
||||
url: '/base/equipment/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export function getEquipment(id) {
|
||||
// 获得设备分页
|
||||
export function getEquipmentPage(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment/page',
|
||||
url: '/base/equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -46,7 +46,7 @@ export function getEquipmentPage(query) {
|
||||
// 导出设备 Excel
|
||||
export function exportEquipmentExcel(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment/export-excel',
|
||||
url: '/base/equipment/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
@@ -55,7 +55,7 @@ export function exportEquipmentExcel(query) {
|
||||
// 获得所有设备列表
|
||||
export function getEquipmentAll() {
|
||||
return request({
|
||||
url: '/base/core-equipment/listAll',
|
||||
url: '/base/equipment/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 创建设备类型
|
||||
export function createEquipmentType(data) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/create',
|
||||
url: '/base/equipment-type/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function createEquipmentType(data) {
|
||||
// 更新设备类型
|
||||
export function updateEquipmentType(data) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/update',
|
||||
url: '/base/equipment-type/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export function updateEquipmentType(data) {
|
||||
// 删除设备类型
|
||||
export function deleteEquipmentType(id) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/delete?id=' + id,
|
||||
url: '/base/equipment-type/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function deleteEquipmentType(id) {
|
||||
// 获得设备类型
|
||||
export function getEquipmentType(id) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/get?id=' + id,
|
||||
url: '/base/equipment-type/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export function getEquipmentType(id) {
|
||||
// 获得设备类型分页
|
||||
export function getEquipmentTypePage(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/page',
|
||||
url: '/base/equipment-type/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -46,7 +46,7 @@ export function getEquipmentTypePage(query) {
|
||||
// 导出设备类型 Excel
|
||||
export function exportEquipmentTypeExcel(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment-type/export-excel',
|
||||
url: '/base/equipment-type/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
|
||||
BIN
src/assets/images/login-bg.png
Normal file
BIN
src/assets/images/login-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
BIN
src/assets/logo/cnbm.png
Normal file
BIN
src/assets/logo/cnbm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,10 +1,13 @@
|
||||
/* ===== PC DESIGN ===== */
|
||||
$W: 1000;
|
||||
$W: 1080;
|
||||
$H: 1920;
|
||||
$picW: 438;
|
||||
$picH: 560;
|
||||
$formW: 320;
|
||||
// $picW: 438;
|
||||
// $picH: 560;
|
||||
$picW: 1080;
|
||||
$picH: 1118;
|
||||
$formW: 420;
|
||||
$tabW: $formW / 2;
|
||||
// $rowH: 56;
|
||||
$rowH: 56;
|
||||
$buttonH: 50;
|
||||
|
||||
@@ -15,6 +18,7 @@ $containerBgImage: '../assets/images/bg.png';
|
||||
$logoWidth: 417px;
|
||||
$logoHeight: 64px;
|
||||
$logoImage: '../assets/logo/login-logo.png';
|
||||
$cnbmLogo: '../assets/logo/cnbm.png';
|
||||
// container-content
|
||||
$contentWidth: round($W / $H * 100) * 1vw;
|
||||
$contentHeight: round($picH / $W * 100) / 100 * $contentWidth;
|
||||
@@ -22,7 +26,8 @@ $contentBgColor: #ffffff;
|
||||
// container-content-pic
|
||||
$picWidth: round($picW / $H * 100) * 1vw;
|
||||
$picHeight: inherit;
|
||||
$picImage: '../assets/images/pic.png';
|
||||
// $picImage: '../assets/images/pic.png';
|
||||
$picImage: '../assets/images/login-bg.png';
|
||||
// container-content-field
|
||||
$fieldWidth: $contentWidth - $picWidth;
|
||||
$fieldHeight: inherit;
|
||||
@@ -40,7 +45,9 @@ $buttonHeight: $buttonH * 1px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
width:100%;max-width:100px; height:auto;
|
||||
width: 100%;
|
||||
max-width: 100px;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +57,7 @@ $buttonHeight: $buttonH * 1px;
|
||||
min-width: 1080px;
|
||||
min-height: 620px;
|
||||
background-color: $containerBgColor;
|
||||
background-image: url($containerBgImage);
|
||||
// background-image: url($containerBgImage);
|
||||
background-size: cover;
|
||||
// 定位
|
||||
position: relative;
|
||||
@@ -75,49 +82,87 @@ $buttonHeight: $buttonH * 1px;
|
||||
}
|
||||
.content {
|
||||
// 元素
|
||||
width: $contentWidth;
|
||||
height: $contentHeight;
|
||||
// width: $contentWidth;
|
||||
// height: $contentHeight;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||
border-radius: 20px;
|
||||
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||
// border-radius: 20px;
|
||||
// 定位
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
.pic {
|
||||
// 元素
|
||||
width: $picWidth;
|
||||
height: $picHeight;
|
||||
background-image: url($picImage);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
border-radius: 20px 0 0 20px;
|
||||
// 定位
|
||||
background-size: 100% 100%;
|
||||
background-position: 0 0;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background: #f003;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.field {
|
||||
width: $fieldWidth;
|
||||
height: $fieldHeight;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: $picWidth;
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
// background: #ccc3;
|
||||
position: relative;
|
||||
padding-top: 196px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// justify-content: center;
|
||||
align-items: center;
|
||||
.pc-title{ width: 100%; clear: both;}
|
||||
.pc-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
position: relative;
|
||||
top: -36px;
|
||||
|
||||
// h3.title {
|
||||
// position: relative;
|
||||
|
||||
// &::before {
|
||||
// content: '';
|
||||
// background: url($cnbmLogo) 100% / 100% no-repeat;
|
||||
// height: 48px;
|
||||
// width: 48px;
|
||||
// position: absolute;
|
||||
// left: 0px;
|
||||
// top: 4px;
|
||||
// display: inline-block;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
.mobile-title,
|
||||
.mobile-switch {
|
||||
display: none;
|
||||
}
|
||||
.form {
|
||||
margin-top: 32px;
|
||||
box-sizing: border-box;
|
||||
width: $formWidth;
|
||||
// width: $formWidth;
|
||||
width: 100%;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__nav) {
|
||||
// background: #f0f3;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
:deep(.el-tabs__item) {
|
||||
user-select: none;
|
||||
// 元素
|
||||
width: $tabWidth;
|
||||
height: $rowHeight;
|
||||
@@ -125,10 +170,13 @@ $buttonHeight: $buttonH * 1px;
|
||||
// 文字
|
||||
line-height: $rowHeight;
|
||||
color: #666666;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
}
|
||||
:deep(.el-tabs__item.is-active) {
|
||||
font-weight: bold;
|
||||
color: #2F53EB;
|
||||
font-weight: 500;
|
||||
color: #2f53eb;
|
||||
}
|
||||
:deep(.el-tabs__active-bar) {
|
||||
height: 3px;
|
||||
@@ -152,22 +200,26 @@ $buttonHeight: $buttonH * 1px;
|
||||
// 文字
|
||||
text-align: left;
|
||||
}
|
||||
:deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */
|
||||
:deep(.el-input__inner::-webkit-input-placeholder) {
|
||||
/* WebKit browsers */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
:deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */
|
||||
:deep(.el-input__inner:-moz-placeholder) {
|
||||
/* Mozilla Firefox 4 to 18 */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
:deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */
|
||||
:deep(.el-input__inner::-moz-placeholder) {
|
||||
/* Mozilla Firefox 19+ */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
opacity:1;
|
||||
color: #8c8c8c;
|
||||
opacity: 1;
|
||||
}
|
||||
:deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */
|
||||
:deep(.el-input__inner:-ms-input-placeholder) {
|
||||
/* Internet Explorer 10+ */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C !important;
|
||||
color: #8c8c8c !important;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
position: relative;
|
||||
@@ -185,10 +237,10 @@ $buttonHeight: $buttonH * 1px;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #2F53EB;
|
||||
color: #2f53eb;
|
||||
span {
|
||||
padding-left: 15px;
|
||||
border-left: 2px solid #D9D9D9;
|
||||
border-left: 2px solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,16 +257,36 @@ $buttonHeight: $buttonH * 1px;
|
||||
// 文字
|
||||
line-height: 26px;
|
||||
font-size: 20px;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
}
|
||||
.button-active {
|
||||
background: #2F53EB;
|
||||
background: #2f53eb;
|
||||
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
* {
|
||||
user-select: none;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 420px;
|
||||
height: 66px;
|
||||
color: #262626;
|
||||
font-size: 18px;
|
||||
}
|
||||
:deep(.el-checkbox__label) {
|
||||
font-size: 18px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
user-select: none;
|
||||
// 元素
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
@@ -235,17 +307,30 @@ $buttonHeight: $buttonH * 1px;
|
||||
// - - - - - PC 最小尺寸设置
|
||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
||||
.container {
|
||||
min-width: 599px;
|
||||
.content {
|
||||
width: 710px;
|
||||
height: 397px;
|
||||
// width: 710px;
|
||||
// height: 397px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.pic {
|
||||
width: 314px;
|
||||
// width: 314px;
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
width: calc(710px - 314px);
|
||||
left: 314px;
|
||||
// width: calc(710px - 314px);
|
||||
// left: 314px;
|
||||
// justify-content: center;
|
||||
width: 100%;
|
||||
|
||||
.pc-title {
|
||||
h3 {
|
||||
font-size: 2.4rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
.form {
|
||||
width: 320px;
|
||||
// width: 320px;
|
||||
:deep(.el-input__inner) {
|
||||
width: 320px;
|
||||
height: 56px;
|
||||
@@ -259,7 +344,6 @@ $buttonHeight: $buttonH * 1px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ===== MOBILE DESIGN ===== */
|
||||
$mobileW: 375;
|
||||
$mobileH: 812;
|
||||
@@ -273,9 +357,10 @@ $mobileButtonH: 48;
|
||||
$mobileContainerBgImage: '../assets/images/bg-mobile.png';
|
||||
// container-content
|
||||
$mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw;
|
||||
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * $mobileContentWidth;
|
||||
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 *
|
||||
$mobileContentWidth;
|
||||
// container-content-field-form
|
||||
$mobileFormWidth: round($mobileFormW / $mobileW *100) * 1vw;
|
||||
$mobileFormWidth: round($mobileFormW / $mobileW * 100) * 1vw;
|
||||
$mobileRowHeight: $mobileRowH * 1px;
|
||||
$mobileButtonHeight: $mobileButtonH * 1px;
|
||||
$iconBgImage: '../assets/images/icon.png';
|
||||
@@ -288,13 +373,17 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
min-width: 280px;
|
||||
min-height: 568px;
|
||||
// 文字
|
||||
font-size: 17px;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
.logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pc-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
// 元素
|
||||
width: $mobileContentWidth;
|
||||
@@ -309,6 +398,7 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
padding: 0;
|
||||
// 元素
|
||||
width: inherit;
|
||||
min-height: inherit;
|
||||
@@ -316,12 +406,15 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.mobile-title {
|
||||
// 元素
|
||||
margin: 0 0 20px;
|
||||
margin: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin: 0;
|
||||
width: $mobileFormWidth;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__header) {
|
||||
@@ -347,7 +440,25 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
.button {
|
||||
height: $mobileButtonHeight;
|
||||
line-height: 24px;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
:deep(.el-input__inner) {
|
||||
height: $mobileRowHeight;
|
||||
line-height: 24px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
color: #262626;
|
||||
}
|
||||
|
||||
:deep(#button-form-item) {
|
||||
margin: 0 !important;
|
||||
button {
|
||||
// 元素
|
||||
height: $mobileRowHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mobile-switch {
|
||||
@@ -370,6 +481,7 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
// 元素
|
||||
font-size: 12px;
|
||||
@@ -379,9 +491,8 @@ $iconBgImage: '../assets/images/icon.png';
|
||||
color: #333333;
|
||||
opacity: 0.6;
|
||||
// 定位
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
// position: absolute;
|
||||
bottom: -32px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import tupleImg from '@/assets/images/tuple.png';
|
||||
import cache from '@/views/extend/processFlow/cache';
|
||||
|
||||
/**
|
||||
* 找到最长的label
|
||||
@@ -191,7 +190,7 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
hasFile: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
@@ -237,7 +236,7 @@ export default {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (this.hasFiles) {
|
||||
if (this.hasFile) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
}
|
||||
},
|
||||
@@ -318,11 +317,6 @@ export default {
|
||||
'list' in response.data
|
||||
? response.data.list
|
||||
: response.data;
|
||||
|
||||
if (opt.cache) {
|
||||
cache.store(opt.cache, list);
|
||||
}
|
||||
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
|
||||
@@ -28,37 +28,10 @@ export default {
|
||||
// tableBtn: [], // 占位
|
||||
// searchBarFormConfig: [], // 占位
|
||||
// // 弹窗表单配置
|
||||
// dialogFormConfig: [], //
|
||||
updateUrl: '',
|
||||
addUrl: '',
|
||||
pageUrl: '',
|
||||
form: {}
|
||||
// dialogFormConfig: [], // 占位
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// utils
|
||||
http(url, method, payload) {
|
||||
return this.$axios({
|
||||
url,
|
||||
method,
|
||||
params: method === 'get' ? payload : null,
|
||||
data: method !== 'get' ? payload : null,
|
||||
})
|
||||
},
|
||||
put(payload) {
|
||||
return this.http(this.updateUrl, 'put', payload);
|
||||
},
|
||||
post(payload) {
|
||||
return this.http(this.addUrl, 'post', payload);
|
||||
},
|
||||
recv(payload) {
|
||||
return this.http(this.pageUrl, 'get', payload);
|
||||
},
|
||||
info(payload) {
|
||||
return this.http(this.infoUrl, 'get', payload);
|
||||
},
|
||||
|
||||
|
||||
// 过滤后端传回的详情数据
|
||||
filterData(data, keys) {
|
||||
const obj = {};
|
||||
|
||||
@@ -72,15 +72,15 @@ export const constantRoutes = [
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: 'core/base/factory',
|
||||
// children: [{
|
||||
// path: 'index',
|
||||
// redirect: 'core/base/factory',
|
||||
children: [{
|
||||
path: 'index',
|
||||
// redirect: 'core/base/factory',
|
||||
component: (resolve) => require(['@/views/index'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
// component: (resolve) => require(['@/views/index'], resolve),
|
||||
// name: '首页',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div ref="dataBoard" class=""></div>
|
||||
<div ref="dataBoard" class="data-board">
|
||||
<el-button type="text" @click="goback" class="go-back--btn">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -24,39 +26,42 @@ export default {
|
||||
mainFooter: null, // dom
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.modify();
|
||||
});
|
||||
},
|
||||
activated() {
|
||||
this.modify();
|
||||
},
|
||||
deactivated() {
|
||||
this.recover();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.recover();
|
||||
},
|
||||
// mounted() {
|
||||
// this.$nextTick(() => {
|
||||
// this.modify();
|
||||
// });
|
||||
// },
|
||||
// activated() {
|
||||
// this.modify();
|
||||
// },
|
||||
// deactivated() {
|
||||
// this.recover();
|
||||
// },
|
||||
// beforeDestroy() {
|
||||
// this.recover();
|
||||
// },
|
||||
methods: {
|
||||
modify() {
|
||||
// 在这个页面临时修改下父类的margin,结束时需还原
|
||||
this.appMain = document.querySelector('.app-main');
|
||||
// this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
||||
this.appMain.style.margin = 0;
|
||||
// 在这个页面临时删除 main-footer 元素,结束时需还原
|
||||
// this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
||||
// document.querySelector('.main-footer').remove();
|
||||
this.$refs.dataBoard.classList.add('data-board');
|
||||
},
|
||||
recover() {
|
||||
this.$refs.dataBoard.classList.remove('data-board');
|
||||
this.$nextTick(() => {
|
||||
this.appMain.style.margin = this.parentStyle.margin;
|
||||
// this.appMain.style.minHeight = this.parentStyle.minHeight;
|
||||
// this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
||||
});
|
||||
},
|
||||
// modify() {
|
||||
// // 在这个页面临时修改下父类的margin,结束时需还原
|
||||
// this.appMain = document.querySelector('.app-main');
|
||||
// // this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
||||
// this.appMain.style.margin = 0;
|
||||
// // 在这个页面临时删除 main-footer 元素,结束时需还原
|
||||
// // this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
||||
// // document.querySelector('.main-footer').remove();
|
||||
// this.$refs.dataBoard.classList.add('data-board');
|
||||
// },
|
||||
// recover() {
|
||||
// this.$refs.dataBoard.classList.remove('data-board');
|
||||
// this.$nextTick(() => {
|
||||
// this.appMain.style.margin = this.parentStyle.margin;
|
||||
// // this.appMain.style.minHeight = this.parentStyle.minHeight;
|
||||
// // this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
||||
// });
|
||||
// },
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -71,4 +76,25 @@ export default {
|
||||
background: url('../../../assets/images/DataBoard.png') 100% 100% / contain
|
||||
no-repeat;
|
||||
}
|
||||
|
||||
.go-back--btn {
|
||||
position: fixed;
|
||||
top: 28px;
|
||||
left: 24px;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
letter-spacing: 6px;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "\2BAA";
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: -26px;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
||||
prop: 'equipmentId',
|
||||
bind: {
|
||||
filterable: true,
|
||||
@@ -278,7 +278,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备分组编码',
|
||||
prop: 'code',
|
||||
// url: '/base/core-equipment/getCode',
|
||||
// url: '/base/equipment/getCode',
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
// 获取设备列表
|
||||
async getEquipmentList() {
|
||||
const response = await this.$axios(
|
||||
'/base/core-equipment/page?pageNo=1&pageSize=100'
|
||||
'/base/equipment/page?pageNo=1&pageSize=100'
|
||||
);
|
||||
this.equipmentList = response.data.list.map((item) => ({
|
||||
label: item.name,
|
||||
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
||||
prop: 'equipmentId',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
v-if="showForm"
|
||||
ref="form"
|
||||
:disabled="mode.includes('detail')"
|
||||
:dataForm="form"
|
||||
v-model="form"
|
||||
:rows="formRows" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows"/>
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备分组编码',
|
||||
prop: 'code',
|
||||
// url: '/base/core-equipment/getCode',
|
||||
// url: '/base/equipment/getCode',
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
v-if="showForm"
|
||||
ref="form"
|
||||
:disabled="mode.includes('detail')"
|
||||
:dataForm="form"
|
||||
v-model="form"
|
||||
:rows="formRows" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
@@ -247,7 +247,7 @@ export default {
|
||||
select: true,
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
|
||||
url: '/base/equipment/page?pageNo=1&pageSize=99',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
@@ -283,7 +283,7 @@ export default {
|
||||
input: true,
|
||||
label: '关联表名',
|
||||
prop: 'plcTableName',
|
||||
// url: '/base/core-equipment/getCode',
|
||||
// url: '/base/equipment/getCode',
|
||||
},
|
||||
],
|
||||
],
|
||||
@@ -320,7 +320,7 @@ export default {
|
||||
methods: {
|
||||
async getEquipmentOptions() {
|
||||
const res = await this.$axios({
|
||||
url: '/base/core-equipment/listAll',
|
||||
url: '/base/equipment/listAll',
|
||||
method: 'get',
|
||||
});
|
||||
return res.data;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
}">
|
||||
<el-upload
|
||||
class="equipment-upload"
|
||||
:style="{ marginBottom: isPicMode ? '48px' : '24px' }"
|
||||
:disabled="disabled"
|
||||
drag
|
||||
:action="uploadUrl"
|
||||
|
||||
@@ -283,7 +283,7 @@ export default {
|
||||
async getEqTypeList() {
|
||||
this.formLoading = true;
|
||||
const { code, data } = await this.$axios(
|
||||
'/base/core-equipment-type/page?pageNo=1&pageSize=100'
|
||||
'/base/equipment-type/page?pageNo=1&pageSize=100'
|
||||
);
|
||||
// debugger;
|
||||
if (code == 0) {
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
:dataForm="form"
|
||||
:rows="computedRows" />
|
||||
v-model="form"
|
||||
:rows="computedRows"
|
||||
:has-file="true" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
@@ -60,9 +61,9 @@
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: computedRows,
|
||||
url: '/base/core-equipment/get',
|
||||
urlUpdate: '/base/core-equipment/update',
|
||||
urlCreate: '/base/core-equipment/create',
|
||||
url: '/base/equipment/get',
|
||||
urlUpdate: '/base/equipment/update',
|
||||
urlCreate: '/base/equipment/create',
|
||||
queryParams: { id: form.id },
|
||||
},
|
||||
{
|
||||
@@ -240,7 +241,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment/getCode',
|
||||
url: '/base/equipment/getCode',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
@@ -267,7 +268,7 @@ export default {
|
||||
select: true,
|
||||
label: '设备类型',
|
||||
prop: 'equipmentTypeId',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
:rows="rows"
|
||||
:has-file="true" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备类型编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment-type/getCode',
|
||||
url: '/base/equipment-type/getCode',
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
select: true,
|
||||
label: '父类',
|
||||
prop: 'parentId',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||
},
|
||||
{},
|
||||
],
|
||||
|
||||
@@ -416,7 +416,7 @@ export default {
|
||||
/** 准备设备数据 */
|
||||
async initEquipment() {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/base/core-equipment/listAll',
|
||||
url: '/base/equipment/listAll',
|
||||
method: 'get',
|
||||
});
|
||||
if (code == 0) {
|
||||
|
||||
@@ -223,7 +223,7 @@ export default {
|
||||
/** 准备设备数据 */
|
||||
async initEquipment() {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/base/core-equipment/listAll',
|
||||
url: '/base/equipment/listAll',
|
||||
method: 'get',
|
||||
});
|
||||
if (code == 0) {
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
let timers = [];
|
||||
|
||||
export default {
|
||||
|
||||
exists(key) {
|
||||
const _ = localStorage.getItem('stored_keys');
|
||||
return _ ? _.split(',')?.indexOf(key) != -1 : false;
|
||||
},
|
||||
|
||||
store(key, value, duration = null) {
|
||||
if (!localStorage.getItem('stored_keys')) localStorage.setItem('stored_keys', key);
|
||||
else localStorage.setItem('stored_keys', localStorage.getItem('stored_keys') + ',' + key);
|
||||
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
console.log('store duration', duration)
|
||||
if (duration) {
|
||||
if (timers[key]) clearTimeout(timers[key]);
|
||||
timers[key] = setTimeout(() => {
|
||||
console.log("clear cache", key)
|
||||
this.clear([key]);
|
||||
}, duration * 1000);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} key
|
||||
* @param {*} cb
|
||||
* @param {*} param2 force 强制更新,调用cb
|
||||
* @returns
|
||||
*/
|
||||
async getList(key, cb = null, { force = false, duration = null } = {}) {
|
||||
if (this.exists(key) && !force) {
|
||||
return JSON.parse(localStorage.getItem(key))
|
||||
} else {
|
||||
const list = await cb();
|
||||
this.store(key, list, duration);
|
||||
return list;
|
||||
}
|
||||
},
|
||||
|
||||
clear(keys) {
|
||||
if (keys && keys.length) {
|
||||
let stored_keys = localStorage.getItem('stored_keys').split(',');
|
||||
keys.forEach((key) => {
|
||||
stored_keys = stored_keys.filter((item) => item != key);
|
||||
});
|
||||
localStorage.setItem('stored_keys', stored_keys);
|
||||
return;
|
||||
}
|
||||
localStorage.removeItem('stored_keys');
|
||||
},
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
<!--
|
||||
filename: index.vue
|
||||
author: liubin
|
||||
date: 2023-10-19 10:03:42
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||
|
||||
<section class="process-flow">
|
||||
<el-button class="process-item__add-btn" @click="handleAdd">
|
||||
+ 新增工艺
|
||||
</el-button>
|
||||
<ProcessItem
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
:id="item.id"
|
||||
:name="item.name"
|
||||
:line="item.lineName"
|
||||
:desc="item.remark"
|
||||
:isActive="item.enabled"
|
||||
@edit="handleUpdate" />
|
||||
</section>
|
||||
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="45%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
// import cache from './cache';
|
||||
|
||||
const ProcessItem = {
|
||||
name: 'ProcessItem',
|
||||
components: {},
|
||||
props: ['id', 'name', 'line', 'desc', 'isActive'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
handleEdit() {
|
||||
this.$emit('edit', this.id);
|
||||
},
|
||||
handleViewDetail(e) {
|
||||
this.$router.push({
|
||||
name: 'ProcessFlowView',
|
||||
params: {
|
||||
id: this.id,
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
class={'process-item' + (this.isActive ? ' active' : '')}
|
||||
style="display: flex; flex-direction: column; position: relative;">
|
||||
<div
|
||||
class="process-item__content"
|
||||
style="flex: 1; display: flex; align-items: center; cursor: pointer;"
|
||||
title="点击查看详细工序列表"
|
||||
onClick={this.handleViewDetail}>
|
||||
{this.isActive ? (
|
||||
<span style="display: inline-block; width: 10px; height: 10px; border-radius: 100%; background: #0ebe3a; position: absolute; top: 20px; right: 20px;" />
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<svg-icon
|
||||
icon-class="tree-table"
|
||||
style="margin-left: 12px; width: 48px; height: 48px; color: #0858ff33"
|
||||
/>
|
||||
<div
|
||||
class="info"
|
||||
style="margin-left: 12px; display: flex; flex-direction: column;">
|
||||
<h2 style="margin: 20px 0 0; font-weight: 600; font-size: 18px; ">
|
||||
{this.name}
|
||||
</h2>
|
||||
<h3 style="margin: 0; font-weight: 400; font-size: 14px; line-height: 2; color: #888;">
|
||||
{this.line || '/'}
|
||||
</h3>
|
||||
<p style="margin: 0; text-overflow: ellipse; white-space: nowrap; font-weight: 400; font-size: 14px; line-height: 1.25; color: #888;">
|
||||
{this.desc}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="process-item__footer"
|
||||
style="background: #f7f9fa; border-top: 1px solid #0001;">
|
||||
<el-row gutter={20}>
|
||||
<el-col
|
||||
span={8}
|
||||
style="text-align: center; border-right: 1px solid #0001">
|
||||
<el-button
|
||||
type="text"
|
||||
style="color: #0007; line-height: 1.75"
|
||||
onClick={this.handleEdit}>
|
||||
编辑
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col
|
||||
span={8}
|
||||
style="text-align: center; border-right: 1px solid #0001">
|
||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
||||
复制
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col span={8} style="text-align: center;">
|
||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'ProcessFlow',
|
||||
components: { ProcessItem },
|
||||
mixins: [basicPageMixin],
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
updateUrl: '/extend/process-flow/update',
|
||||
addUrl: '/extend/process-flow/create',
|
||||
pageUrl: '/extend/process-flow/page',
|
||||
infoUrl: '/extend/process-flow/get',
|
||||
searchBarKeys: ['name', 'code', 'lineId', 'productId'],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
label: '工艺流程列表',
|
||||
},
|
||||
],
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
code: null,
|
||||
name: null,
|
||||
productId: null,
|
||||
lineId: null,
|
||||
},
|
||||
lineList: null,
|
||||
list: [],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '工艺名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
// bind: {
|
||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '工艺编码',
|
||||
prop: 'code',
|
||||
// url: '/base/core-equipment/getCode',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '产线',
|
||||
prop: 'lineId',
|
||||
// cache: 'processFlow::lineList',
|
||||
url: '/base/core-production-line/listAll',
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
switch: true,
|
||||
label: '是否启用',
|
||||
prop: 'enabled',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
textarea: true,
|
||||
label: '功能描述',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
form: {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
productId: null,
|
||||
lineId: null,
|
||||
enabled: 1,
|
||||
remark: null,
|
||||
externalCode: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
productId: null,
|
||||
lineId: null,
|
||||
enabled: 1,
|
||||
remark: null,
|
||||
externalCode: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.showUploadComponents = false;
|
||||
this.title = '添加工艺';
|
||||
},
|
||||
async handleUpdate(id) {
|
||||
this.reset();
|
||||
const { data } = await this.info({ id });
|
||||
this.form = data;
|
||||
this.open = true;
|
||||
this.title = '修改工艺';
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async getList() {
|
||||
this.loading = true;
|
||||
const { code, data } = await this.recv(this.queryParams);
|
||||
if (code == 0) {
|
||||
this.list = data.list;
|
||||
this.total = data.total;
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
// async getList() {
|
||||
// this.loading = true;
|
||||
// const { code, data } = await this.recv(this.queryParams);
|
||||
// if (code == 0) {
|
||||
// const list = [];
|
||||
// for (const item of data.list) {
|
||||
// const newItem = await this.itemAttachName(item);
|
||||
// list.push(newItem);
|
||||
// }
|
||||
// this.list = list;
|
||||
// this.total = data.total;
|
||||
// this.loading = false;
|
||||
// return;
|
||||
// }
|
||||
// this.loading = false;
|
||||
// },
|
||||
|
||||
// async itemAttachName(item) {
|
||||
// if (!this.lineList) {
|
||||
// this.lineList = await cache.getList(
|
||||
// 'processFlow::lineList',
|
||||
// async () => {
|
||||
// const { code, data } = await this.$axios(
|
||||
// '/base/core-production-line/listAll'
|
||||
// );
|
||||
// if (code == 0) {
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// return {
|
||||
// ...item,
|
||||
// lineName: this.lineList.find((line) => line.id == item.lineId)?.name,
|
||||
// };
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.process-flow {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
grid-auto-rows: 200px;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.process-item__add-btn {
|
||||
display: grid;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 20px;
|
||||
color: #ccc;
|
||||
border-style: dashed;
|
||||
border-radius: 6px;
|
||||
place-items: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease-in;
|
||||
|
||||
&:hover {
|
||||
color: #555;
|
||||
border-color: #555;
|
||||
}
|
||||
}
|
||||
|
||||
.process-item {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 6px 1px #ccc;
|
||||
overflow: hidden;
|
||||
|
||||
// &.active {
|
||||
// box-shadow: 0 0 6px 1px #18c8bf66;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
@@ -1,104 +0,0 @@
|
||||
<!--
|
||||
filename: ProcessBomList.vue
|
||||
author: liubin
|
||||
date: 2023-10-20 15:00:58
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<section class="process-bom">
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||
|
||||
<div
|
||||
class="btns"
|
||||
style="
|
||||
text-align: right;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
display: flex;
|
||||
">
|
||||
<el-button type="primary" plain class="btn-create" icon="el-icon-plus">
|
||||
分配设备
|
||||
</el-button>
|
||||
<el-input
|
||||
icon="el-icon-search"
|
||||
placeholder="搜索"
|
||||
style="margin-left: 20px">
|
||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ProcessBom',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
searchBarFormConfig: [{ label: '工序下设备' }],
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ prop: 'code', label: '物料BOM' },
|
||||
{ prop: 'remark', label: '参数BOM' },
|
||||
],
|
||||
list: [],
|
||||
total: 0,
|
||||
tableBtn: [],
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
handleEmitFun() {},
|
||||
handleTableBtnClick() {},
|
||||
getList() {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.process-bom {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
padding: 12px 20px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,214 +0,0 @@
|
||||
<!--
|
||||
filename: ProcessGraph.vue
|
||||
author: liubin
|
||||
date: 2023-10-20 15:00:58
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<section class="process-graph">
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||
|
||||
<div
|
||||
class="btns"
|
||||
style="text-align: right; position: absolute; top: 20px; right: 20px">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
class="btn-create"
|
||||
icon="el-icon-plus"
|
||||
@click="createDet">
|
||||
新建工序
|
||||
</el-button>
|
||||
<el-button class="btn-serialize" @click="graphToJson">序列化</el-button>
|
||||
<el-button class="btn-antiserialize" @click="jsonToGraph">
|
||||
反序列化
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="process-graph__panel" ref="panel"></div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Graph } from '@antv/x6';
|
||||
import ProcessNode from './ProcessNode';
|
||||
|
||||
Graph.registerNode('process-node', ProcessNode);
|
||||
|
||||
export default {
|
||||
name: 'ProcessGraph',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
graph: null,
|
||||
searchBarFormConfig: [{ label: '工序列表' }],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const graph = new Graph({
|
||||
container: this.$refs.panel,
|
||||
grid: {
|
||||
size: 10,
|
||||
visible: false,
|
||||
type: 'dot',
|
||||
args: {
|
||||
color: '#f005',
|
||||
thickness: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const pn1 = graph.addNode({
|
||||
shape: 'process-node',
|
||||
x: 30,
|
||||
y: 30,
|
||||
processName: '工序00A',
|
||||
workshopName: '工段1',
|
||||
processDesc: 'test test test',
|
||||
processId: '1',
|
||||
});
|
||||
const pn2 = graph.addNode({
|
||||
shape: 'process-node',
|
||||
x: 240,
|
||||
y: 30,
|
||||
processName: '工序00B',
|
||||
workshopName: '工段1',
|
||||
processDesc: 'test test test',
|
||||
processId: '1',
|
||||
});
|
||||
|
||||
const pn3 = graph.addNode({
|
||||
shape: 'process-node',
|
||||
x: 360,
|
||||
y: 30,
|
||||
processName: '工序00C',
|
||||
workshopName: '工段1',
|
||||
processDesc: 'test test test',
|
||||
processId: '1',
|
||||
});
|
||||
|
||||
const pn4 = graph.addNode({
|
||||
shape: 'process-node',
|
||||
x: 360,
|
||||
y: 120,
|
||||
processName: '工序00D',
|
||||
workshopName: '工段1',
|
||||
processDesc: 'test test test',
|
||||
processId: '1',
|
||||
});
|
||||
|
||||
const pn5 = graph.addNode({
|
||||
shape: 'process-node',
|
||||
x: 500,
|
||||
y: 30,
|
||||
processName: '工序00E',
|
||||
workshopName: '工段1',
|
||||
processDesc: 'test test test',
|
||||
processId: '1',
|
||||
});
|
||||
|
||||
graph.addEdge({
|
||||
source: pn1,
|
||||
target: pn2,
|
||||
attrs: {
|
||||
line: {
|
||||
stroke: '#0b58ff',
|
||||
strokeWidth: 1,
|
||||
targetMarker: {
|
||||
// name: 'classic',
|
||||
// name: 'async',
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
graph.addEdge({
|
||||
source: pn2,
|
||||
target: pn3,
|
||||
attrs: {
|
||||
line: {
|
||||
stroke: '#0b58ff',
|
||||
strokeWidth: 1,
|
||||
targetMarker: {
|
||||
// name: 'classic',
|
||||
// name: 'async',
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
graph.addEdge({
|
||||
source: pn2,
|
||||
target: pn4,
|
||||
attrs: {
|
||||
line: {
|
||||
stroke: '#0b58ff',
|
||||
strokeWidth: 1,
|
||||
targetMarker: {
|
||||
// name: 'classic',
|
||||
// name: 'async',
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
graph.addEdge({
|
||||
source: pn3,
|
||||
target: pn5,
|
||||
attrs: {
|
||||
line: {
|
||||
stroke: '#0b58ff',
|
||||
strokeWidth: 1,
|
||||
targetMarker: {
|
||||
// name: 'classic',
|
||||
// name: 'async',
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
graph.addEdge({
|
||||
source: pn4,
|
||||
target: pn5,
|
||||
attrs: {
|
||||
line: {
|
||||
stroke: '#0b58ff',
|
||||
strokeWidth: 1,
|
||||
targetMarker: {
|
||||
// name: 'classic',
|
||||
// name: 'async',
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
this.graph = graph;
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
createDet() {},
|
||||
jsonToGraph() {},
|
||||
graphToJson() {
|
||||
if (this.graph) {
|
||||
console.log(JSON.stringify(this.graph.toJSON(), null, 2));
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.process-graph {
|
||||
padding: 12px 20px 20px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.process-graph__panel {
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,89 +0,0 @@
|
||||
<!--
|
||||
filename: ProcessInfo.vue
|
||||
author: liubin
|
||||
date: 2023-10-20 15:00:58
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<section class="process-info">
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<InfoItem label="工艺名称" value="测试工艺" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<InfoItem label="产线" value="A4" />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<InfoItem
|
||||
label="工艺描述"
|
||||
value="咯热门asdfkj alsdfk ;lkj flskdjf sadf" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" style="margin-top: 12px;">
|
||||
<el-col :span="6">
|
||||
<InfoItem label="创建人" value="xxse" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<InfoItem label="创建时间" value="2023-10-22 10:11:00" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<InfoItem label="更新人" value="xxse" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<InfoItem label="更新时间" value="2023-10-22 10:11:00" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
|
||||
const InfoItem = {
|
||||
name: 'InfoItem',
|
||||
components: {},
|
||||
props: ['label', 'value'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5">
|
||||
<span style="width: 100px; text-align: left; font-weight: 700">{this.label}:</span>
|
||||
<span style="width: 200px; text-align: left; text-overflow: ellipse; white-space: nowrap">
|
||||
{this.value}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'ProcessInfo',
|
||||
components: { InfoItem },
|
||||
mixins: [basicPageMixin],
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
infoUrl: '/extend/process-flow/get',
|
||||
searchBarFormConfig: [{ label: '工艺详情' }],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.process-info {
|
||||
padding: 12px 20px 20px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,135 +0,0 @@
|
||||
import { Node, ObjectExt } from '@antv/x6';
|
||||
|
||||
|
||||
export default class ProcessNode extends Node {
|
||||
|
||||
}
|
||||
|
||||
ProcessNode.config({
|
||||
width: 240,
|
||||
height: 100,
|
||||
markup: [
|
||||
{
|
||||
tagName: 'rect',
|
||||
attrs: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 200,
|
||||
height: 100,
|
||||
fill: 'transparent',
|
||||
stroke: '#0b58ff'
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: 'rect',
|
||||
attrs: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 200,
|
||||
height: 50,
|
||||
fill: '#ffffff',
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: 'rect',
|
||||
attrs: {
|
||||
x: 0,
|
||||
y: 50,
|
||||
width: 200,
|
||||
height: 50,
|
||||
fill: '#f8f8f8',
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: 'text',
|
||||
selector: 'processName',
|
||||
attrs: {
|
||||
x: 20,
|
||||
y: 30,
|
||||
// fill: '#777',
|
||||
// fontSize: 14
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: 'text',
|
||||
selector: 'workshopName',
|
||||
attrs: {
|
||||
x: 115,
|
||||
y: 30,
|
||||
// fill: '#777',
|
||||
// fontSize: 14
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: 'text',
|
||||
selector: 'processDesc',
|
||||
// textContent: '工序00A',
|
||||
attrs: {
|
||||
x: 26,
|
||||
y: 80,
|
||||
fill: '#777',
|
||||
fontSize: 14
|
||||
},
|
||||
},
|
||||
// {
|
||||
// tagName: 'text',
|
||||
// textContent: '工序名称',
|
||||
// attrs: {
|
||||
// x: 20,
|
||||
// y: 30,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// tagName: 'text',
|
||||
// textContent: '工段名称',
|
||||
// attrs: {
|
||||
// x: 115,
|
||||
// y: 30,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// tagName: 'text',
|
||||
// selector: 'processName',
|
||||
// // textContent: '工序00A',
|
||||
// attrs: {
|
||||
// x: 26,
|
||||
// y: 80,
|
||||
// fill: '#777',
|
||||
// fontSize: 14
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// tagName: 'text',
|
||||
// selector: 'workshopName',
|
||||
// // textContent: '工段1',
|
||||
// attrs: {
|
||||
// x: 128,
|
||||
// y: 80,
|
||||
// fill: '#777',
|
||||
// fontSize: 14
|
||||
// },
|
||||
// },
|
||||
],
|
||||
//
|
||||
propHooks(metadata) {
|
||||
const { processName, workshopName, processDesc, processId, ...others } = metadata;
|
||||
// debugger;
|
||||
if (processName) {
|
||||
console.log("processName", processName)
|
||||
ObjectExt.setByPath(others, 'attrs/processName/text', processName);
|
||||
}
|
||||
if (workshopName) {
|
||||
console.log("workshopName", workshopName)
|
||||
ObjectExt.setByPath(others, 'attrs/workshopName/text', workshopName);
|
||||
}
|
||||
if (processDesc) {
|
||||
console.log("processDesc", processDesc)
|
||||
ObjectExt.setByPath(others, 'attrs/processDesc/text', processDesc);
|
||||
}
|
||||
if (processId) {
|
||||
console.log("processId", processId)
|
||||
ObjectExt.setByPath(others, 'processId', processId);
|
||||
}
|
||||
return others;
|
||||
}
|
||||
})
|
||||
@@ -1,44 +0,0 @@
|
||||
<!--
|
||||
filename: index.vue
|
||||
author: liubin
|
||||
date: 2023-10-18 12:25:46
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container process-flow-view">
|
||||
<ProcessInfo />
|
||||
<ProcessDetail style="margin-top: 16px" />
|
||||
<ProcessBomList style="margin-top: 16px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProcessInfo from './components/ProcessInfo.vue';
|
||||
import ProcessBomList from './components/ProcessBomList.vue';
|
||||
import ProcessDetail from './components/ProcessDetail.vue';
|
||||
|
||||
export default {
|
||||
name: 'ProcessFlowView',
|
||||
components: { ProcessInfo, ProcessDetail, ProcessBomList },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
activated() {
|
||||
console.log('activated...', this.$route.params);
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.process-flow-view {
|
||||
padding: 8px;
|
||||
flex: 1;
|
||||
background: #f2f4f9;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
@@ -4,70 +4,227 @@
|
||||
<!-- 登录区域 -->
|
||||
<div class="content">
|
||||
<!-- 配图 -->
|
||||
<div class="pic"></div>
|
||||
<div class="pic">
|
||||
<div
|
||||
class="welcome"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 15%;
|
||||
left: 20%;
|
||||
user-select: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
">
|
||||
<strong
|
||||
style="
|
||||
letter-spacing: 1px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 88px;
|
||||
">
|
||||
<span style="color: #26b9de">Wel</span>
|
||||
<span style="color: #fff">come</span>
|
||||
</strong>
|
||||
<p
|
||||
style="
|
||||
margin: 0;
|
||||
font-size: 26px;
|
||||
letter-spacing: 1px;
|
||||
color: #26b9de;
|
||||
opacity: 75%;
|
||||
">
|
||||
<span
|
||||
style="
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
margin-left: 8px;
|
||||
margin-right: 12px;
|
||||
border-radius: 100%;
|
||||
background: #26b9de;
|
||||
"></span>
|
||||
产线生产监控系统
|
||||
</p>
|
||||
</div>
|
||||
<video
|
||||
src="/static/videos/login.webm"
|
||||
muted
|
||||
autoplay
|
||||
loop
|
||||
style="
|
||||
user-select: none;
|
||||
position: absolute;
|
||||
top: 28%;
|
||||
width: 100%;
|
||||
height: 70%;
|
||||
"></video>
|
||||
</div>
|
||||
<!-- 表单 -->
|
||||
<div class="field">
|
||||
<!-- [移动端]标题 -->
|
||||
<h2 class="mobile-title">
|
||||
<h3 class="title">芋道后台管理系统</h3>
|
||||
<h3 class="title">中建材智能自动化研究院有限公司</h3>
|
||||
</h2>
|
||||
<h2 class="pc-title" style="">
|
||||
<h3
|
||||
class="title"
|
||||
style="
|
||||
margin: 0;
|
||||
margin-left: 32px;
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: #000;
|
||||
font-size: 36px;
|
||||
line-height: 54px;
|
||||
letter-spacing: 2px;
|
||||
">
|
||||
<img
|
||||
src="../assets/logo/cnbm.png"
|
||||
alt="cnbm_logo"
|
||||
style="
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
position: relative;
|
||||
top: 12px;
|
||||
right: 8px;
|
||||
" />
|
||||
<span>中建材智能自动化研究院有限公司</span>
|
||||
</h3>
|
||||
<h3
|
||||
class="sub-title"
|
||||
style="
|
||||
margin: 0;
|
||||
margin-left: 32px;
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: #000;
|
||||
font-size: 36px;
|
||||
line-height: 54px;
|
||||
letter-spacing: 2px;
|
||||
">
|
||||
产线生产监控系统
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<!-- 表单 -->
|
||||
<div class="form-cont">
|
||||
<el-tabs class="form" v-model="loginForm.loginType" style=" float:none;">
|
||||
<el-tab-pane label="账号密码登录" name="uname">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="短信验证码登录" name="sms">
|
||||
</el-tab-pane>
|
||||
<el-tabs
|
||||
class="form"
|
||||
v-model="loginForm.loginType"
|
||||
style="float: none">
|
||||
<el-tab-pane label="账号密码登录" name="uname"></el-tab-pane>
|
||||
<el-tab-pane label="短信验证码登录" name="sms"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form">
|
||||
<div style="">
|
||||
<el-form
|
||||
ref="loginForm"
|
||||
:model="loginForm"
|
||||
:rules="LoginRules"
|
||||
class="login-form">
|
||||
<el-form-item prop="tenantName" v-if="tenantEnable">
|
||||
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='租户'>
|
||||
<svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon" />
|
||||
<el-input
|
||||
v-model="loginForm.tenantName"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="租户">
|
||||
<!-- <svg-icon
|
||||
slot="prefix"
|
||||
icon-class="tree"
|
||||
class="el-input__icon input-icon" /> -->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<!-- 账号密码登录 -->
|
||||
<div v-if="loginForm.loginType === 'uname'">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="账号">
|
||||
<!-- <svg-icon
|
||||
slot="prefix"
|
||||
icon-class="user"
|
||||
class="el-input__icon input-icon" /> -->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter.native="getCode">
|
||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||
<!-- <svg-icon
|
||||
slot="prefix"
|
||||
icon-class="password"
|
||||
class="el-input__icon input-icon" /> -->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;">记住密码</el-checkbox>
|
||||
<el-checkbox
|
||||
v-model="loginForm.rememberMe"
|
||||
style="margin: 0 0 25px 0">
|
||||
记住密码
|
||||
</el-checkbox>
|
||||
</div>
|
||||
|
||||
<!-- 短信验证码登录 -->
|
||||
<div v-if="loginForm.loginType === 'sms'">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input v-model="loginForm.mobile" type="text" auto-complete="off" placeholder="请输入手机号">
|
||||
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
|
||||
<el-input
|
||||
v-model="loginForm.mobile"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="请输入手机号">
|
||||
<!-- <svg-icon
|
||||
slot="prefix"
|
||||
icon-class="phone"
|
||||
class="el-input__icon input-icon" /> -->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mobileCode">
|
||||
<el-input v-model="loginForm.mobileCode" type="text" auto-complete="off" placeholder="短信验证码"
|
||||
class="sms-login-mobile-code-prefix" @keyup.enter.native="handleLogin">
|
||||
<template>
|
||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
<template slot="append">
|
||||
<span v-if="mobileCodeTimer <= 0" class="getMobileCode" @click="getSmsCode"
|
||||
style="cursor: pointer;">获取验证码</span>
|
||||
<span v-if="mobileCodeTimer > 0" class="getMobileCode">{{ mobileCodeTimer }}秒后可重新获取</span>
|
||||
<el-input
|
||||
v-model="loginForm.mobileCode"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
placeholder="短信验证码"
|
||||
class="sms-login-mobile-code-prefix"
|
||||
@keyup.enter.native="handleLogin">
|
||||
<!-- <template>
|
||||
<svg-icon
|
||||
slot="prefix"
|
||||
icon-class="password"
|
||||
class="el-input__icon input-icon" />
|
||||
</template> -->
|
||||
<template slot="suffix">
|
||||
<span
|
||||
v-if="mobileCodeTimer <= 0"
|
||||
class="getMobileCode"
|
||||
@click="getSmsCode"
|
||||
style="
|
||||
cursor: pointer;
|
||||
color: #0b58ff;
|
||||
font-size: 18px;
|
||||
line-height: 66px;
|
||||
padding-right: 12px;
|
||||
">
|
||||
获取验证码
|
||||
</span>
|
||||
<span v-if="mobileCodeTimer > 0" class="getMobileCode">
|
||||
{{ mobileCodeTimer }}秒后可重新获取
|
||||
</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 下方的登录按钮 -->
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
|
||||
<el-form-item id="button-form-item" style="width: 100%; margin-top: 32px">
|
||||
<el-button
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%; height: 66px; font-size: 18px;"
|
||||
@click.native.prevent="getCode">
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
@@ -86,99 +243,113 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图形验证码 -->
|
||||
<Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{ width: '400px', height: '200px' }"
|
||||
@success="handleLogin" />
|
||||
|
||||
<!-- footer -->
|
||||
<div class="footer">
|
||||
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图形验证码 -->
|
||||
<Verify
|
||||
ref="verify"
|
||||
:captcha-type="'blockPuzzle'"
|
||||
:img-size="{ width: '400px', height: '200px' }"
|
||||
@success="handleLogin" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sendSmsCode, socialAuthRedirect } from "@/api/login";
|
||||
import { getTenantIdByName } from "@/api/system/tenant";
|
||||
import { SystemUserSocialTypeEnum } from "@/utils/constants";
|
||||
import { getCaptchaEnable, getTenantEnable } from "@/utils/ruoyi";
|
||||
import { sendSmsCode, socialAuthRedirect } from '@/api/login';
|
||||
import { getTenantIdByName } from '@/api/system/tenant';
|
||||
import { SystemUserSocialTypeEnum } from '@/utils/constants';
|
||||
import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi';
|
||||
import {
|
||||
getPassword,
|
||||
getRememberMe, getTenantName,
|
||||
getRememberMe,
|
||||
getTenantName,
|
||||
getUsername,
|
||||
removePassword, removeRememberMe, removeTenantName,
|
||||
removePassword,
|
||||
removeRememberMe,
|
||||
removeTenantName,
|
||||
removeUsername,
|
||||
setPassword, setRememberMe, setTenantId, setTenantName,
|
||||
setUsername
|
||||
} from "@/utils/auth";
|
||||
setPassword,
|
||||
setRememberMe,
|
||||
setTenantId,
|
||||
setTenantName,
|
||||
setUsername,
|
||||
} from '@/utils/auth';
|
||||
|
||||
import Verify from '@/components/Verifition/Verify';
|
||||
import { resetUserPwd } from "@/api/system/user";
|
||||
import { resetUserPwd } from '@/api/system/user';
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
name: 'Login',
|
||||
components: {
|
||||
Verify
|
||||
Verify,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
codeUrl: "",
|
||||
codeUrl: '',
|
||||
captchaEnable: true,
|
||||
tenantEnable: true,
|
||||
mobileCodeTimer: 0,
|
||||
loginForm: {
|
||||
loginType: "uname",
|
||||
username: "admin",
|
||||
password: "admin123",
|
||||
captchaVerification: "",
|
||||
mobile: "",
|
||||
mobileCode: "",
|
||||
loginType: 'uname',
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
captchaVerification: '',
|
||||
mobile: '',
|
||||
mobileCode: '',
|
||||
rememberMe: false,
|
||||
tenantName: "技术中心",
|
||||
tenantName: '技术中心',
|
||||
},
|
||||
scene: 21,
|
||||
|
||||
LoginRules: {
|
||||
username: [
|
||||
{ required: true, trigger: "blur", message: "用户名不能为空" }
|
||||
{ required: true, trigger: 'blur', message: '用户名不能为空' },
|
||||
],
|
||||
password: [
|
||||
{ required: true, trigger: "blur", message: "密码不能为空" }
|
||||
{ required: true, trigger: 'blur', message: '密码不能为空' },
|
||||
],
|
||||
mobile: [
|
||||
{ required: true, trigger: "blur", message: "手机号不能为空" },
|
||||
{ required: true, trigger: 'blur', message: '手机号不能为空' },
|
||||
{
|
||||
validator: function (rule, value, callback) {
|
||||
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
|
||||
callback(new Error("手机号格式错误"));
|
||||
if (
|
||||
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(
|
||||
value
|
||||
) === false
|
||||
) {
|
||||
callback(new Error('手机号格式错误'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: "blur"
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
tenantName: [
|
||||
{ required: true, trigger: "blur", message: "租户不能为空" },
|
||||
{ required: true, trigger: 'blur', message: '租户不能为空' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// debugger
|
||||
getTenantIdByName(value).then(res => {
|
||||
getTenantIdByName(value).then((res) => {
|
||||
const tenantId = res.data;
|
||||
if (tenantId && tenantId >= 0) {
|
||||
// 设置租户
|
||||
setTenantId(tenantId)
|
||||
setTenantId(tenantId);
|
||||
callback();
|
||||
} else {
|
||||
callback('租户不存在');
|
||||
}
|
||||
});
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
loading: false,
|
||||
redirect: undefined,
|
||||
@@ -190,30 +361,33 @@ export default {
|
||||
// 租户开关
|
||||
this.tenantEnable = getTenantEnable();
|
||||
if (this.tenantEnable) {
|
||||
getTenantIdByName(this.loginForm.tenantName).then(res => { // 设置租户
|
||||
getTenantIdByName(this.loginForm.tenantName).then((res) => {
|
||||
// 设置租户
|
||||
const tenantId = res.data;
|
||||
if (tenantId && tenantId >= 0) {
|
||||
setTenantId(tenantId)
|
||||
setTenantId(tenantId);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 验证码开关
|
||||
this.captchaEnable = getCaptchaEnable();
|
||||
// 重定向地址
|
||||
this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
|
||||
this.redirect = this.$route.query.redirect
|
||||
? decodeURIComponent(this.$route.query.redirect)
|
||||
: undefined;
|
||||
this.getCookie();
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
// 情况一,未开启:则直接登录
|
||||
if (!this.captchaEnable) {
|
||||
this.handleLogin({})
|
||||
this.handleLogin({});
|
||||
return;
|
||||
}
|
||||
|
||||
// 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
|
||||
// 弹出验证码
|
||||
this.$refs.verify.show()
|
||||
this.$refs.verify.show();
|
||||
},
|
||||
getCookie() {
|
||||
const username = getUsername();
|
||||
@@ -229,28 +403,34 @@ export default {
|
||||
};
|
||||
},
|
||||
handleLogin(captchaParams) {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
// 设置 Cookie
|
||||
if (this.loginForm.rememberMe) {
|
||||
setUsername(this.loginForm.username)
|
||||
setPassword(this.loginForm.password)
|
||||
setRememberMe(this.loginForm.rememberMe)
|
||||
setTenantName(this.loginForm.tenantName)
|
||||
setUsername(this.loginForm.username);
|
||||
setPassword(this.loginForm.password);
|
||||
setRememberMe(this.loginForm.rememberMe);
|
||||
setTenantName(this.loginForm.tenantName);
|
||||
} else {
|
||||
removeUsername()
|
||||
removePassword()
|
||||
removeRememberMe()
|
||||
removeTenantName()
|
||||
removeUsername();
|
||||
removePassword();
|
||||
removeRememberMe();
|
||||
removeTenantName();
|
||||
}
|
||||
this.loginForm.captchaVerification = captchaParams.captchaVerification
|
||||
this.loginForm.captchaVerification =
|
||||
captchaParams.captchaVerification;
|
||||
// 发起登陆
|
||||
// console.log("发起登录", this.loginForm);
|
||||
this.$store.dispatch(this.loginForm.loginType === "sms" ? "SmsLogin" : "Login", this.loginForm).then(() => {
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(() => {
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$store
|
||||
.dispatch(
|
||||
this.loginForm.loginType === 'sms' ? 'SmsLogin' : 'Login',
|
||||
this.loginForm
|
||||
)
|
||||
.then(() => {
|
||||
this.$router.push({ path: this.redirect || '/' }).catch(() => {});
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
@@ -261,34 +441,46 @@ export default {
|
||||
this.loading = true;
|
||||
let tenant = false;
|
||||
if (this.tenantEnable) {
|
||||
await this.$prompt('请输入租户名称', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(async ({ value }) => {
|
||||
await getTenantIdByName(value).then(res => {
|
||||
await this.$prompt('请输入租户名称', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
.then(async ({ value }) => {
|
||||
await getTenantIdByName(value).then((res) => {
|
||||
const tenantId = res.data;
|
||||
tenant = true
|
||||
tenant = true;
|
||||
if (tenantId && tenantId >= 0) {
|
||||
setTenantId(tenantId)
|
||||
setTenantId(tenantId);
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消登录按钮 loading状态
|
||||
this.loading = false;
|
||||
|
||||
return false
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
tenant = true
|
||||
tenant = true;
|
||||
}
|
||||
if (tenant) {
|
||||
// 计算 redirectUri
|
||||
const redirectUri = location.origin + '/social-login?'
|
||||
+ encodeURIComponent('type=' + socialTypeEnum.type + '&redirect=' + (this.redirect || "/")); // 重定向不能丢
|
||||
const redirectUri =
|
||||
location.origin +
|
||||
'/social-login?' +
|
||||
encodeURIComponent(
|
||||
'type=' +
|
||||
socialTypeEnum.type +
|
||||
'&redirect=' +
|
||||
(this.redirect || '/')
|
||||
); // 重定向不能丢
|
||||
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
|
||||
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
|
||||
// 进行跳转
|
||||
socialAuthRedirect(socialTypeEnum.type, encodeURIComponent(redirectUri)).then((res) => {
|
||||
socialAuthRedirect(
|
||||
socialTypeEnum.type,
|
||||
encodeURIComponent(redirectUri)
|
||||
).then((res) => {
|
||||
// console.log(res.url);
|
||||
window.location.href = res.data;
|
||||
});
|
||||
@@ -297,10 +489,15 @@ export default {
|
||||
/** ========== 以下为升级短信登录 ========== */
|
||||
getSmsCode() {
|
||||
if (this.mobileCodeTimer > 0) return;
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (!valid) return;
|
||||
sendSmsCode(this.loginForm.mobile, this.scene, this.loginForm.uuid, this.loginForm.code).then(res => {
|
||||
this.$modal.msgSuccess("获取验证码成功")
|
||||
sendSmsCode(
|
||||
this.loginForm.mobile,
|
||||
this.scene,
|
||||
this.loginForm.uuid,
|
||||
this.loginForm.code
|
||||
).then((res) => {
|
||||
this.$modal.msgSuccess('获取验证码成功');
|
||||
this.mobileCodeTimer = 60;
|
||||
let msgTimer = setInterval(() => {
|
||||
this.mobileCodeTimer = this.mobileCodeTimer - 1;
|
||||
@@ -310,13 +507,12 @@ export default {
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/login.scss";
|
||||
|
||||
@import '~@/assets/styles/login.scss';
|
||||
|
||||
.oauth-login {
|
||||
display: flex;
|
||||
@@ -344,4 +540,5 @@ export default {
|
||||
:deep(.el-input__prefix) {
|
||||
top: 22%;
|
||||
}
|
||||
}</style>
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -77,7 +77,6 @@ export default {
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
prop: 'equipmentCode',
|
||||
label: '设备编码',
|
||||
},
|
||||
@@ -216,7 +215,7 @@ export default {
|
||||
/** 根据产线获取设备 */
|
||||
async getEquipmentList(id) {
|
||||
const { data } = await this.$axios({
|
||||
url: '/base/core-equipment/listByLine',
|
||||
url: '/base/equipment/listByLine',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
:dataForm="form"
|
||||
v-model="form"
|
||||
:rows="[
|
||||
[
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
:dataForm="form"
|
||||
v-model="form"
|
||||
:rows="[
|
||||
[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user