

<script>
/* eslint-disable */
// sd-skip-auto-import
import sdTimestampPicker from"../sd-timestamp-picker";import components from"./_import-components/sd-datetime-import";export const metaInfo={caption:"日期时间",component:sdTimestampPicker,icon:"calendar",order:900,category:"basic"};export const fieldProps={dataType:"date",attr:{showDate:"true"}};export function updateOnPreview(t){if("true"===t.attr.currentAsDefaultValue)t.attr.defaultValue=Date.now().toString()}var _render=function t(){var e=this,o=e._self._c;return o("div",[o("a-form-model-item",[o("sd-complex-label",{attrs:{slot:"label"},slot:"label"},[o("sd-ugly-checkbox",{model:{value:e.component.attr.showDate,callback:function(t){e.$set(e.component.attr,"showDate",t)},expression:"component.attr.showDate"}},[e._v("显示日期")]),o("sd-ugly-checkbox",{attrs:{slot:"right"},slot:"right",model:{value:e.component.attr.showTime,callback:function(t){e.$set(e.component.attr,"showTime",t)},expression:"component.attr.showTime"}},[e._v("显示时间")])],1)],1),o("a-form-model-item",[o("sd-complex-label",{attrs:{slot:"label"},slot:"label"},[e._v(" 默认值 "),o("sd-ugly-checkbox",{attrs:{slot:"right"},slot:"right",model:{value:e.component.attr.currentAsDefaultValue,callback:function(t){e.$set(e.component.attr,"currentAsDefaultValue",t)},expression:"component.attr.currentAsDefaultValue"}},[e._v("填报时间")])],1),"true"!==e.component.attr.currentAsDefaultValue?o("sd-timestamp-picker",{attrs:{"designer-data":e.component}}):e._e()],1),e.dateFieldsBefore.length?o("a-form-model-item",{attrs:{label:"选择范围限制"}},[o("a-select",{attrs:{options:e.dateFieldsBefore,"allow-clear":""},model:{value:e.component.attrFD.formItemProps.rangeAfter,callback:function(t){e.$set(e.component.attrFD.formItemProps,"rangeAfter",t)},expression:"component.attrFD.formItemProps.rangeAfter"}})],1):e._e(),o("sd-placeholder-editor",{attrs:{component:e.component}})],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdDatetime",components:components,computed:{dateFieldsBefore(){let t=this.componentInstances.filter(((t,e)=>t.attrFD.cid===this.component.attrFD.cid));const e=[];t.forEach((t=>{const o=t.attrFD.formItemProps.rangeAfter;if(o){e.push(o);e.push(t.name)}}));const o=t.indexOf(this.component);t=t.filter(((t,r)=>{if(r>=o)return false;if(t.name===this.component.attrFD.formItemProps.rangeAfter)return true;return!e.includes(t.name)}));return t.map((t=>({label:"晚于"+t.caption,value:t.name})))}},methods:{},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
