ludc
2024-07-10 083e907c2567ba53c892a45cf2605172715922ab
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,6 +1,7 @@
<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 +319,20 @@
        :referConfigOption="referConfigOption"
        @setReferConfigValue="setReferConfigValue"
      ></refer-config-dialog>
      <!--近义词查询规则      -->
      <el-dialog :visible.sync="synonymVisible" append-to-body title="近义词查询规则">
        <avue-crud v-loading="sysonymLoading" :data="synonymData" :option="synonymOption" @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="info" @click="sysClear">清空</el-button>
          <el-button type="primary" @click="sysnonymSubmit">确定</el-button>
          <el-button @click="sysnonymCancel">取消</el-button>
        </div>
      </el-dialog>
    </div>
@@ -401,7 +416,14 @@
</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 +541,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: '',
      // 保存单元格状态
@@ -812,7 +876,7 @@
          },
          {
            label: "只读",
            prop: "readonlyFlag",
            prop: "readOnlyFlag",
          },
          {
            label: "列表排序",
@@ -1290,6 +1354,12 @@
            edit: "switch"
          },
          {
            label: '近义词查询规则',
            prop: 'sysonymRuleOidsText',
            cell: false,
            edit: 'refer'
          },
          {
            label: "相似查重属性",
            prop: "sameRepeatAttrFlag",
            width: 110,
@@ -1316,7 +1386,7 @@
          },
          {
            label: "只读",
            prop: "readonlyFlag",
            prop: "readOnlyFlag",
            cell: false,
            edit: "switch"
          },
@@ -1328,7 +1398,7 @@
          },
          {
            label: "多行文本",
            prop: "textareaFlag",
            prop: "textAreaFlag",
            cell: false,
            edit: "switch"
          },
@@ -1543,13 +1613,13 @@
        value: 'tableDisplayFlag',
        label: '列表显示'
      }, {
        value: 'readonlyFlag',
        value: 'readOnlyFlag',
        label: '只读'
      }, {
        value: 'sortAttrFlag',
        label: '列表排序'
      }, {
        value: 'textareaFlag',
        value: 'textAreaFlag',
        label: '多行文本'
      }, {
        value: 'imageFlag',
@@ -1598,7 +1668,7 @@
      if (this.editStyleFlag) {
        return '800px'
      } else {
        return 'calc(100vh - 565px)'
        return 'calc(100vh - 602px)'
      }
    }
  },
@@ -1612,6 +1682,35 @@
    })
  },
  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(',');
        const newArrayName = this.sysSelectData.map(obj => obj.name);
        const newStringName = newArrayName.join(',')
        this.$set(this.CurrentCell, 'sysonymRuleOids', newString)
        //text
        this.$set(this.CurrentCell, 'sysonymRuleOidsText', newStringName)
        this.$set(this.CurrentCell, 'sysonymRuleOidsData', this.sysSelectData)
        this.AddCellFlag = true;
        this.synonymVisible = false;
      }
    },
    sysClear(){
      this.CurrentCell.sysonymRuleOidsText = "";
      this.CurrentCell.sysonymRuleOidsData = "";
      this.AddCellFlag = true;
    },
    sysChange(row) {
      this.sysSelectData = row;
    },
    //新增搜索
    AddFindHandler() {
      if (this.SelectValue == 'id') {
@@ -1876,6 +1975,7 @@
    //表格行编辑
    handleCellClicks(row, column) {
      if (this.editOpenFlag) {
        this.AddCellFlag = false;
        this.editingRows = row;
        this.editShows = column.property;
        this.rowOid = row.oid;
@@ -1941,6 +2041,17 @@
            if (this.CurrentCell.attributeGroup !== '') {
              this.attrModel = this.CurrentCell.attributeGroup
            }
          },
          sysonymRuleOidsText: () => {
            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;
          }
        };
@@ -2244,9 +2355,16 @@
</script>
<style lang="scss" scoped>
/deep/ .el-table__fixed-body-wrapper {
  .el-table__body {
    padding-bottom: 15px;
  }
}
//固定列高度
/deep/ .el-table__fixed {
  height: calc(100vh - 584px) !important;
  height: calc(100vh - 618px) !important;
}
///deep/ .el-table__fixed[v-if='editStyleFlag'] {