From 18a0d5fc30bb203b5dcaca81df263072d46afadc Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 4 Nov 2025 13:11:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AD=90=E8=A1=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E8=A1=8C=E8=AE=BE=E7=BD=AE=E5=8F=8A?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lowCode/tablePage.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/lowCode/tablePage.vue b/src/components/lowCode/tablePage.vue index 2668e81..31a8ab3 100644 --- a/src/components/lowCode/tablePage.vue +++ b/src/components/lowCode/tablePage.vue @@ -9,6 +9,7 @@ import { } from '@/api/lowCode/utils'; import { jsonParseStringify } from '@/utils/lowCode/item/index' import { SCOPE } from 'element-plus' +import { onMounted,ref } from 'vue'; import SvgIcon from '@/components/svgIcon/index.vue' const props = withDefaults( defineProps<{ @@ -39,6 +40,21 @@ const type = computed(() => { const editDisabled = computed(() => { return formProps.value.type === 2 && props.data.config?.editDisabled }) +const defaultOneFlag = ref(true) +if(type.value==1 && props.data.control.defaultOne==2){ + defaultOneFlag.value = false +} +onMounted(()=>{ + /* alert(type.value) + alert(props.data.control.defaultOne) */ + setTimeout(()=>{ + if(defaultOneFlag){ + addColumn() + } + },200) + +}) + const addColumn = () => { console.log("如果编辑页禁用时--------->",tableDataNew.value) const temp: any = {} From 098fa9e583e8d2130f9448bbb06d3d616fa09e98 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 4 Nov 2025 14:22:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Diphone=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lowCode/assistant/datePicker.vue | 87 +++++++++++++++---- 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/src/components/lowCode/assistant/datePicker.vue b/src/components/lowCode/assistant/datePicker.vue index 5cf15c7..d27020f 100644 --- a/src/components/lowCode/assistant/datePicker.vue +++ b/src/components/lowCode/assistant/datePicker.vue @@ -621,6 +621,57 @@ function getTimestamp() { return timestamp; } + + + + + +// 使用 computed 替代方法调用 +const displayText = computed(() => { + if (!props.modelValue) { + hasValue.value = false + return "请选择时间" + } + + const val = new Date(parseInt(props.modelValue, 10)) + if (isNaN(val.getTime())) { + hasValue.value = false + return "请选择时间" + } + + hasValue.value = true + return formatDate(val, props.data.control.type, props.data.control.valueFormat) +}) + +// 提取格式化逻辑到独立函数 +function formatDate(date: Date, group: string, format: string) { + const validDate = dayJs(date) + if (!validDate.isValid()) return "请选择时间" + + switch (group) { + case "year": + return format === "x" + ? validDate.format('YYYY') + "年" + : validDate.format(format) + "年" + case "month": + return format === "x" + ? validDate.format('YYYY年MM月') + : validDate.format(format) + "月" + case "datetime": + return format === "x" + ? validDate.format('YYYY年MM月DD日 HH时mm分ss秒') + : validDate.format(format) + case "week": + return format === "x" + ? validDate.format('YYYY年 第ww周') + : validDate.format(format) + default: + return format === "x" + ? validDate.format('YYYY年MM月DD日') + : validDate.format(format) + } +} +