From 63b4909ac5d0b7355be211cc7080673b41cdb3cc Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei>
Date: 星期三, 04 三月 2026 14:46:02 +0800
Subject: [PATCH] refactor(module(qa)): 代码重构
---
ruoyi-plus-soybean/src/views/analy/hoister/modules/hoister-data-operate-drawer.vue | 221 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 166 insertions(+), 55 deletions(-)
diff --git a/ruoyi-plus-soybean/src/views/analy/hoister/modules/hoister-data-operate-drawer.vue b/ruoyi-plus-soybean/src/views/analy/hoister/modules/hoister-data-operate-drawer.vue
index 0864f86..594cdd9 100755
--- a/ruoyi-plus-soybean/src/views/analy/hoister/modules/hoister-data-operate-drawer.vue
+++ b/ruoyi-plus-soybean/src/views/analy/hoister/modules/hoister-data-operate-drawer.vue
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
-import { jsonClone } from '~/packages/utils';
import { fetchCreateHoisterData, fetchUpdateHoisterData } from '@/service/api/analy/hoister-data';
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
import { $t } from '@/locales';
+import { jsonClone } from '~/packages/utils';
defineOptions({
name: 'HoisterDataOperateDrawer'
@@ -45,57 +45,53 @@
function createDefaultModel(): Model {
return {
- time: null,
- key: '',
- online: null,
- qty: null,
- tState1: null,
- tState2: null,
- tState3: null,
- tState4: null,
- tState5: null,
- tState6: null,
- tState7: null,
- tState8: null,
- tState9: null,
- tState10: null,
- tState11: null,
- tState12: null,
- pState1: null,
- pState2: null,
- pState3: null,
- pState4: null,
- tQty1: null,
- tQty2: null,
- tQty3: null,
- tQty4: null,
- tQty5: null,
- tQty6: null,
- tQty7: null,
- tQty8: null,
- tQty9: null,
- tQty10: null,
- tQty11: null,
- tQty12: null,
- pQty1: null,
- pQty2: null,
- pQty3: null,
- pQty4: null,
- shift: null,
- equNo: null,
- remark: ''
+ time: null,
+ key: '',
+ online: null,
+ qty: null,
+ tState1: null,
+ tState2: null,
+ tState3: null,
+ tState4: null,
+ tState5: null,
+ tState6: null,
+ tState7: null,
+ tState8: null,
+ tState9: null,
+ tState10: null,
+ tState11: null,
+ tState12: null,
+ pState1: null,
+ pState2: null,
+ pState3: null,
+ pState4: null,
+ tQty1: null,
+ tQty2: null,
+ tQty3: null,
+ tQty4: null,
+ tQty5: null,
+ tQty6: null,
+ tQty7: null,
+ tQty8: null,
+ tQty9: null,
+ tQty10: null,
+ tQty11: null,
+ tQty12: null,
+ pQty1: null,
+ pQty2: null,
+ pQty3: null,
+ pQty4: null,
+ shift: null,
+ equNo: null,
+ remark: ''
};
}
-type RuleKey = Extract<
- keyof Model,
- | 'time'
- | 'key'
->;
+type RuleKey = Extract<keyof Model, 'time' | 'key'>;
const rules: Record<RuleKey, App.Global.FormRule> = {
time: createRequiredRule('鏃堕棿涓嶈兘涓虹┖'),
- key: createRequiredRule('key涓嶈兘涓虹┖'),
+ key: createRequiredRule('key涓嶈兘涓虹┖')
};
function handleUpdateModelWhenEdit() {
@@ -113,16 +109,136 @@
async function handleSubmit() {
await validate();
- const { time, key, online, qty, tState1, tState2, tState3, tState4, tState5, tState6, tState7, tState8, tState9, tState10, tState11, tState12, pState1, pState2, pState3, pState4, tQty1, tQty2, tQty3, tQty4, tQty5, tQty6, tQty7, tQty8, tQty9, tQty10, tQty11, tQty12, pQty1, pQty2, pQty3, pQty4, shift, equNo, remark } = model.value;
+ const {
+ time,
+ key,
+ online,
+ qty,
+ tState1,
+ tState2,
+ tState3,
+ tState4,
+ tState5,
+ tState6,
+ tState7,
+ tState8,
+ tState9,
+ tState10,
+ tState11,
+ tState12,
+ pState1,
+ pState2,
+ pState3,
+ pState4,
+ tQty1,
+ tQty2,
+ tQty3,
+ tQty4,
+ tQty5,
+ tQty6,
+ tQty7,
+ tQty8,
+ tQty9,
+ tQty10,
+ tQty11,
+ tQty12,
+ pQty1,
+ pQty2,
+ pQty3,
+ pQty4,
+ shift,
+ equNo,
+ remark
+ } = model.value;
// request
if (props.operateType === 'add') {
- const { error } = await fetchCreateHoisterData({ time, key, online, qty, tState1, tState2, tState3, tState4, tState5, tState6, tState7, tState8, tState9, tState10, tState11, tState12, pState1, pState2, pState3, pState4, tQty1, tQty2, tQty3, tQty4, tQty5, tQty6, tQty7, tQty8, tQty9, tQty10, tQty11, tQty12, pQty1, pQty2, pQty3, pQty4, shift, equNo, remark });
+ const { error } = await fetchCreateHoisterData({
+ time,
+ key,
+ online,
+ qty,
+ tState1,
+ tState2,
+ tState3,
+ tState4,
+ tState5,
+ tState6,
+ tState7,
+ tState8,
+ tState9,
+ tState10,
+ tState11,
+ tState12,
+ pState1,
+ pState2,
+ pState3,
+ pState4,
+ tQty1,
+ tQty2,
+ tQty3,
+ tQty4,
+ tQty5,
+ tQty6,
+ tQty7,
+ tQty8,
+ tQty9,
+ tQty10,
+ tQty11,
+ tQty12,
+ pQty1,
+ pQty2,
+ pQty3,
+ pQty4,
+ shift,
+ equNo,
+ remark
+ });
if (error) return;
}
if (props.operateType === 'edit') {
- const { error } = await fetchUpdateHoisterData({ time, key, online, qty, tState1, tState2, tState3, tState4, tState5, tState6, tState7, tState8, tState9, tState10, tState11, tState12, pState1, pState2, pState3, pState4, tQty1, tQty2, tQty3, tQty4, tQty5, tQty6, tQty7, tQty8, tQty9, tQty10, tQty11, tQty12, pQty1, pQty2, pQty3, pQty4, shift, equNo, remark });
+ const { error } = await fetchUpdateHoisterData({
+ time,
+ key,
+ online,
+ qty,
+ tState1,
+ tState2,
+ tState3,
+ tState4,
+ tState5,
+ tState6,
+ tState7,
+ tState8,
+ tState9,
+ tState10,
+ tState11,
+ tState12,
+ pState1,
+ pState2,
+ pState3,
+ pState4,
+ tQty1,
+ tQty2,
+ tQty3,
+ tQty4,
+ tQty5,
+ tQty6,
+ tQty7,
+ tQty8,
+ tQty9,
+ tQty10,
+ tQty11,
+ tQty12,
+ pQty1,
+ pQty2,
+ pQty3,
+ pQty4,
+ shift,
+ equNo,
+ remark
+ });
if (error) return;
}
@@ -153,12 +269,7 @@
/>
</NFormItem>
<NFormItem label="key" path="key">
- <NInput
- v-model:value="model.key"
- :rows="3"
- type="textarea"
- placeholder="璇疯緭鍏ey"
- />
+ <NInput v-model:value="model.key" :rows="3" type="textarea" placeholder="璇疯緭鍏ey" />
</NFormItem>
<NFormItem label="缃戠粶鐘舵�� 0寮傚父锛�1姝e父" path="online">
<NInput v-model:value="model.online" placeholder="璇疯緭鍏ョ綉缁滅姸鎬� 0寮傚父锛�1姝e父" />
--
Gitblit v1.9.3