277:参照配置界面,关于包含条件,同一个字段具备多个包含条件时,需要重新设置一下界面更改一下后端查询接口
已修改2个文件
166 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -189,45 +189,27 @@
            @echoSelectedAttr="echoSelectedAttr">
        </refer-select-btm-attr-dialog>
        <el-dialog title="选择显示字段"
        <el-dialog title="选取IN或NOTIN条件"
            append-to-body
            :visible.sync="isShowShowField"
            :visible.sync="isShowInOrNotInCondition"
            width="70%"
            destroy-on-close
            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
            <avue-crud :option="selectionShowFieldOption"
                :table-loading="selectShowFieldLoading"
                :data="selectShowFieldData"
                ref="selectShowFieldCrud"
                @row-click="showFieldRowClick"
                @selection-change="selectionShowFieldDataChange"
                @search-change="showFieldSearchChange"
                @search-reset="showFieldSearchReset">
            <avue-crud :option="selectInOrNotInCondOption"
                :page.sync="inOrNotInPage"
                @current-change="inOrNotInCurrentChange"
                @size-change="inOrNotInSizeChange"
                @selection-change="selectionInOrNotInChange"
                @row-click="rowInOrNotInClick"
                @search-change="selectInOrNotInSearchChange"
                @search-reset="searchInOrNotInReset"
                :data="selectInOrNotInCondData"
                ref="inOrNotInConditionCrud">
            </avue-crud>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="selectedShowField">确 定</el-button>
                <el-button @click="isShowShowField = false">取 消</el-button>
            </div>
        </el-dialog>
        <el-dialog title="选择查询条件"
            append-to-body
            :visible.sync="isShowSearchCondition"
            width="70%"
            destroy-on-close
            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
            <avue-crud :option="selectionSearchConditionOption"
                :table-loading="selectSearchConditionLoading"
                :data="selectSearchConditionData"
                ref="selectSearchConditionCrud"
                @row-click="searchConditionRowClick"
                @selection-change="searchConditionDataChange"
                @search-change="searchConditionSearchChange"
                @search-reset="searchConditionSearchReset">
            </avue-crud>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="selectedSearchCondition">确 定</el-button>
                <el-button @click="isShowSearchCondition = false">取 消</el-button>
              <!-- <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> -->
              <el-button type="primary" @click="selectedInOrNotInCond">确 定</el-button>
              <el-button @click="isShowInOrNotInCondition = false">取 消</el-button>
            </div>
        </el-dialog>
@@ -236,6 +218,7 @@
<script>
    import func from "@/util/func";
    import {getList} from "@/api/refer/table";
    export default {
        name: "referConfigFormDialog",
        props: {
@@ -472,6 +455,37 @@
                //上一次点击的行编辑数据
                preClickAttrRow: '',
                preClickAddSearchConditionRow: '',
                //点击行弹出in或notin的值
                isShowInOrNotInCondition: false,
                selectInOrNotInCondData: [],
                selectInOrNotInCondOption: {
                  height:'220',
                  tip: false,
                  addBtn: false,
                  editBtn: false,
                  searchShow: true,
                  searchMenuSpan: 6,
                  border: false,
                  index: true,
                  viewBtn: false,
                  delBtn: false,
                  selection: true,
                  disablePage: false,
                  refreshBtn: false,
                  columnBtn: false,
                  menu: false,
                  dialogClickModal: false,
                  highlightCurrentRow: true,
                  column: []
                },
                inOrNotInPage: {
                  pageSize: 10,
                  currentPage: 1,
                  total: 0,
                },
                selectionInOrNotInList: [],
                inOrNotInParam: {},
            };
        },
