shijiplus-web-plugin 0.1.10 → 0.1.12

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.
Files changed (28) hide show
  1. package/package.json +8 -4
  2. package/src/App.vue +3 -1
  3. package/src/components/plus-comp/index.js +15 -0
  4. package/src/components/plus-comp/permission-component/permission-component.vue +78 -0
  5. package/src/components/plus-comp/plus-card/plus-card.vue +21 -0
  6. package/src/components/plus-comp/plus-city-cascader/plus-city-cascader.vue +108 -0
  7. package/src/components/plus-comp/plus-common-header/plus-common-header.vue +58 -0
  8. package/src/components/plus-comp/plus-count-down/plus-count-down.vue +51 -0
  9. package/src/components/plus-comp/plus-drawer/plus-drawer.vue +116 -0
  10. package/src/components/plus-comp/plus-form/plus-form.vue +149 -0
  11. package/src/components/plus-comp/plus-icon/plus-icon.vue +91 -0
  12. package/src/components/plus-comp/plus-modal/plus-modal.vue +281 -0
  13. package/src/components/plus-comp/plus-poptip/plus-poptip.vue +42 -0
  14. package/src/components/plus-comp/plus-qr-code/plus-qr-code.vue +110 -0
  15. package/src/components/plus-comp/plus-remote-selector/plus-remote-selector.vue +126 -0
  16. package/src/components/plus-comp/plus-scrollview/plus-scrollview.vue +58 -0
  17. package/src/components/plus-comp/plus-select/plus-select.vue +118 -0
  18. package/src/components/plus-comp/plus-table/export-mixin.js +78 -0
  19. package/src/components/plus-comp/plus-table/plus-circle-progress-modal.vue +54 -0
  20. package/src/components/plus-comp/plus-table/plus-table.vue +568 -0
  21. package/src/components/plus-comp/plus-tabs/plus-tabs.vue +76 -0
  22. package/src/directive/index.js +2 -0
  23. package/src/directive/module/authAccess.js +2 -2
  24. package/src/extentionPlugin/index.js +5 -5
  25. package/src/extentionPlugin/string.js +30 -1
  26. package/src/libs/excel.js +203 -0
  27. package/src/libs/util.js +184 -0
  28. package/src/main.js +2 -0
