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.
@@ -1258,7 +1258,7 @@ var utils = {
1258
1258
  }
1259
1259
  const keyPath = config[key];
1260
1260
  // 获取当前组件所在的表单
1261
- const formInst = utils.getOnlineFormInstance(inst.$parent);
1261
+ const formInst = utils.getOnlineFormInstance(inst);
1262
1262
  // 获取当前组件是否在子表中的某一行
1263
1263
  const {
1264
1264
  subScopeEl,
@@ -1535,6 +1535,37 @@ Date.prototype.format = function (format) {
1535
1535
  }
1536
1536
  return format;
1537
1537
  };
1538
+
1539
+ //精确四舍五入
1540
+ Number.prototype.toFixedRound = function (d) {
1541
+ d = Number(d);
1542
+ var s = this + '';
1543
+ if (!d) d = 0;
1544
+ if (s.indexOf('.') == -1) s += '.';
1545
+ s += new Array(d + 1).join('0');
1546
+ if (new RegExp('^(-|\\+)?(\\d+(\\.\\d{0,' + (d + 1) + '})?)\\d*$').test(s)) {
1547
+ var s = '0' + RegExp.$2,
1548
+ pm = RegExp.$1,
1549
+ a = RegExp.$3.length,
1550
+ b = true;
1551
+ if (a == d + 2) {
1552
+ a = s.match(/\d/g);
1553
+ if (parseInt(a[a.length - 1]) > 4) {
1554
+ for (var i = a.length - 2; i >= 0; i--) {
1555
+ a[i] = parseInt(a[i]) + 1;
1556
+ if (a[i] == 10) {
1557
+ a[i] = 0;
1558
+ b = i != 1;
1559
+ } else break;
1560
+ }
1561
+ }
1562
+ s = a.join('').replace(new RegExp('(\\d+)(\\d{' + d + '})\\d$'), '$1.$2');
1563
+ }
1564
+ if (b) s = s.substr(1);
1565
+ return (pm + s).replace(/\.$/, '');
1566
+ }
1567
+ return this + '';
1568
+ };
1538
1569
  /* harmony default export */ __webpack_exports__["a"] = (utils);
1539
1570
 
1540
1571
  /***/ }),
@@ -4979,6 +5010,17 @@ var component = Object(componentNormalizer["a" /* default */])(
4979
5010
 
4980
5011
  module.exports = require("echarts/lib/chart/bar");
4981
5012
 
5013
+ /***/ }),
5014
+
5015
+ /***/ "11b4":
5016
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5017
+
5018
+ "use strict";
5019
+ /* 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");
5020
+ /* 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__);
5021
+ /* unused harmony reexport * */
5022
+
5023
+
4982
5024
  /***/ }),
4983
5025
 
4984
5026
  /***/ "1242":
@@ -5330,7 +5372,7 @@ const SubPagination = {
5330
5372
  return `${path}:VueComponent`;
5331
5373
  },
5332
5374
  // 导入数据
