属性定义参照类型改成下拉树选择,处理值域显示不正确的问题,属性名选择改为下拉搜索
已修改5个文件
315 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue 296 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
@@ -8,7 +8,7 @@
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span>
                  <i class="el-icon-s-promotion"></i>
                <icon-show :name="data.icon"></icon-show>
                    {{ (node || {}).label }}
                </span>
              </span>
Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue
@@ -9,7 +9,7 @@
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span>
                  <i class="el-icon-s-promotion"></i>
                 <icon-show :name="data.icon"></icon-show>
                    {{ (node || {}).label }}
                </span>
              </span>
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -205,8 +205,8 @@
                使用枚举
              </template>
              <div>
                <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'">
                  {{ lastItem.enumFlag ? '是' : '否' }}
                <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
                  {{ lastItem.enumId ? '是' : '否' }}
                </el-tag>
              </div>
            </el-descriptions-item>
@@ -215,7 +215,7 @@
                枚举类型
              </template>
              <div>
                {{ lastItem.enumFlag }}
                {{ lastItem.enumId }}
              </div>
            </el-descriptions-item>
            <el-descriptions-item>
@@ -320,18 +320,19 @@
              </el-col>
              <el-col :span="8">
                <el-form-item label="选择参照类型:" prop="referValue">
                  <el-input v-model="form.referValue" :clearable="true" @focus="referFormFocusHandler"></el-input>
                  <avue-input-tree key="businessReferValue" v-if="form.attributeSelectType === 'business'" default-expand-all :clearable="true" v-model="form.referValue" placeholder="请选择内容" :dic="businessData" @change="referValueChange"></avue-input-tree>
                  <avue-input-tree key="linkReferValue" v-else default-expand-all v-model="form.referValue" placeholder="请选择内容" :clearable="true" :dic="linkTypeData" @change="referValueChange"></avue-input-tree>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item v-if="form.attributeSelectType === 'link'" label="版本次:" prop="version">
                <el-form-item v-show="form.attributeSelectType === 'link'" label="版本次:" prop="version">
                  <el-select v-model="form.version" placeholder="请选择版本次">
                    <el-option :value="1" label="当前版本次"></el-option>
                    <el-option :value="3" label="最新版本次"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <div v-if="!form.referValue" style="clear: both">
              <div v-show="showEnumSwitch" style="clear: both">
                <el-col :span="8">
                  <el-form-item label="使用枚举:" prop="enumSwitch">
                    <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
@@ -513,58 +514,6 @@
            </div>
          </div>
        </el-form>
        <!-- 业务类型对话框 -->
        <el-dialog
          v-dialogDrag
          :visible.sync="businessVisible"
          append-to-body="true"
          class="avue-dialog"
          title="业务类型选择"
          width="70%"
        >
          <avue-crud
            ref="businessCrud"
            :data="businessData"
            :option="businessOption"
            :table-loading="businessLoading"
            @search-change="businessHandleSearch"
            @search-reset="businessHandleReset"
            @row-click="businessRowClick"
          >
          </avue-crud>
          <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="businessSaveHandler">确 定</el-button>
          <el-button @click="businessEmpty">清 空</el-button>
         <el-button @click="businessVisible = false">取 消</el-button>
        </span>
        </el-dialog>
        <!-- 链接类型对话框 -->
        <el-dialog
          v-dialogDrag
          :visible.sync="linkTypeVisible"
          append-to-body="true"
          class="avue-dialog"
          title="链接类型选择"
          width="70%"
        >
          <avue-crud
            ref="linkTypeCrud"
            :data="linkTypeData"
            :option="linkTypeOption"
            :table-loading="linkTypeLoading"
            @search-change="linkHandleSearch"
            @search-reset="linkHandleReset"
            @row-click="linkRowClick"
          >
          </avue-crud>
          <span slot="footer" class="dialog-footer">
          <el-button @click="linkEmpty">清 空</el-button>
         <el-button @click="linkTypeVisible = false">取 消</el-button>
         <el-button type="primary" @click="linkSaveHandler">确 定</el-button>
        </span>
        </el-dialog>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addSaveHandler">确 定</el-button>