@@ -981,9 +995,78 @@
                    //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]);
                    this.form.codeSrchCondConfigVOS[this.preClickAddSearchConditionRow.$index].$cellEdit = false;
                }
                if(row.filterType === '_in' || row.filterType === '_notin'){
                  //console.log(row);
                  this.selectInOrNotInCondOption.column = [{
                    prop: row.filterField,
                    label: row.filterTypeText,
                    search: true,
                    searchLabelWidth: 45,
                    searchSpan: 8,
                    sortable: true,
                  }]
                  this.initPageData.pageSize = 10;
                  this.initPageData.currentPage = 1;
                  this.loadInOrNotInConditionData(this.initPageData);
                  this.isShowInOrNotInCondition = true;
                }
                row.$cellEdit = true;
                this.preClickAddSearchConditionRow = row;
            },
            loadInOrNotInConditionData(page, params = {}){
              let mustParams = {
                referType: this.form.referType,
                referBo: this.form.referType,
              };
              getList(Object.assign(mustParams,params),page.currentPage,page.pageSize,'/api/ubcs-code/mdmEngineController/defaultReferDataGrid','GET').then(res=>{
                //console.log(res.data);
                this.selectInOrNotInCondData = res.data.records;
                this.inOrNotInPage.total = res.data.total;
              });
            },
            inOrNotInCurrentChange(currentPage) {
              this.inOrNotInPage.currentPage = currentPage;
            },
            inOrNotInSizeChange(pageSize) {
              this.inOrNotInPage.pageSize = pageSize;
            },
            rowInOrNotInClick(row){
              this.$refs.inOrNotInConditionCrud.toggleSelection();
              this.$refs.inOrNotInConditionCrud.toggleRowSelection(row); //选中当前行
            },
            selectionInOrNotInChange(list){
              if (this.isMuti && list.length > 1) {
                const nowVal = list.shift();
                this.$refs.inOrNotInConditionCrud.toggleRowSelection(nowVal, false);
              }
              this.selectionInOrNotInList = list
            },
            selectedInOrNotInCond(){
              if(this.selectionInOrNotInList && this.selectionInOrNotInList.length > 0){
                // console.log(this.selectionInOrNotInList)
                this.preClickAddSearchConditionRow.filterValue = this.selectionInOrNotInList.map(item => item[this.selectInOrNotInCondOption.column[0].prop]).join(',');
                this.isShowInOrNotInCondition = false;
              }
            },
            /** 点击搜索后触发该事件 */
            selectInOrNotInSearchChange(params, done) {
              this.initPageData.currentPage = 1;
              let requestData = {};
              if(params) {
                Object.keys(params).forEach((key)=>{
                  requestData["conditionMap" + "["+ key +"_like]"] = params[key].trim();
                })
              }
              this.inOrNotInParam = requestData;
              this.loadInOrNotInConditionData(this.initPageData,this.inOrNotInParam);
              done();
            },
            /** 重置位属性选取值表格的搜索框之后的回调 */
            searchInOrNotInReset() {
              this.inOrNotInParam = {};
              this.loadInOrNotInConditionData(this.initPageData);
            },
            //上一个页面已经选中参照应用的业务类型的情况,和上一次已经配置过参照配置的情况下进行页面初始化渲染
            initPageData(val){
                // console.log(val.referConfig);
@@ -1263,4 +1346,13 @@
        transition:opacity .0s !important;
    }
    /* .valueInfo {
      float: left;
      border: 1px solid #E9E7E7;
      display: inline-block;
      vertical-align: middle;
      padding: 9px 15px;
      line-height: 1;
    } */
</style>
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -4427,8 +4427,8 @@
        List<Map> maps = commonsMapper.selectBySql("select * from (select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
                + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 and "
                + whereSqlByMap + ") t "+ (baseQueryObject.getLimit()==-1?")": ("where rownum <=" + num1 + ") where rn >=" + num2)
                + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + (Func.isNotBlank(whereSqlByMap) ? "and "+whereSqlByMap:"") + ") t "+ (baseQueryObject.getLimit()==-1?")": ("where rownum <=" + num1 + ") where rn >=" + num2)
        ));
        List<BaseModel> baseModels = new ArrayList<>();
        //将查询到的数据转换为basemodel,使用的反射方式来进行创建的
@@ -4476,8 +4476,8 @@
        }
        int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 and "
                + whereSqlByMap
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + (Func.isNotBlank(whereSqlByMap) ? "and "+whereSqlByMap:"")
        );
        IPage<BaseModelVO> objectDataGrid = new Page<>();
        objectDataGrid.setPages(baseQueryObject.getPage());