From 09c5667700fb6da21d29c41e51fa5482a4b40bc9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 24 十月 2025 11:22:22 +0800
Subject: [PATCH] 新公司部署相关配置修改
---
src/views/production/components/useDialog.js | 96 +++++++++++++++++++++++++----------------------
1 files changed, 51 insertions(+), 45 deletions(-)
diff --git a/src/views/production/components/useDialog.js b/src/views/production/components/useDialog.js
index c3694b3..42e4546 100644
--- a/src/views/production/components/useDialog.js
+++ b/src/views/production/components/useDialog.js
@@ -2,55 +2,61 @@
* 瀵硅瘽妗嗙鐞嗙粍鍚堝紡鍑芥暟
* 鎻愪緵瀵硅瘽妗嗙殑鎵撳紑銆佸叧闂�佹暟鎹鐞嗙瓑鍔熻兘
*/
-import { ref } from 'vue';
+import {ref} from 'vue';
export function useDialog() {
- const dialogVisible = ref(false);
- const dialogType = ref('add');
- const dialogRef = ref(null);
- const currentRowData = ref(null);
+ const dialogVisible = ref(false);
+ const dialogType = ref('add');
+ const dialogRef = ref(null);
+ const currentRowData = ref(null);
- // 鎵撳紑瀵硅瘽妗�
- const openDialog = (type = 'add', rowData = null) => {
- dialogType.value = type;
- currentRowData.value = rowData;
- dialogVisible.value = true;
-
- // 璋冪敤瀵硅瘽妗嗙粍浠剁殑鍒濆鍖栨柟娉�
- if (dialogRef.value) {
- if (type === 'add') {
- dialogRef.value.Initialization?.();
- } else if (type === 'edit' && rowData) {
- dialogRef.value.editInitialization?.(rowData);
- }
- }
- };
+ // 鎵撳紑瀵硅瘽妗�
+ const openDialog = (type = 'add', rowData = null) => {
+ dialogType.value = type;
+ currentRowData.value = rowData;
+ dialogVisible.value = true;
- // 鍏抽棴瀵硅瘽妗�
- const closeDialog = () => {
- dialogVisible.value = false;
- dialogType.value = 'add';
- currentRowData.value = null;
- };
+ // 璋冪敤瀵硅瘽妗嗙粍浠剁殑鍒濆鍖栨柟娉�
+ if (dialogRef.value) {
+ if (type === 'add') {
+ dialogRef.value.Initialization?.();
+ } else if ((type === 'edit' || type === 'viewRow') && rowData) {
+ dialogRef.value.editInitialization?.(type,rowData);
+ }
+ }
+ };
+ const viewRow = (type,rowData) => {
+ dialogType.value = type;
+ currentRowData.value = rowData;
+ dialogVisible.value = true;
+ openDialog('viewRow', rowData);
+ };
+ // 鍏抽棴瀵硅瘽妗�
+ const closeDialog = () => {
+ dialogVisible.value = false;
+ dialogType.value = 'add';
+ currentRowData.value = null;
+ };
- // 瀵硅瘽妗嗘垚鍔熷洖璋�
- const handleDialogSuccess = (callback) => {
- closeDialog();
- if (typeof callback === 'function') {
- callback();
- }
- };
+ // 瀵硅瘽妗嗘垚鍔熷洖璋�
+ const handleDialogSuccess = (callback) => {
+ closeDialog();
+ if (typeof callback === 'function') {
+ callback();
+ }
+ };
- return {
- // 鐘舵��
- dialogVisible,
- dialogType,
- dialogRef,
- currentRowData,
-
- // 鏂规硶
- openDialog,
- closeDialog,
- handleDialogSuccess
- };
+ return {
+ // 鐘舵��
+ dialogVisible,
+ dialogType,
+ dialogRef,
+ currentRowData,
+
+ // 鏂规硶
+ openDialog,
+ closeDialog,
+ handleDialogSuccess,
+ viewRow
+ };
}
--
Gitblit v1.9.3