diff --git a/src/components/martixCraft/Edit/index.vue b/src/components/martixCraft/Edit/index.vue index 6e01bb6..440a884 100644 --- a/src/components/martixCraft/Edit/index.vue +++ b/src/components/martixCraft/Edit/index.vue @@ -62,6 +62,7 @@ const form = ref({ matrixId: undefined, times: [ { + id: Date.now(), matrixPathType: 'horizontal', // 路径类型 motorZHeight: undefined, // 高度 gasPressure: undefined, // Mpa兆帕 @@ -135,7 +136,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | FtMessage.warning('最多添加10次喷涂') return } - form.value.times.push(cloneDeep(form.value.times.at(-1))) + form.value.times.push(cloneDeep({ ...form.value.times.at(-1), id: Date.now() })) const selection = sprayRefs.value[activeTab.value].getSelection() console.log(selection) activeTab.value = form.value.times.length - 1 @@ -203,9 +204,7 @@ const touchendHandle = () => { - + @@ -230,7 +229,15 @@ const touchendHandle = () => { >
- +
@@ -283,43 +290,46 @@ const touchendHandle = () => { { + if (!value && value !== 0) { + callback(new Error('请输入氮气气压')); + } + else if (value < 0 || value > 100) { + callback(new Error('氮气气压需在0-100之间')); + } + else { + callback(); + } + }, + }, ]" > - + Mpa { + if (!value && value !== 0) { + callback(new Error('请输入基质流速')); + } + else if (value < 0 || value > 60) { + callback(new Error('基质流速需在0-60之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -363,19 +373,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入移动速度')); + } + else if (value < 1 || value > 100) { + callback(new Error('移动速度需在1-100之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -384,19 +397,22 @@ const touchendHandle = () => { { + if (!value && value !== 0) { + callback(new Error('请输入间距')); + } + else if (value < 0 || value > 100) { + callback(new Error('间距需在0-100之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -405,19 +421,22 @@ const touchendHandle = () => { { + if (!value && value !== 0) { + callback(new Error('请输入等待时间')); + } + else if (value < 0 || value > 1200) { + callback(new Error('等待时间需在0-1200之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -427,19 +446,22 @@ const touchendHandle = () => { v-if="item.matrixPathType === 'grid'" label="中间等待时间" :prop="`times.${index}.gridDelay`" - :rules="[{ required: true, - trigger: 'blur', - validator: (rule: any, value: any, callback: any) => { - if (!value && value !== 0) { - callback(new Error('请输入等待时间')); - } - else if (value < 0 || value > 120) { - callback(new Error('等待时间需在0-120之间')); - } - else { - callback(); - } - } }, + :rules="[ + { + required: true, + trigger: 'blur', + validator: (rule: any, value: any, callback: any) => { + if (!value && value !== 0) { + callback(new Error('请输入等待时间')); + } + else if (value < 0 || value > 120) { + callback(new Error('等待时间需在0-120之间')); + } + else { + callback(); + } + }, + }, ]" > diff --git a/src/components/spray/sprayParams/index.vue b/src/components/spray/sprayParams/index.vue index c2752d4..6496dff 100644 --- a/src/components/spray/sprayParams/index.vue +++ b/src/components/spray/sprayParams/index.vue @@ -151,7 +151,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | FtMessage.warning('最多添加10次喷涂') return } - form.value.times.push(cloneDeep(form.value.times.at(-1))) + form.value.times.push(cloneDeep({ ...form.value.times.at(-1), id: Date.now() })) const selection = sprayRefs.value[activeTab.value].getSelection() console.log(selection) activeTab.value = form.value.times.length - 1 @@ -169,6 +169,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | console.log(activeTab.value) } form.value.times.splice(activeTab.value, 1) + console.log(activeTab.value) } // 异步任务调用 @@ -244,14 +245,24 @@ const touchendHandle = () => { - + - + { >
- +
@@ -317,19 +337,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入氮气气压')); + } + else if (value < 0 || value > 100) { + callback(new Error('氮气气压需在0-100之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -338,19 +361,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入基质流速')); + } + else if (value < 0 || value > 60) { + callback(new Error('基质流速需在0-60之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -391,19 +417,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入移动速度')); + } + else if (value < 1 || value > 100) { + callback(new Error('移动速度需在1-100之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -412,19 +441,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入间距')); + } + else if (value < 0 || value > 100) { + callback(new Error('间距需在0-100之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -433,19 +465,22 @@ const touchendHandle = () => { { + if (!value) { + callback(new Error('请输入等待时间')); + } + else if (value < 0 || value > 1200) { + callback(new Error('等待时间需在0-1200之间')); + } + else { + callback(); + } + }, + }, ]" > @@ -455,19 +490,22 @@ const touchendHandle = () => { v-if="item.matrixPathType === 'grid'" label="中间等待时间" :prop="`times.${index}.gridDelay`" - :rules="[{ required: true, - trigger: 'blur', - validator: (rule: any, value: any, callback: any) => { - if (!value) { - callback(new Error('请输入等待时间')); - } - else if (value < 0 || value > 120) { - callback(new Error('等待时间需在0-120之间')); - } - else { - callback(); - } - } }, + :rules="[ + { + required: true, + trigger: 'blur', + validator: (rule: any, value: any, callback: any) => { + if (!value) { + callback(new Error('请输入等待时间')); + } + else if (value < 0 || value > 120) { + callback(new Error('等待时间需在0-120之间')); + } + else { + callback(); + } + }, + }, ]" > diff --git a/src/components/spray/trayGraph/index.vue b/src/components/spray/trayGraph/index.vue index ecc50f9..a09f1f6 100644 --- a/src/components/spray/trayGraph/index.vue +++ b/src/components/spray/trayGraph/index.vue @@ -99,7 +99,6 @@ const addSelect = () => { const height = newHeight const stageWidth = stage.value.width() const stageHeight = stage.value.height() - console.log(width, height, stageWidth, stageHeight) // 计算边界约束 // 1. 左上角不超出画布左/上边界 @@ -122,8 +121,6 @@ const addSelect = () => { boundBoxFunc(oldBoundBox, newBoundBox) { const stageWidth = stage.value.width() const stageHeight = stage.value.height() - console.log('oldBoundBox', oldBoundBox) - console.log('newBoundBox', newBoundBox) // 新边界必须满足以下条件: // 1. 左上角不超出画布左/上边界 diff --git a/src/stores/useSprayStore.ts b/src/stores/useSprayStore.ts index ba6d887..729d3e7 100644 --- a/src/stores/useSprayStore.ts +++ b/src/stores/useSprayStore.ts @@ -12,6 +12,7 @@ export const useSprayStore = defineStore('spray', { matrixId: undefined, times: [ { + id: 1, matrixPathType: 'horizontal', // 路径类型 motorZHeight: undefined, // 高度 gasPressure: undefined, // Mpa兆帕 @@ -34,6 +35,7 @@ export const useSprayStore = defineStore('spray', { matrixId: undefined, times: [ { + id: 1, matrixPathType: 'horizontal', // 路径类型 motorZHeight: undefined, // 高度 gasPressure: undefined, // Mpa兆帕 @@ -56,6 +58,7 @@ export const useSprayStore = defineStore('spray', { matrixId: undefined, times: [ { + id: 1, matrixPathType: 'horizontal', // 路径类型 motorZHeight: undefined, // 高度 gasPressure: undefined, // Mpa兆帕 @@ -78,6 +81,7 @@ export const useSprayStore = defineStore('spray', { matrixId: undefined, times: [ { + id: 1, matrixPathType: 'horizontal', // 路径类型 motorZHeight: undefined, // 高度 gasPressure: undefined, // Mpa兆帕