three-trees-ui 1.0.65 → 1.0.66

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.
@@ -1249,7 +1249,7 @@ var utils = {
1249
1249
  }
1250
1250
  const keyPath = config[key];
1251
1251
  // 获取当前组件所在的表单
1252
- const formInst = utils.getOnlineFormInstance(inst.$parent);
1252
+ const formInst = utils.getOnlineFormInstance(inst);
1253
1253
  // 获取当前组件是否在子表中的某一行
1254
1254
  const {
1255
1255
  subScopeEl,
@@ -1526,6 +1526,37 @@ Date.prototype.format = function (format) {
1526
1526
  }
1527
1527
  return format;
1528
1528
  };
1529
+
1530
+ //精确四舍五入
1531
+ Number.prototype.toFixedRound = function (d) {
1532
+ d = Number(d);
1533
+ var s = this + '';
1534
+ if (!d) d = 0;
1535
+ if (s.indexOf('.') == -1) s += '.';
1536
+ s += new Array(d + 1).join('0');
1537
+ if (new RegExp('^(-|\\+)?(\\d+(\\.\\d{0,' + (d + 1) + '})?)\\d*$').test(s)) {
1538
+ var s = '0' + RegExp.$2,
1539
+ pm = RegExp.$1,
1540
+ a = RegExp.$3.length,
1541
+ b = true;
1542
+ if (a == d + 2) {
1543
+ a = s.match(/\d/g);
1544
+ if (parseInt(a[a.length - 1]) > 4) {
1545
+ for (var i = a.length - 2; i >= 0; i--) {
1546
+ a[i] = parseInt(a[i]) + 1;
1547
+ if (a[i] == 10) {
1548
+ a[i] = 0;
1549
+ b = i != 1;
1550
+ } else break;
1551
+ }
1552
+ }
1553
+ s = a.join('').replace(new RegExp('(\\d+)(\\d{' + d + '})\\d$'), '$1.$2');
1554
+ }
1555
+ if (b) s = s.substr(1);
1556
+ return (pm + s).replace(/\.$/, '');
1557
+ }
1558
+ return this + '';
1559
+ };
1529
1560
  /* harmony default export */ __webpack_exports__["a"] = (utils);
1530
1561
 
1531
1562
  /***/ }),
@@ -4970,6 +5001,17 @@ var component = Object(componentNormalizer["a" /* default */])(
4970
5001
 
4971
5002
  module.exports = require("echarts/lib/chart/bar");
4972
5003
 
5004
+ /***/ }),
5005
+
5006
+ /***/ "11b4":
5007
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5008
+
5009
+ "use strict";
5010
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_0aa58584_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("19bc");
5011
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_0aa58584_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_0aa58584_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
5012
+ /* unused harmony reexport * */
5013
+
5014
+
4973
5015
  /***/ }),
4974
5016
 
4975
5017
  /***/ "1242":
@@ -5321,7 +5363,7 @@ const SubPagination = {
5321
5363
  return `${path}:VueComponent`;
5322
5364
  },
5323
5365
  // 导入数据
