Selaa lähdekoodia

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin 3 vuotta sitten
vanhempi
commit
2b8a54c06a

+ 1 - 0
TEAMModelOS/ClientApp/package.json

@@ -29,6 +29,7 @@
 		"echarts": "^4.2.1",
 		"element-resize-detector": "^1.2.1",
 		"element-ui": "^2.12.0",
+		"fabric": "^4.5.1",
 		"file-saver": "^2.0.2",
 		"firebase": "^7.19.0",
 		"firestore": "^1.1.6",

+ 2 - 1
TEAMModelOS/ClientApp/src/boot-app.js

@@ -44,7 +44,8 @@ import htmlToPdf from './utils/html2pdf'
 Vue.use(htmlToPdf);
 import VueClipBoard from 'vue-clipboard2';
 Vue.use(VueClipBoard);
-
+import fabric from 'fabric'
+Vue.use(fabric);
 var getfinishedtime = function () {
     var currentdate = new Date();
     var datetime =

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 624 - 385
TEAMModelOS/ClientApp/src/common/BaseCanvas.vue


+ 20 - 3
TEAMModelOS/ClientApp/src/common/BaseKonva.vue

@@ -28,6 +28,7 @@
 				myLayer: null,
 				isText: false,
 				mode: 'paint',
+				curNodeId:'',
 				config: {
 					textColor: 'red',
 					textSize: 16,
@@ -57,6 +58,18 @@
 			})
 		},
 		methods: {
+			removeTextArea(){
+				let layer = this.myLayer
+				// 删除所有的输入框
+				console.log(layer.children)
+				layer.children.forEach(i => {
+					if(i.id() === 'textareaTrans'){
+						console.log('有删除transformer')
+						i.destroy()
+					}
+				})
+			},
+			
 			initStage() {
 				let that = this
 				var stage = new Konva.Stage({
@@ -89,7 +102,7 @@
 						layer.add(textNode);
 						let tr = new Konva.Transformer({
 							node: textNode,
-							// enabledAnchors: ["middle-left", "middle-right"],
+							enabledAnchors: ["middle-left", "middle-right"],
 							centeredScaling: true,
 							anchorStroke: "#808080",
 							anchorFill: "#fff",
@@ -100,7 +113,9 @@
 							borderStrokeWidth: 2,
 							borderDash: [3, 3],
 							padding: 10,
+							flipEnabled:false
 						});
+						tr.id('textareaTrans')
 						layer.add(tr);
 						textNode.on("transformstart", function() {
 							that.isPaint = false
@@ -176,6 +191,7 @@
 							textarea.focus();
 
 							function removeTextarea() {
+								console.log('进入removeTextarea')
 								textarea.parentNode.removeChild(textarea);
 								window.removeEventListener("click", handleOutsideClick);
 								textNode.show();
@@ -184,7 +200,6 @@
 								tr.hide();
 								tr.forceUpdate();
 								layer.draw();
-								
 							}
 
 							function setTextareaWidth(newWidth) {
@@ -227,7 +242,8 @@
 								textarea.style.height =
 									textarea.scrollHeight + textNode.fontSize() + "px";
 							});
-
+							
+							// 点击外部执行取消操作
 							function handleOutsideClick(e) {
 								if (e.target !== textarea) {
 									textNode.text(textarea.value);
@@ -251,6 +267,7 @@
 							points: [pos.x, pos.y],
 							draggable:true
 						});
+						
 						layer.add(lastLine);
 					}else{
 						// 如果是点击的变形框 则不处理

+ 1 - 0
TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue

@@ -145,6 +145,7 @@
 			doPaint(){
 				this.curMode = 'line'
 				this.$refs.SignCanvas.mode = 'paint'
+				this.$refs.SignCanvas.removeTextArea()
 			},
 			
 			doMove(){

+ 1 - 1
TEAMModelOS/ClientApp/src/utils/editorTools.js

@@ -380,7 +380,7 @@ export default {
 									innerHTML: vm.itemInfo ? vm.itemInfo.question : ''
 								}
 							}),
-							h('BaseMyCanvas', {
+							h('BaseCanvas', {
 								props:{
 									vm:vm
 								},

+ 4 - 6
TEAMModelOS/ClientApp/src/view/notify/NotifyMgt.vue

@@ -2,11 +2,9 @@
     <div class="notify-mgt-container">
         <div class="notify-filter-wrap dark-iview-input">
             <Input search v-model="keyword" placeholder="搜索" class="keyword-search" @on-change="searchNotice" />
-            <span class="keyword-search" @click="toggleNoticeStatus">
-                <Checkbox v-model="publish" :true-value="0" :false-value="1" style="margin-left:30px">
-                    <span style="color:white">
-                        草稿箱
-                    </span>
+            <span class="custom-check-box keyword-search">
+                <Checkbox v-model="publish" @on-change="toggleNoticeStatus" :true-value="0" :false-value="1" style="margin-left:30px">
+                    草稿箱
                 </Checkbox>
             </span> <span class="icon-text-btn" @click="toCreateNotify">
                 <Icon type="md-add" size="16" style="margin-right:2px" />
@@ -76,7 +74,7 @@ export default {
             })
         },
         toggleNoticeStatus() {
-            this.publish = 1 - this.publish
+            // this.publish = 1 - this.publish
             this.keyword = ''
             this.searchNotice()
         },

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/stuMgt/ImportStudent.vue

@@ -532,7 +532,7 @@ export default {
                 } else {
                     // 座號重複檢核
                     let repNo = array.filter((i) => {
-                        return i.id != item.id && i.classId && i.classId == item.classId && i.no == item.no
+                        return i.id != item.id && i.classId && i.classId == item.classId && i.classYear == item.classYear && i.no == item.no 
                     })
                     if (repNo.length > 0) {
                         for (let no of repNo) {