@tongfun/tf-widget 0.1.98 → 0.1.99

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.
@@ -144225,8 +144225,10 @@ function download(fileName, data) {
144225
144225
  this.initTable();
144226
144226
  },
144227
144227
  activated: function activated() {
144228
- document.querySelector('.ag-body-viewport').addEventListener('scroll', (0,utils/* debounceFun */.u1)(this.scrollFn));
144229
- document.querySelector('.ag-body-viewport').scrollTop = this.scrollTop;
144228
+ try {
144229
+ document.querySelector('.ag-body-viewport').addEventListener('scroll', (0,utils/* debounceFun */.u1)(this.scrollFn));
144230
+ document.querySelector('.ag-body-viewport').scrollTop = this.scrollTop; // eslint-disable-next-line no-empty
144231
+ } catch (e) {}
144230
144232
  },
144231
144233
  deactivated: function deactivated() {
144232
144234
  window.removeEventListener('scroll', this.scrollFn);
@@ -144740,7 +144742,7 @@ function download(fileName, data) {
144740
144742
  return _this10.operationCommand(tf_table/* commit */.th, '提交', ids);
144741
144743
 
144742
144744
  case 6:
144743
- _context8.next = 21;
144745
+ _context8.next = 19;
144744
144746
  break;
144745
144747
 
144746
144748
  case 8:
@@ -144753,7 +144755,7 @@ function download(fileName, data) {
144753
144755
  return _this10.operationCommand(tf_table/* check */.BF, '审核', ids);
144754
144756
 
144755
144757
  case 11:
144756
- _context8.next = 21;
144758
+ _context8.next = 19;
144757
144759
  break;
144758
144760
 
144759
144761
  case 13:
@@ -144766,22 +144768,51 @@ function download(fileName, data) {
144766
144768
  return _this10.operationCommand(tf_table/* checkReverse */.P9, '反审核', ids);
144767
144769
 
144768
144770
  case 16:
144769
- _context8.next = 21;
144771
+ _context8.next = 19;
144770
144772
  break;
144771
144773
 
144772
144774
  case 18:
144773
- if (!(command === 'delete')) {
144774
- _context8.next = 21;
144775
- break;
144776
- }
144775
+ if (command === 'delete') {
144776
+ _this10.$confirm('确认审核吗?', '提示', {
144777
+ confirmButtonText: '确定',
144778
+ cancelButtonText: '取消',
144779
+ type: 'warning'
144780
+ }).then(function () {
144781
+ var loading = _this10.$loading({
144782
+ lock: true,
144783
+ text: 'Loading',
144784
+ spinner: 'el-icon-loading',
144785
+ background: 'rgba(0, 0, 0, 0.7)'
144786
+ });
144777
144787
 
144778
- _context8.next = 21;
144779
- return _this10.operationCommand(tf_table/* deleted */.z2, '删除', ids);
144788
+ var data = {
144789
+ deleteIds: ids,
144790
+ code: _this10.code
144791
+ };
144792
+ (0,tf_table/* deleted */.z2)(data).then(function (res) {
144793
+ if (res.code === 0) {
144794
+ _this10.$message.success('删除成功!'); // 刷新表格数据
144780
144795
 
144781
- case 21:
144796
+
144797
+ _this10.refreshData();
144798
+ } else {
144799
+ _this10.$message.warning(res.errorMsg || '删除失败,请稍后重试!');
144800
+ }
144801
+
144802
+ loading.close();
144803
+ }).catch(function () {
144804
+ _this10.$message.warning('删除失败,请稍后重试!');
144805
+
144806
+ loading.close();
144807
+ });
144808
+ }); // await this.operationCommand(deleted, '删除', ids)
144809
+
144810
+ }
144811
+
144812
+ case 19:
144782
144813
  _this10.loadingObj[command + 'Loading'] = false;
144783
144814
 
144784
- case 22:
144815
+ case 20:
144785
144816
  case "end":
144786
144817
  return _context8.stop();
144787
144818
  }
@@ -238150,9 +238181,9 @@ var tf_settingvue_type_template_id_2b5c0bbe_scoped_true_render = function () {va
238150
238181
  var tf_settingvue_type_template_id_2b5c0bbe_scoped_true_staticRenderFns = []
238151
238182
 
238152
238183
 
238153
- ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=template&id=5e738f05&scoped=true&
238154
- var tf_setting_formvue_type_template_id_5e738f05_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tf-setting-form-content"},[_c('div',{staticClass:"tf-header-group"},[_c('div',{staticClass:"tf-search-text"},[_c('el-input',{attrs:{"placeholder":"搜索字段名称"},on:{"change":_vm.handleSearchField},model:{value:(_vm.searchContent),callback:function ($$v) {_vm.searchContent=$$v},expression:"searchContent"}},[_c('i',{staticClass:"el-input__icon el-icon-search",attrs:{"slot":"prefix"},slot:"prefix"})])],1),_c('TfButtonGroup',[_vm._t("showChange",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('showChange')}}},[_vm._v("显示切换")])]}),_vm._t("fixedChange",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('freeze')}}},[_vm._v("冻结固定")])]}),_vm._t("recover",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('recover')}}},[_vm._v("恢复默认")])]}),_vm._t("save",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini","loading":_vm.saveLoading},on:{"click":function($event){return _vm.handlerButtons('save')}}},[_vm._v("保存")])]}),_vm._t("close",function(){return [_c('el-button',{attrs:{"type":"danger","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('close')}}},[_vm._v("关闭")])]})],2)],1),_c('div',{staticClass:"tf-common-table"},[_c('TfAgGridTable',{ref:"settingTable",attrs:{"columns":_vm.mainColumns,"table-data":_vm.tableData,"row-drag-managed":true,"row-drag-entire-row":true,"row-drag-multi-row":true},on:{"rowDragEnd":_vm.rowDragEnd,"handleChangeCellValue":_vm.handleChangeCellValue,"sortRow":_vm.sortRow,"selectChange":_vm.selectChange}})],1)])}
238155
- var tf_setting_formvue_type_template_id_5e738f05_scoped_true_staticRenderFns = []
238184
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=template&id=3c8f0d24&scoped=true&
238185
+ var tf_setting_formvue_type_template_id_3c8f0d24_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tf-setting-form-content"},[_c('div',{staticClass:"tf-header-group"},[_c('div',{staticClass:"tf-search-text"},[_c('el-input',{attrs:{"placeholder":"搜索字段名称"},on:{"change":_vm.handleSearchField},model:{value:(_vm.searchContent),callback:function ($$v) {_vm.searchContent=$$v},expression:"searchContent"}},[_c('i',{staticClass:"el-input__icon el-icon-search",attrs:{"slot":"prefix"},slot:"prefix"})])],1),_c('TfButtonGroup',[_vm._t("showChange",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('showChange')}}},[_vm._v("显示切换")])]}),_vm._t("fixedChange",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('freeze')}}},[_vm._v("冻结固定")])]}),_vm._t("recover",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('recover')}}},[_vm._v("恢复默认")])]}),_vm._t("save",function(){return [_c('el-button',{attrs:{"type":"primary","size":"mini","loading":_vm.saveLoading},on:{"click":function($event){return _vm.handlerButtons('save')}}},[_vm._v("保存")])]}),_vm._t("close",function(){return [_c('el-button',{attrs:{"type":"danger","size":"mini"},on:{"click":function($event){return _vm.handlerButtons('close')}}},[_vm._v("关闭")])]})],2)],1),_c('div',{staticClass:"tf-common-table"},[_c('TfAgGridTable',{ref:"settingTable",attrs:{"columns":_vm.mainColumns,"table-data":_vm.tableData,"row-drag-managed":true,"row-drag-entire-row":true,"row-drag-multi-row":true},on:{"rowDragEnd":_vm.rowDragEnd,"handleChangeCellValue":_vm.handleChangeCellValue,"sortRow":_vm.sortRow,"selectChange":_vm.selectChange}})],1)])}
238186
+ var tf_setting_formvue_type_template_id_3c8f0d24_scoped_true_staticRenderFns = []
238156
238187
 
238157
238188
 
238158
238189
  // EXTERNAL MODULE: ./package/tf-ag-grid-table/index.js + 22 modules
@@ -238168,6 +238199,8 @@ var tf_ag_grid_table = __webpack_require__(876);
238168
238199
 
238169
238200
 
238170
238201
 
238202
+
238203
+
238171
238204
  //
238172
238205
  //
238173
238206
  //
@@ -238449,76 +238482,136 @@ var tf_ag_grid_table = __webpack_require__(876);
238449
238482
  handlerButtons: function handlerButtons(option) {
238450
238483
  var _this3 = this;
238451
238484
 
238452
- switch (option) {
238453
- case 'close':
238454
- {
238455
- this.$emit('close');
238456
- break;
238457
- }
238485
+ return (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/(0,regeneratorRuntime/* default */.Z)().mark(function _callee() {
238486
+ return (0,regeneratorRuntime/* default */.Z)().wrap(function _callee$(_context) {
238487
+ while (1) {
238488
+ switch (_context.prev = _context.next) {
238489
+ case 0:
238490
+ _context.t0 = option;
238491
+ _context.next = _context.t0 === 'close' ? 3 : _context.t0 === 'showChange' ? 5 : _context.t0 === 'freeze' ? 8 : _context.t0 === 'recover' ? 11 : _context.t0 === 'save' ? 13 : 20;
238492
+ break;
238458
238493
 
238459
- case 'showChange':
238460
- {
238461
- this.tableData.map(function (item) {
238462
- if (_this3.selectRows.find(function (row) {
238463
- return row.field === item.field;
238464
- })) {
238465
- item.isShow = !item.isShow;
238466
- }
238467
- });
238468
- this.$refs.settingTable.gridApi.refreshCells();
238469
- break;
238470
- }
238494
+ case 3:
238495
+ _this3.$emit('close');
238471
238496
 
238472
- case 'freeze':
238473
- {
238474
- this.tableData.map(function (item) {
238475
- if (_this3.selectRows.find(function (row) {
238476
- return row.field === item.field;
238477
- })) {
238478
- item.isFreeze = !item.isFreeze;
238479
- }
238480
- });
238481
- this.$refs.settingTable.gridApi.refreshCells();
238482
- break;
238483
- }
238497
+ return _context.abrupt("break", 20);
238484
238498
 
238485
- case 'recover':
238486
- {
238487
- this.tableData = JSON.parse(JSON.stringify(this.defaultCongfigList));
238488
- break;
238489
- }
238499
+ case 5:
238500
+ _this3.tableData.map(function (item) {
238501
+ if (_this3.selectRows.find(function (row) {
238502
+ return row.field === item.field;
238503
+ })) {
238504
+ item.isShow = !item.isShow;
238505
+ }
238506
+ });
238490
238507
 
238491
- case 'save':
238492
- {
238493
- this.saveLoading = true;
238494
- this.tableData.map(function (item, index) {
238495
- item.fieldIndex = index + 1;
238496
- });
238497
- this.$emit('save', this.tableData);
238498
- break;
238508
+ _this3.$refs.settingTable.gridApi.refreshCells();
238509
+
238510
+ return _context.abrupt("break", 20);
238511
+
238512
+ case 8:
238513
+ _this3.tableData.map(function (item) {
238514
+ if (_this3.selectRows.find(function (row) {
238515
+ return row.field === item.field;
238516
+ })) {
238517
+ item.isFreeze = !item.isFreeze;
238518
+ }
238519
+ });
238520
+
238521
+ _this3.$refs.settingTable.gridApi.refreshCells();
238522
+
238523
+ return _context.abrupt("break", 20);
238524
+
238525
+ case 11:
238526
+ _this3.tableData = JSON.parse(JSON.stringify(_this3.defaultCongfigList));
238527
+ return _context.abrupt("break", 20);
238528
+
238529
+ case 13:
238530
+ _this3.saveLoading = true;
238531
+ _context.next = 16;
238532
+ return _this3.handleTableData();
238533
+
238534
+ case 16:
238535
+ _this3.searchContent = '';
238536
+
238537
+ _this3.tableData.map(function (item, index) {
238538
+ item.fieldIndex = index + 1;
238539
+ });
238540
+
238541
+ _this3.$emit('save', _this3.tableData);
238542
+
238543
+ return _context.abrupt("break", 20);
238544
+
238545
+ case 20:
238546
+ case "end":
238547
+ return _context.stop();
238548
+ }
238499
238549
  }
238500
- }
238550
+ }, _callee);
238551
+ }))();
238501
238552
  },
238502
238553
 
238503
238554
  /** 搜索字段 */
238504
238555
  handleSearchField: function handleSearchField(value) {
238505
238556
  if (!value) {
238506
- this.tableData = this.originalTableData;
238557
+ this.handleTableData();
238507
238558
  } else {
238508
238559
  this.originalTableData = JSON.parse(JSON.stringify(this.tableData));
238509
238560
  this.tableData = this.tableData.filter(function (item) {
238510
238561
  return item.label.includes(value);
238511
238562
  });
238512
238563
  }
238564
+ },
238565
+
238566
+ /** 搜索字段并更改保存 */
238567
+ handleTableData: function handleTableData() {
238568
+ var _this4 = this;
238569
+
238570
+ return (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/(0,regeneratorRuntime/* default */.Z)().mark(function _callee2() {
238571
+ var originalTableData;
238572
+ return (0,regeneratorRuntime/* default */.Z)().wrap(function _callee2$(_context2) {
238573
+ while (1) {
238574
+ switch (_context2.prev = _context2.next) {
238575
+ case 0:
238576
+ if (!(_this4.originalTableData.length === _this4.tableData.length)) {
238577
+ _context2.next = 2;
238578
+ break;
238579
+ }
238580
+
238581
+ return _context2.abrupt("return");
238582
+
238583
+ case 2:
238584
+ // 处理用户搜索字段后,修改table值
238585
+ originalTableData = JSON.parse(JSON.stringify(_this4.originalTableData));
238586
+
238587
+ _this4.tableData.map(function (item) {
238588
+ originalTableData = originalTableData.map(function (data) {
238589
+ if (item.field === data.field) {
238590
+ return item;
238591
+ } else {
238592
+ return data;
238593
+ }
238594
+ });
238595
+ });
238596
+
238597
+ _this4.tableData = originalTableData;
238598
+
238599
+ case 5:
238600
+ case "end":
238601
+ return _context2.stop();
238602
+ }
238603
+ }
238604
+ }, _callee2);
238605
+ }))();
238513
238606
  }
238514
238607
  }
238515
238608
  });
238516
238609
  ;// CONCATENATED MODULE: ./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=script&lang=js&
238517
238610
  /* harmony default export */ var components_tf_setting_formvue_type_script_lang_js_ = (tf_setting_formvue_type_script_lang_js_);
238518
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-63[0].rules[0].use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=style&index=0&id=5e738f05&lang=scss&scoped=true&
238611
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-63[0].rules[0].use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-63[0].rules[0].use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=style&index=0&id=3c8f0d24&lang=scss&scoped=true&
238519
238612
  // extracted by mini-css-extract-plugin
238520
238613
 
238521
- ;// CONCATENATED MODULE: ./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=style&index=0&id=5e738f05&lang=scss&scoped=true&
238614
+ ;// CONCATENATED MODULE: ./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue?vue&type=style&index=0&id=3c8f0d24&lang=scss&scoped=true&
238522
238615
 
238523
238616
  ;// CONCATENATED MODULE: ./package/tf-table-list/src/components/tf-header-button/components/tf-setting/components/tf-setting-form/index.vue
238524
238617
 
@@ -238531,11 +238624,11 @@ var tf_ag_grid_table = __webpack_require__(876);
238531
238624
 
238532
238625
  var tf_setting_form_component = (0,componentNormalizer/* default */.Z)(
238533
238626
  components_tf_setting_formvue_type_script_lang_js_,
238534
- tf_setting_formvue_type_template_id_5e738f05_scoped_true_render,
238535
- tf_setting_formvue_type_template_id_5e738f05_scoped_true_staticRenderFns,
238627
+ tf_setting_formvue_type_template_id_3c8f0d24_scoped_true_render,
238628
+ tf_setting_formvue_type_template_id_3c8f0d24_scoped_true_staticRenderFns,
238536
238629
  false,
238537
238630
  null,
238538
- "5e738f05",
238631
+ "3c8f0d24",
238539
238632
  null
238540
238633
 
238541
238634
  )