Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
卡
卡车调度系统
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
caicaicai
卡车调度系统
Commits
ead6a0f9
Commit
ead6a0f9
authored
Feb 24, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
4fb0603d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1356 additions
and
869 deletions
+1356
-869
common.js
src/assets/js/common.js
+145
-1
index.vue
src/views/carManagement/carType/index.vue
+62
-624
index.vue
src/views/productionPlanManagement/productionPlan/index.vue
+5
-5
index.vue
src/views/system/dataDictionary/alarmHowTime/index.vue
+273
-0
index.vue
src/views/system/dataDictionary/fatigueDriving/index.vue
+273
-0
index.vue
src/views/system/dataDictionary/getPriority/index.vue
+280
-0
index.vue
src/views/system/shift/index.vue
+318
-239
No files found.
src/assets/js/common.js
View file @
ead6a0f9
...
...
@@ -4,6 +4,151 @@ var baseAPI2 = process.env.VUE_APP_LOCAL_API2 + '/';
var
HttpReq
=
function
(){
return
{
//卡车调度系统
truckDispatching
:{
//系统管理——班次设置
shiftQuery
:
function
(){
return
request
({
url
:
'
/api/Class
'
,
method
:
'
get
'
,
})
},
shiftAdd
:
function
(
data
){
return
request
({
url
:
'
/api/Class
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
shiftUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/Class
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
shiftDel
:
function
(
data
){
return
request
({
url
:
'
/api/Class
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
//系统管理——数据字典——报警时长
alarmTimeQuery
:
function
(){
return
request
({
url
:
'
/api/AlarmTime
'
,
method
:
'
get
'
,
})
},
alarmTimeAdd
:
function
(
data
){
return
request
({
url
:
'
/api/AlarmTime
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
alarmTimeUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/AlarmTime
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
alarmTimetDel
:
function
(
data
){
return
request
({
url
:
'
/api/AlarmTime
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
//系统管理——数据字典——疲劳驾驶
fdriTimeQuery
:
function
(){
return
request
({
url
:
'
/api/FdriTime
'
,
method
:
'
get
'
,
})
},
fdriTimeAdd
:
function
(
data
){
return
request
({
url
:
'
/api/FdriTime
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
fdriTimeUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/FdriTime
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
fdriTimetDel
:
function
(
data
){
return
request
({
url
:
'
/api/FdriTime
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
//系统管理——数据字典——优先级设置
getPriorityQuery
:
function
(){
return
request
({
url
:
'
/api/Pri
'
,
method
:
'
get
'
,
})
},
getPriorityTimeAdd
:
function
(
data
){
return
request
({
url
:
'
/api/Pri
'
,
method
:
'
POST
'
,
data
:
data
,
}).
then
((
res
)
=>
{
return
res
})
},
getPriorityTimeUpdate
:
function
(
data
){
return
request
({
url
:
'
/api/Pri
'
,
method
:
'
PUT
'
,
data
:
data
,
})
},
getPriorityTimetDel
:
function
(
data
){
return
request
({
url
:
'
/api/Pri
'
,
method
:
'
Delete
'
,
data
:
data
,
})
},
},
//华菱植物工厂
plantFactory
:{
//管理员首页:客户总数 终端总数
...
...
@@ -122,7 +267,6 @@ var HttpReq = function(){
},
/** 操作日志 */
reoperationlog
:{
getLog
:
function
(
param
,
query
)
{
...
...
src/views/carManagement/carType/index.vue
View file @
ead6a0f9
<
template
>
<div
class=
"common-page device-manage"
>
<div
class=
"option page-row"
>
<!--工具栏-->
<div
class=
"head-container"
>
<!-- 搜索 -->
<label
class=
"el-form-item-label"
style=
"font-weight: 500;"
>
设备识别码
</label>
<el-input
v-model=
"query.code"
clearable
size=
"small"
placeholder=
"请输入设备识别码"
style=
"width:180px;"
@
clear=
"clearLimit"
/>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"toSearch"
>
搜索
</el-button>
</div>
</div>
<!-- 表格 -->
<div
class=
"panel-bottom page-row"
>
<h3>
设备管理列表
</h3>
<h3>
车辆类型管理
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
...
...
@@ -19,30 +12,15 @@
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"id"
label=
"设备ID"
align=
"center"
></el-table-column>
<el-table-column
prop=
"code"
label=
"设备识别码"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"设备名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmWindspeed"
label=
"风速报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmTemperature"
label=
"温度报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmHumidity"
label=
"湿度报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmCo2"
label=
"二氧化碳报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmMlux"
label=
"光照报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmPh"
label=
"酸碱度报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmWaterTemperature"
label=
"水温报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmElectricalConductance"
label=
"电导率报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"alarmWaterDepth"
label=
"液位报警阈值"
align=
"center"
></el-table-column>
<el-table-column
prop=
"createTime"
label=
"设备激活时间"
align=
"center"
></el-table-column>
<el-table-column
prop=
"addTime"
label=
"最后采集时间"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectId"
label=
"所属项目"
align=
"center"
:formatter=
"formatter"
></el-table-column>
<el-table-column
label=
"操作"
min-width=
"180px"
align=
"center"
fixed=
"right"
>
<el-table-column
prop=
"id"
label=
"序号"
align=
"center"
></el-table-column>
<el-table-column
prop=
"id"
label=
"编码"
align=
"center"
></el-table-column>
<el-table-column
prop=
"id"
label=
"车辆类型名称"
align=
"center"
></el-table-column>
<el-table-column
prop=
"id"
label=
"车辆标识图"
align=
"center"
></el-table-column>
<el-table-column
prop=
"time"
label=
"日期"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-view"
@
click=
"toSeeMore(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"toEdit(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"toDelete(scope.row)"
></el-button>
<!--
<div
class=
"btn-groub2"
>
<el-button
size=
"mini"
type=
"warning"
icon=
"el-icon-set-up"
@
click=
"toInstructionSet(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"info"
icon=
"el-icon-tickets"
@
click=
"toInstructionLog(scope.row)"
></el-button>
</div>
-->
</
template
>
</el-table-column>
</el-table>
...
...
@@ -57,56 +35,16 @@
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"true"
:before-close=
"cancelForm"
:visible.sync=
"form.visible"
:title=
"form.title"
width=
"700px"
>
<el-form
:model=
"form.item"
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"150px"
>
<el-form-item
label=
"选择项目"
prop=
"projectId"
>
<el-select
v-model=
"form.item.projectId"
placeholder=
"请选择项目"
size=
"small"
>
<el-option
v-for=
"(obj,index) in form.selectList"
:label=
"obj.name"
:value=
"obj.id"
:key=
"index"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="设备ID" prop="id">
<el-input v-model="form.item.id" style="width:280px;" placeholder="请输入设备编号" :disabled="form.reqType==='edit'"/>
</el-form-item> -->
<el-form-item
label=
"设备识别码"
prop=
"code"
>
<el-input
v-model=
"form.item.code"
style=
"width:260px;"
placeholder=
"请输入设备识别码"
:disabled=
"form.reqType==='edit'"
/>
</el-form-item>
<el-form-item
label=
"设备名称"
prop=
"name"
>
<el-input
v-model=
"form.item.name"
style=
"width:260px;"
placeholder=
"请输入设备名称"
/>
</el-form-item>
<el-form-item
label=
"风速报警阈值"
prop=
"alarmWindspeed"
>
<el-input
v-model=
"form.item.alarmWindspeed"
style=
"width:160px;"
placeholder=
"请输入风速报警阈值"
/>
</el-form-item>
<el-form-item
label=
"温度报警阈值"
prop=
"alarmTemperature"
>
<el-input
v-model=
"form.item.alarmTemperature"
style=
"width:160px;"
placeholder=
"请输入温度报警阈值"
/>
</el-form-item>
<el-form-item
label=
"湿度报警阈值"
prop=
"alarmHumidity"
>
<el-input
v-model=
"form.item.alarmHumidity"
style=
"width:160px;"
placeholder=
"请输入湿度报警阈值"
/>
<el-form-item
label=
"编码"
>
<el-input
v-model=
"form.item.time"
style=
"width:280px;"
placeholder=
"请输入编码"
/>
</el-form-item>
<el-form-item
label=
"
二氧化碳报警阈值"
prop=
"alarmCo2"
>
<el-input
v-model=
"form.item.
alarmCo2"
style=
"width:160px;"
placeholder=
"请输入二氧化碳报警阈值
"
/>
<el-form-item
label=
"
车辆类型名称"
>
<el-input
v-model=
"form.item.
time"
style=
"width:280px;"
placeholder=
"请输入车辆类型名称
"
/>
</el-form-item>
<el-form-item
label=
"光照报警阈值"
prop=
"alarmMlux"
>
<el-input
v-model=
"form.item.alarmMlux"
style=
"width:160px;"
placeholder=
"请输入光照报警阈值"
/>
</el-form-item>
<el-form-item
label=
"酸碱度报警阈值"
prop=
"alarmPh"
>
<el-input
v-model=
"form.item.alarmPh"
style=
"width:160px;"
placeholder=
"请输入酸碱度报警阈值"
/>
</el-form-item>
<el-form-item
label=
"水温报警阈值"
prop=
"alarmWaterTemperature"
>
<el-input
v-model=
"form.item.alarmWaterTemperature"
style=
"width:160px;"
placeholder=
"请输入水温报警阈值"
/>
</el-form-item>
<el-form-item
label=
"电导率报警阈值"
prop=
"alarmElectricalConductance"
>
<el-input
v-model=
"form.item.alarmElectricalConductance"
style=
"width:160px;"
placeholder=
"请输入电导率报警阈值"
/>
</el-form-item>
<el-form-item
label=
"液位报警阈值"
prop=
"alarmWaterDepth"
>
<el-input
v-model=
"form.item.alarmWaterDepth"
style=
"width:160px;"
placeholder=
"请输入液位报警阈值"
/>
</el-form-item>
<el-form-item
label=
"上传设备位置"
prop=
"position"
>
<!-- <el-form-item label="车辆标识图" prop="position">
<el-input v-model="picFileName" style="width:160px;" placeholder="请上传设备位置" disabled />
<input type="file" name="image" @change="excelImport($event)" />
</el-form-item>
<div
style=
"margin:0px 0px 10px 55px;font-size:16px;font-weight:bold;"
>
摄像头参数配置
</div>
<el-form-item
label=
"摄像头ID"
prop=
"camera"
>
<el-input
v-model=
"form.item.camera"
style=
"width:160px;"
placeholder=
"请输入摄像头ID"
/>
</el-form-item>
</el-form-item> -->
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm"
>
取消
</el-button>
...
...
@@ -114,119 +52,16 @@
</div>
</el-dialog>
<!-- 查看更多 -->
<el-dialog
title=
"查看设备"
:visible.sync=
"form.seeMoreDialog"
width=
"800px"
>
<el-form
:model=
"seeMoreData"
style=
"margin-top:20px;"
>
<el-form-item
label=
"摄像头位置图片"
label-width=
"150px"
>
<el-image
:src=
"seeMoreImgUrl"
style=
"width:300px;"
></el-image>
</el-form-item>
<el-form-item
label=
"摄像头图像"
label-width=
"150px"
>
<div
id=
"video-container"
style=
"width:550px;height:350px"
></div>
</el-form-item>
<el-form-item
label=
"摄像头ID"
label-width=
"150px"
>
<el-input
v-model=
"seeMoreData.camera"
style=
"width:200px"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"form.seeMoreDialog = false"
>
关闭
</el-button>
</div>
</el-dialog>
<!-- 历史图表 -->
<el-dialog
class=
"ecahrt1-dialog"
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelForm2"
:visible.sync=
"form.historyDialog"
>
<el-form
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"80px"
>
<!-- <el-form-item prop="eprogramid" >
<el-select v-model="form.item2.value" placeholder="请选择月份">
<el-option v-for="obj in form.monthSelectList" :label="obj.name" :value="obj.value"></el-option>
</el-select>
</el-form-item> -->
<el-form-item
prop=
"eprogramid"
>
<date-range-picker
v-model=
"query.timeSpace"
class=
"date-item"
/>
</el-form-item>
<el-form-item
>
<el-button
type=
"primary"
@
click=
"findHistory"
>
查询
</el-button>
</el-form-item>
<el-form-item
prop=
"content"
style=
"display:block;"
>
<div
class=
"form-body"
>
<div
id=
"ecahrtA"
></div>
</div>
</el-form-item>
</el-form>
</el-dialog>
<!-- 指令下发 -->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelForm3"
:visible.sync=
"form2.visible"
:title=
"form2.title"
width=
"600px"
>
<el-form
:model=
"form2.item"
:rules=
"rules"
ref=
"form2"
:inline=
"true"
size=
"small"
label-width=
"100px"
>
<el-form-item
label=
"设备ID"
prop=
"ecode"
>
<el-input
v-model=
"form2.item.ecode"
style=
"width:280px;"
placeholder=
"请输入设备编号"
:disabled=
"form2.reqType==='edit'"
/>
</el-form-item>
<el-form-item
label=
"设备识别码"
prop=
"subcode"
>
<el-input
v-model=
"form2.item.subcode"
style=
"width:260px;"
placeholder=
"请输入设备识别码"
:disabled=
"form2.reqType==='edit'"
/>
</el-form-item>
<el-form-item
label=
"是否启动校正"
prop=
"ilAdjust"
style=
"width:240px;"
>
<el-select
v-model=
"form2.item.ilAdjust"
placeholder=
"请选择"
size=
"small"
style=
"width:120px;"
>
<el-option
v-for=
"obj in form2.adjustList"
:label=
"obj.name"
:key=
"obj.value"
:value=
"obj.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"是否存储裂缝"
prop=
"ilSave"
style=
"width:240px;"
>
<el-select
v-model=
"form2.item.ilSave"
placeholder=
"请选择"
size=
"small"
style=
"width:120px;"
>
<el-option
v-for=
"(obj,index) in form2.saveList"
:label=
"obj.name"
:value=
"obj.value"
:key=
"index"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"裂缝阈值"
prop=
"ilThreshed"
>
<el-input
v-model=
"form2.item.ilThreshed"
style=
"width:160px;"
placeholder=
"请输入裂缝阈值"
/>
<span
style=
"color:#aaa;"
>
1~255
</span>
</el-form-item>
<el-form-item
label=
"唤醒周期"
prop=
"timekey"
>
<el-select
v-model=
"form2.item.timekey"
placeholder=
"请选择时间"
size=
"small"
style=
"width:120px;"
>
<el-option
v-for=
"(obj,index) in form2.timeList"
:label=
"obj.name"
:value=
"obj.value"
:key=
"index"
></el-option>
</el-select>
<el-input
v-model=
"form2.item.time"
style=
"width:160px;"
placeholder=
"请输入时长"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm3"
>
取消
</el-button>
<el-button
:loading=
"form2.status.cu === 2"
type=
"primary"
@
click=
"reqSetInstruction('form2', form2.item)"
>
确认
</el-button>
</div>
</el-dialog>
<!-- 指令日志 -->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelForm4"
:visible.sync=
"form2.logVisible"
:title=
"form2.title"
width=
"65%"
>
<div
class=
"content"
>
<el-table
:data=
"form2.formData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"subcode"
label=
"设备识别码"
min-width=
"135px"
></el-table-column>
<el-table-column
prop=
"ilThreshed"
label=
"裂缝阈值"
></el-table-column>
<el-table-column
prop=
"ilAdjust"
label=
"校正功能"
></el-table-column>
<el-table-column
prop=
"ilSave"
label=
"存储裂缝"
></el-table-column>
<el-table-column
prop=
"ilSendTime"
label=
"唤醒时间"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
time
+
'
(
'
+
scope
.
row
.
timeUnit
+
'
)
'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"ilSendSuccess"
label=
"下发状态"
></el-table-column>
<el-table-column
prop=
"ilSendTime"
label=
"下发时间"
min-width=
"145px"
></el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"form2.total"
:current-page=
"form2.page"
style=
"margin-top:8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange2"
@
current-change=
"pageChange2"
/>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
echarts
from
'
echarts
'
;
import
{
Tools
,
HttpReq
,
Dates
}
from
'
@/assets/js/common.js
'
;
import
DateRangePicker
from
'
@/components/DateRangePicker
'
;
import
cuAmap
from
'
@/components/AMap
'
;
import
Axios
from
'
axios
'
import
EZUIKit
from
"
ezuikit-js
"
;
export
default
{
name
:
'
carType
'
,
components
:
{
DateRangePicker
,
cuAmap
},
name
:
'
CarType
'
,
components
:
{},
data
()
{
return
{
loading
:
false
,
...
...
@@ -234,78 +69,21 @@ export default {
size
:
10
,
total
:
0
,
query
:{},
alarmTimeId
:
''
,
picFileName
:
''
,
tableData
:
[],
seeMoreData
:{},
seeMoreImgUrl
:
""
,
form
:
{
title
:
'
添加设备
'
,
visible
:
false
,
reqType
:
'
add
'
,
historyDialog
:
false
,
seeMoreDialog
:
false
,
status
:{
cu
:
0
},
selectList
:[],
item
:{},
monthSelectList
:[
{
name
:
'
一月
'
,
value
:
'
01
'
},
{
name
:
'
二月
'
,
value
:
'
02
'
},
{
name
:
'
三月
'
,
value
:
'
03
'
},
{
name
:
'
四月
'
,
value
:
'
04
'
},
{
name
:
'
五月
'
,
value
:
'
05
'
},
{
name
:
'
六月
'
,
value
:
'
06
'
},
{
name
:
'
七月
'
,
value
:
'
07
'
},
{
name
:
'
八月
'
,
value
:
'
08
'
},
{
name
:
'
九月
'
,
value
:
'
09
'
},
{
name
:
'
十月
'
,
value
:
'
10
'
},
{
name
:
'
十一月
'
,
value
:
'
11
'
},
{
name
:
'
十二月
'
,
value
:
'
12
'
},
],
item2
:{
value
:
''
},
title
:
'
新增车辆类型
'
,
visible
:
false
,
reqType
:
'
add
'
,
status
:{
cu
:
0
},
item
:{},
},
rules
:
{
projectId
:
[
{
required
:
true
,
message
:
'
请选择项目
'
,
trigger
:
'
blur
'
}
],
id
:
[
{
required
:
true
,
message
:
'
请输入设备ID
'
,
trigger
:
'
blur
'
}
],
code
:
[
{
required
:
true
,
message
:
'
请输入设备识别码
'
,
trigger
:
'
blur
'
}
],
name
:
[
{
required
:
true
,
message
:
'
请输入设备名称
'
,
trigger
:
'
blur
'
}
time
:
[
{
required
:
true
,
message
:
'
请输入车辆类型
'
,
trigger
:
'
blur
'
}
],
},
form2
:{
title
:
'
指令下发
'
,
visible
:
false
,
logDialog
:
false
,
logVisible
:
false
,
query
:{},
page
:
1
,
size
:
10
,
total
:
0
,
status
:{
cu
:
0
},
item
:{
ecode
:
""
,
ename
:
''
,
ilAdjust
:
0
,
ilSave
:
0
,
time
:
''
,
ilThreshed
:
0
,
timekey
:
'
ilTimHour
'
,
},
adjustList
:[
{
name
:
'
启动
'
,
value
:
1
},
{
name
:
'
不启动
'
,
value
:
0
},
],
saveList
:[
{
name
:
'
存储
'
,
value
:
1
},
{
name
:
'
不存储
'
,
value
:
0
},
],
timeList
:[
{
name
:
'
时
'
,
value
:
'
ilTimHour
'
},
{
name
:
'
分
'
,
value
:
'
ilTimMins
'
},
{
name
:
'
秒
'
,
value
:
'
ilTimSec
'
},
],
formData
:[],
},
}
},
mounted
()
{
...
...
@@ -316,24 +94,19 @@ export default {
},
methods
:
{
loadData
()
{
var
that
=
this
;
var
sort
=
'
addTime,desc
'
;
var
sort
=
'
id,desc
'
;
var
param
=
this
.
query
;
param
.
page
=
this
.
page
-
1
;
param
.
size
=
this
.
size
;
param
.
sort
=
sort
;
//请求项目列表
this
.
reqProjectsSimple
().
then
((
list
)
=>
{
this
.
form
.
selectList
=
list
;
});
this
.
$nextTick
(()
=>
{
HttpReq
.
plantFactory
.
getDeviceManageList
(
param
).
then
((
res
)
=>
{
//console.log(res);
this
.
loading
=
false
;
this
.
tableData
=
res
.
content
;
this
.
total
=
res
.
totalElements
;
HttpReq
.
truckDispatching
.
alarmTimeQuery
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
content
;
this
.
total
=
res
.
data
.
totalElements
;
}
})
})
...
...
@@ -345,48 +118,30 @@ export default {
return
'
success-row
'
;
}
return
''
;
},
// 点击搜索
toSearch
()
{
this
.
page
=
1
this
.
loadData
()
},
clearLimit
(){
// 清除限制
this
.
loadData
()
},
},
cancelForm
(
a
,
b
,
c
){
this
.
form
.
visible
=
false
;
},
cancelForm2
(){
this
.
form
.
historyDialog
=
false
;
},
toAdd
()
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
添加设备
'
;
this
.
form
.
title
=
'
新增车辆类型
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
reqType
=
'
add
'
;
this
.
form
.
item
=
{};
this
.
picFileName
=
''
;
//请求项目列表
this
.
reqProjectsSimple
().
then
((
list
)
=>
{
this
.
form
.
selectList
=
list
});
},
toEdit
(
item
)
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
编辑设备
'
;
this
.
form
.
title
=
'
修改车辆类型
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
item
=
item
;
this
.
form
.
item
=
{...
item
}
;
this
.
form
.
reqType
=
'
edit
'
;
this
.
picFileName
=
this
.
form
.
item
.
position
;
//请求项目列表
this
.
reqProjectsSimple
().
then
((
list
)
=>
{
this
.
form
.
selectList
=
list
});
this
.
alarmTimeId
=
this
.
form
.
item
.
id
;
//this.picFileName = this.form.item.position;
},
toDelete
(
item
)
{
var
id
=
item
.
id
;
...
...
@@ -396,103 +151,7 @@ export default {
type
:
'
warning
'
}).
then
((
e
)
=>
{
this
.
reqRemoveProject
([
id
])
}).
catch
((
e
)
=>
{
})
},
//查看图片以及其他信息
toSeeMore
(
row
){
//console.log(row);
this
.
seeMoreData
=
row
;
this
.
seeMoreImgUrl
=
process
.
env
.
VUE_APP_LOCAL_API2
+
"
/avatar/
"
+
row
.
position
;
this
.
form
.
seeMoreDialog
=
true
;
this
.
$nextTick
(()
=>
{
let
videoContainer
=
document
.
querySelector
(
'
#video-container
'
);
videoContainer
.
innerHTML
=
''
;
var
player
=
new
EZUIKit
.
EZUIKitPlayer
({
autoplay
:
true
,
id
:
'
video-container
'
,
accessToken
:
'
at.4qo66bb35a19h07a0d9pbmtj5v4g0o78-4jmzdu3k24-0866je6-qkz1xuwmf
'
,
url
:
'
ezopen://open.ys7.com/J16440511/1.live
'
,
template
:
"
simple
"
,
// simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版;
width
:
530
,
height
:
320
});
})
},
toHistoryLog
(
item
){
this
.
form
.
historyDialog
=
true
;
this
.
form
.
item2
.
value
=
Dates
.
format
(
'
MM
'
);
this
.
form
.
item2
.
code
=
item
.
ecode
;
this
.
$nextTick
(()
=>
{
var
ecahrtEl
=
document
.
getElementById
(
"
ecahrtA
"
);
this
.
ecahrtA
=
this
.
ecahrtA
||
this
.
createPanelEcharts
(
ecahrtEl
);
this
.
reqHistoryList
(
this
.
form
.
item2
);
});
},
cancelForm3
(
a
,
b
,
c
){
this
.
form2
.
visible
=
false
;
},
cancelForm4
(
a
,
b
,
c
){
this
.
form2
.
logVisible
=
false
;
},
// 指令下发
toInstructionSet
(
item
){
var
form2
=
this
.
form2
;
// 请除表单验证
//this.$refs['form1'] && this.$refs['form1'].clearValidate();
form2
.
title
=
'
指令下发
'
;
form2
.
status
.
cu
=
0
;
form2
.
visible
=
true
;
form2
.
reqType
=
'
edit
'
;
form2
.
item
=
{
ecode
:
item
.
ecode
,
subcode
:
item
.
subcode
,
ilAdjust
:
form2
.
item
.
ilAdjust
,
ilSave
:
form2
.
item
.
ilSave
,
timekey
:
form2
.
item
.
timekey
,
time
:
''
,
};
},
// 指令日志
toInstructionLog
(
item
){
var
form2
=
this
.
form2
;
// 请除表单验证
//this.$refs['form1'] && this.$refs['form1'].clearValidate();
form2
.
title
=
'
下发日志
'
;
form2
.
logVisible
=
true
;
form2
.
item
=
item
;
var
param
=
form2
.
query
;
param
.
page
=
form2
.
page
-
1
;
param
.
size
=
form2
.
size
;
param
.
sort
=
'
addTime,desc
'
;
param
.
deviceId
=
item
.
ecode
;
HttpReq
.
equipment
.
getInstructionLog
(
param
).
then
((
res
)
=>
{
if
(
res
){
form2
.
total
=
res
.
totalElements
;
var
formData
=
res
.
content
||
[],
timeKeys
=
{
'
ilTimHour
'
:
'
小时
'
,
'
ilTimMins
'
:
'
分钟
'
,
'
ilTimSec
'
:
'
秒
'
};
for
(
var
fitem
of
formData
){
fitem
.
subcode
=
item
.
subcode
;
for
(
var
key
in
timeKeys
){
if
(
fitem
[
key
]
||
fitem
[
key
]
===
0
){
fitem
[
'
time
'
]
=
fitem
[
key
];
fitem
.
timeUnit
=
timeKeys
[
key
];
}
else
{
delete
fitem
[
key
]
}
};
fitem
.
ilAdjust
=
[
'
不启动
'
,
'
启动
'
][
fitem
.
ilAdjust
||
0
];
fitem
.
ilSave
=
[
'
不存储
'
,
'
存储
'
][
fitem
.
ilSave
||
0
];
fitem
.
ilSendSuccess
=
[
'
下发失败
'
,
'
下发成功
'
][
fitem
.
ilSendSuccess
||
0
];
};
form2
.
formData
=
formData
;
};
}).
catch
(
function
(
error
)
{
console
.
log
(
'
error ________________
'
,
error
);
});
}).
catch
((
e
)
=>
{})
},
pageChange
(
e
)
{
this
.
page
=
e
...
...
@@ -503,15 +162,6 @@ export default {
this
.
size
=
e
this
.
loadData
()
},
pageChange2
(
e
)
{
this
.
form2
.
page
=
e
this
.
reqInstructionLog
(
this
.
form2
.
item
)
},
sizeChange2
(
e
)
{
this
.
form2
.
page
=
1
;
this
.
form2
.
size
=
e
;
this
.
reqInstructionLog
(
this
.
form2
.
item
);
},
submitForm
(
validateName
,
item
){
if
(
!
this
.
form
.
status
.
cu
){
this
.
form
.
status
.
cu
=
2
;
...
...
@@ -528,36 +178,22 @@ export default {
});
};
},
findHistory
(){
this
.
reqHistoryList
(
this
.
form
.
item2
);
},
//请求项目列表
reqProjectsSimple
(){
return
HttpReq
.
project
.
getProject
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
return
res
.
data
.
content
;
}
else
{
return
[]
}
})
},
//添加设备
//新增车辆类型
reqAddItem
(
form
,
item
){
let
lastData
=
item
;
lastData
.
position
=
this
.
picFileName
;
HttpReq
.
plantFactory
.
addDeviceManageList
(
lastData
).
then
((
res
)
=>
{
let
lastData
=
{...
item
}
;
//
lastData.position = this.picFileName;
HttpReq
.
truckDispatching
.
alarmTimeAdd
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
==
1
){
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
项目添加
成功!
'
,
title
:
'
车辆类型新增
成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
head
.
message
,
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
...
...
@@ -566,36 +202,37 @@ export default {
form
.
status
.
cu
=
0
});
},
//修改
设备
//修改
车辆类型
reqUpdateItem
(
form
,
item
){
let
lastData
=
item
;
lastData
.
position
=
this
.
picFileName
;
HttpReq
.
plantFactory
.
upDateDeviceManageList
(
lastData
).
then
((
res
)
=>
{
let
lastData
=
{...
item
};
lastData
.
id
=
this
.
alarmTimeId
;
//lastData.position = this.picFileName;
HttpReq
.
truckDispatching
.
alarmTimeUpdate
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
head
.
message
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
修改成功!
'
,
title
:
'
车辆类型
修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//删除
设备
//删除
车辆类型
reqRemoveProject
(
item
){
HttpReq
.
plantFactory
.
removeDeviceManageList
(
item
).
then
((
res
)
=>
{
HttpReq
.
truckDispatching
.
alarmTimetDel
(
item
).
then
((
res
)
=>
{
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
head
.
message
,
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
...
...
@@ -609,195 +246,6 @@ export default {
this
.
loadData
();
})
},
reqHistoryList
(
item
){
var
timeSpace
=
this
.
query
.
timeSpace
;
var
startTime
=
timeSpace
?
timeSpace
[
0
].
split
(
'
'
)[
0
]
:
''
;
var
endTime
=
timeSpace
?
timeSpace
[
1
].
split
(
'
'
)[
0
]
:
''
;
HttpReq
.
historys
.
getItemBycode
({
codes
:
item
.
code
,
startTime
:
startTime
,
endTime
:
endTime
}).
then
((
res
)
=>
{
if
(
res
.
head
.
code
===
'
0000
'
){
var
body
=
res
.
body
||
{};
var
list
=
body
.
list
||
[];
var
xAxisData
=
[];
var
helement
=
[];
var
htemperature
=
[];
var
hlenght1
=
[],
hlenght2
=
[],
hlenght3
=
[];
for
(
var
item
of
list
){
xAxisData
.
push
(
item
.
createTime
);
helement
.
push
(
item
.
helement
);
htemperature
.
push
(
item
.
htemperature
);
hlenght1
.
push
(
item
.
hlenght1
);
hlenght2
.
push
(
item
.
hlenght2
);
hlenght3
.
push
(
item
.
hlenght3
);
};
this
.
ecahrtA
.
setData
({
xAxis
:
[
{
type
:
'
category
'
,
data
:
xAxisData
,
},
],
series
:
[
{
name
:
'
电压
'
,
data
:
helement
,
},
{
name
:
'
温度
'
,
data
:
htemperature
,
},
{
name
:
'
裂缝1
'
,
data
:
hlenght1
,
},
{
name
:
'
裂缝2
'
,
data
:
hlenght2
,
},
{
name
:
'
裂缝3
'
,
data
:
hlenght3
,
}
]
})
};
}).
catch
(
function
(
error
)
{
console
.
log
(
'
catch __
'
,
error
);
})
},
createPanelEcharts
(
el
){
var
myChart
=
echarts
.
init
(
el
),
lineColor
=
'
green
'
;
var
option
=
{
title
:
{
text
:
''
,
subtext
:
'
设备值
'
},
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
data
:
[
'
电压
'
,
'
温度
'
,
'
裂缝1
'
,
'
裂缝2
'
,
'
裂缝3
'
],
textStyle
:
{
color
:
"
#000
"
},
},
textStyle
:
{
color
:
"
#333
"
},
calculable
:
true
,
xAxis
:
[
{
type
:
'
category
'
,
data
:
[],
}
],
yAxis
:
[
{
type
:
'
value
'
,
}
],
grid
:{
top
:
40
,
right
:
10
,
bottom
:
20
,
left
:
45
,
},
series
:
[
{
name
:
'
电压
'
,
type
:
'
line
'
,
data
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
//itemStyle: {normal: {areaStyle: {type: 'default', color:'#00e5ff'}, color:'#00e5ff'}, color:'green'},
},
{
name
:
'
温度
'
,
type
:
'
line
'
,
data
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
},
{
name
:
'
裂缝1
'
,
type
:
'
line
'
,
data
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
//itemStyle: {normal: {areaStyle: {type:'default', color:'red'}, color:'#1849fe'}, color:'red'},
},
{
name
:
'
裂缝2
'
,
type
:
'
line
'
,
data
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
},
{
name
:
'
裂缝3
'
,
type
:
'
line
'
,
data
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
}
]
};
myChart
.
setOption
(
option
);
var
setData
=
function
(
option
){
myChart
.
hideLoading
();
myChart
.
setOption
(
option
)
};
return
{
setData
:
setData
,
myChart
:
myChart
}
},
reqSetInstruction
(
form
,
item
){
var
param
=
{
deviceId
:
item
.
ecode
,
ilAdjust
:
item
.
ilAdjust
,
ilSave
:
item
.
ilSave
,
ilThreshed
:
item
.
ilThreshed
||
0
,
[
item
.
timekey
]:
item
.
time
||
0
,
};
HttpReq
.
equipment
.
setInstruction
(
param
).
then
((
res
)
=>
{
this
.
form2
.
visible
=
false
;
this
.
$notify
({
title
:
'
修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}).
catch
(
function
(
error
)
{
this
.
form2
.
status
.
cu
=
0
;
this
.
$notify
({
title
:
error
,
type
:
'
error
'
,
duration
:
2500
})
});
},
reqInstructionLog
(
item
){
var
form2
=
this
.
form2
;
var
param
=
form2
.
query
;
param
.
page
=
form2
.
page
-
1
;
param
.
size
=
form2
.
size
;
param
.
sort
=
'
addTime,desc
'
;
param
.
deviceId
=
item
.
ecode
;
HttpReq
.
equipment
.
getInstructionLog
(
param
).
then
((
res
)
=>
{
if
(
res
){
form2
.
total
=
res
.
totalElements
;
var
formData
=
res
.
content
||
[],
timeKeys
=
{
'
ilTimHour
'
:
'
小时
'
,
'
ilTimMins
'
:
'
分钟
'
,
'
ilTimSec
'
:
'
秒
'
};
for
(
var
fitem
of
formData
){
fitem
.
subcode
=
item
.
subcode
;
for
(
var
key
in
timeKeys
){
if
(
fitem
[
key
]){
fitem
[
'
time
'
]
=
fitem
[
key
];
fitem
.
timeUnit
=
timeKeys
[
key
];
}
else
{
delete
fitem
[
key
]
}
};
fitem
.
ilAdjust
=
[
'
不启动
'
,
'
启动
'
][
fitem
.
ilAdjust
||
0
];
fitem
.
ilSave
=
[
'
不存储
'
,
'
存储
'
][
fitem
.
ilSave
||
0
];
fitem
.
ilSendSuccess
=
[
'
下发失败
'
,
'
下发成功
'
][
fitem
.
ilSendSuccess
||
0
];
};
form2
.
formData
=
formData
;
};
}).
catch
(
function
(
error
)
{
console
.
log
(
'
error ________________
'
,
error
);
});
},
//图片上传
excelImport
(
event
)
{
let
that
=
this
;
...
...
@@ -822,16 +270,6 @@ export default {
console
.
log
(
error
);
});
},
//项目名称展示
formatter
(
row
){
let
proName
=
""
;
this
.
form
.
selectList
.
forEach
(
function
(
item
){
if
(
row
.
projectId
==
item
.
id
){
proName
=
item
.
name
;
}
})
return
proName
}
}
}
</
script
>
...
...
src/views/productionPlanManagement/productionPlan/index.vue
View file @
ead6a0f9
<
template
>
<div
class=
"common-page device-manage"
>
<
div
class=
"option page-row"
>
<
!--
<div
class=
"option page-row"
>
--
>
<!--工具栏-->
<
div
class=
"head-container"
>
<
!--
<div
class=
"head-container"
>
--
>
<!-- 搜索 -->
<label
class=
"el-form-item-label"
style=
"font-weight: 500;"
>
设备识别码
</label>
<
!--
<
label
class=
"el-form-item-label"
style=
"font-weight: 500;"
>
设备识别码
</label>
<el-input
v-model=
"query.code"
clearable
size=
"small"
placeholder=
"请输入设备识别码"
style=
"width:180px;"
@
clear=
"clearLimit"
/>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"toSearch"
>
搜索
</el-button>
</div>
</div>
</div>
-->
<div
class=
"panel-bottom page-row"
>
<h3>
设备管理列表
</h3>
<h3>
生产计划设置
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
...
...
src/views/system/dataDictionary/alarmHowTime/index.vue
0 → 100644
View file @
ead6a0f9
<
template
>
<div
class=
"common-page device-manage"
>
<!-- 表格 -->
<div
class=
"panel-bottom page-row"
>
<h3>
报警时长设置
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
<div
class=
"toolbar"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"toAdd"
>
新增
</el-button>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"id"
label=
"序号"
align=
"center"
></el-table-column>
<el-table-column
prop=
"time"
label=
"时长(分钟)"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"toEdit(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"toDelete(scope.row)"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
</div>
</div>
</div>
</div>
</div>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"true"
:before-close=
"cancelForm"
:visible.sync=
"form.visible"
:title=
"form.title"
width=
"700px"
>
<el-form
:model=
"form.item"
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"150px"
>
<el-form-item
label=
"时长(分钟)"
prop=
"time"
>
<el-input
v-model=
"form.item.time"
style=
"width:280px;"
placeholder=
"请输入时长(分钟)"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm"
>
取消
</el-button>
<el-button
:loading=
"form.status.cu === 2"
type=
"primary"
@
click=
"submitForm('form1', form.item)"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
Tools
,
HttpReq
,
Dates
}
from
'
@/assets/js/common.js
'
;
export
default
{
name
:
'
AlarmHowTime
'
,
components
:
{},
data
()
{
return
{
loading
:
false
,
page
:
1
,
size
:
10
,
total
:
0
,
query
:{},
alarmTimeId
:
''
,
tableData
:
[],
form
:
{
title
:
'
新增报警时长
'
,
visible
:
false
,
reqType
:
'
add
'
,
status
:{
cu
:
0
},
item
:{},
},
rules
:
{
time
:
[
{
required
:
true
,
message
:
'
请输入报警时长
'
,
trigger
:
'
blur
'
}
],
},
}
},
mounted
()
{
var
that
=
this
;
this
.
$nextTick
(()
=>
{
this
.
loadData
();
})
},
methods
:
{
loadData
()
{
var
sort
=
'
id,desc
'
;
var
param
=
this
.
query
;
param
.
page
=
this
.
page
-
1
;
param
.
size
=
this
.
size
;
param
.
sort
=
sort
;
this
.
$nextTick
(()
=>
{
HttpReq
.
truckDispatching
.
alarmTimeQuery
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
content
;
this
.
total
=
res
.
data
.
totalElements
;
}
})
})
},
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
===
1
)
{
return
'
warning-row
'
;
}
else
if
(
rowIndex
===
3
)
{
return
'
success-row
'
;
}
return
''
;
},
cancelForm
(
a
,
b
,
c
){
this
.
form
.
visible
=
false
;
},
toAdd
()
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
新增报警时长
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
reqType
=
'
add
'
;
this
.
form
.
item
=
{};
},
toEdit
(
item
)
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
修改报警时长
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
item
=
{...
item
};
this
.
form
.
reqType
=
'
edit
'
;
this
.
alarmTimeId
=
this
.
form
.
item
.
id
;
},
toDelete
(
item
)
{
var
id
=
item
.
id
;
this
.
$confirm
(
'
确认删除该条数据吗?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
((
e
)
=>
{
this
.
reqRemoveProject
([
id
])
}).
catch
((
e
)
=>
{})
},
pageChange
(
e
)
{
this
.
page
=
e
this
.
loadData
()
},
sizeChange
(
e
)
{
this
.
page
=
1
this
.
size
=
e
this
.
loadData
()
},
submitForm
(
validateName
,
item
){
if
(
!
this
.
form
.
status
.
cu
){
this
.
form
.
status
.
cu
=
2
;
this
.
$refs
[
validateName
].
validate
(
valid
=>
{
if
(
valid
){
if
(
this
.
form
.
reqType
===
'
add
'
){
this
.
reqAddItem
(
this
.
form
,
item
)
}
else
{
this
.
reqUpdateItem
(
this
.
form
,
item
)
}
}
else
{
this
.
form
.
status
.
cu
=
0
}
});
};
},
//新增报警时长
reqAddItem
(
form
,
item
){
let
lastData
=
{...
item
};
HttpReq
.
truckDispatching
.
alarmTimeAdd
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
报警时长新增成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//修改报警时长
reqUpdateItem
(
form
,
item
){
let
lastData
=
{...
item
};
lastData
.
id
=
this
.
alarmTimeId
;
HttpReq
.
truckDispatching
.
alarmTimeUpdate
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
报警时长修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//删除报警时长
reqRemoveProject
(
item
){
HttpReq
.
truckDispatching
.
alarmTimetDel
(
item
).
then
((
res
)
=>
{
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
this
.
$notify
({
title
:
'
删除成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
}
this
.
loadData
();
})
},
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scope
>
.el-table
.warning-row
{
background
:
oldlace
;
}
.el-table
.success-row
{
background
:
#f0f9eb
;
}
.device-manage
{
.panel-bottom
{
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
14px
;}
.btn-groub2
{
display
:inline-block
;
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
15px
;}
.el-button--warning
{
background-color
:
#e6a23c
;
border-color
:
#e6a23c
;
}
.el-button--warning
:focus
,
.el-button--warning
:hover
{
background
:
#ebb563
;
border-color
:
#ebb563
;}
}
}
}
.ecahrt1-dialog
{
display
:flex
;
align-items
:center
;
.el-dialog
{
margin-top
:inherit
!
important
;
display
:table
!
important
;
width
:fit-content
;
.el-form-item
{
margin-right
:
0
;}
}
.el-dialog__header
{
height
:
0
;
padding
:
0
;
display
:block
;}
.form-body
{
border
:
1px
solid
#999
;
width
:
800px
;
height
:
500px
;
position
:relative
;
>
div
{
position
:absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;}
}
}
</
style
>
src/views/system/dataDictionary/fatigueDriving/index.vue
0 → 100644
View file @
ead6a0f9
<
template
>
<div
class=
"common-page device-manage"
>
<!-- 表格 -->
<div
class=
"panel-bottom page-row"
>
<h3>
疲劳驾驶时长设置
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
<div
class=
"toolbar"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"toAdd"
>
新增
</el-button>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"id"
label=
"序号"
align=
"center"
></el-table-column>
<el-table-column
prop=
"fdritime"
label=
"时长(小时)"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"toEdit(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"toDelete(scope.row)"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
</div>
</div>
</div>
</div>
</div>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"true"
:before-close=
"cancelForm"
:visible.sync=
"form.visible"
:title=
"form.title"
width=
"700px"
>
<el-form
:model=
"form.item"
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"150px"
>
<el-form-item
label=
"时长(小时)"
prop=
"fdritime"
>
<el-input
v-model=
"form.item.fdritime"
style=
"width:280px;"
placeholder=
"请输入时长(小时)"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm"
>
取消
</el-button>
<el-button
:loading=
"form.status.cu === 2"
type=
"primary"
@
click=
"submitForm('form1', form.item)"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
Tools
,
HttpReq
,
Dates
}
from
'
@/assets/js/common.js
'
;
export
default
{
name
:
'
FatigueDriving
'
,
components
:
{},
data
()
{
return
{
loading
:
false
,
page
:
1
,
size
:
10
,
total
:
0
,
query
:{},
alarmTimeId
:
''
,
tableData
:
[],
form
:
{
title
:
'
新增疲劳驾驶时长
'
,
visible
:
false
,
reqType
:
'
add
'
,
status
:{
cu
:
0
},
item
:{},
},
rules
:
{
fdritime
:
[
{
required
:
true
,
message
:
'
请输入疲劳驾驶时长
'
,
trigger
:
'
blur
'
}
],
},
}
},
mounted
()
{
var
that
=
this
;
this
.
$nextTick
(()
=>
{
this
.
loadData
();
})
},
methods
:
{
loadData
()
{
var
sort
=
'
id,desc
'
;
var
param
=
this
.
query
;
param
.
page
=
this
.
page
-
1
;
param
.
size
=
this
.
size
;
param
.
sort
=
sort
;
this
.
$nextTick
(()
=>
{
HttpReq
.
truckDispatching
.
fdriTimeQuery
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
content
;
this
.
total
=
res
.
data
.
totalElements
;
}
})
})
},
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
===
1
)
{
return
'
warning-row
'
;
}
else
if
(
rowIndex
===
3
)
{
return
'
success-row
'
;
}
return
''
;
},
cancelForm
(
a
,
b
,
c
){
this
.
form
.
visible
=
false
;
},
toAdd
()
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
新增疲劳驾驶时长
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
reqType
=
'
add
'
;
this
.
form
.
item
=
{};
},
toEdit
(
item
)
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
修改疲劳驾驶时长
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
item
=
{...
item
};
this
.
form
.
reqType
=
'
edit
'
;
this
.
alarmTimeId
=
this
.
form
.
item
.
id
;
},
toDelete
(
item
)
{
var
id
=
item
.
id
;
this
.
$confirm
(
'
确认删除该条数据吗?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
((
e
)
=>
{
this
.
reqRemoveProject
([
id
])
}).
catch
((
e
)
=>
{})
},
pageChange
(
e
)
{
this
.
page
=
e
this
.
loadData
()
},
sizeChange
(
e
)
{
this
.
page
=
1
this
.
size
=
e
this
.
loadData
()
},
submitForm
(
validateName
,
item
){
if
(
!
this
.
form
.
status
.
cu
){
this
.
form
.
status
.
cu
=
2
;
this
.
$refs
[
validateName
].
validate
(
valid
=>
{
if
(
valid
){
if
(
this
.
form
.
reqType
===
'
add
'
){
this
.
reqAddItem
(
this
.
form
,
item
)
}
else
{
this
.
reqUpdateItem
(
this
.
form
,
item
)
}
}
else
{
this
.
form
.
status
.
cu
=
0
}
});
};
},
//新增疲劳驾驶时长
reqAddItem
(
form
,
item
){
let
lastData
=
{...
item
};
HttpReq
.
truckDispatching
.
fdriTimeAdd
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
疲劳驾驶时长新增成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//修改疲劳驾驶时长
reqUpdateItem
(
form
,
item
){
let
lastData
=
{...
item
};
lastData
.
id
=
this
.
alarmTimeId
;
HttpReq
.
truckDispatching
.
fdriTimeUpdate
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
疲劳驾驶时长修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//删除疲劳驾驶时长
reqRemoveProject
(
item
){
HttpReq
.
truckDispatching
.
fdriTimetDel
(
item
).
then
((
res
)
=>
{
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
this
.
$notify
({
title
:
'
删除成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
}
this
.
loadData
();
})
},
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scope
>
.el-table
.warning-row
{
background
:
oldlace
;
}
.el-table
.success-row
{
background
:
#f0f9eb
;
}
.device-manage
{
.panel-bottom
{
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
14px
;}
.btn-groub2
{
display
:inline-block
;
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
15px
;}
.el-button--warning
{
background-color
:
#e6a23c
;
border-color
:
#e6a23c
;
}
.el-button--warning
:focus
,
.el-button--warning
:hover
{
background
:
#ebb563
;
border-color
:
#ebb563
;}
}
}
}
.ecahrt1-dialog
{
display
:flex
;
align-items
:center
;
.el-dialog
{
margin-top
:inherit
!
important
;
display
:table
!
important
;
width
:fit-content
;
.el-form-item
{
margin-right
:
0
;}
}
.el-dialog__header
{
height
:
0
;
padding
:
0
;
display
:block
;}
.form-body
{
border
:
1px
solid
#999
;
width
:
800px
;
height
:
500px
;
position
:relative
;
>
div
{
position
:absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;}
}
}
</
style
>
src/views/system/dataDictionary/getPriority/index.vue
0 → 100644
View file @
ead6a0f9
<
template
>
<div
class=
"common-page device-manage"
>
<!-- 表格 -->
<div
class=
"panel-bottom page-row"
>
<h3>
智能分配优先级设置
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
<div
class=
"toolbar"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"toAdd"
>
新增
</el-button>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"id"
label=
"序号"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"名字"
align=
"center"
></el-table-column>
<el-table-column
prop=
"pri"
label=
"优先级设置"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"toEdit(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"toDelete(scope.row)"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
</div>
</div>
</div>
</div>
</div>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"true"
:before-close=
"cancelForm"
:visible.sync=
"form.visible"
:title=
"form.title"
width=
"700px"
>
<el-form
:model=
"form.item"
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"150px"
>
<el-form-item
label=
"名字"
prop=
"name"
>
<el-input
v-model=
"form.item.name"
style=
"width:280px;"
placeholder=
"请输入名字"
/>
</el-form-item>
<el-form-item
label=
"优先级设置"
prop=
"pri"
>
<el-input
v-model=
"form.item.pri"
style=
"width:280px;"
placeholder=
"请输入优先级"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm"
>
取消
</el-button>
<el-button
:loading=
"form.status.cu === 2"
type=
"primary"
@
click=
"submitForm('form1', form.item)"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
Tools
,
HttpReq
,
Dates
}
from
'
@/assets/js/common.js
'
;
export
default
{
name
:
'
GetPriority
'
,
components
:
{},
data
()
{
return
{
loading
:
false
,
page
:
1
,
size
:
10
,
total
:
0
,
query
:{},
alarmTimeId
:
''
,
tableData
:
[],
form
:
{
title
:
'
新增优先级设置
'
,
visible
:
false
,
reqType
:
'
add
'
,
status
:{
cu
:
0
},
item
:{},
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'
请输入名字
'
,
trigger
:
'
blur
'
}
],
pri
:
[
{
required
:
true
,
message
:
'
请输入优先级
'
,
trigger
:
'
blur
'
}
],
},
}
},
mounted
()
{
var
that
=
this
;
this
.
$nextTick
(()
=>
{
this
.
loadData
();
})
},
methods
:
{
loadData
()
{
var
sort
=
'
id,desc
'
;
var
param
=
this
.
query
;
param
.
page
=
this
.
page
-
1
;
param
.
size
=
this
.
size
;
param
.
sort
=
sort
;
this
.
$nextTick
(()
=>
{
HttpReq
.
truckDispatching
.
getPriorityQuery
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
content
;
this
.
total
=
res
.
data
.
totalElements
;
}
})
})
},
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
===
1
)
{
return
'
warning-row
'
;
}
else
if
(
rowIndex
===
3
)
{
return
'
success-row
'
;
}
return
''
;
},
cancelForm
(
a
,
b
,
c
){
this
.
form
.
visible
=
false
;
},
toAdd
()
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
新增优先级设置
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
reqType
=
'
add
'
;
this
.
form
.
item
=
{};
},
toEdit
(
item
)
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
修改优先级设置
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
item
=
{...
item
};
this
.
form
.
reqType
=
'
edit
'
;
this
.
alarmTimeId
=
this
.
form
.
item
.
id
;
},
toDelete
(
item
)
{
var
id
=
item
.
id
;
this
.
$confirm
(
'
确认删除该条数据吗?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
((
e
)
=>
{
this
.
reqRemoveProject
([
id
])
}).
catch
((
e
)
=>
{})
},
pageChange
(
e
)
{
this
.
page
=
e
this
.
loadData
()
},
sizeChange
(
e
)
{
this
.
page
=
1
this
.
size
=
e
this
.
loadData
()
},
submitForm
(
validateName
,
item
){
if
(
!
this
.
form
.
status
.
cu
){
this
.
form
.
status
.
cu
=
2
;
this
.
$refs
[
validateName
].
validate
(
valid
=>
{
if
(
valid
){
if
(
this
.
form
.
reqType
===
'
add
'
){
this
.
reqAddItem
(
this
.
form
,
item
)
}
else
{
this
.
reqUpdateItem
(
this
.
form
,
item
)
}
}
else
{
this
.
form
.
status
.
cu
=
0
}
});
};
},
//新增优先级设置
reqAddItem
(
form
,
item
){
let
lastData
=
{...
item
};
HttpReq
.
truckDispatching
.
getPriorityTimeAdd
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
优先级设置新增成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//修改优先级设置
reqUpdateItem
(
form
,
item
){
let
lastData
=
{...
item
};
lastData
.
id
=
this
.
alarmTimeId
;
HttpReq
.
truckDispatching
.
getPriorityTimeUpdate
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
优先级设置修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//删除优先级设置
reqRemoveProject
(
item
){
HttpReq
.
truckDispatching
.
getPriorityTimetDel
(
item
).
then
((
res
)
=>
{
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
this
.
$notify
({
title
:
'
删除成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
}
this
.
loadData
();
})
},
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scope
>
.el-table
.warning-row
{
background
:
oldlace
;
}
.el-table
.success-row
{
background
:
#f0f9eb
;
}
.device-manage
{
.panel-bottom
{
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
14px
;}
.btn-groub2
{
display
:inline-block
;
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
15px
;}
.el-button--warning
{
background-color
:
#e6a23c
;
border-color
:
#e6a23c
;
}
.el-button--warning
:focus
,
.el-button--warning
:hover
{
background
:
#ebb563
;
border-color
:
#ebb563
;}
}
}
}
.ecahrt1-dialog
{
display
:flex
;
align-items
:center
;
.el-dialog
{
margin-top
:inherit
!
important
;
display
:table
!
important
;
width
:fit-content
;
.el-form-item
{
margin-right
:
0
;}
}
.el-dialog__header
{
height
:
0
;
padding
:
0
;
display
:block
;}
.form-body
{
border
:
1px
solid
#999
;
width
:
800px
;
height
:
500px
;
position
:relative
;
>
div
{
position
:absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;}
}
}
</
style
>
src/views/system/shift/index.vue
View file @
ead6a0f9
<
template
>
<div
class=
"app-container"
>
<!--工具栏-->
<div
class=
"head-container"
>
<div
v-if=
"crud.props.searchToggle"
>
<!-- 搜索 -->
<el-input
v-model=
"query.name"
clearable
size=
"small"
placeholder=
"输入部门名称搜索"
style=
"width: 200px;"
class=
"filter-item"
@
keyup.enter.native=
"crud.toQuery"
/>
<date-range-picker
v-model=
"query.createTime"
class=
"date-item"
/>
<el-select
v-model=
"query.enabled"
clearable
size=
"small"
placeholder=
"状态"
class=
"filter-item"
style=
"width: 90px"
@
change=
"crud.toQuery"
>
<el-option
v-for=
"item in enabledTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<rrOperation
/>
</div>
<crudOperation
:permission=
"permission"
/>
</div>
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"crud.cancelCU"
:visible.sync=
"crud.status.cu > 0"
:title=
"crud.status.title"
width=
"500px"
>
<el-form
ref=
"form"
inline
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"部门名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
style=
"width: 370px;"
/>
</el-form-item>
<el-form-item
label=
"部门排序"
prop=
"deptSort"
>
<el-input-number
v-model.number=
"form.deptSort"
:min=
"0"
:max=
"999"
controls-position=
"right"
style=
"width: 370px;"
/>
</el-form-item>
<el-form-item
label=
"顶级部门"
>
<el-radio-group
v-model=
"form.isTop"
style=
"width: 140px"
>
<el-radio
label=
"1"
>
是
</el-radio>
<el-radio
label=
"0"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"enabled"
>
<el-radio
v-for=
"item in dict.dept_status"
:key=
"item.id"
v-model=
"form.enabled"
:label=
"item.value"
>
{{
item
.
label
}}
</el-radio>
</el-form-item>
<el-form-item
v-if=
"form.isTop === '0'"
style=
"margin-bottom: 0;"
label=
"上级部门"
prop=
"pid"
>
<treeselect
v-model=
"form.pid"
:load-options=
"loadDepts"
:options=
"depts"
style=
"width: 370px;"
placeholder=
"选择上级类目"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"crud.cancelCU"
>
取消
</el-button>
<el-button
:loading=
"crud.status.cu === 2"
type=
"primary"
@
click=
"crud.submitCU"
>
确认
</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref=
"table"
v-loading=
"crud.loading"
lazy
:load=
"getDeptDatas"
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}"
:data="crud.data"
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column
:selectable=
"checkboxT"
type=
"selection"
width=
"55"
/>
<el-table-column
label=
"名称"
prop=
"name"
/>
<el-table-column
label=
"排序"
prop=
"deptSort"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"enabled"
>
<template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.enabled"
:disabled=
"scope.row.id === 1"
active-color=
"#409EFF"
inactive-color=
"#F56C6C"
@
change=
"changeEnabled(scope.row, scope.row.enabled,)"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"createTime"
label=
"创建日期"
/>
<el-table-column
v-if=
"checkPer(['admin','dept:edit','dept:del'])"
label=
"操作"
width=
"130px"
align=
"center"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<udOperation
:data=
"scope.row"
:permission=
"permission"
:disabled-dle=
"scope.row.id === 1"
msg=
"确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"common-page device-manage"
>
<!--
<div
class=
"option page-row"
>
-->
<!--工具栏-->
<!--
<div
class=
"head-container"
>
-->
<!-- 搜索 -->
<!--
<label
class=
"el-form-item-label"
style=
"font-weight: 500;"
>
设备识别码
</label>
<el-input
v-model=
"query.code"
clearable
size=
"small"
placeholder=
"请输入班次"
style=
"width:180px;"
@
clear=
"clearLimit"
/>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"toSearch"
>
搜索
</el-button>
</div>
</div>
-->
<!-- 表格 -->
<div
class=
"panel-bottom page-row"
>
<h3>
班次设置
</h3>
<div
class=
"ctin-box"
>
<div
class=
"content-within"
>
<div
class=
"content-fix"
>
<div
class=
"toolbar"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"toAdd"
>
新增
</el-button>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
style=
"width:auto"
:row-class-name=
"tableRowClassName"
>
<el-table-column
prop=
"banci"
label=
"班次"
align=
"center"
></el-table-column>
<el-table-column
prop=
"startTime"
label=
"开始时间"
align=
"center"
></el-table-column>
<el-table-column
prop=
"endTime"
label=
"结束时间"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"toEdit(scope.row)"
></el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"toDelete(scope.row)"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
</div>
</div>
</div>
</div>
</div>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"true"
:before-close=
"cancelForm"
:visible.sync=
"form.visible"
:title=
"form.title"
width=
"700px"
>
<el-form
:model=
"form.item"
:rules=
"rules"
ref=
"form1"
:inline=
"true"
size=
"small"
label-width=
"150px"
>
<el-form-item
label=
"班次"
prop=
"banci"
>
<el-input
v-model=
"form.item.banci"
style=
"width:220px;"
placeholder=
"请输入班次"
/>
</el-form-item>
<el-form-item
label=
"开始时间"
prop=
"startTime"
>
<el-time-picker
v-model=
"form.item.startTime"
placeholder=
"任意时间点"
></el-time-picker>
</el-form-item>
<el-form-item
label=
"结束时间"
prop=
"endTime"
>
<el-time-picker
v-model=
"form.item.endTime"
placeholder=
"任意时间点"
></el-time-picker>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelForm"
>
取消
</el-button>
<el-button
:loading=
"form.status.cu === 2"
type=
"primary"
@
click=
"submitForm('form1', form.item)"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
crudDept
from
'
@/api/system/dept
'
import
Treeselect
from
'
@riophae/vue-treeselect
'
import
'
@riophae/vue-treeselect/dist/vue-treeselect.css
'
import
{
LOAD_CHILDREN_OPTIONS
}
from
'
@riophae/vue-treeselect
'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'
@crud/crud
'
import
rrOperation
from
'
@crud/RR.operation
'
import
crudOperation
from
'
@crud/CRUD.operation
'
import
udOperation
from
'
@crud/UD.operation
'
import
DateRangePicker
from
'
@/components/DateRangePicker
'
import
{
Tools
,
HttpReq
,
Dates
}
from
'
@/assets/js/common.js
'
;
const
defaultForm
=
{
id
:
null
,
name
:
null
,
isTop
:
'
1
'
,
subCount
:
0
,
pid
:
null
,
deptSort
:
999
,
enabled
:
'
true
'
}
export
default
{
name
:
'
Shift
'
,
components
:
{
Treeselect
,
crudOperation
,
rrOperation
,
udOperation
,
DateRangePicker
},
cruds
()
{
return
CRUD
({
title
:
'
部门
'
,
url
:
'
api/dept
'
,
crudMethod
:
{
...
crudDept
}})
},
mixins
:
[
presenter
(),
header
(),
form
(
defaultForm
),
crud
()],
// 设置数据字典
dicts
:
[
'
dept_status
'
],
data
()
{
return
{
depts
:
[],
rules
:
{
name
:
[
{
required
:
true
,
message
:
'
请输入名称
'
,
trigger
:
'
blur
'
}
],
deptSort
:
[
{
required
:
true
,
message
:
'
请输入序号
'
,
trigger
:
'
blur
'
,
type
:
'
number
'
}
]
},
permission
:
{
add
:
[
'
admin
'
,
'
dept:add
'
],
edit
:
[
'
admin
'
,
'
dept:edit
'
],
del
:
[
'
admin
'
,
'
dept:del
'
]
},
enabledTypeOptions
:
[
{
key
:
'
true
'
,
display_name
:
'
正常
'
},
{
key
:
'
false
'
,
display_name
:
'
禁用
'
}
]
}
},
methods
:
{
getDeptDatas
(
tree
,
treeNode
,
resolve
)
{
const
params
=
{
pid
:
tree
.
id
}
setTimeout
(()
=>
{
crudDept
.
getDepts
(
params
).
then
(
res
=>
{
resolve
(
res
.
content
)
})
},
100
)
},
// 新增与编辑前做的操作
[
CRUD
.
HOOK
.
afterToCU
](
crud
,
form
)
{
if
(
form
.
pid
!==
null
)
{
form
.
isTop
=
'
0
'
}
else
if
(
form
.
id
!==
null
)
{
form
.
isTop
=
'
1
'
}
form
.
enabled
=
`
${
form
.
enabled
}
`
if
(
form
.
id
!=
null
)
{
this
.
getSupDepts
(
form
.
id
)
}
else
{
this
.
getDepts
()
}
},
getSupDepts
(
id
)
{
crudDept
.
getDeptSuperior
(
id
).
then
(
res
=>
{
const
date
=
res
.
content
this
.
buildDepts
(
date
)
this
.
depts
=
date
})
},
buildDepts
(
depts
)
{
depts
.
forEach
(
data
=>
{
if
(
data
.
children
)
{
this
.
buildDepts
(
data
.
children
)
}
if
(
data
.
hasChildren
&&
!
data
.
children
)
{
data
.
children
=
null
}
})
},
getDepts
()
{
crudDept
.
getDepts
({
enabled
:
true
}).
then
(
res
=>
{
this
.
depts
=
res
.
content
.
map
(
function
(
obj
)
{
if
(
obj
.
hasChildren
)
{
obj
.
children
=
null
name
:
'
Shift
'
,
components
:
{},
data
()
{
return
{
loading
:
false
,
page
:
1
,
size
:
10
,
total
:
0
,
query
:{},
ShiftId
:
''
,
tableData
:
[],
form
:
{
title
:
'
新增班次
'
,
visible
:
false
,
reqType
:
'
add
'
,
status
:{
cu
:
0
},
item
:{},
},
rules
:
{
banci
:
[
{
required
:
true
,
message
:
'
请输入班次
'
,
trigger
:
'
blur
'
}
],
startTime
:
[
{
required
:
true
,
message
:
'
请选择开始时间
'
,
trigger
:
'
blur
'
}
],
endTime
:
[
{
required
:
true
,
message
:
'
请选择结束时间
'
,
trigger
:
'
blur
'
}
],
},
}
},
mounted
()
{
var
that
=
this
;
this
.
$nextTick
(()
=>
{
this
.
loadData
();
})
},
methods
:
{
loadData
()
{
var
that
=
this
;
var
sort
=
'
addTime,desc
'
;
var
param
=
this
.
query
;
param
.
page
=
this
.
page
-
1
;
param
.
size
=
this
.
size
;
//param.sort = sort;
this
.
$nextTick
(()
=>
{
HttpReq
.
truckDispatching
.
shiftQuery
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
content
;
this
.
total
=
res
.
data
.
totalElements
;
}
return
obj
})
})
},
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
crudDept
.
getDepts
({
enabled
:
true
,
pid
:
parentNode
.
id
}).
then
(
res
=>
{
parentNode
.
children
=
res
.
content
.
map
(
function
(
obj
)
{
if
(
obj
.
hasChildren
)
{
obj
.
children
=
null
}
return
obj
})
setTimeout
(()
=>
{
callback
()
},
100
)
})
})
})
},
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
===
1
)
{
return
'
warning-row
'
;
}
else
if
(
rowIndex
===
3
)
{
return
'
success-row
'
;
}
return
''
;
},
// 点击搜索
toSearch
()
{
this
.
page
=
1
this
.
loadData
()
},
// 清除限制
clearLimit
(){
this
.
loadData
()
},
cancelForm
(
a
,
b
,
c
){
this
.
form
.
visible
=
false
;
},
toAdd
()
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
新增班次
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
reqType
=
'
add
'
;
this
.
form
.
item
=
{};
this
.
picFileName
=
''
;
},
toEdit
(
item
)
{
// 请除表单验证
this
.
$refs
[
'
form1
'
]
&&
this
.
$refs
[
'
form1
'
].
clearValidate
();
this
.
form
.
title
=
'
修改班次
'
;
this
.
form
.
status
.
cu
=
0
;
this
.
form
.
visible
=
true
;
this
.
form
.
item
=
{...
item
};
this
.
form
.
item
.
startTime
=
''
;
this
.
form
.
item
.
endTime
=
''
;
this
.
form
.
reqType
=
'
edit
'
;
this
.
ShiftId
=
this
.
form
.
item
.
id
;
},
toDelete
(
item
)
{
var
id
=
item
.
id
;
this
.
$confirm
(
'
确认删除该条数据吗?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
((
e
)
=>
{
this
.
reqRemoveProject
([
id
])
}).
catch
((
e
)
=>
{
})
},
pageChange
(
e
)
{
this
.
page
=
e
this
.
loadData
()
},
sizeChange
(
e
)
{
this
.
page
=
1
this
.
size
=
e
this
.
loadData
()
},
submitForm
(
validateName
,
item
){
if
(
!
this
.
form
.
status
.
cu
){
this
.
form
.
status
.
cu
=
2
;
this
.
$refs
[
validateName
].
validate
(
valid
=>
{
if
(
valid
){
if
(
this
.
form
.
reqType
===
'
add
'
){
this
.
reqAddItem
(
this
.
form
,
item
)
}
else
{
this
.
reqUpdateItem
(
this
.
form
,
item
)
}
}
else
{
this
.
form
.
status
.
cu
=
0
}
});
};
},
//新增班次
reqAddItem
(
form
,
item
){
let
lastData
=
{...
item
};
lastData
.
startTime
=
this
.
currentTime
(
lastData
.
startTime
);
lastData
.
endTime
=
this
.
currentTime
(
lastData
.
endTime
);
HttpReq
.
truckDispatching
.
shiftAdd
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
班次新增成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//修改班次
reqUpdateItem
(
form
,
item
){
let
lastData
=
{...
item
};
lastData
.
startTime
=
this
.
currentTime
(
lastData
.
startTime
);
lastData
.
endTime
=
this
.
currentTime
(
lastData
.
endTime
);
lastData
.
id
=
this
.
ShiftId
;
HttpReq
.
truckDispatching
.
shiftUpdate
(
lastData
).
then
((
res
)
=>
{
form
.
visible
=
false
;
if
(
res
.
code
==
200
){
this
.
$notify
({
title
:
'
班次修改成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
this
.
loadData
()
}
else
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
error
'
,
duration
:
2500
})
}
}).
catch
(
function
(
error
)
{
form
.
status
.
cu
=
0
});
},
//删除班次
reqRemoveProject
(
item
){
HttpReq
.
truckDispatching
.
shiftDel
(
item
).
then
((
res
)
=>
{
if
(
res
.
status
==
400
){
this
.
$notify
({
title
:
res
.
head
.
message
,
type
:
'
error
'
,
duration
:
2500
})
}
else
{
this
.
$notify
({
title
:
'
删除成功!
'
,
type
:
'
success
'
,
duration
:
2500
});
}
this
.
loadData
();
})
},
//转换时间
currentTime
(
time
){
var
date
=
new
Date
(
time
);
var
hours
=
date
.
getHours
();
//小时 ,返回 Date 对象的小时 (0 ~ 23)
var
minutes
=
date
.
getMinutes
();
//分钟 ,返回 Date 对象的分钟 (0 ~ 59)
var
seconds
=
date
.
getSeconds
();
//秒 ,返回 Date 对象的秒数 (0 ~ 59)
//修改小时格式
if
(
hours
>=
0
&&
hours
<=
9
)
{
hours
=
"
0
"
+
hours
;
}
},
// 提交前的验证
[
CRUD
.
HOOK
.
afterValidateCU
]()
{
if
(
this
.
form
.
pid
!==
null
&&
this
.
form
.
pid
===
this
.
form
.
id
)
{
this
.
$message
({
message
:
'
上级部门不能为空
'
,
type
:
'
warning
'
})
return
false
//修改分钟格式
if
(
minutes
>=
0
&&
minutes
<=
9
)
{
minutes
=
"
0
"
+
minutes
;
}
if
(
this
.
form
.
isTop
===
'
1
'
)
{
this
.
form
.
pid
=
null
//修改秒格式
if
(
seconds
>=
0
&&
seconds
<=
9
)
{
seconds
=
"
0
"
+
seconds
;
}
return
true
let
currentFormatDate
=
hours
+
"
:
"
+
minutes
+
"
:
"
+
seconds
;
return
currentFormatDate
;
},
// 改变状态
changeEnabled
(
data
,
val
)
{
this
.
$confirm
(
'
此操作将 "
'
+
this
.
dict
.
label
.
dept_status
[
val
]
+
'
"
'
+
data
.
name
+
'
部门, 是否继续?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
(()
=>
{
crudDept
.
edit
(
data
).
then
(
res
=>
{
this
.
crud
.
notify
(
this
.
dict
.
label
.
dept_status
[
val
]
+
'
成功
'
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
}).
catch
(
err
=>
{
data
.
enabled
=
!
data
.
enabled
console
.
log
(
err
.
response
.
data
.
message
)
})
}).
catch
(()
=>
{
data
.
enabled
=
!
data
.
enabled
})
},
checkboxT
(
row
,
rowIndex
)
{
return
row
.
id
!==
1
}
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
::v-deep
.vue-treeselect__control
,
::v-deep
.vue-treeselect__placeholder
,
::v-deep
.vue-treeselect__single-value
{
height
:
30px
;
line-height
:
30px
;
}
</
style
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
::v-deep
.el-input-number
.el-input__inner
{
text-align
:
left
;
}
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scope
>
.el-table
.warning-row
{
background
:
oldlace
;
}
.el-table
.success-row
{
background
:
#f0f9eb
;
}
.device-manage
{
.panel-bottom
{
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
14px
;}
.btn-groub2
{
display
:inline-block
;
.el-button
{
margin
:
2px
0
;
padding
:
6px
15px
;
font-size
:
15px
;}
.el-button--warning
{
background-color
:
#e6a23c
;
border-color
:
#e6a23c
;
}
.el-button--warning
:focus
,
.el-button--warning
:hover
{
background
:
#ebb563
;
border-color
:
#ebb563
;}
}
}
}
.ecahrt1-dialog
{
display
:flex
;
align-items
:center
;
.el-dialog
{
margin-top
:inherit
!
important
;
display
:table
!
important
;
width
:fit-content
;
.el-form-item
{
margin-right
:
0
;}
}
.el-dialog__header
{
height
:
0
;
padding
:
0
;
display
:block
;}
.form-body
{
border
:
1px
solid
#999
;
width
:
800px
;
height
:
500px
;
position
:relative
;
>
div
{
position
:absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;}
}
}
</
style
>
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