5324
- importData: (path, importRows, mode, mergeMethod) => {
5366
+ importData: (path, importRows, mode, mergeMethod, conditionConfig) => {
5325
5367
  return new Promise((resolve, reject) => {
5326
5368
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getOnlineFormInstance(undefined);
5327
5369
  let formUid = pInst && pInst._uid ? pInst._uid : '';
@@ -5354,6 +5396,44 @@ const SubPagination = {
5354
5396
  _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByPath(inst, path, newRows);
5355
5397
  break;
5356
5398
  }
5399
+ case 'condition':
5400
+ {
5401
+ importRows.forEach(item => {
5402
+ let index = array.findIndex(sub => {
5403
+ let orArr = conditionConfig.conditionArr.filter(condition => {
5404
+ return condition.relation == 'or';
5405
+ });
5406
+ let andArr = conditionConfig.conditionArr.filter(condition => {
5407
+ return condition.relation == 'and';
5408
+ });
5409
+ let orFlag = true;
5410
+ let andFlag = true;
5411
+ if (orArr.length) {
5412
+ orFlag = orArr.some(j => {
5413
+ return sub[j.subField] == item[j.exportField];
5414
+ });
5415
+ }
5416
+ if (andArr.length) {
5417
+ andFlag = andArr.every(j => {
5418
+ return sub[j.subField] == item[j.exportField];
5419
+ });
5420
+ }
5421
+ return orFlag && andFlag;
5422
+ });
5423
+ if (index != -1) {
5424
+ let updateArr = conditionConfig.backField.split(',');
5425
+ updateArr.forEach(field => {
5426
+ array[index][field] = item[field];
5427
+ });
5428
+ } else {
5429
+ // 未匹配到时是否新增
5430
+ if (conditionConfig.conditionType == 'add') {
5431
+ array.push(item);
5432
+ }
5433
+ }
5434
+ });
5435
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByPath(inst, path, array);
5436
+ }
5357
5437
  }
5358
5438
  obj.rows = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getValueByPath(inst, path);
5359
5439
  SubPagination._digest(obj.rows);
@@ -5449,7 +5529,7 @@ const SubPagination = {
5449
5529
  // ESM COMPAT FLAG
5450
5530
  __webpack_require__.r(__webpack_exports__);
5451
5531
 
5452
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/File/src/main.vue?vue&type=template&id=f7cc3cda&scoped=true
5532
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/File/src/main.vue?vue&type=template&id=11355c9a&scoped=true
5453
5533
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"ht-file",class:[
5454
5534
  'inputs',
5455
5535
  _vm.formInputsDisplay == 'block'
@@ -5458,7 +5538,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
5458
5538
  var staticRenderFns = []
5459
5539
 
5460
5540
 
5461
- // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=template&id=f7cc3cda&scoped=true
5541
+ // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=template&id=11355c9a&scoped=true
5462
5542
 
5463
5543
  // EXTERNAL MODULE: ./src/utils.js
5464
5544
  var utils = __webpack_require__("025e");
@@ -5813,7 +5893,7 @@ const {
5813
5893
  methods: {
5814
5894
  // 上传前做校验
5815
5895
  beforeUploadMethod(file) {
5816
- if (file.name && this.accept && !this.accept.split(',').includes(file.name.split('.')[1])) {
5896
+ if (file.name && this.accept && !this.accept.split(',').includes(file.name.split('.')[file.name.split('.').length - 1])) {
5817
5897
  this.$message('请选择规定范围的文件进行上传!');
5818
5898
  return false;
5819
5899
  }
@@ -5982,8 +6062,8 @@ const {
5982
6062
  });
5983
6063
  // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=script&lang=js
5984
6064
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
5985
- // EXTERNAL MODULE: ./packages/File/src/main.vue?vue&type=style&index=0&id=f7cc3cda&prod&lang=scss&scoped=true
5986
- var mainvue_type_style_index_0_id_f7cc3cda_prod_lang_scss_scoped_true = __webpack_require__("e25e");
6065
+ // EXTERNAL MODULE: ./packages/File/src/main.vue?vue&type=style&index=0&id=11355c9a&prod&lang=scss&scoped=true
6066
+ var mainvue_type_style_index_0_id_11355c9a_prod_lang_scss_scoped_true = __webpack_require__("ba15");
5987
6067
 
5988
6068
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
5989
6069
  var componentNormalizer = __webpack_require__("2877");
@@ -6003,7 +6083,7 @@ var component = Object(componentNormalizer["a" /* default */])(
6003
6083
  staticRenderFns,
6004
6084
  false,
6005
6085
  null,
6006
- "f7cc3cda",
6086
+ "11355c9a",
6007
6087
  null
6008
6088
 
6009
6089
  )
@@ -6651,6 +6731,13 @@ module.exports = require("echarts/lib/chart/graph");
6651
6731
 
6652
6732
  /***/ }),
6653
6733
 
6734
+ /***/ "19bc":
6735
+ /***/ (function(module, exports, __webpack_require__) {
6736
+
6737
+ // extracted by mini-css-extract-plugin
6738
+
6739
+ /***/ }),
6740
+
6654
6741
  /***/ "19f1":
6655
6742
  /***/ (function(module, exports) {
6656
6743
 
@@ -7456,20 +7543,20 @@ module.exports = require("echarts/lib/chart/radar");
7456
7543
  // ESM COMPAT FLAG
7457
7544
  __webpack_require__.r(__webpack_exports__);
7458
7545
 
7459
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=5e169672&scoped=true
7546
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=0aa58584&scoped=true
7460
7547
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dropdown',{attrs:{"trigger":"click"},on:{"command":_vm.handleCommand}},[_c('span',{staticClass:"el-dropdown-link export_link"},[_c('ht-icon',{attrs:{"name":"export"}}),_vm._v("\n 子表导出\n ")],1),_c('el-dropdown-menu',{attrs:{"slot":"dropdown"},slot:"dropdown"},[_c('el-dropdown-item',{attrs:{"command":"current"}},[_vm._v("当前页数据")]),_c('el-dropdown-item',{attrs:{"command":"all"}},[_vm._v("所有数据")])],1)],1)}
7461
7548
  var staticRenderFns = []
7462
7549
 
7463
7550
 
7464
- // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=5e169672&scoped=true
7551
+ // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=0aa58584&scoped=true
7465
7552
 
7466
7553
  // EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubExportDialog.vue?vue&type=script&lang=js
7467
7554
  var SubExportDialogvue_type_script_lang_js = __webpack_require__("d82d");
7468
7555
 
7469
7556
  // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=script&lang=js
7470
7557
  /* harmony default export */ var src_SubExportDialogvue_type_script_lang_js = (SubExportDialogvue_type_script_lang_js["a" /* default */]);
7471
- // EXTERNAL MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=style&index=0&id=5e169672&prod&lang=scss&scoped=true
7472
- var SubExportDialogvue_type_style_index_0_id_5e169672_prod_lang_scss_scoped_true = __webpack_require__("cf7b");
7558
+ // EXTERNAL MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=style&index=0&id=0aa58584&prod&lang=scss&scoped=true
7559
+ var SubExportDialogvue_type_style_index_0_id_0aa58584_prod_lang_scss_scoped_true = __webpack_require__("11b4");
7473
7560
 
7474
7561
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
7475
7562
  var componentNormalizer = __webpack_require__("2877");
@@ -7489,7 +7576,7 @@ var component = Object(componentNormalizer["a" /* default */])(
7489
7576
  staticRenderFns,
7490
7577
  false,
7491
7578
  null,
7492
- "5e169672",
7579
+ "0aa58584",
7493
7580
  null
7494
7581
 
7495
7582
  )
@@ -9306,6 +9393,45 @@ const {
9306
9393
  dataColumns: {
9307
9394
  type: String,
9308
9395
  required: true
9396
+ },
9397
+ importMaxRow: {
9398
+ type: [String, Number],
9399
+ default: null
9400
+ },
9401
+ templateType: {
9402
+ // 导入模板类型 default 系统默认 custom 自定义
9403
+ type: String,
9404
+ default: 'default'
9405
+ },
9406
+ customTemplate: {
9407
+ // 自定义的导入模板文件
9408
+ type: String,
9409
+ default: ''
9410
+ },
9411
+ importTransform: {
9412
+ // 是否有转换字段
9413
+ type: String,
9414
+ default: '0'
9415
+ },
9416
+ importModes: {
9417
+ // 导入模式选项显示
9418
+ type: String,
9419
+ default: 'append,override,merge'
9420
+ },
9421
+ fieldTransformData: {
9422
+ // 转换字段配置
9423
+ type: String,
9424
+ default: ''
9425
+ },
9426
+ conditionRule: {
9427
+ // 条件模式配置
9428
+ type: String,
9429
+ default: ''
9430
+ },
9431
+ conditionType: {
9432
+ // 条件模式配置
9433
+ type: String,
9434
+ default: 'cover'
9309
9435
  }
9310
9436
  },
9311
9437
  data() {
@@ -9315,7 +9441,15 @@ const {
9315
9441
  showRowData: false,
9316
9442
  mergeFunc: null,
9317
9443
  mode: 'append',
9318
- modeOptions: [{
9444
+ cacheDicData: {} // 缓存字典数据
9445
+ };
9446
+ },
9447
+ computed: {
9448
+ columns: function () {
9449
+ return eval(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.dataColumns));
9450
+ },
9451
+ modeOptions() {
9452
+ let options = [{
9319
9453
  mode: 'append',
9320
9454
  desc: '追加导入'
9321
9455
  }, {
@@ -9323,15 +9457,27 @@ const {
9323
9457
  desc: '覆盖导入'
9324
9458
  }, {
9325
9459
  mode: 'merge',
9326
- desc: '合并导入',
9327
- disabled: true
9328
- }],
9329
- cacheDicData: {} // 缓存字典数据
9330
- };
9331
- },
9332
- computed: {
9333
- columns: function () {
9334
- return eval(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.dataColumns));
9460
+ desc: '合并导入'
9461
+ }, {
9462
+ mode: 'condition',
9463
+ desc: '条件导入'
9464
+ }];
9465
+ return options.filter(k => {
9466
+ return this.importModes.includes(k.mode);
9467
+ });
9468
+ },
9469
+ conditionConfig() {
9470
+ let config = {};
9471
+ if (this.conditionRule) {
9472
+ config = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.conditionRule));
9473
+ config.conditionArr.forEach(k => {
9474
+ k.exportField = this.getNameByDesc(k.exportField);
9475
+ });
9476
+ }
9477
+ return {
9478
+ conditionType: this.conditionType,
9479
+ ...config
9480
+ };
9335
9481
  }
9336
9482
  },
9337
9483
  watch: {
@@ -9350,7 +9496,7 @@ const {
9350
9496
  handler: function (newVal) {
9351
9497
  if (newVal) {
9352
9498
  // 如果有导入合并的代码,则允许选择合并导入模式
9353
- this.$set(this.modeOptions[2], 'disabled', false);
9499
+ // this.$set(this.modeOptions[2], 'disabled', false)
9354
9500
  // 并设置默认为 合并导入
9355
9501
  this.mode = 'merge';
9356
9502
  // 解码合并的代码
@@ -9367,6 +9513,9 @@ const {
9367
9513
  }
9368
9514
  },
9369
9515
  mounted() {
9516
+ if (this.importModes) {
9517
+ this.mode = this.importModes.split(',')[0];
9518
+ }
9370
9519
  // 初始化导入时需要的参数
9371
9520
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getOnlineFormInstance(this);
9372
9521
  let formUid = pInst && pInst._uid ? pInst._uid : '';
@@ -9385,6 +9534,40 @@ const {
9385
9534
  _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].clear(this.dataSubname, this);
9386
9535
  },
9387
9536
  methods: {
9537
+ transformFieldData(data) {
9538
+ return new Promise(async resolve => {
9539
+ if (this.importTransform === '0') {
9540
+ resolve(data);
9541
+ return;
9542
+ }
9543
+ let fieldTransformData = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.fieldTransformData));
9544
+ for (let i = 0; i < data.length; i++) {
9545
+ for (let j = 0; j < fieldTransformData.length; j++) {
9546
+ if (fieldTransformData[j].relevancyType == 'value') {
9547
+ data[i][fieldTransformData[j].field] = fieldTransformData[j].relevancyValue;
9548
+ } else {
9549
+ // 动态时 请求接口修改数据
9550
+ let result = await this.sqlChange(fieldTransformData[j], data[i][fieldTransformData[j].field]);
9551
+ if (result) {
9552
+ data[i][fieldTransformData[j].field] = result;
9553
+ }
9554
+ }
9555
+ }
9556
+ }
9557
+ resolve(data);
9558
+ });
9559
+ },
9560
+ async sqlChange(config, value = '') {
9561
+ return new Promise(resolve => {
9562
+ let params = {
9563
+ dsName: config.dataSource,
9564
+ sql: config.relevancyValue ? config.relevancyValue.replace(/{val}/g, value) : ''
9565
+ };
9566
+ this.$requestConfig.getValueBySql(params).then(res => {
9567
+ resolve(res);
9568
+ });
9569
+ });
9570
+ },
9388
9571
  changeDictionary(data) {
9389
9572
  return new Promise(async resolve => {
9390
9573
  for (let i = 0; i < data.length; i++) {
@@ -9416,6 +9599,24 @@ const {
9416
9599
  },
9417
9600
  //子表模板导出
9418
9601
  exportFormSub() {
9602
+ // 如果是自定义模板
9603
+ if (this.templateType == 'custom' && this.customTemplate) {
9604
+ let file = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.customTemplate))[0];
9605
+ this.$requestConfig.download(file.response.fileId).then(({
9606
+ data,
9607
+ headers
9608
+ }) => {
9609
+ if (data && headers) {
9610
+ // 附件下载
9611
+ const fileName = decodeURIComponent(headers['content-disposition'].split(';')[1].split('filename=')[1]);
9612
+ const blob = new Blob([data]);
9613
+ saveAs(blob, fileName);
9614
+ }
9615
+ }).catch(err => {
9616
+ this.$message.error(`附件下载失败:${err}`);
9617
+ });
9618
+ return;
9619
+ }
9419
9620
  let columns = this.columns.filter(item => {
9420
9621
  return !(item.ctrlType && (item.ctrlType === 'sunDiv' || item.ctrlType === 'suntable'));
9421
9622
  });
@@ -9461,6 +9662,7 @@ const {
9461
9662
  let count = this.importRows.length;
9462
9663
  if (count > maxRowInt && maxRowInt != 0) {
9463
9664
  this.$message.error('子表数据已超过最大行数【' + maxRowInt + '】');
9665
+ this.$refs.selectFile.value = '';
9464
9666
  return;
9465
9667
  }
9466
9668
  } else if (this.mode == 'append') {
@@ -9485,10 +9687,13 @@ const {
9485
9687
  }
9486
9688
  }
9487
9689
  let importRows = await this.changeDictionary(this.importRows);
9488
- _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].importData(this.dataSubname, importRows, this.mode, this.mergeFunc).then(() => {
9690
+ // 导入如果有数据转换的此处做转换
9691
+ importRows = await this.transformFieldData(importRows);
9692
+ _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].importData(this.dataSubname, importRows, this.mode, this.mergeFunc, this.conditionConfig).then(() => {
9489
9693
  this.$message.success('导入成功!');
9490
9694
  this.dialogVisible = false;
9491
9695
  }).catch(err => {
9696
+ this.$refs.selectFile.value = '';
9492
9697
  this.$message.error(`数据导入失败:${err}`);
9493
9698
  });
9494
9699
  },
@@ -9497,10 +9702,34 @@ const {
9497
9702
  return;
9498
9703
  }
9499
9704
  this.importRows = [];
9500
- this.readWorkbookFromLocalFile(m.target.files[0], rows => {
9705
+ this.readWorkbookFromLocalFile(m.target.files[0], async rows => {
9706
+ if (this.importMaxRow) {
9707
+ let count = rows.length;
9708
+ if (count > parseInt(this.importMaxRow)) {
9709
+ let result = await this.getConfirmValue(rows, parseInt(this.importMaxRow));
9710
+ if (result === false) {
9711
+ this.$refs.selectFile.value = '';
9712
+ return;
9713
+ }
9714
+ rows = result;
9715
+ }
9716
+ }
9501
9717
  this.importRows = this.changeRowKey(rows);
9502
9718
  });
9503
9719
  },
9720
+ getConfirmValue(rows, count) {
9721
+ return new Promise(resolve => {
9722
+ this.$confirm(`导入数据量已超过最大限制,将默认导入前【${count}】条,是否继续?`, '提示', {
9723
+ confirmButtonText: '确定',
9724
+ cancelButtonText: '取消',
9725
+ type: 'warning'
9726
+ }).then(() => {
9727
+ resolve(rows.slice(0, count));
9728
+ }).catch(() => {
9729
+ resolve(false);
9730
+ });
9731
+ });
9732
+ },
9504
9733
  // 读取本地excel文件
9505
9734
  readWorkbookFromLocalFile(file, callback) {
9506
9735
  const reader = new FileReader();
@@ -10554,13 +10783,6 @@ module.exports = require("echarts/lib/chart/pie");
10554
10783
 
10555
10784
  /***/ }),
10556
10785
 
10557
- /***/ "2a0b":
10558
- /***/ (function(module, exports, __webpack_require__) {
10559
-
10560
- // extracted by mini-css-extract-plugin
10561
-
10562
- /***/ }),
10563
-
10564
10786
  /***/ "2b16":
10565
10787
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10566
10788
 
@@ -12437,6 +12659,7 @@ const Formulas = {
12437
12659
  Formulas.install = Vue => {
12438
12660
  Vue.prototype.$Formulas = Formulas;
12439
12661
  };
12662
+ window.FormMath = Formulas;
12440
12663
 
12441
12664
 
12442
12665
  /***/ }),
@@ -12528,668 +12751,199 @@ var staticRenderFns = []
12528
12751
  // EXTERNAL MODULE: ./src/utils.js
12529
12752
  var utils = __webpack_require__("025e");
12530
12753
 
12531
- // EXTERNAL MODULE: ./src/services/SubPagination.js
12532
- var SubPagination = __webpack_require__("1639");
12754
+ // EXTERNAL MODULE: ./src/mixins/onlineSubtable.js
12755
+ var onlineSubtable = __webpack_require__("c31b");
12756
+
12757
+ // EXTERNAL MODULE: ./src/mixins/regionValidator.js
12758
+ var regionValidator = __webpack_require__("eaa5");
12533
12759
 
12534
- // CONCATENATED MODULE: ./src/mixins/onlineSubtable.js
12760
+ // EXTERNAL MODULE: ./src/mixins/emitter.js
12761
+ var emitter = __webpack_require__("a215");
12535
12762
 
12536
- /* harmony default export */ var onlineSubtable = ({
12537
- data() {
12538
- return {
12539
- fillOrg: {},
12540
- fillOrgConfMap: {},
12541
- transitionIndex: -1,
12542
- left_image: '',
12543
- right_image: ''
12544
- };
12545
- },
12546
- computed: {
12547
- // 子表前端分页过滤器
12548
- pagingSubData() {
12549
- const me = this;
12550
- return function (datapath) {
12551
- // 通过子表数据路径获取分页数据
12552
- return SubPagination["a" /* default */].pagingByPath(datapath, me);
12553
- };
12763
+ // EXTERNAL MODULE: external "vue"
12764
+ var external_vue_ = __webpack_require__("8bbf");
12765
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
12766
+
12767
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/OnlineForm/src/Form.vue?vue&type=script&lang=js
12768
+ //
12769
+ //
12770
+ //
12771
+ //
12772
+ //
12773
+ //
12774
+ //
12775
+ //
12776
+ //
12777
+ //
12778
+ //
12779
+ //
12780
+ //
12781
+ //
12782
+ //
12783
+ //
12784
+ //
12785
+ //
12786
+ //
12787
+ //
12788
+ //
12789
+ //
12790
+ //
12791
+ //
12792
+ //
12793
+ //
12794
+
12795
+
12796
+ // import onlineHottable from '@/mixins/onlineHottable.js'
12797
+
12798
+
12799
+
12800
+
12801
+ /* harmony default export */ var Formvue_type_script_lang_js = ({
12802
+ name: 'HtOnlineForm',
12803
+ componentName: 'HtOnlineForm',
12804
+ mixins: [regionValidator["a" /* default */], emitter["a" /* default */]],
12805
+ props: {
12806
+ html: String,
12807
+ data: Object,
12808
+ permission: Object,
12809
+ initFillData: {
12810
+ type: Boolean,
12811
+ default: false
12554
12812
  },
12555
- // 获取子表分页 offset
12556
- getPageOffset() {
12557
- return datapath => {
12558
- return SubPagination["a" /* default */].getPageOffset(datapath, this);
12559
- };
12813
+ isView: {
12814
+ type: Boolean,
12815
+ default: false
12560
12816
  },
12561
- // 是否为待办单
12562
- isTodoForm() {
12563
- const types = ['MyDelegate', 'done', 'LeaderDone', 'request'];
12564
- const type = this.$route.query.type || '';
12565
- return types.includes(type) || this.$route.query.readId;
12817
+ isPrint: {
12818
+ type: Boolean,
12819
+ default: false
12820
+ },
12821
+ isLook: {
12822
+ type: Boolean,
12823
+ default: false
12824
+ },
12825
+ mobileMode: {
12826
+ type: Boolean,
12827
+ default: false
12828
+ },
12829
+ flowKey: String,
12830
+ formId: String,
12831
+ formKey: String,
12832
+ extendProp: {
12833
+ type: Object,
12834
+ default: () => {
12835
+ return {};
12836
+ }
12837
+ },
12838
+ isSupportMobile: {
12839
+ type: Boolean,
12840
+ default: false
12841
+ },
12842
+ instId: [String, Number],
12843
+ isPreview: {
12844
+ type: Boolean,
12845
+ default: false
12566
12846
  }
12567
12847
  },
12568
- mounted() {
12569
- // 如果当前表单的element为Comment说明表单加载失败了。
12570
- if (this.$el && this.$el.constructor == Comment) {
12571
- this.$emit('load-fail');
12572
- return;
12573
- }
12574
- this.$validator = this.$root.$validator;
12575
- if (this.permission.table) {
12576
- for (let subTableName in this.permission.table) {
12577
- if (this.permission.table[subTableName].required) {
12578
- this.addSubTableByName(subTableName);
12848
+ data() {
12849
+ return {
12850
+ formName: `onlineForm_${utils["a" /* default */].getName()}`,
12851
+ loadStatus: 0,
12852
+ subBackfill: new Map(),
12853
+ hotTableFillback: String,
12854
+ scopeName: `form-${utils["a" /* default */].getName()}`,
12855
+ getDataPromiseResolve: null,
12856
+ getDataPromiseReject: null
12857
+ };
12858
+ },
12859
+ watch: {
12860
+ html: {
12861
+ handler: function (newVal) {
12862
+ if (newVal) {
12863
+ this.init();
12579
12864
  }
12580
- }
12581
- }
12582
- this.$emit('load-success', true);
12583
- if (this.isPrint) {
12584
- this.printDetail();
12865
+ },
12866
+ immediate: true
12585
12867
  }
12586
12868
  },
12587
- methods: {
12588
- getExpandArr(data, type) {
12589
- if (type === 'expand' && data) {
12590
- let arr = [];
12591
- data.forEach(item => {
12592
- arr.push(item.sub_guid);
12593
- });
12594
- return arr;
12595
- }
12596
- return data && data.length ? [data[0].sub_guid] : [];
12597
- },
12598
- printDetail() {
12599
- window.print();
12600
- if (this.isPrint) {
12601
- this.$router.go(-1);
12602
- }
12603
- setTimeout(function () {
12604
- location.reload();
12605
- }, 200);
12606
- },
12607
- //子表上移
12608
- up(index, data) {
12609
- if (index === 0) {
12610
- this.$message({
12611
- message: '已经是列表中第一位',
12612
- type: 'warning'
12613
- });
12869
+ created() {
12870
+ this.$on('global-validate-result', result => {
12871
+ if (result) {
12872
+ this.getDataPromiseResolve(this.data);
12614
12873
  } else {
12615
- let temp = data[index - 1];
12616
- this.$set(data, index - 1, data[index]);
12617
- this.$set(data, index, temp);
12874
+ this.getDataPromiseReject();
12618
12875
  }
12876
+ });
12877
+ },
12878
+ methods: {
12879
+ handleLoadSuccess(res) {
12880
+ this.loadStatus = 1;
12881
+ this.$emit('load-success', res);
12619
12882
  },
12620
- //子表下移
12621
- down(index, data) {
12622
- if (index === data.length - 1) {
12623
- this.$message({
12624
- message: '已经是列表中最后一位',
12625
- type: 'warning'
12626
- });
12627
- } else {
12628
- this.isTransition = true;
12629
- let i = data[index + 1];
12630
- this.$set(data, index + 1, data[index]);
12631
- this.$set(data, index, i);
12632
- }
12883
+ handleLoadFail() {
12884
+ this.loadStatus = -1;
12633
12885
  },
12634
- //子表复制数据
12635
- copy(obj, item, subPath) {
12636
- let newOne = JSON.parse(JSON.stringify(item));
12637
- //把id置空以免走的修改方法
12638
- if (newOne.id_) {
12639
- delete newOne.id_;
12640
- }
12641
- if (newOne.id) {
12642
- delete newOne.id;
12643
- }
12644
- if (newOne.sub_row_readonly) {
12645
- delete newOne.sub_row_readonly;
12646
- }
12647
- //有孙表时,删除孙表id_
12648
- for (let key in newOne) {
12649
- if (key.startsWith('sub_') && Array.isArray(newOne[key])) {
12650
- if (newOne[key].length) {
12651
- newOne[key].forEach(it => {
12652
- it.id_ && delete it.id_;
12653
- });
12654
- }
12655
- }
12656
- }
12657
- if (subPath) {
12658
- const watchMap = this.watchMap;
12659
- // 判断当前是否有绑定流水号的字段
12660
- if (watchMap) {
12661
- const bindIdentityModelNameList = watchMap.get('bindIdentityModelNameList');
12662
- if (bindIdentityModelNameList && bindIdentityModelNameList.length > 0) {
12663
- bindIdentityModelNameList.forEach(bim => {
12664
- if (bim.startsWith(subPath)) {
12665
- // 如果有则删除复制数据中原来的流水号值
12666
- delete newOne[bim.replace(`${subPath}.`, '')];
12667
- }
12668
- });
12669
- }
12886
+ getData(validate) {
12887
+ return new Promise((resolve, reject) => {
12888
+ this.getDataPromiseResolve = resolve;
12889
+ this.getDataPromiseReject = reject;
12890
+ if (!validate) {
12891
+ resolve(this.data);
12892
+ } else {
12893
+ // 执行校验逻辑
12894
+ this.validateRegion(`[name='${this.formName}']`).then(errorItems => {
12895
+ if (errorItems.length > 0) {
12896
+ reject(errorItems);
12897
+ } else {
12898
+ this.broadcast('HtGlobalValidate', 'global-validate');
12899
+ }
12900
+ });
12670
12901
  }
12671
- }
12672
- newOne.sub_guid = this.guid();
12673
- this.$root.$emit('add-new-collapse-item', newOne.sub_guid);
12674
- obj.push(newOne);
12675
- this.$forceUpdate();
12902
+ });
12676
12903
  },
12677
- //子表默认值回填
12678
- addSubTab(subTabPath) {
12679
- let pathArr = subTabPath.split('.');
12680
- if (pathArr.length < 3) {
12681
- this.$message({
12682
- message: '子表路径有误',
12683
- type: 'warning'
12684
- });
12685
- } else {
12686
- let subTabName = pathArr[2].replace('sub_', '');
12687
- let subInitData = this.data[pathArr[1]].initData[subTabName] || {};
12688
- //判断当前子表是否存有回显值
12689
- if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
12690
- subInitData = this.$parent.subBackfill.get(subTabPath);
12691
- }
12692
- //把数组里面的值为 null 转换为空字符串
12693
- let str = JSON.stringify(subInitData).replace(/null/g, '""');
12694
- let subData = JSON.parse(str);
12695
- const subDataArr = this.data[pathArr[1]][pathArr[2]];
12696
- //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
12697
- const nextIndex = subDataArr.length;
12698
- for (var key in subData) {
12699
- //点添加时判断要新增子表记录中的孙表是否有值
12700
- if (key.indexOf('sub_') == 0) {
12701
- if (subData[key].length > 0) {
12702
- subData[key] = []; //有则清空
12703
- }
12704
- const sunTabName = key.replace('sub_', '');
12705
- if (this.permission.table[sunTabName] && (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName].required == 'true')) {
12706
- this.$nextTick(() => {
12707
- this.addSunTab(`${subTabPath}.${key}`, nextIndex);
12708
- });
12904
+ init() {
12905
+ this.loadStatus = 1;
12906
+ external_vue_default.a.component('ht-runtime-template', {
12907
+ componentName: 'HtRuntimeTemplate',
12908
+ mixins: [onlineSubtable["a" /* default */]],
12909
+ props: {
12910
+ html: String,
12911
+ data: Object,
12912
+ permission: Object,
12913
+ initFillData: {
12914
+ type: Boolean,
12915
+ default: false
12916
+ },
12917
+ isView: {
12918
+ type: Boolean,
12919
+ default: false
12920
+ },
12921
+ isPrint: {
12922
+ type: Boolean,
12923
+ default: false
12924
+ },
12925
+ formKey: String,
12926
+ mobileMode: {
12927
+ type: Boolean,
12928
+ default: false
12929
+ },
12930
+ extendProp: {
12931
+ type: Object,
12932
+ default: () => {
12933
+ return {};
12709
12934
  }
12935
+ },
12936
+ isSupportMobile: {
12937
+ type: Boolean,
12938
+ default: false
12939
+ },
12940
+ instId: [String, Number],
12941
+ isPreview: {
12942
+ type: Boolean,
12943
+ default: false
12710
12944
  }
12711
- }
12712
- let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData);
12713
- fillObj.sub_guid = this.guid();
12714
- this.$root.$emit('add-new-collapse-item', fillObj.sub_guid);
12715
- subDataArr.push(fillObj);
12716
- }
12717
- },
12718
- //子表添加头部样式
12719
- handleCellStyle({
12720
- column
12721
- }) {
12722
- let ColBgColor;
12723
- if (column.className) {
12724
- ColBgColor = column.className.split('__')[1];
12725
- }
12726
- return ColBgColor ? {
12727
- background: ColBgColor
12728
- } : {};
12729
- },
12730
- //子表表头颜色
12731
- handleRowStyle(color) {
12732
- return {
12733
- '--headerBgColor': color ? color : '#f4f4f4'
12734
- };
12735
- },
12736
- guid() {
12737
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
12738
- var r = Math.random() * 16 | 0,
12739
- v = c == 'x' ? r : r & 0x3 | 0x8;
12740
- return v.toString(16);
12741
- });
12742
- },
12743
- //孙表默认值回填
12744
- addSunTab(subTabPath, index) {
12745
- let pathArr = subTabPath.split('.');
12746
- if (pathArr.length < 4) {
12747
- this.$message({
12748
- message: '孙表路径有误',
12749
- type: 'warning'
12750
- });
12751
- } else {
12752
- const subTablePath = pathArr.filter((item, index) => index !== 3);
12753
- const subIndex = this.getPageOffset(subTablePath.join('.')) + index;
12754
- let subTabName = pathArr[2].replace('sub_', '');
12755
- let sunTabName = pathArr[3].replace('sub_', '');
12756
- let subTable = this.data[pathArr[1]][pathArr[2]][subIndex];
12757
- if (!subTable.hasOwnProperty(pathArr[3])) {
12758
- this.$set(subTable, pathArr[3], new Array());
12759
- }
12760
- let subInitData = this.data[pathArr[1]].initData[subTabName].initData[sunTabName] || {};
12761
- //判断当前孙表是否存有回显值
12762
- if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
12763
- //this.data[pathArr[1]][pathArr[2]].push(this.$parent.subBackfill.get(subTabPath));
12764
- subInitData = this.$parent.subBackfill.get(subTabPath);
12765
- }
12766
- //把数组里面的值为 null 转换为空字符串
12767
- let str = JSON.stringify(subInitData).replace(/null/g, '""');
12768
- if (!this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]]) {
12769
- let key = [pathArr[3]];
12770
- let value = new Array();
12771
- this.data[pathArr[1]][pathArr[2]][subIndex][key] = value;
12772
- }
12773
- let sunBodata = JSON.parse(str);
12774
- sunBodata.sub_guid = this.guid();
12775
- this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]].push(sunBodata);
12776
- this.$root.$emit('add-new-collapse-item', sunBodata.sub_guid);
12777
- this.$forceUpdate(); //迫使 Vue 实例重新渲染
12778
- }
12779
- },
12780
- addSubTableByName(subTableName) {
12781
- for (let boAlias in this.data) {
12782
- let subInitData = JSON.parse(JSON.stringify(this.data[boAlias].initData[subTableName] || {}));
12783
- if (this.data[boAlias]['sub_' + subTableName] && this.data[boAlias]['sub_' + subTableName].length < 1) {
12784
- this.data[boAlias]['sub_' + subTableName].push(JSON.parse(JSON.stringify(subInitData)));
12785
- // 孙表必填 默认添加一条
12786
- if (this.permission.table) {
12787
- for (let tableName in this.permission.table) {
12788
- if (this.permission.table[tableName].required) {
12789
- if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] && this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].length < 1) {
12790
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(JSON.parse(JSON.stringify(subInitData.initData[tableName])));
12791
- } else if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && !this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName]) {
12792
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] = [];
12793
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(subInitData.initData[tableName]);
12794
- }
12795
- }
12796
- }
12797
- }
12798
- }
12799
- }
12800
- },
12801
- deleteRow(subTablePath, item) {
12802
- let pathArr = subTablePath.split('.');
12803
- if (pathArr.length < 2) {
12804
- this.$message({
12805
- message: '子表路径有误',
12806
- type: 'warning'
12807
- });
12808
- } else {
12809
- let subTabName = pathArr[1].replace('sub_', '');
12810
- if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12811
- this.$message({
12812
- message: '子表必填一条记录',
12813
- type: 'warning'
12814
- });
12815
- return;
12816
- }
12817
- this.data[pathArr[0]][pathArr[1]].remove(item);
12818
- }
12819
- },
12820
- deleteSunRow(subTablePath, item, subIndex) {
12821
- let pathArr = subTablePath.split('.');
12822
- if (pathArr.length < 3) {
12823
- this.$message({
12824
- message: '孙表路径有误',
12825
- type: 'warning'
12826
- });
12827
- } else {
12828
- let subTabName = pathArr[1].replace('sub_', '');
12829
- let sunTabName = pathArr[2].replace('sub_', '');
12830
- if (this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].length == 1 && (this.permission.table[sunTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12831
- this.$message({
12832
- message: '孙表必填一条记录',
12833
- type: 'warning'
12834
- });
12835
- return;
12836
- }
12837
- this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].remove(item);
12838
- this.data = Object.assign({}, this.data);
12839
- }
12840
- },
12841
- clearAllMessageBox(data) {
12842
- this.$confirm('确认执行该操作?', '提示', {
12843
- confirmButtonText: '确定',
12844
- cancelButtonText: '取消',
12845
- type: 'warning'
12846
- }).then(() => {
12847
- this.clearAll(data);
12848
- }).catch(() => {
12849
- this.$message({
12850
- type: 'info',
12851
- message: '已取消操作'
12852
- });
12853
- });
12854
- },
12855
- clearAll(args) {
12856
- const {
12857
- subTablePath,
12858
- isHot,
12859
- index
12860
- } = args;
12861
- let pathArr;
12862
- if (!subTablePath) {
12863
- pathArr = args.split('.');
12864
- } else {
12865
- pathArr = subTablePath.split('.');
12866
- }
12867
- if (pathArr.length < 2) {
12868
- this.$message({
12869
- message: '子表路径有误',
12870
- type: 'warning'
12871
- });
12872
- //孙表
12873
- } else if ((index || index === 0) && pathArr.length == 3) {
12874
- const sunTabName = pathArr[2].replace('sub_', '');
12875
- if (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName] == 'true') {
12876
- this.$message.warning('孙表必填,至少保留一条记录');
12877
- return;
12878
- }
12879
- const _subPath = `data.${pathArr[0]}.${pathArr[1]}`;
12880
- const subIndex = this.getPageOffset(_subPath) + index;
12881
- const ary = this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]];
12882
- if (ary instanceof Array) {
12883
- ary.splice(0, ary.length);
12884
- }
12885
- } else {
12886
- const subTabName = pathArr[1].replace('sub_', '');
12887
- if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12888
- this.$message({
12889
- message: '子表必填,至少保留一条记录。',
12890
- type: 'warning'
12891
- });
12892
- return;
12893
- }
12894
- const ary = this.data[pathArr[0]][pathArr[1]];
12895
- if (ary instanceof Array) {
12896
- ary.splice(0, ary.length);
12897
- }
12898
- if (isHot) {
12899
- const hotTableRef = 'hottable.' + subTablePath;
12900
- this.$refs[hotTableRef].fillbackHotTableData(null);
12901
- }
12902
- }
12903
- },
12904
- toFillOrg(path, row) {
12905
- const fillOrgConf = this.fillOrgConfMap[path];
12906
- let fillObj = {};
12907
- if (fillOrgConf && this.fillOrg) {
12908
- if (fillOrgConf.name) {
12909
- const namePath = fillOrgConf.name.split('.');
12910
- fillObj[namePath[namePath.length - 1]] = this.fillOrg.name;
12911
- }
12912
- if (fillOrgConf.id) {
12913
- const idPath = fillOrgConf.id.split('.');
12914
- fillObj[idPath[idPath.length - 1]] = this.fillOrg.id;
12915
- }
12916
- if (fillOrgConf.code) {
12917
- const codePath = fillOrgConf.code.split('.');
12918
- fillObj[codePath[codePath.length - 1]] = this.fillOrg.code;
12919
- }
12920
- if (fillOrgConf.instId) {
12921
- const instIdPath = fillOrgConf.instId.split('.');
12922
- fillObj[instIdPath[instIdPath.length - 1]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
12923
- }
12924
- return {
12925
- ...row,
12926
- ...fillObj
12927
- };
12928
- }
12929
- return row;
12930
- },
12931
- initFill(path, conf) {
12932
- //收集自动回填信息
12933
- if (path && conf) {
12934
- try {
12935
- const confJson = this.fillOrgConfMap[path] ? this.fillOrgConfMap[path] : JSON.parse(conf);
12936
- if (confJson.id || confJson.code || confJson.name || confJson.instId) {
12937
- this.fillOrgConfMap[path] = confJson;
12938
- this.initFirstFill(path, confJson);
12939
- }
12940
- } catch (error) {
12941
- error;
12942
- }
12943
- }
12944
- },
12945
- initFirstFill(path, conf) {
12946
- //处理第一行的回填
12947
- const paths = path.split('.');
12948
- if (this.data[paths[0]][paths[1]] && this.data[paths[0]][paths[1]].length == 1 && this.fillOrg.id) {
12949
- if (conf.id) {
12950
- const idPath = conf.id.split('.');
12951
- if (!this.data[paths[0]][paths[1]][0][idPath[2]]) {
12952
- this.data[paths[0]][paths[1]][0][idPath[2]] = this.fillOrg.id;
12953
- if (conf.code) {
12954
- const codePath = conf.code.split('.');
12955
- if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
12956
- this.data[paths[0]][paths[1]][0][codePath[2]] = this.fillOrg.code;
12957
- }
12958
- }
12959
- if (conf.name) {
12960
- const namePath = conf.name.split('.');
12961
- if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
12962
- this.data[paths[0]][paths[1]][0][namePath[2]] = this.fillOrg.name;
12963
- }
12964
- }
12965
- }
12966
- }
12967
- if (conf.instId) {
12968
- const instIdPath = conf.instId.split('.');
12969
- if (!this.data[paths[0]][paths[1]][0][instIdPath[2]]) {
12970
- this.data[paths[0]][paths[1]][0][instIdPath[2]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
12971
- }
12972
- }
12973
- }
12974
- },
12975
- isShowAddButton(path, maxRow, subIndex) {
12976
- if (maxRow === 0) return false;
12977
- let pathArr = path.split('.');
12978
- if (subIndex >= 0) {
12979
- if (pathArr.length < 4) {
12980
- this.$message({
12981
- message: '子表路径有误',
12982
- type: 'warning'
12983
- });
12984
- } else {
12985
- let data = this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]] || [];
12986
- return data.length >= maxRow;
12987
- }
12988
- } else {
12989
- if (pathArr.length < 3) {
12990
- this.$message({
12991
- message: '子表路径有误',
12992
- type: 'warning'
12993
- });
12994
- } else {
12995
- let data = this.data[pathArr[1]][pathArr[2]] || [];
12996
- return data.length >= maxRow;
12997
- }
12998
- }
12999
- return false;
13000
- }
13001
- }
13002
- });
13003
- // EXTERNAL MODULE: ./src/mixins/regionValidator.js
13004
- var regionValidator = __webpack_require__("eaa5");
13005
-
13006
- // EXTERNAL MODULE: ./src/mixins/emitter.js
13007
- var emitter = __webpack_require__("a215");
13008
-
13009
- // EXTERNAL MODULE: external "vue"
13010
- var external_vue_ = __webpack_require__("8bbf");
13011
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
13012
-
13013
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/OnlineForm/src/Form.vue?vue&type=script&lang=js
13014
- //
13015
- //
13016
- //
13017
- //
13018
- //
13019
- //
13020
- //
13021
- //
13022
- //
13023
- //
13024
- //
13025
- //
13026
- //
13027
- //
13028
- //
13029
- //
13030
- //
13031
- //
13032
- //
13033
- //
13034
- //
13035
- //
13036
- //
13037
- //
13038
- //
13039
- //
13040
-
13041
-
13042
- // import onlineHottable from '@/mixins/onlineHottable.js'
13043
-
13044
-
13045
-
13046
-
13047
- /* harmony default export */ var Formvue_type_script_lang_js = ({
13048
- name: 'HtOnlineForm',
13049
- componentName: 'HtOnlineForm',
13050
- mixins: [regionValidator["a" /* default */], emitter["a" /* default */]],
13051
- props: {
13052
- html: String,
13053
- data: Object,
13054
- permission: Object,
13055
- initFillData: {
13056
- type: Boolean,
13057
- default: false
13058
- },
13059
- isView: {
13060
- type: Boolean,
13061
- default: false
13062
- },
13063
- isPrint: {
13064
- type: Boolean,
13065
- default: false
13066
- },
13067
- isLook: {
13068
- type: Boolean,
13069
- default: false
13070
- },
13071
- mobileMode: {
13072
- type: Boolean,
13073
- default: false
13074
- },
13075
- flowKey: String,
13076
- formId: String,
13077
- formKey: String,
13078
- extendProp: {
13079
- type: Object,
13080
- default: () => {
13081
- return {};
13082
- }
13083
- },
13084
- isSupportMobile: {
13085
- type: Boolean,
13086
- default: false
13087
- },
13088
- instId: [String, Number],
13089
- isPreview: {
13090
- type: Boolean,
13091
- default: false
13092
- }
13093
- },
13094
- data() {
13095
- return {
13096
- formName: `onlineForm_${utils["a" /* default */].getName()}`,
13097
- loadStatus: 0,
13098
- subBackfill: new Map(),
13099
- hotTableFillback: String,
13100
- scopeName: `form-${utils["a" /* default */].getName()}`,
13101
- getDataPromiseResolve: null,
13102
- getDataPromiseReject: null
13103
- };
13104
- },
13105
- watch: {
13106
- html: {
13107
- handler: function (newVal) {
13108
- if (newVal) {
13109
- this.init();
13110
- }
13111
- },
13112
- immediate: true
13113
- }
13114
- },
13115
- created() {
13116
- this.$on('global-validate-result', result => {
13117
- if (result) {
13118
- this.getDataPromiseResolve(this.data);
13119
- } else {
13120
- this.getDataPromiseReject();
13121
- }
13122
- });
13123
- },
13124
- methods: {
13125
- handleLoadSuccess(res) {
13126
- this.loadStatus = 1;
13127
- this.$emit('load-success', res);
13128
- },
13129
- handleLoadFail() {
13130
- this.loadStatus = -1;
13131
- },
13132
- getData(validate) {
13133
- return new Promise((resolve, reject) => {
13134
- this.getDataPromiseResolve = resolve;
13135
- this.getDataPromiseReject = reject;
13136
- if (!validate) {
13137
- resolve(this.data);
13138
- } else {
13139
- // 执行校验逻辑
13140
- this.validateRegion(`[name='${this.formName}']`).then(errorItems => {
13141
- if (errorItems.length > 0) {
13142
- reject(errorItems);
13143
- } else {
13144
- this.broadcast('HtGlobalValidate', 'global-validate');
13145
- }
13146
- });
13147
- }
13148
- });
13149
- },
13150
- init() {
13151
- this.loadStatus = 1;
13152
- external_vue_default.a.component('ht-runtime-template', {
13153
- componentName: 'HtRuntimeTemplate',
13154
- mixins: [onlineSubtable],
13155
- props: {
13156
- html: String,
13157
- data: Object,
13158
- permission: Object,
13159
- initFillData: {
13160
- type: Boolean,
13161
- default: false
13162
- },
13163
- isView: {
13164
- type: Boolean,
13165
- default: false
13166
- },
13167
- isPrint: {
13168
- type: Boolean,
13169
- default: false
13170
- },
13171
- formKey: String,
13172
- mobileMode: {
13173
- type: Boolean,
13174
- default: false
13175
- },
13176
- extendProp: {
13177
- type: Object,
13178
- default: () => {
13179
- return {};
13180
- }
13181
- },
13182
- isSupportMobile: {
13183
- type: Boolean,
13184
- default: false
13185
- },
13186
- instId: [String, Number],
13187
- isPreview: {
13188
- type: Boolean,
13189
- default: false
13190
- }
13191
- },
13192
- template: this.html
12945
+ },
12946
+ template: this.html
13193
12947
  });
13194
12948
  }
13195
12949
  }
@@ -14415,13 +14169,6 @@ var component = Object(componentNormalizer["a" /* default */])(
14415
14169
 
14416
14170
  /***/ }),
14417
14171
 
14418
- /***/ "3929":
14419
- /***/ (function(module, exports, __webpack_require__) {
14420
-
14421
- // extracted by mini-css-extract-plugin
14422
-
14423
- /***/ }),
14424
-
14425
14172
  /***/ "3966":
14426
14173
  /***/ (function(module, exports, __webpack_require__) {
14427
14174
 
@@ -19443,17 +19190,6 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
19443
19190
  /* unused harmony reexport * */
19444
19191
 
19445
19192
 
19446
- /***/ }),
19447
-
19448
- /***/ "5369":
19449
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
19450
-
19451
- "use strict";
19452
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_139da030_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a0b");
19453
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_139da030_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_139da030_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
19454
- /* unused harmony reexport * */
19455
-
19456
-
19457
19193
  /***/ }),
19458
19194
 
19459
19195
  /***/ "540d":
@@ -23814,6 +23550,13 @@ var component = Object(componentNormalizer["a" /* default */])(
23814
23550
  /* unused harmony reexport * */
23815
23551
 
23816
23552
 
23553
+ /***/ }),
23554
+
23555
+ /***/ "67be":
23556
+ /***/ (function(module, exports, __webpack_require__) {
23557
+
23558
+ // extracted by mini-css-extract-plugin
23559
+
23817
23560
  /***/ }),
23818
23561
 
23819
23562
  /***/ "6861":
@@ -31681,13 +31424,6 @@ var component = Object(componentNormalizer["a" /* default */])(
31681
31424
  /* unused harmony reexport * */
31682
31425
 
31683
31426
 
31684
- /***/ }),
31685
-
31686
- /***/ "7f2d":
31687
- /***/ (function(module, exports, __webpack_require__) {
31688
-
31689
- // extracted by mini-css-extract-plugin
31690
-
31691
31427
  /***/ }),
31692
31428
 
31693
31429
  /***/ "7fbd":
@@ -33487,7 +33223,7 @@ _main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].register({
33487
33223
  /***/ "9224":
33488
33224
  /***/ (function(module) {
33489
33225
 
33490
- module.exports = JSON.parse("{\"a\":\"1.0.65\"}");
33226
+ module.exports = JSON.parse("{\"a\":\"1.0.66\"}");
33491
33227
 
33492
33228
  /***/ }),
33493
33229
 
@@ -37099,6 +36835,17 @@ var component = Object(componentNormalizer["a" /* default */])(
37099
36835
 
37100
36836
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
37101
36837
 
36838
+ /***/ }),
36839
+
36840
+ /***/ "a692":
36841
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
36842
+
36843
+ "use strict";
36844
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_c3869aec_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cd50");
36845
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_c3869aec_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubImportDialog_vue_vue_type_style_index_0_id_c3869aec_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
36846
+ /* unused harmony reexport * */
36847
+
36848
+
37102
36849
  /***/ }),
