1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-90f59ac0"],{"055b":function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"e",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"g",(function(){return o})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return c}));var a=n("b775");function i(e){return Object(a["a"])({url:"/system/question/list",method:"get",params:e})}function r(e){return Object(a["a"])({url:"/system/question/"+e,method:"get"})}function s(e){return Object(a["a"])({url:"/system/question",method:"post",data:e})}function o(e){return Object(a["a"])({url:"/system/question",method:"put",data:e})}function l(e){return Object(a["a"])({url:"/system/question/"+e,method:"delete"})}function u(){return Object(a["a"])({url:"/system/question/getLabelType",method:"post"})}function c(e){return Object(a["a"])({url:"/system/question/getDetailQuestion",method:"post",data:{tagId:e}})}},"63ce":function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return l}));var a=n("b775");function i(e){return Object(a["a"])({url:"/system/label/list",method:"get",params:e})}function r(e){return Object(a["a"])({url:"/system/label/"+e,method:"get"})}function s(e){return Object(a["a"])({url:"/system/label",method:"post",data:e})}function o(e){return Object(a["a"])({url:"/system/label",method:"put",data:e})}function l(e){return Object(a["a"])({url:"/system/label/"+e,method:"delete"})}},"9d6b":function(e,t,n){"use strict";n.r(t);var a=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":"68px"}},[n("el-form-item",{attrs:{label:"所提的问题",prop:"question"}},[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.question,callback:function(t){e.$set(e.queryParams,"question",t)},expression:"queryParams.question"}})],1),n("el-form-item",{attrs:{label:"标签id",prop:"tagId"}},[n("el-input",{attrs:{placeholder:"请输入标签id",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.tagId,callback:function(t){e.$set(e.queryParams,"tagId",t)},expression:"queryParams.tagId"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),n("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),n("el-row",{staticClass:"mb8",attrs:{gutter:10}},[n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:question:add"],expression:"['system:question:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),n("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.questionList},on:{"selection-change":e.handleSelectionChange}},[n("el-table-column",{attrs:{label:"推荐问题",align:"center",prop:"question"}}),n("el-table-column",{attrs:{label:"标签",align:"center",prop:"tagName"}}),n("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:question:edit"],expression:"['system:question:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(n){return e.handleUpdate(t.row)}}},[e._v("修改")]),n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:question:remove"],expression:"['system:question:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(n){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),n("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[n("el-form-item",{attrs:{label:"推荐问题",prop:"question"}},[n("el-input",{attrs:{placeholder:"请输入所提的问题"},model:{value:e.form.question,callback:function(t){e.$set(e.form,"question",t)},expression:"form.question"}})],1),n("el-form-item",{attrs:{label:"标签",prop:"tagId"}},[n("TreeSelect",{attrs:{options:e.labelOptions,normalizer:e.normalizer,placeholder:"请输入标签"},model:{value:e.form.tagId,callback:function(t){e.$set(e.form,"tagId",t)},expression:"form.tagId"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),n("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},i=[],r=n("5530"),s=(n("d81d"),n("14d9"),n("055b")),o=n("ca17"),l=n.n(o),u=(n("542c"),n("63ce")),c={name:"Question",components:{TreeSelect:l.a},data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,labelOptions:[],total:0,questionList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,question:null,tagName:null,tagId:null},form:{},rules:{question:[{required:!0,message:"推荐问题不能为空",trigger:"blur"}],tagName:[{required:!0,message:"标签不能为空",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,Object(s["f"])(this.queryParams).then((function(t){e.questionList=t.rows,e.total=t.total,e.loading=!1}))},normalizer:function(e){return e.children&&!e.children.length&&delete e.children,{id:e.id,label:e.tagName,children:e.children}},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,question:null,tagId:null,tagName:null,createTime:null,updateTime:null,isActive:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(e){var t=this;this.reset(),void 0!==e&&(this.form.parentId=e.id),this.open=!0,this.title="添加标签",Object(u["d"])().then((function(e){t.labelOptions=t.handleTree(e.data,"id")}))},handleUpdate:function(e){var t=this;this.reset();var n=e.id||this.ids;Object(s["e"])(n).then((function(n){t.labelOptions.length=0,t.form=n.data,t.open=!0,t.title="修改推荐问题管理";var a={id:e.tagId,tagName:t.form.tagName,children:[]};t.labelOptions.push(a)}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id?Object(s["g"])(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):Object(s["a"])(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,n=e.id||this.ids;this.$modal.confirm('是否确认删除推荐问题管理编号为"'+n+'"的数据项?').then((function(){return Object(s["b"])(n)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("system/question/export",Object(r["a"])({},this.queryParams),"question_".concat((new Date).getTime(),".xlsx"))}}},d=c,m=n("2877"),h=Object(m["a"])(d,a,i,!1,null,null,null);t["default"]=h.exports}}]); |