第四轮:FlowInstance/FlowNodeLog 后端骨架 + WcsFlowLogController升级 + flowlog前端页面 + flowlog API
This commit is contained in:
39
ruoyi-ui/src/api/wcs/apiconfig.js
Normal file
39
ruoyi-ui/src/api/wcs/apiconfig.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listApiConfig(query) {
|
||||
return request({
|
||||
url: '/wcs/api/config/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getApiConfig(apiId) {
|
||||
return request({
|
||||
url: '/wcs/api/config/' + apiId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addApiConfig(data) {
|
||||
return request({
|
||||
url: '/wcs/api/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateApiConfig(data) {
|
||||
return request({
|
||||
url: '/wcs/api/config',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delApiConfig(apiId) {
|
||||
return request({
|
||||
url: '/wcs/api/config/' + apiId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
39
ruoyi-ui/src/api/wcs/device.js
Normal file
39
ruoyi-ui/src/api/wcs/device.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listDevice(query) {
|
||||
return request({
|
||||
url: '/wcs/device/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getDevice(deviceId) {
|
||||
return request({
|
||||
url: '/wcs/device/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevice(data) {
|
||||
return request({
|
||||
url: '/wcs/device',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateDevice(data) {
|
||||
return request({
|
||||
url: '/wcs/device',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delDevice(deviceId) {
|
||||
return request({
|
||||
url: '/wcs/device/' + deviceId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
55
ruoyi-ui/src/api/wcs/flow.js
Normal file
55
ruoyi-ui/src/api/wcs/flow.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listFlowDef(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getFlowDef(flowId) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/' + flowId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addFlowDef(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/def',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateFlowDef(data) {
|
||||
return request({
|
||||
url: '/wcs/flow/def',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delFlowDef(flowId) {
|
||||
return request({
|
||||
url: '/wcs/flow/def/' + flowId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listFlowInstance(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/instance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function listFlowLog(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
26
ruoyi-ui/src/api/wcs/flowlog.js
Normal file
26
ruoyi-ui/src/api/wcs/flowlog.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程节点日志列表
|
||||
export function listFlowLog(query) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程节点日志详细
|
||||
export function getFlowLog(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程节点日志
|
||||
export function delFlowLog(id) {
|
||||
return request({
|
||||
url: '/wcs/flow/log/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
39
ruoyi-ui/src/api/wcs/point.js
Normal file
39
ruoyi-ui/src/api/wcs/point.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listPoint(query) {
|
||||
return request({
|
||||
url: '/wcs/device/point/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getPoint(pointId) {
|
||||
return request({
|
||||
url: '/wcs/device/point/' + pointId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addPoint(data) {
|
||||
return request({
|
||||
url: '/wcs/device/point',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePoint(data) {
|
||||
return request({
|
||||
url: '/wcs/device/point',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delPoint(pointId) {
|
||||
return request({
|
||||
url: '/wcs/device/point/' + pointId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
400
ruoyi-ui/src/views/wcs/apiconfig/index.vue
Normal file
400
ruoyi-ui/src/views/wcs/apiconfig/index.vue
Normal file
@@ -0,0 +1,400 @@
|
||||
<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>ӿڱ<D3BF><DAB1><EFBFBD>" prop="apiCode">
|
||||
<el-input
|
||||
v-model="queryParams.apiCode"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" prop="apiName">
|
||||
<el-input
|
||||
v-model="queryParams.apiName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" prop="requestMethod">
|
||||
<el-select v-model="queryParams.requestMethod" placeholder="<22><>ѡ<EFBFBD><D1A1>" clearable>
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>" prop="direction">
|
||||
<el-select v-model="queryParams.direction" placeholder="<22><>ѡ<EFBFBD><D1A1>" clearable>
|
||||
<el-option label="<22><>վ" value="inbound" />
|
||||
<el-option label="<22><>վ" value="outbound" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="<22>ӿ<EFBFBD>״̬" 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:api: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:api: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:api:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:api:export']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="apiList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="<22>ӿ<EFBFBD>ID" align="center" prop="apiId" width="70" />
|
||||
<el-table-column label="<22>ӿڱ<D3BF><DAB1><EFBFBD>" align="center" prop="apiCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="apiName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22>ӿڵ<D3BF>ַ" align="center" prop="apiUrl" :show-overflow-tooltip="true" min-width="180" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" align="center" prop="requestMethod" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="methodTagType(scope.row.requestMethod)" size="small">{{ scope.row.requestMethod }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" prop="direction" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.direction === 'inbound'"><EFBFBD><EFBFBD>վ</span>
|
||||
<span v-else-if="scope.row.direction === 'outbound'"><EFBFBD><EFBFBD>վ</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ʱ(ms)" align="center" prop="timeout" width="90" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" prop="retryCount" width="60" />
|
||||
<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:api:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:api: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><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="650px" 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>ӿڱ<D3BF><DAB1><EFBFBD>" prop="apiCode">
|
||||
<el-input v-model="form.apiCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" prop="apiName">
|
||||
<el-input v-model="form.apiName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="<22>ӿڵ<D3BF>ַ" prop="apiUrl">
|
||||
<el-input v-model="form.apiUrl" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڵ<D3BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD> http://wms-server/api/task" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ" prop="requestMethod">
|
||||
<el-select v-model="form.requestMethod" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="contentType">
|
||||
<el-select v-model="form.contentType" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="application/json" value="application/json" />
|
||||
<el-option label="application/xml" value="application/xml" />
|
||||
<el-option label="application/x-www-form-urlencoded" value="application/x-www-form-urlencoded" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>" prop="direction">
|
||||
<el-select v-model="form.direction" placeholder="<22><>ѡ<EFBFBD><D1A1>">
|
||||
<el-option label="<22><>վ" value="inbound" />
|
||||
<el-option label="<22><>վ" value="outbound" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><>ʱ(ms)" prop="timeout">
|
||||
<el-input-number v-model="form.timeout" controls-position="right" :min="1000" :max="300000" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="<22><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>" prop="retryCount">
|
||||
<el-input-number v-model="form.retryCount" controls-position="right" :min="0" :max="10" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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 { listApiConfig, getApiConfig, addApiConfig, updateApiConfig, delApiConfig } from "@/api/wcs/apiconfig"
|
||||
|
||||
export default {
|
||||
name: "WcsApiConfig",
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
// <20><><EFBFBD>ֲ<EFBFBD>
|
||||
loading: true,
|
||||
// ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ids: [],
|
||||
// <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
single: true,
|
||||
// <20>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
multiple: true,
|
||||
// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
showSearch: true,
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
total: 0,
|
||||
// <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
apiList: [],
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
title: "",
|
||||
// <20>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
open: false,
|
||||
// <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
apiCode: undefined,
|
||||
apiName: undefined,
|
||||
requestMethod: undefined,
|
||||
direction: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
form: {},
|
||||
// <20><><EFBFBD><EFBFBD>У<EFBFBD><D0A3>
|
||||
rules: {
|
||||
apiCode: [
|
||||
{ required: true, message: "<22>ӿڱ<D3BF><DAB1>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
apiName: [
|
||||
{ required: true, message: "<22>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
apiUrl: [
|
||||
{ required: true, message: "<22>ӿڵ<D3BF>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** <20><>ѯ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listApiConfig(this.queryParams).then(response => {
|
||||
this.apiList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ǩ<EFBFBD><C7A9>ɫ
|
||||
methodTagType(method) {
|
||||
const map = { GET: '', POST: 'success', PUT: 'warning', DELETE: 'danger' }
|
||||
return map[method] || 'info'
|
||||
},
|
||||
// ȡ<><C8A1><EFBFBD><EFBFBD>ť
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
reset() {
|
||||
this.form = {
|
||||
apiId: undefined,
|
||||
apiCode: undefined,
|
||||
apiName: undefined,
|
||||
apiUrl: undefined,
|
||||
requestMethod: "POST",
|
||||
contentType: "application/json",
|
||||
timeout: 30000,
|
||||
retryCount: 0,
|
||||
direction: undefined,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** <20><><EFBFBD>ð<EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// <20><>ѡ<EFBFBD><D1A1>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.apiId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD>ӽӿ<D3BD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
},
|
||||
/** <20>İ<DEB8>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const apiId = row.apiId || this.ids
|
||||
getApiConfig(apiId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22>Ľӿ<C4BD><D3BF><EFBFBD><EFBFBD><EFBFBD>"
|
||||
})
|
||||
},
|
||||
/** <20>ύ<EFBFBD><E1BDBB>ť */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.apiId != undefined) {
|
||||
updateApiConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addApiConfig(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** ɾ<><C9BE><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleDelete(row) {
|
||||
const apiIds = row.apiId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD>ӿڱ<D3BF><DAB1><EFBFBD>Ϊ"' + apiIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delApiConfig(apiIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD> */
|
||||
handleExport() {
|
||||
this.download('wcs/api/config/export', {
|
||||
...this.queryParams
|
||||
}, `apiconfig_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
330
ruoyi-ui/src/views/wcs/device/index.vue
Normal file
330
ruoyi-ui/src/views/wcs/device/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<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><E8B1B8><EFBFBD><EFBFBD>" prop="deviceCode">
|
||||
<el-input
|
||||
v-model="queryParams.deviceCode"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceType">
|
||||
<el-select v-model="queryParams.deviceType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" clearable>
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="conveyor" />
|
||||
<el-option label="AGV" value="agv" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="elevator" />
|
||||
<el-option label="<22>Ѷ<EFBFBD><D1B6><EFBFBD>" value="stacker" />
|
||||
</el-select>
|
||||
</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:device: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:device: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:device:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="<22>豸ID" align="center" prop="deviceId" width="80" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceCode" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceName" />
|
||||
<el-table-column label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" align="center" prop="deviceType" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="areaCode" />
|
||||
<el-table-column label="ͨ<><CDA8>Э<EFBFBD><D0AD>" align="center" prop="protocolType" />
|
||||
<el-table-column label="IP<49><50>ַ" align="center" prop="ipAddress" />
|
||||
<el-table-column label="<22>˿<EFBFBD>" align="center" prop="port" 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:device:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:device: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><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><E8B1B8><EFBFBD><EFBFBD>" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>" prop="deviceType">
|
||||
<el-select v-model="form.deviceType" placeholder="<22><>ѡ<EFBFBD><D1A1><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>">
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="conveyor" />
|
||||
<el-option label="AGV" value="agv" />
|
||||
<el-option label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" value="elevator" />
|
||||
<el-option label="<22>Ѷ<EFBFBD><D1B6><EFBFBD>" value="stacker" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="areaCode">
|
||||
<el-input v-model="form.areaCode" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="ͨ<><CDA8>Э<EFBFBD><D0AD>" prop="protocolType">
|
||||
<el-select v-model="form.protocolType" placeholder="<22><>ѡ<EFBFBD><D1A1>ͨ<EFBFBD><CDA8>Э<EFBFBD><D0AD>">
|
||||
<el-option label="Modbus TCP" value="modbus_tcp" />
|
||||
<el-option label="OPC UA" value="opc_ua" />
|
||||
<el-option label="S7" value="s7" />
|
||||
</el-select>
|
||||
</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-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IP<49><50>ַ" prop="ipAddress">
|
||||
<el-input v-model="form.ipAddress" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49><50>ַ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="<22>˿<EFBFBD>" prop="port">
|
||||
<el-input-number v-model="form.port" controls-position="right" :min="1" :max="65535" />
|
||||
</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 { listDevice, getDevice, addDevice, updateDevice, delDevice } from "@/api/wcs/device"
|
||||
|
||||
export default {
|
||||
name: "WcsDevice",
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
deviceList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceCode: undefined,
|
||||
deviceName: undefined,
|
||||
deviceType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
deviceCode: [
|
||||
{ required: true, message: "<22>豸<EFBFBD><E8B1B8><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
deviceName: [
|
||||
{ required: true, message: "<22>豸<EFBFBD><E8B1B8><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listDevice(this.queryParams).then(response => {
|
||||
this.deviceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
deviceId: undefined,
|
||||
deviceCode: undefined,
|
||||
deviceName: undefined,
|
||||
deviceType: undefined,
|
||||
areaCode: undefined,
|
||||
protocolType: undefined,
|
||||
ipAddress: undefined,
|
||||
port: 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.deviceId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD><EFBFBD><EFBFBD>豸"
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const deviceId = row.deviceId || this.ids
|
||||
getDevice(deviceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22><EFBFBD><DEB8>豸"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.deviceId != undefined) {
|
||||
updateDevice(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addDevice(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const deviceIds = row.deviceId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>Ϊ"' + deviceIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delDevice(deviceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
353
ruoyi-ui/src/views/wcs/flowdef/index.vue
Normal file
353
ruoyi-ui/src/views/wcs/flowdef/index.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<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="流程编码" prop="flowCode">
|
||||
<el-input
|
||||
v-model="queryParams.flowCode"
|
||||
placeholder="请输入流程编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
<el-input
|
||||
v-model="queryParams.flowName"
|
||||
placeholder="请输入流程名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程类型" prop="flowType">
|
||||
<el-select v-model="queryParams.flowType" placeholder="请选择流程类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_status"
|
||||
: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">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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:flow:add']"
|
||||
>新增</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:flow:edit']"
|
||||
>修改</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:flow:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flow:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="flowList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="流程ID" align="center" prop="flowId" width="70" />
|
||||
<el-table-column label="流程编码" align="center" prop="flowCode" />
|
||||
<el-table-column label="流程名称" align="center" prop="flowName" />
|
||||
<el-table-column label="流程类型" align="center" prop="flowType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wcs_flow_type" :value="scope.row.flowType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本" align="center" prop="version" width="70" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wcs_flow_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:flow:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flow:remove']"
|
||||
>删除</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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改流程定义对话框 -->
|
||||
<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="流程编码" prop="flowCode">
|
||||
<el-input v-model="form.flowCode" placeholder="请输入流程编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流程名称" prop="flowName">
|
||||
<el-input v-model="form.flowName" placeholder="请输入流程名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="流程类型" prop="flowType">
|
||||
<el-select v-model="form.flowType" placeholder="请选择流程类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.wcs_flow_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input-number v-model="form.version" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.wcs_flow_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFlowDef, getFlowDef, addFlowDef, updateFlowDef, delFlowDef } from "@/api/wcs/flow"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowDef",
|
||||
dicts: ['wcs_flow_type', 'wcs_flow_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 流程定义表格数据
|
||||
flowList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
flowCode: undefined,
|
||||
flowName: undefined,
|
||||
flowType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
flowCode: [
|
||||
{ required: true, message: "流程编码不能为空", trigger: "blur" }
|
||||
],
|
||||
flowName: [
|
||||
{ required: true, message: "流程名称不能为空", trigger: "blur" }
|
||||
],
|
||||
flowType: [
|
||||
{ required: true, message: "流程类型不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowDef(this.queryParams).then(response => {
|
||||
this.flowList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
flowId: undefined,
|
||||
flowCode: undefined,
|
||||
flowName: undefined,
|
||||
flowType: undefined,
|
||||
version: 1,
|
||||
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.flowId)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加流程定义"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const flowId = row.flowId || this.ids
|
||||
getFlowDef(flowId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改流程定义"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.flowId != undefined) {
|
||||
updateFlowDef(this.form).then(() => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addFlowDef(this.form).then(() => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const flowIds = row.flowId || this.ids
|
||||
this.$modal.confirm('是否确认删除流程定义编号为"' + flowIds + '"的数据项?').then(function() {
|
||||
return delFlowDef(flowIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wcs/flow/def/export', {
|
||||
...this.queryParams
|
||||
}, `flowdef_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
304
ruoyi-ui/src/views/wcs/flowinstance/index.vue
Normal file
304
ruoyi-ui/src/views/wcs/flowinstance/index.vue
Normal file
@@ -0,0 +1,304 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="processDefName">
|
||||
<el-input
|
||||
v-model="queryParams.processDefName"
|
||||
placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="ʵ<><CAB5>״̬" clearable>
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
: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:flowinstance: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:flowinstance: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:flowinstance:remove']"
|
||||
>ɾ<EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flowinstance:export']"
|
||||
><EFBFBD><EFBFBD><EFBFBD><EFBFBD></el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="instanceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ʵ<><CAB5>ID" align="center" prop="instanceId" />
|
||||
<el-table-column label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" align="center" prop="processDefName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="״̬" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ʼʱ<CABC><CAB1>" align="center" prop="startTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" align="center" prop="endTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="<22><>ע" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="<22><><EFBFBD><EFBFBD>" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wcs:flowinstance:edit']"
|
||||
><EFBFBD><EFBFBD></el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flowinstance: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>ʵ<EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><EFBFBD><EFBFBD> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||
<el-form-item label="<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" prop="processDefName">
|
||||
<el-input v-model="form.processDefName" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</el-form-item>
|
||||
<el-form-item label="״̬" prop="status">
|
||||
<el-select v-model="form.status" placeholder="<22><>ѡ<EFBFBD><D1A1>״̬">
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><>ʼʱ<CABC><CAB1>" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
placeholder="ѡ<><D1A1><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1>"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
placeholder="ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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 { listFlowInstance, getFlowInstance, delFlowInstance, addFlowInstance, updateFlowInstance } from "@/api/wcs/flowinstance"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowInstance",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
instanceList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
statusOptions: [
|
||||
{ value: "0", label: "<22><>ִ<EFBFBD><D6B4>" },
|
||||
{ value: "1", label: "ִ<><D6B4><EFBFBD><EFBFBD>" },
|
||||
{ value: "2", label: "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" },
|
||||
{ value: "3", label: "<22>쳣<EFBFBD><ECB3A3>ֹ" }
|
||||
],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processDefName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
processDefName: [
|
||||
{ required: true, message: "<22><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "״̬<D7B4><CCAC><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>", trigger: "change" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowInstance(this.queryParams).then(response => {
|
||||
this.instanceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
statusLabel(status) {
|
||||
const map = { "0": "<22><>ִ<EFBFBD><D6B4>", "1": "ִ<><D6B4><EFBFBD><EFBFBD>", "2": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "3": "<22>쳣<EFBFBD><ECB3A3>ֹ" }
|
||||
return map[status] || "δ֪"
|
||||
},
|
||||
statusTagType(status) {
|
||||
const map = { "0": "info", "1": "", "2": "success", "3": "danger" }
|
||||
return map[status] || "info"
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
instanceId: undefined,
|
||||
processDefName: undefined,
|
||||
status: "0",
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
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.instanceId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>"
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const instanceId = row.instanceId || this.ids
|
||||
getFlowInstance(instanceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "<22><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.instanceId != undefined) {
|
||||
updateFlowInstance(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22>ijɹ<C4B3>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addFlowInstance(this.form).then(() => {
|
||||
this.$modal.msgSuccess("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const instanceIds = row.instanceId || this.ids
|
||||
this.$modal.confirm('<27>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE>ʵ<EFBFBD><CAB5>IDΪ"' + instanceIds + '"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').then(function() {
|
||||
return delFlowInstance(instanceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>")
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleExport() {
|
||||
this.download('wcs/flowinstance/export', {
|
||||
...this.queryParams
|
||||
}, `flowinstance_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
263
ruoyi-ui/src/views/wcs/flowlog/index.vue
Normal file
263
ruoyi-ui/src/views/wcs/flowlog/index.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="实例ID" prop="instanceId">
|
||||
<el-input
|
||||
v-model="queryParams.instanceId"
|
||||
placeholder="请输入实例ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="节点类型" prop="nodeType">
|
||||
<el-select v-model="queryParams.nodeType" placeholder="请选择" clearable>
|
||||
<el-option label="开始" value="start" />
|
||||
<el-option label="API调用" value="api" />
|
||||
<el-option label="PLC读写" value="plc" />
|
||||
<el-option label="条件判断" value="condition" />
|
||||
<el-option label="等待" value="wait" />
|
||||
<el-option label="结束" value="end" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
||||
<el-option label="待执行" value="0" />
|
||||
<el-option label="执行中" value="1" />
|
||||
<el-option label="成功" value="2" />
|
||||
<el-option label="失败" value="3" />
|
||||
<el-option label="跳过" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wcs:flowlog:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wcs:flowlog:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="日志ID" align="center" prop="id" width="70" />
|
||||
<el-table-column label="实例ID" align="center" prop="instanceId" width="80" />
|
||||
<el-table-column label="节点ID" align="center" prop="nodeId" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="节点类型" align="center" prop="nodeType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="nodeTypeTag(scope.row.nodeType)" size="small">{{ nodeTypeLabel(scope.row.nodeType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="small">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="错误信息" align="center" prop="errorMsg" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wcs:flowlog:remove']"
|
||||
>删除</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"
|
||||
/>
|
||||
|
||||
<!-- 日志详情对话框 -->
|
||||
<el-dialog title="日志详情" :visible.sync="openView" width="700px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="日志ID">{{ viewForm.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实例ID">{{ viewForm.instanceId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="节点ID">{{ viewForm.nodeId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="节点类型">{{ nodeTypeLabel(viewForm.nodeType) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">{{ statusLabel(viewForm.status) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{ parseTime(viewForm.startTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{ parseTime(viewForm.endTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ parseTime(viewForm.createTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider content-position="left">输入参数</el-divider>
|
||||
<pre class="log-content">{{ viewForm.input || '无' }}</pre>
|
||||
<el-divider content-position="left">输出结果</el-divider>
|
||||
<pre class="log-content">{{ viewForm.output || '无' }}</pre>
|
||||
<el-divider content-position="left" v-if="viewForm.errorMsg">错误信息</el-divider>
|
||||
<pre class="log-content log-error" v-if="viewForm.errorMsg">{{ viewForm.errorMsg }}</pre>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="openView = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFlowLog, getFlowLog, delFlowLog } from "@/api/wcs/flowlog"
|
||||
|
||||
export default {
|
||||
name: "WcsFlowLog",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 日志表格数据
|
||||
logList: [],
|
||||
// 详情弹出层
|
||||
openView: false,
|
||||
// 详情表单
|
||||
viewForm: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
instanceId: undefined,
|
||||
nodeType: undefined,
|
||||
status: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询日志列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listFlowLog(this.queryParams).then(response => {
|
||||
this.logList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 节点类型标签 */
|
||||
nodeTypeLabel(type) {
|
||||
const map = { start: '开始', api: 'API调用', plc: 'PLC读写', condition: '条件判断', wait: '等待', end: '结束' }
|
||||
return map[type] || type || '-'
|
||||
},
|
||||
/** 节点类型标签颜色 */
|
||||
nodeTypeTag(type) {
|
||||
const map = { start: '', api: 'success', plc: 'warning', condition: 'info', wait: '', end: 'info' }
|
||||
return map[type] || ''
|
||||
},
|
||||
/** 状态标签 */
|
||||
statusLabel(status) {
|
||||
const map = { '0': '待执行', '1': '执行中', '2': '成功', '3': '失败', '4': '跳过' }
|
||||
return map[status] || '未知'
|
||||
},
|
||||
/** 状态标签颜色 */
|
||||
statusTagType(status) {
|
||||
const map = { '0': 'info', '1': '', '2': 'success', '3': 'danger', '4': 'warning' }
|
||||
return map[status] || 'info'
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
getFlowLog(row.id).then(response => {
|
||||
this.viewForm = response.data
|
||||
this.openView = true
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const logIds = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除日志ID为"' + logIds + '"的数据项?').then(function() {
|
||||
return delFlowLog(logIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wcs/flow/log/export', {
|
||||
...this.queryParams
|
||||
}, `flowlog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.log-content {
|
||||
background: #f5f7fa;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
.log-error {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
}
|
||||
</style>
|
||||
347
ruoyi-ui/src/views/wcs/point/index.vue
Normal file
347
ruoyi-ui/src/views/wcs/point/index.vue
Normal 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>
|
||||
Reference in New Issue
Block a user