sh-view 2.8.1 → 2.8.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.
Files changed (91) hide show
  1. package/.eslintrc.js +25 -20
  2. package/other.js +8 -8
  3. package/package.json +9 -6
  4. package/packages/components/index.js +91 -91
  5. package/packages/components/sh-alert/alert.ts +30 -0
  6. package/packages/components/sh-alert/index.vue +143 -168
  7. package/packages/components/sh-badge/index.vue +242 -242
  8. package/packages/components/sh-calendar/index.vue +650 -650
  9. package/packages/components/sh-card/index.vue +148 -148
  10. package/packages/components/sh-code-editor/index.vue +19 -19
  11. package/packages/components/sh-col/index.vue +92 -92
  12. package/packages/components/sh-corner/index.vue +230 -230
  13. package/packages/components/sh-count-to/index.vue +131 -131
  14. package/packages/components/sh-date/index.vue +301 -301
  15. package/packages/components/sh-drawer/index.vue +579 -579
  16. package/packages/components/sh-drawer/scrollbar.js +78 -78
  17. package/packages/components/sh-empty/index.vue +42 -42
  18. package/packages/components/sh-form/js/props.js +76 -76
  19. package/packages/components/sh-form/js/useForm.js +229 -229
  20. package/packages/components/sh-header/index.vue +261 -260
  21. package/packages/components/sh-icon/css/default/ionicons.svg +869 -869
  22. package/packages/components/sh-icon/css/font/iconfont.json +247 -247
  23. package/packages/components/sh-icon/index.vue +41 -41
  24. package/packages/components/sh-image/index.vue +133 -133
  25. package/packages/components/sh-list/index.vue +146 -146
  26. package/packages/components/sh-loading/index.vue +53 -53
  27. package/packages/components/sh-modal/index.vue +188 -188
  28. package/packages/components/sh-noticebar/index.vue +215 -215
  29. package/packages/components/sh-poptip/index.vue +597 -597
  30. package/packages/components/sh-progress/index.vue +276 -276
  31. package/packages/components/sh-pull-refresh/index.vue +289 -289
  32. package/packages/components/sh-result/index.vue +114 -114
  33. package/packages/components/sh-row/index.vue +66 -66
  34. package/packages/components/sh-split/components/trigger.vue +33 -33
  35. package/packages/components/sh-split/index.vue +342 -342
  36. package/packages/components/sh-table/components/importModal.vue +363 -363
  37. package/packages/components/sh-table/components/sh-column.vue +68 -68
  38. package/packages/components/sh-table/js/excel_to_json.js +313 -313
  39. package/packages/components/sh-table/js/props.js +305 -305
  40. package/packages/components/sh-table/js/tableMethods.js +167 -167
  41. package/packages/components/sh-table/js/useTable.js +636 -636
  42. package/packages/components/sh-table/table.vue +217 -217
  43. package/packages/components/sh-tabs/index.vue +426 -426
  44. package/packages/components/sh-tag/index.vue +168 -168
  45. package/packages/components/sh-toolbar/index.vue +182 -182
  46. package/packages/components/sh-tree/components/table-tree.vue +289 -289
  47. package/packages/components/sh-tree/mixin/treeProps.js +122 -122
  48. package/packages/components/sh-upload/index.vue +535 -535
  49. package/packages/components/sh-water-fall/index.vue +80 -80
  50. package/packages/components/sh-water-mark/index.vue +96 -96
  51. package/packages/css/index.js +4 -4
  52. package/packages/directive/index.js +19 -19
  53. package/packages/directive/module/click-out.js +14 -14
  54. package/packages/directive/module/draggable.js +42 -42
  55. package/packages/directive/module/line-clamp.js +22 -22
  56. package/packages/directive/module/prevent-click.js +18 -18
  57. package/packages/directive/module/resize.js +14 -14
  58. package/packages/directive/module/ripple.js +166 -166
  59. package/packages/index.js +39 -39
  60. package/packages/mixin/index.js +86 -86
  61. package/packages/other/sh-cron-modal/components/cron-content.vue +294 -294
  62. package/packages/other/sh-cron-modal/index.vue +81 -81
  63. package/packages/other/sh-cron-modal/mixin/cron-emits.js +1 -1
  64. package/packages/other/sh-cron-modal/mixin/cron-props.js +9 -9
  65. package/packages/other/sh-cron-modal/tabs/cron-week-box.vue +126 -126
  66. package/packages/other/sh-menu/index.vue +326 -326
  67. package/packages/other/sh-menu/menu-group-content.vue +136 -136
  68. package/packages/other/sh-menu/menu-item-content.vue +71 -71
  69. package/packages/other/sh-menu-card/index.vue +250 -250
  70. package/packages/other/sh-menu-card/menu-box.vue +87 -87
  71. package/packages/other/sh-preview/components/sh-excel.vue +163 -163
  72. package/packages/other/sh-preview/js/data-hook.js +41 -41
  73. package/packages/other/sh-preview/js/data-props.js +15 -15
  74. package/packages/other/sh-system-tip/index.vue +115 -115
  75. package/packages/utils/resize.js +69 -70
  76. package/packages/utils/transfer-queue.js +12 -12
  77. package/packages/vxeTable/index.js +193 -184
  78. package/packages/vxeTable/plugins/export.js +450 -450
  79. package/packages/vxeTable/render/cell/vxe-render-img.vue +27 -27
  80. package/packages/vxeTable/render/cell/vxe-render-table.vue +51 -51
  81. package/packages/vxeTable/render/cell/vxe-render-time.vue +44 -44
  82. package/packages/vxeTable/render/cell/vxe-render-tree.vue +70 -70
  83. package/packages/vxeTable/render/filters/vxe-filter-input.vue +26 -26
  84. package/packages/vxeTable/render/filters/vxe-filter-time.vue +26 -26
  85. package/packages/vxeTable/render/globalRenders.jsx +514 -514
  86. package/packages/vxeTable/render/mixin/cell-hooks.js +198 -198
  87. package/packages/vxeTable/render/mixin/cell-props.js +23 -23
  88. package/packages/vxeTable/render/mixin/filter-hooks.js +46 -46
  89. package/tsconfig.json +25 -0
  90. package/types/component.d.ts +1 -0
  91. package/types/index.ts +0 -0
