ludc
2024-02-04 6909d1ad3107a6e030dc13e143f6b961ef163284
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;height: 80px">
    <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">
@@ -320,12 +321,12 @@
      ></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>
        <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="primary" @click="sysnonymSubmit">确定</el-button>
          <el-button @click="sysnonymCancel">取消</el-button>
@@ -414,7 +415,14 @@
</template>
<script>
import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag,codeSynonym} 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";
@@ -532,48 +540,48 @@
  },
  data() {
    return {
      sysSelectData:[],
      sysonymLoading:false,
      synonymOption:{
        addBtn:false,
        editBtn:false,
        delBtn:false,
        refreshBtn:false,
        columnBtn:false,
        menu:false,
        selection:true,
        column:[
      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: 'id',
            align: 'center'
          },
          {
            label:'名称',
            prop:'name',
            align:'center'
            label: '名称',
            prop: 'name',
            align: 'center'
          },
          {
            label:'源值',
            prop:'sourceValue',
            align:'center'
            label: '源值',
            prop: 'sourceValue',
            align: 'center'
          },
          {
            label:'同义词',
            prop:'synonymValue',
            align:'center'
            label: '同义词',
            prop: 'synonymValue',
            align: 'center'
          },
          {
            label:'启停状态',
            prop:'lcStatus',
            align:'center',
            label: '启停状态',
            prop: 'lcStatus',
            align: 'center',
            slot: true
          },
        ]
      },
      synonymData:[],
      synonymData: [],
      //近义词查询规则
      synonymVisible:false,
      synonymVisible: false,
      //表格高度
      dynamicHeight: '',
      // 保存单元格状态
@@ -1345,8 +1353,8 @@
            edit: "switch"
          },
          {
            label:'近义词查询规则',
            prop:'sysonymRuleOids',
            label: '近义词查询规则',
            prop: 'sysonymRuleOidsText',
            cell: false,
            edit: 'refer'
          },
@@ -1674,22 +1682,27 @@
  },
  methods: {
    //近义词查询规则取消
    sysnonymCancel(){
    sysnonymCancel() {
      this.synonymVisible = false;
    },
    //近义词查询规则确定
    sysnonymSubmit(){
      if(this.sysSelectData.length <= 0){
    sysnonymSubmit() {
      if (this.sysSelectData.length <= 0) {
        this.$message.warning('请至少选择一条数据!')
      }else {
      } 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.AddCellFlag = true;
        this.synonymVisible = false;
      }
    },
    sysChange(row){
    sysChange(row) {
      console.log(row)
      this.sysSelectData = row;
    },
    //新增搜索
@@ -2022,12 +2035,12 @@
              this.attrModel = this.CurrentCell.attributeGroup
            }
          },
          sysonymRuleOids: () =>{
          sysonymRuleOidsText: () => {
            this.sysonymLoading = true
            codeSynonym('1','-1','Released').then(res=>{
            codeSynonym('1', '-1', 'Released').then(res => {
              this.synonymData = res.data.data.records;
              this.sysonymLoading = false;
            }).catch(()=>{
            }).catch(() => {
              this.$message.error('请检查控制台错误信息!')
            })
            this.synonymVisible = true;