中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

897 lines
28 KiB

<template>
6 months ago
<basic-container>
<!-- 记录仪管理 -->
<el-tabs v-model="tabPosition" class="demo-tabs" @tab-change="tabPositionChange">
6 months ago
<el-tab-pane label="记录仪" name="recorder">
4 months ago
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
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"
>
6 months ago
<template #menu="{ row, index, size }">
4 months ago
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'"
>明细</el-button
>
6 months ago
<el-button type="text" @click="rowEdit(row, index)">修改</el-button>
4 months ago
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'"
>删除</el-button
>
6 months ago
</template>
<template #menu-left>
4 months ago
<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
>
6 months ago
</template>
</avue-crud>
</el-tab-pane>
<el-tab-pane label="记录仪曲线配置" name="recorderLineSetting">
4 months ago
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
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"
@on-load="onLoad"
>
6 months ago
<template #menu="{ row, index, size }">
4 months ago
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'"
>明细</el-button
>
6 months ago
<el-button type="text" @click="rowEdit(row, index)">修改</el-button>
4 months ago
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'"
>删除</el-button
>
6 months ago
</template>
<template #menu-left>
4 months ago
<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
>
6 months ago
</template>
</avue-crud>
</el-tab-pane>
<el-tab-pane label="记录仪历史曲线" name="recorderHistoryLine">
4 months ago
<el-form
:inline="true"
:model="searchForm"
:rules="searchRules"
ref="searchForm"
class="demo-form-inline"
>
6 months ago
<el-form-item label="设备编码" prop="code">
<el-input v-model="searchForm.code" placeholder="设备编码"></el-input>
</el-form-item>
<el-form-item label="统计日期" prop="queryDate">
4 months ago
<el-date-picker
v-model="searchForm.queryDate"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
6 months ago
</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>
4 months ago
<div style="width: 100%; height: 70vh">
<div style="width: 100%; height: 100%" ref="historyCurve"></div>
6 months ago
</div>
</el-tab-pane>
6 months ago
</el-tabs>
<el-dialog append-to-body title="详情" width="80%" v-model="detailDialog">
4 months ago
<avue-crud
:option="detailOption"
:table-loading="detailLoading"
:data="detailData"
v-model="detailForm"
v-model:page="detailPage"
ref="crud"
@current-change="currentChange"
@size-change="sizeChange"
>
6 months ago
</avue-crud>
</el-dialog>
<el-dialog append-to-body title="打包周期配置" v-model="settingDialog">
<el-form ref="setForm" :model="setForm" :rules="setRules" label-width="120px">
<el-form-item label="记录仪打包周期" prop="cpcQuantity">
<!-- <el-input placeholder="请输入记录仪打包周期" v-model="setForm.cpcQuantity"></el-input> -->
4 months ago
<el-input-number
v-model="setForm.cpcQuantity"
controls-position="right"
@change="handleChange"
:min="1"
></el-input-number>
6 months ago
</el-form-item>
<el-form-item prop="cpcUnit">
<el-radio-group v-model="setForm.cpcUnit" size="small">
4 months ago
<el-radio label="0" border></el-radio>
<el-radio label="1" border></el-radio>
<el-radio label="2" border></el-radio>
<el-radio label="3" border></el-radio>
<el-radio label="4" border></el-radio>
<el-radio label="5" border></el-radio>
6 months ago
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="settingDialog = false"> </el-button>
<el-button type="primary" @click="submitCycle"> </el-button>
</span>
</template>
</el-dialog>
6 months ago
<el-dialog append-to-body title="新增" v-model="addDialog" width="80%">
4 months ago
<div style="display: flex; align-items: center" v-if="addType == 'add'">
6 months ago
<span>设备编号</span>
4 months ago
<el-input style="width: 300px; margin-left: 10px" v-model="deviceCode"></el-input>
6 months ago
</div>
4 months ago
<div style="margin: 10px 0">
6 months ago
<el-button type="primary" icon="el-icon-plus" @click="insertEvent()">插入一行</el-button>
<el-button plain type="danger" @click="remove">删除选择行</el-button>
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
<el-table :data="settingData" @select="selectChange">
<el-table-column type="selection"></el-table-column>
<el-table-column label="参数名称" prop="name" align="center">
<template #default="scope">
<el-input v-model="scope.row.name"></el-input>
</template>
</el-table-column>
<el-table-column label="参数显示名称" prop="showName" align="center">
<template #default="scope">
<el-input v-model="scope.row.showName"></el-input>
</template>
</el-table-column>
<el-table-column label="是否显示曲线图" prop="showGraph" align="center">
<template #default="scope">
4 months ago
<el-switch
v-model="scope.row.showGraph"
active-color="#13ce66"
inactive-color="#ff4949"
>
6 months ago
</el-switch>
</template>
</el-table-column>
<el-table-column label="曲线X轴间隔" prop="crcX" align="center">
<template #default="scope">
<!-- <el-input v-model="scope.row.crcX"></el-input> -->
4 months ago
<el-input
v-model.number="scope.row.crcX"
oninput="scope.row.crcX=scope.row.crcX.replace(/[^\d]/g,'')"
>
></el-input
>
6 months ago
</template>
</el-table-column>
</el-table>
</el-dialog>
6 months ago
</basic-container>
</template>
<script>
6 months ago
import recorderColumnData from './js/recorderColumnData';
4 months ago
import { getRecorderList,addRecorder,updateRecorder,deleteRecorder,getRecorderDetail,addpackCycle } from '@/api/equiptManagement/recorderList';
export default {
6 months ago
data() {
return {
6 months ago
searchForm: {},
searchRules: {
code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }],
4 months ago
queryDate: [{ required: true, message: '请选择统计日期', trigger: 'blur' }],
6 months ago
},
deviceCode: '',
settingData: [],
6 months ago
tabPosition: 'recorder',
loading: false,
data: [],
form: {},
detailDialog: false,
detailData: [],
6 months ago
settingDialog: false,
6 months ago
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
6 months ago
addType: 'add',
addDialog: false,
setForm: {},
setRules: {
4 months ago
cpcQuantity: [{ required: true, message: '请输入记录仪打包周期', trigger: 'blur' }],
6 months ago
},
option: {
columnSort: true,
tip: false,
height: 'auto',
align: 'center',
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: false,
viewBtn: false,
delBtn: false,
editBtn: false,
addBtnIcon: ' ',
viewBtnIcon: ' ',
6 months ago
delBtnIcon: ' ',
editBtnIcon: ' ',
6 months ago
addBtn: true,
labelWidth: 120,
searchLabelWidth: 120,
menu: true,
menuWidth: 200,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
4 months ago
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
column: [],
6 months ago
},
detailOption: {
columnSort: true,
tip: false,
height: 'auto',
align: 'center',
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: false,
viewBtn: false,
delBtn: false,
editBtn: false,
delBtnIcon: ' ',
addBtn: false,
labelWidth: 120,
searchLabelWidth: 120,
menu: false,
menuWidth: 200,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
4 months ago
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
6 months ago
column: [
{
label: '记录仪',
prop: 'recorder',
span: 24,
labelWidth: 140,
addDisplay: false,
editDisplay: false,
overflow: true,
},
{
label: '使用时间',
prop: 'recordDate',
span: 24,
labelWidth: 140,
addDisplay: false,
editDisplay: false,
overflow: true,
},
{
label: '数据信息',
prop: 'memo',
span: 24,
labelWidth: 140,
addDisplay: false,
editDisplay: false,
overflow: true,
},
4 months ago
],
6 months ago
},
detailPage: {
pageSize: 10,
currentPage: 1,
total: 0,
},
detailForm: {},
4 months ago
};
6 months ago
},
mounted() {
4 months ago
this.tabPositionChange();
this.option.column = recorderColumnData[this.tabPosition];
6 months ago
},
methods: {
6 months ago
// 查询
onSubmit() {
this.$refs.searchForm.validate(valid => {
if (valid) {
let chartData = {
4 months ago
yArray: [
6 months ago
{
4 months ago
showName: '压力',
yData: [
11.75, 1.0, 0.15, 1.9, 11.75, 0.15, 1.75, 1.9, 1.0, 1.75, 1.0, 0.15, 0.15, 1.9,
1.0, 1.75, 1.9, 11.75, 1.75, 11.75, 11.75, 1.0, 0.15, 1.9, 11.75, 0.15, 1.75, 1.9,
1.0, 1.75, 1.0, 0.15, 0.15, 1.9, 1.0, 1.75, 1.9, 11.75, 1.75, 11.75, 11.75, 1.0,
0.15, 1.9, 11.75, 0.15, 1.75, 1.9, 1.0, 1.75, 1.0, 0.15, 0.15, 1.9, 1.0, 1.75,
1.9, 11.75, 1.75, 11.75, 11.75, 1.0, 0.15, 1.9, 11.75, 0.15, 1.75, 1.9, 1.0, 1.75,
1.0, 0.15, 0.15, 1.9, 1.0, 1.75, 1.9, 11.75, 1.75, 11.75,
6 months ago
],
4 months ago
crcY: 0.25,
6 months ago
},
{
4 months ago
showName: '温度',
yData: [
85.0, 500.0, 30.0, 500.0, 85.0, 30.0, 65.0, 500.0, 500.0, 65.0, 500.0, 30.0, 30.0,
500.0, 500.0, 65.0, 500.0, 85.0, 65.0, 85.0, 85.0, 500.0, 30.0, 500.0, 85.0, 30.0,
65.0, 500.0, 500.0, 65.0, 500.0, 30.0, 30.0, 500.0, 500.0, 65.0, 500.0, 85.0,
65.0, 85.0, 85.0, 500.0, 30.0, 500.0, 85.0, 30.0, 65.0, 500.0, 500.0, 65.0, 500.0,
30.0, 30.0, 500.0, 500.0, 65.0, 500.0, 85.0, 65.0, 85.0, 85.0, 500.0, 30.0, 500.0,
85.0, 30.0, 65.0, 500.0, 500.0, 65.0, 500.0, 30.0, 30.0, 500.0, 500.0, 65.0,
500.0, 85.0, 65.0, 85.0,
6 months ago
],
4 months ago
crcY: 65.0,
6 months ago
},
{
4 months ago
showName: '低真空',
yData: [
12.0, 7.8, 1.0, 7.5, 12.0, 1.0, 6.0, 7.5, 7.8, 6.0, 7.8, 1.0, 1.0, 7.5, 7.8, 6.0,
7.5, 12.0, 6.0, 12.0, 12.0, 7.8, 1.0, 7.5, 12.0, 1.0, 6.0, 7.5, 7.8, 6.0, 7.8,
1.0, 1.0, 7.5, 7.8, 6.0, 7.5, 12.0, 6.0, 12.0, 12.0, 7.8, 1.0, 7.5, 12.0, 1.0,
6.0, 7.5, 7.8, 6.0, 7.8, 1.0, 1.0, 7.5, 7.8, 6.0, 7.5, 12.0, 6.0, 12.0, 12.0, 7.8,
1.0, 7.5, 12.0, 1.0, 6.0, 7.5, 7.8, 6.0, 7.8, 1.0, 1.0, 7.5, 7.8, 6.0, 7.5, 12.0,
6.0, 12.0,
6 months ago
],
4 months ago
crcY: 1.0,
6 months ago
},
{
4 months ago
showName: '高真空',
yData: [
1.875, 0.875, 0.101, 0.375, 1.875, 0.101, 0.875, 0.375, 0.875, 0.875, 0.875,
0.101, 0.101, 0.375, 0.875, 0.875, 0.375, 1.875, 0.875, 1.875, 1.875, 0.875,
0.101, 0.375, 1.875, 0.101, 0.875, 0.375, 0.875, 0.875, 0.875, 0.101, 0.101,
0.375, 0.875, 0.875, 0.375, 1.875, 0.875, 1.875, 1.875, 0.875, 0.101, 0.375,
1.875, 0.101, 0.875, 0.375, 0.875, 0.875, 0.875, 0.101, 0.101, 0.375, 0.875,
0.875, 0.375, 1.875, 0.875, 1.875, 1.875, 0.875, 0.101, 0.375, 1.875, 0.101,
0.875, 0.375, 0.875, 0.875, 0.875, 0.101, 0.101, 0.375, 0.875, 0.875, 0.375,
1.875, 0.875, 1.875,
6 months ago
],
4 months ago
crcY: 0.125,
},
6 months ago
],
4 months ago
xData: [
'2024-03-16 12:01:17.0',
'2024-03-16 12:13:11.0',
'2024-03-16 12:20:12.0',
'2024-03-16 12:20:25.0',
'2024-03-16 12:21:27.0',
'2024-03-16 12:30:00.0',
'2024-03-16 12:30:27.0',
'2024-03-16 12:40:15.0',
'2024-03-16 12:43:10.0',
'2024-03-16 12:50:17.0',
'2024-03-16 16:13:11.0',
'2024-03-16 16:20:12.0',
'2024-03-16 16:30:00.0',
'2024-03-16 16:40:15.0',
'2024-03-16 16:43:10.0',
'2024-03-16 16:50:17.0',
'2024-03-16 17:20:25.0',
'2024-03-16 17:21:27.0',
'2024-03-16 17:30:27.0',
'2024-03-16 17:41:17.0',
'2024-03-17 12:01:17.0',
'2024-03-17 12:13:11.0',
'2024-03-17 12:20:12.0',
'2024-03-17 12:20:25.0',
'2024-03-17 12:21:27.0',
'2024-03-17 12:30:00.0',
'2024-03-17 12:30:27.0',
'2024-03-17 12:40:15.0',
'2024-03-17 12:43:10.0',
'2024-03-17 12:50:17.0',
'2024-03-17 16:13:11.0',
'2024-03-17 16:20:12.0',
'2024-03-17 16:30:00.0',
'2024-03-17 16:40:15.0',
'2024-03-17 16:43:10.0',
'2024-03-17 16:50:17.0',
'2024-03-17 17:20:25.0',
'2024-03-17 17:21:27.0',
'2024-03-17 17:30:27.0',
'2024-03-17 17:41:17.0',
'2024-03-18 12:01:17.0',
'2024-03-18 12:13:11.0',
'2024-03-18 12:20:12.0',
'2024-03-18 12:20:25.0',
'2024-03-18 12:21:27.0',
'2024-03-18 12:30:00.0',
'2024-03-18 12:30:27.0',
'2024-03-18 12:40:15.0',
'2024-03-18 12:43:10.0',
'2024-03-18 12:50:17.0',
'2024-03-18 16:13:11.0',
'2024-03-18 16:20:12.0',
'2024-03-18 16:30:00.0',
'2024-03-18 16:40:15.0',
'2024-03-18 16:43:10.0',
'2024-03-18 16:50:17.0',
'2024-03-18 17:20:25.0',
'2024-03-18 17:21:27.0',
'2024-03-18 17:30:27.0',
'2024-03-18 17:41:17.0',
'2024-03-19 12:01:17.0',
'2024-03-19 12:13:11.0',
'2024-03-19 12:20:12.0',
'2024-03-19 12:20:25.0',
'2024-03-19 12:21:27.0',
'2024-03-19 12:30:00.0',
'2024-03-19 12:30:27.0',
'2024-03-19 12:40:15.0',
'2024-03-19 12:43:10.0',
'2024-03-19 12:50:17.0',
'2024-03-19 16:13:11.0',
'2024-03-19 16:20:12.0',
'2024-03-19 16:30:00.0',
'2024-03-19 16:40:15.0',
'2024-03-19 16:43:10.0',
'2024-03-19 16:50:17.0',
'2024-03-19 17:20:25.0',
'2024-03-19 17:21:27.0',
'2024-03-19 17:30:27.0',
'2024-03-19 17:41:17.0',
6 months ago
],
4 months ago
crcX: 2,
};
6 months ago
this.$nextTick(() => {
4 months ago
this.setEchart(chartData);
});
6 months ago
}
4 months ago
});
6 months ago
},
setEchart(data) {
if (data.xData.length == 0 || data.yArray.length == 0) {
return this.$message.warning('暂无数据');
}
const chart = this.$echarts.init(this.$refs.historyCurve);
var colors = [
'#5793f3',
'#d14a61',
'#675bba',
'#C502F3',
'#0102F3',
'#FF2366',
'red',
'orange',
'green',
'blue',
'purple',
'pink',
'orange',
4 months ago
'blue',
6 months ago
];
const yAxis = [];
const series = [];
let offsetArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
const le = data.yArray.length;
if (le >= 1 && le <= 2) {
offsetArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else if (le >= 3 && le <= 4) {
offsetArr = [70, 70, 10, 10, 0, 0, 0, 0, 0, 0];
} else if (le >= 5 && le <= 6) {
offsetArr = [142, 142, 70, 70, 0, 0, 0, 0, 0, 0];
} else if (le >= 7 && le <= 8) {
offsetArr = [203, 203, 140, 140, 70, 70, 0, 0, 0, 0];
} else if (le >= 9 && le <= 10) {
offsetArr = [273, 273, 203, 203, 130, 130, 60, 60, 0, 0];
}
for (var index = 0; index < le; index++) {
if (index % 2 == 0) {
yAxis.push({
type: 'value',
name: data.yArray[index].showName,
position: 'left',
offset: offsetArr[le - index - 1],
axisLine: {
lineStyle: {
4 months ago
color: colors[index],
},
},
6 months ago
});
} else {
yAxis.push({
type: 'value',
name: data.yArray[index].showName,
position: 'right',
offset: offsetArr[le - index],
axisLine: {
lineStyle: {
4 months ago
color: colors[index],
},
},
6 months ago
});
}
series.push({
name: data.yArray[index].showName,
type: 'line',
smooth: true,
showSymbol: false,
yAxisIndex: index,
4 months ago
data: data.yArray[index].yData,
6 months ago
});
}
const option = {
color: colors,
toolbox: {
show: true,
right: '4%',
top: '-1%',
feature: {
4 months ago
saveAsImage: { show: true }, // 保存图表
},
6 months ago
},
tooltip: {
trigger: 'axis',
4 months ago
axisPointer: { type: 'cross' },
6 months ago
},
grid: {
top: '10%',
right: parseInt((le + 1) / 2) * 5 + '%',
4 months ago
left: parseInt((le + 1) / 2) * 5 + '%',
6 months ago
},
xAxis: [
{
type: 'category',
axisTick: {
4 months ago
alignWithLabel: true,
6 months ago
},
data: data.xData,
boundaryGap: false,
interval: 2, // 步长
axisLabel: {
formatter: function (value, index) {
if (data.crcX > 1) {
if (parseInt(index % data.crcX) == 0) {
return value;
} else {
return '';
}
}
return value;
},
4 months ago
rotate: 25,
},
},
6 months ago
],
yAxis: yAxis,
4 months ago
series: series,
6 months ago
};
// 使用制定的配置项和数据显示图表
chart.setOption(option, true);
// 图表自适应
window.addEventListener('resize', function () {
chart.resize();
});
},
4 months ago
getRecorder() {
getRecorderList({
current: this.page.currentPage,
size: this.page.pageSize,
}).then(res => {
this.data = res.data.data.records;
this.page.total = res.data.data.total;
});
},
6 months ago
// tab切换
6 months ago
tabPositionChange(val) {
4 months ago
this.option.column = recorderColumnData[val];
6 months ago
if (this.tabPosition == 'recorderLineSetting') {
4 months ago
this.option.addBtn = false;
6 months ago
this.data = [
{
4 months ago
code: '001',
crcId: 1,
crcX: 2,
crcY: 65.0,
keyValue: 1,
name: 'Var2',
showGraph: true,
showName: '温度',
6 months ago
},
{
4 months ago
code: '001',
crcId: 3,
crcX: 2,
crcY: 0.25,
keyValue: 3,
name: 'Var1',
showGraph: true,
showName: '压力',
6 months ago
},
{
4 months ago
code: '001',
crcId: 4,
crcX: 2,
crcY: 1.0,
keyValue: 4,
name: 'Var3',
showGraph: true,
showName: '低真空',
6 months ago
},
4 months ago
];
this.page.total = this.data.length;
6 months ago
} else if (this.tabPosition == 'recorder') {
4 months ago
this.getRecorder();
// this.option.addBtn = true
// this.data = [
// { crtCode: '001', memo: '' },
// { crtCode: '002', memo: '' },
// { crtCode: '003', memo: '' },
// ]
// this.page.total = this.data.length
6 months ago
}
6 months ago
},
6 months ago
insertEvent() {
const record = { _select: false };
4 months ago
this.settingData.push(record);
6 months ago
},
selectChange(list, row) {
4 months ago
row._select = !row._select;
},
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()
}
})
}
},
rowUpdate(row, index, done, loading){
console.log('row--------------',row)
console.log('tabPosition--------------',this.tabPosition)
if(this.tabPosition == "recorder"){
let params = {
id:row.id,
crtCode:row.crtCode,
memo:row.memo
}
console.log('params-----------',params)
updateRecorder(params).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.getRecorder()
}
})
}
6 months ago
},
remove() {
4 months ago
let arr = this.settingData.filter(item => item._select);
6 months ago
if (arr.length != 0) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
if (this.rowId) {
4 months ago
let deleteData = this.settingData.filter(item => item._select);
this.deleteTidArr = deleteData.filter(item => item.tidId);
6 months ago
}
4 months ago
let deleteArr = this.settingData.filter(item => !item._select);
this.settingData = deleteArr;
});
6 months ago
} else {
4 months ago
this.$message.error('请至少选择一条数据进行操作!');
6 months ago
}
},
handleSave() {
4 months ago
this.addDialog = false;
6 months ago
},
rowEdit(row, index) {
if (this.tabPosition == 'recorder') {
6 months ago
this.$refs.crud.rowEdit(row, index);
6 months ago
} else if (this.tabPosition == 'recorderLineSetting') {
4 months ago
this.addType = 'edit';
6 months ago
this.settingData = [
{
4 months ago
code: '001',
crcId: 1,
crcX: 2,
crcY: 65.0,
keyValue: 1,
name: 'Var2',
showGraph: true,
showName: '温度',
6 months ago
},
{
4 months ago
code: '001',
crcId: 3,
crcX: 2,
crcY: 0.25,
keyValue: 3,
name: 'Var1',
showGraph: true,
showName: '压力',
6 months ago
},
{
4 months ago
code: '001',
crcId: 4,
crcX: 2,
crcY: 1.0,
keyValue: 4,
name: 'Var3',
showGraph: true,
showName: '低真空',
6 months ago
},
{
4 months ago
code: '001',
crcId: 5,
crcX: 2,
crcY: 0.125,
keyValue: 5,
name: 'Var4',
showGraph: true,
showName: '高真空',
6 months ago
},
{
4 months ago
code: '001',
crcId: 49,
crcX: 2,
crcY: null,
keyValue: 49,
name: 'Var5',
showGraph: false,
showName: 'Var5',
},
];
this.addDialog = true;
6 months ago
}
6 months ago
},
showDetail(row) {
4 months ago
this.loadData();
this.detailDialog = true;
getRecorderDetail({id:row.id}).then(res =>{
console.log('res----------------',res)
})
6 months ago
},
6 months ago
setCycle() {
4 months ago
this.settingDialog = true;
6 months ago
},
6 months ago
handleAdd() {
4 months ago
this.addType = 'add';
this.addDialog = true;
6 months ago
},
4 months ago
deleteRow(row) {
6 months ago
this.$confirm('确定删除本条数据?', {
6 months ago
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
4 months ago
if(this.tabPosition == 'recorder'){
deleteRecorder({ids:row.id}).then(res => {
if(res.data.code == 200){
this.$message.success('删除成功')
this.getRecorder()
}
});
}
});
6 months ago
},
6 months ago
submitCycle() {
6 months ago
this.$refs.setForm.validate(valid => {
if (valid) {
4 months ago
console.log('set-------------',this.setForm)
// this.settingDialog = false;
addpackCycle(this.setForm).then(res => {
if(res.data.code == 200){
this.$message.success('保存成功')
this.settingDialog = false;
}
});
6 months ago
}
4 months ago
});
6 months ago
},
loadData() {
this.detailData = [
{ recorder: '1302022', recordDate: '2025-07-26 16:04:43' },
{ recorder: '1302022', recordDate: '2025-07-26 16:04:43' },
{ recorder: '1302022', recordDate: '2025-07-26 16:04:43' },
{ recorder: '1302022', recordDate: '2025-07-26 16:04:43' },
4 months ago
];
this.detailPage.total = this.detailData.length;
6 months ago
},
onLoad() {
this.data = [
{ crtCode: '001', memo: '' },
{ crtCode: '002', memo: '' },
{ crtCode: '003', memo: '' },
4 months ago
];
this.page.total = this.data.length;
},
},
};
</script>
6 months ago
<style></style>