meixioacomponent 0.3.44 → 0.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.3.44",
3
+ "version": "0.3.45",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -244,6 +244,9 @@ export default {
244
244
  borderRow: true,
245
245
  // 倒计时
246
246
  triggerDown: null,
247
+
248
+ // 组件销毁时重置的class 配合 LinkViewClass使用
249
+ _linkViewClassSubs: null,
247
250
  }
248
251
  },
249
252
  created() {
@@ -256,6 +259,9 @@ export default {
256
259
  beforeDestroy() {
257
260
  componentConfig.eventBus.$off('handleTableBorder', this.handleTableBorder)
258
261
  clearTimeout(this.triggerDown)
262
+ if (this._linkViewClassSubs) {
263
+ this._linkViewClassSubs.init()
264
+ }
259
265
  },
260
266
  computed: {
261
267
  config() {
@@ -638,7 +644,22 @@ export default {
638
644
 
639
645
  let screenResult = this.returnProScreenResult()
640
646
  this.$props.httpRequire(screenResult).then((res) => {
641
- this.setTableData(res)
647
+ let isArray = res instanceof Array
648
+ if (isArray) {
649
+ this.setTableData(res)
650
+ } else {
651
+ const tableData = res.tableData
652
+ if (
653
+ res._class.__proto__.__proto__.constructor.name ==
654
+ 'LinkViewClass' &&
655
+ !this._linkViewClassSubs
656
+ ) {
657
+ this._linkViewClassSubs = res._class
658
+ }
659
+ if (tableData) {
660
+ this.setTableData(tableData)
661
+ }
662
+ }
642
663
  })
643
664
  },
644
665
  // 设置表格数据
@@ -787,7 +808,6 @@ export default {
787
808
  })
788
809
  },
789
810
  sortChange(column) {
790
- console.log('sort')
791
811
  this.tableData = this.tableData.sort(
792
812
  this.sortFun(
793
813
  column.prop,
@@ -823,7 +843,6 @@ export default {
823
843
  return index == tableConfig.length - 1
824
844
  },
825
845
  },
826
- watch: {},
827
846
  }
828
847
  </script>
829
848
 
@@ -311,8 +311,8 @@ export default {
311
311
  }
312
312
  </style> -->
313
313
 
314
- <!-- <template>
315
- <div class="page-table-wrap" ref="pageTableWrap">
314
+ <template>
315
+ <div class="page-table-wrap" ref="pageTableWrap" v-if="show">
316
316
  <base-pro-table
317
317
  :align="`left`"
318
318
  v-model="keyWords"
@@ -326,9 +326,9 @@ export default {
326
326
  :headerConfig="headerConfig"
327
327
  :totalPropsList="totalPropsList"
328
328
  :proScreenConfig="proScreenConfig"
329
- > -->
330
- <!-- 表格头部插槽 -->
331
- <!-- <template>
329
+ >
330
+ <!-- 表格头部插槽 -->
331
+ <template>
332
332
  <base-icon
333
333
  :color="`m`"
334
334
  :event="true"
@@ -357,17 +357,19 @@ export default {
357
357
  <el-dropdown-item>蚵仔煎</el-dropdown-item>
358
358
  </el-dropdown-menu>
359
359
  </el-dropdown>
360
- </template> -->
360
+ </template>
361
361
 
362
- <!-- 自定义模板列 -->
363
- <!-- <template v-slot:name="data">template-{{ data.scope }}</template>
362
+ <!-- 自定义模板列 -->
363
+ <template v-slot:name="data">template-{{ data.scope }}</template>
364
364
  <template v-slot:address="data">template-{{ data.scope }}</template>
365
365
  </base-pro-table>
366
366
  </div>
367
- </template> -->
368
- <!--
367
+ </template>
368
+
369
369
  <script>
370
370
  import tableTable from '../test'
371
+ import companyInfoConfig from '../config/CompanyInfoConfig'
372
+ import componentConfig from '../../packages/config/componentConfig'
371
373
  export default {
372
374
  data() {
373
375
  return {
@@ -424,19 +426,9 @@ export default {
424
426
  },
425
427
  ],
426
428
 
427
- // 分页属性
428
- /* 分页属性 */
429
- pageProps: {
430
- pageSize: 15,
431
- pageNum: 1,
432
- total: 100,
433
- },
434
- // 分页配置
435
- pageConfig: {
436
- size: 'pageSize',
437
- page: 'pageNum',
438
- total: 'total',
439
- },
429
+ show: true,
430
+
431
+ one: true,
440
432
  }
441
433
  },
442
434
  created() {
@@ -521,13 +513,25 @@ export default {
521
513
  mounted() {
522
514
  this.pageHeight = this.$refs.pageTableWrap.clientHeight
523
515
  },
516
+ computed: {
517
+ pageProps() {
518
+ return companyInfoConfig.getPageProps()
519
+ },
520
+ pageConfig() {
521
+ return companyInfoConfig.getPageConfig()
522
+ },
523
+ },
524
524
  components: {},
525
525
  methods: {
526
526
  async httpRequire(screenCofig) {
527
- let result = null
527
+ companyInfoConfig.setTable()
528
528
  try {
529
- // result = await test(screenCofig)
530
- this.pageProps.total = 20
529
+ // result = await test(screenCofig);
530
+ if (this.one) {
531
+ this.pageProps.total = 100
532
+ } else {
533
+ this.pageProps.total = 20
534
+ }
531
535
  } catch (error) {
532
536
  return new Promise((resolve, reject) => {
533
537
  this.pageProps.total = 0
@@ -535,7 +539,7 @@ export default {
535
539
  })
536
540
  }
537
541
  return new Promise((resolve, reject) => {
538
- resolve(tableTable)
542
+ resolve(companyInfoConfig.getTableData())
539
543
  })
540
544
  },
541
545
  rowClick(row) {
@@ -551,174 +555,9 @@ export default {
551
555
  height: 100%;
552
556
  background: inherit;
553
557
  }
554
- </style> -->
558
+ </style>
555
559
 
556
560
  <!-- 普通表单 -->
557
- <template>
558
- <div class="add-company-step-two-wrap">
559
- <base-form
560
- :footer="false"
561
- :rules="rules"
562
- :rowNumber="1"
563
- @onCancel="onCancel"
564
- v-model="formList"
565
- :labelWidth="`200px`"
566
- :labelPosition="`right`"
567
- @formSubmit="formSubmit"
568
- >
569
- <template v-slot:form-businessLicense="data">
570
- <div class="upload-wrap">
571
- <base-upload-item
572
- :shape="`pro`"
573
- :fileType="`img`"
574
- @uploadEd="uploadEd"
575
- :uploadType="`single`"
576
- v-model="data.scope[3].value"
577
- ></base-upload-item>
578
- </div>
579
- </template>
580
- <template v-slot:form-idPositive="data">
581
- <div class="upload-wrap">
582
- <base-upload-item
583
- :shape="`pro`"
584
- :fileType="`img`"
585
- @uploadEd="uploadEd"
586
- :uploadType="`single`"
587
- v-model="data.scope[4].value"
588
- ></base-upload-item>
589
- </div>
590
- </template>
591
- <template v-slot:form-idBack="data">
592
- <div class="upload-wrap">
593
- <base-upload-item
594
- :shape="`pro`"
595
- :fileType="`img`"
596
- @uploadEd="uploadEd"
597
- :uploadType="`single`"
598
- v-model="data.scope[5].value"
599
- ></base-upload-item>
600
- </div>
601
- </template>
602
- </base-form>
603
- </div>
604
- </template>
605
-
606
- <script>
607
- export default {
608
- data() {
609
- return {
610
- formList: [
611
- {
612
- value: '',
613
- key: 'companyName',
614
- type: 'input',
615
- label: '企业名称',
616
- },
617
- {
618
- value: '',
619
- key: 'companyAddress',
620
- type: 'area',
621
- label: '通讯地址',
622
- },
623
- {
624
- value: '',
625
- key: 'companyDetail',
626
- type: 'textarea',
627
- label: '详细地址',
628
- },
629
- {
630
- value: [],
631
- key: 'businessLicense',
632
- type: 'template',
633
- label: '营业执照正面彩照',
634
- },
635
- {
636
- value: [],
637
- key: 'idPositive',
638
- type: 'template',
639
- label: '法人身份证人像照',
640
- },
641
- {
642
- value: [],
643
- key: 'idBack',
644
- type: 'template',
645
- label: '法人身份证国徽照',
646
- },
647
- ],
648
- rules: {
649
- companyName: [
650
- {
651
- required: true,
652
- message: '请输入企业名称',
653
- trigger: 'blur',
654
- },
655
- ],
656
- companyAddress: [
657
- {
658
- required: true,
659
- message: '请输入通讯地址',
660
- trigger: 'blur',
661
- },
662
- ],
663
- companyDetail: [
664
- {
665
- required: true,
666
- message: '请输入详细地址',
667
- trigger: 'blur',
668
- },
669
- ],
670
- businessLicense: [
671
- {
672
- required: true,
673
- message: '请上传营业彩照',
674
- trigger: 'blur',
675
- },
676
- ],
677
- idPositive: [
678
- {
679
- required: true,
680
- message: '请上传法人身份证人像照',
681
- trigger: 'blur',
682
- },
683
- ],
684
- idBack: [
685
- {
686
- required: true,
687
- message: '请上传法人身份证国徽照',
688
- trigger: 'blur',
689
- },
690
- ],
691
- },
692
- }
693
- },
694
- methods: {
695
- onCancel() {},
696
- formSubmit() {},
697
- uploadEd(value) {
698
- console.log(value)
699
- console.log(this.formList)
700
- },
701
- },
702
- }
703
- </script>
704
-
705
- <style lang="less" scoped>
706
- .add-company-step-two-wrap {
707
- width: 60%;
708
- height: 100%;
709
- overflow-y: auto;
710
- .upload-wrap {
711
- width: 100%;
712
- height: 170px;
713
- display: flex;
714
- align-items: center;
715
- justify-content: center;
716
- /deep/ .base-upload-item-wrap {
717
- margin: 0px;
718
- }
719
- }
720
- }
721
- </style>
722
561
 
723
562
  <!-- 上传表单 -->
724
563
  <!-- <template>
@@ -0,0 +1,26 @@
1
+ import { reactive } from 'vue'
2
+ import LinkViewClass from './linkViewClass'
3
+
4
+ class CompanyInfoConfig extends LinkViewClass {
5
+ constructor() {
6
+ super()
7
+ this.dynamicMount = null
8
+ this.drawerContent = null
9
+
10
+ this.tableData = []
11
+ }
12
+ setTable() {
13
+ this.tableData = [
14
+ { firmName: 1 },
15
+ { firmName: '这是一段八个字的文字' },
16
+ { firmName: 3 },
17
+ { firmName: 4 },
18
+ { firmName: 5 },
19
+ { firmName: 6 },
20
+ { firmName: 7 },
21
+ ]
22
+ }
23
+ }
24
+
25
+ const companyInfoConfig = reactive(new CompanyInfoConfig())
26
+ export default companyInfoConfig
@@ -0,0 +1,71 @@
1
+ class LinkViewClass {
2
+ constructor(params) {
3
+ this.tableData = []
4
+ this.refreshTableData = null
5
+ this.pageProps = {}
6
+ this.pageConfig = {}
7
+ this.activeIndex = 0
8
+ this.init()
9
+ }
10
+
11
+ init() {
12
+ this.tableData = []
13
+ this.activeIndex = 0
14
+ this.refreshTableData = null
15
+ this.pageProps = {
16
+ size: 15,
17
+ total: 100,
18
+ current: 1,
19
+ }
20
+ this.pageConfig = {
21
+ size: 'size',
22
+ page: 'current',
23
+ total: 'total',
24
+ }
25
+ }
26
+ onHandNextData() {
27
+ if (this.hasNextTableData()) {
28
+ this.activeIndex += 1
29
+ return
30
+ }
31
+ this.activeIndex = this.tableData.length - 1
32
+ }
33
+
34
+ onHandPreData() {
35
+ if (this.hasPreTableData()) {
36
+ this.activeIndex -= 1
37
+ }
38
+ this.activeIndex = 0
39
+ }
40
+
41
+ hasNextTableData() {
42
+ return this.tableData.length > 0
43
+ ? this.activeIndex == this.tableData.length - 1
44
+ ? false
45
+ : true
46
+ : false
47
+ }
48
+ hasPreTableData() {
49
+ return this.activeIndex <= 0 ? false : true
50
+ }
51
+ getTableDataForActiveIndex() {
52
+ return this.tableData[this.activeIndex]
53
+ }
54
+
55
+ getPageProps() {
56
+ return this.pageProps
57
+ }
58
+
59
+ getTableData() {
60
+ this.activeIndex = 0
61
+ return {
62
+ _class: this,
63
+ tableData: this.tableData,
64
+ }
65
+ }
66
+ getPageConfig() {
67
+ return this.pageConfig
68
+ }
69
+ }
70
+
71
+ export default LinkViewClass