5333
- importData: (path, importRows, mode, mergeMethod) => {
5375
+ importData: (path, importRows, mode, mergeMethod, conditionConfig) => {
5334
5376
  return new Promise((resolve, reject) => {
5335
5377
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getOnlineFormInstance(undefined);
5336
5378
  let formUid = pInst && pInst._uid ? pInst._uid : '';
@@ -5363,6 +5405,44 @@ const SubPagination = {
5363
5405
  _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByPath(inst, path, newRows);
5364
5406
  break;
5365
5407
  }
5408
+ case 'condition':
5409
+ {
5410
+ importRows.forEach(item => {
5411
+ let index = array.findIndex(sub => {
5412
+ let orArr = conditionConfig.conditionArr.filter(condition => {
5413
+ return condition.relation == 'or';
5414
+ });
5415
+ let andArr = conditionConfig.conditionArr.filter(condition => {
5416
+ return condition.relation == 'and';
5417
+ });
5418
+ let orFlag = true;
5419
+ let andFlag = true;
5420
+ if (orArr.length) {
5421
+ orFlag = orArr.some(j => {
5422
+ return sub[j.subField] == item[j.exportField];
5423
+ });
5424
+ }
5425
+ if (andArr.length) {
5426
+ andFlag = andArr.every(j => {
5427
+ return sub[j.subField] == item[j.exportField];
5428
+ });
5429
+ }
5430
+ return orFlag && andFlag;
5431
+ });
5432
+ if (index != -1) {
5433
+ let updateArr = conditionConfig.backField.split(',');
5434
+ updateArr.forEach(field => {
5435
+ array[index][field] = item[field];
5436
+ });
5437
+ } else {
5438
+ // 未匹配到时是否新增
5439
+ if (conditionConfig.conditionType == 'add') {
5440
+ array.push(item);
5441
+ }
5442
+ }
5443
+ });
5444
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByPath(inst, path, array);
5445
+ }
5366
5446
  }
5367
5447
  obj.rows = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getValueByPath(inst, path);
5368
5448
  SubPagination._digest(obj.rows);
@@ -5458,7 +5538,7 @@ const SubPagination = {
5458
5538
  // ESM COMPAT FLAG
5459
5539
  __webpack_require__.r(__webpack_exports__);
5460
5540
 
5461
- // 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
5541
+ // 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
5462
5542
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"ht-file",class:[
5463
5543
  'inputs',
5464
5544
  _vm.formInputsDisplay == 'block'
@@ -5467,7 +5547,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
5467
5547
  var staticRenderFns = []
5468
5548
 
5469
5549
 
5470
- // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=template&id=f7cc3cda&scoped=true
5550
+ // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=template&id=11355c9a&scoped=true
5471
5551
 
5472
5552
  // EXTERNAL MODULE: ./src/utils.js
5473
5553
  var utils = __webpack_require__("025e");
@@ -5822,7 +5902,7 @@ const {
5822
5902
  methods: {
5823
5903
  // 上传前做校验
5824
5904
  beforeUploadMethod(file) {
5825
- if (file.name && this.accept && !this.accept.split(',').includes(file.name.split('.')[1])) {
5905
+ if (file.name && this.accept && !this.accept.split(',').includes(file.name.split('.')[file.name.split('.').length - 1])) {
5826
5906
  this.$message('请选择规定范围的文件进行上传!');
5827
5907
  return false;
5828
5908
  }
@@ -5991,8 +6071,8 @@ const {
5991
6071
  });
5992
6072
  // CONCATENATED MODULE: ./packages/File/src/main.vue?vue&type=script&lang=js
5993
6073
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
5994
- // EXTERNAL MODULE: ./packages/File/src/main.vue?vue&type=style&index=0&id=f7cc3cda&prod&lang=scss&scoped=true
5995
- var mainvue_type_style_index_0_id_f7cc3cda_prod_lang_scss_scoped_true = __webpack_require__("e25e");
6074
+ // EXTERNAL MODULE: ./packages/File/src/main.vue?vue&type=style&index=0&id=11355c9a&prod&lang=scss&scoped=true
6075
+ var mainvue_type_style_index_0_id_11355c9a_prod_lang_scss_scoped_true = __webpack_require__("ba15");
5996
6076
 
5997
6077
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
5998
6078
  var componentNormalizer = __webpack_require__("2877");
@@ -6012,7 +6092,7 @@ var component = Object(componentNormalizer["a" /* default */])(
6012
6092
  staticRenderFns,
6013
6093
  false,
6014
6094
  null,
6015
- "f7cc3cda",
6095
+ "11355c9a",
6016
6096
  null
6017
6097
 
6018
6098
  )
@@ -6660,6 +6740,13 @@ module.exports = require("echarts/lib/chart/graph");
6660
6740
 
6661
6741
  /***/ }),
6662
6742
 
6743
+ /***/ "19bc":
6744
+ /***/ (function(module, exports, __webpack_require__) {
6745
+
6746
+ // extracted by mini-css-extract-plugin
6747
+
6748
+ /***/ }),
6749
+
6663
6750
  /***/ "19f1":
6664
6751
  /***/ (function(module, exports) {
6665
6752
 
@@ -7465,20 +7552,20 @@ module.exports = require("echarts/lib/chart/radar");
7465
7552
  // ESM COMPAT FLAG
7466
7553
  __webpack_require__.r(__webpack_exports__);
7467
7554
 
7468
- // 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
7555
+ // 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
7469
7556
  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)}
7470
7557
  var staticRenderFns = []
7471
7558
 
7472
7559
 
7473
- // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=5e169672&scoped=true
7560
+ // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=template&id=0aa58584&scoped=true
7474
7561
 
7475
7562
  // 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
7476
7563
  var SubExportDialogvue_type_script_lang_js = __webpack_require__("d82d");
7477
7564
 
7478
7565
  // CONCATENATED MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=script&lang=js
7479
7566
  /* harmony default export */ var src_SubExportDialogvue_type_script_lang_js = (SubExportDialogvue_type_script_lang_js["a" /* default */]);
7480
- // EXTERNAL MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=style&index=0&id=5e169672&prod&lang=scss&scoped=true
7481
- var SubExportDialogvue_type_style_index_0_id_5e169672_prod_lang_scss_scoped_true = __webpack_require__("cf7b");
7567
+ // EXTERNAL MODULE: ./packages/Subtable/src/SubExportDialog.vue?vue&type=style&index=0&id=0aa58584&prod&lang=scss&scoped=true
7568
+ var SubExportDialogvue_type_style_index_0_id_0aa58584_prod_lang_scss_scoped_true = __webpack_require__("11b4");
7482
7569
 
7483
7570
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
7484
7571
  var componentNormalizer = __webpack_require__("2877");
@@ -7498,7 +7585,7 @@ var component = Object(componentNormalizer["a" /* default */])(
7498
7585
  staticRenderFns,
7499
7586
  false,
7500
7587
  null,
7501
- "5e169672",
7588
+ "0aa58584",
7502
7589
  null
7503
7590
 
7504
7591
  )
@@ -9315,6 +9402,45 @@ const {
9315
9402
  dataColumns: {
9316
9403
  type: String,
9317
9404
  required: true
9405
+ },
9406
+ importMaxRow: {
9407
+ type: [String, Number],
9408
+ default: null
9409
+ },
9410
+ templateType: {
9411
+ // 导入模板类型 default 系统默认 custom 自定义
9412
+ type: String,
9413
+ default: 'default'
9414
+ },
9415
+ customTemplate: {
9416
+ // 自定义的导入模板文件
9417
+ type: String,
9418
+ default: ''
9419
+ },
9420
+ importTransform: {
9421
+ // 是否有转换字段
9422
+ type: String,
9423
+ default: '0'
9424
+ },
9425
+ importModes: {
9426
+ // 导入模式选项显示
9427
+ type: String,
9428
+ default: 'append,override,merge'
9429
+ },
9430
+ fieldTransformData: {
9431
+ // 转换字段配置
9432
+ type: String,
9433
+ default: ''
9434
+ },
9435
+ conditionRule: {
9436
+ // 条件模式配置
9437
+ type: String,
9438
+ default: ''
9439
+ },
9440
+ conditionType: {
9441
+ // 条件模式配置
9442
+ type: String,
9443
+ default: 'cover'
9318
9444
  }
9319
9445
  },
9320
9446
  data() {
@@ -9324,7 +9450,15 @@ const {
9324
9450
  showRowData: false,
9325
9451
  mergeFunc: null,
9326
9452
  mode: 'append',
9327
- modeOptions: [{
9453
+ cacheDicData: {} // 缓存字典数据
9454
+ };
9455
+ },
9456
+ computed: {
9457
+ columns: function () {
9458
+ return eval(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.dataColumns));
9459
+ },
9460
+ modeOptions() {
9461
+ let options = [{
9328
9462
  mode: 'append',
9329
9463
  desc: '追加导入'
9330
9464
  }, {
@@ -9332,15 +9466,27 @@ const {
9332
9466
  desc: '覆盖导入'
9333
9467
  }, {
9334
9468
  mode: 'merge',
9335
- desc: '合并导入',
9336
- disabled: true
9337
- }],
9338
- cacheDicData: {} // 缓存字典数据
9339
- };
9340
- },
9341
- computed: {
9342
- columns: function () {
9343
- return eval(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.dataColumns));
9469
+ desc: '合并导入'
9470
+ }, {
9471
+ mode: 'condition',
9472
+ desc: '条件导入'
9473
+ }];
9474
+ return options.filter(k => {
9475
+ return this.importModes.includes(k.mode);
9476
+ });
9477
+ },
9478
+ conditionConfig() {
9479
+ let config = {};
9480
+ if (this.conditionRule) {
9481
+ config = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.conditionRule));
9482
+ config.conditionArr.forEach(k => {
9483
+ k.exportField = this.getNameByDesc(k.exportField);
9484
+ });
9485
+ }
9486
+ return {
9487
+ conditionType: this.conditionType,
9488
+ ...config
9489
+ };
9344
9490
  }
9345
9491
  },
9346
9492
  watch: {
@@ -9359,7 +9505,7 @@ const {
9359
9505
  handler: function (newVal) {
9360
9506
  if (newVal) {
9361
9507
  // 如果有导入合并的代码,则允许选择合并导入模式
9362
- this.$set(this.modeOptions[2], 'disabled', false);
9508
+ // this.$set(this.modeOptions[2], 'disabled', false)
9363
9509
  // 并设置默认为 合并导入
9364
9510
  this.mode = 'merge';
9365
9511
  // 解码合并的代码
@@ -9376,6 +9522,9 @@ const {
9376
9522
  }
9377
9523
  },
9378
9524
  mounted() {
9525
+ if (this.importModes) {
9526
+ this.mode = this.importModes.split(',')[0];
9527
+ }
9379
9528
  // 初始化导入时需要的参数
9380
9529
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].getOnlineFormInstance(this);
9381
9530
  let formUid = pInst && pInst._uid ? pInst._uid : '';
@@ -9394,6 +9543,40 @@ const {
9394
9543
  _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].clear(this.dataSubname, this);
9395
9544
  },
9396
9545
  methods: {
9546
+ transformFieldData(data) {
9547
+ return new Promise(async resolve => {
9548
+ if (this.importTransform === '0') {
9549
+ resolve(data);
9550
+ return;
9551
+ }
9552
+ let fieldTransformData = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.fieldTransformData));
9553
+ for (let i = 0; i < data.length; i++) {
9554
+ for (let j = 0; j < fieldTransformData.length; j++) {
9555
+ if (fieldTransformData[j].relevancyType == 'value') {
9556
+ data[i][fieldTransformData[j].field] = fieldTransformData[j].relevancyValue;
9557
+ } else {
9558
+ // 动态时 请求接口修改数据
9559
+ let result = await this.sqlChange(fieldTransformData[j], data[i][fieldTransformData[j].field]);
9560
+ if (result) {
9561
+ data[i][fieldTransformData[j].field] = result;
9562
+ }
9563
+ }
9564
+ }
9565
+ }
9566
+ resolve(data);
9567
+ });
9568
+ },
9569
+ async sqlChange(config, value = '') {
9570
+ return new Promise(resolve => {
9571
+ let params = {
9572
+ dsName: config.dataSource,
9573
+ sql: config.relevancyValue ? config.relevancyValue.replace(/{val}/g, value) : ''
9574
+ };
9575
+ this.$requestConfig.getValueBySql(params).then(res => {
9576
+ resolve(res);
9577
+ });
9578
+ });
9579
+ },
9397
9580
  changeDictionary(data) {
9398
9581
  return new Promise(async resolve => {
9399
9582
  for (let i = 0; i < data.length; i++) {
@@ -9425,6 +9608,24 @@ const {
9425
9608
  },
9426
9609
  //子表模板导出
9427
9610
  exportFormSub() {
9611
+ // 如果是自定义模板
9612
+ if (this.templateType == 'custom' && this.customTemplate) {
9613
+ let file = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_2__[/* decode */ "a"])(this.customTemplate))[0];
9614
+ this.$requestConfig.download(file.response.fileId).then(({
9615
+ data,
9616
+ headers
9617
+ }) => {
9618
+ if (data && headers) {
9619
+ // 附件下载
9620
+ const fileName = decodeURIComponent(headers['content-disposition'].split(';')[1].split('filename=')[1]);
9621
+ const blob = new Blob([data]);
9622
+ saveAs(blob, fileName);
9623
+ }
9624
+ }).catch(err => {
9625
+ this.$message.error(`附件下载失败:${err}`);
9626
+ });
9627
+ return;
9628
+ }
9428
9629
  let columns = this.columns.filter(item => {
9429
9630
  return !(item.ctrlType && (item.ctrlType === 'sunDiv' || item.ctrlType === 'suntable'));
9430
9631
  });
@@ -9470,6 +9671,7 @@ const {
9470
9671
  let count = this.importRows.length;
9471
9672
  if (count > maxRowInt && maxRowInt != 0) {
9472
9673
  this.$message.error('子表数据已超过最大行数【' + maxRowInt + '】');
9674
+ this.$refs.selectFile.value = '';
9473
9675
  return;
9474
9676
  }
9475
9677
  } else if (this.mode == 'append') {
@@ -9494,10 +9696,13 @@ const {
9494
9696
  }
9495
9697
  }
9496
9698
  let importRows = await this.changeDictionary(this.importRows);
9497
- _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].importData(this.dataSubname, importRows, this.mode, this.mergeFunc).then(() => {
9699
+ // 导入如果有数据转换的此处做转换
9700
+ importRows = await this.transformFieldData(importRows);
9701
+ _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].importData(this.dataSubname, importRows, this.mode, this.mergeFunc, this.conditionConfig).then(() => {
9498
9702
  this.$message.success('导入成功!');
9499
9703
  this.dialogVisible = false;
9500
9704
  }).catch(err => {
9705
+ this.$refs.selectFile.value = '';
9501
9706
  this.$message.error(`数据导入失败:${err}`);
9502
9707
  });
9503
9708
  },
@@ -9506,10 +9711,34 @@ const {
9506
9711
  return;
9507
9712
  }
9508
9713
  this.importRows = [];
9509
- this.readWorkbookFromLocalFile(m.target.files[0], rows => {
9714
+ this.readWorkbookFromLocalFile(m.target.files[0], async rows => {
9715
+ if (this.importMaxRow) {
9716
+ let count = rows.length;
9717
+ if (count > parseInt(this.importMaxRow)) {
9718
+ let result = await this.getConfirmValue(rows, parseInt(this.importMaxRow));
9719
+ if (result === false) {
9720
+ this.$refs.selectFile.value = '';
9721
+ return;
9722
+ }
9723
+ rows = result;
9724
+ }
9725
+ }
9510
9726
  this.importRows = this.changeRowKey(rows);
9511
9727
  });
9512
9728
  },
9729
+ getConfirmValue(rows, count) {
9730
+ return new Promise(resolve => {
9731
+ this.$confirm(`导入数据量已超过最大限制,将默认导入前【${count}】条,是否继续?`, '提示', {
9732
+ confirmButtonText: '确定',
9733
+ cancelButtonText: '取消',
9734
+ type: 'warning'
9735
+ }).then(() => {
9736
+ resolve(rows.slice(0, count));
9737
+ }).catch(() => {
9738
+ resolve(false);
9739
+ });
9740
+ });
9741
+ },
9513
9742
  // 读取本地excel文件
9514
9743
  readWorkbookFromLocalFile(file, callback) {
9515
9744
  const reader = new FileReader();
@@ -10563,13 +10792,6 @@ module.exports = require("echarts/lib/chart/pie");
10563
10792
 
10564
10793
  /***/ }),
10565
10794
 
10566
- /***/ "2a0b":
10567
- /***/ (function(module, exports, __webpack_require__) {
10568
-
10569
- // extracted by mini-css-extract-plugin
10570
-
10571
- /***/ }),
10572
-
10573
10795
  /***/ "2b16":
10574
10796
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10575
10797
 
@@ -12446,6 +12668,7 @@ const Formulas = {
12446
12668
  Formulas.install = Vue => {
12447
12669
  Vue.prototype.$Formulas = Formulas;
12448
12670
  };
12671
+ window.FormMath = Formulas;
12449
12672
 
12450
12673
 
12451
12674
  /***/ }),
@@ -12537,668 +12760,199 @@ var staticRenderFns = []
12537
12760
  // EXTERNAL MODULE: ./src/utils.js
12538
12761
  var utils = __webpack_require__("025e");
12539
12762
 
12540
- // EXTERNAL MODULE: ./src/services/SubPagination.js
12541
- var SubPagination = __webpack_require__("1639");
12763
+ // EXTERNAL MODULE: ./src/mixins/onlineSubtable.js
12764
+ var onlineSubtable = __webpack_require__("c31b");
12765
+
12766
+ // EXTERNAL MODULE: ./src/mixins/regionValidator.js
12767
+ var regionValidator = __webpack_require__("eaa5");
12542
12768
 
12543
- // CONCATENATED MODULE: ./src/mixins/onlineSubtable.js
12769
+ // EXTERNAL MODULE: ./src/mixins/emitter.js
12770
+ var emitter = __webpack_require__("a215");
12544
12771
 
12545
- /* harmony default export */ var onlineSubtable = ({
12546
- data() {
12547
- return {
12548
- fillOrg: {},
12549
- fillOrgConfMap: {},
12550
- transitionIndex: -1,
12551
- left_image: '',
12552
- right_image: ''
12553
- };
12554
- },
12555
- computed: {
12556
- // 子表前端分页过滤器
12557
- pagingSubData() {
12558
- const me = this;
12559
- return function (datapath) {
12560
- // 通过子表数据路径获取分页数据
12561
- return SubPagination["a" /* default */].pagingByPath(datapath, me);
12562
- };
12772
+ // EXTERNAL MODULE: external "vue"
12773
+ var external_vue_ = __webpack_require__("8bbf");
12774
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
12775
+
12776
+ // 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
12777
+ //
12778
+ //
12779
+ //
12780
+ //
12781
+ //
12782
+ //
12783
+ //
12784
+ //
12785
+ //
12786
+ //
12787
+ //
12788
+ //
12789
+ //
12790
+ //
12791
+ //
12792
+ //
12793
+ //
12794
+ //
12795
+ //
12796
+ //
12797
+ //
12798
+ //
12799
+ //
12800
+ //
12801
+ //
12802
+ //
12803
+
12804
+
12805
+ // import onlineHottable from '@/mixins/onlineHottable.js'
12806
+
12807
+
12808
+
12809
+
12810
+ /* harmony default export */ var Formvue_type_script_lang_js = ({
12811
+ name: 'HtOnlineForm',
12812
+ componentName: 'HtOnlineForm',
12813
+ mixins: [regionValidator["a" /* default */], emitter["a" /* default */]],
12814
+ props: {
12815
+ html: String,
12816
+ data: Object,
12817
+ permission: Object,
12818
+ initFillData: {
12819
+ type: Boolean,
12820
+ default: false
12563
12821
  },
12564
- // 获取子表分页 offset
12565
- getPageOffset() {
12566
- return datapath => {
12567
- return SubPagination["a" /* default */].getPageOffset(datapath, this);
12568
- };
12822
+ isView: {
12823
+ type: Boolean,
12824
+ default: false
12569
12825
  },
12570
- // 是否为待办单
12571
- isTodoForm() {
12572
- const types = ['MyDelegate', 'done', 'LeaderDone', 'request'];
12573
- const type = this.$route.query.type || '';
12574
- return types.includes(type) || this.$route.query.readId;
12826
+ isPrint: {
12827
+ type: Boolean,
12828
+ default: false
12829
+ },
12830
+ isLook: {
12831
+ type: Boolean,
12832
+ default: false
12833
+ },
12834
+ mobileMode: {
12835
+ type: Boolean,
12836
+ default: false
12837
+ },
12838
+ flowKey: String,
12839
+ formId: String,
12840
+ formKey: String,
12841
+ extendProp: {
12842
+ type: Object,
12843
+ default: () => {
12844
+ return {};
12845
+ }
12846
+ },
12847
+ isSupportMobile: {
12848
+ type: Boolean,
12849
+ default: false
12850
+ },
12851
+ instId: [String, Number],
12852
+ isPreview: {
12853
+ type: Boolean,
12854
+ default: false
12575
12855
  }
12576
12856
  },
12577
- mounted() {
12578
- // 如果当前表单的element为Comment说明表单加载失败了。
12579
- if (this.$el && this.$el.constructor == Comment) {
12580
- this.$emit('load-fail');
12581
- return;
12582
- }
12583
- this.$validator = this.$root.$validator;
12584
- if (this.permission.table) {
12585
- for (let subTableName in this.permission.table) {
12586
- if (this.permission.table[subTableName].required) {
12587
- this.addSubTableByName(subTableName);
12857
+ data() {
12858
+ return {
12859
+ formName: `onlineForm_${utils["a" /* default */].getName()}`,
12860
+ loadStatus: 0,
12861
+ subBackfill: new Map(),
12862
+ hotTableFillback: String,
12863
+ scopeName: `form-${utils["a" /* default */].getName()}`,
12864
+ getDataPromiseResolve: null,
12865
+ getDataPromiseReject: null
12866
+ };
12867
+ },
12868
+ watch: {
12869
+ html: {
12870
+ handler: function (newVal) {
12871
+ if (newVal) {
12872
+ this.init();
12588
12873
  }
12589
- }
12590
- }
12591
- this.$emit('load-success', true);
12592
- if (this.isPrint) {
12593
- this.printDetail();
12874
+ },
12875
+ immediate: true
12594
12876
  }
12595
12877
  },
12596
- methods: {
12597
- getExpandArr(data, type) {
12598
- if (type === 'expand' && data) {
12599
- let arr = [];
12600
- data.forEach(item => {
12601
- arr.push(item.sub_guid);
12602
- });
12603
- return arr;
12604
- }
12605
- return data && data.length ? [data[0].sub_guid] : [];
12606
- },
12607
- printDetail() {
12608
- window.print();
12609
- if (this.isPrint) {
12610
- this.$router.go(-1);
12611
- }
12612
- setTimeout(function () {
12613
- location.reload();
12614
- }, 200);
12615
- },
12616
- //子表上移
12617
- up(index, data) {
12618
- if (index === 0) {
12619
- this.$message({
12620
- message: '已经是列表中第一位',
12621
- type: 'warning'
12622
- });
12878
+ created() {
12879
+ this.$on('global-validate-result', result => {
12880
+ if (result) {
12881
+ this.getDataPromiseResolve(this.data);
12623
12882
  } else {
12624
- let temp = data[index - 1];
12625
- this.$set(data, index - 1, data[index]);
12626
- this.$set(data, index, temp);
12883
+ this.getDataPromiseReject();
12627
12884
  }
12885
+ });
12886
+ },
12887
+ methods: {
12888
+ handleLoadSuccess(res) {
12889
+ this.loadStatus = 1;
12890
+ this.$emit('load-success', res);
12628
12891
  },
12629
- //子表下移
12630
- down(index, data) {
12631
- if (index === data.length - 1) {
12632
- this.$message({
12633
- message: '已经是列表中最后一位',
12634
- type: 'warning'
12635
- });
12636
- } else {
12637
- this.isTransition = true;
12638
- let i = data[index + 1];
12639
- this.$set(data, index + 1, data[index]);
12640
- this.$set(data, index, i);
12641
- }
12892
+ handleLoadFail() {
12893
+ this.loadStatus = -1;
12642
12894
  },
12643
- //子表复制数据
12644
- copy(obj, item, subPath) {
12645
- let newOne = JSON.parse(JSON.stringify(item));
12646
- //把id置空以免走的修改方法
12647
- if (newOne.id_) {
12648
- delete newOne.id_;
12649
- }
12650
- if (newOne.id) {
12651
- delete newOne.id;
12652
- }
12653
- if (newOne.sub_row_readonly) {
12654
- delete newOne.sub_row_readonly;
12655
- }
12656
- //有孙表时,删除孙表id_
12657
- for (let key in newOne) {
12658
- if (key.startsWith('sub_') && Array.isArray(newOne[key])) {
12659
- if (newOne[key].length) {
12660
- newOne[key].forEach(it => {
12661
- it.id_ && delete it.id_;
12662
- });
12663
- }
12664
- }
12665
- }
12666
- if (subPath) {
12667
- const watchMap = this.watchMap;
12668
- // 判断当前是否有绑定流水号的字段
12669
- if (watchMap) {
12670
- const bindIdentityModelNameList = watchMap.get('bindIdentityModelNameList');
12671
- if (bindIdentityModelNameList && bindIdentityModelNameList.length > 0) {
12672
- bindIdentityModelNameList.forEach(bim => {
12673
- if (bim.startsWith(subPath)) {
12674
- // 如果有则删除复制数据中原来的流水号值
12675
- delete newOne[bim.replace(`${subPath}.`, '')];
12676
- }
12677
- });
12678
- }
12895
+ getData(validate) {
12896
+ return new Promise((resolve, reject) => {
12897
+ this.getDataPromiseResolve = resolve;
12898
+ this.getDataPromiseReject = reject;
12899
+ if (!validate) {
12900
+ resolve(this.data);
12901
+ } else {
12902
+ // 执行校验逻辑
12903
+ this.validateRegion(`[name='${this.formName}']`).then(errorItems => {
12904
+ if (errorItems.length > 0) {
12905
+ reject(errorItems);
12906
+ } else {
12907
+ this.broadcast('HtGlobalValidate', 'global-validate');
12908
+ }
12909
+ });
12679
12910
  }
12680
- }
12681
- newOne.sub_guid = this.guid();
12682
- this.$root.$emit('add-new-collapse-item', newOne.sub_guid);
12683
- obj.push(newOne);
12684
- this.$forceUpdate();
12911
+ });
12685
12912
  },
12686
- //子表默认值回填
12687
- addSubTab(subTabPath) {
12688
- let pathArr = subTabPath.split('.');
12689
- if (pathArr.length < 3) {
12690
- this.$message({
12691
- message: '子表路径有误',
12692
- type: 'warning'
12693
- });
12694
- } else {
12695
- let subTabName = pathArr[2].replace('sub_', '');
12696
- let subInitData = this.data[pathArr[1]].initData[subTabName] || {};
12697
- //判断当前子表是否存有回显值
12698
- if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
12699
- subInitData = this.$parent.subBackfill.get(subTabPath);
12700
- }
12701
- //把数组里面的值为 null 转换为空字符串
12702
- let str = JSON.stringify(subInitData).replace(/null/g, '""');
12703
- let subData = JSON.parse(str);
12704
- const subDataArr = this.data[pathArr[1]][pathArr[2]];
12705
- //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
12706
- const nextIndex = subDataArr.length;
12707
- for (var key in subData) {
12708
- //点添加时判断要新增子表记录中的孙表是否有值
12709
- if (key.indexOf('sub_') == 0) {
12710
- if (subData[key].length > 0) {
12711
- subData[key] = []; //有则清空
12712
- }
12713
- const sunTabName = key.replace('sub_', '');
12714
- if (this.permission.table[sunTabName] && (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName].required == 'true')) {
12715
- this.$nextTick(() => {
12716
- this.addSunTab(`${subTabPath}.${key}`, nextIndex);
12717
- });
12913
+ init() {
12914
+ this.loadStatus = 1;
12915
+ external_vue_default.a.component('ht-runtime-template', {
12916
+ componentName: 'HtRuntimeTemplate',
12917
+ mixins: [onlineSubtable["a" /* default */]],
12918
+ props: {
12919
+ html: String,
12920
+ data: Object,
12921
+ permission: Object,
12922
+ initFillData: {
12923
+ type: Boolean,
12924
+ default: false
12925
+ },
12926
+ isView: {
12927
+ type: Boolean,
12928
+ default: false
12929
+ },
12930
+ isPrint: {
12931
+ type: Boolean,
12932
+ default: false
12933
+ },
12934
+ formKey: String,
12935
+ mobileMode: {
12936
+ type: Boolean,
12937
+ default: false
12938
+ },
12939
+ extendProp: {
12940
+ type: Object,
12941
+ default: () => {
12942
+ return {};
12718
12943
  }
12944
+ },
12945
+ isSupportMobile: {
12946
+ type: Boolean,
12947
+ default: false
12948
+ },
12949
+ instId: [String, Number],
12950
+ isPreview: {
12951
+ type: Boolean,
12952
+ default: false
12719
12953
  }
12720
- }
12721
- let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData);
12722
- fillObj.sub_guid = this.guid();
12723
- this.$root.$emit('add-new-collapse-item', fillObj.sub_guid);
12724
- subDataArr.push(fillObj);
12725
- }
12726
- },
12727
- //子表添加头部样式
12728
- handleCellStyle({
12729
- column
12730
- }) {
12731
- let ColBgColor;
12732
- if (column.className) {
12733
- ColBgColor = column.className.split('__')[1];
12734
- }
12735
- return ColBgColor ? {
12736
- background: ColBgColor
12737
- } : {};
12738
- },
12739
- //子表表头颜色
12740
- handleRowStyle(color) {
12741
- return {
12742
- '--headerBgColor': color ? color : '#f4f4f4'
12743
- };
12744
- },
12745
- guid() {
12746
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
12747
- var r = Math.random() * 16 | 0,
12748
- v = c == 'x' ? r : r & 0x3 | 0x8;
12749
- return v.toString(16);
12750
- });
12751
- },
12752
- //孙表默认值回填
12753
- addSunTab(subTabPath, index) {
12754
- let pathArr = subTabPath.split('.');
12755
- if (pathArr.length < 4) {
12756
- this.$message({
12757
- message: '孙表路径有误',
12758
- type: 'warning'
12759
- });
12760
- } else {
12761
- const subTablePath = pathArr.filter((item, index) => index !== 3);
12762
- const subIndex = this.getPageOffset(subTablePath.join('.')) + index;
12763
- let subTabName = pathArr[2].replace('sub_', '');
12764
- let sunTabName = pathArr[3].replace('sub_', '');
12765
- let subTable = this.data[pathArr[1]][pathArr[2]][subIndex];
12766
- if (!subTable.hasOwnProperty(pathArr[3])) {
12767
- this.$set(subTable, pathArr[3], new Array());
12768
- }
12769
- let subInitData = this.data[pathArr[1]].initData[subTabName].initData[sunTabName] || {};
12770
- //判断当前孙表是否存有回显值
12771
- if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
12772
- //this.data[pathArr[1]][pathArr[2]].push(this.$parent.subBackfill.get(subTabPath));
12773
- subInitData = this.$parent.subBackfill.get(subTabPath);
12774
- }
12775
- //把数组里面的值为 null 转换为空字符串
12776
- let str = JSON.stringify(subInitData).replace(/null/g, '""');
12777
- if (!this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]]) {
12778
- let key = [pathArr[3]];
12779
- let value = new Array();
12780
- this.data[pathArr[1]][pathArr[2]][subIndex][key] = value;
12781
- }
12782
- let sunBodata = JSON.parse(str);
12783
- sunBodata.sub_guid = this.guid();
12784
- this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]].push(sunBodata);
12785
- this.$root.$emit('add-new-collapse-item', sunBodata.sub_guid);
12786
- this.$forceUpdate(); //迫使 Vue 实例重新渲染
12787
- }
12788
- },
12789
- addSubTableByName(subTableName) {
12790
- for (let boAlias in this.data) {
12791
- let subInitData = JSON.parse(JSON.stringify(this.data[boAlias].initData[subTableName] || {}));
12792
- if (this.data[boAlias]['sub_' + subTableName] && this.data[boAlias]['sub_' + subTableName].length < 1) {
12793
- this.data[boAlias]['sub_' + subTableName].push(JSON.parse(JSON.stringify(subInitData)));
12794
- // 孙表必填 默认添加一条
12795
- if (this.permission.table) {
12796
- for (let tableName in this.permission.table) {
12797
- if (this.permission.table[tableName].required) {
12798
- 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) {
12799
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(JSON.parse(JSON.stringify(subInitData.initData[tableName])));
12800
- } else if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && !this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName]) {
12801
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] = [];
12802
- this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(subInitData.initData[tableName]);
12803
- }
12804
- }
12805
- }
12806
- }
12807
- }
12808
- }
12809
- },
12810
- deleteRow(subTablePath, item) {
12811
- let pathArr = subTablePath.split('.');
12812
- if (pathArr.length < 2) {
12813
- this.$message({
12814
- message: '子表路径有误',
12815
- type: 'warning'
12816
- });
12817
- } else {
12818
- let subTabName = pathArr[1].replace('sub_', '');
12819
- if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12820
- this.$message({
12821
- message: '子表必填一条记录',
12822
- type: 'warning'
12823
- });
12824
- return;
12825
- }
12826
- this.data[pathArr[0]][pathArr[1]].remove(item);
12827
- }
12828
- },
12829
- deleteSunRow(subTablePath, item, subIndex) {
12830
- let pathArr = subTablePath.split('.');
12831
- if (pathArr.length < 3) {
12832
- this.$message({
12833
- message: '孙表路径有误',
12834
- type: 'warning'
12835
- });
12836
- } else {
12837
- let subTabName = pathArr[1].replace('sub_', '');
12838
- let sunTabName = pathArr[2].replace('sub_', '');
12839
- if (this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].length == 1 && (this.permission.table[sunTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12840
- this.$message({
12841
- message: '孙表必填一条记录',
12842
- type: 'warning'
12843
- });
12844
- return;
12845
- }
12846
- this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].remove(item);
12847
- this.data = Object.assign({}, this.data);
12848
- }
12849
- },
12850
- clearAllMessageBox(data) {
12851
- this.$confirm('确认执行该操作?', '提示', {
12852
- confirmButtonText: '确定',
12853
- cancelButtonText: '取消',
12854
- type: 'warning'
12855
- }).then(() => {
12856
- this.clearAll(data);
12857
- }).catch(() => {
12858
- this.$message({
12859
- type: 'info',
12860
- message: '已取消操作'
12861
- });
12862
- });
12863
- },
12864
- clearAll(args) {
12865
- const {
12866
- subTablePath,
12867
- isHot,
12868
- index
12869
- } = args;
12870
- let pathArr;
12871
- if (!subTablePath) {
12872
- pathArr = args.split('.');
12873
- } else {
12874
- pathArr = subTablePath.split('.');
12875
- }
12876
- if (pathArr.length < 2) {
12877
- this.$message({
12878
- message: '子表路径有误',
12879
- type: 'warning'
12880
- });
12881
- //孙表
12882
- } else if ((index || index === 0) && pathArr.length == 3) {
12883
- const sunTabName = pathArr[2].replace('sub_', '');
12884
- if (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName] == 'true') {
12885
- this.$message.warning('孙表必填,至少保留一条记录');
12886
- return;
12887
- }
12888
- const _subPath = `data.${pathArr[0]}.${pathArr[1]}`;
12889
- const subIndex = this.getPageOffset(_subPath) + index;
12890
- const ary = this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]];
12891
- if (ary instanceof Array) {
12892
- ary.splice(0, ary.length);
12893
- }
12894
- } else {
12895
- const subTabName = pathArr[1].replace('sub_', '');
12896
- if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
12897
- this.$message({
12898
- message: '子表必填,至少保留一条记录。',
12899
- type: 'warning'
12900
- });
12901
- return;
12902
- }
12903
- const ary = this.data[pathArr[0]][pathArr[1]];
12904
- if (ary instanceof Array) {
12905
- ary.splice(0, ary.length);
12906
- }
12907
- if (isHot) {
12908
- const hotTableRef = 'hottable.' + subTablePath;
12909
- this.$refs[hotTableRef].fillbackHotTableData(null);
12910
- }
12911
- }
12912
- },
12913
- toFillOrg(path, row) {
12914
- const fillOrgConf = this.fillOrgConfMap[path];
12915
- let fillObj = {};
12916
- if (fillOrgConf && this.fillOrg) {
12917
- if (fillOrgConf.name) {
12918
- const namePath = fillOrgConf.name.split('.');
12919
- fillObj[namePath[namePath.length - 1]] = this.fillOrg.name;
12920
- }
12921
- if (fillOrgConf.id) {
12922
- const idPath = fillOrgConf.id.split('.');
12923
- fillObj[idPath[idPath.length - 1]] = this.fillOrg.id;
12924
- }
12925
- if (fillOrgConf.code) {
12926
- const codePath = fillOrgConf.code.split('.');
12927
- fillObj[codePath[codePath.length - 1]] = this.fillOrg.code;
12928
- }
12929
- if (fillOrgConf.instId) {
12930
- const instIdPath = fillOrgConf.instId.split('.');
12931
- fillObj[instIdPath[instIdPath.length - 1]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
12932
- }
12933
- return {
12934
- ...row,
12935
- ...fillObj
12936
- };
12937
- }
12938
- return row;
12939
- },
12940
- initFill(path, conf) {
12941
- //收集自动回填信息
12942
- if (path && conf) {
12943
- try {
12944
- const confJson = this.fillOrgConfMap[path] ? this.fillOrgConfMap[path] : JSON.parse(conf);
12945
- if (confJson.id || confJson.code || confJson.name || confJson.instId) {
12946
- this.fillOrgConfMap[path] = confJson;
12947
- this.initFirstFill(path, confJson);
12948
- }
12949
- } catch (error) {
12950
- error;
12951
- }
12952
- }
12953
- },
12954
- initFirstFill(path, conf) {
12955
- //处理第一行的回填
12956
- const paths = path.split('.');
12957
- if (this.data[paths[0]][paths[1]] && this.data[paths[0]][paths[1]].length == 1 && this.fillOrg.id) {
12958
- if (conf.id) {
12959
- const idPath = conf.id.split('.');
12960
- if (!this.data[paths[0]][paths[1]][0][idPath[2]]) {
12961
- this.data[paths[0]][paths[1]][0][idPath[2]] = this.fillOrg.id;
12962
- if (conf.code) {
12963
- const codePath = conf.code.split('.');
12964
- if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
12965
- this.data[paths[0]][paths[1]][0][codePath[2]] = this.fillOrg.code;
12966
- }
12967
- }
12968
- if (conf.name) {
12969
- const namePath = conf.name.split('.');
12970
- if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
12971
- this.data[paths[0]][paths[1]][0][namePath[2]] = this.fillOrg.name;
12972
- }
12973
- }
12974
- }
12975
- }
12976
- if (conf.instId) {
12977
- const instIdPath = conf.instId.split('.');
12978
- if (!this.data[paths[0]][paths[1]][0][instIdPath[2]]) {
12979
- this.data[paths[0]][paths[1]][0][instIdPath[2]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
12980
- }
12981
- }
12982
- }
12983
- },
12984
- isShowAddButton(path, maxRow, subIndex) {
12985
- if (maxRow === 0) return false;
12986
- let pathArr = path.split('.');
12987
- if (subIndex >= 0) {
12988
- if (pathArr.length < 4) {
12989
- this.$message({
12990
- message: '子表路径有误',
12991
- type: 'warning'
12992
- });
12993
- } else {
12994
- let data = this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]] || [];
12995
- return data.length >= maxRow;
12996
- }
12997
- } else {
12998
- if (pathArr.length < 3) {
12999
- this.$message({
13000
- message: '子表路径有误',
13001
- type: 'warning'
13002
- });
13003
- } else {
13004
- let data = this.data[pathArr[1]][pathArr[2]] || [];
13005
- return data.length >= maxRow;
13006
- }
13007
- }
13008
- return false;
13009
- }
13010
- }
13011
- });
13012
- // EXTERNAL MODULE: ./src/mixins/regionValidator.js
13013
- var regionValidator = __webpack_require__("eaa5");
13014
-
13015
- // EXTERNAL MODULE: ./src/mixins/emitter.js
13016
- var emitter = __webpack_require__("a215");
13017
-
13018
- // EXTERNAL MODULE: external "vue"
13019
- var external_vue_ = __webpack_require__("8bbf");
13020
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
13021
-
13022
- // 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
13023
- //
13024
- //
13025
- //
13026
- //
13027
- //
13028
- //
13029
- //
13030
- //
13031
- //
13032
- //
13033
- //
13034
- //
13035
- //
13036
- //
13037
- //
13038
- //
13039
- //
13040
- //
13041
- //
13042
- //
13043
- //
13044
- //
13045
- //
13046
- //
13047
- //
13048
- //
13049
-
13050
-
13051
- // import onlineHottable from '@/mixins/onlineHottable.js'
13052
-
13053
-
13054
-
13055
-
13056
- /* harmony default export */ var Formvue_type_script_lang_js = ({
13057
- name: 'HtOnlineForm',
13058
- componentName: 'HtOnlineForm',
13059
- mixins: [regionValidator["a" /* default */], emitter["a" /* default */]],
13060
- props: {
13061
- html: String,
13062
- data: Object,
13063
- permission: Object,
13064
- initFillData: {
13065
- type: Boolean,
13066
- default: false
13067
- },
13068
- isView: {
13069
- type: Boolean,
13070
- default: false
13071
- },
13072
- isPrint: {
13073
- type: Boolean,
13074
- default: false
13075
- },
13076
- isLook: {
13077
- type: Boolean,
13078
- default: false
13079
- },
13080
- mobileMode: {
13081
- type: Boolean,
13082
- default: false
13083
- },
13084
- flowKey: String,
13085
- formId: String,
13086
- formKey: String,
13087
- extendProp: {
13088
- type: Object,
13089
- default: () => {
13090
- return {};
13091
- }
13092
- },
13093
- isSupportMobile: {
13094
- type: Boolean,
13095
- default: false
13096
- },
13097
- instId: [String, Number],
13098
- isPreview: {
13099
- type: Boolean,
13100
- default: false
13101
- }
13102
- },
13103
- data() {
13104
- return {
13105
- formName: `onlineForm_${utils["a" /* default */].getName()}`,
13106
- loadStatus: 0,
13107
- subBackfill: new Map(),
13108
- hotTableFillback: String,
13109
- scopeName: `form-${utils["a" /* default */].getName()}`,
13110
- getDataPromiseResolve: null,
13111
- getDataPromiseReject: null
13112
- };
13113
- },
13114
- watch: {
13115
- html: {
13116
- handler: function (newVal) {
13117
- if (newVal) {
13118
- this.init();
13119
- }
13120
- },
13121
- immediate: true
13122
- }
13123
- },
13124
- created() {
13125
- this.$on('global-validate-result', result => {
13126
- if (result) {
13127
- this.getDataPromiseResolve(this.data);
13128
- } else {
13129
- this.getDataPromiseReject();
13130
- }
13131
- });
13132
- },
13133
- methods: {
13134
- handleLoadSuccess(res) {
13135
- this.loadStatus = 1;
13136
- this.$emit('load-success', res);
13137
- },
13138
- handleLoadFail() {
13139
- this.loadStatus = -1;
13140
- },
13141
- getData(validate) {
13142
- return new Promise((resolve, reject) => {
13143
- this.getDataPromiseResolve = resolve;
13144
- this.getDataPromiseReject = reject;
13145
- if (!validate) {
13146
- resolve(this.data);
13147
- } else {
13148
- // 执行校验逻辑
13149
- this.validateRegion(`[name='${this.formName}']`).then(errorItems => {
13150
- if (errorItems.length > 0) {
13151
- reject(errorItems);
13152
- } else {
13153
- this.broadcast('HtGlobalValidate', 'global-validate');
13154
- }
13155
- });
13156
- }
13157
- });
13158
- },
13159
- init() {
13160
- this.loadStatus = 1;
13161
- external_vue_default.a.component('ht-runtime-template', {
13162
- componentName: 'HtRuntimeTemplate',
13163
- mixins: [onlineSubtable],
13164
- props: {
13165
- html: String,
13166
- data: Object,
13167
- permission: Object,
13168
- initFillData: {
13169
- type: Boolean,
13170
- default: false
13171
- },
13172
- isView: {
13173
- type: Boolean,
13174
- default: false
13175
- },
13176
- isPrint: {
13177
- type: Boolean,
13178
- default: false
13179
- },
13180
- formKey: String,
13181
- mobileMode: {
13182
- type: Boolean,
13183
- default: false
13184
- },
13185
- extendProp: {
13186
- type: Object,
13187
- default: () => {
13188
- return {};
13189
- }
13190
- },
13191
- isSupportMobile: {
13192
- type: Boolean,
13193
- default: false
13194
- },
13195
- instId: [String, Number],
13196
- isPreview: {
13197
- type: Boolean,
13198
- default: false
13199
- }
13200
- },
13201
- template: this.html
12954
+ },
12955
+ template: this.html
13202
12956
  });
13203
12957
  }
13204
12958
  }
@@ -14424,13 +14178,6 @@ var component = Object(componentNormalizer["a" /* default */])(
14424
14178
 
14425
14179
  /***/ }),
14426
14180
 
14427
- /***/ "3929":
14428
- /***/ (function(module, exports, __webpack_require__) {
14429
-
14430
- // extracted by mini-css-extract-plugin
14431
-
14432
- /***/ }),
14433
-
14434
14181
  /***/ "3966":
14435
14182
  /***/ (function(module, exports, __webpack_require__) {
14436
14183
 
@@ -19452,17 +19199,6 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
19452
19199
  /* unused harmony reexport * */
19453
19200
 
19454
19201
 
19455
- /***/ }),
19456
-
19457
- /***/ "5369":
19458
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
19459
-
19460
- "use strict";
19461
- /* 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");
19462
- /* 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__);
19463
- /* unused harmony reexport * */
19464
-
19465
-
19466
19202
  /***/ }),
19467
19203
 
19468
19204
  /***/ "540d":
@@ -23823,6 +23559,13 @@ var component = Object(componentNormalizer["a" /* default */])(
23823
23559
  /* unused harmony reexport * */
23824
23560
 
23825
23561
 
23562
+ /***/ }),
23563
+
23564
+ /***/ "67be":
23565
+ /***/ (function(module, exports, __webpack_require__) {
23566
+
23567
+ // extracted by mini-css-extract-plugin
23568
+
23826
23569
  /***/ }),
23827
23570
 
23828
23571
  /***/ "6861":
@@ -31690,13 +31433,6 @@ var component = Object(componentNormalizer["a" /* default */])(
31690
31433
  /* unused harmony reexport * */
31691
31434
 
31692
31435
 
31693
- /***/ }),
31694
-
31695
- /***/ "7f2d":
31696
- /***/ (function(module, exports, __webpack_require__) {
31697
-
31698
- // extracted by mini-css-extract-plugin
31699
-
31700
31436
  /***/ }),
31701
31437
 
31702
31438
  /***/ "7fbd":
@@ -33496,7 +33232,7 @@ _main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].register({
33496
33232
  /***/ "9224":
33497
33233
  /***/ (function(module) {
33498
33234
 
33499
- module.exports = JSON.parse("{\"a\":\"1.0.65\"}");
33235
+ module.exports = JSON.parse("{\"a\":\"1.0.66\"}");
33500
33236
 
33501
33237
  /***/ }),
33502
33238
 
@@ -37108,6 +36844,17 @@ var component = Object(componentNormalizer["a" /* default */])(
37108
36844
 
37109
36845
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
37110
36846
 
36847
+ /***/ }),
36848
+
36849
+ /***/ "a692":
36850
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
36851
+
36852
+ "use strict";
36853
+ /* 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");
36854
+ /* 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__);
36855
+ /* unused harmony reexport * */
36856
+
36857
+
37111
36858
  /***/ }),