@@ -625,73 +574,8 @@
        ]
      },
      dialogTitle: "",
      businessRow: {},
      linkRow: {},
      linkDataSearch: [],
      businessSearchParams: {},
      linkTypeSearchParams: {},
      businessLoading: false,
      linkTypeLoading: false,
      businessVisible: false,
      linkTypeVisible: false,
      businessData: [],
      linkTypeData: [],
      businessOption: {
        ...basicOption,
        addBtn: false,
        menu: false,
        searchMenuSpan: 8,
        selection: false,
        refreshBtn: false,
        searchLabelWidth: 100,
        highlightCurrentRow: true,
        column: [
          {
            label: '业务类型名',
            prop: 'name',
            sortable: true,
            search: true
          },
          {
            label: '标签',
            prop: 'label',
            sortable: true,
          },
          {
            label: '父类',
            prop: 'fName',
            sortable: true,
          },
          {
            label: '版本规则',
            prop: 'revRuleName',
            sortable: true,
          },
          {
            label: '生命周期',
            prop: 'lifeCycle',
            sortable: true,
          },
        ]
      },
      linkTypeOption: {
        ...basicOption,
        addBtn: false,
        menu: false,
        searchMenuSpan: 8,
        selection: false,
        refreshBtn: false,
        searchLabelWidth: 100,
        highlightCurrentRow: true,
        column: [
          {
            label: '链接类型名',
            prop: 'name',
            sortable: true,
            search: true
          },
        ]
      },
      tableData: [],
      option: {
        ...basicOption,
@@ -744,6 +628,8 @@
      },
      addVisible: false,
      addLoading: false,
      referValueDic:[],
      showEnumSwitch:false,
      form: {
        id: "",
        name: "",
@@ -833,9 +719,24 @@
        this.tableData = data;
        this.page.total = res.data.total;
        this.tableLoading = false;
      }).catch(err => {
        this.$message.error(err)
      });
      //获取业务类型数据
      getBizTypes().then(res => {
        const data = res.data.data.map(item => ({
          label: item.name,
          value:item.name,
          desc:item.label
        }));
        this.businessData = data;
      })
      //获取链接类型数据
      getAllLtName().then(res => {
        const data = res.data.data.map(item => ({
          label: item,
          value:item
        }));
        this.linkTypeData = data;
      })
    },
    // 表格头部刷新