37103
36850
 
37104
36851
  /***/ "a699":
@@ -40239,6 +39986,17 @@ var component = Object(componentNormalizer["a" /* default */])(
40239
39986
 
40240
39987
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
40241
39988
 
39989
+ /***/ }),
39990
+
39991
+ /***/ "ba15":
39992
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
39993
+
39994
+ "use strict";
39995
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_11355c9a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("67be");
39996
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_11355c9a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_11355c9a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
39997
+ /* unused harmony reexport * */
39998
+
39999
+
40242
40000
  /***/ }),
40243
40001
 
40244
40002
  /***/ "ba2f":
@@ -40302,20 +40060,20 @@ __webpack_require__.r(__webpack_exports__);
40302
40060
  // ESM COMPAT FLAG
40303
40061
  __webpack_require__.r(__webpack_exports__);
40304
40062
 
40305
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=139da030&scoped=true
40063
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"6ffb8e84-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=c3869aec&scoped=true
40306
40064
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"import-container"},[_c('el-button',{staticClass:"import-btn",attrs:{"type":"text","size":"mini"},on:{"click":function($event){_vm.dialogVisible = true}}},[_c('ht-icon',{attrs:{"name":"import"}}),_vm._v("\n 子表导入\n ")],1),_c('el-button',{staticClass:"download-btn",attrs:{"type":"text","size":"mini"},on:{"click":_vm.exportFormSub}},[_c('ht-icon',{attrs:{"name":"download"}}),_vm._v("\n 下载模板\n ")],1),_c('el-dialog',{attrs:{"visible":_vm.dialogVisible,"width":"600px","title":"导入子表数据","append-to-body":"","close-on-click-modal":false},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('el-form',{directives:[{name:"form",rawName:"v-form",value:({ inputsDisplay: 'block' }),expression:"{ inputsDisplay: 'block' }"}],attrs:{"label-width":"100px","label-position":"left"}},[_c('el-form-item',{attrs:{"label":"导入文件:"}},[_c('input',{ref:"selectFile",attrs:{"type":"file","accept":"application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},on:{"change":_vm.fileChange}})]),_c('el-form-item',{attrs:{"label":"导入模式:"}},[_c('ht-radio',{attrs:{"options":_vm.modeOptions,"props":{ key: 'mode', value: 'desc' }},model:{value:(_vm.mode),callback:function ($$v) {_vm.mode=$$v},expression:"mode"}})],1),(_vm.importRows && _vm.importRows.length > 0)?_c('el-tag',{staticClass:"read-success__label",attrs:{"type":"warning"}},[_vm._v("\n 已经读取到\n "),_c('b',[_vm._v(_vm._s(_vm.importRows.length))]),_vm._v("\n 条数据,\n "),_c('a',{on:{"click":function($event){_vm.showRowData = !_vm.showRowData}}},[_vm._v("点击查看详情")]),_vm._v("\n 。\n ")]):_vm._e(),(_vm.showRowData)?_c('pre',{staticClass:"import-rows__pre"},[_vm._v(_vm._s(_vm.importRows))]):_vm._e()],1),_c('span',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"size":"small","type":"primary","disabled":!_vm.importRows || _vm.importRows.length == 0},on:{"click":_vm.dialogConfirm}},[_vm._v("\n 确定\n ")]),_c('el-button',{attrs:{"size":"small"},on:{"click":function($event){_vm.dialogVisible = false}}},[_vm._v("取消")])],1)],1)],1)}
40307
40065
  var staticRenderFns = []
40308
40066
 
40309
40067
 
40310
- // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=139da030&scoped=true
40068
+ // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=c3869aec&scoped=true
40311
40069
 
40312
40070
  // EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/Subtable/src/SubImportDialog.vue?vue&type=script&lang=js
40313
40071
  var SubImportDialogvue_type_script_lang_js = __webpack_require__("248e");
40314
40072
 
40315
40073
  // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=script&lang=js
40316
40074
  /* harmony default export */ var src_SubImportDialogvue_type_script_lang_js = (SubImportDialogvue_type_script_lang_js["a" /* default */]);
40317
- // EXTERNAL MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=style&index=0&id=139da030&prod&lang=scss&scoped=true
40318
- var SubImportDialogvue_type_style_index_0_id_139da030_prod_lang_scss_scoped_true = __webpack_require__("5369");
40075
+ // EXTERNAL MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=style&index=0&id=c3869aec&prod&lang=scss&scoped=true
40076
+ var SubImportDialogvue_type_style_index_0_id_c3869aec_prod_lang_scss_scoped_true = __webpack_require__("a692");
40319
40077
 
40320
40078
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
40321
40079
  var componentNormalizer = __webpack_require__("2877");
@@ -40335,7 +40093,7 @@ var component = Object(componentNormalizer["a" /* default */])(
40335
40093
  staticRenderFns,
40336
40094
  false,
40337
40095
  null,
40338
- "139da030",
40096
+ "c3869aec",
40339
40097
  null
40340
40098
 
40341
40099
  )
@@ -42024,6 +41782,698 @@ module.exports = require("echarts/lib/echarts.js");
42024
41782
 
42025
41783
  /***/ }),
42026
41784
 
41785
+ /***/ "c31b":
41786
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
41787
+
41788
+ "use strict";
41789
+ /* harmony import */ var _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1639");
41790
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("025e");
41791
+
41792
+
41793
+ /* harmony default export */ __webpack_exports__["a"] = ({
41794
+ data() {
41795
+ return {
41796
+ searchVal: '',
41797
+ //搜索关键字
41798
+ fillOrg: {},
41799
+ fillOrgConfMap: {},
41800
+ transitionIndex: -1,
41801
+ left_image: '',
41802
+ right_image: ''
41803
+ };
41804
+ },
41805
+ computed: {
41806
+ // 子表前端分页过滤器
41807
+ pagingSubData() {
41808
+ const me = this;
41809
+ return function (datapath) {
41810
+ // 通过子表数据路径获取分页数据
41811
+ return _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].pagingByPath(datapath, me);
41812
+ };
41813
+ },
41814
+ // 获取子表分页 offset
41815
+ getPageOffset() {
41816
+ return datapath => {
41817
+ return _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].getPageOffset(datapath, this);
41818
+ };
41819
+ },
41820
+ // 是否为待办单
41821
+ isTodoForm() {
41822
+ const types = ['MyDelegate', 'done', 'LeaderDone', 'request'];
41823
+ const type = this.$route.query.type || '';
41824
+ return types.includes(type) || this.$route.query.readId;
41825
+ }
41826
+ },
41827
+ mounted() {
41828
+ // 如果当前表单的element为Comment说明表单加载失败了。
41829
+ if (this.$el && this.$el.constructor == Comment) {
41830
+ this.$emit('load-fail');
41831
+ return;
41832
+ }
41833
+ this.$validator = this.$root.$validator;
41834
+ if (this.permission.table) {
41835
+ for (let subTableName in this.permission.table) {
41836
+ if (this.permission.table[subTableName].required) {
41837
+ this.addSubTableByName(subTableName);
41838
+ }
41839
+ }
41840
+ }
41841
+ this.$emit('load-success', true);
41842
+ if (this.isPrint) {
41843
+ this.printDetail();
41844
+ }
41845
+ },
41846
+ methods: {
41847
+ //合计计算
41848
+ getSummaries(param, list) {
41849
+ let CancelTheCalculation = sessionStorage.getItem('Cancel_The_Calculation') ? JSON.parse(sessionStorage.getItem('Cancel_The_Calculation')) : {};
41850
+ //
41851
+ let listChange = JSON.parse(Base64.decode(list, 'utf-8'));
41852
+
41853
+ //
41854
+
41855
+ if (listChange.length < 1) {
41856
+ return;
41857
+ }
41858
+ const {
41859
+ columns,
41860
+ data
41861
+ } = param;
41862
+ this.tableData = data;
41863
+ const sums = [];
41864
+ let calcProp = [];
41865
+ let columnsDep = _.cloneDeep(columns);
41866
+ listChange.forEach((item, idex) => {
41867
+ if (item.addFunc == 'calcFunc') {
41868
+ columnsDep.forEach((column, index) => {
41869
+ if (item.mathExp && item.mathExp.indexOf('.' + column.property) > -1) {
41870
+ calcProp.push(column.property);
41871
+ }
41872
+ });
41873
+ }
41874
+ columnsDep.forEach((column, index) => {
41875
+ if (item.columnField == column.property) {
41876
+ column.combinedOption = item;
41877
+ }
41878
+ });
41879
+ });
41880
+ columnsDep.forEach((column, index) => {
41881
+ if (index === 0 && columnsDep[0].type == 'index') {
41882
+ sums[index] = '';
41883
+ return;
41884
+ }
41885
+ //当有需要才合计
41886
+ if (column.combinedOption) {
41887
+ let {
41888
+ addFunc,
41889
+ columnField,
41890
+ name,
41891
+ unit,
41892
+ showType,
41893
+ num,
41894
+ tag,
41895
+ mainTarget
41896
+ } = column.combinedOption;
41897
+ let Bol = tag && CancelTheCalculation && CancelTheCalculation[tag] && CancelTheCalculation[tag].length > 0;
41898
+ const values = data.map(item => Number(item[column.property]));
41899
+ let depValues = _.cloneDeep(values);
41900
+ if (Bol) {
41901
+ let delMin = [];
41902
+ depValues.forEach((item, i) => {
41903
+ if (!CancelTheCalculation[tag].includes(i)) {
41904
+ delMin.push(item);
41905
+ }
41906
+ });
41907
+ depValues = delMin;
41908
+ }
41909
+ let units = unit ? unit : '';
41910
+ //求和
41911
+ if (addFunc === 'add') {
41912
+ if (!depValues.every(value => isNaN(value))) {
41913
+ sums[index] = depValues.reduce((prev, curr) => {
41914
+ const value = Number(curr);
41915
+ if (!isNaN(value)) {
41916
+ return prev + curr;
41917
+ } else {
41918
+ return prev;
41919
+ }
41920
+ }, 0);
41921
+ sums[index] = this.dealWithDataHtml(name, sums[index], showType, num, units, mainTarget);
41922
+ } else {
41923
+ sums[index] = this.dealWithDataHtml(name, 0, showType, num, units, mainTarget);
41924
+ }
41925
+ }
41926
+ //计数
41927
+ if (addFunc === 'count') {
41928
+ let numCount = values.length;
41929
+ if (Bol) {
41930
+ numCount = values.length - CancelTheCalculation[tag].length;
41931
+ }
41932
+ sums[index] = this.dealWithDataHtml(name, numCount, showType, num, units, mainTarget);
41933
+ }
41934
+ //平均值
41935
+ if (addFunc === 'average') {
41936
+ let sum = 0;
41937
+ var average = 0;
41938
+ for (var i = 0; i < depValues.length; i++) {
41939
+ sum += depValues[i];
41940
+ }
41941
+ depValues.length > 0 ? average = sum / depValues.length : average = 0;
41942
+ sums[index] = this.dealWithDataHtml(name, average, showType, num, units, mainTarget);
41943
+ }
41944
+ //最大值
41945
+ if (addFunc === 'max') {
41946
+ let maxNum = Math.max.apply(null, depValues.length > 0 ? depValues : [0]);
41947
+ sums[index] = this.dealWithDataHtml(name, maxNum, showType, num, units, mainTarget);
41948
+ }
41949
+ //最小值
41950
+ if (addFunc === 'min') {
41951
+ let minNum = Math.min.apply(null, depValues.length > 0 ? depValues : [0]);
41952
+ sums[index] = this.dealWithDataHtml(name, minNum, showType, num, units, mainTarget);
41953
+ }
41954
+
41955
+ //公式计算
41956
+ if (addFunc === 'calcFunc') {
41957
+ const calcVal = this.dealCustomCalc(data, column.combinedOption);
41958
+ sums[index] = this.dealWithDataHtml(name, calcVal, showType, num, units, mainTarget);
41959
+ }
41960
+ } else if (calcProp.indexOf(column.property) > -1) {
41961
+ const values = data.map(item => Number(item[column.property]));
41962
+ }
41963
+ });
41964
+ return sums;
41965
+ },
41966
+ //合计行
41967
+ handleSummary(summary) {
41968
+ return summary && !this.searchVal ? true : false;
41969
+ },
41970
+ dealCustomCalc(data, calc) {
41971
+ let exp = calc.mathExp;
41972
+ if (!exp) return null;
41973
+ var reg = /([\[|\{]).*?\((.*?)\)[\}|\]]/g;
41974
+ exp = exp.replace(reg, function () {
41975
+ var symbol = arguments[1],
41976
+ name = arguments[2];
41977
+ const prop = name.split('.')[1];
41978
+ const values = data.map(item => Number(item[prop]));
41979
+ return values.join(',');
41980
+ });
41981
+ exp = exp.replace(/[|\[|\]]/g, '');
41982
+ exp = eval(`(${exp})`);
41983
+ if (exp === Infinity || isNaN(exp)) {
41984
+ exp = null;
41985
+ }
41986
+ return exp;
41987
+ },
41988
+ dealWithDataHtml(name, type, showType, num, units, mainTarget) {
41989
+ let {
41990
+ data,
41991
+ monCap
41992
+ } = this.dealWithData(type, showType, num, mainTarget);
41993
+ if (monCap) {
41994
+ return name + ':' + data + units + '\n' + monCap;
41995
+ }
41996
+ return name + ':' + data + units;
41997
+ },
41998
+ //处理数据
41999
+ dealWithData(data, showType, numfix = 0, mainTarget) {
42000
+ data = Number(data);
42001
+ let list = showType;
42002
+ let num = {
42003
+ data: 0,
42004
+ monCap: ''
42005
+ };
42006
+ // 保留小数位
42007
+ if (list.includes('keepSmall')) {
42008
+ const fixData = data.toFixedRound(numfix);
42009
+ num.data = fixData;
42010
+ if (mainTarget) {
42011
+ mainTarget = !mainTarget.startsWith('data.') ? 'data.' + mainTarget : mainTarget;
42012
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByConfigKey(this, {
42013
+ trget: mainTarget
42014
+ }, 'trget', data);
42015
+ }
42016
+ } else {
42017
+ if (mainTarget && data != null) {
42018
+ mainTarget = !mainTarget.startsWith('data.') ? 'data.' + mainTarget : mainTarget;
42019
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByConfigKey(this, {
42020
+ trget: mainTarget
42021
+ }, 'trget', data.toFixedRound(4));
42022
+ }
42023
+ }
42024
+
42025
+ //百分比
42026
+ if (list.includes('percentage')) {
42027
+ num.data = Number(data * 100) + '%';
42028
+ }
42029
+ // 千分位
42030
+ if (list.includes('Micrometer')) {
42031
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(data);
42032
+ }
42033
+ if (list.includes('keepSmall') && list.includes('percentage') && list.includes('Micrometer')) {
42034
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(Number(data * 100).toFixedRound(numfix)) + '%';
42035
+ return num;
42036
+ }
42037
+ if (list.includes('keepSmall') && list.includes('percentage')) {
42038
+ num.data = Number(data * 100).toFixedRound(numfix) + '%';
42039
+ return num;
42040
+ }
42041
+ if (list.includes('Micrometer') && list.includes('percentage')) {
42042
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(Number(data * 100)) + '%';
42043
+ return num;
42044
+ }
42045
+ if (list.includes('keepSmall') && list.includes('Micrometer')) {
42046
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(data.toFixedRound(numfix));
42047
+ }
42048
+
42049
+ // 货币大写
42050
+ if (list.includes('monCap')) {
42051
+ num = {
42052
+ data: data,
42053
+ monCap: _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].convertCurrency(data)
42054
+ };
42055
+ return num;
42056
+ }
42057
+ return num;
42058
+ },
42059
+ getExpandArr(data, type) {
42060
+ if (type === 'expand' && data) {
42061
+ let arr = [];
42062
+ data.forEach(item => {
42063
+ arr.push(item.sub_guid);
42064
+ });
42065
+ return arr;
42066
+ }
42067
+ return data && data.length ? [data[0].sub_guid] : [];
42068
+ },
42069
+ printDetail() {
42070
+ window.print();
42071
+ if (this.isPrint) {
42072
+ this.$router.go(-1);
42073
+ }
42074
+ setTimeout(function () {
42075
+ location.reload();
42076
+ }, 200);
42077
+ },
42078
+ //子表上移
42079
+ up(index, data) {
42080
+ if (index === 0) {
42081
+ this.$message({
42082
+ message: '已经是列表中第一位',
42083
+ type: 'warning'
42084
+ });
42085
+ } else {
42086
+ let temp = data[index - 1];
42087
+ this.$set(data, index - 1, data[index]);
42088
+ this.$set(data, index, temp);
42089
+ }
42090
+ },
42091
+ //子表下移
42092
+ down(index, data) {
42093
+ if (index === data.length - 1) {
42094
+ this.$message({
42095
+ message: '已经是列表中最后一位',
42096
+ type: 'warning'
42097
+ });
42098
+ } else {
42099
+ this.isTransition = true;
42100
+ let i = data[index + 1];
42101
+ this.$set(data, index + 1, data[index]);
42102
+ this.$set(data, index, i);
42103
+ }
42104
+ },
42105
+ //子表复制数据
42106
+ copy(obj, item, subPath) {
42107
+ let newOne = JSON.parse(JSON.stringify(item));
42108
+ //把id置空以免走的修改方法
42109
+ if (newOne.id_) {
42110
+ delete newOne.id_;
42111
+ }
42112
+ if (newOne.id) {
42113
+ delete newOne.id;
42114
+ }
42115
+ if (newOne.sub_row_readonly) {
42116
+ delete newOne.sub_row_readonly;
42117
+ }
42118
+ //有孙表时,删除孙表id_
42119
+ for (let key in newOne) {
42120
+ if (key.startsWith('sub_') && Array.isArray(newOne[key])) {
42121
+ if (newOne[key].length) {
42122
+ newOne[key].forEach(it => {
42123
+ it.id_ && delete it.id_;
42124
+ });
42125
+ }
42126
+ }
42127
+ }
42128
+ if (subPath) {
42129
+ const watchMap = this.watchMap;
42130
+ // 判断当前是否有绑定流水号的字段
42131
+ if (watchMap) {
42132
+ const bindIdentityModelNameList = watchMap.get('bindIdentityModelNameList');
42133
+ if (bindIdentityModelNameList && bindIdentityModelNameList.length > 0) {
42134
+ bindIdentityModelNameList.forEach(bim => {
42135
+ if (bim.startsWith(subPath)) {
42136
+ // 如果有则删除复制数据中原来的流水号值
42137
+ delete newOne[bim.replace(`${subPath}.`, '')];
42138
+ }
42139
+ });
42140
+ }
42141
+ }
42142
+ }
42143
+ newOne.sub_guid = this.guid();
42144
+ this.$root.$emit('add-new-collapse-item', newOne.sub_guid);
42145
+ obj.push(newOne);
42146
+ this.$forceUpdate();
42147
+ },
42148
+ //子表默认值回填
42149
+ addSubTab(subTabPath) {
42150
+ let pathArr = subTabPath.split('.');
42151
+ if (pathArr.length < 3) {
42152
+ this.$message({
42153
+ message: '子表路径有误',
42154
+ type: 'warning'
42155
+ });
42156
+ } else {
42157
+ let subTabName = pathArr[2].replace('sub_', '');
42158
+ let subInitData = this.data[pathArr[1]].initData[subTabName] || {};
42159
+ //判断当前子表是否存有回显值
42160
+ if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
42161
+ subInitData = this.$parent.subBackfill.get(subTabPath);
42162
+ }
42163
+ //把数组里面的值为 null 转换为空字符串
42164
+ let str = JSON.stringify(subInitData).replace(/null/g, '""');
42165
+ let subData = JSON.parse(str);
42166
+ const subDataArr = this.data[pathArr[1]][pathArr[2]];
42167
+ //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
42168
+ const nextIndex = subDataArr.length;
42169
+ for (var key in subData) {
42170
+ //点添加时判断要新增子表记录中的孙表是否有值
42171
+ if (key.indexOf('sub_') == 0) {
42172
+ if (subData[key].length > 0) {
42173
+ subData[key] = []; //有则清空
42174
+ }
42175
+ const sunTabName = key.replace('sub_', '');
42176
+ if (this.permission.table[sunTabName] && (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName].required == 'true')) {
42177
+ this.$nextTick(() => {
42178
+ this.addSunTab(`${subTabPath}.${key}`, nextIndex);
42179
+ });
42180
+ }
42181
+ }
42182
+ }
42183
+ let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData);
42184
+ fillObj.sub_guid = this.guid();
42185
+ this.$root.$emit('add-new-collapse-item', fillObj.sub_guid);
42186
+ subDataArr.push(fillObj);
42187
+ }
42188
+ },
42189
+ //子表添加头部样式
42190
+ handleCellStyle({
42191
+ column
42192
+ }) {
42193
+ let ColBgColor;
42194
+ if (column.className) {
42195
+ ColBgColor = column.className.split('__')[1];
42196
+ }
42197
+ return ColBgColor ? {
42198
+ background: ColBgColor
42199
+ } : {};
42200
+ },
42201
+ //子表表头颜色
42202
+ handleRowStyle(color) {
42203
+ return {
42204
+ '--headerBgColor': color ? color : '#f4f4f4'
42205
+ };
42206
+ },
42207
+ guid() {
42208
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
42209
+ var r = Math.random() * 16 | 0,
42210
+ v = c == 'x' ? r : r & 0x3 | 0x8;
42211
+ return v.toString(16);
42212
+ });
42213
+ },
42214
+ //孙表默认值回填
42215
+ addSunTab(subTabPath, index) {
42216
+ let pathArr = subTabPath.split('.');
42217
+ if (pathArr.length < 4) {
42218
+ this.$message({
42219
+ message: '孙表路径有误',
42220
+ type: 'warning'
42221
+ });
42222
+ } else {
42223
+ const subTablePath = pathArr.filter((item, index) => index !== 3);
42224
+ const subIndex = this.getPageOffset(subTablePath.join('.')) + index;
42225
+ let subTabName = pathArr[2].replace('sub_', '');
42226
+ let sunTabName = pathArr[3].replace('sub_', '');
42227
+ let subTable = this.data[pathArr[1]][pathArr[2]][subIndex];
42228
+ if (!subTable.hasOwnProperty(pathArr[3])) {
42229
+ this.$set(subTable, pathArr[3], new Array());
42230
+ }
42231
+ let subInitData = this.data[pathArr[1]].initData[subTabName].initData[sunTabName] || {};
42232
+ //判断当前孙表是否存有回显值
42233
+ if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
42234
+ //this.data[pathArr[1]][pathArr[2]].push(this.$parent.subBackfill.get(subTabPath));
42235
+ subInitData = this.$parent.subBackfill.get(subTabPath);
42236
+ }
42237
+ //把数组里面的值为 null 转换为空字符串
42238
+ let str = JSON.stringify(subInitData).replace(/null/g, '""');
42239
+ if (!this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]]) {
42240
+ let key = [pathArr[3]];
42241
+ let value = new Array();
42242
+ this.data[pathArr[1]][pathArr[2]][subIndex][key] = value;
42243
+ }
42244
+ let sunBodata = JSON.parse(str);
42245
+ sunBodata.sub_guid = this.guid();
42246
+ this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]].push(sunBodata);
42247
+ this.$root.$emit('add-new-collapse-item', sunBodata.sub_guid);
42248
+ this.$forceUpdate(); //迫使 Vue 实例重新渲染
42249
+ }
42250
+ },
42251
+ addSubTableByName(subTableName) {
42252
+ for (let boAlias in this.data) {
42253
+ let subInitData = JSON.parse(JSON.stringify(this.data[boAlias].initData[subTableName] || {}));
42254
+ if (this.data[boAlias]['sub_' + subTableName] && this.data[boAlias]['sub_' + subTableName].length < 1) {
42255
+ this.data[boAlias]['sub_' + subTableName].push(JSON.parse(JSON.stringify(subInitData)));
42256
+ // 孙表必填 默认添加一条
42257
+ if (this.permission.table) {
42258
+ for (let tableName in this.permission.table) {
42259
+ if (this.permission.table[tableName].required) {
42260
+ if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] && this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].length < 1) {
42261
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(JSON.parse(JSON.stringify(subInitData.initData[tableName])));
42262
+ } else if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && !this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName]) {
42263
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] = [];
42264
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(subInitData.initData[tableName]);
42265
+ }
42266
+ }
42267
+ }
42268
+ }
42269
+ }
42270
+ }
42271
+ },
42272
+ deleteRow(subTablePath, item) {
42273
+ let pathArr = subTablePath.split('.');
42274
+ if (pathArr.length < 2) {
42275
+ this.$message({
42276
+ message: '子表路径有误',
42277
+ type: 'warning'
42278
+ });
42279
+ } else {
42280
+ let subTabName = pathArr[1].replace('sub_', '');
42281
+ if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42282
+ this.$message({
42283
+ message: '子表必填一条记录',
42284
+ type: 'warning'
42285
+ });
42286
+ return;
42287
+ }
42288
+ this.data[pathArr[0]][pathArr[1]].remove(item);
42289
+ }
42290
+ },
42291
+ deleteSunRow(subTablePath, item, subIndex) {
42292
+ let pathArr = subTablePath.split('.');
42293
+ if (pathArr.length < 3) {
42294
+ this.$message({
42295
+ message: '孙表路径有误',
42296
+ type: 'warning'
42297
+ });
42298
+ } else {
42299
+ let subTabName = pathArr[1].replace('sub_', '');
42300
+ let sunTabName = pathArr[2].replace('sub_', '');
42301
+ if (this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].length == 1 && (this.permission.table[sunTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42302
+ this.$message({
42303
+ message: '孙表必填一条记录',
42304
+ type: 'warning'
42305
+ });
42306
+ return;
42307
+ }
42308
+ this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].remove(item);
42309
+ this.data = Object.assign({}, this.data);
42310
+ }
42311
+ },
42312
+ clearAllMessageBox(data) {
42313
+ this.$confirm('确认执行该操作?', '提示', {
42314
+ confirmButtonText: '确定',
42315
+ cancelButtonText: '取消',
42316
+ type: 'warning'
42317
+ }).then(() => {
42318
+ this.clearAll(data);
42319
+ }).catch(() => {
42320
+ this.$message({
42321
+ type: 'info',
42322
+ message: '已取消操作'
42323
+ });
42324
+ });
42325
+ },
42326
+ clearAll(args) {
42327
+ const {
42328
+ subTablePath,
42329
+ isHot,
42330
+ index
42331
+ } = args;
42332
+ let pathArr;
42333
+ if (!subTablePath) {
42334
+ pathArr = args.split('.');
42335
+ } else {
42336
+ pathArr = subTablePath.split('.');
42337
+ }
42338
+ if (pathArr.length < 2) {
42339
+ this.$message({
42340
+ message: '子表路径有误',
42341
+ type: 'warning'
42342
+ });
42343
+ //孙表
42344
+ } else if ((index || index === 0) && pathArr.length == 3) {
42345
+ const sunTabName = pathArr[2].replace('sub_', '');
42346
+ if (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName] == 'true') {
42347
+ this.$message.warning('孙表必填,至少保留一条记录');
42348
+ return;
42349
+ }
42350
+ const _subPath = `data.${pathArr[0]}.${pathArr[1]}`;
42351
+ const subIndex = this.getPageOffset(_subPath) + index;
42352
+ const ary = this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]];
42353
+ if (ary instanceof Array) {
42354
+ ary.splice(0, ary.length);
42355
+ }
42356
+ } else {
42357
+ const subTabName = pathArr[1].replace('sub_', '');
42358
+ if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42359
+ this.$message({
42360
+ message: '子表必填,至少保留一条记录。',
42361
+ type: 'warning'
42362
+ });
42363
+ return;
42364
+ }
42365
+ const ary = this.data[pathArr[0]][pathArr[1]];
42366
+ if (ary instanceof Array) {
42367
+ ary.splice(0, ary.length);
42368
+ }
42369
+ if (isHot) {
42370
+ const hotTableRef = 'hottable.' + subTablePath;
42371
+ this.$refs[hotTableRef].fillbackHotTableData(null);
42372
+ }
42373
+ }
42374
+ },
42375
+ toFillOrg(path, row) {
42376
+ const fillOrgConf = this.fillOrgConfMap[path];
42377
+ let fillObj = {};
42378
+ if (fillOrgConf && this.fillOrg) {
42379
+ if (fillOrgConf.name) {
42380
+ const namePath = fillOrgConf.name.split('.');
42381
+ fillObj[namePath[namePath.length - 1]] = this.fillOrg.name;
42382
+ }
42383
+ if (fillOrgConf.id) {
42384
+ const idPath = fillOrgConf.id.split('.');
42385
+ fillObj[idPath[idPath.length - 1]] = this.fillOrg.id;
42386
+ }
42387
+ if (fillOrgConf.code) {
42388
+ const codePath = fillOrgConf.code.split('.');
42389
+ fillObj[codePath[codePath.length - 1]] = this.fillOrg.code;
42390
+ }
42391
+ if (fillOrgConf.instId) {
42392
+ const instIdPath = fillOrgConf.instId.split('.');
42393
+ fillObj[instIdPath[instIdPath.length - 1]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
42394
+ }
42395
+ return {
42396
+ ...row,
42397
+ ...fillObj
42398
+ };
42399
+ }
42400
+ return row;
42401
+ },
42402
+ initFill(path, conf) {
42403
+ //收集自动回填信息
42404
+ if (path && conf) {
42405
+ try {
42406
+ const confJson = this.fillOrgConfMap[path] ? this.fillOrgConfMap[path] : JSON.parse(conf);
42407
+ if (confJson.id || confJson.code || confJson.name || confJson.instId) {
42408
+ this.fillOrgConfMap[path] = confJson;
42409
+ this.initFirstFill(path, confJson);
42410
+ }
42411
+ } catch (error) {
42412
+ error;
42413
+ }
42414
+ }
42415
+ },
42416
+ initFirstFill(path, conf) {
42417
+ //处理第一行的回填
42418
+ const paths = path.split('.');
42419
+ if (this.data[paths[0]][paths[1]] && this.data[paths[0]][paths[1]].length == 1 && this.fillOrg.id) {
42420
+ if (conf.id) {
42421
+ const idPath = conf.id.split('.');
42422
+ if (!this.data[paths[0]][paths[1]][0][idPath[2]]) {
42423
+ this.data[paths[0]][paths[1]][0][idPath[2]] = this.fillOrg.id;
42424
+ if (conf.code) {
42425
+ const codePath = conf.code.split('.');
42426
+ if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
42427
+ this.data[paths[0]][paths[1]][0][codePath[2]] = this.fillOrg.code;
42428
+ }
42429
+ }
42430
+ if (conf.name) {
42431
+ const namePath = conf.name.split('.');
42432
+ if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
42433
+ this.data[paths[0]][paths[1]][0][namePath[2]] = this.fillOrg.name;
42434
+ }
42435
+ }
42436
+ }
42437
+ }
42438
+ if (conf.instId) {
42439
+ const instIdPath = conf.instId.split('.');
42440
+ if (!this.data[paths[0]][paths[1]][0][instIdPath[2]]) {
42441
+ this.data[paths[0]][paths[1]][0][instIdPath[2]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
42442
+ }
42443
+ }
42444
+ }
42445
+ },
42446
+ isShowAddButton(path, maxRow, subIndex) {
42447
+ if (maxRow === 0) return false;
42448
+ let pathArr = path.split('.');
42449
+ if (subIndex >= 0) {
42450
+ if (pathArr.length < 4) {
42451
+ this.$message({
42452
+ message: '子表路径有误',
42453
+ type: 'warning'
42454
+ });
42455
+ } else {
42456
+ let data = this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]] || [];
42457
+ return data.length >= maxRow;
42458
+ }
42459
+ } else {
42460
+ if (pathArr.length < 3) {
42461
+ this.$message({
42462
+ message: '子表路径有误',
42463
+ type: 'warning'
42464
+ });
42465
+ } else {
42466
+ let data = this.data[pathArr[1]][pathArr[2]] || [];
42467
+ return data.length >= maxRow;
42468
+ }
42469
+ }
42470
+ return false;
42471
+ }
42472
+ }
42473
+ });
42474
+
42475
+ /***/ }),
42476
+
42027
42477
  /***/ "c32d":
