第四轮:FlowInstance/FlowNodeLog 后端骨架 + WcsFlowLogController升级 + flowlog前端页面 + flowlog API

This commit is contained in:
root
2026-03-17 22:51:34 +08:00
parent 912944c0b2
commit 3de2294ead
73 changed files with 6494 additions and 2 deletions

View File

@@ -0,0 +1,347 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" prop="deviceId">
<el-select v-model="queryParams.deviceId" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸" clearable>
<el-option
v-for="item in deviceOptions"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId"
/>
</el-select>
</el-form-item>
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointCode">
<el-input
v-model="queryParams.pointCode"
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointName">
<el-input
v-model="queryParams.pointName"
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="״̬" prop="status">
<el-select v-model="queryParams.status" placeholder="<22><>λ״̬" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wcs:point:add']"
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wcs:point:edit']"
><EFBFBD>޸<EFBFBD></el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wcs:point:remove']"
>ɾ<EFBFBD><EFBFBD></el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="<22><>λID" align="center" prop="pointId" width="80" />
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" align="center" prop="deviceName" />
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointCode" />
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointName" />
<el-table-column label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" align="center" prop="pointType" />
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="dataType" />
<el-table-column label="<22><>ַ" align="center" prop="address" />
<el-table-column label="<22><>λ" align="center" prop="unit" width="80" />
<el-table-column label="״̬" align="center" prop="status" width="80">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width" width="160">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wcs:point:edit']"
><EFBFBD>޸<EFBFBD></el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wcs:point:remove']"
>ɾ<EFBFBD><EFBFBD></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- <EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><EFBFBD>޸ĵ<EFBFBD>λ<EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD> -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD>豸" prop="deviceId">
<el-select v-model="form.deviceId" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸">
<el-option
v-for="item in deviceOptions"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointCode">
<el-input v-model="form.pointCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointName">
<el-input v-model="form.pointName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>" prop="pointType">
<el-select v-model="form.pointType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>">
<el-option label="ֻ<><D6BB>" value="read" />
<el-option label="ֻд" value="write" />
<el-option label="<22><>д" value="read_write" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="dataType">
<el-select v-model="form.dataType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
<el-option label="<22><><EFBFBD><EFBFBD>" value="int" />
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="float" />
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="bool" />
<el-option label="<22>ַ<EFBFBD><D6B7><EFBFBD>" value="string" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="<22><>ַ" prop="address">
<el-input v-model="form.address" placeholder="<22>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ/OPC<50>ڵ<EFBFBD>" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="<22><>λ" prop="unit">
<el-input v-model="form.unit" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD>뵥λ" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="״̬" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="<22><>ע" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">ȷ <EFBFBD><EFBFBD></el-button>
<el-button @click="cancel">ȡ <EFBFBD><EFBFBD></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPoint, getPoint, addPoint, updatePoint, delPoint } from "@/api/wcs/point"
import { listDevice } from "@/api/wcs/device"
export default {
name: "WcsPoint",
dicts: ['sys_normal_disable'],
data() {
return {
loading: true,
ids: [],
single: true,
multiple: true,
showSearch: true,
total: 0,
pointList: [],
deviceOptions: [],
title: "",
open: false,
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: undefined,
pointCode: undefined,
pointName: undefined,
status: undefined
},
form: {},
rules: {
deviceId: [
{ required: true, message: "<22><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "change" }
],
pointCode: [
{ required: true, message: "<22><>λ<EFBFBD><CEBB><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
]
}
}
},
created() {
this.getList()
this.getDeviceOptions()
},
methods: {
getList() {
this.loading = true
listPoint(this.queryParams).then(response => {
this.pointList = response.rows
this.total = response.total
this.loading = false
})
},
getDeviceOptions() {
listDevice({ pageNum: 1, pageSize: 1000 }).then(response => {
this.deviceOptions = response.rows || []
})
},
cancel() {
this.open = false
this.reset()
},
reset() {
this.form = {
pointId: undefined,
deviceId: undefined,
pointCode: undefined,
pointName: undefined,
pointType: undefined,
dataType: undefined,
address: undefined,
unit: undefined,
status: "0",
remark: undefined
}
this.resetForm("form")
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
handleSelectionChange(selection) {
this.ids = selection.map(item => item.pointId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleAdd() {
this.reset()
this.open = true
this.title = "<22><><EFBFBD>ӵ<EFBFBD>λ"
},
handleUpdate(row) {
this.reset()
const pointId = row.pointId || this.ids
getPoint(pointId).then(response => {
this.form = response.data
this.open = true
this.title = "<22>޸ĵ<DEB8>λ"
})
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.pointId != undefined) {
updatePoint(this.form).then(() => {
this.$modal.msgSuccess("<22>޸ijɹ<C4B3>")
this.open = false
this.getList()
})
} else {
addPoint(this.form).then(() => {
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
this.open = false
this.getList()
})
}
}
})
},
handleDelete(row) {
const pointIds = row.pointId || this.ids
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ"' + pointIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
return delPoint(pointIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
}).catch(() => {})
}
}
}
</script>