切换git地址test1
This commit is contained in:
1
components.d.ts
vendored
1
components.d.ts
vendored
@ -42,7 +42,6 @@ declare module 'vue' {
|
|||||||
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||||
ATable: typeof import('ant-design-vue/es')['Table']
|
ATable: typeof import('ant-design-vue/es')['Table']
|
||||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
|
||||||
AUpload: typeof import('ant-design-vue/es')['Upload']
|
AUpload: typeof import('ant-design-vue/es')['Upload']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
@ -94,9 +94,12 @@
|
|||||||
v-model.number="formData.projectSettlementCycle"
|
v-model.number="formData.projectSettlementCycle"
|
||||||
type="number"
|
type="number"
|
||||||
min="1"
|
min="1"
|
||||||
|
max="10"
|
||||||
class="input-field"
|
class="input-field"
|
||||||
required
|
required
|
||||||
placeholder="请输入结算周期"
|
placeholder="请输入结算周期(1-10)"
|
||||||
|
@input="limitSettlementCycle"
|
||||||
|
@keypress="filterNumericInput"
|
||||||
>
|
>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -108,9 +111,12 @@
|
|||||||
v-model.number="formData.maxPromoterCount"
|
v-model.number="formData.maxPromoterCount"
|
||||||
type="number"
|
type="number"
|
||||||
min="1"
|
min="1"
|
||||||
|
max="999999"
|
||||||
class="input-field"
|
class="input-field"
|
||||||
required
|
required
|
||||||
placeholder="请输入最大人数"
|
placeholder="请输入最大人数(1-999999)"
|
||||||
|
@input="limitPromoterCount"
|
||||||
|
@keypress="filterNumericInput"
|
||||||
>
|
>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -351,8 +357,8 @@ const handleSubmit = async () => {
|
|||||||
// 重置表单
|
// 重置表单
|
||||||
Object.assign(formData, {
|
Object.assign(formData, {
|
||||||
projectName: '',
|
projectName: '',
|
||||||
projectSettlementCycle: 2,
|
projectSettlementCycle: '',
|
||||||
maxPromoterCount: 200,
|
maxPromoterCount: '',
|
||||||
projectStatus: 'running',
|
projectStatus: 'running',
|
||||||
projectDescription: '',
|
projectDescription: '',
|
||||||
settlementDesc: '',
|
settlementDesc: '',
|
||||||
@ -391,7 +397,45 @@ const validateForm = (): boolean => {
|
|||||||
return value !== '' && value !== null && value !== undefined;
|
return value !== '' && value !== null && value !== undefined;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const filterNumericInput = (event: KeyboardEvent) => {
|
||||||
|
const key = event.key;
|
||||||
|
// 只允许数字输入
|
||||||
|
if (!/^\d$/.test(key)) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const limitSettlementCycle = (event: Event) => {
|
||||||
|
const input = event.target as HTMLInputElement;
|
||||||
|
let value = parseInt(input.value);
|
||||||
|
|
||||||
|
if (isNaN(value)) {
|
||||||
|
formData.projectSettlementCycle = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制在1-10之间
|
||||||
|
if (value < 1) value = 1;
|
||||||
|
if (value > 10) value = 10;
|
||||||
|
|
||||||
|
formData.projectSettlementCycle = value;
|
||||||
|
};
|
||||||
|
|
||||||
|
const limitPromoterCount = (event: Event) => {
|
||||||
|
const input = event.target as HTMLInputElement;
|
||||||
|
let value = parseInt(input.value);
|
||||||
|
|
||||||
|
if (isNaN(value)) {
|
||||||
|
formData.maxPromoterCount = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制在1-999999之间
|
||||||
|
if (value < 1) value = 1;
|
||||||
|
if (value > 999999) value = 999999;
|
||||||
|
|
||||||
|
formData.maxPromoterCount = value;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,13 +134,7 @@ const previewImage = ref('');
|
|||||||
|
|
||||||
const formRef = ref<typeof Form>();
|
const formRef = ref<typeof Form>();
|
||||||
|
|
||||||
// 添加数字输入校验方法
|
|
||||||
const handleNumberInput = (e: KeyboardEvent) => {
|
|
||||||
const allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'];
|
|
||||||
if (!allowedKeys.includes(e.key)) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 添加粘贴校验方法
|
// 添加粘贴校验方法
|
||||||
const handlePaste = (e: ClipboardEvent) => {
|
const handlePaste = (e: ClipboardEvent) => {
|
||||||
@ -281,6 +275,53 @@ const triggerFileInput = () => {
|
|||||||
fileInput.value.click();
|
fileInput.value.click();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleNumberInput = (e: KeyboardEvent) => {
|
||||||
|
const allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'];
|
||||||
|
|
||||||
|
// 只允许数字和控制键
|
||||||
|
if (!allowedKeys.includes(e.key)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 添加范围限制方法 - 现在在输入时立即修正
|
||||||
|
const limitSettlementCycle = (value: number) => {
|
||||||
|
if (!editData.value) return;
|
||||||
|
|
||||||
|
// 确保是数字
|
||||||
|
if (isNaN(value)) {
|
||||||
|
editData.value.projectSettlementCycle = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制在1-10之间
|
||||||
|
if (value < 1) editData.value.projectSettlementCycle = 1;
|
||||||
|
if (value > 10) editData.value.projectSettlementCycle = 10;
|
||||||
|
};
|
||||||
|
|
||||||
|
const limitPromoterCount = (value: number) => {
|
||||||
|
if (!editData.value) return;
|
||||||
|
|
||||||
|
// 确保是数字
|
||||||
|
if (isNaN(value)) {
|
||||||
|
editData.value.maxPromoterCount = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制在1-999999之间
|
||||||
|
if (value < 1) editData.value.maxPromoterCount = 1;
|
||||||
|
if (value > 999999) editData.value.maxPromoterCount = 999999;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 添加输入时实时限制 - 立即修正值
|
||||||
|
const handleSettlementInput = (value: number) => {
|
||||||
|
limitSettlementCycle(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePromoterInput = (value: number) => {
|
||||||
|
limitPromoterCount(value);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -375,19 +416,25 @@ const triggerFileInput = () => {
|
|||||||
:rules="[{
|
:rules="[{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0,
|
min: 1,
|
||||||
message: '请输入有效的正整数'
|
max: 10,
|
||||||
|
message: '请输入1-10之间的数字'
|
||||||
}]"
|
}]"
|
||||||
>
|
>
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="editData.projectSettlementCycle"
|
v-model:value="editData.projectSettlementCycle"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="0"
|
:min="1"
|
||||||
|
:max="10"
|
||||||
@keypress="handleNumberInput"
|
@keypress="handleNumberInput"
|
||||||
@paste="handlePaste"
|
@paste="handlePaste"
|
||||||
|
@change="(val:any) => handleSettlementInput(val)"
|
||||||
|
placeholder="请输入1-10之间的数字"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
<!-- 最大推广人数输入框 -->
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="最大推广人数"
|
label="最大推广人数"
|
||||||
@ -396,15 +443,19 @@ const triggerFileInput = () => {
|
|||||||
required: true,
|
required: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 1,
|
min: 1,
|
||||||
message: '请输入有效的正整数'
|
max: 999999,
|
||||||
|
message: '请输入1-999999之间的数字'
|
||||||
}]"
|
}]"
|
||||||
>
|
>
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="editData.maxPromoterCount"
|
v-model:value="editData.maxPromoterCount"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="1"
|
:min="1"
|
||||||
|
:max="999999"
|
||||||
@keypress="handleNumberInput"
|
@keypress="handleNumberInput"
|
||||||
@paste="handlePaste"
|
@paste="handlePaste"
|
||||||
|
@change="(val:any) => handlePromoterInput(val)"
|
||||||
|
placeholder="请输入1-999999之间的数字"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@ -804,6 +855,7 @@ const triggerFileInput = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.label-text {
|
.label-text {
|
||||||
|
margin: 10px 0 0 5px;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
@ -30,7 +30,7 @@ const columns = [
|
|||||||
title: '通知标题',
|
title: '通知标题',
|
||||||
dataIndex: 'notificationTitle',
|
dataIndex: 'notificationTitle',
|
||||||
key: 'notificationTitle',
|
key: 'notificationTitle',
|
||||||
width: 30,
|
width: 50,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
@ -59,7 +59,7 @@ const columns = [
|
|||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 100,
|
width: 40,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user