@indfnd/common 1.0.25 → 1.0.36

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,8 +1,8 @@
1
1
  import { Button as Button$1, ButtonGroup as ButtonGroup$1, Input, Drawer as Drawer$1, Dropdown as Dropdown$1, Modal as Modal$1, Form, FormItem, Select as Select$1, Option, Row, Col, Menu, MenuItem, Badge, DropdownMenu, DropdownItem, Submenu, Tag, Header, Layout, Content, Spin, Poptip as Poptip$1, CheckboxGroup, Checkbox, RadioGroup, Radio, Card, Message, LoadingBar } from "view-design";
2
- import { isNil, formatDate as formatDate$1, useConfig, getQuarterNum, formatQuarter, str2Date, isDate, isArray, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, isFunction, isString, uuid, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, getPermissionCache, listItemTreeApi, getPriceInfo, MIME_TYPE, base64ToBlob, putOssFileApi, isEqual, getCaptchaURL, getLocalStorage, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, getToken, putOssFileUrl, getOssFileUrl, responseInterceptors, listUserTreeApi, UC_ENUM, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, getSessionStorage, setSessionStorage, getAppListApi, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi, getIndexDescCache, listIndexDescApi, setIndexDescCache } from "@indfnd/utils";
2
+ import { isNil, formatDate as formatDate$1, useConfig, getQuarterNum, formatQuarter, str2Date, isDate, isArray, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, isFunction, isString, uuid, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, getPermissionCache, listItemTreeApi, getPriceInfo, MIME_TYPE, base64ToBlob, putOssFileApi, isEqual, getCaptchaURL, getLocalStorage, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, getToken, putOssFileUrl, getOssFileUrl, responseInterceptors, listComTreeApi, listUserTreeApi, UC_ENUM, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, getSessionStorage, setSessionStorage, getAppListApi, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi, getIndexDescCache, listIndexDescApi, setIndexDescCache } from "@indfnd/utils";
3
3
  import Vue$1 from "vue";
4
4
  const name$1 = "@indfnd/common";
5
- const version = "1.0.24";
5
+ const version = "1.0.35";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -48589,6 +48589,7 @@ var FormImpl = {
48589
48589
  searchLoading: Boolean,
48590
48590
  queryBtn: { type: Boolean, default: true },
48591
48591
  resetBtn: { type: Boolean, default: true },
48592
+ scopedSlots: Object,
48592
48593
  formCacheList: Array,
48593
48594
  curCacheId: String,
48594
48595
  formEnumData: Object
@@ -49176,7 +49177,12 @@ var FormImpl = {
49176
49177
  prop: d.formKey
49177
49178
  }
49178
49179
  },
49179
- [itemInner]
49180
+ [
49181
+ this.scopedSlots[d.formKey] ? this.scopedSlots[d.formKey]({
49182
+ form: this.form,
49183
+ item: d
49184
+ }) : itemInner
49185
+ ]
49180
49186
  )
49181
49187
  ]
49182
49188
  )
