|
|
|
|
@ -2,147 +2,146 @@ |
|
|
|
|
<basic-container> |
|
|
|
|
<!-- 记录仪管理 --> |
|
|
|
|
<el-tabs v-model="tabPosition" class="demo-tabs" @tab-change="tabPositionChange"> |
|
|
|
|
<el-tab-pane label="记录仪" name="recorder"> |
|
|
|
|
<avue-crud |
|
|
|
|
:height="460" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="recorderPage" |
|
|
|
|
ref="crud" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
<el-tab-pane label="记录仪" name="recorder"> </el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪曲线配置" name="recorderLineSetting"> </el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪历史曲线" name="recorderHistoryLine"> </el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
|
<avue-crud |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="recorderPage" |
|
|
|
|
ref="crud" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<!-- <el-button |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<!-- <el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> --> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪曲线配置" name="recorderLineSetting"> |
|
|
|
|
<avue-crud |
|
|
|
|
:height="460" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="recorderLinePage" |
|
|
|
|
ref="crud" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>批量删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪历史曲线" name="recorderHistoryLine"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
:model="searchForm" |
|
|
|
|
:rules="searchRules" |
|
|
|
|
ref="searchForm" |
|
|
|
|
class="demo-form-inline" |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
<el-form-item label="设备编码" prop="code"> |
|
|
|
|
<el-input v-model="searchForm.code" placeholder="设备编码"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="统计日期" prop="queryDate"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="searchForm.queryDate" |
|
|
|
|
type="daterange" |
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<!-- <el-date-picker v-model="form.queryDate" :default-time="['00:00:00', '23:59:59']" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" /> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" @click="onSubmit">查询</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div style="width: 100%; height: 70vh"> |
|
|
|
|
<div style="width: 100%; height: 100%" ref="historyCurve"></div> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<el-dialog append-to-body title="详情" width="80%" v-model="detailDialog" > |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
<avue-crud |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model="form" |
|
|
|
|
v-model:page="recorderLinePage" |
|
|
|
|
ref="crud" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="primary" @click="handleAdd" v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>批量删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
<div v-if="tabPosition == 'recorderHistoryLine'"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
:model="searchForm" |
|
|
|
|
:rules="searchRules" |
|
|
|
|
ref="searchForm" |
|
|
|
|
class="demo-form-inline" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="设备编码" prop="code"> |
|
|
|
|
<el-input v-model="searchForm.code" placeholder="设备编码"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="统计日期" prop="queryDate"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="searchForm.queryDate" |
|
|
|
|
type="daterange" |
|
|
|
|
format="YYYY-MM-DD" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<!-- <el-date-picker v-model="form.queryDate" :default-time="['00:00:00', '23:59:59']" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" /> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" @click="onSubmit">查询</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div style="width: 100%; height: 70vh"> |
|
|
|
|
<div style="width: 100%; height: 100%" ref="historyCurve"></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog append-to-body title="详情" width="80%" v-model="detailDialog"> |
|
|
|
|
<avue-crud |
|
|
|
|
class="detail-crud-option" |
|
|
|
|
:option="detailOption" |
|
|
|
|
@ -213,17 +212,12 @@ |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<div style="margin: 10px 0" v-if="addType == 'add'"> |
|
|
|
|
<el-button type="primary" @click="insertEvent()">插入一行</el-button> |
|
|
|
|
<el-button type="primary" @click="insertEvent()">插入一行</el-button> |
|
|
|
|
<el-button plain type="danger" @click="remove">删除选择行</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-form |
|
|
|
|
ref="tableForm" |
|
|
|
|
:model="lineForm" |
|
|
|
|
:rules="formRules" |
|
|
|
|
label-width="0px" |
|
|
|
|
> |
|
|
|
|
<el-form ref="tableForm" :model="lineForm" :rules="formRules" label-width="0px"> |
|
|
|
|
<!-- 全局错误提示 --> |
|
|
|
|
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;"> |
|
|
|
|
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px"> |
|
|
|
|
{{ formError }} |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="lineForm.settingData" @select="selectChange"> |
|
|
|
|
@ -234,23 +228,29 @@ |
|
|
|
|
</template> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].name`" :rules="formRules.name"> |
|
|
|
|
<el-input style="margin-top:10px;" v-model="scope.row.name"></el-input> |
|
|
|
|
<el-input style="margin-top: 10px" v-model="scope.row.name"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="参数显示名称" prop="showName" align="center"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].showName`" :rules="formRules.showName"> |
|
|
|
|
<el-input style="margin-top:10px;" v-model="scope.row.showName"></el-input> |
|
|
|
|
<el-form-item |
|
|
|
|
:prop="`settingData[${scope.$index}].showName`" |
|
|
|
|
:rules="formRules.showName" |
|
|
|
|
> |
|
|
|
|
<el-input style="margin-top: 10px" v-model="scope.row.showName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="是否显示曲线图" prop="showGraph" align="center"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].showGraph`" :rules="formRules.showGraph"> |
|
|
|
|
<div style="width:100%;display:flex;justify-content: center;"> |
|
|
|
|
<el-form-item |
|
|
|
|
:prop="`settingData[${scope.$index}].showGraph`" |
|
|
|
|
:rules="formRules.showGraph" |
|
|
|
|
> |
|
|
|
|
<div style="width: 100%; display: flex; justify-content: center"> |
|
|
|
|
<el-switch |
|
|
|
|
style="margin-top:10px;" |
|
|
|
|
style="margin-top: 10px" |
|
|
|
|
v-model="scope.row.showGraph" |
|
|
|
|
active-color="#13ce66" |
|
|
|
|
inactive-color="#ff4949" |
|
|
|
|
@ -265,7 +265,7 @@ |
|
|
|
|
<!-- <el-input v-model="scope.row.crcX"></el-input> --> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].crcX`" :rules="formRules.crcX"> |
|
|
|
|
<el-input |
|
|
|
|
style="margin-top:10px;" |
|
|
|
|
style="margin-top: 10px" |
|
|
|
|
v-model.number="scope.row.crcX" |
|
|
|
|
oninput="scope.row.crcX=scope.row.crcX.replace(/[^\d]/g,'')" |
|
|
|
|
></el-input> |
|
|
|
|
@ -286,9 +286,23 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import recorderColumnData from './js/recorderColumnData'; |
|
|
|
|
import { getRecorderList,addRecorder,updateRecorder,deleteRecorder,getRecorderDetail,addpackCycle, |
|
|
|
|
getpackCycleList,updatepackCycle,getRecorderLineSetting,addRecorderLineSetting,getRecorderLineSettingDetail, |
|
|
|
|
updateRecorderLineSetting,deleteRecorderLineSetting,getRecorderHistoryLine,getRecorderHistoryDetail } from '@/api/equiptManagement/recorderList'; |
|
|
|
|
import { |
|
|
|
|
getRecorderList, |
|
|
|
|
addRecorder, |
|
|
|
|
updateRecorder, |
|
|
|
|
deleteRecorder, |
|
|
|
|
getRecorderDetail, |
|
|
|
|
addpackCycle, |
|
|
|
|
getpackCycleList, |
|
|
|
|
updatepackCycle, |
|
|
|
|
getRecorderLineSetting, |
|
|
|
|
addRecorderLineSetting, |
|
|
|
|
getRecorderLineSettingDetail, |
|
|
|
|
updateRecorderLineSetting, |
|
|
|
|
deleteRecorderLineSetting, |
|
|
|
|
getRecorderHistoryLine, |
|
|
|
|
getRecorderHistoryDetail, |
|
|
|
|
} from '@/api/equiptManagement/recorderList'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -297,16 +311,16 @@ export default { |
|
|
|
|
code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }], |
|
|
|
|
queryDate: [{ required: true, message: '请选择统计日期', trigger: 'blur' }], |
|
|
|
|
}, |
|
|
|
|
codeArr:[], |
|
|
|
|
formError:'', |
|
|
|
|
codeArr: [], |
|
|
|
|
formError: '', |
|
|
|
|
deviceCode: '', |
|
|
|
|
settingData: [], |
|
|
|
|
tabPosition: 'recorder', |
|
|
|
|
loading: false, |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
lineForm:{ |
|
|
|
|
settingData:[] |
|
|
|
|
lineForm: { |
|
|
|
|
settingData: [], |
|
|
|
|
}, |
|
|
|
|
detailDialog: false, |
|
|
|
|
detailData: [], |
|
|
|
|
@ -399,8 +413,8 @@ export default { |
|
|
|
|
searchEnter: true, |
|
|
|
|
excelBtn: false, |
|
|
|
|
gridBtn: false, |
|
|
|
|
refreshBtn:false, |
|
|
|
|
columnBtn:false, |
|
|
|
|
refreshBtn: false, |
|
|
|
|
columnBtn: false, |
|
|
|
|
searchShowBtn: false, |
|
|
|
|
showOverflowTooltip: true, |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
@ -445,11 +459,11 @@ export default { |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
lineQuery:{}, |
|
|
|
|
selectLoading:false, |
|
|
|
|
lineQuery: {}, |
|
|
|
|
selectLoading: false, |
|
|
|
|
detailForm: {}, |
|
|
|
|
detailId:null, |
|
|
|
|
selectionList:[], |
|
|
|
|
detailId: null, |
|
|
|
|
selectionList: [], |
|
|
|
|
// 统一校验规则:支持数组项校验 |
|
|
|
|
formRules: { |
|
|
|
|
// 表格数据数组的整体校验(可选:如最少1行数据) |
|
|
|
|
@ -458,7 +472,7 @@ export default { |
|
|
|
|
required: true, |
|
|
|
|
message: '请至少添加一行数据', |
|
|
|
|
trigger: 'submit', |
|
|
|
|
type: 'array' // 明确类型为数组 |
|
|
|
|
type: 'array', // 明确类型为数组 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
@ -468,15 +482,13 @@ export default { |
|
|
|
|
callback(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
trigger: 'submit' |
|
|
|
|
} |
|
|
|
|
trigger: 'submit', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
// 数组中每一项的 name 字段校验 |
|
|
|
|
name: [ |
|
|
|
|
{ required: true, message: '请输入参数名称', trigger: ['change', 'submit'] } |
|
|
|
|
], |
|
|
|
|
} |
|
|
|
|
name: [{ required: true, message: '请输入参数名称', trigger: ['change', 'submit'] }], |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -491,19 +503,19 @@ export default { |
|
|
|
|
let params = { |
|
|
|
|
code: this.searchForm.code, |
|
|
|
|
startDate: this.searchForm.queryDate[0], |
|
|
|
|
endDate: this.searchForm.queryDate[1] |
|
|
|
|
} |
|
|
|
|
getRecorderHistoryLine(params).then(res =>{ |
|
|
|
|
console.log('res-----------',res) |
|
|
|
|
endDate: this.searchForm.queryDate[1], |
|
|
|
|
}; |
|
|
|
|
getRecorderHistoryLine(params).then(res => { |
|
|
|
|
console.log('res-----------', res); |
|
|
|
|
let chartData = { |
|
|
|
|
yArray:res.data.data.yarray, |
|
|
|
|
crcX:res.data.data.x, |
|
|
|
|
xData:res.data.data.xdata |
|
|
|
|
} |
|
|
|
|
yArray: res.data.data.yarray, |
|
|
|
|
crcX: res.data.data.x, |
|
|
|
|
xData: res.data.data.xdata, |
|
|
|
|
}; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.setEchart(chartData); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
// let chartData = { |
|
|
|
|
// yArray: [ |
|
|
|
|
// { |
|
|
|
|
@ -777,70 +789,68 @@ export default { |
|
|
|
|
chart.resize(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done){ |
|
|
|
|
if (this.tabPosition == "recorder") { |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.query = params; |
|
|
|
|
this.query.crtCode = this.query.recorder |
|
|
|
|
this.query.crtCode = this.query.recorder; |
|
|
|
|
this.recorderPage.currentPage = 1; |
|
|
|
|
this.getRecorder() |
|
|
|
|
done() |
|
|
|
|
}else if(this.tabPosition == 'recorderLineSetting'){ |
|
|
|
|
this.getRecorder(); |
|
|
|
|
done(); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineQuery = params; |
|
|
|
|
this.recorderLinePage.currentPage = 1 |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
done() |
|
|
|
|
this.recorderLinePage.currentPage = 1; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
remoteMethod(query) { |
|
|
|
|
if (query) { |
|
|
|
|
this.selectLoading = true |
|
|
|
|
getRecorderList({ crtCode: query }).then(res =>{ |
|
|
|
|
this.codeArr = res.data.data.records |
|
|
|
|
this.selectLoading = false |
|
|
|
|
}) |
|
|
|
|
this.selectLoading = true; |
|
|
|
|
getRecorderList({ crtCode: query }).then(res => { |
|
|
|
|
this.codeArr = res.data.data.records; |
|
|
|
|
this.selectLoading = false; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
getRecorderList({ crtCode: '' }).then(res =>{ |
|
|
|
|
this.codeArr = res.data.data.records |
|
|
|
|
this.selectLoading = false |
|
|
|
|
}) |
|
|
|
|
getRecorderList({ crtCode: '' }).then(res => { |
|
|
|
|
this.codeArr = res.data.data.records; |
|
|
|
|
this.selectLoading = false; |
|
|
|
|
}); |
|
|
|
|
// this.codeArr = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
searchReset(){ |
|
|
|
|
if (this.tabPosition == "recorder") { |
|
|
|
|
this.query = {} |
|
|
|
|
this.getRecorder() |
|
|
|
|
}else if(this.tabPosition == "recorderLineSetting"){ |
|
|
|
|
this.lineQuery = {} |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
searchReset() { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineQuery = {}; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleDelete(){ |
|
|
|
|
if(this.selectionList.length == 0){ |
|
|
|
|
this.$message.error('请至少选择一条数据') |
|
|
|
|
return |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error('请至少选择一条数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确认", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
if(this.tabPosition == "recorderLineSetting"){ |
|
|
|
|
if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
deleteRecorderLineSetting({ |
|
|
|
|
ids:this.selectionList.map(item => item.id).join(',') |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(','), |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list){ |
|
|
|
|
this.selectionList = list |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
getRecorder() { |
|
|
|
|
getRecorderList({ |
|
|
|
|
@ -852,31 +862,31 @@ export default { |
|
|
|
|
this.recorderPage.total = res.data.data.total; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getRecorderLine(){ |
|
|
|
|
getRecorderLine() { |
|
|
|
|
getRecorderLineSetting({ |
|
|
|
|
current:this.recorderLinePage.currentPage, |
|
|
|
|
size:this.recorderLinePage.pageSize, |
|
|
|
|
...this.lineQuery |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.recorderLinePage.total = res.data.data.total |
|
|
|
|
}) |
|
|
|
|
current: this.recorderLinePage.currentPage, |
|
|
|
|
size: this.recorderLinePage.pageSize, |
|
|
|
|
...this.lineQuery, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.recorderLinePage.total = res.data.data.total; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tabPositionChange(val) { |
|
|
|
|
console.log('val----------------',val); |
|
|
|
|
console.log('tabPosition----------------',this.tabPosition); |
|
|
|
|
console.log('val----------------', val); |
|
|
|
|
console.log('tabPosition----------------', this.tabPosition); |
|
|
|
|
this.option.column = recorderColumnData[val]; |
|
|
|
|
if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.option.addBtn = false; |
|
|
|
|
this.option.menuAlign = "center" |
|
|
|
|
this.option.menuWidth = 70 |
|
|
|
|
this.option.selection = true |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
this.option.menuAlign = 'center'; |
|
|
|
|
this.option.menuWidth = 70; |
|
|
|
|
this.option.selection = true; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} else if (this.tabPosition == 'recorder') { |
|
|
|
|
this.option.addBtn = true |
|
|
|
|
this.option.menuWidth = 150 |
|
|
|
|
this.option.selection = false |
|
|
|
|
this.option.addBtn = true; |
|
|
|
|
this.option.menuWidth = 150; |
|
|
|
|
this.option.selection = false; |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -887,48 +897,50 @@ export default { |
|
|
|
|
selectChange(list, row) { |
|
|
|
|
row._select = !row._select; |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading){ |
|
|
|
|
if(this.tabPosition == "recorder"){ |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
let params = { |
|
|
|
|
crtCode:row.crtCode, |
|
|
|
|
memo:row.memo |
|
|
|
|
} |
|
|
|
|
addRecorder(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
done() |
|
|
|
|
this.getRecorder() |
|
|
|
|
} |
|
|
|
|
}).catch(err =>{ |
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
crtCode: row.crtCode, |
|
|
|
|
memo: row.memo, |
|
|
|
|
}; |
|
|
|
|
addRecorder(params) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading){ |
|
|
|
|
if(this.tabPosition == "recorder"){ |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
let params = { |
|
|
|
|
id:row.id, |
|
|
|
|
crtCode:row.crtCode, |
|
|
|
|
memo:row.memo |
|
|
|
|
} |
|
|
|
|
updateRecorder(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
done() |
|
|
|
|
this.getRecorder() |
|
|
|
|
id: row.id, |
|
|
|
|
crtCode: row.crtCode, |
|
|
|
|
memo: row.memo, |
|
|
|
|
}; |
|
|
|
|
updateRecorder(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type){ |
|
|
|
|
console.log('type=============',type) |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
console.log('type=============', type); |
|
|
|
|
if (['edit', 'view'].includes(type)) { |
|
|
|
|
getRecorderDetail({ id: this.form.id }).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
done() |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}else if(['add'].includes(type)){ |
|
|
|
|
done() |
|
|
|
|
} else if (['add'].includes(type)) { |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
remove() { |
|
|
|
|
@ -950,17 +962,17 @@ export default { |
|
|
|
|
this.$message.error('请至少选择一条数据进行操作!'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
closeDialog(){ |
|
|
|
|
this.formError = '' |
|
|
|
|
closeDialog() { |
|
|
|
|
this.formError = ''; |
|
|
|
|
this.$refs.tableForm?.resetFields(); |
|
|
|
|
this.lineForm.settingData = [] |
|
|
|
|
this.addDialog = false |
|
|
|
|
this.lineForm.settingData = []; |
|
|
|
|
this.addDialog = false; |
|
|
|
|
}, |
|
|
|
|
handleSave() { |
|
|
|
|
this.formError = ''; |
|
|
|
|
if(this.deviceCode == '' && this.addType == 'add'){ |
|
|
|
|
this.$message.error('设备编码不能为空') |
|
|
|
|
return |
|
|
|
|
if (this.deviceCode == '' && this.addType == 'add') { |
|
|
|
|
this.$message.error('设备编码不能为空'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
|
@ -978,50 +990,50 @@ export default { |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.lineForm.settingData.map(item =>{ |
|
|
|
|
item.code = this.addType == 'add' ? this.deviceCode : item.code |
|
|
|
|
item.showGraph = item.showGraph == true ? 1 : 0 |
|
|
|
|
}) |
|
|
|
|
if(this.addType == 'add'){ |
|
|
|
|
this.lineForm.settingData.map(item => { |
|
|
|
|
item.code = this.addType == 'add' ? this.deviceCode : item.code; |
|
|
|
|
item.showGraph = item.showGraph == true ? 1 : 0; |
|
|
|
|
}); |
|
|
|
|
if (this.addType == 'add') { |
|
|
|
|
addRecorderLineSetting({ |
|
|
|
|
code:this.deviceCode, |
|
|
|
|
recorderCompareEntities:this.lineForm.settingData |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
code: this.deviceCode, |
|
|
|
|
recorderCompareEntities: this.lineForm.settingData, |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
this.addDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
updateRecorderLineSetting({...this.lineForm.settingData[0]}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
updateRecorderLineSetting({ ...this.lineForm.settingData[0] }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
this.addDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// this.addDialog = false; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowEdit(row, index) { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.$refs.crud.rowEdit(row, index); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineForm.settingData = [] |
|
|
|
|
this.lineForm.settingData = []; |
|
|
|
|
this.addType = 'edit'; |
|
|
|
|
getRecorderLineSettingDetail({ |
|
|
|
|
id:row.id |
|
|
|
|
}).then(res =>{ |
|
|
|
|
console.log('res00000000000000000',res) |
|
|
|
|
res.data.data.showGraph = res.data.data.showGraph == 1 ? true : false |
|
|
|
|
this.lineForm.settingData[0] = res.data.data |
|
|
|
|
setTimeout(() =>{ |
|
|
|
|
id: row.id, |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log('res00000000000000000', res); |
|
|
|
|
res.data.data.showGraph = res.data.data.showGraph == 1 ? true : false; |
|
|
|
|
this.lineForm.settingData[0] = res.data.data; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.addDialog = true; |
|
|
|
|
},100) |
|
|
|
|
}) |
|
|
|
|
}, 100); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
showDetail(row) { |
|
|
|
|
@ -1034,12 +1046,12 @@ export default { |
|
|
|
|
}, |
|
|
|
|
setCycle() { |
|
|
|
|
getpackCycleList({ |
|
|
|
|
current:1, |
|
|
|
|
size:10 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.setForm = res.data.data.records.length > 0 ? res.data.data.records[0] : {} |
|
|
|
|
current: 1, |
|
|
|
|
size: 10, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.setForm = res.data.data.records.length > 0 ? res.data.data.records[0] : {}; |
|
|
|
|
this.settingDialog = true; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleAdd() { |
|
|
|
|
this.addType = 'add'; |
|
|
|
|
@ -1051,11 +1063,11 @@ export default { |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
if(this.tabPosition == 'recorder'){ |
|
|
|
|
deleteRecorder({ids:row.id}).then(res => { |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getRecorder() |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
deleteRecorder({ ids: row.id }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -1064,45 +1076,44 @@ export default { |
|
|
|
|
submitCycle() { |
|
|
|
|
this.$refs.setForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if(!this.setForm.id){ |
|
|
|
|
if (!this.setForm.id) { |
|
|
|
|
addpackCycle(this.setForm).then(res => { |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('保存成功') |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.settingDialog = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
updatepackCycle(this.setForm).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('保存成功') |
|
|
|
|
} else { |
|
|
|
|
updatepackCycle(this.setForm).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.settingDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
loadData(row) { |
|
|
|
|
getRecorderHistoryDetail({ |
|
|
|
|
// id:this.detailId, |
|
|
|
|
recorder:this.detailId, |
|
|
|
|
current:this.detailPage.currentPage, |
|
|
|
|
size:this.detailPage.pageSize |
|
|
|
|
}).then(res =>{ |
|
|
|
|
console.log('res',res) |
|
|
|
|
this.detailData = res.data.data.records |
|
|
|
|
this.detailPage.total = res.data.data.total |
|
|
|
|
recorder: this.detailId, |
|
|
|
|
current: this.detailPage.currentPage, |
|
|
|
|
size: this.detailPage.pageSize, |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log('res', res); |
|
|
|
|
this.detailData = res.data.data.records; |
|
|
|
|
this.detailPage.total = res.data.data.total; |
|
|
|
|
this.detailDialog = true; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
detailCurrentChange(currentPage){ |
|
|
|
|
this.detailPage.currentPage = currentPage |
|
|
|
|
this.loadData() |
|
|
|
|
detailCurrentChange(currentPage) { |
|
|
|
|
this.detailPage.currentPage = currentPage; |
|
|
|
|
this.loadData(); |
|
|
|
|
}, |
|
|
|
|
detailSizeChange(pageSize){ |
|
|
|
|
this.detailPage.pageSize = pageSize |
|
|
|
|
this.loadData() |
|
|
|
|
detailSizeChange(pageSize) { |
|
|
|
|
this.detailPage.pageSize = pageSize; |
|
|
|
|
this.loadData(); |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
this.data = [ |
|
|
|
|
@ -1117,9 +1128,9 @@ export default { |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
.detail-crud-option{ |
|
|
|
|
.avue-crud__header{ |
|
|
|
|
min-height: 0; |
|
|
|
|
} |
|
|
|
|
.detail-crud-option { |
|
|
|
|
.avue-crud__header { |
|
|
|
|
min-height: 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |