@ajaxjs/ui 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- .datasource .left[data-v-79e01278]{float:left;width:28%;height:300px;border-right:1px solid #f5f5f5}.datasource .left ul[data-v-79e01278]{margin:0 2%}.datasource .left li[data-v-79e01278]{border-bottom:1px solid #eaeaea;padding:5px 8px;cursor:pointer}.datasource .left li[data-v-79e01278]:hover{border-bottom-color:#d3d3d3}.datasource .left li.actived[data-v-79e01278]{font-weight:700}.datasource .right[data-v-79e01278]{float:right;width:70%;padding-left:10px}.datasource .add[data-v-79e01278]{display:block;padding:5px 10px}.datasource .del-icon[data-v-79e01278]{float:right;margin-top:3px}.datasource .del-icon[data-v-79e01278]:hover{color:brown}
1
+ .datasource .left[data-v-79e01278]{float:left;width:28%;height:300px;border-right:1px solid #f5f5f5}.datasource .left ul[data-v-79e01278]{margin:0 2%}.datasource .left li[data-v-79e01278]{border-bottom:1px solid #eaeaea;padding:5px 8px;cursor:pointer}.datasource .left li[data-v-79e01278]:hover{border-bottom-color:#d3d3d3}.datasource .left li.actived[data-v-79e01278]{font-weight:700}.datasource .right[data-v-79e01278]{float:right;width:70%;padding-left:10px}.datasource .add[data-v-79e01278]{display:block;padding:5px 10px}.datasource .del-icon[data-v-79e01278]{float:right;margin-top:3px}.datasource .del-icon[data-v-79e01278]:hover{color:brown}.toolbar[data-v-75ca7672]{margin-bottom:20px;overflow:hidden}.toolbar .ivu-ml[data-v-75ca7672]{float:right;padding-top:10px}.ivu-mt.ivu-text-right[data-v-75ca7672]{text-align:right;margin-top:20px}.common-search-panel .ivu-input-type-text[data-v-75ca7672]{width:280px;margin:0 10px 16px 0}
@@ -460,6 +460,462 @@ var component = (0,componentNormalizer/* default */.A)(
460
460
 
461
461
  /***/ }),
462
462
 
463
+ /***/ 5747:
464
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
465
+
466
+ "use strict";
467
+ // ESM COMPAT FLAG
468
+ __webpack_require__.r(__webpack_exports__);
469
+
470
+ // EXPORTS
471
+ __webpack_require__.d(__webpack_exports__, {
472
+ "default": function() { return /* binding */ fast_iview_table; }
473
+ });
474
+
475
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/iview-ext/fast-iview-table.vue?vue&type=template&id=75ca7672&scoped=true
476
+ var render = function render() {
477
+ var _vm = this,
478
+ _c = _vm._self._c,
479
+ _setup = _vm._self._setupProxy;
480
+ return _c('div', [_c('Card', {
481
+ staticClass: "common-search-panel",
482
+ staticStyle: {
483
+ "text-align": "left"
484
+ },
485
+ attrs: {
486
+ "bordered": false,
487
+ "dis-hover": ""
488
+ }
489
+ }, [_c('span', {
490
+ staticStyle: {
491
+ "float": "right"
492
+ }
493
+ }, [_c('Button', {
494
+ attrs: {
495
+ "type": "primary",
496
+ "icon": "ios-search"
497
+ },
498
+ on: {
499
+ "click": function ($event) {
500
+ return _vm.$parent.getData();
501
+ }
502
+ }
503
+ }, [_vm._v("查询")]), _c('Button', {
504
+ staticStyle: {
505
+ "margin-left": "10px"
506
+ },
507
+ on: {
508
+ "click": _vm.reset
509
+ }
510
+ }, [_vm._v("重置")])], 1), _c('Input', {
511
+ attrs: {
512
+ "suffix": "ios-search",
513
+ "clearable": "",
514
+ "placeholder": '请输入' + _vm.widgetName_ + '名称'
515
+ },
516
+ on: {
517
+ "on-enter": _vm.getData
518
+ },
519
+ model: {
520
+ value: _vm.list.search.name,
521
+ callback: function ($$v) {
522
+ _vm.$set(_vm.list.search, "name", $$v);
523
+ },
524
+ expression: "list.search.name"
525
+ }
526
+ })], 1), _c('div', [_c('Card', {
527
+ attrs: {
528
+ "bordered": false,
529
+ "dis-hover": ""
530
+ }
531
+ }, [_c('div', {
532
+ staticClass: "toolbar"
533
+ }, [_c('Tooltip', {
534
+ staticClass: "ivu-ml",
535
+ attrs: {
536
+ "content": "刷新",
537
+ "placement": "top"
538
+ }
539
+ }, [_c('Icon', {
540
+ staticStyle: {
541
+ "cursor": "pointer"
542
+ },
543
+ attrs: {
544
+ "size": "20",
545
+ "type": "ios-refresh"
546
+ },
547
+ on: {
548
+ "click": _vm.getData
549
+ }
550
+ })], 1), _vm._t("toolbar"), !!_vm.createRoute || !!_vm.$parent.onCreate ? _c('Button', {
551
+ attrs: {
552
+ "type": "primary",
553
+ "icon": "md-add"
554
+ },
555
+ on: {
556
+ "click": _vm.onCreate
557
+ }
558
+ }, [_vm._v("新建" + _vm._s(_vm.widgetName_))]) : _vm._e()], 2), _c('Table', {
559
+ attrs: {
560
+ "columns": _vm.list.columns,
561
+ "data": _vm.list.data,
562
+ "loading": _vm.list.loading,
563
+ "height": "500"
564
+ },
565
+ scopedSlots: _vm._u([{
566
+ key: "action",
567
+ fn: function ({
568
+ row,
569
+ index
570
+ }) {
571
+ return [_vm._t("list_action", null, {
572
+ "item": row
573
+ }), _vm.pickup ? _c('a', {
574
+ staticStyle: {
575
+ "color": "green"
576
+ },
577
+ on: {
578
+ "click": function ($event) {
579
+ return _vm.doPickup(row);
580
+ }
581
+ }
582
+ }, [_vm._v("选择")]) : _vm._e(), !_vm.pickup ? _c('span', [_c('a', {
583
+ staticStyle: {
584
+ "color": "green"
585
+ },
586
+ on: {
587
+ "click": function ($event) {
588
+ return _vm.onEdit(row.id);
589
+ }
590
+ }
591
+ }, [_vm._v("编辑")]), _c('Divider', {
592
+ attrs: {
593
+ "type": "vertical"
594
+ }
595
+ }), _c('Poptip', {
596
+ attrs: {
597
+ "confirm": "",
598
+ "transfer": "",
599
+ "title": "是否要删除此行?"
600
+ },
601
+ on: {
602
+ "on-ok": function ($event) {
603
+ return _vm.deleteInfo(row.id, index);
604
+ }
605
+ }
606
+ }, [_c('a', {
607
+ staticStyle: {
608
+ "color": "red"
609
+ }
610
+ }, [_vm._v("删除")])])], 1) : _vm._e()];
611
+ }
612
+ }], null, true)
613
+ }), _c('Page', {
614
+ staticClass: "ivu-mt ivu-text-right",
615
+ attrs: {
616
+ "total": _vm.list.total,
617
+ "current": _vm.list.pageNo,
618
+ "show-total": "",
619
+ "show-sizer": "",
620
+ "page-size": _vm.list.limit
621
+ },
622
+ on: {
623
+ "update:current": function ($event) {
624
+ return _vm.$set(_vm.list, "pageNo", $event);
625
+ },
626
+ "on-page-size-change": _vm.handleChangePageSize
627
+ }
628
+ })], 1)], 1)], 1);
629
+ };
630
+ var staticRenderFns = [];
631
+
632
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
633
+ var es_array_push = __webpack_require__(4114);
634
+ // EXTERNAL MODULE: ./node_modules/@ajaxjs/util/dist/index.esm.js
635
+ var index_esm = __webpack_require__(8030);
636
+ ;// CONCATENATED MODULE: ./src/iview-ext/list.ts
637
+
638
+ /* harmony default export */ var list = ({
639
+ afterDelete(cb) {
640
+ return function (j) {
641
+ if (j.status) {
642
+ cb && cb(j);
643
+ this.$Message.success('删除成功');
644
+ } else this.$Message.info('删除失败。' + j.message);
645
+ };
646
+ },
647
+ delInfo(index) {
648
+ index_esm/* Xhr */.TF.xhr_del(`${this.API}/${this.list.data[index].id}`, j => {
649
+ if (j.status) {
650
+ this.list.data.splice(index, 1);
651
+ this.list.total--;
652
+ this.$Message.success('删除成功');
653
+ } else this.$Message.info('删除失败。' + j.message);
654
+ });
655
+ },
656
+ /**
657
+ * id 列
658
+ */
659
+ id: {
660
+ title: '#',
661
+ width: 60,
662
+ key: 'id',
663
+ align: 'center'
664
+ },
665
+ /**
666
+ * 创建日期
667
+ */
668
+ createDate: {
669
+ title: '创建日期',
670
+ /* key: 'createDate', */width: 160,
671
+ align: 'center',
672
+ render(h, params) {
673
+ return h('div', index_esm/* Utils */.Aq.dateFormat.call(new Date(params.row.createDate), 'yyyy-MM-dd hh:mm'));
674
+ }
675
+ },
676
+ /**
677
+ * 分类标签
678
+ */
679
+ tags: {
680
+ title: '分类标签',
681
+ minWidth: 100,
682
+ key: 'tagsNames',
683
+ align: 'center',
684
+ ellipsis: true
685
+ },
686
+ status: {
687
+ title: '状态',
688
+ width: 80,
689
+ render(h, params) {
690
+ let str = '',
691
+ color = '';
692
+ switch (params.row.stat) {
693
+ case -1:
694
+ str = '草稿';
695
+ color = 'gray';
696
+ break;
697
+ case 2:
698
+ color = 'red';
699
+ str = '禁用';
700
+ break;
701
+ case 1:
702
+ color = 'red';
703
+ str = '已删除';
704
+ break;
705
+ case null:
706
+ case 0:
707
+ default:
708
+ color = 'green';
709
+ str = "启用";
710
+ }
711
+ return h('div', {
712
+ style: {
713
+ color: color
714
+ }
715
+ }, str);
716
+ }
717
+ },
718
+ getPageList(self, listArray, callback) {
719
+ return j => {
720
+ if (j.status) {
721
+ listArray.total = j.data.total;
722
+ listArray.data = j.data.rows;
723
+ callback && callback();
724
+ } else self.$Message.warning(j.message || '获取数据失败');
725
+ };
726
+ },
727
+ copyBeanClean(bean) {
728
+ const deepCopy = JSON.parse(JSON.stringify(bean));
729
+ delete deepCopy.createDate;
730
+ delete deepCopy.updateDate;
731
+ delete deepCopy.updateDate;
732
+ delete deepCopy.creatorId;
733
+ delete deepCopy.updaterId;
734
+ delete deepCopy.creator;
735
+ delete deepCopy.updater;
736
+ delete deepCopy.extend;
737
+ return deepCopy;
738
+ }
739
+ });
740
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-86.use[2]!./src/iview-ext/fast-iview-table.ts?vue&type=script&lang=ts&external
741
+
742
+
743
+
744
+ /* harmony default export */ var fast_iview_tablevue_type_script_lang_ts_external = ({
745
+ props: {
746
+ widgetName: {
747
+ type: String,
748
+ required: false
749
+ },
750
+ apiUrl: {
751
+ type: String,
752
+ required: false
753
+ },
754
+ columnsDef: {
755
+ type: Array,
756
+ required: false
757
+ },
758
+ listApiUrl: {
759
+ type: String,
760
+ required: true
761
+ },
762
+ createRoute: {
763
+ type: String,
764
+ required: false
765
+ },
766
+ editRoute: {
767
+ type: String,
768
+ required: false
769
+ },
770
+ pickup: {
771
+ type: Boolean,
772
+ required: false
773
+ } // 编辑事件触发时候,进入的路由地址
774
+ },
775
+ data() {
776
+ return {
777
+ widgetName_: this.widgetName,
778
+ listApiUrl_: this.listApiUrl,
779
+ colDefId: 0,
780
+ list: {
781
+ columns: this.columnsDef || [],
782
+ data: [],
783
+ total: 0,
784
+ start: 0,
785
+ limit: 9,
786
+ pageNo: 1,
787
+ pageSize: 9,
788
+ loading: false,
789
+ search: {
790
+ name: ''
791
+ }
792
+ }
793
+ };
794
+ },
795
+ mounted() {
796
+ this.getData();
797
+ },
798
+ methods: {
799
+ getData() {
800
+ this.list.loading = true;
801
+ const params = {
802
+ pageNo: this.list.pageNo,
803
+ pageSize: this.list.pageSize
804
+ };
805
+ // if (this.list.search.name)
806
+ // params.where = `name LIKE '%${this.list.search.name}%'`;
807
+ this.listApiUrl_ && index_esm/* Xhr */.TF.xhr_get(this.listApiUrl_, j => {
808
+ this.list.loading = false;
809
+ if (j.status) {
810
+ this.list.data = j.data.rows;
811
+ this.list.total = j.data.total;
812
+ } else this.$Message.warning(j.message || '获取列表失败');
813
+ }, params);
814
+ },
815
+ /**
816
+ * 分页记录数
817
+ */
818
+ handleChangePageSize(pageSize) {
819
+ this.list.limit = pageSize;
820
+ this.getData();
821
+ },
822
+ reset() {
823
+ for (const i in this.search) this.search[i] = "";
824
+ this.getData();
825
+ },
826
+ /**
827
+ * 新建
828
+ */
829
+ onCreate() {
830
+ if (this.createRoute) this.$router.push({
831
+ path: this.createRoute
832
+ }); // 进入详情页,采用相对路径
833
+ else {
834
+ if (!this.$parent.onCreate) throw '请设置父组件的 onCreate 事件处理器';
835
+ this.$parent.onCreate();
836
+ }
837
+ },
838
+ /**
839
+ * 编辑
840
+ */
841
+ onEdit(id) {
842
+ if (this.editRoute) this.$router.push({
843
+ path: this.editRoute,
844
+ query: {
845
+ id
846
+ }
847
+ }); // 进入详情页,采用相对路径
848
+ else {
849
+ if (!this.$parent.onEdit) throw '请设置父组件的 onEdit 事件处理器';
850
+ this.$parent.onEdit(id);
851
+ }
852
+ },
853
+ doPickup(data) {
854
+ this.$emit("on-select", data);
855
+ },
856
+ deleteInfo(id, index) {
857
+ this.list.loading = true;
858
+ index_esm/* Xhr */.TF.xhr_del(`${this.apiUrl}/${id}`, list.afterDelete(() => {
859
+ this.list.data.splice(index, 1);
860
+ this.list.total--;
861
+ this.list.loading = false;
862
+ }).bind(this));
863
+ }
864
+ },
865
+ watch: {
866
+ listApiUrl(v) {
867
+ // debugger
868
+ this.listApiUrl_ = v;
869
+ this.getData();
870
+ },
871
+ /**
872
+ * 分页
873
+ *
874
+ * @param v
875
+ */
876
+ current(v) {
877
+ this.start = (v - 1) * this.list.limit;
878
+ this.getData();
879
+ },
880
+ 'list.pageNo'(v) {
881
+ this.list.start = (v - 1) * this.list.limit;
882
+ this.getData();
883
+ }
884
+ }
885
+ });
886
+ ;// CONCATENATED MODULE: ./src/iview-ext/fast-iview-table.ts?vue&type=script&lang=ts&external
887
+ /* harmony default export */ var iview_ext_fast_iview_tablevue_type_script_lang_ts_external = (fast_iview_tablevue_type_script_lang_ts_external);
888
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-57.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-57.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-57.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/iview-ext/fast-iview-table.vue?vue&type=style&index=0&id=75ca7672&prod&scoped=true&lang=css
889
+ // extracted by mini-css-extract-plugin
890
+
891
+ ;// CONCATENATED MODULE: ./src/iview-ext/fast-iview-table.vue?vue&type=style&index=0&id=75ca7672&prod&scoped=true&lang=css
892
+
893
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
894
+ var componentNormalizer = __webpack_require__(1656);
895
+ ;// CONCATENATED MODULE: ./src/iview-ext/fast-iview-table.vue
896
+
897
+
898
+
899
+ ;
900
+
901
+
902
+ /* normalize component */
903
+
904
+ var component = (0,componentNormalizer/* default */.A)(
905
+ iview_ext_fast_iview_tablevue_type_script_lang_ts_external,
906
+ render,
907
+ staticRenderFns,
908
+ false,
909
+ null,
910
+ "75ca7672",
911
+ null
912
+
913
+ )
914
+
915
+ /* harmony default export */ var fast_iview_table = (component.exports);
916
+
917
+ /***/ }),
918
+
463
919
  /***/ 2863:
464
920
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
465
921
 
@@ -942,6 +1398,7 @@ function normalizeComponent(
942
1398
  var map = {
943
1399
  "./data-source/data-source.vue": 9298,
944
1400
  "./iam/user.vue": 1700,
1401
+ "./iview-ext/fast-iview-table.vue": 5747,
945
1402
  "./iview-ext/table-selector.vue": 2863,
946
1403
  "./iview-ext/tips.vue": 629
947
1404
  };