37112
36859
 
37113
36860
  /***/ "a699":
@@ -40248,6 +39995,17 @@ var component = Object(componentNormalizer["a" /* default */])(
40248
39995
 
40249
39996
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
40250
39997
 
39998
+ /***/ }),
39999
+
40000
+ /***/ "ba15":
40001
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
40002
+
40003
+ "use strict";
40004
+ /* 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");
40005
+ /* 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__);
40006
+ /* unused harmony reexport * */
40007
+
40008
+
40251
40009
  /***/ }),
40252
40010
 
40253
40011
  /***/ "ba2f":
@@ -40311,20 +40069,20 @@ __webpack_require__.r(__webpack_exports__);
40311
40069
  // ESM COMPAT FLAG
40312
40070
  __webpack_require__.r(__webpack_exports__);
40313
40071
 
40314
- // 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
40072
+ // 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
40315
40073
  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)}
40316
40074
  var staticRenderFns = []
40317
40075
 
40318
40076
 
40319
- // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=139da030&scoped=true
40077
+ // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=template&id=c3869aec&scoped=true
40320
40078
 
40321
40079
  // 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
40322
40080
  var SubImportDialogvue_type_script_lang_js = __webpack_require__("248e");
40323
40081
 
40324
40082
  // CONCATENATED MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=script&lang=js
