切换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']
|
||||
ATable: typeof import('ant-design-vue/es')['Table']
|
||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
||||
AUpload: typeof import('ant-design-vue/es')['Upload']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
|
@ -9,7 +9,7 @@ const myAxios = axios.create({
|
||||
//baseURL:'http://localhost:9091'
|
||||
// baseURL:'http://1.94.237.210:3457'
|
||||
//baseURL:'http://1.94.237.210:8088'
|
||||
// baseURL:'http://27.30.77.229:9091/'
|
||||
//baseURL:'http://27.30.77.229:9091/'
|
||||
baseURL:'http://27.30.77.229:9092/'
|
||||
|
||||
});
|
||||
|
@ -94,9 +94,12 @@
|
||||
v-model.number="formData.projectSettlementCycle"
|
||||
type="number"
|
||||
min="1"
|
||||
max="10"
|
||||
class="input-field"
|
||||
required
|
||||
placeholder="请输入结算周期"
|
||||
placeholder="请输入结算周期(1-10)"
|
||||
@input="limitSettlementCycle"
|
||||
@keypress="filterNumericInput"
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
@ -108,9 +111,12 @@
|
||||
v-model.number="formData.maxPromoterCount"
|
||||
type="number"
|
||||
min="1"
|
||||
max="999999"
|
||||
class="input-field"
|
||||
required
|
||||
placeholder="请输入最大人数"
|
||||
placeholder="请输入最大人数(1-999999)"
|
||||
@input="limitPromoterCount"
|
||||
@keypress="filterNumericInput"
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
@ -351,8 +357,8 @@ const handleSubmit = async () => {
|
||||
// 重置表单
|
||||
Object.assign(formData, {
|
||||
projectName: '',
|
||||
projectSettlementCycle: 2,
|
||||
maxPromoterCount: 200,
|
||||
projectSettlementCycle: '',
|
||||
maxPromoterCount: '',
|
||||
projectStatus: 'running',
|
||||
projectDescription: '',
|
||||
settlementDesc: '',
|
||||
@ -391,7 +397,45 @@ const validateForm = (): boolean => {
|
||||
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>
|
||||
|
||||
|
||||
|
@ -134,13 +134,7 @@ const previewImage = ref('');
|
||||
|
||||
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) => {
|
||||
@ -281,6 +275,53 @@ const triggerFileInput = () => {
|
||||
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>
|
||||
|
||||
<template>
|
||||
@ -375,19 +416,25 @@ const triggerFileInput = () => {
|
||||
:rules="[{
|
||||
required: true,
|
||||
type: 'number',
|
||||
min: 0,
|
||||
message: '请输入有效的正整数'
|
||||
min: 1,
|
||||
max: 10,
|
||||
message: '请输入1-10之间的数字'
|
||||
}]"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="editData.projectSettlementCycle"
|
||||
style="width: 100%"
|
||||
:min="0"
|
||||
:min="1"
|
||||
:max="10"
|
||||
@keypress="handleNumberInput"
|
||||
@paste="handlePaste"
|
||||
@change="(val:any) => handleSettlementInput(val)"
|
||||
placeholder="请输入1-10之间的数字"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 最大推广人数输入框 -->
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
label="最大推广人数"
|
||||
@ -396,15 +443,19 @@ const triggerFileInput = () => {
|
||||
required: true,
|
||||
type: 'number',
|
||||
min: 1,
|
||||
message: '请输入有效的正整数'
|
||||
max: 999999,
|
||||
message: '请输入1-999999之间的数字'
|
||||
}]"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="editData.maxPromoterCount"
|
||||
style="width: 100%"
|
||||
:min="1"
|
||||
:max="999999"
|
||||
@keypress="handleNumberInput"
|
||||
@paste="handlePaste"
|
||||
@change="(val:any) => handlePromoterInput(val)"
|
||||
placeholder="请输入1-999999之间的数字"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -804,6 +855,7 @@ const triggerFileInput = () => {
|
||||
}
|
||||
|
||||
.label-text {
|
||||
margin: 10px 0 0 5px;
|
||||
display: block;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 600;
|
||||
|
@ -30,7 +30,7 @@ const columns = [
|
||||
title: '通知标题',
|
||||
dataIndex: 'notificationTitle',
|
||||
key: 'notificationTitle',
|
||||
width: 30,
|
||||
width: 50,
|
||||
fixed: 'left',
|
||||
align: 'center'
|
||||
},
|
||||
@ -59,7 +59,7 @@ const columns = [
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
width: 40,
|
||||
align: 'center'
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user