Browse Source

rev:更新

mqtt
gengby 4 months ago
parent
commit
b489456a32
  1. 20
      acs/nladmin-ui/src/views/acs/device/config.vue
  2. 86
      acs/nladmin-ui/src/views/acs/device/opc/index.vue

20
acs/nladmin-ui/src/views/acs/device/config.vue

@ -22,13 +22,13 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<span style="color: #C0C0C0;margin-left: 10px;"/> <span style="color: #C0C0C0;margin-left: 10px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备编号" prop="device_code"> <el-form-item label="设备编号" prop="device_code">
<el-input v-model="form.device_code" disabled/> <el-input v-model="form.device_code" disabled />
<span style="color: #C0C0C0;margin-left: 10px;"/> <span style="color: #C0C0C0;margin-left: 10px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -36,8 +36,8 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备名称" prop="device_name"> <el-form-item label="设备名称" prop="device_name">
<el-input v-model="form.device_name" disabled/> <el-input v-model="form.device_name" disabled />
<span style="color: #C0C0C0;margin-left: 10px;"/> <span style="color: #C0C0C0;margin-left: 10px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -63,7 +63,7 @@
</el-col> </el-col>
<!-- 组件--> <!-- 组件-->
<component :is="currentComponent" :parent-form="form"/> <component :is="currentComponent" :parent-form="form" />
</el-row> </el-row>
</div> </div>
@ -71,8 +71,8 @@
<script> <script>
import crud from '@/mixins/crud' import crud from '@/mixins/crud'
import {get, selectDriverCodeList} from '@/api/acs/device/driverConfig' import { get, selectDriverCodeList } from '@/api/acs/device/driverConfig'
import {getDicts} from '@/api/system/dict' import { getDicts } from '@/api/system/dict'
import standard_inspect_site from './driver/standard_inspect_site' import standard_inspect_site from './driver/standard_inspect_site'
import standard_ordinary_site from './driver/standard_ordinary_site' import standard_ordinary_site from './driver/standard_ordinary_site'
import lamp_three_color from './driver/lamp_three_color' import lamp_three_color from './driver/lamp_three_color'
@ -161,11 +161,11 @@ export default {
dicts: [], dicts: [],
syncLoading: false, syncLoading: false,
genLoading: false, genLoading: false,
form: {id: null, device_name: '', device_type: '', name: '', code: '', driver_code: ''}, form: { id: null, device_name: '', device_type: '', name: '', code: '', driver_code: '' },
deviceDriverList: [], deviceDriverList: [],
rules: { rules: {
driver_code: [ driver_code: [
{required: true, message: '设备驱动不能为空', trigger: 'blur'} { required: true, message: '设备驱动不能为空', trigger: 'blur' }
] ]
} }
} }

86
acs/nladmin-ui/src/views/acs/device/opc/index.vue