42028
42478
  /***/ (function(module, exports) {
42029
42479
 
@@ -42792,6 +43242,13 @@ _src_main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].install = function (Vue) {
42792
43242
 
42793
43243
  /***/ }),
42794
43244
 
43245
+ /***/ "cd50":
43246
+ /***/ (function(module, exports, __webpack_require__) {
43247
+
43248
+ // extracted by mini-css-extract-plugin
43249
+
43250
+ /***/ }),
43251
+
42795
43252
  /***/ "ce89":
42796
43253
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
42797
43254
 
@@ -44073,17 +44530,6 @@ var component = Object(componentNormalizer["a" /* default */])(
44073
44530
 
44074
44531
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
44075
44532
 
44076
- /***/ }),
44077
-
44078
- /***/ "cf7b":
44079
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
44080
-
44081
- "use strict";
44082
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_5e169672_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7f2d");
44083
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_5e169672_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SubExportDialog_vue_vue_type_style_index_0_id_5e169672_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
44084
- /* unused harmony reexport * */
44085
-
44086
-
44087
44533
  /***/ }),
44088
44534
 
44089
44535
  /***/ "cfad":
@@ -45611,6 +46057,16 @@ const {
45611
46057
  dataSubdesc: {
45612
46058
  type: String,
45613
46059
  default: '子表数据'
46060
+ },
46061
+ exportMaxRow: {
46062
+ type: [String, Number]
46063
+ },
46064
+ exportField: {
46065
+ // 禁止导出的字段集合
46066
+ type: String
46067
+ },
46068
+ exportFieldTransformData: {
46069
+ type: String
45614
46070
  }
45615
46071
  },