@@ -0,0 +1,118 @@
1
+ <template>
2
+ <div class="plus-select-wrap">
3
+ <Select
4
+ ref="select"
5
+ v-model="mValue"
6
+ label-in-value
7
+ :disabled="disabled"
8
+ :placeholder="placeholder"
9
+ @on-change="valueChange"
10
+ >
11
+ <Option v-if="allOption" :value="-1">全部</Option>
12
+ <slot>
13
+ <Option
14
+ v-for="(option, index) in mOptions"
15
+ :key="index"
16
+ :value="option.value"
17
+ :label="option.label"
18
+ />
19
+ </slot>
20
+ </Select>
21
+ </div>
22
+ </template>
23
+ <script>
24
+ export default {
25
+ name: 'PlusSelect',
26
+ model: {
27
+ prop: 'modelValue',
28
+ event: 'change'
29
+ },
30
+ props: {
31
+ modelValue: {
32
+ type: [Number, String, Array]
33
+ },
34
+ disabled: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ allOption: {
39
+ default: true
40
+ },
41
+ valueKey: {
42
+ type: String,
43
+ default: 'value'
44
+ },
45
+ labelKeys: {
46
+ type: [String, Array],
47
+ default: 'label'
48
+ },
49
+ placeholder: {
50
+ type: String,
51
+ default: '请选择'
52
+ },
53
+ options: {
54
+ type: Array,
55
+ default() {
56
+ return []
57
+ }
58
+ }
59
+ },
60
+ watch: {
61
+ modelValue: {
62
+ handler(val) {
63
+ if (!val) {
64
+ this.mValue = -1
65
+ } else {
66
+ this.mValue = val
67
+ }
68
+ },
69
+ immediate: true,
70
+ deep: true
71
+ }
72
+ },
73
+ data() {
74
+ return {
75
+ mValue: null
76
+ }
77
+ },
78
+ computed: {
79
+ mOptions() {
80
+ return this.options.map((item) => {
81
+ let label = ''
82
+ let value = item[this.valueKey]
83
+ if (this.labelKeys) {
84
+ let tempKeys = this.labelKeys
85
+ if (typeof tempKeys == 'string') {
86
+ tempKeys = this.labelKeys.split(',')
87
+ }
88
+ tempKeys.forEach((lKey) => {
89
+ label += item[lKey]
90
+ })
91
+ }
92
+ return { label, value }
93
+ })
94
+ }
95
+ },
96
+ methods: {
97
+ valueChange(e) {
98
+ if (e) {
99
+ if (e.value == -1) {
100
+ this.$emit('change', null)
101
+ this.$emit('change-option', {})
102
+ } else {
103
+ this.$emit('change', e.value)
104
+ this.$emit('change-option', { ...e })
105
+ }
106
+ } else {
107
+ this.$emit('change', null)
108
+ this.$emit('change-option', {})
109
+ }
110
+ }
111
+ }
112
+ }
113
+ </script>
114
+ <style lang="less" scoped>
115
+ .plus-select-wrap {
116
+ position: relative;
117
+ }
118
+ </style>
@@ -0,0 +1,78 @@
1
+ import PlusCircleProgressModal from './plus-circle-progress-modal.vue'
2
+ export default {
3
+ data() {
4
+ return {
5
+ totalCount: 0,
6
+ orderExportModalPercent: 0,
7
+ orderExportPageSize: 100
8
+ }
9
+ },
10
+ methods: {
11
+ invokeExportExcel(searchForm, apiFunction) {
12
+ const checkExportDataTotal = (searchForm) => {
13
+ return apiFunction({
14
+ ...searchForm,
15
+ pageNo: 1,
16
+ currentPage: 1,
17
+ pageSize: 1
18
+ })
19
+ .then((res) => {
20
+ if (res && res.meta) {
21
+ this.totalCount = res.meta.totalCount
22
+ } else {
23
+ this.totalCount = (res.data || []).length
24
+ }
25
+ })
26
+ }
27
+ let exportData = []
28
+ const excelExportFun = (pageNo, pageSize, processUpdate) => {
29
+ return apiFunction({
30
+ ...searchForm,
31
+ currentPage: pageNo,
32
+ pageNo: pageNo,
33
+ pageSize: pageSize
34
+ }).then((res) => {
35
+ if (res && res.data) {
36
+ exportData.push(...res.data)
37
+ }
38
+ this.orderExportModalPercent = (exportData.length / (this.totalCount || 1) * 100).toFixed(2)
39
+ if (processUpdate) {
40
+ processUpdate(this.orderExportModalPercent)
41
+ }
42
+ if (exportData.length < this.totalCount) {
43
+ return excelExportFun(pageNo + 1, pageSize, processUpdate)
44
+ }
45
+ return exportData
46
+ }).catch((error) => {
47
+ console.log('--------error---------', error)
48
+ throw Error('导出失败')
49
+ })
50
+ }
51
+ return checkExportDataTotal(searchForm).then((res) => {
52
+ if (this.totalCount === 0) {
53
+ // 宏任务最后执行
54
+ setTimeout(() => {
55
+ this.$Message.error('暂无数据,请搜索后重试', 3)
56
+ }, 0)
57
+ return
58
+ }
59
+ const instance = this.$getComponentInstance(PlusCircleProgressModal)
60
+ instance.$on('on-close', (e) => {
61
+ setTimeout(() => {
62
+ this.$removeVComp(instance)
63
+ }, 500)
64
+ })
65
+ instance.show()
66
+ return excelExportFun(1, this.orderExportPageSize, (process) => {
67
+ instance.updatePercent(process)
68
+ }).catch(() => {
69
+ // 宏任务最后执行
70
+ setTimeout(() => {
71
+ this.$Message.error('导出失败', 3)
72
+ this.$removeVComp(instance)
73
+ }, 0)
74
+ })
75
+ })
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <PlusModal
3
+ :props="modalProps"
4
+ :closable="false"
5
+ @on-close="handlerClose"
6
+ width="500px"
7
+ >
8
+ <div class="i-flex-wrap justify-center align-center" style="height: 200px">
9
+ <i-circle :strokeColor="'var(--primary-color)'" :percent="percent">
10
+ <p class="sub-text">正在导出...</p>
11
+ <p
12
+ class="primary-title"
13
+ style="margin-top: 6px; color: var(--primary-color)"
14
+ >
15
+ {{ percent }}%
16
+ </p>
17
+ </i-circle>
18
+ </div>
19
+ <div slot="footer"></div>
20
+ </PlusModal>
21
+ </template>
22
+ <script>
23
+ export default {
24
+ data() {
25
+ return {
26
+ modalProps: {
27
+ show: false
28
+ },
29
+ percent: 0
30
+ }
31
+ },
32
+ methods: {
33
+ updatePercent(value) {
34
+ this.percent = Number(value)
35
+ if (this.percent >= 100) {
36
+ setTimeout(() => {
37
+ this.handlerClose()
38
+ }, 800)
39
+ }
40
+ },
41
+ handlerClose() {
42
+ this.modalProps.show = false
43
+ this.$emit('on-close')
44
+ },
45
+ show() {
46
+ this.percent = 0
47
+ this.modalProps.show = true
48
+ },
49
+ hide() {}
50
+ }
51
+ }
52
+ </script>
53
+ <style lang="less" scoped>
54
+ </style>