40325
40083
  /* harmony default export */ var src_SubImportDialogvue_type_script_lang_js = (SubImportDialogvue_type_script_lang_js["a" /* default */]);
40326
- // EXTERNAL MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=style&index=0&id=139da030&prod&lang=scss&scoped=true
40327
- var SubImportDialogvue_type_style_index_0_id_139da030_prod_lang_scss_scoped_true = __webpack_require__("5369");
40084
+ // EXTERNAL MODULE: ./packages/Subtable/src/SubImportDialog.vue?vue&type=style&index=0&id=c3869aec&prod&lang=scss&scoped=true
40085
+ var SubImportDialogvue_type_style_index_0_id_c3869aec_prod_lang_scss_scoped_true = __webpack_require__("a692");
40328
40086
 
40329
40087
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
40330
40088
  var componentNormalizer = __webpack_require__("2877");
@@ -40344,7 +40102,7 @@ var component = Object(componentNormalizer["a" /* default */])(
40344
40102
  staticRenderFns,
40345
40103
  false,
40346
40104
  null,
40347
- "139da030",
40105
+ "c3869aec",
40348
40106
  null
40349
40107
 
40350
40108
  )
@@ -42033,6 +41791,698 @@ module.exports = require("echarts/lib/echarts.js");
42033
41791
 
