| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="工位编号" prop="locationCode"> |
| | | <el-input |
| | | v-model="queryParams.locationCode" |
| | | placeholder="请输入工位编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="工位名称" prop="locationName"> |
| | | <el-input |
| | | v-model="queryParams.locationName" |
| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-form-item label="采集类型" prop="type"> |
| | | <el-input |
| | | v-model="queryParams.node" |
| | | placeholder="请输入采集类型" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item style="float: right" > |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <!-- <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>--> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="opcConfList" @selection-change="handleSelectionChange"> |
| | | <el-table v-loading="loading" border :data="opcConfList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主键id" align="center" prop="id" /> |
| | | <el-table-column label="工位编码" align="center" prop="locationCode" /> |
| | | <el-table-column label="工位名称" align="center" prop="locationName" /> |
| | | <el-table-column label="地址" align="center" prop="node" /> |
| | | <el-table-column label="采集类型" align="center" prop="type" /> |
| | | <el-table-column label="是否订阅" align="center" prop="subscribe" /> |
| | | <el-table-column label="是否订阅" align="center" prop="subscribe" > |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.subscribe"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | style="width: 72px" |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['sc:opcConf:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | style="width: 72px" |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['sc:opcConf:remove']" |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改OPC交互配置对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="工位编码" prop="locationCode"> |
| | | <el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" /> |
| | | <el-input v-model="form.locationCode" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="工位名称" prop="locationName"> |
| | | <el-input v-model="form.locationName" placeholder="请输入工位名称" /> |
| | |
| | | <el-form-item label="地址" prop="node"> |
| | | <el-input v-model="form.node" placeholder="请输入地址" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="删除标志" prop="delFlag">--> |
| | | <!-- <el-input v-model="form.delFlag" placeholder="请输入删除标志" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="采集类型" prop="type"> |
| | | <el-input v-model="form.type" placeholder="请输入采集类型" /> |
| | | </el-form-item> |
| | | <el-form-item label="是否订阅" prop="subscribe"> |
| | | <el-radio-group v-model="form.subscribe"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_yes_no" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | |
| | | |
| | | export default { |
| | | name: "OpcConf", |
| | | dicts: ['sys_yes_no'], |
| | | data() { |
| | | return { |
| | | advancedSearchVisible: false, |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | locationCode: [ |
| | | { required: true, message: "工位编码不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "总成序列号不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | locationName: [ |
| | | { required: true, message: "工位名称不能为空", trigger: "blur" }, |
| | | ], |
| | | node: [ |
| | | { required: true, message: "地址不能为空", trigger: "blur" }, |
| | | { pattern: /^[a-zA-Z0-9]*$/, message: "地址不能包含中文字符", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | toggleAdvancedSearch() { |
| | | this.advancedSearchVisible = !this.advancedSearchVisible; |
| | | |
| | | }, |
| | | /** 查询OPC交互配置列表 */ |
| | | getList() { |
| | | this.loading = true; |