@indfnd/common-mobile 0.0.9 → 0.0.11

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.11](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.10...v0.0.11) (2024-03-20)
6
+
7
+
8
+ ### Features
9
+
10
+ * page-view支持单位切换 ([da0f84e](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/da0f84ee5c0a5c7841be8810cb741e2cc9e052d6))
11
+
12
+ ### [0.0.10](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.9...v0.0.10) (2024-03-19)
13
+
14
+
15
+ ### Features
16
+
17
+ * detail-view支持切换单位 ([80b0dd0](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/80b0dd0beca146f344faa59b23a8f8abddcff6fc))
18
+ * init ([23ff353](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/23ff35387cea48ede7495585dfa2b92ebe6aac46))
19
+
5
20
  ### [0.0.9](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.8...v0.0.9) (2024-03-18)
6
21
 
7
22
 
@@ -2,7 +2,7 @@ import { getQuarterNum, getHalfYearNum, getHalfYear, formatDate, checkIdCard, ch
2
2
  import { DropdownMenu as DropdownMenu$1, DropdownItem as DropdownItem$1, Message, LoadingBar, Spin } from "view-design";
3
3
  import Vue$1 from "vue";
4
4
  const name = "@indfnd/common-mobile";
5
- const version$1 = "0.0.8";
5
+ const version$1 = "0.0.10";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -44306,6 +44306,14 @@ var staticRenderFns$i = [];
44306
44306
  const __vue2_script$i = {
44307
44307
  name: "IndMPageView",
44308
44308
  props: {
44309
+ dataUnit: {
44310
+ type: String,
44311
+ default: "X"
44312
+ },
44313
+ pageUnit: {
44314
+ type: String,
44315
+ default: "X"
44316
+ },
44309
44317
  readonly: Boolean,
44310
44318
  formValue: Object,
44311
44319
  dataApi: Function,
@@ -44344,11 +44352,14 @@ const __vue2_script$i = {
44344
44352
  };
44345
44353
  },
44346
44354
  created() {
44347
- this.form = this.formValue;
44348
44355
  this.initConfig();
44356
+ this.setPageData(this.formValue);
44349
44357
  this.initData();
44350
44358
  },
44351
44359
  watch: {
44360
+ pageUnit: function() {
44361
+ this.setPageData(this.formValue);
44362
+ },
44352
44363
  xmlInfo: function() {
44353
44364
  this.initConfig();
44354
44365
  },
@@ -44365,7 +44376,7 @@ const __vue2_script$i = {
44365
44376
  handler: function() {
44366
44377
  this.updating = true;
44367
44378
  console.log("form change", this.form);
44368
- this.$emit("update:formValue", this.form);
44379
+ this.emitData();
44369
44380
  this.$nextTick(() => {
44370
44381
  this.updating = false;
44371
44382
  });
@@ -44376,13 +44387,119 @@ const __vue2_script$i = {
44376
44387
  handler: function() {
44377
44388
  if (!this.updating) {
44378
44389
  console.log("formValue change", this.formValue);
44379
- this.form = this.formValue;
44390
+ this.setPageData(this.formValue);
44380
44391
  }
44381
44392
  },
44382
44393
  deep: true
44383
44394
  }
44384
44395
  },
44385
44396
  methods: {
44397
+ setPageData(src2) {
44398
+ let dataSrc = _.cloneDeep(src2);
44399
+ if (this.dataUnit == this.pageUnit) {
44400
+ this.form = dataSrc;
44401
+ return;
44402
+ }
44403
+ this.subTable.forEach((d) => {
44404
+ let unitFields = _.filter(d.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44405
+ (m) => m.id
44406
+ );
44407
+ if (d.dataField) {
44408
+ let tmpData = dataSrc[d.dataField];
44409
+ if (unitFields == null ? void 0 : unitFields.length) {
44410
+ if (tmpData instanceof Array) {
44411
+ _.forEach(tmpData, (dd) => {
44412
+ _.forEach(unitFields, (ddd) => {
44413
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44414
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44415
+ dd[ddd] = isNaN(t2) ? null : t2 * 5;
44416
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44417
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44418
+ dd[ddd] = isNaN(t2) ? null : t2 / 5;
44419
+ }
44420
+ });
44421
+ });
44422
+ } else {
44423
+ _.forEach(unitFields, (dd) => {
44424
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44425
+ let t2 = _.round(parseFloat(tmpData[dd]), 6);
44426
+ tmpData[dd] = isNaN(t2) ? null : t2 * 5;
44427
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44428
+ let t2 = _.round(parseFloat(tmpData[dd]), 6);
44429
+ tmpData[dd] = isNaN(t2) ? null : t2 / 5;
44430
+ }
44431
+ });
44432
+ }
44433
+ }
44434
+ } else {
44435
+ if (unitFields == null ? void 0 : unitFields.length) {
44436
+ _.forEach(unitFields, (dd) => {
44437
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44438
+ let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44439
+ dataSrc[dd] = isNaN(t2) ? null : t2 * 5;
44440
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44441
+ let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44442
+ dataSrc[dd] = isNaN(t2) ? null : t2 / 5;
44443
+ }
44444
+ });
44445
+ }
44446
+ }
44447
+ });
44448
+ this.form = dataSrc;
44449
+ },
44450
+ emitData() {
44451
+ let dataSrc = _.cloneDeep(this.form);
44452
+ if (this.dataUnit == this.pageUnit) {
44453
+ this.$emit("update:formValue", dataSrc);
44454
+ return;
44455
+ }
44456
+ this.subTable.forEach((d) => {
44457
+ let unitFields = _.filter(d.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44458
+ (m) => m.id
44459
+ );
44460
+ if (d.dataField) {
44461
+ let tmpData = dataSrc[d.dataField];
44462
+ if (unitFields == null ? void 0 : unitFields.length) {
44463
+ if (tmpData instanceof Array) {
44464
+ _.forEach(tmpData, (dd) => {
44465
+ _.forEach(unitFields, (ddd) => {
44466
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44467
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44468
+ dd[ddd] = isNaN(t2) ? null : t2 / 5;
44469
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44470
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44471
+ dd[ddd] = isNaN(t2) ? null : t2 * 5;
44472
+ }
44473
+ });
44474
+ });
44475
+ } else {
44476
+ _.forEach(unitFields, (dd) => {
44477
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44478
+ let t2 = _.round(parseFloat(tmpData[dd]), 6);
44479
+ tmpData[dd] = isNaN(t2) ? null : t2 / 5;
44480
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44481
+ let t2 = _.round(parseFloat(tmpData[dd]), 6);
44482
+ tmpData[dd] = isNaN(t2) ? null : t2 * 5;
44483
+ }
44484
+ });
44485
+ }
44486
+ }
44487
+ } else {
44488
+ if (unitFields == null ? void 0 : unitFields.length) {
44489
+ _.forEach(unitFields, (dd) => {
44490
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44491
+ let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44492
+ dataSrc[dd] = isNaN(t2) ? null : t2 / 5;
44493
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44494
+ let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44495
+ dataSrc[dd] = isNaN(t2) ? null : t2 * 5;
44496
+ }
44497
+ });
44498
+ }
44499
+ }
44500
+ });
44501
+ this.$emit("update:formValue", dataSrc);
44502
+ },
44386
44503
  fieldChange(table, event) {
44387
44504
  this.$emit("fieldChange", {
44388
44505
  ...event,
@@ -44414,7 +44531,7 @@ const __vue2_script$i = {
44414
44531
  if (this.dataApi) {
44415
44532
  const resp = await this.dataApi(this.params);
44416
44533
  if (resp == null ? void 0 : resp.data) {
44417
- this.form = resp == null ? void 0 : resp.data;
44534
+ this.setPageData(resp == null ? void 0 : resp.data);
44418
44535
  }
44419
44536
  }
44420
44537
  } catch (e) {
@@ -44493,6 +44610,14 @@ var staticRenderFns$h = [];
44493
44610
  const __vue2_script$h = {
44494
44611
  name: "IndMPageView",
44495
44612
  props: {
44613
+ dataUnit: {
44614
+ type: String,
44615
+ default: "X"
44616
+ },
44617
+ pageUnit: {
44618
+ type: String,
44619
+ default: "X"
44620
+ },
44496
44621
  dataApi: Function,
44497
44622
  loading: Boolean,
44498
44623
  bottom: Boolean,
@@ -44541,15 +44666,37 @@ const __vue2_script$h = {
44541
44666
  },
44542
44667
  computed: {
44543
44668
  displayRows() {
44669
+ let datas;
44544
44670
  if (this.searchVal) {
44545
- return _.filter(this.rows, (d) => {
44671
+ datas = _.filter(this.rows, (d) => {
44546
44672
  return _.some(this.formFieldList, (dd) => {
44547
44673
  return _.includes(d[dd.formKey], this.searchVal);
44548
44674
  });
44549
44675
  }) || [];
44550
44676
  } else {
44551
- return this.rows || [];
44677
+ datas = this.rows || [];
44678
+ }
44679
+ let dataSrc = _.cloneDeep(datas);
44680
+ if (this.dataUnit == this.pageUnit) {
44681
+ return dataSrc;
44552
44682
  }
44683
+ let unitFields = _.filter(this.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44684
+ (m) => m.id
44685
+ );
44686
+ if (unitFields == null ? void 0 : unitFields.length) {
44687
+ _.forEach(dataSrc, (dd) => {
44688
+ _.forEach(unitFields, (ddd) => {
44689
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44690
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44691
+ dd[ddd] = isNaN(t2) ? null : t2 * 5;
44692
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44693
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44694
+ dd[ddd] = isNaN(t2) ? null : t2 / 5;
44695
+ }
44696
+ });
44697
+ });
44698
+ }
44699
+ return dataSrc;
44553
44700
  }
44554
44701
  },
44555
44702
  methods: {
@@ -62956,9 +63103,9 @@ var render$a = function() {
62956
63103
  var _vm = this;
62957
63104
  var _h = _vm.$createElement;
62958
63105
  var _c = _vm._self._c || _h;
62959
- return _c("van-popup", { style: { width: "100%", height: "100%" }, attrs: { "value": _vm.show, "position": "right", "lazy-render": true, "get-container": "body" }, on: { "opened": _vm.getTableData } }, [_c("div", { staticClass: "ind-select-panel ind-vcenter", class: [_vm.isTree ? "ind-mobile-tree" : "", _vm.showHeader ? "ind-select-panel-widthheader" : ""], staticStyle: { "width": "100%", "height": "100vh" }, style: { paddingBottom: _vm.multiple ? "20px" : "0" } }, [_c("van-nav-bar", { staticClass: "ind-flex-no-shrink", attrs: { "title": "\u8BF7\u9009\u62E9" + _vm.title, "left-text": "\u8FD4\u56DE", "left-arrow": "" }, on: { "click-left": _vm.cancel } }), _c("div", { staticClass: "ind-main-content-wrapper ind-flex-grow ind-vcenter" }, [_c("van-search", { staticClass: "ind-flex-no-shrink", staticStyle: { "position": "relative", "z-index": "3" }, attrs: { "placeholder": "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD" }, on: { "search": _vm.doSearch }, model: { value: _vm.searchVal, callback: function($$v) {
63106
+ return _c("van-popup", { style: { width: "100%", height: "100%" }, attrs: { "value": _vm.show, "position": "right", "lazy-render": true, "get-container": "body" }, on: { "opened": _vm.getTableData } }, [_c("div", { staticClass: "ind-select-panel ind-vcenter", class: [_vm.isTree ? "ind-mobile-tree" : "", _vm.showHeader ? "ind-select-panel-widthheader" : ""], staticStyle: { "width": "100%", "height": "100vh" }, style: { paddingBottom: _vm.multiple && !_vm.showHeader ? "20px" : "0" } }, [_c("van-nav-bar", { staticClass: "ind-flex-no-shrink", attrs: { "title": "\u8BF7\u9009\u62E9" + _vm.title, "left-text": "\u8FD4\u56DE", "left-arrow": "" }, on: { "click-left": _vm.cancel } }), _c("div", { staticClass: "ind-main-content-wrapper ind-flex-grow ind-vcenter" }, [_c("van-search", { staticClass: "ind-flex-no-shrink", staticStyle: { "position": "relative", "z-index": "3" }, attrs: { "placeholder": "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD" }, on: { "search": _vm.doSearch }, model: { value: _vm.searchVal, callback: function($$v) {
62960
63107
  _vm.searchVal = $$v;
62961
- }, expression: "searchVal" } }), _c("IndTable", { ref: "table", attrs: { "rowClick": "", "headerHeight": 49, "rowMultiSelectWithClick": _vm.multiple, "isRowSelectable": _vm.isRowSelectable, "groupSelectsChildren": _vm.multiple, "showBottom": false, "dataApi": _vm.selectDataApi, "searchParams": _vm.searchParams, "columns": _vm.columnsData, "rowKey": _vm.selectRowKey, "showTableOption": false, "groupDefaultExpanded": 3, "disablePage": "" }, on: { "on-select-change": _vm.onSelectChange, "on-data-format-load": _vm.setLength } }), _c("div", { staticClass: "ind-bottom-info ind-bottom-btn", staticStyle: { "position": "absolute", "bottom": "0" }, attrs: { "slot": "bottom" }, slot: "bottom" }, [_vm.multiple ? _c("div", { staticClass: "ind-flex" }, [_vm._v(" \u5171\xA0"), _c("span", { staticClass: "ind-orange ind-large" }, [_vm._v(_vm._s(_vm.dataLen))]), _vm._v("\xA0\u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9\xA0"), _c("span", { staticClass: "ind-orange ind-large" }, [_vm._v(_vm._s(_vm.selectedRows.length))]), _vm._v("\xA0\u6761 ")]) : _vm._e(), _c("div", { staticClass: "ind-flex ind-space-between", class: [_vm.multiple ? "ind-mt" : ""] }, [_vm.multiple ? _c("div", { staticClass: "ind-flex ind-flex-no-shrink ind-checkbox-bottom ag-theme-balham ag-theme-balham-dark", staticStyle: { "margin-right": "20px" }, on: { "click": _vm.toggleCheckAll } }, [_c("div", { staticClass: "ag-checkbox-input-wrapper", class: _vm.allCheck ? "ag-checked" : "" }), _vm._v(" \u5168\u9009 ")]) : _vm._e(), _c("div", { staticClass: "ind-flex", staticStyle: { "width": "100%" } }, [_c("IndButton", { attrs: { "bizType": "cancel" }, on: { "click": _vm.cancel } }, [_vm._v("\u53D6\u6D88")]), _c("IndButton", { attrs: { "bizType": "primary" }, on: { "click": _vm.confirm } }, [_vm._v("\u786E\u8BA4")])], 1)])])], 1)], 1)]);
63108
+ }, expression: "searchVal" } }), _c("IndTable", { ref: "table", attrs: { "rowClick": "", "headerHeight": 49, "rowMultiSelectWithClick": _vm.multiple, "isRowSelectable": _vm.isRowSelectable, "groupSelectsChildren": _vm.multiple, "showBottom": false, "dataApi": _vm.selectDataApi, "searchParams": _vm.searchParams, "columns": _vm.columnsData, "rowKey": _vm.selectRowKey, "showTableOption": false, "groupDefaultExpanded": 3, "disablePage": "" }, on: { "on-select-change": _vm.onSelectChange, "on-data-format-load": _vm.setLength } }), _c("div", { staticClass: "ind-bottom-info ind-bottom-btn", style: { position: _vm.showHeader ? "static" : "absolute", bottom: 0 }, attrs: { "slot": "bottom" }, slot: "bottom" }, [_vm.multiple ? _c("div", { staticClass: "ind-flex" }, [_vm._v(" \u5171\xA0"), _c("span", { staticClass: "ind-orange ind-large" }, [_vm._v(_vm._s(_vm.dataLen))]), _vm._v("\xA0\u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9\xA0"), _c("span", { staticClass: "ind-orange ind-large" }, [_vm._v(_vm._s(_vm.selectedRows.length))]), _vm._v("\xA0\u6761 ")]) : _vm._e(), _c("div", { staticClass: "ind-flex ind-space-between", class: [_vm.multiple ? "ind-mt" : ""] }, [_vm.multiple ? _c("div", { staticClass: "ind-flex ind-flex-no-shrink ind-checkbox-bottom ag-theme-balham ag-theme-balham-dark", staticStyle: { "margin-right": "20px" }, style: { top: _vm.showHeader ? "7px" : "" }, on: { "click": _vm.toggleCheckAll } }, [_c("div", { staticClass: "ag-checkbox-input-wrapper", class: _vm.allCheck ? "ag-checked" : "" }), _vm._v(" \u5168\u9009 ")]) : _vm._e(), _c("div", { staticClass: "ind-flex", staticStyle: { "width": "100%" } }, [_c("IndButton", { attrs: { "bizType": "cancel" }, on: { "click": _vm.cancel } }, [_vm._v("\u53D6\u6D88")]), _c("IndButton", { attrs: { "bizType": "primary" }, on: { "click": _vm.confirm } }, [_vm._v("\u786E\u8BA4")])], 1)])])], 1)], 1)]);
62962
63109
  };
62963
63110
  var staticRenderFns$a = [];
62964
63111
  function deepEach(parentNode, list2, callback2) {
@@ -63294,6 +63441,7 @@ const __vue2_script$9 = {
63294
63441
  },
63295
63442
  created() {
63296
63443
  this.visible = this.defaultVisible;
63444
+ this.updateSelectedTitles();
63297
63445
  },
63298
63446
  deactivated() {
63299
63447
  this.visible = false;
@@ -68585,7 +68733,6 @@ const checkPermission = function(el, binding, vnode) {
68585
68733
  const value17 = binding.value;
68586
68734
  const permission2 = instance2.$store.state.app.permission;
68587
68735
  const have = permission2[value17];
68588
- console.log(el.style);
68589
68736
  if (have || value17 === "all") {
68590
68737
  el.style.display = "";
68591
68738
  }
@@ -69165,15 +69312,13 @@ var app = {
69165
69312
  },
69166
69313
  actions: {
69167
69314
  async getAppListData({ commit: commit2, getters }) {
69168
- var _a;
69169
69315
  let appList = getters.getAppList;
69170
69316
  if (!appList.length) {
69171
69317
  const { data: data49 = [] } = await getAppListApi();
69172
69318
  appList = data49.filter((app2) => app2.basepath !== "/cmsadmin");
69173
69319
  commit2("setAppList", appList);
69174
69320
  }
69175
- let appInfo = appList.find((item2) => item2.application.extendProps.is_mobile_app == "1");
69176
- let appId = appInfo.appId;
69321
+ let appId = "";
69177
69322
  if (location.search) {
69178
69323
  let rlt = /appId=([^&]*)/.exec(location.search);
69179
69324
  if (rlt && rlt.length > 1) {
@@ -69181,11 +69326,12 @@ var app = {
69181
69326
  }
69182
69327
  }
69183
69328
  if (!appId) {
69184
- const appInfo2 = getSessionStorage("appInfo");
69185
- appId = (appInfo2 == null ? void 0 : appInfo2.appId) || "";
69329
+ const appInfo = getSessionStorage("appInfo");
69330
+ appId = (appInfo == null ? void 0 : appInfo.appId) || "";
69186
69331
  }
69187
69332
  if (!appId) {
69188
- appId = ((_a = appList == null ? void 0 : appList[0]) == null ? void 0 : _a.appId) || "";
69333
+ let appInfo = appList.find((item2) => item2.application.extendProps.is_mobile_app == "1");
69334
+ appId = appInfo.appId || "";
69189
69335
  }
69190
69336
  commit2("setAppInfo", appId);
69191
69337
  return appList;