@ -14,9 +14,9 @@
class="filter-item" class="filter-item"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
<rrOperation/> <rrOperation />
</div> </div>
<crudOperation :permission="permission"/> <crudOperation :permission="permission" />
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
@ -27,35 +27,35 @@
> >
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="OPC编码" prop="opc_code"> <el-form-item label="OPC编码" prop="opc_code">
<el-input v-model="form.opc_code" style="width: 370px;"/> <el-input v-model="form.opc_code" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="OPC名称" prop="opc_name"> <el-form-item label="OPC名称" prop="opc_name">
<el-input v-model="form.opc_name" style="width: 370px;"/> <el-input v-model="form.opc_name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="OPC地址"> <el-form-item label="OPC地址">
<el-input v-model="form.opc_host" style="width: 370px;"/> <el-input v-model="form.opc_host" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="订阅主题"> <el-form-item label="订阅主题">
<el-input v-model="form.topic" style="width: 370px;"/> <el-input v-model="form.topic" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="用户名"> <el-form-item label="用户名">
<el-input v-model="form.user" style="width: 370px;"/> <el-input v-model="form.user" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="form.password" style="width: 370px;" type="password"/> <el-input v-model="form.password" style="width: 370px;" type="password" />
<el-button :loading="crud.cu === 2" type="primary" @click="getDetail()">详情</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="getDetail()">详情</el-button>
</el-form-item> </el-form-item>
<el-form-item label="程序ID"> <el-form-item label="程序ID">
<el-input v-model="form.prog_id" style="width: 370px;"/> <el-input v-model="form.prog_id" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="注册表ID"> <el-form-item label="注册表ID">
<el-input v-model="form.cls_id" style="width: 370px;"/> <el-input v-model="form.cls_id" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="domain"> <el-form-item label="domain">
<el-input v-model="form.domain" style="width: 370px;"/> <el-input v-model="form.domain" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea"/> <el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -66,18 +66,18 @@
<el-dialog title="PLC管理" :visible.sync="dialogPlcFormVisible" width="550px"> <el-dialog title="PLC管理" :visible.sync="dialogPlcFormVisible" width="550px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-input v-model="form.opc_server_id" type="hidden" prop="opc_server_id"/> <el-input v-model="form.opc_server_id" type="hidden" prop="opc_server_id" />
<el-form-item label="PLC编码" prop="plc_code"> <el-form-item label="PLC编码" prop="plc_code">
<el-input v-model="form.plc_code" style="width: 370px;"/> <el-input v-model="form.plc_code" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="OPC名称" prop="plc_opc_name"> <el-form-item label="OPC名称" prop="plc_opc_name">
<el-input v-model="form.plc_opc_name" style="width: 370px;" disabled/> <el-input v-model="form.plc_opc_name" style="width: 370px;" disabled />
</el-form-item> </el-form-item>
<el-form-item label="PLC名称" prop="plc_name"> <el-form-item label="PLC名称" prop="plc_name">
<el-input v-model="form.plc_name" style="width: 370px;"/> <el-input v-model="form.plc_name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="PLC地址" prop="plc_host"> <el-form-item label="PLC地址" prop="plc_host">
<el-input v-model="form.plc_host" style="width: 370px;"/> <el-input v-model="form.plc_host" style="width: 370px;" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -100,19 +100,19 @@
@select-all="crud.selectAllChange" @select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55" />
<el-table-column prop="opc_code" label="OPC编码" width="100"/> <el-table-column prop="opc_code" label="OPC编码" width="100" />
<el-table-column prop="opc_name" label="OPC名称"/> <el-table-column prop="opc_name" label="OPC名称" />
<el-table-column prop="opc_host" label="OPC地址" min-width="130"/> <el-table-column prop="opc_host" label="OPC地址" min-width="130" />
<el-table-column prop="topic" label="订阅主题" min-width="130"/> <el-table-column prop="topic" label="订阅主题" min-width="130" />
<el-table-column prop="type" label="类型"/> <el-table-column prop="type" label="类型" />
<el-table-column prop="user" label="用户名" min-width="100"/> <el-table-column prop="user" label="用户名" min-width="100" />
<el-table-column prop="password" label="密码"/> <el-table-column prop="password" label="密码" />
<el-table-column prop="prog_id" label="程序ID" min-width="150"/> <el-table-column prop="prog_id" label="程序ID" min-width="150" />
<el-table-column prop="cls_id" label="注册表ID" min-width="150"/> <el-table-column prop="cls_id" label="注册表ID" min-width="150" />
<el-table-column prop="domain" label="domain"/> <el-table-column prop="domain" label="domain" />
<el-table-column prop="remark" label="备注" min-width="100"/> <el-table-column prop="remark" label="备注" min-width="100" />
<el-table-column prop="createtime" label="创建时间"/> <el-table-column prop="createtime" label="创建时间" />
<el-table-column label="操作" width="200px" align="center" fixed="right"> <el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="handleClick(scope.row,'1')">修改</el-button> <el-button type="text" size="small" @click="handleClick(scope.row,'1')">修改</el-button>
@ -124,14 +124,14 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination/> <pagination />
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import crudOpc from '@/api/acs/device/opc' import crudOpc from '@/api/acs/device/opc'
import CRUD, {crud, form, header, presenter} from '@crud/crud' import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
@ -163,11 +163,11 @@ const defaultForm = {
} }
export default { export default {
name: 'Opc', name: 'Opc',
components: {pagination, crudOperation, rrOperation}, components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
title: 'opc', url: 'api/opc', idField: 'opc_id', sort: 'opc_id,desc', crudMethod: {...crudOpc}, title: 'opc', url: 'api/opc', idField: 'opc_id', sort: 'opc_id,desc', crudMethod: { ...crudOpc },
optShow: { optShow: {
add: true, add: true,
edit: false, edit: false,
@ -187,28 +187,28 @@ export default {
}, },
rules: { rules: {
opc_id: [ opc_id: [
{required: true, message: 'OPC标识不能为空', trigger: 'blur'} { required: true, message: 'OPC标识不能为空', trigger: 'blur' }
], ],
opc_code: [ opc_code: [
{required: true, message: 'OPC编码不能为空', trigger: 'blur'} { required: true, message: 'OPC编码不能为空', trigger: 'blur' }
], ],
opc_name: [ opc_name: [
{required: true, message: 'OPC名称不能为空', trigger: 'blur'} { required: true, message: 'OPC名称不能为空', trigger: 'blur' }
], ],
password: [ password: [
{required: true, message: '密码不能为空', trigger: 'blur'} { required: true, message: '密码不能为空', trigger: 'blur' }
], ],
is_active: [ is_active: [
{required: true, message: '是否启用不能为空', trigger: 'blur'} { required: true, message: '是否启用不能为空', trigger: 'blur' }
], ],
is_delete: [ is_delete: [
{required: true, message: '是否删除不能为空', trigger: 'blur'} { required: true, message: '是否删除不能为空', trigger: 'blur' }
], ],
create_by: [ create_by: [
{required: true, message: '创建者不能为空', trigger: 'blur'} { required: true, message: '创建者不能为空', trigger: 'blur' }
], ],
create_time: [ create_time: [
{required: true, message: '创建时间不能为空', trigger: 'blur'} { required: true, message: '创建时间不能为空', trigger: 'blur' }
] ]
} }
} }
@ -269,7 +269,7 @@ export default {
}, },
getDetail() { getDetail() {
const _this = this const _this = this
this.crud.crudMethod.getmeteal(this.form).then(function (response) { this.crud.crudMethod.getmeteal(this.form).then(function(response) {
_this.form.cls_id = response.classId _this.form.cls_id = response.classId
_this.form.prog_id = response.progId _this.form.prog_id = response.progId
_this.form.remark = response.description _this.form.remark = response.description

Loading…
Cancel
Save