42034
41792
  /***/ }),
42035
41793
 
41794
+ /***/ "c31b":
41795
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
41796
+
41797
+ "use strict";
41798
+ /* harmony import */ var _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1639");
41799
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("025e");
41800
+
41801
+
41802
+ /* harmony default export */ __webpack_exports__["a"] = ({
41803
+ data() {
41804
+ return {
41805
+ searchVal: '',
41806
+ //搜索关键字
41807
+ fillOrg: {},
41808
+ fillOrgConfMap: {},
41809
+ transitionIndex: -1,
41810
+ left_image: '',
41811
+ right_image: ''
41812
+ };
41813
+ },
41814
+ computed: {
41815
+ // 子表前端分页过滤器
41816
+ pagingSubData() {
41817
+ const me = this;
41818
+ return function (datapath) {
41819
+ // 通过子表数据路径获取分页数据
41820
+ return _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].pagingByPath(datapath, me);
41821
+ };
41822
+ },
41823
+ // 获取子表分页 offset
41824
+ getPageOffset() {
41825
+ return datapath => {
41826
+ return _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].getPageOffset(datapath, this);
41827
+ };
41828
+ },
41829
+ // 是否为待办单
41830
+ isTodoForm() {
41831
+ const types = ['MyDelegate', 'done', 'LeaderDone', 'request'];
41832
+ const type = this.$route.query.type || '';
41833
+ return types.includes(type) || this.$route.query.readId;
41834
+ }
41835
+ },
41836
+ mounted() {
41837
+ // 如果当前表单的element为Comment说明表单加载失败了。
41838
+ if (this.$el && this.$el.constructor == Comment) {
41839
+ this.$emit('load-fail');
41840
+ return;
41841
+ }
41842
+ this.$validator = this.$root.$validator;
41843
+ if (this.permission.table) {
41844
+ for (let subTableName in this.permission.table) {
41845
+ if (this.permission.table[subTableName].required) {
41846
+ this.addSubTableByName(subTableName);
41847
+ }
41848
+ }
41849
+ }
41850
+ this.$emit('load-success', true);
41851
+ if (this.isPrint) {
41852
+ this.printDetail();
41853
+ }
41854
+ },
41855
+ methods: {
41856
+ //合计计算
41857
+ getSummaries(param, list) {
41858
+ let CancelTheCalculation = sessionStorage.getItem('Cancel_The_Calculation') ? JSON.parse(sessionStorage.getItem('Cancel_The_Calculation')) : {};
41859
+ //
41860
+ let listChange = JSON.parse(Base64.decode(list, 'utf-8'));
41861
+
41862
+ //
41863
+
41864
+ if (listChange.length < 1) {
41865
+ return;
41866
+ }
41867
+ const {
41868
+ columns,
41869
+ data
41870
+ } = param;
41871
+ this.tableData = data;
41872
+ const sums = [];
41873
+ let calcProp = [];
41874
+ let columnsDep = _.cloneDeep(columns);
41875
+ listChange.forEach((item, idex) => {
41876
+ if (item.addFunc == 'calcFunc') {
41877
+ columnsDep.forEach((column, index) => {
41878
+ if (item.mathExp && item.mathExp.indexOf('.' + column.property) > -1) {
41879
+ calcProp.push(column.property);
41880
+ }
41881
+ });
41882
+ }
41883
+ columnsDep.forEach((column, index) => {
41884
+ if (item.columnField == column.property) {
41885
+ column.combinedOption = item;
41886
+ }
41887
+ });
41888
+ });
41889
+ columnsDep.forEach((column, index) => {
41890
+ if (index === 0 && columnsDep[0].type == 'index') {
41891
+ sums[index] = '';
41892
+ return;
41893
+ }
41894
+ //当有需要才合计
41895
+ if (column.combinedOption) {
41896
+ let {
41897
+ addFunc,
41898
+ columnField,
41899
+ name,
41900
+ unit,
41901
+ showType,
41902
+ num,
41903
+ tag,
41904
+ mainTarget
41905
+ } = column.combinedOption;
41906
+ let Bol = tag && CancelTheCalculation && CancelTheCalculation[tag] && CancelTheCalculation[tag].length > 0;
41907
+ const values = data.map(item => Number(item[column.property]));
41908
+ let depValues = _.cloneDeep(values);
41909
+ if (Bol) {
41910
+ let delMin = [];
41911
+ depValues.forEach((item, i) => {
41912
+ if (!CancelTheCalculation[tag].includes(i)) {
41913
+ delMin.push(item);
41914
+ }
41915
+ });
41916
+ depValues = delMin;
41917
+ }
41918
+ let units = unit ? unit : '';
41919
+ //求和
41920
+ if (addFunc === 'add') {
41921
+ if (!depValues.every(value => isNaN(value))) {
41922
+ sums[index] = depValues.reduce((prev, curr) => {
41923
+ const value = Number(curr);
41924
+ if (!isNaN(value)) {
41925
+ return prev + curr;
41926
+ } else {
41927
+ return prev;
41928
+ }
41929
+ }, 0);
41930
+ sums[index] = this.dealWithDataHtml(name, sums[index], showType, num, units, mainTarget);
41931
+ } else {
41932
+ sums[index] = this.dealWithDataHtml(name, 0, showType, num, units, mainTarget);
41933
+ }
41934
+ }
41935
+ //计数
41936
+ if (addFunc === 'count') {
41937
+ let numCount = values.length;
41938
+ if (Bol) {
41939
+ numCount = values.length - CancelTheCalculation[tag].length;
41940
+ }
41941
+ sums[index] = this.dealWithDataHtml(name, numCount, showType, num, units, mainTarget);
41942
+ }
41943
+ //平均值
41944
+ if (addFunc === 'average') {
41945
+ let sum = 0;
41946
+ var average = 0;
41947
+ for (var i = 0; i < depValues.length; i++) {
41948
+ sum += depValues[i];
41949
+ }
41950
+ depValues.length > 0 ? average = sum / depValues.length : average = 0;
41951
+ sums[index] = this.dealWithDataHtml(name, average, showType, num, units, mainTarget);
41952
+ }
41953
+ //最大值
41954
+ if (addFunc === 'max') {
41955
+ let maxNum = Math.max.apply(null, depValues.length > 0 ? depValues : [0]);
41956
+ sums[index] = this.dealWithDataHtml(name, maxNum, showType, num, units, mainTarget);
41957
+ }
41958
+ //最小值
41959
+ if (addFunc === 'min') {
41960
+ let minNum = Math.min.apply(null, depValues.length > 0 ? depValues : [0]);
41961
+ sums[index] = this.dealWithDataHtml(name, minNum, showType, num, units, mainTarget);
41962
+ }
41963
+
41964
+ //公式计算
41965
+ if (addFunc === 'calcFunc') {
41966
+ const calcVal = this.dealCustomCalc(data, column.combinedOption);
41967
+ sums[index] = this.dealWithDataHtml(name, calcVal, showType, num, units, mainTarget);
41968
+ }
41969
+ } else if (calcProp.indexOf(column.property) > -1) {
41970
+ const values = data.map(item => Number(item[column.property]));
41971
+ }
41972
+ });
41973
+ return sums;
41974
+ },
41975
+ //合计行
41976
+ handleSummary(summary) {
41977
+ return summary && !this.searchVal ? true : false;
41978
+ },
41979
+ dealCustomCalc(data, calc) {
41980
+ let exp = calc.mathExp;
41981
+ if (!exp) return null;
41982
+ var reg = /([\[|\{]).*?\((.*?)\)[\}|\]]/g;
41983
+ exp = exp.replace(reg, function () {
41984
+ var symbol = arguments[1],
41985
+ name = arguments[2];
41986
+ const prop = name.split('.')[1];
41987
+ const values = data.map(item => Number(item[prop]));
41988
+ return values.join(',');
41989
+ });
41990
+ exp = exp.replace(/[|\[|\]]/g, '');
41991
+ exp = eval(`(${exp})`);
41992
+ if (exp === Infinity || isNaN(exp)) {
41993
+ exp = null;
41994
+ }
41995
+ return exp;
41996
+ },
41997
+ dealWithDataHtml(name, type, showType, num, units, mainTarget) {
41998
+ let {
41999
+ data,
42000
+ monCap
42001
+ } = this.dealWithData(type, showType, num, mainTarget);
42002
+ if (monCap) {
42003
+ return name + ':' + data + units + '\n' + monCap;
42004
+ }
42005
+ return name + ':' + data + units;
42006
+ },
42007
+ //处理数据
42008
+ dealWithData(data, showType, numfix = 0, mainTarget) {
42009
+ data = Number(data);
42010
+ let list = showType;
42011
+ let num = {
42012
+ data: 0,
42013
+ monCap: ''
42014
+ };
42015
+ // 保留小数位
42016
+ if (list.includes('keepSmall')) {
42017
+ const fixData = data.toFixedRound(numfix);
42018
+ num.data = fixData;
42019
+ if (mainTarget) {
42020
+ mainTarget = !mainTarget.startsWith('data.') ? 'data.' + mainTarget : mainTarget;
42021
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByConfigKey(this, {
42022
+ trget: mainTarget
42023
+ }, 'trget', data);
42024
+ }
42025
+ } else {
42026
+ if (mainTarget && data != null) {
42027
+ mainTarget = !mainTarget.startsWith('data.') ? 'data.' + mainTarget : mainTarget;
42028
+ _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].setValueByConfigKey(this, {
42029
+ trget: mainTarget
42030
+ }, 'trget', data.toFixedRound(4));
42031
+ }
42032
+ }
42033
+
42034
+ //百分比
42035
+ if (list.includes('percentage')) {
42036
+ num.data = Number(data * 100) + '%';
42037
+ }
42038
+ // 千分位
42039
+ if (list.includes('Micrometer')) {
42040
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(data);
42041
+ }
42042
+ if (list.includes('keepSmall') && list.includes('percentage') && list.includes('Micrometer')) {
42043
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(Number(data * 100).toFixedRound(numfix)) + '%';
42044
+ return num;
42045
+ }
42046
+ if (list.includes('keepSmall') && list.includes('percentage')) {
42047
+ num.data = Number(data * 100).toFixedRound(numfix) + '%';
42048
+ return num;
42049
+ }
42050
+ if (list.includes('Micrometer') && list.includes('percentage')) {
42051
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(Number(data * 100)) + '%';
42052
+ return num;
42053
+ }
42054
+ if (list.includes('keepSmall') && list.includes('Micrometer')) {
42055
+ num.data = _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].thousandBit(data.toFixedRound(numfix));
42056
+ }
42057
+
42058
+ // 货币大写
42059
+ if (list.includes('monCap')) {
42060
+ num = {
42061
+ data: data,
42062
+ monCap: _utils_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].convertCurrency(data)
42063
+ };
42064
+ return num;
42065
+ }
42066
+ return num;
42067
+ },
42068
+ getExpandArr(data, type) {
42069
+ if (type === 'expand' && data) {
42070
+ let arr = [];
42071
+ data.forEach(item => {
42072
+ arr.push(item.sub_guid);
42073
+ });
42074
+ return arr;
42075
+ }
42076
+ return data && data.length ? [data[0].sub_guid] : [];
42077
+ },
42078
+ printDetail() {
42079
+ window.print();
42080
+ if (this.isPrint) {
42081
+ this.$router.go(-1);
42082
+ }
42083
+ setTimeout(function () {
42084
+ location.reload();
42085
+ }, 200);
42086
+ },
42087
+ //子表上移
42088
+ up(index, data) {
42089
+ if (index === 0) {
42090
+ this.$message({
42091
+ message: '已经是列表中第一位',
42092
+ type: 'warning'
42093
+ });
42094
+ } else {
42095
+ let temp = data[index - 1];
42096
+ this.$set(data, index - 1, data[index]);
42097
+ this.$set(data, index, temp);
42098
+ }
42099
+ },
42100
+ //子表下移
42101
+ down(index, data) {
42102
+ if (index === data.length - 1) {
42103
+ this.$message({
42104
+ message: '已经是列表中最后一位',
42105
+ type: 'warning'
42106
+ });
42107
+ } else {
42108
+ this.isTransition = true;
42109
+ let i = data[index + 1];
42110
+ this.$set(data, index + 1, data[index]);
42111
+ this.$set(data, index, i);
42112
+ }
42113
+ },
42114
+ //子表复制数据
42115
+ copy(obj, item, subPath) {
42116
+ let newOne = JSON.parse(JSON.stringify(item));
42117
+ //把id置空以免走的修改方法
42118
+ if (newOne.id_) {
42119
+ delete newOne.id_;
42120
+ }
42121
+ if (newOne.id) {
42122
+ delete newOne.id;
42123
+ }
42124
+ if (newOne.sub_row_readonly) {
42125
+ delete newOne.sub_row_readonly;
42126
+ }
42127
+ //有孙表时,删除孙表id_
42128
+ for (let key in newOne) {
42129
+ if (key.startsWith('sub_') && Array.isArray(newOne[key])) {
42130
+ if (newOne[key].length) {
42131
+ newOne[key].forEach(it => {
42132
+ it.id_ && delete it.id_;
42133
+ });
42134
+ }
42135
+ }
42136
+ }
42137
+ if (subPath) {
42138
+ const watchMap = this.watchMap;
42139
+ // 判断当前是否有绑定流水号的字段
42140
+ if (watchMap) {
42141
+ const bindIdentityModelNameList = watchMap.get('bindIdentityModelNameList');
42142
+ if (bindIdentityModelNameList && bindIdentityModelNameList.length > 0) {
42143
+ bindIdentityModelNameList.forEach(bim => {
42144
+ if (bim.startsWith(subPath)) {
42145
+ // 如果有则删除复制数据中原来的流水号值
42146
+ delete newOne[bim.replace(`${subPath}.`, '')];
42147
+ }
42148
+ });
42149
+ }
42150
+ }
42151
+ }
42152
+ newOne.sub_guid = this.guid();
42153
+ this.$root.$emit('add-new-collapse-item', newOne.sub_guid);
42154
+ obj.push(newOne);
42155
+ this.$forceUpdate();
42156
+ },
42157
+ //子表默认值回填
42158
+ addSubTab(subTabPath) {
42159
+ let pathArr = subTabPath.split('.');
42160
+ if (pathArr.length < 3) {
42161
+ this.$message({
42162
+ message: '子表路径有误',
42163
+ type: 'warning'
42164
+ });
42165
+ } else {
42166
+ let subTabName = pathArr[2].replace('sub_', '');
42167
+ let subInitData = this.data[pathArr[1]].initData[subTabName] || {};
42168
+ //判断当前子表是否存有回显值
42169
+ if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
42170
+ subInitData = this.$parent.subBackfill.get(subTabPath);
42171
+ }
42172
+ //把数组里面的值为 null 转换为空字符串
42173
+ let str = JSON.stringify(subInitData).replace(/null/g, '""');
42174
+ let subData = JSON.parse(str);
42175
+ const subDataArr = this.data[pathArr[1]][pathArr[2]];
42176
+ //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
42177
+ const nextIndex = subDataArr.length;
42178
+ for (var key in subData) {
42179
+ //点添加时判断要新增子表记录中的孙表是否有值
42180
+ if (key.indexOf('sub_') == 0) {
42181
+ if (subData[key].length > 0) {
42182
+ subData[key] = []; //有则清空
42183
+ }
42184
+ const sunTabName = key.replace('sub_', '');
42185
+ if (this.permission.table[sunTabName] && (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName].required == 'true')) {
42186
+ this.$nextTick(() => {
42187
+ this.addSunTab(`${subTabPath}.${key}`, nextIndex);
42188
+ });
42189
+ }
42190
+ }
42191
+ }
42192
+ let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData);
42193
+ fillObj.sub_guid = this.guid();
42194
+ this.$root.$emit('add-new-collapse-item', fillObj.sub_guid);
42195
+ subDataArr.push(fillObj);
42196
+ }
42197
+ },
42198
+ //子表添加头部样式
42199
+ handleCellStyle({
42200
+ column
42201
+ }) {
42202
+ let ColBgColor;
42203
+ if (column.className) {
42204
+ ColBgColor = column.className.split('__')[1];
42205
+ }
42206
+ return ColBgColor ? {
42207
+ background: ColBgColor
42208
+ } : {};
42209
+ },
42210
+ //子表表头颜色
42211
+ handleRowStyle(color) {
42212
+ return {
42213
+ '--headerBgColor': color ? color : '#f4f4f4'
42214
+ };
42215
+ },
42216
+ guid() {
42217
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
42218
+ var r = Math.random() * 16 | 0,
42219
+ v = c == 'x' ? r : r & 0x3 | 0x8;
42220
+ return v.toString(16);
42221
+ });
42222
+ },
42223
+ //孙表默认值回填
42224
+ addSunTab(subTabPath, index) {
42225
+ let pathArr = subTabPath.split('.');
42226
+ if (pathArr.length < 4) {
42227
+ this.$message({
42228
+ message: '孙表路径有误',
42229
+ type: 'warning'
42230
+ });
42231
+ } else {
42232
+ const subTablePath = pathArr.filter((item, index) => index !== 3);
42233
+ const subIndex = this.getPageOffset(subTablePath.join('.')) + index;
42234
+ let subTabName = pathArr[2].replace('sub_', '');
42235
+ let sunTabName = pathArr[3].replace('sub_', '');
42236
+ let subTable = this.data[pathArr[1]][pathArr[2]][subIndex];
42237
+ if (!subTable.hasOwnProperty(pathArr[3])) {
42238
+ this.$set(subTable, pathArr[3], new Array());
42239
+ }
42240
+ let subInitData = this.data[pathArr[1]].initData[subTabName].initData[sunTabName] || {};
42241
+ //判断当前孙表是否存有回显值
42242
+ if (this.$parent.subBackfill && this.$parent.subBackfill.has(subTabPath)) {
42243
+ //this.data[pathArr[1]][pathArr[2]].push(this.$parent.subBackfill.get(subTabPath));
42244
+ subInitData = this.$parent.subBackfill.get(subTabPath);
42245
+ }
42246
+ //把数组里面的值为 null 转换为空字符串
42247
+ let str = JSON.stringify(subInitData).replace(/null/g, '""');
42248
+ if (!this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]]) {
42249
+ let key = [pathArr[3]];
42250
+ let value = new Array();
42251
+ this.data[pathArr[1]][pathArr[2]][subIndex][key] = value;
42252
+ }
42253
+ let sunBodata = JSON.parse(str);
42254
+ sunBodata.sub_guid = this.guid();
42255
+ this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]].push(sunBodata);
42256
+ this.$root.$emit('add-new-collapse-item', sunBodata.sub_guid);
42257
+ this.$forceUpdate(); //迫使 Vue 实例重新渲染
42258
+ }
42259
+ },
42260
+ addSubTableByName(subTableName) {
42261
+ for (let boAlias in this.data) {
42262
+ let subInitData = JSON.parse(JSON.stringify(this.data[boAlias].initData[subTableName] || {}));
42263
+ if (this.data[boAlias]['sub_' + subTableName] && this.data[boAlias]['sub_' + subTableName].length < 1) {
42264
+ this.data[boAlias]['sub_' + subTableName].push(JSON.parse(JSON.stringify(subInitData)));
42265
+ // 孙表必填 默认添加一条
42266
+ if (this.permission.table) {
42267
+ for (let tableName in this.permission.table) {
42268
+ if (this.permission.table[tableName].required) {
42269
+ 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) {
42270
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(JSON.parse(JSON.stringify(subInitData.initData[tableName])));
42271
+ } else if (this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty('sub_' + tableName) && !this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName]) {
42272
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName] = [];
42273
+ this.data[boAlias]['sub_' + subTableName][0]['sub_' + tableName].push(subInitData.initData[tableName]);
42274
+ }
42275
+ }
42276
+ }
42277
+ }
42278
+ }
42279
+ }
42280
+ },
42281
+ deleteRow(subTablePath, item) {
42282
+ let pathArr = subTablePath.split('.');
42283
+ if (pathArr.length < 2) {
42284
+ this.$message({
42285
+ message: '子表路径有误',
42286
+ type: 'warning'
42287
+ });
42288
+ } else {
42289
+ let subTabName = pathArr[1].replace('sub_', '');
42290
+ if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42291
+ this.$message({
42292
+ message: '子表必填一条记录',
42293
+ type: 'warning'
42294
+ });
42295
+ return;
42296
+ }
42297
+ this.data[pathArr[0]][pathArr[1]].remove(item);
42298
+ }
42299
+ },
42300
+ deleteSunRow(subTablePath, item, subIndex) {
42301
+ let pathArr = subTablePath.split('.');
42302
+ if (pathArr.length < 3) {
42303
+ this.$message({
42304
+ message: '孙表路径有误',
42305
+ type: 'warning'
42306
+ });
42307
+ } else {
42308
+ let subTabName = pathArr[1].replace('sub_', '');
42309
+ let sunTabName = pathArr[2].replace('sub_', '');
42310
+ if (this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].length == 1 && (this.permission.table[sunTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42311
+ this.$message({
42312
+ message: '孙表必填一条记录',
42313
+ type: 'warning'
42314
+ });
42315
+ return;
42316
+ }
42317
+ this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].remove(item);
42318
+ this.data = Object.assign({}, this.data);
42319
+ }
42320
+ },
42321
+ clearAllMessageBox(data) {
42322
+ this.$confirm('确认执行该操作?', '提示', {
42323
+ confirmButtonText: '确定',
42324
+ cancelButtonText: '取消',
42325
+ type: 'warning'
42326
+ }).then(() => {
42327
+ this.clearAll(data);
42328
+ }).catch(() => {
42329
+ this.$message({
42330
+ type: 'info',
42331
+ message: '已取消操作'
42332
+ });
42333
+ });
42334
+ },
42335
+ clearAll(args) {
42336
+ const {
42337
+ subTablePath,
42338
+ isHot,
42339
+ index
42340
+ } = args;
42341
+ let pathArr;
42342
+ if (!subTablePath) {
42343
+ pathArr = args.split('.');
42344
+ } else {
42345
+ pathArr = subTablePath.split('.');
42346
+ }
42347
+ if (pathArr.length < 2) {
42348
+ this.$message({
42349
+ message: '子表路径有误',
42350
+ type: 'warning'
42351
+ });
42352
+ //孙表
42353
+ } else if ((index || index === 0) && pathArr.length == 3) {
42354
+ const sunTabName = pathArr[2].replace('sub_', '');
42355
+ if (this.permission.table[sunTabName].required == true || this.permission.table[sunTabName] == 'true') {
42356
+ this.$message.warning('孙表必填,至少保留一条记录');
42357
+ return;
42358
+ }
42359
+ const _subPath = `data.${pathArr[0]}.${pathArr[1]}`;
42360
+ const subIndex = this.getPageOffset(_subPath) + index;
42361
+ const ary = this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]];
42362
+ if (ary instanceof Array) {
42363
+ ary.splice(0, ary.length);
42364
+ }
42365
+ } else {
42366
+ const subTabName = pathArr[1].replace('sub_', '');
42367
+ if (this.data[pathArr[0]][pathArr[1]].length == 1 && (this.permission.table[subTabName].required == true || this.permission.table[subTabName].required == 'true')) {
42368
+ this.$message({
42369
+ message: '子表必填,至少保留一条记录。',
42370
+ type: 'warning'
42371
+ });
42372
+ return;
42373
+ }
42374
+ const ary = this.data[pathArr[0]][pathArr[1]];
42375
+ if (ary instanceof Array) {
42376
+ ary.splice(0, ary.length);
42377
+ }
42378
+ if (isHot) {
42379
+ const hotTableRef = 'hottable.' + subTablePath;
42380
+ this.$refs[hotTableRef].fillbackHotTableData(null);
42381
+ }
42382
+ }
42383
+ },
42384
+ toFillOrg(path, row) {
42385
+ const fillOrgConf = this.fillOrgConfMap[path];
42386
+ let fillObj = {};
42387
+ if (fillOrgConf && this.fillOrg) {
42388
+ if (fillOrgConf.name) {
42389
+ const namePath = fillOrgConf.name.split('.');
42390
+ fillObj[namePath[namePath.length - 1]] = this.fillOrg.name;
42391
+ }
42392
+ if (fillOrgConf.id) {
42393
+ const idPath = fillOrgConf.id.split('.');
42394
+ fillObj[idPath[idPath.length - 1]] = this.fillOrg.id;
42395
+ }
42396
+ if (fillOrgConf.code) {
42397
+ const codePath = fillOrgConf.code.split('.');
42398
+ fillObj[codePath[codePath.length - 1]] = this.fillOrg.code;
42399
+ }
42400
+ if (fillOrgConf.instId) {
42401
+ const instIdPath = fillOrgConf.instId.split('.');
42402
+ fillObj[instIdPath[instIdPath.length - 1]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
42403
+ }
42404
+ return {
42405
+ ...row,
42406
+ ...fillObj
42407
+ };
42408
+ }
42409
+ return row;
42410
+ },
42411
+ initFill(path, conf) {
42412
+ //收集自动回填信息
42413
+ if (path && conf) {
42414
+ try {
42415
+ const confJson = this.fillOrgConfMap[path] ? this.fillOrgConfMap[path] : JSON.parse(conf);
42416
+ if (confJson.id || confJson.code || confJson.name || confJson.instId) {
42417
+ this.fillOrgConfMap[path] = confJson;
42418
+ this.initFirstFill(path, confJson);
42419
+ }
42420
+ } catch (error) {
42421
+ error;
42422
+ }
42423
+ }
42424
+ },
42425
+ initFirstFill(path, conf) {
42426
+ //处理第一行的回填
42427
+ const paths = path.split('.');
42428
+ if (this.data[paths[0]][paths[1]] && this.data[paths[0]][paths[1]].length == 1 && this.fillOrg.id) {
42429
+ if (conf.id) {
42430
+ const idPath = conf.id.split('.');
42431
+ if (!this.data[paths[0]][paths[1]][0][idPath[2]]) {
42432
+ this.data[paths[0]][paths[1]][0][idPath[2]] = this.fillOrg.id;
42433
+ if (conf.code) {
42434
+ const codePath = conf.code.split('.');
42435
+ if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
42436
+ this.data[paths[0]][paths[1]][0][codePath[2]] = this.fillOrg.code;
42437
+ }
42438
+ }
42439
+ if (conf.name) {
42440
+ const namePath = conf.name.split('.');
42441
+ if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
42442
+ this.data[paths[0]][paths[1]][0][namePath[2]] = this.fillOrg.name;
42443
+ }
42444
+ }
42445
+ }
42446
+ }
42447
+ if (conf.instId) {
42448
+ const instIdPath = conf.instId.split('.');
42449
+ if (!this.data[paths[0]][paths[1]][0][instIdPath[2]]) {
42450
+ this.data[paths[0]][paths[1]][0][instIdPath[2]] = this.$parent.$parent.instId ? this.$parent.$parent.instId : '';
42451
+ }
42452
+ }
42453
+ }
42454
+ },
42455
+ isShowAddButton(path, maxRow, subIndex) {
42456
+ if (maxRow === 0) return false;
42457
+ let pathArr = path.split('.');
42458
+ if (subIndex >= 0) {
42459
+ if (pathArr.length < 4) {
42460
+ this.$message({
42461
+ message: '子表路径有误',
42462
+ type: 'warning'
42463
+ });
42464
+ } else {
42465
+ let data = this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]] || [];
42466
+ return data.length >= maxRow;
42467
+ }
42468
+ } else {
42469
+ if (pathArr.length < 3) {
42470
+ this.$message({
42471
+ message: '子表路径有误',
42472
+ type: 'warning'
42473
+ });
42474
+ } else {
42475
+ let data = this.data[pathArr[1]][pathArr[2]] || [];
42476
+ return data.length >= maxRow;
42477
+ }
42478
+ }
42479
+ return false;
42480
+ }
42481
+ }
42482
+ });
42483
+
42484
+ /***/ }),
42485
+
42036
42486
  /***/ "c32d":
