up.
This commit is contained in:
parent
a6d9063d52
commit
41600443ed
@ -19,6 +19,9 @@ export function strToValue(type: string, value: string): any {
|
|||||||
return value.split(",");
|
return value.split(",");
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
|
case 'date':
|
||||||
|
case 'datetime':
|
||||||
|
return null;
|
||||||
default:
|
default:
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
@ -54,6 +57,10 @@ export function strToBind(type: string, option: string): any {
|
|||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
|
case 'date':
|
||||||
|
return {format: 'YYYY-MM-DD'}
|
||||||
|
case 'datetime':
|
||||||
|
return {format: 'YYYY-MM-DD HH:mm:ss'}
|
||||||
default:
|
default:
|
||||||
if (option) {
|
if (option) {
|
||||||
return JSON.parse(option);
|
return JSON.parse(option);
|
||||||
|
|||||||
@ -40,6 +40,12 @@
|
|||||||
<el-radio v-for="item in (dataOptions || [])" :label="item.label" :value="item.value" />
|
<el-radio v-for="item in (dataOptions || [])" :label="item.label" :value="item.value" />
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="props.type === 'date'">
|
||||||
|
<el-date-picker v-model="dataValue" type="date" :placeholder="'请选择' + props.title" v-bind="dataBind"/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="props.type === 'datetime'">
|
||||||
|
<el-date-picker v-model="dataValue" type="datetime" :placeholder="'请选择' + props.title" v-bind="dataBind"/>
|
||||||
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user