@@ -1,182 +1,182 @@
1
- <template>
2
- <div class="sh-vxe-toolbar">
3
- <div class="toolbar-left">
4
- <slot name="left"></slot>
5
- <template v-if="isTool">
6
- <template v-for="(toolBtn, toolBtnIndex) in toolBtns" :key="toolBtnIndex">
7
- <vxe-button v-ripple v-bind="toolBtn" @click="handleToolBtn(toolBtn)"></vxe-button>
8
- </template>
9
- </template>
10
- <vxe-radio-group v-else v-model="leftActive" @change="handleLeftBtn">
11
- <template v-for="(leftBtn, leftBtnIndex) in leftBtns" :key="leftBtnIndex">
12
- <vxe-radio-button v-ripple v-bind="leftBtn" :label="leftBtn.value"></vxe-radio-button>
13
- </template>
14
- </vxe-radio-group>
15
- <slot name="leftr"></slot>
16
- </div>
17
- <div class="toolbar-right">
18
- <slot name="rightl"></slot>
19
- <template v-for="(rightBtn, rightBtnIndex) in rightBtns" :key="rightBtnIndex">
20
- <vxe-button v-ripple v-bind="rightBtn" @click="handleRightBtn(rightBtn)"></vxe-button>
21
- </template>
22
- <slot name="right"></slot>
23
- </div>
24
- </div>
25
- </template>
26
-
27
- <script>
28
- import { defineComponent, computed, getCurrentInstance, ref, watch, onBeforeMount } from 'vue'
29
- export default defineComponent({
30
- name: 'ShToolbar',
31
- props: {
32
- modelValue: {
33
- type: String
34
- },
35
- relation: {
36
- type: Boolean
37
- },
38
- leftContain: {
39
- type: Array,
40
- default() {
41
- return []
42
- }
43
- },
44
- leftConfig: {
45
- type: Array,
46
- default() {
47
- return [
48
- { value: '1', code: 'wss', content: '未送审' },
49
- { value: '2', code: 'bth', content: '被退回' },
50
- { value: '3', code: 'yss', content: '已送审' },
51
- { value: '4', code: 'ygd', content: '已归档' },
52
- { value: '5', code: 'qb', content: '全部' },
53
- { value: '6', code: 'dsh', content: '待审核' },
54
- { value: '7', code: 'ysh', content: '已审核' }
55
- ]
56
- }
57
- },
58
- rightConfig: {
59
- type: Array,
60
- default() {
61
- return []
62
- }
63
- },
64
- isTool: {
65
- type: Boolean
66
- },
67
- toolsContain: {
68
- type: Array,
69
- default() {
70
- return []
71
- }
72
- },
73
- toolsConfig: {
74
- type: Array,
75
- default() {
76
- return [
77
- { code: 'add', content: '新增', status: 'primary', icon: 'vxe-icon-add' },
78
- { code: 'edit', content: '修改', status: 'warning', icon: 'vxe-icon-edit' },
79
- { code: 'delete', content: '删除', status: 'danger', icon: 'vxe-icon-delete' },
80
- { code: 'detail', content: '查看', status: '', icon: 'vxe-icon-information' },
81
- { code: 'export', content: '导出', status: 'success', icon: 'vxe-icon-download' },
82
- { code: 'import', content: '导入', status: 'primary', icon: 'vxe-icon-upload' },
83
- { code: 'print', content: '打印', status: 'warning', icon: 'vxe-icon-print' },
84
- { code: 'batch-add', content: '批量新增', status: 'primary', icon: 'vxe-icon-add' },
85
- { code: 'batch-edit', content: '批量修改', status: 'warning', icon: 'vxe-icon-edit' },
86
- { code: 'batch-delete', content: '批量删除', status: 'danger', icon: 'vxe-icon-delete' },
87
- { code: 'batch-detail', content: '查看', status: '', icon: 'vxe-icon-information' }
88
- ]
89
- }
90
- }
91
- },
92
- emits: ['update:modelValue', 'left', 'right', 'tool'],
93
- setup(props, context) {
94
- const { proxy } = getCurrentInstance()
95
- const { $vUtils } = proxy
96
- const { emit, slots } = context
97
-
98
- const leftActive = ref(props.modelValue)
99
-
100
- const leftBtns = computed(() => {
101
- let lBtns = []
102
- if (props.leftContain && Array.isArray(props.leftContain)) {
103
- lBtns = props.leftContain.map(item => props.leftConfig.find(btn => btn.code === item))
104
- }
105
- return lBtns
106
- })
107
- const rightBtns = computed(() => {
108
- let rBtns = []
109
- if (props.rightConfig && Array.isArray(props.rightConfig)) {
110
- rBtns = props.rightConfig
111
- }
112
- let leftCode = leftBtns.value.find(btn => btn.value === leftActive.value)
113
- if (props.relation && leftCode) {
114
- rBtns = rBtns.filter(item => item.code && item.code.split(',').includes(leftCode.code))
115
- }
116
- return rBtns
117
- })
118
- const toolBtns = computed(() => {
119
- let toolBtns = []
120
- if (props.toolsContain && Array.isArray(props.toolsContain)) {
121
- toolBtns = props.toolsContain.map(item => props.toolsConfig.find(btn => btn.code === item))
122
- }
123
- return toolBtns
124
- })
125
-
126
- const handleLeftBtn = ({ label }) => {
127
- let btnObj = props.leftConfig.find(item => item.value === label)
128
- emitValue()
129
- emit('left', label, btnObj)
130
- }
131
- const handleRightBtn = btn => {
132
- emit('right', btn.value, btn)
133
- }
134
- const handleToolBtn = btn => {
135
- emit('tool', btn)
136
- }
137
- const emitValue = () => {
138
- emit('update:modelValue', leftActive.value)
139
- }
140
-
141
- watch(
142
- () => props.modelValue,
143
- nv => {
144
- leftActive.value = nv
145
- }
146
- )
147
-
148
- return {
149
- leftActive,
150
- toolBtns,
151
- leftBtns,
152
- rightBtns,
153
- handleToolBtn,
154
- handleLeftBtn,
155
- handleRightBtn
156
- }
157
- }
158
- })
159
- </script>
160
-
161
- <style lang="scss">
162
- .sh-vxe-toolbar {
163
- display: flex;
164
- justify-content: space-between;
165
- align-items: center;
166
- padding: 10px 5px;
167
- box-sizing: border-box;
168
- background-color: var(--vxe-table-body-background-color);
169
- width: 100%;
170
- .toolbar-left {
171
- flex: 1;
172
- .vxe-radio-button > input:checked + .vxe-radio--label {
173
- border-color: var(--vxe-primary-color);
174
- background: linear-gradient(-10deg, var(--vxe-primary-color), var(--vxe-primary-lighten-color));
175
- }
176
- }
177
- .toolbar-right {
178
- flex: 0;
179
- white-space: nowrap;
180
- }
181
- }
182
- </style>
1
+ <template>
2
+ <div class="sh-vxe-toolbar">
3
+ <div class="toolbar-left">
4
+ <slot name="left"></slot>
5
+ <template v-if="isTool">
6
+ <template v-for="(toolBtn, toolBtnIndex) in toolBtns" :key="toolBtnIndex">
7
+ <vxe-button v-ripple v-bind="toolBtn" @click="handleToolBtn(toolBtn)"></vxe-button>
8
+ </template>
9
+ </template>
10
+ <vxe-radio-group v-else v-model="leftActive" @change="handleLeftBtn">
11
+ <template v-for="(leftBtn, leftBtnIndex) in leftBtns" :key="leftBtnIndex">
12
+ <vxe-radio-button v-ripple v-bind="leftBtn" :label="leftBtn.value"></vxe-radio-button>
13
+ </template>
14
+ </vxe-radio-group>
15
+ <slot name="leftr"></slot>
16
+ </div>
17
+ <div class="toolbar-right">
18
+ <slot name="rightl"></slot>
19
+ <template v-for="(rightBtn, rightBtnIndex) in rightBtns" :key="rightBtnIndex">
20
+ <vxe-button v-ripple v-bind="rightBtn" @click="handleRightBtn(rightBtn)"></vxe-button>
21
+ </template>
22
+ <slot name="right"></slot>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import { defineComponent, computed, getCurrentInstance, ref, watch, onBeforeMount } from 'vue'
29
+ export default defineComponent({
30
+ name: 'ShToolbar',
31
+ props: {
32
+ modelValue: {
33
+ type: String
34
+ },
35
+ relation: {
36
+ type: Boolean
37
+ },
38
+ leftContain: {
39
+ type: Array,
40
+ default() {
41
+ return []
42
+ }
43
+ },
44
+ leftConfig: {
45
+ type: Array,
46
+ default() {
47
+ return [
48
+ { value: '1', code: 'wss', content: '未送审' },
49
+ { value: '2', code: 'bth', content: '被退回' },
50
+ { value: '3', code: 'yss', content: '已送审' },
51
+ { value: '4', code: 'ygd', content: '已归档' },
52
+ { value: '5', code: 'qb', content: '全部' },
53
+ { value: '6', code: 'dsh', content: '待审核' },
54
+ { value: '7', code: 'ysh', content: '已审核' }
55
+ ]
56
+ }
57
+ },
58
+ rightConfig: {
59
+ type: Array,
60
+ default() {
61
+ return []
62
+ }
63
+ },
64
+ isTool: {
65
+ type: Boolean
66
+ },
67
+ toolsContain: {
68
+ type: Array,
69
+ default() {
70
+ return []
71
+ }
72
+ },
73
+ toolsConfig: {
74
+ type: Array,
75
+ default() {
76
+ return [
77
+ { code: 'add', content: '新增', status: 'primary', icon: 'vxe-icon-add' },
78
+ { code: 'edit', content: '修改', status: 'warning', icon: 'vxe-icon-edit' },
79
+ { code: 'delete', content: '删除', status: 'danger', icon: 'vxe-icon-delete' },
80
+ { code: 'detail', content: '查看', status: '', icon: 'vxe-icon-information' },
81
+ { code: 'export', content: '导出', status: 'success', icon: 'vxe-icon-download' },
82
+ { code: 'import', content: '导入', status: 'primary', icon: 'vxe-icon-upload' },
83
+ { code: 'print', content: '打印', status: 'warning', icon: 'vxe-icon-print' },
84
+ { code: 'batch-add', content: '批量新增', status: 'primary', icon: 'vxe-icon-add' },
85
+ { code: 'batch-edit', content: '批量修改', status: 'warning', icon: 'vxe-icon-edit' },
86
+ { code: 'batch-delete', content: '批量删除', status: 'danger', icon: 'vxe-icon-delete' },
87
+ { code: 'batch-detail', content: '查看', status: '', icon: 'vxe-icon-information' }
88
+ ]
89
+ }
90
+ }
91
+ },
92
+ emits: ['update:modelValue', 'left', 'right', 'tool'],
93
+ setup(props, context) {
94
+ const { proxy } = getCurrentInstance()
95
+ const { $vUtils } = proxy
96
+ const { emit, slots } = context
97
+
98
+ const leftActive = ref(props.modelValue)
99
+
100
+ const leftBtns = computed(() => {
101
+ let lBtns = []
102
+ if (props.leftContain && Array.isArray(props.leftContain)) {
103
+ lBtns = props.leftContain.map(item => props.leftConfig.find(btn => btn.code === item))
104
+ }
105
+ return lBtns
106
+ })
107
+ const rightBtns = computed(() => {
108
+ let rBtns = []
109
+ if (props.rightConfig && Array.isArray(props.rightConfig)) {
110
+ rBtns = props.rightConfig
111
+ }
112
+ let leftCode = leftBtns.value.find(btn => btn.value === leftActive.value)
113
+ if (props.relation && leftCode) {
114
+ rBtns = rBtns.filter(item => item.code && item.code.split(',').includes(leftCode.code))
115
+ }
116
+ return rBtns
117
+ })
118
+ const toolBtns = computed(() => {
119
+ let toolBtns = []
120
+ if (props.toolsContain && Array.isArray(props.toolsContain)) {
121
+ toolBtns = props.toolsContain.map(item => props.toolsConfig.find(btn => btn.code === item))
122
+ }
123
+ return toolBtns
124
+ })
125
+
126
+ const handleLeftBtn = ({ label }) => {
127
+ let btnObj = props.leftConfig.find(item => item.value === label)
128
+ emitValue()
129
+ emit('left', label, btnObj)
130
+ }
131
+ const handleRightBtn = btn => {
132
+ emit('right', btn.value, btn)
133
+ }
134
+ const handleToolBtn = btn => {
135
+ emit('tool', btn)
136
+ }
137
+ const emitValue = () => {
138
+ emit('update:modelValue', leftActive.value)
139
+ }
140
+
141
+ watch(
142
+ () => props.modelValue,
143
+ nv => {
144
+ leftActive.value = nv
145
+ }
146
+ )
147
+
148
+ return {
149
+ leftActive,
150
+ toolBtns,
151
+ leftBtns,
152
+ rightBtns,
153
+ handleToolBtn,
154
+ handleLeftBtn,
155
+ handleRightBtn
156
+ }
157
+ }
158
+ })
159
+ </script>
160
+
161
+ <style lang="scss">
162
+ .sh-vxe-toolbar {
163
+ display: flex;
164
+ justify-content: space-between;
165
+ align-items: center;
166
+ padding: 10px 5px;
167
+ box-sizing: border-box;
168
+ background-color: var(--vxe-table-body-background-color);
169
+ width: 100%;
170
+ .toolbar-left {
171
+ flex: 1;
172
+ .vxe-radio-button > input:checked + .vxe-radio--label {
173
+ border-color: var(--vxe-primary-color);
174
+ background: linear-gradient(-10deg, var(--vxe-primary-color), var(--vxe-primary-lighten-color));
175
+ }
176
+ }
177
+ .toolbar-right {
178
+ flex: 0;
179
+ white-space: nowrap;
180
+ }
181
+ }
182
+ </style>