42037
42487
  /***/ (function(module, exports) {
42038
42488
 
@@ -42801,6 +43251,13 @@ _src_main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].install = function (Vue) {
42801
43251
 
42802
43252
  /***/ }),
42803
43253
 
43254
+ /***/ "cd50":
43255
+ /***/ (function(module, exports, __webpack_require__) {
43256
+
43257
+ // extracted by mini-css-extract-plugin
43258
+
43259
+ /***/ }),
43260
+
42804
43261
  /***/ "ce89":
42805
43262
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
42806
43263
 
@@ -44082,17 +44539,6 @@ var component = Object(componentNormalizer["a" /* default */])(
44082
44539
 
44083
44540
  /* harmony default export */ var main = __webpack_exports__["default"] = (component.exports);
44084
44541
 
44085
- /***/ }),
44086
-
44087
- /***/ "cf7b":
44088
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
44089
-
44090
- "use strict";
44091
- /* 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");
44092
- /* 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__);
44093
- /* unused harmony reexport * */
44094
-
44095
-
44096
44542
  /***/ }),
44097
44543
 
44098
44544
  /***/ "cfad":
@@ -45620,6 +46066,16 @@ const {
45620
46066
  dataSubdesc: {
45621
46067
  type: String,
45622
46068
  default: '子表数据'
46069
+ },
46070
+ exportMaxRow: {
46071
+ type: [String, Number]
46072
+ },
46073
+ exportField: {
46074
+ // 禁止导出的字段集合
46075
+ type: String
46076
+ },
46077
+ exportFieldTransformData: {
46078
+ type: String
45623
46079
  }
45624
46080
  },
