chunk-4552e990.e867adf7.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4552e990"],{"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",{staticClass:"midd-page"},[r("div",{staticClass:"header"},[r("div",{staticClass:"h_left"},[r("p",{staticClass:"current-doc"},[t._v(" 当前数据表: "+t._s(t.firstForm.currentDocument)+" ")]),r("div",{staticClass:"search-box"},[r("el-input",{staticClass:"custom-search-input",attrs:{placeholder:"请输入搜索内容",clearable:""},on:{clear:t.handleSearchClear},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch(e)}},scopedSlots:t._u([{key:"append",fn:function(){return[r("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleSearch}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.firstForm.searchQuery,callback:function(e){t.$set(t.firstForm,"searchQuery",e)},expression:"firstForm.searchQuery"}})],1)])]),r("el-table",{staticStyle:{width:"100%"},attrs:{data:t.firstTableData}},[r("el-table-column",{attrs:{label:"项目",prop:"name",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.name,callback:function(r){t.$set(e.row,"name",r)},expression:"scope.row.name"}}):r("span",[t._v(t._s(e.row.name))])]}}])}),r("el-table-column",{attrs:{label:"说明",prop:"description"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.description,callback:function(r){t.$set(e.row,"description",r)},expression:"scope.row.description"}}):r("span",[t._v(t._s(e.row.description))])]}}])}),r("el-table-column",{attrs:{label:"范例",prop:"example"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.example,callback:function(r){t.$set(e.row,"example",r)},expression:"scope.row.example"}}):r("span",[t._v(" "+t._s(e.row.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:"模型生成1",prop:"generation_1","class-name":"model-gen-1"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.isEdit?r("el-input",{model:{value:e.row.generation_1,callback:function(r){t.$set(e.row,"generation_1",r)},expression:"scope.row.generation_1"}}):r("span",[t._v(" "+t._s(e.row.generation_1)+" "),r("i",{staticClass:"el-icon-refresh",staticStyle:{cursor:"pointer","margin-left":"5px"},on:{click:function(r){return t.openModel1Dialog(e.row)}}})])]}}])}),r("el-table-column",{attrs:{label:"模型生成2",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("i",{staticClass:"el-icon-refresh",staticStyle:{cursor:"pointer","margin-left":"5px"},on:{click:function(r){return t.openModel2Dialog(e.row)}}})])]}}])}),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.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-button",{staticStyle:{"margin-top":"20px"},attrs:{type:"primary"},on:{click:t.firstHandleAdd}},[t._v("新增行")]),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.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"}},[r("el-option",{attrs:{label:"应用1",value:"app1"}}),r("el-option",{attrs:{label:"应用2",value:"app2"}})],1)],1),r("el-form-item",{attrs:{label:"MAX-token数"}},[r("el-input-number",{attrs:{min:1,max:1e3,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)],1)},n=[],a=r("ade3"),s=r("5530"),l=r("3835"),c=r("2909"),u=r("c7eb"),p=r("1da1"),f=(r("a4d3"),r("e01a"),r("4de4"),r("caad"),r("d81d"),r("a434"),r("b0c0"),r("4fad"),r("d3b7"),r("07ac"),r("6062"),r("2532"),r("3ca3"),r("ddb0"),r("db6a")),d={name:"MiddPage",data:function(){return{activeName:"first",firstForm:{tableData:[],workTypeFilters:[{text:"类型1",value:"type1"},{text:"类型2",value:"type2"},{text:"类型3",value:"type3"}],projectFilters:[],activeFilters:{workType:[],project:[]},dialogVisible:!1,firstAiForm:{application:"",wordCount:100,description:"",prompt:"",modelValue:""},currentDocument:"AED数据表",searchQuery:"",currentPage:1,pageSize:10,total:3},dialogVisible:!1,currentExample:"",currentRow: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))}))}},created:function(){this.updateProjectFilters()},mounted:function(){this.firstForm.currentDocument=this.$route.query.name,this.firstInit()},methods:(i={openExampleDialog:function(t){this.dialogVisible=!0,this.currentExample=t.example,this.currentRow=t},saveExample:function(){this.currentRow&&(this.currentRow.example=this.currentExample),this.dialogVisible=!1},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(p["a"])(Object(u["a"])().mark((function e(){var r;return Object(u["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(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["a"])(i,"firstHandleUpload",(function(t,e){this.firstForm.dialogVisible=!0})),"firstHandleEdit",(function(t,e){console.log(t),e.isEdit=!0})),"firstHandleSave",(function(t,e){e.isEdit=!1,this.updateProjectFilters()})),"firstHandleDelete",(function(t,e){this.firstForm.tableData.splice(t,1),this.updateProjectFilters()})),"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(a["a"])(Object(a["a"])(Object(a["a"])(Object(a["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(p["a"])(Object(u["a"])().mark((function e(){var r,i;return Object(u["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(f["n"])({id:t.$route.query.id});case 2:r=e.sent,console.log("详情数据:",r.data),i=Object.entries(r.data).filter((function(t){var e=Object(l["a"])(t,1),r=e[0];return!["id","create_time","update_time"].includes(r)})).map((function(t){var e=Object(l["a"])(t,2),r=e[0],i=e[1];return Object(s["a"])({name:r,isEdit:!1},i)})),console.log(i),t.firstForm.tableData=i;case 7:case"end":return e.stop()}}),e)})))()}))),watch:{tableData:{handler:function(){this.updateProjectFilters()},deep:!0}}},m=d,b=(r("dc90"),r("2877")),h=Object(b["a"])(m,o,n,!1,null,"e429baea",null);e["default"]=h.exports},"387b":function(t,e,r){},"4fad":function(t,e,r){var i=r("23e7"),o=r("6f53").entries;i({target:"Object",stat:!0},{entries:function(t){return o(t)}})},"6f53":function(t,e,r){var i=r("83ab"),o=r("df75"),n=r("fc6a"),a=r("d1e7").f,s=function(t){return function(e){var r,s=n(e),l=o(s),c=l.length,u=0,p=[];while(c>u)r=l[u++],i&&!a.call(s,r)||p.push(t?[r,s[r]]:s[r]);return p}};t.exports={entries:s(!0),values:s(!1)}},dc90:function(t,e,r){"use strict";r("387b")}}]);