45616
46072
  computed: {
@@ -45624,6 +46080,36 @@ const {
45624
46080
  }
45625
46081
  },
45626
46082
  methods: {
46083
+ async sqlChange(config, value = '') {
46084
+ return new Promise(resolve => {
46085
+ let params = {
46086
+ dsName: config.dataSource,
46087
+ sql: config.relevancyValue ? config.relevancyValue.replace(/{val}/g, value) : ''
46088
+ };
46089
+ this.$requestConfig.getValueBySql(params).then(res => {
46090
+ resolve(res);
46091
+ });
46092
+ });
46093
+ },
46094
+ transformFieldData(data) {
46095
+ return new Promise(async resolve => {
46096
+ let fieldTransformData = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_1__[/* decode */ "a"])(this.exportFieldTransformData));
46097
+ for (let i = 0; i < data.length; i++) {
46098
+ for (let j = 0; j < fieldTransformData.length; j++) {
46099
+ if (fieldTransformData[j].relevancyType == 'value') {
46100
+ data[i][fieldTransformData[j].field] = fieldTransformData[j].relevancyValue;
46101
+ } else {
46102
+ // 动态时 请求接口修改数据
46103
+ let result = await this.sqlChange(fieldTransformData[j], data[i][fieldTransformData[j].field]);
46104
+ if (result) {
46105
+ data[i][fieldTransformData[j].field] = result;
46106
+ }
46107
+ }
46108
+ }
46109
+ }
46110
+ resolve(data);
46111
+ });
46112
+ },
45627
46113
  // 配置的数据字典 导出时翻译为汉字
