Karsa 8 tháng trước cách đây
mục cha
commit
abba170226

+ 2 - 3
src/views/semantics_manage/summery/components/promptClassifySection.vue

@@ -177,7 +177,7 @@ export default {
         
         if(res.Ret !== 200) return 
         this.$message.success(res.Msg)
-        this.myPromptList.splice(1,this.myPromptList.findIndex(_ =>_.AiPromptId===item.AiPromptId))
+        this.myPromptList.splice(this.myPromptList.findIndex(_ =>_.AiPromptId===item.AiPromptId),1)
 
         this.selectId = 0;
         this.$emit('close')
@@ -185,9 +185,8 @@ export default {
     },
 
     nodeChange(data,node) {
-      console.log(data)
       if(data.AiPromptId) { //提示词
-        // this.selectId = data.AiPromptId;
+        this.selectId = 0;
 
         this.$emit('change',data)
       }

+ 4 - 4
src/views/semantics_manage/summery/components/promptDetail.vue

@@ -36,10 +36,10 @@ export default {
       console.log(nval)
       if(nval.AiPromptId) {
         this.promptData.title = nval.Title;
-        this.$refs.editorRef.initData(nval.PromptContent)
+        this.$refs.editorRef&&this.$refs.editorRef.initData(nval.PromptContent)
       }else {
         this.promptData.title=''
-        this.$refs.editorRef.initData('')
+        this.$refs.editorRef&&this.$refs.editorRef.initData('')
       }
     }
   },
@@ -54,12 +54,12 @@ export default {
     if(this.item.AiPromptId) {
       this.promptData.title = this.item.Title;
       this.$nextTick(() => {
-        this.$refs.editorRef.initData(this.item.PromptContent)
+        this.$refs.editorRef&&this.$refs.editorRef.initData(this.item.PromptContent)
       })
     }else {
       this.promptData.title=''
       this.$nextTick(() => {
-        this.$refs.editorRef.initData('')
+        this.$refs.editorRef&&this.$refs.editorRef.initData('')
       })
     }
   },

+ 6 - 4
src/views/semantics_manage/summery/index.vue

@@ -317,10 +317,12 @@ export default {
 			if(type!=='public') {
 				const res = await aiSummeryInterface.getMyPromptClassify()
 				if(res.Ret !==200) return 
-				this.myPromptList = res.Data&&res.Data.map(_ =>({
-					..._,
-					type: 'mine'
-				}))
+				this.myPromptList = res.Data
+					? res.Data.map(_ =>({
+						..._,
+						type: 'mine'
+					})) 
+					: []
 			}
 		},
 

+ 2 - 4
src/views/semantics_manage/summery/summeryEdit.vue

@@ -24,7 +24,6 @@
               </el-popover>
             </li>
             <li :class="['tab-item',{'act':sourceForm.type===3}]" @click="tabClick(3)">
-              
               <div class="upload-row">
                   <el-upload
                   style="display: inline-block; margin-right: 8px"
@@ -33,8 +32,7 @@
                   :http-request="handleUpload"
                   :before-upload="handleBeforeUpload"
                   :show-file-list="false"
-                  :disabled="isUploading">
-                      <!-- <img src="~@/assets/img/icons/ai-upload.png" /> -->
+                  :disabled="isUploading||sourceForm.type!==3">
                       <!-- 上传文件 -->{{$t('SemanticsManage.AiSummeryPage.source_tab3')}}
                   </el-upload>
               </div>
@@ -369,7 +367,7 @@ export default {
           this.$message.error("上传文件格式只支持PDF、PPTX、DOCX");
           return false;
       }
-      if(!(e.size/1024/1024 < 50.1)){
+      else if(!(e.size/1024/1024 < 50.1)){
           this.$message.error("上传文件大小不超过50MB");
           return false;
       }