sh-view 2.6.6 → 2.6.8
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/README.md +2 -1
- package/package.json +3 -3
- package/packages/components/global-components/sh-alert/index.vue +1 -1
- package/packages/components/global-components/sh-calendar/index.vue +21 -4
- package/packages/components/global-components/sh-date/index.vue +273 -0
- package/packages/components/global-components/sh-tree/index.vue +2 -2
- package/packages/components/index.js +2 -0
- package/packages/vxeTable/render/cell/vxe-render-time.vue +44 -44
- package/packages/vxeTable/render/mixin/cell-hooks.js +1 -1
- package/README.en.md +0 -36
package/README.md
CHANGED
|
@@ -66,7 +66,8 @@ createApp(App).use(ShView).mount('#app')
|
|
|
66
66
|
|
|
67
67
|
#### 功能计划
|
|
68
68
|
* [x] v2.6.4 基于 vxe4.+,包含vxe-table所有功能,扩展更强渲染器
|
|
69
|
-
* [
|
|
69
|
+
* [x] v2.6.7:独立日历组件,扩展日期选择组件(支持日期的单选,范围选择,多日期选择等);
|
|
70
|
+
* [ ] 下一阶段:基础sh-view的admin系统开源(包含低代码设计模板,及系统鉴权、路由守卫等)
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
#### 项目预览
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-view",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.8",
|
|
4
4
|
"description": "基于vxe-table二次封装",
|
|
5
5
|
"main": "packages/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"jszip": "^3.10.1",
|
|
30
30
|
"lunar-javascript": "^1.6.4",
|
|
31
31
|
"popper.js": "^1.16.1",
|
|
32
|
-
"sh-tools": "^2.1.
|
|
32
|
+
"sh-tools": "^2.1.8",
|
|
33
33
|
"tinymce": "^5.10.5",
|
|
34
34
|
"vue": "^3.3.4",
|
|
35
35
|
"vue-masonry": "^0.16.0",
|
|
36
36
|
"vue-router": "^4.2.4",
|
|
37
|
-
"vxe-table": "^4.5.
|
|
37
|
+
"vxe-table": "^4.5.12",
|
|
38
38
|
"vxe-table-plugin-export-pdf": "^3.0.4",
|
|
39
39
|
"vxe-table-plugin-export-xlsx": "^3.0.5",
|
|
40
40
|
"xe-clipboard": "^1.10.2",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
</div>
|
|
10
10
|
</div>
|
|
11
|
-
<table class="sh-calendar-table" v-bind="tableConfig">
|
|
11
|
+
<table class="sh-calendar-table" :class="{ 'sh-calendar-pulldown': pulldown }" v-bind="tableConfig">
|
|
12
12
|
<thead>
|
|
13
13
|
<tr>
|
|
14
14
|
<template v-for="(head, headIndex) in headers" :key="headIndex">
|
|
15
|
-
<th>{{ head.label }}</th>
|
|
15
|
+
<th :style="{ textAlign: headerAlign }">{{ head.label }}</th>
|
|
16
16
|
</template>
|
|
17
17
|
</tr>
|
|
18
18
|
</thead>
|
|
@@ -75,6 +75,7 @@ export default defineComponent({
|
|
|
75
75
|
modelValue: [String, Number, Date],
|
|
76
76
|
type: { type: String, default: 'day' }, // day, month, year 暂时只支持day
|
|
77
77
|
startDay: { type: [String, Number], default: 1 },
|
|
78
|
+
headerAlign: { type: String, default: 'center' },
|
|
78
79
|
align: { type: String, default: 'center' },
|
|
79
80
|
header: { type: Boolean, default: true },
|
|
80
81
|
footer: { type: Boolean, default: false },
|
|
@@ -82,13 +83,15 @@ export default defineComponent({
|
|
|
82
83
|
noteHeight: { type: String, default: '22px' }, // 备注高度
|
|
83
84
|
noteMethod: { type: Function, default() {} },
|
|
84
85
|
festival: { type: Boolean, default: false }, // 是否显示农历
|
|
86
|
+
pulldown: { type: Boolean, default: false }, // 是否为下拉显示
|
|
85
87
|
valueFormat: { type: String, default: '' },
|
|
86
88
|
weeks: {
|
|
87
89
|
type: Array,
|
|
88
90
|
default() {
|
|
89
91
|
return ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
|
90
92
|
}
|
|
91
|
-
}
|
|
93
|
+
},
|
|
94
|
+
disabledMethod: { type: Function }
|
|
92
95
|
},
|
|
93
96
|
emits: ['update:modelValue', 'change'],
|
|
94
97
|
setup(props, context) {
|
|
@@ -445,6 +448,18 @@ export default defineComponent({
|
|
|
445
448
|
font-size: 0.8em;
|
|
446
449
|
}
|
|
447
450
|
}
|
|
451
|
+
.sh-calendar-table {
|
|
452
|
+
&:not(.sh-calendar-pulldown) {
|
|
453
|
+
td {
|
|
454
|
+
border: 1px solid var(--vxe-table-border-color);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
&.sh-calendar-pulldown {
|
|
458
|
+
tbody {
|
|
459
|
+
border: 1px solid var(--vxe-table-border-color);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
448
463
|
table {
|
|
449
464
|
border: 0;
|
|
450
465
|
width: 100%;
|
|
@@ -457,9 +472,11 @@ export default defineComponent({
|
|
|
457
472
|
td {
|
|
458
473
|
font-weight: normal;
|
|
459
474
|
position: relative;
|
|
460
|
-
border: 1px solid var(--vxe-table-border-color);
|
|
461
475
|
height: 36px;
|
|
462
476
|
}
|
|
477
|
+
th {
|
|
478
|
+
border: 1px solid var(--vxe-table-border-color);
|
|
479
|
+
}
|
|
463
480
|
td {
|
|
464
481
|
&.is--prev,
|
|
465
482
|
&.is--next {
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-date">
|
|
3
|
+
<template v-if="range">
|
|
4
|
+
<vxe-pulldown v-model="pulldownValue" v-bind="pulldownConfig" @hide-panel="onHidePanel">
|
|
5
|
+
<template #default>
|
|
6
|
+
<div class="sh-date-range-input" @click="onRangeFocus">
|
|
7
|
+
<input class="vxe-input vxe-input--inner" v-bind="startInputConfig" />
|
|
8
|
+
<span>{{ separator }}</span>
|
|
9
|
+
<input class="vxe-input vxe-input--inner" v-bind="endInputConfig" />
|
|
10
|
+
<span class="sh-date-range-suffix sh-date-clear" @click.stop="onRangeClear"><i class="vxe-icon-error-circle-fill"></i></span>
|
|
11
|
+
<span class="sh-date-range-suffix"><i class="vxe-icon-calendar"></i></span>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<template #dropdown>
|
|
15
|
+
<div class="sh-date-content">
|
|
16
|
+
<sh-calendar v-model="rangeValue[0]" v-bind="startCalendarConfig"></sh-calendar>
|
|
17
|
+
<div style="min-width: 10px"></div>
|
|
18
|
+
<sh-calendar v-model="rangeValue[1]" v-bind="endCalendarConfig"></sh-calendar>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
</vxe-pulldown>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-else>
|
|
24
|
+
<vxe-input
|
|
25
|
+
v-model="inputValue"
|
|
26
|
+
v-bind="inputConfig"
|
|
27
|
+
@input="dispatch('input', $event)"
|
|
28
|
+
@change="dispatch('change', $event)"
|
|
29
|
+
@keydown="dispatch('keydown', $event)"
|
|
30
|
+
@keyup="dispatch('keyup', $event)"
|
|
31
|
+
@click="dispatch('click', $event)"
|
|
32
|
+
@focus="dispatch('focus', $event)"
|
|
33
|
+
@blur="dispatch('blur', $event)"
|
|
34
|
+
@clear="dispatch('clear', $event)"
|
|
35
|
+
@search-click="dispatch('search-click', $event)"
|
|
36
|
+
@toggle-visible="dispatch('toggle-visible', $event)"
|
|
37
|
+
@prefix-click="dispatch('prefix-click', $event)"
|
|
38
|
+
@suffix-click="dispatch('suffix-click', $event)"
|
|
39
|
+
@date-prev="dispatch('date-prev', $event)"
|
|
40
|
+
@date-today="dispatch('date-today', $event)"
|
|
41
|
+
@date-next="dispatch('date-next', $event)"></vxe-input>
|
|
42
|
+
</template>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
// 记录自定义参数,传给vxe要过滤掉
|
|
48
|
+
let omitProps = ['range', 'separator', 'startPlaceholder', 'endPlaceholder', 'pulldown']
|
|
49
|
+
import { computed, defineComponent, getCurrentInstance, ref, reactive, onBeforeMount, PropType, watch } from 'vue'
|
|
50
|
+
export default defineComponent({
|
|
51
|
+
name: 'ShDate',
|
|
52
|
+
props: {
|
|
53
|
+
modelValue: [String, Number, Date, Array],
|
|
54
|
+
type: { type: String, default: 'date' },
|
|
55
|
+
clearable: { type: Boolean },
|
|
56
|
+
readonly: Boolean,
|
|
57
|
+
disabled: Boolean,
|
|
58
|
+
placeholder: String,
|
|
59
|
+
className: String,
|
|
60
|
+
size: String,
|
|
61
|
+
multiple: Boolean,
|
|
62
|
+
// date、week、month、quarter、year
|
|
63
|
+
startDate: { type: [String, Number, Date] },
|
|
64
|
+
endDate: { type: [String, Number, Date] },
|
|
65
|
+
minDate: [String, Number, Date],
|
|
66
|
+
maxDate: [String, Number, Date],
|
|
67
|
+
startDay: { type: [String, Number] },
|
|
68
|
+
labelFormat: { type: String, default: 'yyyy-MM-dd' },
|
|
69
|
+
valueFormat: { type: String, default: 'yyyy-MM-dd' },
|
|
70
|
+
editable: { type: Boolean, default: true },
|
|
71
|
+
festivalMethod: { type: Function },
|
|
72
|
+
disabledMethod: { type: Function },
|
|
73
|
+
// week
|
|
74
|
+
selectDay: { type: [String, Number] },
|
|
75
|
+
prefixIcon: String,
|
|
76
|
+
suffixIcon: String,
|
|
77
|
+
placement: String,
|
|
78
|
+
transfer: Boolean,
|
|
79
|
+
// 个性化参数
|
|
80
|
+
range: Boolean,
|
|
81
|
+
separator: { type: String, default: '至' },
|
|
82
|
+
startPlaceholder: { type: String, default: '起始日期' },
|
|
83
|
+
endPlaceholder: { type: String, default: '截止日期' },
|
|
84
|
+
pulldown: Object
|
|
85
|
+
},
|
|
86
|
+
emits: [
|
|
87
|
+
'update:modelValue',
|
|
88
|
+
'focus',
|
|
89
|
+
'change',
|
|
90
|
+
'blur',
|
|
91
|
+
'input',
|
|
92
|
+
'keydown',
|
|
93
|
+
'keyup',
|
|
94
|
+
'click',
|
|
95
|
+
'clear',
|
|
96
|
+
'search-click',
|
|
97
|
+
'toggle-visible',
|
|
98
|
+
'prefix-click',
|
|
99
|
+
'suffix-click',
|
|
100
|
+
'date-prev',
|
|
101
|
+
'date-today',
|
|
102
|
+
'date-next'
|
|
103
|
+
],
|
|
104
|
+
setup(props, context) {
|
|
105
|
+
const { proxy } = getCurrentInstance()
|
|
106
|
+
const { $vUtils } = proxy
|
|
107
|
+
const { emit, slots } = context
|
|
108
|
+
|
|
109
|
+
const pulldownValue = ref(false)
|
|
110
|
+
const inputValue = ref(props.modelValue)
|
|
111
|
+
const rangeValue = ref(props.modelValue || [])
|
|
112
|
+
|
|
113
|
+
const inputConfig = computed(() => {
|
|
114
|
+
let defaultProps = {}
|
|
115
|
+
let vxeProps = $vUtils.omit(props, (val, key) => {
|
|
116
|
+
return omitProps.includes(key) || $vUtils.isNone(val)
|
|
117
|
+
})
|
|
118
|
+
let shProps = {}
|
|
119
|
+
return Object.assign(defaultProps, vxeProps, shProps)
|
|
120
|
+
})
|
|
121
|
+
const pulldownConfig = computed(() => {
|
|
122
|
+
return Object.assign({ transfer: true }, props.pulldown)
|
|
123
|
+
})
|
|
124
|
+
const rangeInputConfig = computed(() => ({ type: 'text', readonly: true }))
|
|
125
|
+
const startInputConfig = computed(() => {
|
|
126
|
+
let startValue = rangeValue.value[0] || ''
|
|
127
|
+
let startLabel = $vUtils.toDateString(startValue, props.labelFormat)
|
|
128
|
+
return { ...rangeInputConfig.value, value: startLabel, placeholder: props.startPlaceholder }
|
|
129
|
+
})
|
|
130
|
+
const endInputConfig = computed(() => {
|
|
131
|
+
let endValue = rangeValue.value[1] || ''
|
|
132
|
+
let endLabel = $vUtils.toDateString(endValue, props.labelFormat)
|
|
133
|
+
return { ...rangeInputConfig.value, value: endLabel, placeholder: props.endPlaceholder }
|
|
134
|
+
})
|
|
135
|
+
const calendarConfig = computed(() => ({ pulldown: true, style: { height: '100%' }, align: 'center', valueFormat: props.valueFormat }))
|
|
136
|
+
const startCalendarConfig = computed(() => {
|
|
137
|
+
let startValue = rangeValue.value[0] || ''
|
|
138
|
+
return {
|
|
139
|
+
...calendarConfig.value,
|
|
140
|
+
modelValue: startValue,
|
|
141
|
+
disabledMethod: ({ date, viewType }) => {
|
|
142
|
+
let endTime = rangeValue.value[1]
|
|
143
|
+
let { done, time } = $vUtils.getDateDiff(endTime, date)
|
|
144
|
+
return done
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
const endCalendarConfig = computed(() => {
|
|
149
|
+
let endValue = rangeValue.value[1] || ''
|
|
150
|
+
return {
|
|
151
|
+
...calendarConfig.value,
|
|
152
|
+
modelValue: endValue,
|
|
153
|
+
disabledMethod: ({ date, viewType }) => {
|
|
154
|
+
let startTime = rangeValue.value[0]
|
|
155
|
+
let { done, time } = $vUtils.getDateDiff(startTime, date)
|
|
156
|
+
return startTime ? !done : false
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const onRangeFocus = async e => {
|
|
162
|
+
pulldownValue.value = !pulldownValue.value
|
|
163
|
+
if (pulldownValue.value) {
|
|
164
|
+
dispatch('focus', e)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const onRangeClear = () => {
|
|
168
|
+
pulldownValue.value = false
|
|
169
|
+
rangeValue.value = []
|
|
170
|
+
onHidePanel()
|
|
171
|
+
}
|
|
172
|
+
const onHidePanel = () => {
|
|
173
|
+
dispatch('value')
|
|
174
|
+
dispatch('change')
|
|
175
|
+
dispatch('blur')
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 回调事件
|
|
179
|
+
const dispatch = (code, params) => {
|
|
180
|
+
if (code === 'value') {
|
|
181
|
+
emit('update:modelValue', rangeValue.value)
|
|
182
|
+
} else if (props.range) {
|
|
183
|
+
emit(code, { value: rangeValue.value, params })
|
|
184
|
+
} else {
|
|
185
|
+
if (code === 'change') {
|
|
186
|
+
emit('update:modelValue', params.value)
|
|
187
|
+
}
|
|
188
|
+
emit(code, params)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
watch(
|
|
193
|
+
() => props.modelValue,
|
|
194
|
+
(value, oldValue) => {
|
|
195
|
+
if (props.range) {
|
|
196
|
+
rangeValue.value = value
|
|
197
|
+
} else {
|
|
198
|
+
inputValue.value = value
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
pulldownValue,
|
|
205
|
+
inputValue,
|
|
206
|
+
rangeValue,
|
|
207
|
+
inputConfig,
|
|
208
|
+
pulldownConfig,
|
|
209
|
+
startInputConfig,
|
|
210
|
+
endInputConfig,
|
|
211
|
+
startCalendarConfig,
|
|
212
|
+
endCalendarConfig,
|
|
213
|
+
onRangeFocus,
|
|
214
|
+
onHidePanel,
|
|
215
|
+
onRangeClear,
|
|
216
|
+
dispatch
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<style scoped lang="scss">
|
|
223
|
+
.sh-date {
|
|
224
|
+
display: inline-block;
|
|
225
|
+
position: relative;
|
|
226
|
+
}
|
|
227
|
+
.sh-date-range-input {
|
|
228
|
+
display: flex;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
align-items: center;
|
|
231
|
+
border-radius: var(--vxe-border-radius);
|
|
232
|
+
color: var(--vxe-font-color);
|
|
233
|
+
border: 1px solid var(--vxe-input-border-color);
|
|
234
|
+
background-color: var(--vxe-input-background-color);
|
|
235
|
+
box-shadow: none;
|
|
236
|
+
&:hover {
|
|
237
|
+
.sh-date-clear {
|
|
238
|
+
display: flex;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
input {
|
|
242
|
+
width: 100%;
|
|
243
|
+
border: none;
|
|
244
|
+
color: inherit;
|
|
245
|
+
text-align: center;
|
|
246
|
+
}
|
|
247
|
+
.sh-date-range-suffix {
|
|
248
|
+
color: var(--vxe-table-column-icon-border-color);
|
|
249
|
+
height: 100%;
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
margin-right: 8px;
|
|
252
|
+
}
|
|
253
|
+
.sh-date-clear {
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
display: none;
|
|
256
|
+
position: absolute;
|
|
257
|
+
right: 0;
|
|
258
|
+
height: 100%;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
align-items: center;
|
|
261
|
+
&:hover {
|
|
262
|
+
color: inherit;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
.sh-date-content {
|
|
267
|
+
display: flex;
|
|
268
|
+
justify-content: space-between;
|
|
269
|
+
padding: 12px;
|
|
270
|
+
width: 600px;
|
|
271
|
+
max-width: 100%;
|
|
272
|
+
}
|
|
273
|
+
</style>
|
|
@@ -162,7 +162,7 @@ export default defineComponent({
|
|
|
162
162
|
const onDataCall = datas => {
|
|
163
163
|
treeData.value = datas
|
|
164
164
|
}
|
|
165
|
-
// 回调
|
|
165
|
+
// 回调focus事件
|
|
166
166
|
const emitFocus = obj => {
|
|
167
167
|
emit('focus', obj)
|
|
168
168
|
}
|
|
@@ -171,7 +171,7 @@ export default defineComponent({
|
|
|
171
171
|
emitValue()
|
|
172
172
|
emit('change', selectedKeys.value, selectedData.value)
|
|
173
173
|
}
|
|
174
|
-
// 回调
|
|
174
|
+
// 回调blur事件
|
|
175
175
|
const emitBlur = () => {
|
|
176
176
|
emit('blur', selectedKeys.value, selectedData.value)
|
|
177
177
|
}
|
|
@@ -7,6 +7,7 @@ import ShCodeEditor from './global-components/sh-code-editor/index.vue'
|
|
|
7
7
|
import ShCol from './global-components/sh-col/index.vue'
|
|
8
8
|
import ShCorner from './global-components/sh-corner/index.vue'
|
|
9
9
|
import ShCountTo from './global-components/sh-count-to/index.vue'
|
|
10
|
+
import ShDate from './global-components/sh-date/index.vue'
|
|
10
11
|
import ShDrawer from './global-components/sh-drawer/index.vue'
|
|
11
12
|
import ShEmpty from './global-components/sh-empty/index.vue'
|
|
12
13
|
import ShForm from './global-components/sh-form/form.vue'
|
|
@@ -44,6 +45,7 @@ const components = {
|
|
|
44
45
|
ShCol,
|
|
45
46
|
ShCorner,
|
|
46
47
|
ShCountTo,
|
|
48
|
+
ShDate,
|
|
47
49
|
ShDrawer,
|
|
48
50
|
ShEmpty,
|
|
49
51
|
ShForm,
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span class="vxe-render--inner" :class="{ 'form-render': rform, 'td-render': !rform }">
|
|
3
|
-
<template v-if="redit || isEditAll">
|
|
4
|
-
<
|
|
5
|
-
</template>
|
|
6
|
-
<template v-else>
|
|
7
|
-
<span v-html="renderText"></span>
|
|
8
|
-
</template>
|
|
9
|
-
</span>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import { defineComponent, getCurrentInstance } from 'vue'
|
|
14
|
-
import cellProps from '../mixin/cell-props'
|
|
15
|
-
import cellHooks from '../mixin/cell-hooks'
|
|
16
|
-
export default defineComponent({
|
|
17
|
-
name: 'VxeRenderTime',
|
|
18
|
-
props: cellProps,
|
|
19
|
-
setup(props, context) {
|
|
20
|
-
const { proxy } = getCurrentInstance()
|
|
21
|
-
const { $vUtils } = proxy
|
|
22
|
-
const useCell = cellHooks(props, context, proxy)
|
|
23
|
-
|
|
24
|
-
// 禁用事件
|
|
25
|
-
const vxeDisabledMethod = ({ date, viewType }) => {
|
|
26
|
-
let { startTime, endTime } = props.rprops
|
|
27
|
-
if (startTime) {
|
|
28
|
-
startTime = $vUtils.format(startTime, props.rdata)
|
|
29
|
-
let { done, time } = $vUtils.getDateDiff(startTime, date)
|
|
30
|
-
return startTime ? !done : false
|
|
31
|
-
} else if (endTime) {
|
|
32
|
-
endTime = $vUtils.format(endTime, props.rdata)
|
|
33
|
-
let { done, time } = $vUtils.getDateDiff(endTime, date)
|
|
34
|
-
return done
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
...useCell,
|
|
40
|
-
vxeDisabledMethod
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<span class="vxe-render--inner" :class="{ 'form-render': rform, 'td-render': !rform }">
|
|
3
|
+
<template v-if="redit || isEditAll">
|
|
4
|
+
<sh-date v-model="renderValue" v-bind="rprops" :size="rsize" :disabled-method="vxeDisabledMethod" @change="vxeChangeCallBack"></sh-date>
|
|
5
|
+
</template>
|
|
6
|
+
<template v-else>
|
|
7
|
+
<span v-html="renderText"></span>
|
|
8
|
+
</template>
|
|
9
|
+
</span>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { defineComponent, getCurrentInstance } from 'vue'
|
|
14
|
+
import cellProps from '../mixin/cell-props'
|
|
15
|
+
import cellHooks from '../mixin/cell-hooks'
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'VxeRenderTime',
|
|
18
|
+
props: cellProps,
|
|
19
|
+
setup(props, context) {
|
|
20
|
+
const { proxy } = getCurrentInstance()
|
|
21
|
+
const { $vUtils } = proxy
|
|
22
|
+
const useCell = cellHooks(props, context, proxy)
|
|
23
|
+
|
|
24
|
+
// 禁用事件
|
|
25
|
+
const vxeDisabledMethod = ({ date, viewType }) => {
|
|
26
|
+
let { startTime, endTime } = props.rprops
|
|
27
|
+
if (startTime) {
|
|
28
|
+
startTime = $vUtils.format(startTime, props.rdata)
|
|
29
|
+
let { done, time } = $vUtils.getDateDiff(startTime, date)
|
|
30
|
+
return startTime ? !done : false
|
|
31
|
+
} else if (endTime) {
|
|
32
|
+
endTime = $vUtils.format(endTime, props.rdata)
|
|
33
|
+
let { done, time } = $vUtils.getDateDiff(endTime, date)
|
|
34
|
+
return done
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
...useCell,
|
|
40
|
+
vxeDisabledMethod
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
@@ -35,7 +35,7 @@ export default function (props, context, proxy) {
|
|
|
35
35
|
const rform = computed(() => !!props.rparams.$form)
|
|
36
36
|
const reditmode = computed(() => props.rparams.$table?.props?.editConfig?.mode)
|
|
37
37
|
const isEditAll = computed(() => {
|
|
38
|
-
return props.rparams.$table?.props?.editConfig?.enabled && reditmode.value === 'all'
|
|
38
|
+
return props.rparams.$table?.props?.editConfig?.enabled && reditmode.value === 'all' && props.rparams.column.editRender
|
|
39
39
|
})
|
|
40
40
|
const moneyUnitText = computed(() => {
|
|
41
41
|
let moneyConstant = moneyUnitConstants.find(item => item.value === props.rprops.moneyUnit)
|
package/README.en.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# sh-view
|
|
2
|
-
|
|
3
|
-
#### Description
|
|
4
|
-
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
|
5
|
-
|
|
6
|
-
#### Software Architecture
|
|
7
|
-
Software architecture description
|
|
8
|
-
|
|
9
|
-
#### Installation
|
|
10
|
-
|
|
11
|
-
1. xxxx
|
|
12
|
-
2. xxxx
|
|
13
|
-
3. xxxx
|
|
14
|
-
|
|
15
|
-
#### Instructions
|
|
16
|
-
|
|
17
|
-
1. xxxx
|
|
18
|
-
2. xxxx
|
|
19
|
-
3. xxxx
|
|
20
|
-
|
|
21
|
-
#### Contribution
|
|
22
|
-
|
|
23
|
-
1. Fork the repository
|
|
24
|
-
2. Create Feat_xxx branch
|
|
25
|
-
3. Commit your code
|
|
26
|
-
4. Create Pull Request
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### Gitee Feature
|
|
30
|
-
|
|
31
|
-
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
32
|
-
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
33
|
-
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
34
|
-
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
35
|
-
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
36
|
-
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|