45628
46114
  changeDictionary(data) {
45629
46115
  return new Promise(async (resolve, reject) => {
@@ -45647,10 +46133,14 @@ const {
45647
46133
  },
45648
46134
  changeRowKey(rows) {
45649
46135
  var exportData = [];
46136
+ let exportFieldArr = null;
46137
+ if (this.exportField) {
46138
+ exportFieldArr = this.exportField.split(',');
46139
+ }
45650
46140
  rows.forEach(row => {
45651
46141
  var exportRow = {};
45652
46142
  this.columns.forEach(col => {
45653
- if (col.ctrlType != 'suntable') {
46143
+ if (col.ctrlType != 'suntable' && (!exportFieldArr || exportFieldArr && !exportFieldArr.includes(col.name))) {
45654
46144
  exportRow[col.desc] = row[col.name];
45655
46145
  }
45656
46146
  });
@@ -45658,10 +46148,33 @@ const {
45658
46148
  });
45659
46149
  return exportData;
45660
46150
  },
46151
+ getConfirmValue(rows, count) {
46152
+ return new Promise(resolve => {
46153
+ this.$confirm(`导出数据量超出导出限制【${count}】,将导出${count}条,是否继续?`, '提示', {
46154
+ confirmButtonText: '确定',
46155
+ cancelButtonText: '取消',
46156
+ type: 'warning'
46157
+ }).then(() => {
46158
+ resolve(rows.slice(0, count));
46159
+ }).catch(() => {
46160
+ resolve(false);
46161
+ });
46162
+ });
46163
+ },
45661
46164
  handleCommand(type) {
45662
46165
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].getOnlineFormInstance(this);
45663
46166
  _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].exportData(this.dataSubname, type, pInst, this.subtablePagination).then(async data => {
45664
46167
  data = JSON.parse(JSON.stringify(data));
46168
+ if (this.exportMaxRow && Number(this.exportMaxRow) < data.length) {
46169
+ let result = await this.getConfirmValue(data, Number(this.exportMaxRow));
46170
+ if (result === false) {
46171
+ return;
46172
+ }
46173
+ data = result;
46174
+ }
46175
+ if (this.exportFieldTransformData) {
46176
+ data = await this.transformFieldData(data);
46177
+ }
45665
46178
  // 导出时 字典转换
45666
46179
  await this.changeDictionary(data);
45667
46180
  let exportData = this.changeRowKey(data);
@@ -46403,17 +46916,6 @@ _main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].register({
46403
46916
 
46404
46917
  // extracted by mini-css-extract-plugin
46405
46918
 
46406
- /***/ }),
46407
-
46408
- /***/ "e25e":
46409
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
46410
-
46411
- "use strict";
46412
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_f7cc3cda_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("3929");
46413
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_f7cc3cda_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_f7cc3cda_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
46414
- /* unused harmony reexport * */
46415
-
46416
-
46417
46919
  /***/ }),
46418
46920
 
46419
46921
  /***/ "e323":