comp-save (替换RelatedUserId,related_user_id,relatedUserId)

<section class="van-notice-c">
      <!-- {{ value }} -->
      <van-notice-bar left-icon="new-o">列表如果没有用户,右侧输入文章精确查找</van-notice-bar>
    </section>
    <bs-lookup-owner
      :on-callback-root-data="handleCallBackRootData"
      :primary-change-state="value.primaryChangeState"
      @change="
        (item, itemValueO, itemV) => {
          changeField.relatedUserId = itemV;
          unChangeField.relatedUserId = itemV;
          changeField.changed = true;
          SetChangeField(changeField);
        }
      "
      v-bind="{
        ...{ 'inactive-value': 0, 'active-value': 1 },
        ...bridger.relatedUserId.attrs,
        ...(bridger.relatedUserId.attrsInt || {}),
      }"
      v-model="value.relatedUserId"
      :label="bridger.relatedUserId.label"
      :name="bridger.relatedUserId.name"
      :item="bridger.relatedUserId"
    ></bs-lookup-owner>

method.js 引入配置模板,然后修改配置信息

import bridgerTemplate from "@/main-bridger-template";

    init(that) {
        that.bridger.relatedUserId=JSON.parse(JSON.stringify(bridgerTemplate["relUserId"]));
        that.bridger.relatedUserId.alias="related_user_id";
        that.bridger.relatedUserId.field
    },

mapper_{mkey}sql__columns.json(替换RelatedUserId,relateduser_id,relatedUserId)

{
  "columns": {
    "relatedUserId": {
      "extendAlias": "user_basis",
      //控制替换继承列名 _fromPrimaryIds   替换为
      "dimSqlRep": [
        {
          "key": "_fromPrimaryIds",
          "value": "_filterDimRelatedUserId",
          "name": "RelatedUserId",
          "alias": "related_user_id"
        }
      ],
      "dimJoin": {
        "fromDimField": "userBasis",
        "allFilter": "",
        "joinChar": ","
      }
    }
  }
}

mapper_{mkey}sql__dimdata.json (替换RelatedUserId,relateduser_id,relatedUserId)

{
  "dimDatas": {
    //用户信息
    "userBasis": {
      "extend": "userBasis",
      "dataFromType": "Database"
    }

  }
}

app_sql_extend.json

 "userBasis": {
      //"allSql": "select nike_name name,0 parent_id,user_id id,user_id value from bo_user where user_status=1     and user_id in @_fromPrimaryIds    order by user_id", 
        "allSql": "select u.user_id id,u.user_id value,ifnull(ifnull(ifnull(ifnull(real_name,ua.nike_name),ua.user_name),email),telephone) name,0 parent_id from bo_user  u left join bo_user_account ua on(ua.user_id=u.user_id) where u.user_status is not null     and u.user_id in @_fromPrimaryIds    order by u.user_id",
      //"sql": {
      //  "oracle": null,
      //  "mysql": null,
      //  "sqlserver": null,
      //  "sqlite": null,
      //  "postgresql": null
      //},
      "connName": "ConnBo",
      "dimCacheKey": "dim-bo-user",
      "name": "用户信息",
      "fromExtend": true
    },

发布字段显示顺序

 {
        "name": "push_name",
        "path": "real_name",
        "sortId": 1
      },
      {
        "key": "user_id", //主键别名  使用于  1对1
        "path": "account:nike_name", // : 前面为主表列 ,  后面为1对1里面表列
        "value": "-",
        "sortId": 2
      },
      {
        "path": "email",
        "sortId": 3
      },
      {
        "path": "telephone",
        "value": "-",
        "sortId": 4
      },
文档更新时间: 2022-01-02 10:58   作者:admin