@indfnd/common 1.0.35 → 1.0.37

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.34";
5
+ const version = "1.0.36";
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;
@@ -52245,7 +52251,7 @@ var render$$ = function() {
52245
52251
  _vm.checkAllGroup = $$v;
52246
52252
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
52247
52253
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
52248
- }), _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);
52249
52255
  };
52250
52256
  var staticRenderFns$$ = [];
52251
52257
  function suppressNavigation$1(params) {
@@ -52337,6 +52343,10 @@ const __vue2_script$10 = {
52337
52343
  AgImage
52338
52344
  },
52339
52345
  props: {
52346
+ showMenu: Boolean,
52347
+ rowHeight: Number,
52348
+ headerHeight: Number,
52349
+ getRowHeightProp: Function,
52340
52350
  rowSpanDefs: Array,
52341
52351
  headerHeight: {
52342
52352
  type: Number,
@@ -52548,14 +52558,31 @@ const __vue2_script$10 = {
52548
52558
  tableColumns: [],
52549
52559
  defaultColDef: {
52550
52560
  unSortIcon: true,
52551
- suppressMenu: true,
52561
+ suppressMenu: !this.showMenu,
52562
+ floatingFilter: this.showMenu,
52563
+ filter: this.showMenu,
52564
+ suppressHeaderFilterButton: true,
52552
52565
  wrapHeaderText: this.headerAutoHeight,
52553
52566
  autoHeaderHeight: this.headerAutoHeight,
52554
52567
  wrapText: this.cellAutoHeight,
52555
52568
  autoHeight: this.cellAutoHeight,
52569
+ filter: "agSetColumnFilter",
52556
52570
  suppressKeyboardEvent: (params) => {
52557
52571
  return suppressNavigation$1(params);
52558
- }
52572
+ },
52573
+ headerComponentParams: this.showMenu ? {
52574
+ template: `<div class="ag-cell-label-container" role="presentation">
52575
+ <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button ag-header-menu-always-show" aria-hidden="true"></span>
52576
+ <span ref="eSortAsc" class="ag-header-icon ag-header-label-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
52577
+ <span ref="eSortDesc" class="ag-header-icon ag-header-label-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
52578
+ <span ref="eSortNone" class="ag-header-icon ag-header-label-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
52579
+ <div ref="eLabel" class="ag-header-cell-label" role="presentation">
52580
+ <span ref="eText" class="ag-header-cell-text"></span>
52581
+ <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
52582
+ <span ref="eSortOrder" class="ag-header-icon ag-header-label-icon ag-sort-order" aria-hidden="true"></span>
52583
+ </div>
52584
+ </div>`
52585
+ } : null
52559
52586
  },
52560
52587
  gridApi: null,
52561
52588
  gridColumnApi: null,
@@ -53618,57 +53645,70 @@ const __vue2_script$10 = {
53618
53645
  },
53619
53646
  renderSumRow: _.debounce(async function() {
53620
53647
  var _a;
53621
- let hasSumRow = this.flatColumns.some((item2) => item2.isSum);
53648
+ let hasSumRow = _.some(this.flatColumns, (item2) => item2.isSum);
53622
53649
  if (hasSumRow) {
53623
53650
  console.time("calcSum");
53651
+ let sumCols = _.filter(this.flatColumns, (item2) => item2.isSum);
53652
+ let sumCalcCols = _.remove(sumCols, (item2) => isString(item2.isSum));
53653
+ let sumFuncCols = _.remove(sumCols, (item2) => item2.isSum instanceof Function);
53654
+ const sumCalcRuleMap = {};
53655
+ _.forEach(sumCalcCols, (col) => {
53656
+ addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
53657
+ });
53624
53658
  let sumData = {};
53625
- for (let col of this.flatColumns) {
53626
- if (!["checkbox", "radios", "index"].includes(col.type)) {
53627
- sumData[col.field || col.key] = "\u5408\u8BA1";
53659
+ for (let i = 0; i < this.flatColumns.length; i++) {
53660
+ if (!["checkbox", "radios", "index"].includes((_a = this.flatColumns[i]) == null ? void 0 : _a.type)) {
53661
+ let colTmp = this.flatColumns[i];
53662
+ sumData[colTmp.field || colTmp.key] = "\u5408\u8BA1";
53628
53663
  break;
53629
53664
  }
53630
53665
  }
53631
- let sumCols = this.flatColumns.filter((item2) => item2.isSum);
53632
- let sumCalcCols = [], sumFuncCols = [];
53633
- sumCols.forEach((col) => {
53634
- if (typeof col.isSum === "string")
53635
- sumCalcCols.push(col);
53636
- else if (col.isSum instanceof Function)
53637
- sumFuncCols.push(col);
53638
- });
53639
- const sumCalcRuleMap = {};
53640
- sumCalcCols.forEach((col) => {
53641
- addCalcRuleMap(sumCalcRuleMap, col.isSum, col.field || col.key);
53642
- });
53643
- sumCols.forEach((col) => {
53644
- if (!(col.field || col.key) in sumData)
53645
- sumData[col.field || col.key] = 0;
53646
- });
53647
- this.rowDataFiltered.forEach((d) => {
53648
- sumCols.forEach((dd) => {
53649
- if (typeof dd.isSum === "string")
53650
- return;
53651
- let field = dd.field || dd.key;
53652
- let value = d[field];
53653
- if (typeof value === "number" && !isNaN(value)) {
53654
- sumData[field] = (sumData[field] || 0) + value;
53655
- }
53656
- });
53657
- });
53658
- sumFuncCols.forEach((col) => {
53659
- sumData[col.field || col.key] = col.isSum(this.rowDataFiltered, col);
53666
+ sumCols.forEach((d) => sumData[d.field || d.key] = 0);
53667
+ sumData = _.reduce(
53668
+ this.rowDataFiltered,
53669
+ (s, d, idx) => {
53670
+ sumCols.forEach((dd) => {
53671
+ if (isString(dd.isSum))
53672
+ return;
53673
+ let field = dd.field || dd.key;
53674
+ let rowMergeInfo = this.tableRowSpanMergeIndexMap[field];
53675
+ let mergedRows = [];
53676
+ _.forEach(rowMergeInfo, (v, k) => {
53677
+ let rows2 = _.range(k, parseInt(k) + v);
53678
+ mergedRows.push(...rows2.slice(1));
53679
+ });
53680
+ if (!mergedRows.includes(idx)) {
53681
+ sumData[field] = _.round(
53682
+ sumData[field] + (!d[field] || isNaN(d[field]) ? 0 : parseFloat(d[field])),
53683
+ 6
53684
+ );
53685
+ }
53686
+ });
53687
+ return s;
53688
+ },
53689
+ sumData
53690
+ );
53691
+ _.forEach(sumFuncCols, (d) => {
53692
+ sumData[d.field || d.key] = d.isSum(this.rowDataFiltered, d);
53660
53693
  });
53661
53694
  let sumRows = [sumData];
53695
+ let calcRules = {};
53696
+ _.forEach(sumCalcRuleMap, (v, k) => {
53697
+ _.merge(calcRules, v);
53698
+ });
53662
53699
  let rules = [];
53663
- for (let key in sumCalcRuleMap) {
53664
- let column = sumCalcCols.find((col) => col.field === key || col.key === key);
53700
+ _.forEach(calcRules, (v, k) => {
53701
+ var _a2;
53702
+ let column = _.find(sumCalcCols, (d) => {
53703
+ return d.field == k || d.key == k;
53704
+ });
53665
53705
  rules.push({
53666
- rltKey: key,
53667
- ast: sumCalcRuleMap[key],
53668
- precision: ((_a = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a.scale) || 2,
53706
+ rltKey: k,
53707
+ ast: v,
53708
+ precision: ((_a2 = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a2.scale) || 2,
53669
53709
  errRtn: 0
53670
53710
  });
53671
- }
53711
+ });
53672
53712
  let options = { calcRules: rules };
53673
53713
  calcDatas(sumRows, options);
53674
53714
  this.topRows = this.pinnedTopRowDataWithUnit ? _.concat(this.pinnedTopRowDataWithUnit, sumRows) : sumRows;
@@ -65952,9 +65992,6 @@ var uploadImg = /* @__PURE__ */ function() {
65952
65992
  return __component__$2.exports;
65953
65993
  }();
65954
65994
  const CONTEXT$1 = `${config.imgServerContext}/system/auths`;
65955
- function getAuthDetaileTypeApi$1(params) {
65956
- return axios.get(`${CONTEXT$1}/getAuthDetaileType`, { params });
65957
- }
65958
65995
  function getRoleListApi(params) {
65959
65996
  return axios.get(`${CONTEXT$1}/getRoleList`, { params });
65960
65997
  }
@@ -65982,11 +66019,9 @@ var render$1 = function() {
65982
66019
  var _c = _vm._self._c || _h;
65983
66020
  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() {
65984
66021
  return [_c("IndButton", { attrs: { "bizType": "table" }, on: { "click": _vm.addRole } }, [_vm._v("\u65B0\u589E")])];
65985
- }, 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) {
65986
- _vm.authDetaileTypeParam = $$v;
65987
- }, expression: "authDetaileTypeParam" } }, _vm._l(_vm.authDetaileTypes, function(type) {
65988
- return _c("IndOption", { key: type.value, attrs: { "value": type.value } }, [_vm._v(" " + _vm._s(type.label) + " ")]);
65989
- }), 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) {
66022
+ }, 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) {
66023
+ _vm.authDetaileTypeForm = $$v;
66024
+ }, 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) {
65990
66025
  _vm.showEditRole = $$v;
65991
66026
  }, 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) {
65992
66027
  _vm.formData = $$v;
@@ -66006,7 +66041,6 @@ const __vue2_script$1 = {
66006
66041
  props: {
66007
66042
  authModule: { type: String, required: true },
66008
66043
  authType: { type: String, required: true },
66009
- authDetaileType: { type: String, required: true },
66010
66044
  authTreeApiParams: { type: Object, required: true },
66011
66045
  authTreeApi: { type: Function, required: true }
66012
66046
  },
@@ -66134,44 +66168,50 @@ const __vue2_script$1 = {
66134
66168
  saveRoleLoading: false,
66135
66169
  tableDataSize: 1,
66136
66170
  saveLoading: false,
66137
- authDetaileTypes: [],
66138
- authDetaileTypeParam: this.authDetaileType,
66139
- authTreeLoading: false
66171
+ authDetaileTypeForm: {
66172
+ authDetaileTypeParam: []
66173
+ },
66174
+ authTreeLoading: false,
66175
+ authDetaileTypeField: [
66176
+ {
66177
+ formKey: "authDetaileTypeParam",
66178
+ title: "\u6743\u9650\u7C7B\u578B\uFF1A",
66179
+ type: "treeselect",
66180
+ props: {
66181
+ selectLeafOnly: true,
66182
+ dataApi: listComTreeApi,
66183
+ urlParams: {
66184
+ bizType: "40",
66185
+ dataPermitType: JSON.stringify({
66186
+ authModule: this.authModule,
66187
+ authType: this.authType
66188
+ })
66189
+ }
66190
+ }
66191
+ }
66192
+ ]
66140
66193
  };
66141
66194
  },
66142
66195
  watch: {
66143
- authDetaileTypeParam() {
66144
- if (this.selectedRole) {
66145
- this.reloadAuthTree();
66146
- }
66196
+ "authDetaileTypeForm.authDetaileTypeParam": {
66197
+ handler: _.debounce(function(newVal) {
66198
+ if (this.selectedRole && newVal.length > 0) {
66199
+ this.reloadAuthTree();
66200
+ }
66201
+ }, 300),
66202
+ deep: true,
66203
+ immediate: true
66147
66204
  }
66148
66205
  },
66149
- created() {
66150
- this.initTypeData();
66151
- },
66152
66206
  methods: {
66153
- async initTypeData() {
66154
- try {
66155
- const params = {
66156
- authModule: this.authModule,
66157
- authType: this.authType
66158
- };
66159
- const response = await getAuthDetaileTypeApi$1(params);
66160
- const datas = response.data;
66161
- this.authDetaileTypes = datas.map((item2) => ({
66162
- label: item2.authDetaileTypeName,
66163
- value: item2.authDetaileType
66164
- }));
66165
- } catch (error) {
66166
- console.log("\u83B7\u53D6\u7EC6\u5206\u7C7B\u578Berror: " + error);
66167
- }
66168
- },
66169
66207
  query() {
66170
66208
  this.tableLoading = true;
66209
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66210
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66171
66211
  this.searchParams = {
66172
66212
  authModule: this.authModule,
66173
66213
  authType: this.authType,
66174
- authDetaileType: this.authDetaileTypeParam
66214
+ authDetaileType
66175
66215
  };
66176
66216
  },
66177
66217
  async tableDataLoad(data) {
@@ -66180,9 +66220,9 @@ const __vue2_script$1 = {
66180
66220
  await this.$nextTick();
66181
66221
  },
66182
66222
  tableSelectChange: _.debounce(function(selectedRows) {
66183
- this.authDetaileTypeParam = "1";
66184
66223
  if (selectedRows.length) {
66185
66224
  this.selectedRole = selectedRows[0];
66225
+ this.authDetaileTypeForm.authDetaileTypeParam = [];
66186
66226
  this.getUserAuthTreeData(true);
66187
66227
  } else {
66188
66228
  this.selectedRole = null;
@@ -66239,10 +66279,12 @@ const __vue2_script$1 = {
66239
66279
  },
66240
66280
  async listUserRolesApi() {
66241
66281
  try {
66282
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66283
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66242
66284
  const params = {
66243
66285
  authModule: this.authModule,
66244
66286
  authType: this.authType,
66245
- authDetaileType: this.authDetaileTypeParam
66287
+ authDetaileType
66246
66288
  };
66247
66289
  const { data } = await listUserRolesApi(params);
66248
66290
  return data;
@@ -66292,11 +66334,13 @@ const __vue2_script$1 = {
66292
66334
  },
66293
66335
  async getRoleUsersAuths(roleId) {
66294
66336
  try {
66337
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66338
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66295
66339
  const params = {
66296
66340
  roleId,
66297
66341
  authModule: this.authModule,
66298
66342
  authType: this.authType,
66299
- authDetaileType: this.authDetaileTypeParam
66343
+ authDetaileType
66300
66344
  };
66301
66345
  const { data } = await detailAuthsUsersApi(params);
66302
66346
  return data;
@@ -66347,6 +66391,10 @@ const __vue2_script$1 = {
66347
66391
  }
66348
66392
  },
66349
66393
  async saveUsersAuths() {
66394
+ if (this.authDetaileTypeForm.authDetaileTypeParam.length == 0) {
66395
+ this.$Message.warning("\u8BF7\u9009\u62E9\u6743\u9650\u7C7B\u578B");
66396
+ return;
66397
+ }
66350
66398
  const userTreeNodes = this.$refs.userTree.getCheckedNodes(true) || [];
66351
66399
  const authTreeNodes = this.$refs.authTree.getCheckedNodes(true) || [];
66352
66400
  const roleUsers = userTreeNodes.filter((item2) => {
@@ -66378,9 +66426,11 @@ const __vue2_script$1 = {
66378
66426
  }
66379
66427
  try {
66380
66428
  this.saveLoading = true;
66429
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66430
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66381
66431
  await saveAuthsUsersApi({
66382
66432
  ...this.selectedRole,
66383
- authDetaileType: this.authDetaileTypeParam,
66433
+ authDetaileType,
66384
66434
  roleUsers: roleUsers.length ? roleUsers.map((item2) => {
66385
66435
  return {
66386
66436
  authModule: this.authModule,
@@ -66393,7 +66443,7 @@ const __vue2_script$1 = {
66393
66443
  return {
66394
66444
  authModule: this.authModule,
66395
66445
  authType: this.authType,
66396
- authDetaileType: this.authDetaileTypeParam,
66446
+ authDetaileType,
66397
66447
  roleId: this.selectedRole.roleId,
66398
66448
  authId: item2.id
66399
66449
  };
@@ -66440,9 +66490,6 @@ var roleAuth = /* @__PURE__ */ function() {
66440
66490
  return __component__$1.exports;
66441
66491
  }();
66442
66492
  const CONTEXT = `${config.imgServerContext}/system/auths`;
66443
- function getAuthDetaileTypeApi(params) {
66444
- return axios.get(`${CONTEXT}/getAuthDetaileType`, { params });
66445
- }
66446
66493
  function getUserAuthsApi(params) {
66447
66494
  return axios.get(`${CONTEXT}/getUserAuths`, { params });
66448
66495
  }
@@ -66453,11 +66500,9 @@ var render = function() {
66453
66500
  var _vm = this;
66454
66501
  var _h = _vm.$createElement;
66455
66502
  var _c = _vm._self._c || _h;
66456
- 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) {
66457
- _vm.authDetaileTypeParam = $$v;
66458
- }, expression: "authDetaileTypeParam" } }, _vm._l(_vm.authDetaileTypes, function(type) {
66459
- return _c("IndOption", { key: type.value, attrs: { "value": type.value } }, [_vm._v(_vm._s(type.label) + " ")]);
66460
- }), 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);
66503
+ 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) {
66504
+ _vm.authDetaileTypeForm = $$v;
66505
+ }, 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);
66461
66506
  };
66462
66507
  var staticRenderFns = [];
66463
66508
  const __vue2_script = {
@@ -66465,7 +66510,6 @@ const __vue2_script = {
66465
66510
  props: {
66466
66511
  authModule: { type: String, required: true },
66467
66512
  authType: { type: String, required: true },
66468
- authDetaileType: { type: String, required: true },
66469
66513
  authTreeApiParams: { type: Object, required: true },
66470
66514
  authTreeApi: { type: Function, required: true }
66471
66515
  },
@@ -66479,8 +66523,27 @@ const __vue2_script = {
66479
66523
  authTreeData: [],
66480
66524
  defaultAuthId: [],
66481
66525
  saveLoading: false,
66482
- authDetaileTypes: [],
66483
- authDetaileTypeParam: this.authDetaileType
66526
+ authDetaileTypeForm: {
66527
+ authDetaileTypeParam: []
66528
+ },
66529
+ authDetaileTypeField: [
66530
+ {
66531
+ formKey: "authDetaileTypeParam",
66532
+ title: "\u6743\u9650\u7C7B\u578B\uFF1A",
66533
+ type: "treeselect",
66534
+ props: {
66535
+ selectLeafOnly: true,
66536
+ dataApi: listComTreeApi,
66537
+ urlParams: {
66538
+ bizType: "40",
66539
+ dataPermitType: JSON.stringify({
66540
+ authModule: this.authModule,
66541
+ authType: this.authType
66542
+ })
66543
+ }
66544
+ }
66545
+ }
66546
+ ]
66484
66547
  };
66485
66548
  },
66486
66549
  activated() {
@@ -66494,10 +66557,14 @@ const __vue2_script = {
66494
66557
  this.defaultAuthId = [];
66495
66558
  },
66496
66559
  watch: {
66497
- authDetaileTypeParam() {
66498
- if (this.selectUser) {
66499
- this.reloadAuthTree();
66500
- }
66560
+ "authDetaileTypeForm.authDetaileTypeParam": {
66561
+ handler: _.debounce(function(newVal) {
66562
+ if (this.selectUser && newVal.length > 0) {
66563
+ this.reloadAuthTree();
66564
+ }
66565
+ }, 300),
66566
+ deep: true,
66567
+ immediate: true
66501
66568
  }
66502
66569
  },
66503
66570
  computed: {
@@ -66505,30 +66572,12 @@ const __vue2_script = {
66505
66572
  return !this.selectUser;
66506
66573
  }
66507
66574
  },
66508
- created() {
66509
- this.initTypeData();
66510
- },
66511
66575
  methods: {
66512
- async initTypeData() {
66513
- try {
66514
- const params = {
66515
- authModule: this.authModule,
66516
- authType: this.authType
66517
- };
66518
- const response = await getAuthDetaileTypeApi(params);
66519
- const datas = response.data;
66520
- this.authDetaileTypes = datas.map((item2) => ({
66521
- label: item2.authDetaileTypeName,
66522
- value: item2.authDetaileType
66523
- }));
66524
- } catch (error) {
66525
- console.log("\u83B7\u53D6\u7EC6\u5206\u7C7B\u578Berror: " + error);
66526
- }
66527
- },
66528
66576
  async onSelectUserChange(selectNode) {
66529
66577
  this.userAuthLoading = true;
66530
66578
  if (selectNode.length) {
66531
66579
  this.selectUser = selectNode[0];
66580
+ this.authDetaileTypeForm.authDetaileTypeParam = [];
66532
66581
  this.authTreeData = await this.makeAuthTreeData(selectNode[0]);
66533
66582
  } else {
66534
66583
  this.selectUser = null;
@@ -66560,11 +66609,13 @@ const __vue2_script = {
66560
66609
  },
66561
66610
  async getUserAuthsApi(selectUser) {
66562
66611
  try {
66612
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66613
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66563
66614
  const params = {
66564
66615
  userId: selectUser.id,
66565
66616
  authModule: this.authModule,
66566
66617
  authType: this.authType,
66567
- authDetaileType: this.authDetaileTypeParam
66618
+ authDetaileType
66568
66619
  };
66569
66620
  const { data } = await getUserAuthsApi(params);
66570
66621
  return data;
@@ -66587,22 +66638,28 @@ const __vue2_script = {
66587
66638
  return authTreeData;
66588
66639
  },
66589
66640
  async saveUserAuths() {
66641
+ if (this.authDetaileTypeForm.authDetaileTypeParam.length == 0) {
66642
+ this.$Message.warning("\u8BF7\u9009\u62E9\u6743\u9650\u7C7B\u578B");
66643
+ return;
66644
+ }
66590
66645
  const authTreeNodes = this.$refs.authTree.getCheckedNodes(true) || [];
66591
66646
  const userAuths = authTreeNodes.filter((item2) => {
66592
66647
  return !item2.disabled;
66593
66648
  }) || [];
66649
+ const authDetaileTypeParam = this.authDetaileTypeForm.authDetaileTypeParam;
66650
+ const authDetaileType = authDetaileTypeParam && authDetaileTypeParam.length > 0 && authDetaileTypeParam[0].id ? authDetaileTypeParam[0].id : "";
66594
66651
  try {
66595
66652
  this.saveLoading = true;
66596
66653
  await saveUserAuthsApi({
66597
66654
  userId: this.selectUser.id,
66598
66655
  authModule: this.authModule,
66599
66656
  authType: this.authType,
66600
- authDetaileType: this.authDetaileTypeParam,
66657
+ authDetaileType,
66601
66658
  userAuths: userAuths.map((item2) => {
66602
66659
  return {
66603
66660
  authModule: this.authModule,
66604
66661
  authType: this.authType,
66605
- authDetaileType: this.authDetaileTypeParam,
66662
+ authDetaileType,
66606
66663
  userId: this.selectUser.id,
66607
66664
  authId: item2.id
66608
66665
  };