1 line
8.0 KiB
JavaScript
1 line
8.0 KiB
JavaScript
|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-baa452ea","chunk-014fc830"],{2167:function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","before-close":e.finishCommit},on:{"update:visible":function(t){e.open=t}}},[n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[n("el-form-item",{attrs:{label:"知识库名称",prop:"knowName"}},[n("el-input",{attrs:{placeholder:"请输入知识库名称",maxlength:"30"},model:{value:e.form.knowName,callback:function(t){e.$set(e.form,"knowName",t)},expression:"form.knowName"}})],1),n("el-form-item",{attrs:{label:"知识库介绍",prop:"knowIntroduce"}},[n("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入知识库介绍"},model:{value:e.form.knowIntroduce,callback:function(t){e.$set(e.form,"knowIntroduce",t)},expression:"form.knowIntroduce"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submit()}}},[e._v("确 定")]),n("el-button",{on:{click:function(t){return e.finishCommit(!1)}}},[e._v("取 消")])],1)],1)},i=[],a=(n("b64b"),n("829f")),r={name:"operateDialog",props:{item:{type:Object,default:{}},open:{type:Boolean,default:!1},title:String},data:function(){return{form:{id:null,knowName:null,knowIntroduce:null},rules:{knowName:[{required:!0,message:"知识库名称不能为空",trigger:"blur"},{min:2,max:20,message:"知识库名称长度必须介于 2 和 20 之间",trigger:"blur"},{pattern:/^[^\u4e00-\u9fa5]*$/,message:"新知识库名称,不支持中文命名",trigger:"blur"}]}}},watch:{item:function(e){Object.keys(e).length>0&&(this.form.id=e.id,this.form.knowName=e.knowName,this.form.knowIntroduce=e.knowIntroduce)}},methods:{finishCommit:function(e){this.form={id:null,knowName:null,knowIntroduce:null},this.$refs["form"].resetFields(),this.$emit("finishCommit",e)},submit:function(){var e=this;this.$modal.loading("数据上传中,请稍候"),this.$refs["form"].validate((function(t){t&&(e.form.id?Object(a["f"])(e.form).then((function(t){200===t.code?(e.$modal.msgSuccess(t.msg),e.finishCommit(!0)):e.$modal.msgError(t.msg)})):Object(a["c"])(e.form).then((function(t){200===t.code?(e.$modal.msgSuccess(t.msg),e.finishCommit(!0)):e.$modal.msgError(t.msg)}))),e.$modal.closeLoading()}))}}},l=r,s=n("2877"),u=Object(s["a"])(l,o,i,!1,null,null,null);t["default"]=u.exports},"829f":function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return r})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return u}));var o=n("b775");function i(e){return Object(o["a"])({url:"/system/knowledge/list",method:"post",data:e})}function a(e){return Object(o["a"])({url:"/system/knowledge/insertKnowledge",method:"post",data:e})}function r(e){return Object(o["a"])({url:"/system/knowledge/updateKnowledge",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/system/knowledge/"+e,method:"post"})}function s(e){return Object(o["a"])({url:"/system/knowledge/selectKnowledgeFilesByKnowId",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/system/knowledge/deleteDocs",method:"post",data:e})}},"94d7":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"98px"}},[n("el-form-item",{attrs:{label:"知识库名称",prop:"knowName"}},[n("el-input",{attrs:{placeholder:"知识库名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.knowName,callback:function(t){e.$set(e.queryParams,"knowName",t)},expression:"queryParams.knowName"}})],1)
|