chunk-a459716c.5bdb304d.js 18 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a459716c"],{"07ac":function(t,e,r){var i=r("23e7"),o=r("6f53").values;i({target:"Object",stat:!0},{values:function(t){return o(t)}})},17842:function(t,e,r){"use strict";r.r(e);var i,o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"midd-page",attrs:{"element-loading-text":"加载中..."}},[r("div",{staticClass:"header"},[r("div",{staticClass:"h_left"},[r("p",{staticClass:"current-doc"},[r("strong",[t._v("当前文献")]),t._v(": "),r("span",{staticStyle:{color:"#97a8be"}},[t._v(t._s(t.firstForm.currentDocument))])]),r("p",[r("strong",[t._v("文献编号:")]),r("span",{staticStyle:{color:"#97a8be"}},[t._v(t._s(t.doc_identifier))])]),r("p",[r("strong",[t._v("所属标签")]),t._v(": "),t.firstForm.tag&&t.firstForm.tag.length?t._l(t.firstForm.tag,(function(e,i){return r("el-tag",{key:i,style:0!==i?"margin-left: 5px;":"",attrs:{type:""}},[t._v(" "+t._s(e.name)+" ")])})):r("span",{staticStyle:{color:"#97a8be"}},[t._v("暂无标签")])],2)])]),r("div",[r("el-button",{on:{click:t.handlePreview}},[t._v("预览")])],1),r("el-table",{staticStyle:{width:"100%"},attrs:{data:t.firstTableData}},[r("el-table-column",{attrs:{label:"项目",prop:"",filters:t.firstForm.projectFilters,"filter-method":t.firstFilterProject,"filter-placement":"bottom-end",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.project_name,callback:function(r){t.$set(e.row,"project_name",r)},expression:"scope.row.project_name"}}):r("span",[t._v(t._s(e.row.project_name))])]}}])}),r("el-table-column",{attrs:{label:"说明",prop:"project_description"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.project_description,callback:function(r){t.$set(e.row,"project_description",r)},expression:"scope.row.project_description"}}):r("span",[t._v(" "+t._s(e.row.project_description)+" "),r("i",{staticClass:"el-icon-edit",staticStyle:{cursor:"pointer","margin-left":"5px"},on:{click:function(r){return t.openDescriptionDialog(e.row)}}})])]}}])}),r("el-table-column",{attrs:{label:"范例",prop:"project_example"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.project_example,callback:function(r){t.$set(e.row,"project_example",r)},expression:"scope.row.project_example"}}):r("span",[t._v(" "+t._s(e.row.project_example)+" "),r("i",{staticClass:"el-icon-edit",staticStyle:{cursor:"pointer","margin-left":"5px"},on:{click:function(r){return t.openExampleDialog(e.row)}}})])]}}])}),r("el-table-column",{attrs:{label:"模型生成",prop:"generation_2","class-name":"model-gen-2"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.generation_2,callback:function(r){t.$set(e.row,"generation_2",r)},expression:"scope.row.generation_2"}}):r("span",[t._v(" "+t._s(e.row.generation_2)+" ")])]}}])}),r("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-dropdown",{attrs:{trigger:"click"},scopedSlots:t._u([{key:"dropdown",fn:function(){return[r("el-dropdown-menu",[e.row.isEdit?t._e():r("el-dropdown-item",{nativeOn:{click:function(r){return t.firstHandleEdit(e.$index,e.row)}}},[r("i",{staticClass:"el-icon-edit"}),t._v(" 编辑 ")]),e.row.isEdit?r("el-dropdown-item",{nativeOn:{click:function(r){return t.firstHandleSave(e.$index,e.row)}}},[r("i",{staticClass:"el-icon-check"}),t._v(" 保存 ")]):t._e(),r("el-dropdown-item",{nativeOn:{click:function(r){return t.firstHandleConfig(e.$index,e.row)}}},[r("i",{staticClass:"el-icon-refresh"}),t._v(" 配置模型 ")]),r("el-dropdown-item",{nativeOn:{click:function(r){return t.firstHandleDelete(e.$index,e.row)}}},[r("i",{staticClass:"el-icon-delete"}),t._v(" 删除 ")])],1)]},proxy:!0}],null,!0)},[r("el-button",{staticClass:"operation-button",staticStyle:{"font-size":"15px","margin-left":"10px"},attrs:{type:"text",size:"small",circle:"",icon:"el-icon-more"}})],1)]}}])})],1),r("el-dialog",{attrs:{visible:t.dialogVisible,title:"编辑范例",width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}},scopedSlots:t._u([{key:"footer",fn:function(){return[r("span",{staticClass:"dialog-footer"},[r("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.saveExample}},[t._v("确定")])],1)]},proxy:!0}])},[r("el-input",{attrs:{type:"textarea",rows:4},model:{value:t.currentExample,callback:function(e){t.currentExample=e},expression:"currentExample"}})],1),r("el-dialog",{attrs:{visible:t.firstForm.dialogVisible,title:"内容更新",width:"40%"},on:{"update:visible":function(e){return t.$set(t.firstForm,"dialogVisible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[r("span",{staticClass:"dialog-footer"},[r("el-button",{on:{click:t.saveConfig}},[t._v("保存配置")]),r("el-button",{on:{click:t.generateContent}},[t._v("生成内容")]),r("el-button",{on:{click:function(e){t.firstForm.dialogVisible=!1}}},[t._v("取消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.firstSaveExample}},[t._v("确定")])],1)]},proxy:!0}])},[r("el-form",{attrs:{model:t.firstForm.firstAiForm,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"应用"}},[r("el-select",{attrs:{placeholder:"请选择应用",disabled:""},model:{value:t.firstForm.firstAiForm.application,callback:function(e){t.$set(t.firstForm.firstAiForm,"application",e)},expression:"firstForm.firstAiForm.application"}},t._l(t.configArr,(function(t,e){return r("el-option",{key:e,attrs:{label:t.chat_name,value:t.id}})})),1)],1),r("el-form-item",{attrs:{label:"MAX-token数"}},[r("el-input-number",{attrs:{min:1,max:9999,placeholder:"请输入字数限制"},model:{value:t.firstForm.firstAiForm.wordCount,callback:function(e){t.$set(t.firstForm.firstAiForm,"wordCount",e)},expression:"firstForm.firstAiForm.wordCount"}})],1),r("el-form-item",{attrs:{label:"说明"}},[r("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入说明"},model:{value:t.firstForm.firstAiForm.description,callback:function(e){t.$set(t.firstForm.firstAiForm,"description",e)},expression:"firstForm.firstAiForm.description"}})],1),r("el-form-item",{attrs:{label:"提示词"}},[r("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入提示词"},model:{value:t.firstForm.firstAiForm.prompt,callback:function(e){t.$set(t.firstForm.firstAiForm,"prompt",e)},expression:"firstForm.firstAiForm.prompt"}})],1),r("el-form-item",{attrs:{label:"生成内容"}},[r("el-input",{attrs:{type:"textarea",rows:4,readonly:""},model:{value:t.firstForm.firstAiForm.modelValue,callback:function(e){t.$set(t.firstForm.firstAiForm,"modelValue",e)},expression:"firstForm.firstAiForm.modelValue"}})],1)],1)],1),r("el-dialog",{attrs:{visible:t.firstForm.configVisible,title:"配置模型",width:"40%"},on:{"update:visible":function(e){return t.$set(t.firstForm,"configVisible",e)}},scopedSlots:t._u([{key:"footer",fn:function(){return[r("span",{staticClass:"dialog-footer"},[r("el-button",{on:{click:function(e){t.firstForm.dialogVisible=!1}}},[t._v("取消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.saveConfig}},[t._v("保存配置")])],1)]},proxy:!0}])},[r("el-form",{attrs:{model:t.firstForm.configForm,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"模型"}},[r("el-select",{attrs:{placeholder:"请选择应用"},model:{value:t.firstForm.configForm.model_b_config,callback:function(e){t.$set(t.firstForm.configForm,"model_b_config",e)},expression:"firstForm.configForm.model_b_config"}},t._l(t.configArr,(function(t,e){return r("el-option",{key:e,attrs:{label:t.chat_name,value:t.id}})})),1)],1),r("el-form-item",{attrs:{label:"MAX-token数"}},[r("el-input-number",{attrs:{min:1,max:2048,placeholder:"请输入字数限制"},model:{value:t.firstForm.configForm.max_tokens,callback:function(e){t.$set(t.firstForm.configForm,"max_tokens",e)},expression:"firstForm.configForm.max_tokens"}})],1),r("el-form-item",{attrs:{label:"说明"}},[r("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入说明"},model:{value:t.firstForm.configForm.project_description,callback:function(e){t.$set(t.firstForm.configForm,"project_description",e)},expression:"firstForm.configForm.project_description"}})],1),r("el-form-item",{attrs:{label:"范例"}},[r("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入范例"},model:{value:t.firstForm.configForm.project_example,callback:function(e){t.$set(t.firstForm.configForm,"project_example",e)},expression:"firstForm.configForm.project_example"}})],1),r("el-form-item",{attrs:{label:"提示词"}},[r("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入提示词"},model:{value:t.firstForm.configForm.project_name,callback:function(e){t.$set(t.firstForm.configForm,"project_name",e)},expression:"firstForm.configForm.project_name"}})],1),r("el-form-item",{attrs:{label:"生成方法"}},[r("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入生成方法"},model:{value:t.firstForm.configForm.generation_method,callback:function(e){t.$set(t.firstForm.configForm,"generation_method",e)},expression:"firstForm.configForm.generation_method"}})],1)],1)],1),r("el-dialog",{attrs:{visible:t.descriptionDialogVisible,title:"编辑说明",width:"30%"},on:{"update:visible":function(e){t.descriptionDialogVisible=e}},scopedSlots:t._u([{key:"footer",fn:function(){return[r("span",{staticClass:"dialog-footer"},[r("el-button",{on:{click:function(e){t.descriptionDialogVisible=!1}}},[t._v("取消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.saveDescription}},[t._v("确定")])],1)]},proxy:!0}])},[r("el-input",{attrs:{type:"textarea",rows:4},model:{value:t.currentDescription,callback:function(e){t.currentDescription=e},expression:"currentDescription"}})],1)],1)},n=[],s=r("ade3"),a=r("3835"),c=r("2909"),l=r("c7eb"),f=r("1da1"),u=r("5530"),p=(r("a4d3"),r("e01a"),r("99af"),r("4de4"),r("caad"),r("d81d"),r("b0c0"),r("b64b"),r("d3b7"),r("07ac"),r("6062"),r("2532"),r("3ca3"),r("ddb0"),r("db6a")),m={name:"MiddPage",data:function(){return{loading:!1,activeName:"first",firstForm:{tableData:[],workTypeFilters:[{text:"类型1",value:"type1"},{text:"类型2",value:"type2"},{text:"类型3",value:"type3"}],projectFilters:[],activeFilters:{workType:[],project:[]},dialogVisible:!1,configVisible:!1,firstAiForm:{application:"",wordCount:100,description:"",prompt:"",modelValue:""},configForm:{id:"",project_name:"提取第一作者",max_tokens:1024,project_description:"从文献中提取第一作者信息,并进行格式化处理",generation_method:"extract_first_author",model_a_config:20,model_b_config:22,project_example:""},currentDocument:"AED数据表",tag:[],searchQuery:"",currentPage:1,pageSize:10,total:3},configArr:[],dialogVisible:!1,currentExample:"",currentRow:null,doc_identifier:"",descriptionDialogVisible:!1,currentDescription:"",currentDescriptionRow:null}},computed:{firstTableData:function(){var t=this;return this.firstForm.tableData.filter((function(e){return(!t.firstForm.activeFilters.workType.length||t.firstForm.activeFilters.workType.includes(e.workType))&&(!t.firstForm.activeFilters.project.length||t.firstForm.activeFilters.project.includes(e.project))})).reverse()}},mounted:function(){this.doc_identifier=this.$route.query.identifier,this.firstForm.currentDocument=this.$route.query.name,this.firstForm.tag=JSON.parse(this.$route.query.tag),this.firstInit(),this.updateProjectFilters()},methods:(i={handlePreview:function(t){console.log(t);var e=document.createElement("a");e.href="#/infoList?id=".concat(this.$route.query.id,"&type=").concat(this.$route.query.type.toLowerCase()),e.target="_blank",e.click()},openDescriptionDialog:function(t){this.descriptionDialogVisible=!0,this.currentDescriptionRow=t,this.currentDescription=t.project_description},saveDescription:function(){var t=this;this.currentDescriptionRow&&this.currentDescription&&(this.currentDescriptionRow.project_description=this.currentDescription,Object(p["kb"])(Object(u["a"])(Object(u["a"])({},this.currentDescriptionRow),{},{project_description:this.currentDescription})).then((function(e){200===e.status&&(t.$message.success("说明更新成功"),t.firstInit())}))),this.descriptionDialogVisible=!1,this.currentDescriptionRow=null,this.currentDescription=""},firstHandleConfig:function(t,e){this.firstForm.configForm=e,console.log(e),this.firstForm.configForm.model_b_config=e.model_b_config.id,this.firstForm.configVisible=!0},saveConfig:function(){var t=this;this.firstForm.configForm.id?Object(p["kb"])(this.firstForm.configForm).then((function(e){200===e.status&&(t.firstForm.configVisible=!1,t.$message.success("修改成功!"),t.firstInit())})):Object(p["cb"])(this.firstForm.configForm).then((function(e){200===e.status&&(t.firstForm.configVisible=!1,t.firstInit())}))},openExampleDialog:function(t){this.dialogVisible=!0,this.currentRow=t,this.currentExample=t.project_example},saveExample:function(){var t=this;this.currentRow&&this.currentExample&&(this.currentRow.project_example=this.currentExample,Object(p["kb"])(Object(u["a"])(Object(u["a"])({},this.currentRow),{},{project_example:this.currentExample})).then((function(e){200===e.status&&(t.$message.success("范例更新成功"),t.firstInit())}))),this.dialogVisible=!1,this.currentRow=null,this.currentExample=""},firstHandleUpload:function(t,e){var r=this.getUpdatedContent(e);this.$set(e,"model1",r.model1),this.$set(e,"model2",r.model2),this.$message({type:"success",message:"内容已更新"})},openModel1Dialog:function(t){this.firstForm.firstAiForm.application="app1",this.firstForm.firstAiForm.description=t.description,this.firstForm.dialogVisible=!0},openModel2Dialog:function(t){this.firstForm.firstAiForm.application="app2",this.firstForm.firstAiForm.description=t.description,this.firstForm.dialogVisible=!0},getUpdatedContent:function(t){return{model1:"更新后的模型1内容",model2:"更新后的模型2内容"}},generateContent:function(){var t=this;return Object(f["a"])(Object(l["a"])().mark((function e(){var r;return Object(l["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.yourApiCall({application:t.firstForm.firstAiForm.application,wordCount:t.firstForm.firstAiForm.wordCount,description:t.firstForm.firstAiForm.description,prompt:t.firstForm.firstAiForm.prompt});case 3:r=e.sent,t.firstForm.firstAiForm.modelValue=r.data,e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),t.$message.error("生成内容失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()},firstSaveExample:function(){this.firstForm.dialogVisible=!1}},Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(i,"firstHandleUpload",(function(t,e){this.firstForm.dialogVisible=!0})),"firstHandleEdit",(function(t,e){this.firstForm.configForm=e,this.firstForm.configForm.model_a_config=e.model_a_config.id,this.firstForm.configForm.model_b_config=e.model_b_config.id,e.isEdit=!0})),"firstHandleSave",(function(t,e){var r=this;e.isEdit=!1,Object(p["kb"])(this.firstForm.configForm).then((function(t){200===t.status&&(r.$message.success("修改成功!"),r.firstInit())}))})),"firstHandleDelete",(function(t,e){var r=this;return Object(f["a"])(Object(l["a"])().mark((function t(){var i;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.$confirm("确认删除该记录?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:return t.next=5,Object(p["r"])({id:e.id});case 5:i=t.sent,200===i.status&&(r.$message.success("删除成功"),r.firstInit()),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),"cancel"!==t.t0&&r.$message.error("删除失败");case 12:case"end":return t.stop()}}),t,null,[[0,9]])})))()})),"firstHandleAdd",(function(){this.firstForm.tableData.push({workType:"",project:"",description:"",example:"",isEdit:!0})})),"firstFilterWorkType",(function(t,e){return e.workType===t})),"firstFilterProject",(function(t,e){return e.project===t})),"updateProjectFilters",(function(){var t=Object(c["a"])(new Set(this.firstForm.tableData.map((function(t){return t.project}))));this.projectFilters=t.map((function(t){return{text:t,value:t}}))})),"handleSearch",(function(){var t=this.firstForm.searchQuery.toLowerCase(),e=this.firstForm.tableData.filter((function(e){return Object.values(e).some((function(e){return String(e).toLowerCase().includes(t)}))}));this.total=e.length})),"handleSearchClear",(function(){this.firstForm.searchQuery="",this.handleSearch()})),Object(s["a"])(Object(s["a"])(Object(s["a"])(Object(s["a"])(i,"handleSizeChange",(function(t){this.firstForm.pageSize=t,this.handleSearch()})),"handleCurrentChange",(function(t){this.firstForm.currentPage=t,this.handleSearch()})),"handleClick",(function(){})),"firstInit",(function(){var t=this;return Object(f["a"])(Object(l["a"])().mark((function e(){var r,i,o,n,s,c;return Object(l["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,e.prev=1,e.next=4,Promise.all([Object(p["m"])(),Object(p["K"])()]);case 4:if(r=e.sent,i=Object(a["a"])(r,2),o=i[0],n=i[1],200===o.status&&(t.configArr=o.data),200===n.status&&(s=n.data.data.map((function(t){return Object(u["a"])(Object(u["a"])({},t),{},{isEdit:!1,generation_1:"N/A",generation_2:"N/A"})})),t.firstForm.tableData=s),!t.$route.query.id){e.next=16;break}return e.next=13,Object(p["ab"])({id:t.$route.query.id});case 13:c=e.sent,console.log(c),200===c.status&&c.data.data&&(t.firstForm.tableData=t.firstForm.tableData.map((function(t){var e=t.project_name,r=c.data.data.datalist[e];return null!==r&&void 0!==r&&r.text?(console.log(r),Object(u["a"])(Object(u["a"])({},t),{},{generation_1:r.text||"N/A",generation_2:r.text||"N/A"})):t})));case 16:e.next=22;break;case 18:e.prev=18,e.t0=e["catch"](1),console.error("Error in firstInit:",e.t0),t.$message.error("加载数据失败");case 22:return e.prev=22,t.loading=!1,e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[1,18,22,25]])})))()}))),watch:{tableData:{handler:function(){this.updateProjectFilters()},deep:!0}}},d=m,b=(r("9cc4"),r("2877")),g=Object(b["a"])(d,o,n,!1,null,"0d483b88",null);e["default"]=g.exports},"60ab":function(t,e,r){},"6f53":function(t,e,r){var i=r("83ab"),o=r("df75"),n=r("fc6a"),s=r("d1e7").f,a=function(t){return function(e){var r,a=n(e),c=o(a),l=c.length,f=0,u=[];while(l>f)r=c[f++],i&&!s.call(a,r)||u.push(t?[r,a[r]]:a[r]);return u}};t.exports={entries:a(!0),values:a(!1)}},"9cc4":function(t,e,r){"use strict";r("60ab")}}]);