Bläddra i källkod

feat(report): improve evaluation editor tabs

Developer 1 månad sedan
förälder
incheckning
01c61190fb
2 ändrade filer med 29 tillägg och 6 borttagningar
  1. 22 6
      pagesHome/components/report/generateList.vue
  2. 7 0
      tests/reportButtonAvailability.test.js

+ 22 - 6
pagesHome/components/report/generateList.vue

@@ -66,12 +66,20 @@
 			</view>
 		</view>
 		<view class="evaluation-mask adffcacjc" v-if="evaluationVisible">
-			<view class="evaluation-box">
+			<view class="evaluation-box evaluation-box-tall">
 				<view class="kr-title">修改评估内容</view>
-				<view class="evaluation-label">总体评估结果</view>
-				<textarea class="evaluation-textarea" maxlength="20000" v-model="evaluationForm.overallAssessment" placeholder="请输入总体评估结果"></textarea>
-				<view class="evaluation-label">团队发展建议</view>
-				<textarea class="evaluation-textarea" maxlength="20000" v-model="evaluationForm.developmentAdvice" placeholder="请输入团队发展建议"></textarea>
+				<view class="evaluation-tabs">
+					<view class="evaluation-tab" :class="{active:evaluationTab === 'overall'}" @click="evaluationTab='overall'">总体评估结果</view>
+					<view class="evaluation-tab" :class="{active:evaluationTab === 'advice'}" @click="evaluationTab='advice'">团队发展建议</view>
+				</view>
+				<view class="evaluation-panel" v-if="evaluationTab === 'overall'">
+					<view class="evaluation-label">总体评估结果</view>
+					<textarea class="evaluation-textarea" maxlength="20000" v-model="evaluationForm.overallAssessment" placeholder="请输入总体评估结果"></textarea>
+				</view>
+				<view class="evaluation-panel" v-else>
+					<view class="evaluation-label">团队发展建议</view>
+					<textarea class="evaluation-textarea" maxlength="20000" v-model="evaluationForm.developmentAdvice" placeholder="请输入团队发展建议"></textarea>
+				</view>
 				<view class="evaluation-actions">
 					<view class="evaluation-cancel" @click="closeEvaluation">取消</view>
 					<view class="evaluation-submit" :class="{disabled:evaluationSubmitting}" @click="submitEvaluation">{{evaluationSubmitting?'提交中':'保存提交'}}</view>
@@ -133,6 +141,7 @@
 				evaluationVisible:false,
 				evaluationSubmitting:false,
 				evaluationReportId:'',
+				evaluationTab:'overall',
 				evaluationForm:{overallAssessment:'',developmentAdvice:''}
 			}
 		},
@@ -246,6 +255,7 @@
 				if(!this.canEditEvaluation(item)) return;
 				this.evaluationReportId = item.reportId;
 				this.evaluationSubmitting = false;
+				this.evaluationTab = 'overall';
 				this.evaluationVisible = true;
 				this.$api.get('/core/report/evaluation/'+item.reportId).then(({data:res})=>{
 					if(res.code!==0){ this.closeEvaluation(); return this.$showToast(res.msg); }
@@ -606,8 +616,14 @@
 	.report-selector-cancel{margin-top:24rpx;text-align:center;font-size:28rpx;line-height:48rpx;color:#667E90;}
 	.evaluation-mask{position:fixed;left:0;right:0;top:0;bottom:0;z-index:30;background:rgba(0,0,0,.45);}
 	.evaluation-box{width:650rpx;background:#fff;border-radius:16rpx;padding:34rpx 28rpx 26rpx;box-sizing:border-box;}
+	.evaluation-box-tall{height:78vh;min-height:760rpx;display:flex;flex-direction:column;}
+	.evaluation-tabs{display:flex;margin-top:24rpx;border-bottom:1rpx solid #E5EAED;}
+	.evaluation-tab{flex:1;height:72rpx;text-align:center;font-size:28rpx;color:#667E90;line-height:72rpx;position:relative;}
+	.evaluation-tab.active{font-weight:bold;color:#33A7A7;}
+	.evaluation-tab.active::after{content:'';position:absolute;left:25%;right:25%;bottom:-1rpx;height:6rpx;border-radius:3rpx;background:#33A7A7;}
+	.evaluation-panel{flex:1;display:flex;flex-direction:column;min-height:0;}
 	.evaluation-label{font-size:28rpx;font-weight:bold;color:#333;margin:18rpx 0 12rpx;}
-	.evaluation-textarea{width:100%;height:180rpx;box-sizing:border-box;background:#f7f7f7;border-radius:8rpx;padding:18rpx;font-size:26rpx;color:#333;}
+	.evaluation-textarea{width:100%;flex:1;min-height:300rpx;box-sizing:border-box;background:#f7f7f7;border-radius:8rpx;padding:18rpx;font-size:26rpx;color:#333;}
 	.evaluation-actions{display:flex;justify-content:flex-end;gap:20rpx;margin-top:28rpx;}
 	.evaluation-cancel,.evaluation-submit{padding:18rpx 28rpx;border-radius:10rpx;font-size:28rpx;}
 	.evaluation-cancel{color:#666;background:#f2f2f2;}.evaluation-submit{color:#fff;background:#833478;}.evaluation-submit.disabled{opacity:.5;}

+ 7 - 0
tests/reportButtonAvailability.test.js

@@ -18,5 +18,12 @@ assert.match(source, /selectReportArtifact\('background'\)/);
 assert.match(source, /selectReportArtifact\('professional'\)/);
 assert.match(source, /selectReportArtifact\('public'\)/);
 assert.match(source, />查看报告<\/view>/);
+assert.match(source, /evaluation-tabs/);
+assert.match(source, /总体评估结果/);
+assert.match(source, /团队发展建议/);
+assert.match(source, /evaluationTab === 'overall'/);
+assert.match(source, /evaluationTab === 'advice'/);
+assert.match(source, /保存提交/);
+assert.match(source, /取消/);
 
 console.log('reportButtonAvailability.test.js: all assertions passed');