45625
46081
  computed: {
@@ -45633,6 +46089,36 @@ const {
45633
46089
  }
45634
46090
  },
45635
46091
  methods: {
46092
+ async sqlChange(config, value = '') {
46093
+ return new Promise(resolve => {
46094
+ let params = {
46095
+ dsName: config.dataSource,
46096
+ sql: config.relevancyValue ? config.relevancyValue.replace(/{val}/g, value) : ''
46097
+ };
46098
+ this.$requestConfig.getValueBySql(params).then(res => {
46099
+ resolve(res);
46100
+ });
46101
+ });
46102
+ },
46103
+ transformFieldData(data) {
46104
+ return new Promise(async resolve => {
46105
+ let fieldTransformData = JSON.parse(Object(_util_base64_js__WEBPACK_IMPORTED_MODULE_1__[/* decode */ "a"])(this.exportFieldTransformData));
46106
+ for (let i = 0; i < data.length; i++) {
46107
+ for (let j = 0; j < fieldTransformData.length; j++) {
46108
+ if (fieldTransformData[j].relevancyType == 'value') {
46109
+ data[i][fieldTransformData[j].field] = fieldTransformData[j].relevancyValue;
46110
+ } else {
46111
+ // 动态时 请求接口修改数据
46112
+ let result = await this.sqlChange(fieldTransformData[j], data[i][fieldTransformData[j].field]);
46113
+ if (result) {
46114
+ data[i][fieldTransformData[j].field] = result;
46115
+ }
46116
+ }
46117
+ }
46118
+ }
46119
+ resolve(data);
46120
+ });
46121
+ },
45636
46122
  // 配置的数据字典 导出时翻译为汉字
45637
46123
  changeDictionary(data) {
45638
46124
  return new Promise(async (resolve, reject) => {
@@ -45656,10 +46142,14 @@ const {
45656
46142
  },
45657
46143
  changeRowKey(rows) {
45658
46144
  var exportData = [];
46145
+ let exportFieldArr = null;
46146
+ if (this.exportField) {
46147
+ exportFieldArr = this.exportField.split(',');
46148
+ }
45659
46149
  rows.forEach(row => {
45660
46150
  var exportRow = {};
45661
46151
  this.columns.forEach(col => {
45662
- if (col.ctrlType != 'suntable') {
46152
+ if (col.ctrlType != 'suntable' && (!exportFieldArr || exportFieldArr && !exportFieldArr.includes(col.name))) {
45663
46153
  exportRow[col.desc] = row[col.name];
45664
46154
  }
45665
46155
  });
@@ -45667,10 +46157,33 @@ const {
45667
46157
  });
45668
46158
  return exportData;
45669
46159
  },
46160
+ getConfirmValue(rows, count) {
46161
+ return new Promise(resolve => {
46162
+ this.$confirm(`导出数据量超出导出限制【${count}】,将导出${count}条,是否继续?`, '提示', {
46163
+ confirmButtonText: '确定',
46164
+ cancelButtonText: '取消',
46165
+ type: 'warning'
46166
+ }).then(() => {
46167
+ resolve(rows.slice(0, count));
46168
+ }).catch(() => {
46169
+ resolve(false);
46170
+ });
46171
+ });
46172
+ },
45670
46173
  handleCommand(type) {
45671
46174
  const pInst = _utils_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].getOnlineFormInstance(this);
45672
46175
  _services_SubPagination_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].exportData(this.dataSubname, type, pInst, this.subtablePagination).then(async data => {
45673
46176
  data = JSON.parse(JSON.stringify(data));
46177
+ if (this.exportMaxRow && Number(this.exportMaxRow) < data.length) {
46178
+ let result = await this.getConfirmValue(data, Number(this.exportMaxRow));
46179
+ if (result === false) {
46180
+ return;
46181
+ }
46182
+ data = result;
46183
+ }
46184
+ if (this.exportFieldTransformData) {
46185
+ data = await this.transformFieldData(data);
46186
+ }
45674
46187
  // 导出时 字典转换
45675
46188
  await this.changeDictionary(data);
45676
46189
  let exportData = this.changeRowKey(data);
@@ -46412,17 +46925,6 @@ _main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].register({
46412
46925
 
46413
46926
  // extracted by mini-css-extract-plugin
46414
46927
 
46415
- /***/ }),
46416
-
46417
- /***/ "e25e":
46418
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
46419
-
46420
- "use strict";
46421
- /* 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");
46422
- /* 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__);
46423
- /* unused harmony reexport * */
46424
-
46425
-
46426
46928
  /***/ }),
46427
46929
 
46428
46930
  /***/ "e323":