|
@@ -7,7 +7,20 @@ const formDesignerStore = useFormDesignerStore()
|
|
const { formProps, formSpan } = storeToRefs(formDesignerStore)
|
|
const { formProps, formSpan } = storeToRefs(formDesignerStore)
|
|
|
|
|
|
// 组件属性
|
|
// 组件属性
|
|
-const compData: any = computed(() => formDesignerStore.curFormItem)
|
|
|
|
|
|
+const compData: any = computed(() => {
|
|
|
|
+ if (formDesignerStore.curFormItem.type == 'time-select') {
|
|
|
|
+ if (formDesignerStore.curFormItem.props.start) {
|
|
|
|
+ selectStart.value = formDesignerStore.curFormItem.props.start
|
|
|
|
+ }
|
|
|
|
+ if (formDesignerStore.curFormItem.props.step) {
|
|
|
|
+ selectStep.value = formDesignerStore.curFormItem.props.step
|
|
|
|
+ }
|
|
|
|
+ if (formDesignerStore.curFormItem.props.end) {
|
|
|
|
+ selectEnd.value = formDesignerStore.curFormItem.props.end
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return formDesignerStore.curFormItem
|
|
|
|
+})
|
|
const handleCompTypeChange = (type: string) => {
|
|
const handleCompTypeChange = (type: string) => {
|
|
let formItem: any
|
|
let formItem: any
|
|
comps.forEach(comp => {
|
|
comps.forEach(comp => {
|
|
@@ -20,6 +33,9 @@ const handleCompTypeChange = (type: string) => {
|
|
formDesignerStore.setCurFormItem(compToFormItem(formItem))
|
|
formDesignerStore.setCurFormItem(compToFormItem(formItem))
|
|
// formDesignerStore.curFormItem.type = type
|
|
// formDesignerStore.curFormItem.type = type
|
|
}
|
|
}
|
|
|
|
+let selectStart = ref('9:00')
|
|
|
|
+let selectEnd = ref('18:30')
|
|
|
|
+let selectStep = ref('00:30')
|
|
|
|
|
|
// 日期类型
|
|
// 日期类型
|
|
const dateType = ref(['year', 'month', 'date', 'dates', 'datetime', 'week', 'datetimerange', 'daterange', 'monthrange'])
|
|
const dateType = ref(['year', 'month', 'date', 'dates', 'datetime', 'week', 'datetimerange', 'daterange', 'monthrange'])
|
|
@@ -39,7 +55,11 @@ const handleAddOption = () => {
|
|
const handleDelOption = (index: number) => {
|
|
const handleDelOption = (index: number) => {
|
|
compData.value.options.splice(index, 1)
|
|
compData.value.options.splice(index, 1)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const setStart = () => {
|
|
|
|
+ compData.value.props.start = selectStart.value
|
|
|
|
+ compData.value.props.step = selectStep.value
|
|
|
|
+ compData.value.props.end = selectEnd.value
|
|
|
|
+}
|
|
const marks = ref({
|
|
const marks = ref({
|
|
6: '6',
|
|
6: '6',
|
|
8: '8',
|
|
8: '8',
|
|
@@ -81,7 +101,7 @@ watch(
|
|
<el-form-item label="组件栅格">
|
|
<el-form-item label="组件栅格">
|
|
<el-slider :max="24" v-model="compData.span" :marks="marks" class="mb-10px"></el-slider>
|
|
<el-slider :max="24" v-model="compData.span" :marks="marks" class="mb-10px"></el-slider>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="默认值" v-if="compData.type !== 'date-picker'">
|
|
|
|
|
|
+ <el-form-item label="默认值" v-if="compData.type !== 'date-picker' && compData.type != 'time-picker'">
|
|
<el-input v-model="compData.value"></el-input>
|
|
<el-input v-model="compData.value"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="列表显示">
|
|
<el-form-item label="列表显示">
|
|
@@ -217,13 +237,13 @@ watch(
|
|
<!-- time-select属性 begin -->
|
|
<!-- time-select属性 begin -->
|
|
<template v-if="compData.type === 'time-select'">
|
|
<template v-if="compData.type === 'time-select'">
|
|
<el-form-item label="起始时间">
|
|
<el-form-item label="起始时间">
|
|
- <el-input v-model="compData.props.start" placeholder="08:30"></el-input>
|
|
|
|
|
|
+ <el-input v-model="selectStart" placeholder="09:00" @blur="setStart"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="结束时间">
|
|
<el-form-item label="结束时间">
|
|
- <el-input v-model="compData.props.end" placeholder="18:30"></el-input>
|
|
|
|
|
|
+ <el-input v-model="selectEnd" placeholder="18:00" @blur="setStart"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="步长">
|
|
<el-form-item label="步长">
|
|
- <el-input v-model="compData.props.step" placeholder="00:15"></el-input>
|
|
|
|
|
|
+ <el-input v-model="selectStep" placeholder="00:30" @blur="setStart"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
<!-- time-select属性 begin -->
|
|
<!-- time-select属性 begin -->
|