BOM
hdy
2024-11-26 f47bd7409609995c7eebb81a0b92b6e4aff0bdbf
billion-ui/src/views/main/sc/opcConf/index.vue
@@ -26,12 +26,24 @@
        />
      </el-form-item>
      <el-form-item label="采集类型" prop="type">
        <el-input
          v-model="queryParams.node"
          placeholder="请输入采集类型"
          clearable
          @keyup.enter.native="handleQuery"
        <el-select v-model="queryParams.type" placeholder="请选择订阅状态" clearable>
          <el-option
            v-for="dict in dict.type.collection_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
        />
        </el-select>
      </el-form-item>
      <el-form-item label="订阅" prop="subscribe">
        <el-select v-model="queryParams.subscribe" placeholder="请选择订阅状态" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item style="float: right" >
@@ -85,7 +97,6 @@
          v-hasPermi="['sc:opcConf:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" border :data="opcConfList" @selection-change="handleSelectionChange">
@@ -93,32 +104,14 @@
      <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="type" >
        <template slot-scope="scope">
          <dict-tag :options="dict.type.collection_type" :value="scope.row.type"/>
        </template>
      </el-table-column>
      <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"
            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"
            style="width: 72px"
            type="danger"
            plain
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['sc:opcConf:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -144,7 +137,14 @@
          <el-input v-model="form.node" placeholder="请输入地址" />
        </el-form-item>
        <el-form-item label="采集类型" prop="type">
          <el-input v-model="form.type" placeholder="请输入采集类型" />
          <el-select v-model="form.type" placeholder="请选择采集类型" >
            <el-option
              v-for="dict in dict.type.collection_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="是否订阅" prop="subscribe">
          <el-radio-group v-model="form.subscribe">
@@ -169,7 +169,7 @@
export default {
  name: "OpcConf",
  dicts: ['sys_yes_no'],
  dicts: ['sys_yes_no','collection_type'],
  data() {
    return {
      advancedSearchVisible: false,
@@ -212,9 +212,11 @@
        locationName: [
          { required: true, message: "工位名称不能为空", trigger: "blur" },
        ],
        subscribe: [
          { required: true, message: "订阅不能为空", trigger: "blur" },
        ],
        node: [
          { required: true, message: "地址不能为空", trigger: "blur" },
          { pattern: /^[a-zA-Z0-9]*$/, message: "地址不能包含中文字符", trigger: "blur" }
        ],
      }
    };