@@ -49919,7 +49925,7 @@ var render$15 = function() {
49919
49925
  var _vm = this;
49920
49926
  var _h = _vm.$createElement;
49921
49927
  var _c = _vm._self._c || _h;
49922
- return _c("div", { staticClass: "ind-form-wrap" }, [_c("FormImpl", _vm._g(_vm._b({ ref: "form", attrs: { "funId": (_vm.funId || "") + "-" + _vm.$route.meta.permissionId, "formCacheList": _vm.formCacheList, "curCacheId": _vm.curCacheId, "formEnumData": _vm.formEnumData, "value": _vm.value, "fieldList": _vm.fieldList }, on: { "update:formEnumData": function($event) {
49928
+ return _c("div", { staticClass: "ind-form-wrap" }, [_c("FormImpl", _vm._g(_vm._b({ ref: "form", attrs: { "funId": (_vm.funId || "") + "-" + _vm.$route.meta.permissionId, "formCacheList": _vm.formCacheList, "curCacheId": _vm.curCacheId, "formEnumData": _vm.formEnumData, "value": _vm.value, "fieldList": _vm.fieldList, "scopedSlots": _vm.$scopedSlots }, on: { "update:formEnumData": function($event) {
49923
49929
  _vm.formEnumData = $event;
49924
49930
  }, "update:form-enum-data": function($event) {
49925
49931
  _vm.formEnumData = $event;
@@ -51069,6 +51075,12 @@ var Tooltip = /* @__PURE__ */ function() {
51069
51075
  }();
51070
51076
  function tableTooltipRender(h, value, opts = {}) {
51071
51077
  const { clickable, params, onClick } = opts;
51078
+ const colDef = params.colDef || {};
51079
+ const data = params.data;
51080
+ const cellRendererParams = colDef.cellRendererParams || {};
51081
+ const tooltipContentDef = cellRendererParams.tooltipContent;
51082
+ const tooltipContent = tooltipContentDef instanceof Function ? tooltipContentDef(data) : tooltipContentDef;
51083
+ console.log("tooltipContent", tooltipContent);
51072
51084
  let text_render;
51073
51085
  if (clickable) {
51074
51086
  text_render = h(
@@ -51106,7 +51118,7 @@ function tableTooltipRender(h, value, opts = {}) {
51106
51118
  {
51107
51119
  slot: "content"
51108
51120
  },
51109
- [value]
51121
+ [tooltipContent || value]
51110
51122
  )
51111
51123
  ]
51112
51124
  );
@@ -51114,7 +51126,7 @@ function tableTooltipRender(h, value, opts = {}) {
51114
51126
  const __vue2_script$1b = {
51115
51127
  name: "IndAgTooltip",
51116
51128
  render(h) {
51117
- return tableTooltipRender(h, this.params.value);
51129
+ return tableTooltipRender(h, this.params.value, { params: this.params });
51118
51130
  }
51119
51131
  };
51120
51132
  let __vue2_render$a, __vue2_staticRenderFns$a;
@@ -51510,7 +51522,7 @@ const __vue2_script$14 = {
51510
51522
  }
51511
51523
  text = text || "";
51512
51524
  if (tooltip) {
51513
- return tableTooltipRender(h, text);
51525
+ return tableTooltipRender(h, text, { params: this.params });
51514
51526
  }
51515
51527
  return h("span", text);
51516
51528
  }
@@ -52239,7 +52251,7 @@ var render$$ = function() {
52239
52251
  _vm.checkAllGroup = $$v;
52240
52252
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
52241
52253
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
52242
- }), _c("br"), _c("br"), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnSave } }, [_vm._v("\u4FDD \u5B58")]), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnClear } }, [_vm._v("\u6E05 \u9664")])], 2), _c("Button", { directives: [{ name: "show", rawName: "v-show", value: _vm.btnSel != "1", expression: "btnSel != '1'" }], staticStyle: { "position": "absolute", "top": "10px", "right": "10px" }, attrs: { "type": "primary", "icon": "md-close", "size": "small", "title": "\u5173\u95ED" }, on: { "click": _vm.closeTableSettingDropdown } })], 1)], 1)], 1)])], 2)], 1), _c("IndLoadingPanel", { attrs: { "loading": _vm.tableLoading } }, [!_vm.refreshTable ? _c("ag-grid-vue", _vm._g(_vm._b({ ref: "tableRef", staticClass: "ag-theme-balham", style: { height: _vm.height && !_vm.fullSreen ? _vm.height + "px" : "100%" }, attrs: { "id": "agTable", "suppressCellFocus": true, "suppressMenu": true, "suppressContextMenu": !_vm.showTableOption, "defaultColDef": _vm.defaultColDef, "headerHeight": _vm.headerHeight, "rowHeight": _vm.getRowHeight(), "getRowHeight": _vm.getRowHeight, "rowData": _vm.rowDataFiltered, "suppressRowClickSelection": (_vm.isPc || _vm.isEditTable) && _vm.rowSelection == "multiple" || _vm.suppressRowClickSelection, "rowSelection": _vm.rowSelection, "rowMultiSelectWithClick": !_vm.isPc && !_vm.isEditTable && (_vm.rowSelection == "multiple" || _vm.rowMultiSelectWithClick), "columnDefs": _vm.tableColumns, "localeText": _vm.localeText, "singleClickEdit": true, "pinnedTopRowData": _vm.topRows, "pinnedBottomRowData": _vm.pinnedBottomRowData, "suppressRowTransform": true, "stopEditingWhenCellsLoseFocus": true, "getRowClass": _vm.getRowClassCommon, "getRowId": _vm.getRowId, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.noRowsTemplate || _vm.overlayNoRowsTemplate, "treeData": _vm.treeData, "getDataPath": _vm.getDataPath, "autoGroupColumnDef": _vm.autoGroupColumnDef, "groupDisplayType": _vm.groupDisplayType, "groupSelectsChildren": _vm.groupSelectsChildren, "groupDefaultExpanded": _vm.groupDefaultExpanded, "getContextMenuItems": _vm.getContextMenuItems }, on: { "sortChanged": _vm.sortChanged, "selection-changed": _vm.selectionChanged, "rowSelected": _vm.rowSelected, "grid-ready": _vm.onGridReady, "cellClicked": _vm.cellClicked, "cellDoubleClicked": _vm.cellDoubleClicked } }, "ag-grid-vue", _vm.$attrs, false), _vm.$listeners)) : _vm._e()], 1), _vm.showBottom ? _c("div", { ref: "bottom" }, [_c("Row", [_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "span": "18" } }, [_c("Page", { directives: [{ name: "show", rawName: "v-show", value: !_vm.disablePage, expression: "!disablePage" }], attrs: { "size": "small", "total": _vm.totalNumber, "current": _vm.currentPage, "page-size": _vm.limitNumber, "show-sizer": "", "show-total": "", "show-elevator": "" }, on: { "on-change": _vm.onPageChange, "on-page-size-change": _vm.onPageSizeChange } }), _c("span", { directives: [{ name: "show", rawName: "v-show", value: _vm.disablePage, expression: "disablePage" }] }, [_vm._v("\u5171 " + _vm._s(_vm.tableData.length) + " \u6761\u6570\u636E")])], 1)], 1)], 1) : _vm._e()], 1);
52254
+ }), _c("br"), _c("br"), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnSave } }, [_vm._v("\u4FDD \u5B58")]), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnClear } }, [_vm._v("\u6E05 \u9664")])], 2), _c("Button", { directives: [{ name: "show", rawName: "v-show", value: _vm.btnSel != "1", expression: "btnSel != '1'" }], staticStyle: { "position": "absolute", "top": "10px", "right": "10px" }, attrs: { "type": "primary", "icon": "md-close", "size": "small", "title": "\u5173\u95ED" }, on: { "click": _vm.closeTableSettingDropdown } })], 1)], 1)], 1)])], 2)], 1), _c("IndLoadingPanel", { attrs: { "loading": _vm.tableLoading } }, [!_vm.refreshTable ? _c("ag-grid-vue", _vm._g(_vm._b({ ref: "tableRef", staticClass: "ag-theme-balham", style: { height: _vm.height && !_vm.fullSreen ? _vm.height + "px" : "100%" }, attrs: { "id": "agTable", "suppressCellFocus": true, "suppressMenu": true, "suppressContextMenu": !_vm.showTableOption, "defaultColDef": _vm.defaultColDef, "headerHeight": _vm.headerHeight, "rowHeight": _vm.getRowHeightProp ? _vm.getRowHeightProp() : _vm.getRowHeight(), "getRowHeight": _vm.getRowHeightProp || _vm.getRowHeight, "rowData": _vm.rowDataFiltered, "suppressRowClickSelection": (_vm.isPc || _vm.isEditTable) && _vm.rowSelection == "multiple" || _vm.suppressRowClickSelection, "rowSelection": _vm.rowSelection, "rowMultiSelectWithClick": !_vm.isPc && !_vm.isEditTable && (_vm.rowSelection == "multiple" || _vm.rowMultiSelectWithClick), "columnDefs": _vm.tableColumns, "localeText": _vm.localeText, "singleClickEdit": true, "pinnedTopRowData": _vm.topRows, "pinnedBottomRowData": _vm.pinnedBottomRowData, "suppressRowTransform": true, "stopEditingWhenCellsLoseFocus": true, "getRowClass": _vm.getRowClassCommon, "getRowId": _vm.getRowId, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.noRowsTemplate || _vm.overlayNoRowsTemplate, "treeData": _vm.treeData, "getDataPath": _vm.getDataPath, "autoGroupColumnDef": _vm.autoGroupColumnDef, "groupDisplayType": _vm.groupDisplayType, "groupSelectsChildren": _vm.groupSelectsChildren, "groupDefaultExpanded": _vm.groupDefaultExpanded, "getContextMenuItems": _vm.getContextMenuItems }, on: { "sortChanged": _vm.sortChanged, "selection-changed": _vm.selectionChanged, "rowSelected": _vm.rowSelected, "grid-ready": _vm.onGridReady, "cellClicked": _vm.cellClicked, "cellDoubleClicked": _vm.cellDoubleClicked } }, "ag-grid-vue", _vm.$attrs, false), _vm.$listeners)) : _vm._e()], 1), _vm.showBottom ? _c("div", { ref: "bottom" }, [_c("Row", [_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "span": "18" } }, [_c("Page", { directives: [{ name: "show", rawName: "v-show", value: !_vm.disablePage, expression: "!disablePage" }], attrs: { "size": "small", "total": _vm.totalNumber, "current": _vm.currentPage, "page-size": _vm.limitNumber, "show-sizer": "", "show-total": "", "show-elevator": "" }, on: { "on-change": _vm.onPageChange, "on-page-size-change": _vm.onPageSizeChange } }), _c("span", { directives: [{ name: "show", rawName: "v-show", value: _vm.disablePage, expression: "disablePage" }] }, [_vm._v("\u5171 " + _vm._s(_vm.tableData.length) + " \u6761\u6570\u636E")])], 1)], 1)], 1) : _vm._e()], 1);
52243
52255
  };
