DEdit 添加 日期组件

szh-new
张同海 3 months ago
parent f702606541
commit 814f056dfb

@ -11,6 +11,7 @@
import { useAttrs } from '/@/hooks/core/useAttrs'
import { useI18n } from '/@/hooks/web/useI18n'
import { useAppStore } from '/@/store/modules/app'
import dayjs from 'dayjs'
const appStore = useAppStore()
type OptionsItem = { label: string; value: string; disabled?: boolean }
export default defineComponent({
@ -50,7 +51,9 @@
const attrs = useAttrs()
const { t } = useI18n()
const [state] = useRuleFormItem(props, 'value', 'change')
function isDate(value) {
return value instanceof Date || Object.prototype.toString.call(value) === '[object Date]'
}
function GetState() {
let RData: any = null
if (state.value) {
@ -78,6 +81,8 @@
RData = item[props.labelField]
}
})
} else if (state.value.$d && state.value.$isDayjsObject) {
RData = dayjs(state.value.$d).format('YYYY-MM-DD')
} else {
if (props.label == '来源明细') {
appStore.getSourceData.forEach((item) => {
@ -105,6 +110,7 @@
function CilckEdit() {
emit('edit')
}
return { attrs, t, showTooltip, props, state, CilckEdit, GetState }
},
})

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save