@witlink/usercenter 1.2.69 → 1.2.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import './assets/main.b000db64.css';var __defProp = Object.defineProperty;
1
+ import './assets/main.fd32ea2f.css';var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -33791,40 +33791,52 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
33791
33791
  const handleSelect = (value, option) => {
33792
33792
  queryParam.value.name = value;
33793
33793
  queryParam.value.id = option.id;
33794
+ queryById();
33794
33795
  };
33795
33796
  const selfId = ref(null);
33796
- const fetchChildListApi = (parentRow, j) => {
33797
- const params = {
33797
+ const fetchSearchInitList = async (parentRow) => {
33798
+ const res = await getRegionListAsync({
33798
33799
  parentId: parentRow.id,
33799
- page: j,
33800
+ page: 1,
33800
33801
  size: 10,
33801
- id: selfId.value ? selfId.value : null
33802
- };
33803
- return getRegionListAsync(params).then((res) => {
33804
- if (res.code === 0) {
33805
- const childs = res.result.list;
33806
- if (queryParam.value.id && queryParam.value.id === selfId.value) {
33807
- childs.push({
33808
- id: parentRow.id + "_loadMore_" + (j - 1),
33809
- parentId: parentRow.id,
33810
- name: t2("uc_organ.loadMore")
33811
- });
33812
- } else {
33813
- if (childs.length > 0 && res.result.hasMore) {
33814
- childs.push({
33815
- id: parentRow.id + "_loadMore_" + j,
33816
- parentId: parentRow.id,
33817
- name: t2("uc_organ.loadMore")
33818
- });
33819
- }
33820
- }
33821
- selfId.value = null;
33822
- return childs;
33823
- } else {
33824
- selfId.value = null;
33825
- return [];
33826
- }
33802
+ id: selfId.value
33827
33803
  });
33804
+ if (res.code !== 0)
33805
+ return [];
33806
+ const list = res.result.list || [];
33807
+ if (queryParam.value.id && queryParam.value.id === selfId.value) {
33808
+ list.push({
33809
+ id: `${parentRow.id}_loadMore_search`,
33810
+ parentId: parentRow.id,
33811
+ name: t2("uc_organ.loadMore"),
33812
+ _isLoadMore: true
33813
+ });
33814
+ selfId.value = null;
33815
+ }
33816
+ return list;
33817
+ };
33818
+ const fetchChildListApi = async (parentRow, page) => {
33819
+ const res = await getRegionListAsync({
33820
+ parentId: parentRow.id,
33821
+ page,
33822
+ size: 10,
33823
+ id: null
33824
+ });
33825
+ if (res.code !== 0)
33826
+ return [];
33827
+ let list = res.result.list || [];
33828
+ if (queryParam.value.id) {
33829
+ list = list.filter((item) => item.id !== queryParam.value.id);
33830
+ }
33831
+ if (res.result.hasMore) {
33832
+ list.push({
33833
+ id: `${parentRow.id}_loadMore_${page}`,
33834
+ parentId: parentRow.id,
33835
+ name: t2("uc_organ.loadMore"),
33836
+ _isLoadMore: true
33837
+ });
33838
+ }
33839
+ return list;
33828
33840
  };
33829
33841
  const treeConfig = reactive({
33830
33842
  transform: true,
@@ -33832,31 +33844,33 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
33832
33844
  parentField: "parentId",
33833
33845
  lazy: true,
33834
33846
  hasChild: "hasChild",
33835
- expandRowKeys: [],
33836
- loadMethod({ row }) {
33837
- return fetchChildListApi(row, 1);
33847
+ async loadMethod({ row }) {
33848
+ if (selfId.value && !row._searchInitLoaded) {
33849
+ row._searchInitLoaded = true;
33850
+ row._page = 1;
33851
+ const list2 = await fetchSearchInitList(row);
33852
+ row._lazyChildren = list2;
33853
+ return row._lazyChildren;
33854
+ }
33855
+ const page = row._page || 1;
33856
+ const list = await fetchChildListApi(row, page);
33857
+ if (!row._lazyChildren) {
33858
+ row._lazyChildren = [];
33859
+ }
33860
+ row._lazyChildren = row._lazyChildren.filter((item) => !item._isLoadMore);
33861
+ row._lazyChildren.push(...list);
33862
+ row._page = page + 1;
33863
+ return row._lazyChildren;
33838
33864
  }
33839
33865
  });
33840
33866
  const showMore = async (record) => {
33841
33867
  const parentRow = tableRef.value.getRowById(record.parentId);
33842
- const recordIdStr = record.id.toString();
33843
- const childs = await fetchChildListApi(
33844
- parentRow,
33845
- parseInt(recordIdStr.split("_loadMore_")[1]) + 1
33846
- );
33847
- if (queryParam.value.id) {
33848
- for (let i = 0; i < childs.length; i++) {
33849
- if (childs[i].id === queryParam.value.id) {
33850
- childs.splice(i, 1);
33851
- break;
33852
- }
33853
- }
33854
- }
33855
- tableRef.value.insertChildAt(childs, parentRow, record);
33856
- if (queryParam.value.id) {
33857
- parentRow.hasChild = false;
33858
- }
33868
+ if (!parentRow)
33869
+ return;
33859
33870
  tableRef.value.remove(record);
33871
+ parentRow._treeLoaded = false;
33872
+ await tableRef.value.setTreeExpand(parentRow, false);
33873
+ await tableRef.value.setTreeExpand(parentRow, true);
33860
33874
  };
33861
33875
  const showMoreOperation = (record) => {
33862
33876
  return [0, 1].includes(record.type) && (addShow.value || removeShow.value && record.deleteStatus == 0) && hideButtonArr.value.indexOf(record.id) === -1;
@@ -34004,17 +34018,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
34004
34018
  }
34005
34019
  };
34006
34020
  async function addOrDeleRefresh(row) {
34007
- if (row.children && row.children.length > 11) {
34008
- delete row.children;
34009
- await tableRef.value.setTreeExpand(row, false);
34010
- await tableRef.value.setTreeExpand(row, true);
34011
- } else {
34012
- const treeExpandRecords = tableRef.value.getTreeExpandRecords();
34013
- await tableRef.value.clearTreeExpandLoaded(row);
34014
- nextTick(() => {
34015
- tableRef.value.setTreeExpand(treeExpandRecords, true);
34016
- });
34017
- }
34021
+ row._page = 1;
34022
+ row._lazyChildren = [];
34023
+ const treeExpandRecords = tableRef.value.getTreeExpandRecords();
34024
+ await tableRef.value.clearTreeExpandLoaded(row);
34025
+ nextTick(() => {
34026
+ tableRef.value.setTreeExpand(treeExpandRecords, true);
34027
+ });
34018
34028
  }
34019
34029
  const onDelete = (record) => {
34020
34030
  if (record.type == "3") {
@@ -34081,7 +34091,6 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
34081
34091
  return (_ctx, _cache) => {
34082
34092
  const _component_a_auto_complete = AutoComplete;
34083
34093
  const _component_a_form_item = FormItem;
34084
- const _component_uc_btn_search = resolveComponent("uc-btn-search");
34085
34094
  const _component_a_button = Button$1;
34086
34095
  const _component_a_form = Form;
34087
34096
  const _component_a_tooltip = Tooltip;
@@ -34122,10 +34131,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
34122
34131
  _: 1
34123
34132
  }, 8, ["label"]),
34124
34133
  createElementVNode("div", _hoisted_3$7, [
34125
- createVNode(_component_uc_btn_search, {
34126
- onClick: queryById,
34127
- showInput: false
34128
- }),
34134
+ createCommentVNode(' <uc-btn-search\r\n @click="queryById"\r\n :showInput="false"\r\n ></uc-btn-search> '),
34129
34135
  createVNode(_component_a_button, {
34130
34136
  onClick: handleReset,
34131
34137
  style: { "margin-left": "8px" }
@@ -34174,7 +34180,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
34174
34180
  }, toDisplayString(_ctx.$t("uc_organ.type" + row.type)), 3),
34175
34181
  withDirectives(createVNode(_component_a_button, {
34176
34182
  type: "link",
34177
- onClick: ($event) => onDetail(row)
34183
+ onClick: ($event) => onDetail(row),
34184
+ class: "wrap-btn"
34178
34185
  }, {
34179
34186
  default: withCtx(() => [
34180
34187
  createTextVNode(toDisplayString(row.name), 1)
@@ -34183,7 +34190,10 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
34183
34190
  }, 1032, ["onClick"]), [
34184
34191
  [vShow, !row.operationPermissions && row.type != "3"]
34185
34192
  ]),
34186
- withDirectives(createElementVNode("span", { style: { "padding-left": "16px" } }, toDisplayString(row.name), 513), [
34193
+ withDirectives(createElementVNode("span", {
34194
+ style: { "padding-left": "16px" },
34195
+ class: "wrap-btn"
34196
+ }, toDisplayString(row.name), 513), [
34187
34197
  [vShow, !row.operationPermissions && row.type == "3"]
34188
34198
  ]),
34189
34199
  createVNode(_component_a_tooltip, { placement: "top" }, {