Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhongtong-avi-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中通客车项目
zhongtong-avi-web
Commits
4ffa49a3
Commit
4ffa49a3
authored
Mar 13, 2020
by
李志鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(设备状态): 功能联调(100%) 添加权限 eslint错误修复
parent
919d5834
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
44 deletions
+99
-44
htmlToPdf.js
src/components/htmlToPdf/htmlToPdf.js
+30
-30
deviceRunning.js
src/router/modules/deviceRunning.js
+1
-1
dutyStation.js
src/router/modules/dutyStation.js
+1
-1
list.vue
src/views/DeviceRunning/DeviceStatus/list.vue
+63
-10
list.vue
src/views/DutyStation/list.vue
+4
-2
No files found.
src/components/htmlToPdf/htmlToPdf.js
View file @
4ffa49a3
...
...
@@ -2,36 +2,36 @@
import
html2Canvas
from
'html2canvas'
import
JsPDF
from
'jspdf'
export
default
{
install
(
Vue
,
options
)
{
Vue
.
prototype
.
getPdf
=
function
()
{
var
title
=
this
.
htmlTitle
html2Canvas
(
document
.
querySelector
(
'.many_charts'
),
{
allowTaint
:
true
}).
then
(
function
(
canvas
)
{
let
contentWidth
=
canvas
.
width
let
contentHeight
=
canvas
.
height
let
pageHeight
=
contentWidth
/
592.28
*
841.89
let
leftHeight
=
contentHeight
let
position
=
0
let
imgWidth
=
595.28
let
imgHeight
=
592.28
/
contentWidth
*
contentHeight
let
pageData
=
canvas
.
toDataURL
(
'image/jpeg'
,
1.0
)
let
PDF
=
new
JsPDF
(
''
,
'pt'
,
'a4'
)
if
(
leftHeight
<
pageHeight
)
{
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
0
,
imgWidth
,
imgHeight
)
}
else
{
while
(
leftHeight
>
0
)
{
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
position
,
imgWidth
,
imgHeight
)
leftHeight
-=
pageHeight
position
-=
841.89
if
(
leftHeight
>
0
)
{
PDF
.
addPage
()
install
(
Vue
,
options
)
{
Vue
.
prototype
.
getPdf
=
function
()
{
var
title
=
this
.
htmlTitle
html2Canvas
(
document
.
querySelector
(
'.many_charts'
),
{
allowTaint
:
true
}).
then
(
function
(
canvas
)
{
let
contentWidth
=
canvas
.
width
let
contentHeight
=
canvas
.
height
let
pageHeight
=
contentWidth
/
592.28
*
841.89
let
leftHeight
=
contentHeight
let
position
=
0
let
imgWidth
=
595.28
let
imgHeight
=
592.28
/
contentWidth
*
contentHeight
let
pageData
=
canvas
.
toDataURL
(
'image/jpeg'
,
1.0
)
let
PDF
=
new
JsPDF
(
''
,
'pt'
,
'a4'
)
if
(
leftHeight
<
pageHeight
)
{
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
0
,
imgWidth
,
imgHeight
)
}
else
{
while
(
leftHeight
>
0
)
{
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
position
,
imgWidth
,
imgHeight
)
leftHeight
-=
pageHeight
position
-=
841.89
if
(
leftHeight
>
0
)
{
PDF
.
addPage
()
}
}
}
PDF
.
save
(
title
+
'.pdf'
)
}
}
)
}
PDF
.
save
(
title
+
'.pdf'
)
}
)
}
}
}
\ No newline at end of file
}
src/router/modules/deviceRunning.js
View file @
4ffa49a3
...
...
@@ -24,7 +24,7 @@ export default {
path
:
'deviceStatus'
,
component
:
()
=>
import
(
'@/views/DeviceRunning/DeviceStatus/list'
),
name
:
'DeviceStatus'
,
meta
:
{
title
:
'DeviceStatus'
,
icon
:
'repairApplication'
,
noCache
:
false
}
meta
:
{
title
:
'DeviceStatus'
,
icon
:
'repairApplication'
,
noCache
:
false
,
mark
:
'/deviceRunning/deviceStatus/list'
}
}
]
}
src/router/modules/dutyStation.js
View file @
4ffa49a3
...
...
@@ -11,7 +11,7 @@ export default {
path
:
'index'
,
component
:
()
=>
import
(
'@/views/DutyStation/list'
),
name
:
'DutyStationIndex'
,
meta
:
{
title
:
'DutyStationIndex'
,
icon
:
'dutyStationSearch'
,
noCache
:
false
}
meta
:
{
title
:
'DutyStationIndex'
,
icon
:
'dutyStationSearch'
,
noCache
:
false
,
mark
:
'/dutyStation/index'
}
}
]
}
src/views/DeviceRunning/DeviceStatus/list.vue
View file @
4ffa49a3
...
...
@@ -13,7 +13,7 @@
</div>
<div
class=
"tool-pack clear-float pl-15 pr-15"
>
<Search
searchCode=
"
PASS_INFO
"
searchCode=
"
REAL_TIME_STATUS
"
@
search=
"doSearchClick"
@
reset=
"doResetClick"
>
</Search>
...
...
@@ -49,10 +49,10 @@
height
:
0
,
data
:
[],
fieldList
:
[
{
label
:
'车间'
,
value
:
'
vin
'
},
{
label
:
'设备名称'
,
value
:
'
station
Name'
},
{
label
:
'设备编码'
,
value
:
'
stationNo
'
},
{
label
:
'设备状态'
,
value
:
'
passTim
e'
}
{
label
:
'车间'
,
value
:
'
equipWorkshop
'
},
{
label
:
'设备名称'
,
value
:
'
equip
Name'
},
{
label
:
'设备编码'
,
value
:
'
equipCode
'
},
{
label
:
'设备状态'
,
value
:
'
equipStat
e'
}
],
paginationToggle
:
true
,
paginationConfig
:
{
...
...
@@ -65,19 +65,72 @@
},
methods
:
{
// 点击刷新按钮
doRefreshClick
()
{},
async
doRefreshClick
()
{
try
{
let
params
=
{
searchCode
:
this
.
searchList
.
searchCode
||
'REAL_TIME_STATUS'
,
filters
:
this
.
searchList
.
filters
||
[],
pageSize
:
this
.
tableConfig
.
paginationConfig
.
pageSize
,
pageNum
:
this
.
tableConfig
.
paginationConfig
.
currentPage
};
let
response
=
await
this
.
$service
(
'POST'
,
'/api/basicinfo/equipStatusRealTime'
,
params
);
this
.
tableConfig
.
data
=
_
.
cloneDeep
(
response
.
list
);
this
.
tableConfig
.
paginationConfig
.
total
=
_
.
cloneDeep
(
response
.
total
);
this
.
$message
.
success
(
'刷新成功'
);
}
catch
(
error
)
{
throw
error
;
}
},
// 点击搜索按钮
doSearchClick
(
searchValue
)
{},
doSearchClick
(
searchValue
)
{
this
.
searchList
=
searchValue
;
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
;
// 设备实时状态查询
this
.
getDeviceStatusRunningTime
();
},
// 点击重置按钮
doResetClick
(
searchValue
)
{},
doResetClick
(
searchValue
)
{
this
.
searchList
=
{
...
searchValue
,
filters
:
[]
};
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
;
this
.
tableConfig
.
paginationConfig
.
pageSize
=
20
;
// 设备实时状态查询
this
.
getDeviceStatusRunningTime
();
},
// 触发表格数量改变事件
onPageSizeChange
(
pageSize
)
{},
onPageSizeChange
(
pageSize
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
;
this
.
tableConfig
.
paginationConfig
.
pageSize
=
pageSize
;
// 设备实时状态查询
this
.
getDeviceStatusRunningTime
();
},
// 触发表格分页改变事件
onCurrentPageChange
(
currentPage
)
{}
onCurrentPageChange
(
currentPage
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
currentPage
;
// 设备实时状态查询
this
.
getDeviceStatusRunningTime
();
},
// 设备实时状态查询
async
getDeviceStatusRunningTime
()
{
try
{
let
params
=
{
searchCode
:
this
.
searchList
.
searchCode
||
'REAL_TIME_STATUS'
,
filters
:
this
.
searchList
.
filters
||
[],
pageSize
:
this
.
tableConfig
.
paginationConfig
.
pageSize
,
pageNum
:
this
.
tableConfig
.
paginationConfig
.
currentPage
};
let
response
=
await
this
.
$service
(
'POST'
,
'/api/basicinfo/equipStatusRealTime'
,
params
);
this
.
tableConfig
.
data
=
_
.
cloneDeep
(
response
.
list
);
this
.
tableConfig
.
paginationConfig
.
total
=
_
.
cloneDeep
(
response
.
total
);
}
catch
(
error
)
{
throw
error
;
}
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
tableConfig
.
height
=
document
.
querySelector
(
'.page-pack'
).
offsetHeight
-
178
;
// 设备实时状态查询
this
.
getDeviceStatusRunningTime
();
},
0
);
}
}
...
...
src/views/DutyStation/list.vue
View file @
4ffa49a3
...
...
@@ -21,13 +21,15 @@
<el-button
@
click=
"doOpenAutoMakeUpClick"
type=
"primary"
size=
"small"
>
size=
"small"
v-if=
"Authority.checkedAuthority('/dutyStation/index/openAutoMakeUp')"
>
开启自动补扫
</el-button>
<el-button
@
click=
"doStopAutoMakeUpClick"
type=
"primary"
size=
"small"
>
size=
"small"
v-if=
"Authority.checkedAuthority('/dutyStation/index/stopAutoMakeUp')"
>
关闭自动补扫
</el-button>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment