修改逻辑

This commit is contained in:
zhangsir
2024-02-06 14:37:08 +08:00
parent 11a06e4ece
commit 12feec928a
3 changed files with 5 additions and 2 deletions

View File

@@ -191,7 +191,7 @@
v-model:name="item.teacherName"
:disabled="editBeginClass"
></ProjectManager>
<a-input-number :min="0" :max="100" @change="inputWeightChange(index)" v-model:value="item.weight" placeholder="%"/>
<a-input-number :min="0" @change="inputWeightChange(index)" v-model:value="item.weight" placeholder="%"/>
<span style="margin-top: 10px;width: 34px;">权重</span>
<div style="display: flex;">
<a-button shape="circle" class="btn-circle btn-add" @click="inputAdd">+</a-button>
@@ -640,6 +640,7 @@ function inputWeightChange(index) {
totalWeight += Number(item.weight);
});
if (totalWeight > 100) {
message.info('权重值最大为100%')
formData.value.offteachers[index].weight -= totalWeight - 100;
totalWeight = 100;
}

View File

@@ -1037,7 +1037,7 @@
v-model:name="item.teacherName"
:disabled="editBeginClass"
></ProjectManager>
<a-input-number :min="0" :max="100" @change="inputWeightChange(index)" v-model:value="item.weight" placeholder="%"/>
<a-input-number :min="0" @change="inputWeightChange(index)" v-model:value="item.weight" placeholder="%"/>
<span style="margin-top: 10px;width: 34px;">权重</span>
<div style="display: flex;">
<a-button shape="circle" class="btn-circle btn-add" @click="inputAdd">+</a-button>
@@ -2958,6 +2958,7 @@ function onFocusEnd(){
totalWeight += Number(item.weight);
});
if (totalWeight > 100) {
message.info("权重值最大为100%");
state.offteachers[index].weight -= totalWeight - 100;
totalWeight = 100;
}

View File

@@ -631,6 +631,7 @@ const submitStorage = async () => {
content: '该项目已经发布,修改后如未点击暂存当前操作未保存数据将丢失,确认保存?',
ok: async () => {
confirmLoading.value = true
request(PROJECT_DETAIL_MODIFY, projectInfo.value)
await request(PROJECT_RELEASE, {projectId: route.query.projectId})
message.success("保存成功");
confirmLoading.value = false;