52244
52256
  var staticRenderFns$$ = [];
52245
52257
  function suppressNavigation$1(params) {
@@ -52331,6 +52343,9 @@ const __vue2_script$10 = {
52331
52343
  AgImage
52332
52344
  },
52333
52345
  props: {
52346
+ rowHeight: Number,
52347
+ headerHeight: Number,
52348
+ getRowHeightProp: Function,
52334
52349
  rowSpanDefs: Array,
52335
52350
  headerHeight: {
52336
52351
  type: Number,
@@ -53182,7 +53197,8 @@ const __vue2_script$10 = {
53182
53197
  pinned: column.fixed || column.pinned,
53183
53198
  cellDataType: column.cellDataType || "text",
53184
53199
  headerTooltip: (_c = (_b = (_a = this.$store) == null ? void 0 : _a.getters) == null ? void 0 : _b.getIndexDesc) == null ? void 0 : _c[column.standardField || column.key || column.field],
53185
- suppressStickyLabel: true
53200
+ suppressStickyLabel: true,
53201
+ suppressMovable: !!column.suppressMovable
53186
53202
  };
53187
53203
  if (column.flex) {
53188
53204
  agColumn.flex = column.flex;
@@ -53389,13 +53405,18 @@ const __vue2_script$10 = {
53389
53405
  agColumn.valueSetter = column.valueSetter;
53390
53406
  } else if (column.valueSetter) {
53391
53407
  agColumn.valueSetter = (params) => {
53408
+ const { newValue, data, colDef } = params;
53409
+ if (this.isRevertingOldValue) {
53410
+ data[colDef.field || colDef.key] = newValue;
53411
+ return true;
53412
+ }
53392
53413
  const isValid = column.valueSetter(params);
53393
53414
  if (!isValid) {
53394
- const { newValue, oldValue, data, colDef, column: column2 } = params;
53415
+ const { oldValue, column: agValueSetterColumn } = params;
53395
53416
  this.isRevertingOldValue = true;
53396
53417
  data[colDef.field || colDef.key] = newValue;
53397
53418
  setTimeout(() => {
53398
- params.node.setDataValue(column2, oldValue);
53419
+ params.node.setDataValue(agValueSetterColumn, oldValue);
53399
53420
  this.isRevertingOldValue = false;
53400
53421
  }, 0);
53401
53422
  }
@@ -53606,57 +53627,70 @@ const __vue2_script$10 = {
53606
53627
  },
53607
53628
  renderSumRow: _.debounce(async function() {
53608
53629
  var _a;
53609
- let hasSumRow = this.flatColumns.some((item2) => item2.isSum);
53630
+ let hasSumRow = _.some(this.flatColumns, (item2) => item2.isSum);
53610
53631
  if (hasSumRow) {
53611
53632
  console.time("calcSum");
53633
+ let sumCols = _.filter(this.flatColumns, (item2) => item2.isSum);
53634
+ let sumCalcCols = _.remove(sumCols, (item2) => isString(item2.isSum));
53635
+ let sumFuncCols = _.remove(sumCols, (item2) => item2.isSum instanceof Function);
53636
+ const sumCalcRuleMap = {};
53637
+ _.forEach(sumCalcCols, (col) => {
53638
+ addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
53639
+ });
53612
53640
  let sumData = {};
53613
- for (let col of this.flatColumns) {
53614
- if (!["checkbox", "radios", "index"].includes(col.type)) {
53615
- sumData[col.field || col.key] = "\u5408\u8BA1";
53641
+ for (let i = 0; i < this.flatColumns.length; i++) {
53642
+ if (!["checkbox", "radios", "index"].includes((_a = this.flatColumns[i]) == null ? void 0 : _a.type)) {
53643
+ let colTmp = this.flatColumns[i];
53644
+ sumData[colTmp.field || colTmp.key] = "\u5408\u8BA1";
53616
53645
  break;
53617
53646
  }
53618
53647
  }
53619
- let sumCols = this.flatColumns.filter((item2) => item2.isSum);
53620
- let sumCalcCols = [], sumFuncCols = [];
53621
- sumCols.forEach((col) => {
53622
- if (typeof col.isSum === "string")
53623
- sumCalcCols.push(col);
53624
- else if (col.isSum instanceof Function)
53625
- sumFuncCols.push(col);
53626
- });
53627
- const sumCalcRuleMap = {};
53628
- sumCalcCols.forEach((col) => {
53629
- addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
53630
- });
53631
- sumCols.forEach((col) => {
53632
- if (!(col.field || col.key) in sumData)
53633
- sumData[col.field || col.key] = 0;
53634
- });
53635
- this.rowDataFiltered.forEach((d) => {
53636
- sumCols.forEach((dd) => {
53637
- if (typeof dd.isSum === "string")
53638
- return;
53639
- let field = dd.field || dd.key;
53640
- let value = d[field];
53641
- if (typeof value === "number" && !isNaN(value)) {
53642
- sumData[field] = (sumData[field] || 0) + value;
53643
- }
53644
- });
53645
- });
53646
- sumFuncCols.forEach((col) => {
53647
- sumData[col.field || col.key] = col.isSum(this.rowDataFiltered, col);
53648
+ sumCols.forEach((d) => sumData[d.field || d.key] = 0);
53649
+ sumData = _.reduce(
53650
+ this.rowDataFiltered,
53651
+ (s, d, idx) => {
53652
+ sumCols.forEach((dd) => {
53653
+ if (isString(dd.isSum))
53654
+ return;
53655
+ let field = dd.field || dd.key;
53656
+ let rowMergeInfo = this.tableRowSpanMergeIndexMap[field];
53657
+ let mergedRows = [];
53658
+ _.forEach(rowMergeInfo, (v, k) => {
53659
+ let rows2 = _.range(k, parseInt(k) + v);
53660
+ mergedRows.push(...rows2.slice(1));
53661
+ });
53662
+ if (!mergedRows.includes(idx)) {
53663
+ sumData[field] = _.round(
53664
+ sumData[field] + (!d[field] || isNaN(d[field]) ? 0 : parseFloat(d[field])),
53665
+ 6
53666
+ );
53667
+ }
53668
+ });
53669
+ return s;
53670
+ },
53671
+ sumData
53672
+ );
53673
+ _.forEach(sumFuncCols, (d) => {
53674
+ sumData[d.field || d.key] = d.isSum(this.rowDataFiltered, d);
53648
53675
  });
53649
53676
  let sumRows = [sumData];
53677
+ let calcRules = {};
53678
+ _.forEach(sumCalcRuleMap, (v, k) => {
53679
+ _.merge(calcRules, v);
53680
+ });
53650
53681
  let rules = [];
53651
- for (let key in sumCalcRuleMap) {
53652
- let column = sumCalcCols.find((col) => col.field === key || col.key === key);
53682
+ _.forEach(calcRules, (v, k) => {
53683
+ var _a2;
53684
+ let column = _.find(sumCalcCols, (d) => {
53685
+ return d.field == k || d.key == k;
53686
+ });
53653
53687
  rules.push({
53654
- rltKey: key,
53655
- ast: sumCalcRuleMap[key],
53656
- precision: ((_a = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a.scale) || 2,
53688
+ rltKey: k,
53689
+ ast: v,
53690
+ precision: ((_a2 = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a2.scale) || 2,
53657
53691
  errRtn: 0
53658
53692
  });
53659
- }
53693
+ });
53660
53694
  let options = { calcRules: rules };
53661
53695
  calcDatas(sumRows, options);
53662
53696
  this.topRows = this.pinnedTopRowDataWithUnit ? _.concat(this.pinnedTopRowDataWithUnit, sumRows) : sumRows;
@@ -55058,13 +55092,18 @@ const __vue2_script$$ = {
55058
55092
  agColumn.valueSetter = column.valueSetter;
55059
55093
  } else if (column.valueSetter) {
55060
55094
  agColumn.valueSetter = (params) => {
55095
+ const { newValue, data, colDef } = params;
55096
+ if (this.isRevertingOldValue) {
55097
+ data[colDef.field || colDef.key] = newValue;
55098
+ return true;
55099
+ }
55061
55100
  const isValid = column.valueSetter(params);
55062
55101
  if (!isValid) {
55063
- const { newValue, oldValue, data, colDef, column: column2 } = params;
55102
+ const { oldValue, column: agValueSetterColumn } = params;
55064
55103
  this.isRevertingOldValue = true;
55065
55104
  data[colDef.field || colDef.key] = newValue;
55066
55105
  setTimeout(() => {
55067
- params.node.setDataValue(column2, oldValue);
55106
+ params.node.setDataValue(agValueSetterColumn, oldValue);
55068
55107
  this.isRevertingOldValue = false;
55069
55108
  }, 0);
55070
55109
  }
@@ -55274,7 +55313,6 @@ const __vue2_script$$ = {
55274
55313
  });
55275
55314
  },
55276
55315
  renderSumRow: _.debounce(async function() {
55277
- var _a;
55278
55316
  let hasSumRow = this.flatColumns.some((item2) => item2.isSum);
55279
55317
  if (hasSumRow) {
55280
55318
  console.time("calcSum");
@@ -55316,16 +55354,23 @@ const __vue2_script$$ = {
55316
55354
  sumData[col.field || col.key] = col.isSum(this.rowDataFiltered, col);
55317
55355
  });
55318
55356
  let sumRows = [sumData];
55357
+ let calcRules = {};
55358
+ _.forEach(sumCalcRuleMap, (v, k) => {
55359
+ _.merge(calcRules, v);
55360
+ });
55319
55361
  let rules = [];
55320
- for (let key in sumCalcRuleMap) {
55321
- let column = sumCalcCols.find((col) => col.field === key || col.key === key);
55362
+ _.forEach(calcRules, (v, k) => {
55363
+ var _a;
55364
+ let column = _.find(sumCalcCols, (d) => {
55365
+ return d.field == k || d.key == k;
55366
+ });
55322
55367
  rules.push({
55323
- rltKey: key,
55324
- ast: sumCalcRuleMap[key],
55368
+ rltKey: k,
55369
+ ast: v,
55325
55370
  precision: ((_a = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a.scale) || 2,
55326
55371
  errRtn: 0
55327
55372
  });
55328
- }
55373
+ });
55329
55374
  let options = { calcRules: rules };
55330
55375
  calcDatas(sumRows, options);
55331
55376
  this.topRows = this.pinnedTopRowDataWithUnit ? _.concat(this.pinnedTopRowDataWithUnit, sumRows) : sumRows;
@@ -65929,9 +65974,6 @@ var uploadImg = /* @__PURE__ */ function() {
65929
65974
  return __component__$2.exports;
65930
65975
  }();
65931
65976
  const CONTEXT$1 = `${config.imgServerContext}/system/auths`;
65932
- function getAuthDetaileTypeApi$1(params) {
65933
- return axios.get(`${CONTEXT$1}/getAuthDetaileType`, { params });
65934
- }
65935
65977
  function getRoleListApi(params) {
65936
65978
  return axios.get(`${CONTEXT$1}/getRoleList`, { params });
65937
65979
  }
@@ -65959,11 +66001,9 @@ var render$1 = function() {
65959
66001
  var _c = _vm._self._c || _h;
65960
66002
  return _c("IndPageView", [_c("Row", { staticClass: "row-contain", attrs: { "gutter": 16 } }, [_c("Col", { attrs: { "span": "8" } }, [_c("IndTable", { ref: "table", attrs: { "disablePage": "", "columns": _vm.tableColumns, "dataApi": _vm.dataApi, "search-params": _vm.searchParams, "rowKey": "roleId", "auto-refresh": "" }, on: { "on-data-load": _vm.tableDataLoad, "on-select-change": _vm.tableSelectChange }, scopedSlots: _vm._u([{ key: "buttons", fn: function() {
65961
66003
  return [_c("IndButton", { attrs: { "bizType": "table" }, on: { "click": _vm.addRole } }, [_vm._v("\u65B0\u589E")])];
65962
- }, proxy: true }]) })], 1), _c("Col", { attrs: { "span": "16" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.userAuthLoading } }, [_c("div", { staticClass: "ind-flex-no-shrink important-tip" }, [_c("Icon", { attrs: { "type": "md-information-circle" } }), _c("span", { attrs: { "name": "importanttip" } }, [_vm._v("\u5F53\u524D\u9009\u4E2D\u89D2\u8272\uFF1A"), _c("span", { staticClass: "ind-blue" }, [_vm._v(_vm._s(_vm.selectedRole ? _vm.selectedRole.roleName : ""))])])], 1), _c("div", { staticClass: "ind-flex-grow content" }, [_c("Row", { attrs: { "gutter": 16 } }, [_c("Col", { attrs: { "span": "12" } }, [!_vm.userAuthLoading ? _c("IndTree", { ref: "userTree", attrs: { "data": _vm.userTreeData, "default-value": _vm.defaultUserId, "multiple": "", "show-checkbox": "", "defaultExpandLevel": 1, "isShowHeader": true, "treeName": "\u7CFB\u7EDF\u7528\u6237\uFF1A[\u90E8\u95E8(\u5DF2\u8BBE\u4EBA\u6570/\u603B\u4EBA\u6570)] \u3001[\u7528\u6237(\u89D2\u82721,\u89D2\u82722...)]" } }) : _vm._e()], 1), _c("Col", { attrs: { "span": "12" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.authTreeLoading } }, [_c("div", { staticClass: "auth-type-select-container" }, [_c("Row", [_c("Col", [_c("span", { staticClass: "auth-type-label" }, [_vm._v("\u6743\u9650\u7C7B\u578B\uFF1A")])]), _c("Col", [_c("div", { staticClass: "auth-type-value" }, [_c("IndSelect", { attrs: { "filterable": "" }, model: { value: _vm.authDetaileTypeParam, callback: function($$v) {
65963
- _vm.authDetaileTypeParam = $$v;
65964
- }, expression: "authDetaileTypeParam" } }, _vm._l(_vm.authDetaileTypes, function(type) {
65965
- return _c("IndOption", { key: type.value, attrs: { "value": type.value } }, [_vm._v(" " + _vm._s(type.label) + " ")]);
65966
- }), 1)], 1)])], 1)], 1), !_vm.userAuthLoading ? _c("IndTree", { ref: "authTree", attrs: { "data": _vm.authTreeData, "default-value": _vm.defaultAuthId, "multiple": "", "show-checkbox": "", "expandAll": "", "isShowHeader": false } }) : _vm._e()], 1)], 1)], 1)], 1), _c("div", { staticClass: "ind-flex-no-shrink function-wrapper" }, [_c("IndButtonGroup", { attrs: { "center": "" } }, [_c("IndButton", { attrs: { "bizType": "save", "loading": _vm.saveLoading }, on: { "click": _vm.saveUsersAuths } })], 1)], 1)])], 1)], 1), _c("IndModal", { attrs: { "lazyRender": false, "title": "\u89D2\u8272\u7F16\u8F91", "saving": _vm.saveRoleLoading }, on: { "on-ok": _vm.saveRole }, model: { value: _vm.showEditRole, callback: function($$v) {
66004
+ }, proxy: true }]) })], 1), _c("Col", { attrs: { "span": "16" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.userAuthLoading } }, [_c("div", { staticClass: "ind-flex-no-shrink important-tip" }, [_c("Icon", { attrs: { "type": "md-information-circle" } }), _c("span", { attrs: { "name": "importanttip" } }, [_vm._v("\u5F53\u524D\u9009\u4E2D\u89D2\u8272\uFF1A"), _c("span", { staticClass: "ind-blue" }, [_vm._v(_vm._s(_vm.selectedRole ? _vm.selectedRole.roleName : ""))])])], 1), _c("div", { staticClass: "ind-flex-grow content" }, [_c("Row", { attrs: { "gutter": 16 } }, [_c("Col", { attrs: { "span": "12" } }, [!_vm.userAuthLoading ? _c("IndTree", { ref: "userTree", attrs: { "data": _vm.userTreeData, "default-value": _vm.defaultUserId, "multiple": "", "show-checkbox": "", "defaultExpandLevel": 1, "isShowHeader": true, "treeName": "\u7CFB\u7EDF\u7528\u6237\uFF1A[\u90E8\u95E8(\u5DF2\u8BBE\u4EBA\u6570/\u603B\u4EBA\u6570)] \u3001[\u7528\u6237(\u89D2\u82721,\u89D2\u82722...)]" } }) : _vm._e()], 1), _c("Col", { attrs: { "span": "12" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.authTreeLoading } }, [_c("div", { staticClass: "auth-type-select-container" }, [_c("Row", [_c("Col", [_c("IndFormWrap", { ref: "authDetaileTypeForm", attrs: { "fieldList": _vm.authDetaileTypeField, "gridColumns": 1 }, model: { value: _vm.authDetaileTypeForm, callback: function($$v) {
66005
+ _vm.authDetaileTypeForm = $$v;
66006
+ }, expression: "authDetaileTypeForm" } })], 1)], 1)], 1), !_vm.userAuthLoading ? _c("IndTree", { ref: "authTree", attrs: { "data": _vm.authTreeData, "default-value": _vm.defaultAuthId, "multiple": "", "show-checkbox": "", "expandAll": "", "isShowHeader": false } }) : _vm._e()], 1)], 1)], 1)], 1), _c("div", { staticClass: "ind-flex-no-shrink function-wrapper" }, [_c("IndButtonGroup", { attrs: { "center": "" } }, [_c("IndButton", { attrs: { "bizType": "save", "loading": _vm.saveLoading }, on: { "click": _vm.saveUsersAuths } })], 1)], 1)])], 1)], 1), _c("IndModal", { attrs: { "lazyRender": false, "title": "\u89D2\u8272\u7F16\u8F91", "saving": _vm.saveRoleLoading }, on: { "on-ok": _vm.saveRole }, model: { value: _vm.showEditRole, callback: function($$v) {
65967
66007
  _vm.showEditRole = $$v;
65968
66008
  }, expression: "showEditRole" } }, [_c("div", { staticClass: "ivu-biz-form-row" }, [_c("IndFormWrap", { ref: "basicForm", attrs: { "fieldList": _vm.formFields, "gridColumns": 1 }, model: { value: _vm.formData, callback: function($$v) {
65969
66009
  _vm.formData = $$v;
@@ -65983,7 +66023,6 @@ const __vue2_script$1 = {
65983
66023
  props: {
65984
66024
  authModule: { type: String, required: true },
65985
66025
  authType: { type: String, required: true },
65986
- authDetaileType: { type: String, required: true },
65987
66026
  authTreeApiParams: { type: Object, required: true },
65988
66027
  authTreeApi: { type: Function, required: true }
65989
66028
  },
@@ -66019,22 +66058,38 @@ const __vue2_script$1 = {
66019
66058
  title: "\u64CD\u4F5C",
66020
66059
  align: "center",
66021
66060
  width: 140,
66022
- type: "button",
66023
- cellRendererParams: {
66024
- datas: (row) => {
66025
- return [
66026
- {
66027
- btnName: "\u4FEE\u6539",
66028
- bizType: "table",
66029
- btnClick: () => this.editRole(row)
66030
- },
66031
- {
66032
- btnName: "\u5220\u9664",
66033
- bizType: "table-delete",
66034
- btnClick: () => this.deleteRole(row)
66035
- }
66036
- ];
66037
- }
66061
+ cellRenderer: (row) => {
66062
+ const container = document.createElement("div");
66063
+ container.style.display = "flex";
66064
+ container.style.justifyContent = "center";
66065
+ container.classList.add("ag-button");
66066
+ const editButton = document.createElement("button");
66067
+ editButton.textContent = "\u4FEE\u6539";
66068
+ editButton.style.margin = "0 3px";
66069
+ editButton.type = "button";
66070
+ editButton.classList.add("ivu-btn");
66071
+ editButton.classList.add("ivu-btn-primary");
66072
+ editButton.classList.add("ivu-btn-small");
66073
+ editButton.classList.add("ivu-btn-ghost");
66074
+ editButton.addEventListener("click", (event) => {
66075
+ event.stopPropagation();
66076
+ this.editRole(row.data);
66077
+ });
66078
+ container.appendChild(editButton);
66079
+ const deleteButton = document.createElement("button");
66080
+ deleteButton.textContent = "\u5220\u9664";
66081
+ deleteButton.style.margin = "0 3px";
66082
+ deleteButton.type = "button";
66083
+ deleteButton.classList.add("ivu-btn");
66084
+ deleteButton.classList.add("ivu-btn-error");
66085
+ deleteButton.classList.add("ivu-btn-small");
66086
+ deleteButton.classList.add("ivu-btn-ghost");
66087
+ deleteButton.addEventListener("click", (event) => {
66088
+ event.stopPropagation();
66089
+ this.deleteRole(row.data);
66090
+ });
66091
+ container.appendChild(deleteButton);
66092
+ return container;
66038
66093
  }
66039
66094
  }
66040
66095
  ],
@@ -66095,44 +66150,49 @@ const __vue2_script$1 = {
66095
66150
  saveRoleLoading: false,
66096
66151
  tableDataSize: 1,
66097
66152
  saveLoading: false,
66098
- authDetaileTypes: [],
66099
- authDetaileTypeParam: this.authDetaileType,
66100
- authTreeLoading: false
66153
+ authDetaileTypeForm: {
66154
+ authDetaileTypeParam: []
66155
+ },
66156
+ authTreeLoading: false,
66157
+ authDetaileTypeField: [
66158
+ {
66159
+ formKey: "authDetaileTypeParam",
66160
+ title: "\u6743\u9650\u7C7B\u578B\uFF1A",
66161
+ type: "treeselect",
66162
+ props: {
66163
+ dataApi: listComTreeApi,
66164
+ urlParams: {
66165
+ bizType: "40",
66166
+ dataPermitType: JSON.stringify({
66167
+ authModule: this.authModule,
66168
+ authType: this.authType
66169
+ })
66170
+ }
66171
+ }
66172
+ }
66173
+ ]
66101
66174
  };
66102
66175
  },
66103
66176
  watch: {
66104
- authDetaileTypeParam() {
66105
- if (this.selectedRole) {
66106
- this.reloadAuthTree();
66107
- }
66177
+ "authDetaileTypeForm.authDetaileTypeParam": {
66178
+ handler: _.debounce(function(newVal) {
66179
+ if (this.selectedRole && newVal.length > 0) {
66180
+ this.reloadAuthTree();
66181
+ }
66182
+ }, 300),
66183
+ deep: true,
66184
+ immediate: true
66108
66185
  }
66109
66186
  },
66110
- created() {
66111
- this.initTypeData();
66112
- },
66113
66187
  methods: {
66114
- async initTypeData() {
66115
- try {
66116
- const params = {
66117
- authModule: this.authModule,
66118
- authType: this.authType
66119
- };
66120
- const response = await getAuthDetaileTypeApi$1(params);
66121
- const datas = response.data;
66122
- this.authDetaileTypes = datas.map((item2) => ({
66123
- label: item2.authDetaileTypeName,
66124
- value: item2.authDetaileType
66125
- }));
66126
- } catch (error) {
66127
- console.log("\u83B7\u53D6\u7EC6\u5206\u7C7B\u578Berror: " + error);
66128
- }
66129
- },
66130
66188
  query() {
66131
66189
  this.tableLoading = true;
66190
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66191
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66132
66192
  this.searchParams = {
66133
66193
  authModule: this.authModule,
66134
66194
  authType: this.authType,
66135
- authDetaileType: this.authDetaileTypeParam
66195
+ authDetaileType
66136
66196
  };
66137
66197
  },
66138
66198
  async tableDataLoad(data) {
@@ -66143,6 +66203,7 @@ const __vue2_script$1 = {
66143
66203
  tableSelectChange: _.debounce(function(selectedRows) {
66144
66204
  if (selectedRows.length) {
66145
66205
  this.selectedRole = selectedRows[0];
66206
+ this.authDetaileTypeForm.authDetaileTypeParam = [];
66146
66207
  this.getUserAuthTreeData(true);
66147
66208
  } else {
66148
66209
  this.selectedRole = null;
@@ -66199,10 +66260,12 @@ const __vue2_script$1 = {
66199
66260
  },
66200
66261
  async listUserRolesApi() {
66201
66262
  try {
66263
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66264
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66202
66265
  const params = {
66203
66266
  authModule: this.authModule,
66204
66267
  authType: this.authType,
66205
- authDetaileType: this.authDetaileTypeParam
66268
+ authDetaileType
66206
66269
  };
66207
66270
  const { data } = await listUserRolesApi(params);
66208
66271
  return data;
@@ -66252,11 +66315,13 @@ const __vue2_script$1 = {
66252
66315
  },
66253
66316
  async getRoleUsersAuths(roleId) {
66254
66317
  try {
66318
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66319
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66255
66320
  const params = {
66256
66321
  roleId,
66257
66322
  authModule: this.authModule,
66258
66323
  authType: this.authType,
66259
- authDetaileType: this.authDetaileTypeParam
66324
+ authDetaileType
66260
66325
  };
66261
66326
  const { data } = await detailAuthsUsersApi(params);
66262
66327
  return data;
@@ -66307,6 +66372,10 @@ const __vue2_script$1 = {
66307
66372
  }
66308
66373
  },
66309
66374
  async saveUsersAuths() {
66375
+ if (this.authDetaileTypeForm.authDetaileTypeParam.length == 0) {
66376
+ this.$Message.warning("\u8BF7\u9009\u62E9\u6743\u9650\u7C7B\u578B");
66377
+ return;
66378
+ }
66310
66379
  const userTreeNodes = this.$refs.userTree.getCheckedNodes(true) || [];
66311
66380
  const authTreeNodes = this.$refs.authTree.getCheckedNodes(true) || [];
66312
66381
  const roleUsers = userTreeNodes.filter((item2) => {
@@ -66338,8 +66407,11 @@ const __vue2_script$1 = {
66338
66407
  }
66339
66408
  try {
66340
66409
  this.saveLoading = true;
66410
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66411
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66341
66412
  await saveAuthsUsersApi({
66342
66413
  ...this.selectedRole,
66414
+ authDetaileType,
66343
66415
  roleUsers: roleUsers.length ? roleUsers.map((item2) => {
66344
66416
  return {
66345
66417
  authModule: this.authModule,
@@ -66352,7 +66424,7 @@ const __vue2_script$1 = {
66352
66424
  return {
66353
66425
  authModule: this.authModule,
66354
66426
  authType: this.authType,
66355
- authDetaileType: this.authDetaileTypeParam,
66427
+ authDetaileType,
66356
66428
  roleId: this.selectedRole.roleId,
66357
66429
  authId: item2.id
66358
66430
  };
@@ -66399,9 +66471,6 @@ var roleAuth = /* @__PURE__ */ function() {
66399
66471
  return __component__$1.exports;
66400
66472
  }();
66401
66473
  const CONTEXT = `${config.imgServerContext}/system/auths`;
66402
- function getAuthDetaileTypeApi(params) {
66403
- return axios.get(`${CONTEXT}/getAuthDetaileType`, { params });
66404
- }
66405
66474
  function getUserAuthsApi(params) {
66406
66475
  return axios.get(`${CONTEXT}/getUserAuths`, { params });
66407
66476
  }
@@ -66412,11 +66481,9 @@ var render = function() {
66412
66481
  var _vm = this;
66413
66482
  var _h = _vm.$createElement;
66414
66483
  var _c = _vm._self._c || _h;
66415
- return _c("IndPageView", [_c("Row", { staticClass: "row-contain", attrs: { "gutter": 16 } }, [_c("Col", { attrs: { "span": "12" } }, [_c("IndTree", { ref: "userTree", attrs: { "dataApi": _vm.userTreeApi, "url-params": _vm.userTreeParams, "default-value": _vm.defaultUserId, "isShowHeader": true, "selectLeafOnly": true, "defaultExpandLevel": 1, "treeName": "\u7CFB\u7EDF\u7528\u6237" }, on: { "on-select-change": _vm.onSelectUserChange } })], 1), _c("Col", { attrs: { "span": "12" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.userAuthLoading } }, [_c("div", { staticClass: "auth-type-select-container" }, [_c("Row", [_c("Col", [_c("span", { staticClass: "auth-type-label" }, [_vm._v("\u6743\u9650\u7C7B\u578B\uFF1A")])]), _c("Col", [_c("div", { staticClass: "auth-type-value" }, [_c("IndSelect", { attrs: { "filterable": "" }, model: { value: _vm.authDetaileTypeParam, callback: function($$v) {
66416
- _vm.authDetaileTypeParam = $$v;
66417
- }, expression: "authDetaileTypeParam" } }, _vm._l(_vm.authDetaileTypes, function(type) {
66418
- return _c("IndOption", { key: type.value, attrs: { "value": type.value } }, [_vm._v(_vm._s(type.label) + " ")]);
66419
- }), 1)], 1)])], 1)], 1), _c("div", { staticClass: "ind-flex-grow" }, [_c("IndTree", { ref: "authTree", attrs: { "data": _vm.authTreeData, "default-value": _vm.defaultAuthId, "multiple": "", "show-checkbox": "", "expandAll": "", "isShowHeader": false } })], 1), _c("div", { staticClass: "ind-flex-no-shrink function-wrapper" }, [_c("IndButtonGroup", { attrs: { "center": "" } }, [_c("IndButton", { attrs: { "bizType": "save", "disabled": _vm.btnDisAbled, "loading": _vm.saveLoading }, on: { "click": _vm.saveUserAuths } })], 1)], 1)])], 1)], 1)], 1);
66484
+ return _c("IndPageView", [_c("Row", { staticClass: "row-contain", attrs: { "gutter": 16 } }, [_c("Col", { attrs: { "span": "12" } }, [_c("IndTree", { ref: "userTree", attrs: { "dataApi": _vm.userTreeApi, "url-params": _vm.userTreeParams, "default-value": _vm.defaultUserId, "isShowHeader": true, "selectLeafOnly": true, "defaultExpandLevel": 1, "treeName": "\u7CFB\u7EDF\u7528\u6237" }, on: { "on-select-change": _vm.onSelectUserChange } })], 1), _c("Col", { attrs: { "span": "12" } }, [_c("IndLoadingPanel", { staticClass: "ind-flex-column", attrs: { "loading": _vm.userAuthLoading } }, [_c("div", { staticClass: "auth-type-select-container" }, [_c("Row", [_c("Col", [_c("IndFormWrap", { ref: "authDetaileTypeForm", attrs: { "fieldList": _vm.authDetaileTypeField, "gridColumns": 1 }, model: { value: _vm.authDetaileTypeForm, callback: function($$v) {
66485
+ _vm.authDetaileTypeForm = $$v;
66486
+ }, expression: "authDetaileTypeForm" } })], 1)], 1)], 1), _c("div", { staticClass: "ind-flex-grow" }, [_c("IndTree", { ref: "authTree", attrs: { "data": _vm.authTreeData, "default-value": _vm.defaultAuthId, "multiple": "", "show-checkbox": "", "expandAll": "", "isShowHeader": false } })], 1), _c("div", { staticClass: "ind-flex-no-shrink function-wrapper" }, [_c("IndButtonGroup", { attrs: { "center": "" } }, [_c("IndButton", { attrs: { "bizType": "save", "disabled": _vm.btnDisAbled, "loading": _vm.saveLoading }, on: { "click": _vm.saveUserAuths } })], 1)], 1)])], 1)], 1)], 1);
66420
66487
  };
66421
66488
  var staticRenderFns = [];
66422
66489
  const __vue2_script = {
@@ -66424,7 +66491,6 @@ const __vue2_script = {
66424
66491
  props: {
66425
66492
  authModule: { type: String, required: true },
66426
66493
  authType: { type: String, required: true },
66427
- authDetaileType: { type: String, required: true },
66428
66494
  authTreeApiParams: { type: Object, required: true },
66429
66495
  authTreeApi: { type: Function, required: true }
66430
66496
  },
@@ -66438,8 +66504,26 @@ const __vue2_script = {
66438
66504
  authTreeData: [],
66439
66505
  defaultAuthId: [],
66440
66506
  saveLoading: false,
66441
- authDetaileTypes: [],
66442
- authDetaileTypeParam: this.authDetaileType
66507
+ authDetaileTypeForm: {
66508
+ authDetaileTypeParam: []
66509
+ },
66510
+ authDetaileTypeField: [
66511
+ {
66512
+ formKey: "authDetaileTypeParam",
66513
+ title: "\u6743\u9650\u7C7B\u578B\uFF1A",
66514
+ type: "treeselect",
66515
+ props: {
66516
+ dataApi: listComTreeApi,
66517
+ urlParams: {
66518
+ bizType: "40",
66519
+ dataPermitType: JSON.stringify({
66520
+ authModule: this.authModule,
66521
+ authType: this.authType
66522
+ })
66523
+ }
66524
+ }
66525
+ }
66526
+ ]
66443
66527
  };
66444
66528
  },
66445
66529
  activated() {
@@ -66453,10 +66537,14 @@ const __vue2_script = {
66453
66537
  this.defaultAuthId = [];
66454
66538
  },
66455
66539
  watch: {
66456
- authDetaileTypeParam() {
66457
- if (this.selectUser) {
66458
- this.reloadAuthTree();
66459
- }
66540
+ "authDetaileTypeForm.authDetaileTypeParam": {
66541
+ handler: _.debounce(function(newVal) {
66542
+ if (this.selectUser && newVal.length > 0) {
66543
+ this.reloadAuthTree();
66544
+ }
66545
+ }, 300),
66546
+ deep: true,
66547
+ immediate: true
66460
66548
  }
66461
66549
  },
66462
66550
  computed: {
@@ -66464,30 +66552,12 @@ const __vue2_script = {
66464
66552
  return !this.selectUser;
66465
66553
  }
66466
66554
  },
66467
- created() {
66468
- this.initTypeData();
66469
- },
66470
66555
  methods: {
66471
- async initTypeData() {
66472
- try {
66473
- const params = {
66474
- authModule: this.authModule,
66475
- authType: this.authType
66476
- };
66477
- const response = await getAuthDetaileTypeApi(params);
66478
- const datas = response.data;
66479
- this.authDetaileTypes = datas.map((item2) => ({
66480
- label: item2.authDetaileTypeName,
66481
- value: item2.authDetaileType
66482
- }));
66483
- } catch (error) {
66484
- console.log("\u83B7\u53D6\u7EC6\u5206\u7C7B\u578Berror: " + error);
66485
- }
66486
- },
66487
66556
  async onSelectUserChange(selectNode) {
66488
66557
  this.userAuthLoading = true;
66489
66558
  if (selectNode.length) {
66490
66559
  this.selectUser = selectNode[0];
66560
+ this.authDetaileTypeForm.authDetaileTypeParam = [];
66491
66561
  this.authTreeData = await this.makeAuthTreeData(selectNode[0]);
66492
66562
  } else {
66493
66563
  this.selectUser = null;
@@ -66519,11 +66589,13 @@ const __vue2_script = {
66519
66589
  },
66520
66590
  async getUserAuthsApi(selectUser) {
66521
66591
  try {
66592
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66593
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66522
66594
  const params = {
66523
66595
  userId: selectUser.id,
66524
66596
  authModule: this.authModule,
66525
66597
  authType: this.authType,
66526
- authDetaileType: this.authDetaileTypeParam
66598
+ authDetaileType
66527
66599
  };
66528
66600
  const { data } = await getUserAuthsApi(params);
66529
66601
  return data;
@@ -66546,22 +66618,28 @@ const __vue2_script = {
66546
66618
  return authTreeData;
66547
66619
  },
66548
66620
  async saveUserAuths() {
66621
+ if (this.authDetaileTypeForm.authDetaileTypeParam.length == 0) {
66622
+ this.$Message.warning("\u8BF7\u9009\u62E9\u6743\u9650\u7C7B\u578B");
66623
+ return;
66624
+ }
66549
66625
  const authTreeNodes = this.$refs.authTree.getCheckedNodes(true) || [];
66550
66626
  const userAuths = authTreeNodes.filter((item2) => {
66551
66627
  return !item2.disabled;
66552
66628
  }) || [];
66629
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66630
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66553
66631
  try {
66554
66632
  this.saveLoading = true;
66555
66633
  await saveUserAuthsApi({
66556
66634
  userId: this.selectUser.id,
66557
66635
  authModule: this.authModule,
66558
66636
  authType: this.authType,
66559
- authDetaileType: this.authDetaileTypeParam,
66637
+ authDetaileType,
66560
66638
  userAuths: userAuths.map((item2) => {
66561
66639
  return {
66562
66640
  authModule: this.authModule,
66563
66641
  authType: this.authType,
66564
- authDetaileType: this.authDetaileTypeParam,
66642
+ authDetaileType,
66565
66643
  userId: this.selectUser.id,
66566
66644
  authId: item2.id
66567
66645
  };