Przeglądaj źródła

处理投票活动选项删除、富文本展示、学生姓名信息整合、状态以及开始时间数据问题

OnePsycho 4 lat temu
rodzic
commit
3c853c5b4e

+ 1 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteBar.vue

@@ -78,7 +78,7 @@
                     series: [{
                         type: 'bar',
                         data: data.map(item => item.value),
-                        barWidth: 50, //柱子宽度
+                        barMaxWidth: 80, //柱子宽度
                         itemStyle: {
                             normal: {
                                 color: new that.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{

+ 18 - 0
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.less

@@ -214,6 +214,7 @@
         margin-top: 10px;
 
         .option-order {
+			position: relative;
             display: inline-block;
             min-height: 42px;
             width: 10%;
@@ -223,6 +224,23 @@
             text-align: center;
             line-height: 42px;
             border-right: 1px solid #4e4e4e;
+			
+			&:hover{
+				.ivu-icon{
+					display: unset;
+				}
+			}
+			
+			.ivu-icon{
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%,-50%);
+				font-size: 20px;
+				color:#fff;
+				display: none;
+				cursor: pointer;
+			}
         }
 
         .option-editor {

+ 11 - 2
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue

@@ -38,7 +38,7 @@
             <FormItem label="选项设置" prop="attachment">
                 <div v-for="(item,index) in voteOptions" :key="index" class="option-editor-wrap">
 					<div v-show="voteFormEdit">
-						<span class="option-order">{{ index + 1 }}</span>
+						<span class="option-order">{{ index + 1 }}<Icon type="md-trash" @click="deleteOption(index)"/></span>
 						<div :ref="'voteOption'+index" style="text-align:left" class="option-editor" @click="optionClick(index)"></div>
 					</div>
 					<div v-show="!voteFormEdit">
@@ -260,7 +260,7 @@
 
                             // 如果是编辑状态 则将选项内容回显
                             if (this.editInfo) {
-                                editor.txt.html(this.editInfo.option[i].value)
+                                editor.txt.html(this.voteOptionsContent[i].value)
                             }
                         })
                         }
@@ -280,6 +280,15 @@
                     currentToolBar.style.visibility = 'visible'
                 }, 100)
             },
+			
+			// 删除选项
+			deleteOption(index) {
+				this.voteOptions.splice(index, 1)
+				this.voteOptionsContent.splice(index, 1)
+				this.$nextTick(() => {
+				    this.initEditors()
+				})
+			},
 
             // 添加选项
             onAddOption() {

+ 4 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -144,6 +144,10 @@
                 } else {
                     this.$Message.warning('至少保留两个选项!')
                 }
+				
+				// this.$nextTick(() => {
+				//     this.initEditors()
+				// })
             },
 
             // 模拟选项聚焦事件