@@ -844,7 +745,7 @@
    },
    // 搜索
    handleSearch(params, done) {
    handleSearch(params, done) {debugger;
      this.searchParams = {
        "conditionMap[id]": "*" + params.id + "*"
      };
@@ -1184,136 +1085,13 @@
    },
    // 值域类型切换
    attributeSelectTypeChange() {
      this.form.referValue = ''; // 切换值域类型 清空当前参照
      this.$forceUpdate(); // 强制更新form组件
      this.form.referValue = null; // 切换值域类型 清空当前参照
    },
    // 选择参照
    referFormFocusHandler() {
      const handlers = {
        business: () => {
          this.businessVisible = true;
          this.businessLoading = true;
          this.businessGetTable();
        },
        link: () => {
          this.linkTypeVisible = true;
          this.linkTypeLoading = true;
          this.linkGetTable();
        }
      };
      const {attributeSelectType} = this.form;
      const handler = handlers[attributeSelectType];
      if (handler) {
        handler();
      }
      ;
    //参照类型数据变化
    referValueChange(data){
      this.showEnumSwitch=!data.value;
    },
    // 业务类型表格数据请求
    businessGetTable() {
      getBizTypes(this.businessSearchParams).then(res => {
        const data = res.data.data;
        this.businessData = data;
        this.businessLoading = false;
      })
    },
    // 业务类型参照搜索
    businessHandleSearch(val, done) {
      this.businessSearchParams = {
        btmName: val.name
      }
      this.businessGetTable();
      done()
    },
    // 业务类型参照清空搜索
    businessHandleReset() {
      this.businessSearchParams = {};
      this.businessGetTable();
    },
    // 链接类型表格数据请求
    linkGetTable() {
      getAllLtName(this.linkTypeSearchParams).then(res => {
        const data = res.data.data.map(item => ({name: item}));
        ;
        this.linkTypeData = data;
        this.linkDataSearch = data;
        this.linkTypeLoading = false;
      })
    },
    // 链接类型参照搜索
    linkHandleSearch(params, done) {
      const {name} = params;
      if (!params.name) {
        this.linkTypeData = this.linkDataSearch;
        return done();
      }
      ;
      this.linkTypeData = this.linkDataSearch.filter(item => {
        console.log(item)
        return item.name && item.name.includes(name);
      });
      done();
    },
    // 链接类型参照清空搜索
    linkHandleReset() {
      this.linkTypeData = this.linkDataSearch;
    },
    // 业务类型表格行点击
    businessRowClick(row) {
      this.businessRow = row;
    },
    // 业务类型确定保存
    businessSaveHandler() {
      if (func.isEmptyObject(this.businessRow)) {
        this.$message.error('请选择一条数据!')
        return;
      }
      this.form.referValue = this.businessRow.name;
      this.businessVisible = false;
    },
    // 业务类型清空
    businessEmpty() {
      this.form.referValue = null;
      this.businessVisible = false;
    },
    // 链接类型确定保存
    linkRowClick(row) {
      this.linkRow = row;
    },
    // 业务类型确定保存
    linkSaveHandler() {
      if (func.isEmptyObject(this.linkRow)) {
        this.$message.error('请选择一条数据!')
        return;
      }
      this.form.referValue = this.linkRow.name;
      this.linkTypeVisible = false;
    },
    // 链接类型清空
    linkEmpty() {
      this.form.referValue = null;
      this.linkTypeVisible = false;
    },
    // 关闭新增对话框
    addEscHandler() {
      this.addVisible = false;
@@ -1334,7 +1112,7 @@
        attributeSelectType: "business",
        version: 1,
        defaultValue: "",//默认值
        referValue: "",
        referValue: null,
        btmTypeId: "",
        linkTypeName: "",
        rangeValue: ""
@@ -1347,6 +1125,16 @@
    addSaveHandler() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          if(this.form.attributeDataType === 'VTString'){
            if(!this.form.referValue){
              //参照类型没有值
            }else {
              this.form.enumSwitch=false;
              this.form.rangeValue=''
            }
          }
          this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : '';
          if (this.form.attributeSelectType === 'business') {
            this.form.btmTypeId = this.form.referValue;
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js
@@ -4,6 +4,18 @@
    prop: 'id',
    search: true,
    sortable: true,
    type:'select',
    allowCreate:true,
    filterable:true,
    props:{
      label:'id',
      value:'id'
    },
    dicUrl:"/api/attributeController/gridAttribute",
    dicQuery:{
      page:1,
      limit:-1
    }
  },
  {
    label: '标签',
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue
@@ -16,6 +16,7 @@
            <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span>
                 <icon-show :name="data.icon"></icon-show>
                    {{ (node || {}).label }}
                </span>
              </span>
@@ -149,11 +150,9 @@
        level: this.paramsType
      }
      this.defaultExpandKeys = ['root'];
      console.log(row);
      getAllLevelTreeByBtm(params).then(res => {
        this.uiTreeOption.defaultExpandedKeys = [res.data.obj.oid];
        this.uiTreeData = [res.data.obj];
        console.log(res);
        this.rightLoading = false;
      }).catch(error => {
        this.rightLoading = false;