田源
2024-01-30 eff08b9e2986b91615620c0fa47c2de2170f7a78
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block">
    <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block;height: 80px">
      <el-button-group>
        <!--新增-->
        <span v-if="permissionList.busineStatus">
@@ -318,6 +318,19 @@
        :referConfigOption="referConfigOption"
        @setReferConfigValue="setReferConfigValue"
      ></refer-config-dialog>
      <!--近义词查询规则      -->
      <el-dialog :visible.sync="synonymVisible" append-to-body title="近义词查询规则">
          <avue-crud :data="synonymData" :option="synonymOption" v-loading="sysonymLoading" @selection-change="sysChange">
            <template slot="lcStatus" slot-scope="{row}">
              <el-tag v-if="row.lcStatus === 'Released'" type="success">启用</el-tag>
              <el-tag v-else type="danger">停用</el-tag>
            </template>
          </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="sysnonymSubmit">确定</el-button>
          <el-button @click="sysnonymCancel">取消</el-button>
        </div>
      </el-dialog>
    </div>
@@ -401,7 +414,7 @@
</template>
<script>
import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag} from '@/api/template/templateAttr'
import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag,codeSynonym} from '@/api/template/templateAttr'
import {getList} from "@/api/refer/table";
import func from "@/util/func";
import {getCurrentInstance} from "vue";
@@ -519,6 +532,48 @@
  },
  data() {
    return {
      sysSelectData:[],
      sysonymLoading:false,
      synonymOption:{
        addBtn:false,
        editBtn:false,
        delBtn:false,
        refreshBtn:false,
        columnBtn:false,
        menu:false,
        selection:true,
        column:[
          {
            label:'编码',
            prop:'id',
            align:'center'
          },
          {
            label:'名称',
            prop:'name',
            align:'center'
          },
          {
            label:'源值',
            prop:'sourceValue',
            align:'center'
          },
          {
            label:'同义词',
            prop:'synonymValue',
            align:'center'
          },
          {
            label:'启停状态',
            prop:'lcStatus',
            align:'center',
            slot: true
          },
        ]
      },
      synonymData:[],
      //近义词查询规则
      synonymVisible:false,
      //表格高度
      dynamicHeight: '',
      // 保存单元格状态
@@ -1290,6 +1345,12 @@
            edit: "switch"
          },
          {
            label:'近义词查询规则',
            prop:'sysonymRuleOids',
            cell: false,
            edit: 'refer'
          },
          {
            label: "相似查重属性",
            prop: "sameRepeatAttrFlag",
            width: 110,
@@ -1598,7 +1659,7 @@
      if (this.editStyleFlag) {
        return '800px'
      } else {
        return 'calc(100vh - 565px)'
        return 'calc(100vh - 602px)'
      }
    }
  },
@@ -1612,6 +1673,25 @@
    })
  },
  methods: {
    //近义词查询规则取消
    sysnonymCancel(){
      this.synonymVisible = false;
    },
    //近义词查询规则确定
    sysnonymSubmit(){
      if(this.sysSelectData.length <= 0){
        this.$message.warning('请至少选择一条数据!')
      }else {
        const newArray = this.sysSelectData.map(obj => obj.oid);
        const newString = newArray.join(',');
        this.$set(this.CurrentCell, 'sysonymRuleOids', newString)
        this.AddCellFlag = true;
        this.synonymVisible = false;
      }
    },
    sysChange(row){
      this.sysSelectData = row;
    },
    //新增搜索
    AddFindHandler() {
      if (this.SelectValue == 'id') {
@@ -1941,6 +2021,16 @@
            if (this.CurrentCell.attributeGroup !== '') {
              this.attrModel = this.CurrentCell.attributeGroup
            }
          },
          sysonymRuleOids: () =>{
            this.sysonymLoading = true
            codeSynonym('1','-1','Released').then(res=>{
              this.synonymData = res.data.data.records;
              this.sysonymLoading = false;
            }).catch(()=>{
              this.$message.error('请检查控制台错误信息!')
            })
            this.synonymVisible = true;
          }
        };
@@ -2246,7 +2336,7 @@
<style lang="scss" scoped>
//固定列高度
/deep/ .el-table__fixed {
  height: calc(100vh - 584px) !important;
  height: calc(100vh - 618px) !important;
}
///deep/ .el-table__fixed[v-if='editStyleFlag'] {