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.
- package/.eslintrc.js +25 -20
- package/other.js +8 -8
- package/package.json +9 -6
- package/packages/components/index.js +91 -91
- package/packages/components/sh-alert/alert.ts +30 -0
- package/packages/components/sh-alert/index.vue +143 -168
- package/packages/components/sh-badge/index.vue +242 -242
- package/packages/components/sh-calendar/index.vue +650 -650
- package/packages/components/sh-card/index.vue +148 -148
- package/packages/components/sh-code-editor/index.vue +19 -19
- package/packages/components/sh-col/index.vue +92 -92
- package/packages/components/sh-corner/index.vue +230 -230
- package/packages/components/sh-count-to/index.vue +131 -131
- package/packages/components/sh-date/index.vue +301 -301
- package/packages/components/sh-drawer/index.vue +579 -579
- package/packages/components/sh-drawer/scrollbar.js +78 -78
- package/packages/components/sh-empty/index.vue +42 -42
- package/packages/components/sh-form/js/props.js +76 -76
- package/packages/components/sh-form/js/useForm.js +229 -229
- package/packages/components/sh-header/index.vue +261 -260
- package/packages/components/sh-icon/css/default/ionicons.svg +869 -869
- package/packages/components/sh-icon/css/font/iconfont.json +247 -247
- package/packages/components/sh-icon/index.vue +41 -41
- package/packages/components/sh-image/index.vue +133 -133
- package/packages/components/sh-list/index.vue +146 -146
- package/packages/components/sh-loading/index.vue +53 -53
- package/packages/components/sh-modal/index.vue +188 -188
- package/packages/components/sh-noticebar/index.vue +215 -215
- package/packages/components/sh-poptip/index.vue +597 -597
- package/packages/components/sh-progress/index.vue +276 -276
- package/packages/components/sh-pull-refresh/index.vue +289 -289
- package/packages/components/sh-result/index.vue +114 -114
- package/packages/components/sh-row/index.vue +66 -66
- package/packages/components/sh-split/components/trigger.vue +33 -33
- package/packages/components/sh-split/index.vue +342 -342
- package/packages/components/sh-table/components/importModal.vue +363 -363
- package/packages/components/sh-table/components/sh-column.vue +68 -68
- package/packages/components/sh-table/js/excel_to_json.js +313 -313
- package/packages/components/sh-table/js/props.js +305 -305
- package/packages/components/sh-table/js/tableMethods.js +167 -167
- package/packages/components/sh-table/js/useTable.js +636 -636
- package/packages/components/sh-table/table.vue +217 -217
- package/packages/components/sh-tabs/index.vue +426 -426
- package/packages/components/sh-tag/index.vue +168 -168
- package/packages/components/sh-toolbar/index.vue +182 -182
- package/packages/components/sh-tree/components/table-tree.vue +289 -289
- package/packages/components/sh-tree/mixin/treeProps.js +122 -122
- package/packages/components/sh-upload/index.vue +535 -535
- package/packages/components/sh-water-fall/index.vue +80 -80
- package/packages/components/sh-water-mark/index.vue +96 -96
- package/packages/css/index.js +4 -4
- package/packages/directive/index.js +19 -19
- package/packages/directive/module/click-out.js +14 -14
- package/packages/directive/module/draggable.js +42 -42
- package/packages/directive/module/line-clamp.js +22 -22
- package/packages/directive/module/prevent-click.js +18 -18
- package/packages/directive/module/resize.js +14 -14
- package/packages/directive/module/ripple.js +166 -166
- package/packages/index.js +39 -39
- package/packages/mixin/index.js +86 -86
- package/packages/other/sh-cron-modal/components/cron-content.vue +294 -294
- package/packages/other/sh-cron-modal/index.vue +81 -81
- package/packages/other/sh-cron-modal/mixin/cron-emits.js +1 -1
- package/packages/other/sh-cron-modal/mixin/cron-props.js +9 -9
- package/packages/other/sh-cron-modal/tabs/cron-week-box.vue +126 -126
- package/packages/other/sh-menu/index.vue +326 -326
- package/packages/other/sh-menu/menu-group-content.vue +136 -136
- package/packages/other/sh-menu/menu-item-content.vue +71 -71
- package/packages/other/sh-menu-card/index.vue +250 -250
- package/packages/other/sh-menu-card/menu-box.vue +87 -87
- package/packages/other/sh-preview/components/sh-excel.vue +163 -163
- package/packages/other/sh-preview/js/data-hook.js +41 -41
- package/packages/other/sh-preview/js/data-props.js +15 -15
- package/packages/other/sh-system-tip/index.vue +115 -115
- package/packages/utils/resize.js +69 -70
- package/packages/utils/transfer-queue.js +12 -12
- package/packages/vxeTable/index.js +193 -184
- package/packages/vxeTable/plugins/export.js +450 -450
- package/packages/vxeTable/render/cell/vxe-render-img.vue +27 -27
- package/packages/vxeTable/render/cell/vxe-render-table.vue +51 -51
- package/packages/vxeTable/render/cell/vxe-render-time.vue +44 -44
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +70 -70
- package/packages/vxeTable/render/filters/vxe-filter-input.vue +26 -26
- package/packages/vxeTable/render/filters/vxe-filter-time.vue +26 -26
- package/packages/vxeTable/render/globalRenders.jsx +514 -514
- package/packages/vxeTable/render/mixin/cell-hooks.js +198 -198
- package/packages/vxeTable/render/mixin/cell-props.js +23 -23
- package/packages/vxeTable/render/mixin/filter-hooks.js +46 -46
- package/tsconfig.json +25 -0
- package/types/component.d.ts +1 -0
- package/types/index.ts +0 -0
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<sh-modal v-bind="modalConfig" @close="onModalClose" @confirm="onModalConfim">
|
|
3
|
-
<cron-content v-model="cronValue" :disabled="disabled"></cron-content>
|
|
4
|
-
</sh-modal>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { defineComponent, computed, getCurrentInstance, ref, reactive, watch, onBeforeMount } from 'vue'
|
|
9
|
-
import cronContent from './components/cron-content.vue'
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
name: 'ShCronModal',
|
|
12
|
-
components: {
|
|
13
|
-
cronContent
|
|
14
|
-
},
|
|
15
|
-
props: {
|
|
16
|
-
modelValue: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ''
|
|
19
|
-
},
|
|
20
|
-
visible: {
|
|
21
|
-
type: Boolean
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
type: Boolean
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
emits: ['update:modelValue', 'update:visible', 'submit'],
|
|
28
|
-
setup(props, context) {
|
|
29
|
-
const { proxy } = getCurrentInstance()
|
|
30
|
-
const { $vUtils } = proxy
|
|
31
|
-
const { emit, slots } = context
|
|
32
|
-
|
|
33
|
-
const cronValue = ref('')
|
|
34
|
-
const modalConfig = reactive({
|
|
35
|
-
loading: false,
|
|
36
|
-
width: '70%',
|
|
37
|
-
title: 'cron表达式',
|
|
38
|
-
visible: props.visible
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
const emitValue = () => {
|
|
42
|
-
emit('update:modelValue', cronValue.value)
|
|
43
|
-
emit('submit', cronValue.value)
|
|
44
|
-
}
|
|
45
|
-
// 提交
|
|
46
|
-
const onModalConfim = () => {
|
|
47
|
-
emitValue()
|
|
48
|
-
onModalClose()
|
|
49
|
-
}
|
|
50
|
-
// 关闭
|
|
51
|
-
const onModalClose = () => {
|
|
52
|
-
emit('update:visible', false)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
watch(
|
|
56
|
-
() => props.modelValue,
|
|
57
|
-
nv => {
|
|
58
|
-
cronValue.value = nv
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
watch(
|
|
62
|
-
() => props.visible,
|
|
63
|
-
nv => {
|
|
64
|
-
modalConfig.visible = nv
|
|
65
|
-
cronValue.value = props.modelValue
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
modalConfig,
|
|
71
|
-
cronValue,
|
|
72
|
-
onModalClose,
|
|
73
|
-
onModalConfim
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
</script>
|
|
78
|
-
|
|
79
|
-
<style lang="scss">
|
|
80
|
-
@import './css/index.scss';
|
|
81
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<sh-modal v-bind="modalConfig" @close="onModalClose" @confirm="onModalConfim">
|
|
3
|
+
<cron-content v-model="cronValue" :disabled="disabled"></cron-content>
|
|
4
|
+
</sh-modal>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { defineComponent, computed, getCurrentInstance, ref, reactive, watch, onBeforeMount } from 'vue'
|
|
9
|
+
import cronContent from './components/cron-content.vue'
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
name: 'ShCronModal',
|
|
12
|
+
components: {
|
|
13
|
+
cronContent
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
visible: {
|
|
21
|
+
type: Boolean
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ['update:modelValue', 'update:visible', 'submit'],
|
|
28
|
+
setup(props, context) {
|
|
29
|
+
const { proxy } = getCurrentInstance()
|
|
30
|
+
const { $vUtils } = proxy
|
|
31
|
+
const { emit, slots } = context
|
|
32
|
+
|
|
33
|
+
const cronValue = ref('')
|
|
34
|
+
const modalConfig = reactive({
|
|
35
|
+
loading: false,
|
|
36
|
+
width: '70%',
|
|
37
|
+
title: 'cron表达式',
|
|
38
|
+
visible: props.visible
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const emitValue = () => {
|
|
42
|
+
emit('update:modelValue', cronValue.value)
|
|
43
|
+
emit('submit', cronValue.value)
|
|
44
|
+
}
|
|
45
|
+
// 提交
|
|
46
|
+
const onModalConfim = () => {
|
|
47
|
+
emitValue()
|
|
48
|
+
onModalClose()
|
|
49
|
+
}
|
|
50
|
+
// 关闭
|
|
51
|
+
const onModalClose = () => {
|
|
52
|
+
emit('update:visible', false)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
watch(
|
|
56
|
+
() => props.modelValue,
|
|
57
|
+
nv => {
|
|
58
|
+
cronValue.value = nv
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
watch(
|
|
62
|
+
() => props.visible,
|
|
63
|
+
nv => {
|
|
64
|
+
modalConfig.visible = nv
|
|
65
|
+
cronValue.value = props.modelValue
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
modalConfig,
|
|
71
|
+
cronValue,
|
|
72
|
+
onModalClose,
|
|
73
|
+
onModalConfim
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss">
|
|
80
|
+
@import './css/index.scss';
|
|
81
|
+
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default ['update:modelValue', 'change']
|
|
1
|
+
export default ['update:modelValue', 'change']
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
modelValue: {
|
|
3
|
-
type: String,
|
|
4
|
-
default: '*'
|
|
5
|
-
},
|
|
6
|
-
disabled: {
|
|
7
|
-
type: Boolean
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: String,
|
|
4
|
+
default: '*'
|
|
5
|
+
},
|
|
6
|
+
disabled: {
|
|
7
|
+
type: Boolean
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="sh-cron-config-list">
|
|
3
|
-
<vxe-radio-group v-model="type">
|
|
4
|
-
<div class="item">
|
|
5
|
-
<vxe-radio :label="TypeEnum.unset" v-bind="beforeRadioAttrs">不设置</vxe-radio>
|
|
6
|
-
<span class="tip-info">日和周只能设置其中之一</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="item">
|
|
9
|
-
<vxe-radio :label="TypeEnum.range" v-bind="beforeRadioAttrs">区间</vxe-radio>
|
|
10
|
-
<span> 从 </span>
|
|
11
|
-
<vxe-select v-model="valueRange.start" :options="weekOptions" v-bind="typeRangeSelectAttrs" />
|
|
12
|
-
<span> 至 </span>
|
|
13
|
-
<vxe-select v-model="valueRange.end" :options="weekOptions" v-bind="typeRangeSelectAttrs" />
|
|
14
|
-
</div>
|
|
15
|
-
<div class="item">
|
|
16
|
-
<vxe-radio :label="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</vxe-radio>
|
|
17
|
-
<span> 从 </span>
|
|
18
|
-
<vxe-select v-model="valueLoop.start" :options="weekOptions" v-bind="typeLoopSelectAttrs" />
|
|
19
|
-
<span> 至 </span>
|
|
20
|
-
<vxe-input v-model="valueLoop.interval" v-bind="typeLoopAttrs" />
|
|
21
|
-
</div>
|
|
22
|
-
<div class="item">
|
|
23
|
-
<vxe-radio :label="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</vxe-radio>
|
|
24
|
-
<div class="list">
|
|
25
|
-
<vxe-checkbox-group v-model="valueList">
|
|
26
|
-
<template v-for="i in specifyRange" :key="i">
|
|
27
|
-
<vxe-checkbox :label="i" v-bind="typeSpecifyAttrs">{{ i }}</vxe-checkbox>
|
|
28
|
-
</template>
|
|
29
|
-
</vxe-checkbox-group>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</vxe-radio-group>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import { defineComponent, computed, getCurrentInstance, watch } from 'vue'
|
|
38
|
-
import cronProps from '../mixin/cron-props'
|
|
39
|
-
import cronHooks from '../mixin/cron-hooks'
|
|
40
|
-
import cronEmits from '../mixin/cron-emits'
|
|
41
|
-
const WEEK_MAP_EN = {
|
|
42
|
-
1: 'SUN',
|
|
43
|
-
2: 'MON',
|
|
44
|
-
3: 'TUE',
|
|
45
|
-
4: 'WED',
|
|
46
|
-
5: 'THU',
|
|
47
|
-
6: 'FRI',
|
|
48
|
-
7: 'SAT'
|
|
49
|
-
}
|
|
50
|
-
const WEEK_MAP_CN = {
|
|
51
|
-
1: '周日',
|
|
52
|
-
2: '周一',
|
|
53
|
-
3: '周二',
|
|
54
|
-
4: '周三',
|
|
55
|
-
5: '周四',
|
|
56
|
-
6: '周五',
|
|
57
|
-
7: '周六'
|
|
58
|
-
}
|
|
59
|
-
export default defineComponent({
|
|
60
|
-
name: 'CronWeekBox',
|
|
61
|
-
props: {
|
|
62
|
-
...cronProps,
|
|
63
|
-
day: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: '*'
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
emits: cronEmits,
|
|
69
|
-
setup(props, context) {
|
|
70
|
-
const { proxy } = getCurrentInstance()
|
|
71
|
-
const { $vUtils } = proxy
|
|
72
|
-
const { emit, slots } = context
|
|
73
|
-
|
|
74
|
-
const useCron = cronHooks(props, context, proxy, {
|
|
75
|
-
defaultValue: '*',
|
|
76
|
-
minValue: 1,
|
|
77
|
-
maxValue: 7,
|
|
78
|
-
valueRange: { start: 1, end: 7 },
|
|
79
|
-
valueLoop: { start: 2, interval: 1 }
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const disabledChoice = computed(() => {
|
|
83
|
-
return (props.day && props.day !== '?') || props.disabled
|
|
84
|
-
})
|
|
85
|
-
const weekOptions = computed(() => {
|
|
86
|
-
let options = []
|
|
87
|
-
for (let weekKey of Object.keys(WEEK_MAP_CN)) {
|
|
88
|
-
let weekName = WEEK_MAP_CN[weekKey]
|
|
89
|
-
options.push({
|
|
90
|
-
value: Number.parseInt(weekKey),
|
|
91
|
-
label: weekName
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
return options
|
|
95
|
-
})
|
|
96
|
-
const typeRangeSelectAttrs = computed(() => {
|
|
97
|
-
return {
|
|
98
|
-
class: ['cron-item-input'],
|
|
99
|
-
disabled: useCron.typeRangeAttrs.value.disabled
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
const typeLoopSelectAttrs = computed(() => {
|
|
103
|
-
return {
|
|
104
|
-
class: ['cron-item-input'],
|
|
105
|
-
disabled: useCron.typeLoopAttrs.value.disabled
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
watch(
|
|
110
|
-
() => props.day,
|
|
111
|
-
() => {
|
|
112
|
-
useCron.updateValue(disabledChoice.value ? '?' : useCron.computeValue.value)
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
...useCron,
|
|
118
|
-
weekOptions,
|
|
119
|
-
typeRangeSelectAttrs,
|
|
120
|
-
typeLoopSelectAttrs
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<style scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-cron-config-list">
|
|
3
|
+
<vxe-radio-group v-model="type">
|
|
4
|
+
<div class="item">
|
|
5
|
+
<vxe-radio :label="TypeEnum.unset" v-bind="beforeRadioAttrs">不设置</vxe-radio>
|
|
6
|
+
<span class="tip-info">日和周只能设置其中之一</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="item">
|
|
9
|
+
<vxe-radio :label="TypeEnum.range" v-bind="beforeRadioAttrs">区间</vxe-radio>
|
|
10
|
+
<span> 从 </span>
|
|
11
|
+
<vxe-select v-model="valueRange.start" :options="weekOptions" v-bind="typeRangeSelectAttrs" />
|
|
12
|
+
<span> 至 </span>
|
|
13
|
+
<vxe-select v-model="valueRange.end" :options="weekOptions" v-bind="typeRangeSelectAttrs" />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="item">
|
|
16
|
+
<vxe-radio :label="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</vxe-radio>
|
|
17
|
+
<span> 从 </span>
|
|
18
|
+
<vxe-select v-model="valueLoop.start" :options="weekOptions" v-bind="typeLoopSelectAttrs" />
|
|
19
|
+
<span> 至 </span>
|
|
20
|
+
<vxe-input v-model="valueLoop.interval" v-bind="typeLoopAttrs" />
|
|
21
|
+
</div>
|
|
22
|
+
<div class="item">
|
|
23
|
+
<vxe-radio :label="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</vxe-radio>
|
|
24
|
+
<div class="list">
|
|
25
|
+
<vxe-checkbox-group v-model="valueList">
|
|
26
|
+
<template v-for="i in specifyRange" :key="i">
|
|
27
|
+
<vxe-checkbox :label="i" v-bind="typeSpecifyAttrs">{{ i }}</vxe-checkbox>
|
|
28
|
+
</template>
|
|
29
|
+
</vxe-checkbox-group>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</vxe-radio-group>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import { defineComponent, computed, getCurrentInstance, watch } from 'vue'
|
|
38
|
+
import cronProps from '../mixin/cron-props'
|
|
39
|
+
import cronHooks from '../mixin/cron-hooks'
|
|
40
|
+
import cronEmits from '../mixin/cron-emits'
|
|
41
|
+
const WEEK_MAP_EN = {
|
|
42
|
+
1: 'SUN',
|
|
43
|
+
2: 'MON',
|
|
44
|
+
3: 'TUE',
|
|
45
|
+
4: 'WED',
|
|
46
|
+
5: 'THU',
|
|
47
|
+
6: 'FRI',
|
|
48
|
+
7: 'SAT'
|
|
49
|
+
}
|
|
50
|
+
const WEEK_MAP_CN = {
|
|
51
|
+
1: '周日',
|
|
52
|
+
2: '周一',
|
|
53
|
+
3: '周二',
|
|
54
|
+
4: '周三',
|
|
55
|
+
5: '周四',
|
|
56
|
+
6: '周五',
|
|
57
|
+
7: '周六'
|
|
58
|
+
}
|
|
59
|
+
export default defineComponent({
|
|
60
|
+
name: 'CronWeekBox',
|
|
61
|
+
props: {
|
|
62
|
+
...cronProps,
|
|
63
|
+
day: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '*'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
emits: cronEmits,
|
|
69
|
+
setup(props, context) {
|
|
70
|
+
const { proxy } = getCurrentInstance()
|
|
71
|
+
const { $vUtils } = proxy
|
|
72
|
+
const { emit, slots } = context
|
|
73
|
+
|
|
74
|
+
const useCron = cronHooks(props, context, proxy, {
|
|
75
|
+
defaultValue: '*',
|
|
76
|
+
minValue: 1,
|
|
77
|
+
maxValue: 7,
|
|
78
|
+
valueRange: { start: 1, end: 7 },
|
|
79
|
+
valueLoop: { start: 2, interval: 1 }
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const disabledChoice = computed(() => {
|
|
83
|
+
return (props.day && props.day !== '?') || props.disabled
|
|
84
|
+
})
|
|
85
|
+
const weekOptions = computed(() => {
|
|
86
|
+
let options = []
|
|
87
|
+
for (let weekKey of Object.keys(WEEK_MAP_CN)) {
|
|
88
|
+
let weekName = WEEK_MAP_CN[weekKey]
|
|
89
|
+
options.push({
|
|
90
|
+
value: Number.parseInt(weekKey),
|
|
91
|
+
label: weekName
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
return options
|
|
95
|
+
})
|
|
96
|
+
const typeRangeSelectAttrs = computed(() => {
|
|
97
|
+
return {
|
|
98
|
+
class: ['cron-item-input'],
|
|
99
|
+
disabled: useCron.typeRangeAttrs.value.disabled
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
const typeLoopSelectAttrs = computed(() => {
|
|
103
|
+
return {
|
|
104
|
+
class: ['cron-item-input'],
|
|
105
|
+
disabled: useCron.typeLoopAttrs.value.disabled
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
watch(
|
|
110
|
+
() => props.day,
|
|
111
|
+
() => {
|
|
112
|
+
useCron.updateValue(disabledChoice.value ? '?' : useCron.computeValue.value)
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
...useCron,
|
|
118
|
+
weekOptions,
|
|
119
|
+
typeRangeSelectAttrs,
|
|
120
|
+
typeLoopSelectAttrs
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style scoped></style>
|