From a24b03e43fc0eac91dc5f825964bec92c425a66c Mon Sep 17 00:00:00 2001 From: liting <994745334@qq.com> Date: Sun, 30 Jun 2024 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialog/src/Dialog.vue | 3 +- src/styles/index.scss | 2 +- src/utils/formatTime.ts | 11 +- src/views/acceptance/acceptance/MainForm.vue | 8 +- .../acceptance/components/CheckForm.vue | 10 +- src/views/acceptance/acceptance/index.vue | 4 +- src/views/change/change/MainForm.vue | 3 + src/views/contract/contract/MainForm.vue | 101 +++++---- .../contract/components/CheckForm.vue | 10 +- .../contract/components/DeviceForm.vue | 10 +- .../contract/components/FundsForm copy 2.vue | 202 ++++++++++++++++++ .../contract/contract/components/InfoForm.vue | 44 ++-- .../contract/components/ParticipantForm.vue | 53 +++-- .../contract/contract/components/PlanForm.vue | 14 +- .../contract/components/TargetForm.vue | 10 +- .../contract/contract/components/UnitForm.vue | 18 +- src/views/contract/contract/index.vue | 30 ++- 17 files changed, 414 insertions(+), 119 deletions(-) create mode 100644 src/views/contract/contract/components/FundsForm copy 2.vue diff --git a/src/components/Dialog/src/Dialog.vue b/src/components/Dialog/src/Dialog.vue index 64db1d961..a2f1270bc 100644 --- a/src/components/Dialog/src/Dialog.vue +++ b/src/components/Dialog/src/Dialog.vue @@ -7,6 +7,7 @@ const slots = useSlots() const props = defineProps({ modelValue: propTypes.bool.def(false), + Fullscreen:propTypes.bool.def(true), title: propTypes.string.def('Dialog'), fullscreen: propTypes.bool.def(false), width: propTypes.oneOfType([String, Number]).def('40%'), @@ -26,7 +27,7 @@ const getBindValue = computed(() => { return obj }) -const isFullscreen = ref(true) + const isFullscreen = ref(props.Fullscreen) const toggleFull = () => { isFullscreen.value = !unref(isFullscreen) diff --git a/src/styles/index.scss b/src/styles/index.scss index 8c771b449..56ebd7eaa 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -70,4 +70,4 @@ legend { background: #1e4dad; height: 8px; width: 52px; -} \ No newline at end of file +} diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index ed434cb05..8814a1d35 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -211,7 +211,16 @@ export function dateFormatter(_row: any, _column: TableColumnCtx, cellValue export function dateFormatter2(_row: any, _column: TableColumnCtx, cellValue: any): string { return cellValue ? formatDate(cellValue, 'YYYY-MM-DD') : '' } - +/** + * element plus 的时间 Formatter 实现,使用 YYYY 格式 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +export function dateFormatter3(cellValue: any): string { + return cellValue ? formatDate(cellValue, 'YYYY') : '' +} /** * 设置起始日期,时间为00:00:00 * @param param 传入日期 diff --git a/src/views/acceptance/acceptance/MainForm.vue b/src/views/acceptance/acceptance/MainForm.vue index 8e5804997..4e0b83793 100644 --- a/src/views/acceptance/acceptance/MainForm.vue +++ b/src/views/acceptance/acceptance/MainForm.vue @@ -77,11 +77,11 @@ - + @@ -91,11 +91,11 @@ - + diff --git a/src/views/acceptance/acceptance/components/CheckForm.vue b/src/views/acceptance/acceptance/components/CheckForm.vue index 9be554bb7..59a6c23bf 100644 --- a/src/views/acceptance/acceptance/components/CheckForm.vue +++ b/src/views/acceptance/acceptance/components/CheckForm.vue @@ -102,9 +102,15 @@ const handleAdd = () => { formData.value.push(row) } +const message = useMessage() // 消息弹窗 /** 删除按钮操作 */ -const handleDelete = (index) => { - formData.value.splice(index, 1) +const handleDelete = async (index) => { + try { + // 删除的二次确认 + await message.delConfirm() + // 发起删除 + formData.value.splice(index, 1) + } catch {} } /** 表单校验 */ diff --git a/src/views/acceptance/acceptance/index.vue b/src/views/acceptance/acceptance/index.vue index 9dbab5eb0..26cac6358 100644 --- a/src/views/acceptance/acceptance/index.vue +++ b/src/views/acceptance/acceptance/index.vue @@ -322,9 +322,9 @@ diff --git a/src/views/change/change/MainForm.vue b/src/views/change/change/MainForm.vue index 1343707bc..e3d7ded24 100644 --- a/src/views/change/change/MainForm.vue +++ b/src/views/change/change/MainForm.vue @@ -125,6 +125,9 @@ const open = async (type: string, id?: number) => { formLoading.value = true try { formData.value = await MainApi.getMain(id) + if(formData.value.changeType){ + formData.value.changeType = formData.value.changeType.split(",") + } } finally { formLoading.value = false } diff --git a/src/views/contract/contract/MainForm.vue b/src/views/contract/contract/MainForm.vue index ee3b60ceb..a935450a9 100644 --- a/src/views/contract/contract/MainForm.vue +++ b/src/views/contract/contract/MainForm.vue @@ -14,9 +14,9 @@ - + - @@ -27,7 +27,7 @@ - @@ -44,14 +44,14 @@ - - - + + + - @@ -61,8 +61,8 @@ - + @@ -72,22 +72,22 @@ - + - + - + @@ -114,11 +114,8 @@ - - - - - @@ -126,7 +123,7 @@ - + + \ No newline at end of file diff --git a/src/views/contract/contract/components/InfoForm.vue b/src/views/contract/contract/components/InfoForm.vue index 079307c33..f39ee4839 100644 --- a/src/views/contract/contract/components/InfoForm.vue +++ b/src/views/contract/contract/components/InfoForm.vue @@ -1,12 +1,6 @@