ludc
2024-04-18 aee67ef5bf2e57a148bfded1cb986378e35e7e01
Source/UBCS-WEB/src/views/integration/vciAttribute.vue
@@ -4,8 +4,21 @@
               @size-change="sizeChange" @row-dblclick="handleRowClick" @row-update="handleUpdate"
               @selection-change="selectChange">
      <template slot="menuLeft">
        <el-button plain size="small" type="success" @click="savaHandler">保存</el-button>
        <el-button plain size="small" type="primary" @click="syncHandler">同步</el-button>
        <el-button v-if="permissionList.saveBtn" plain size="small" type="success" @click="savaHandler">保存</el-button>
        <el-button v-if="permissionList.syncBtn" plain size="small" type="primary" @click="syncHandler">同步</el-button>
        <span style="width: 200px;display: inline-block">
                <el-select slot="prepend" v-model="searchSelect" placeholder="请选择" size="small">
                <el-option v-for="item in searchData" :key="item.prop" :label="item.label" :value="item.prop"
                ></el-option>
              </el-select>
            </span>
        <span style="margin-left: 5px">
                 <el-input v-model="searchValue" class="attrSearch" clearable placeholder="请输入内容"
                           prefix-icon="el-icon-search"
                           size="small" type="text"></el-input>
              <el-button v-if="permissionList.searchBtn" icon="el-icon-search" plain size="small" type="primary"
                         @click="searchHandler">&nbsp;搜索</el-button>
              </span>
      </template>
    </avue-crud>
  </basic-container>
@@ -14,11 +27,29 @@
<script>
import {getGroupAttrPoolALlList, editGroupAttr, syncGroupAttrMapping} from '@/api/vciAttrbute'
import {getPage} from "@/api/omd/OmdAttribute";
import {mapGetters} from "vuex";
export default {
  name: "vciAttribute",
  data() {
    return {
      searchSelect: "groupAttrKey",
      searchValue: '',
      searchData: [
        {
          label: "集团属性编号",
          prop: "groupAttrKey",
          align: "left",
          display: false,
          width: 200,
          required: true
        }, {
          label: "集团属性名称",
          prop: "groupAttrName",
          align: "left",
          display: false
        }
      ],
      data: [],
      options: {
        height: 'auto',
@@ -86,9 +117,30 @@
  computed: {
    codeMetaColumn() {
      return this.options.column.find(column => column.prop === 'codeMetaAttrName');
    }
    },
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        saveBtn: this.vaildData(this.permission.vciAttribute.attribute_save, false),
        syncBtn: this.vaildData(this.permission.vciAttribute.attribute_sync, false),
        searchBtn: this.vaildData(this.permission.vciAttribute.attribute_search, false),
      }
    },
  },
  methods: {
    searchHandler() {
      console.log(this.searchSelect)
      const params = {
        [`conditionMap[${this.searchSelect}_like]`]: this.searchValue,
        page: this.page.currentPage,
        limit: this.page.pageSize
      }
      getGroupAttrPoolALlList(params).then(res => {
        const data = res.data.data;
        this.data = data.records;
        this.page.total = data.total;
      })
    },
    codeMetaDis() {
      for (const item of this.data) {
        if (item.codeMetaAttrOid && item.codeMetaAttrKey && item.codeMetaAttrName) {
@@ -153,9 +205,9 @@
      if (updataList) {
        const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList;
        Object.assign(row, {
          codeMetaAttrOid: codeMetaAttrOid.toLowerCase(),
          codeMetaAttrOid: codeMetaAttrOid,
          codeMetaAttrKey: codeMetaAttrKey.toLowerCase(),
          codeMetaAttrName: codeMetaAttrName.toLowerCase()
          codeMetaAttrName: codeMetaAttrName
        });
      }
@@ -194,9 +246,9 @@
          if (updataList) {
            const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList;
            Object.assign(item, {
              codeMetaAttrOid: codeMetaAttrOid.toLowerCase(),
              codeMetaAttrOid: codeMetaAttrOid,
              codeMetaAttrKey: codeMetaAttrKey.toLowerCase(),
              codeMetaAttrName: codeMetaAttrName.toLowerCase()
              codeMetaAttrName: codeMetaAttrName
            });
          }
          item.$cellEdit = false;