Files
fastbee/docker/data/nginx/html/static/js/chunk-ce3349bc.2255f55c.js
2022-08-19 00:28:36 +08:00

1 line
10 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ce3349bc"],{"5af9":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticStyle:{padding:"6px"}},[r("el-card",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],staticStyle:{"margin-bottom":"6px"}},[r("el-form",{ref:"queryForm",staticStyle:{"margin-bottom":"-20px"},attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[r("el-form-item",{attrs:{label:"固件名称",prop:"firmwareName"}},[r("el-input",{attrs:{placeholder:"请输入固件名称",clearable:"",size:"small"},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.firmwareName,callback:function(t){e.$set(e.queryParams,"firmwareName",t)},expression:"queryParams.firmwareName"}})],1),r("el-form-item",{attrs:{label:"产品名称",prop:"productName"}},[r("el-input",{attrs:{placeholder:"请输入产品名称",clearable:"",size:"small"},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.productName,callback:function(t){e.$set(e.queryParams,"productName",t)},expression:"queryParams.productName"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1)],1),r("el-card",{staticStyle:{"padding-bottom":"100px"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.firmwareList},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{label:"固件名称",align:"center",prop:"firmwareName"}}),r("el-table-column",{attrs:{label:"固件版本",align:"center",prop:"version",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v("Version ")]),e._v(" "+e._s(t.row.version)+" ")]}}])}),r("el-table-column",{attrs:{label:"状态",align:"center",prop:"isLatest",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.isLatest?r("el-tag",{attrs:{type:"success"}},[e._v("最新")]):r("el-tag",{attrs:{type:"info"}},[e._v("默认")])]}}])}),r("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d}")))])]}}])}),r("el-table-column",{attrs:{label:"产品名称",align:"center",prop:"productName"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-link",{attrs:{underline:!1,type:"primary"},on:{click:function(r){return e.handleViewProduct(t.row.productId)}}},[e._v(e._s(t.row.productName))])]}}])}),r("el-table-column",{attrs:{label:"下载地址",align:"center",prop:"filePath","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-link",{attrs:{href:e.getDownloadUrl(t.row.filePath),underline:!1,type:"success"}},[e._v(e._s(e.getDownloadUrl(t.row.filePath)))])]}}])}),r("el-table-column",{attrs:{label:"固件描述",align:"center",prop:"remark","min-width":"200"}})],1),r("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}}),r("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"固件名称",prop:"firmwareName"}},[r("el-input",{attrs:{placeholder:"请输入固件名称"},model:{value:e.form.firmwareName,callback:function(t){e.$set(e.form,"firmwareName",t)},expression:"form.firmwareName"}})],1),r("el-form-item",{attrs:{label:"所属产品",prop:"productId"}},[r("el-select",{attrs:{placeholder:"请选择产品"},on:{change:e.selectProduct},model:{value:e.form.productId,callback:function(t){e.$set(e.form,"productId",t)},expression:"form.productId"}},e._l(e.productShortList,(function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),r("el-form-item",{attrs:{label:"固件版本",prop:"version"}},[r("el-input",{attrs:{placeholder:"请输入固件版本",type:"number"},model:{value:e.form.version,callback:function(t){e.$set(e.form,"version",t)},expression:"form.version"}})],1),r("el-form-item",{attrs:{label:"固件上传",prop:"filePath"}},[r("fileUpload",{ref:"file-upload",attrs:{value:e.form.filePath,limit:1,fileSize:10,fileType:["bin","zip","pdf"]},on:{input:function(t){return e.getFilePath(t)}}})],1),r("el-form-item",{attrs:{label:"备注",prop:"remark"}},[r("el-input",{attrs:{type:"textarea",placeholder:"请输入内容"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),r("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)],1)},n=[],i=r("5530"),o=(r("d81d"),r("b0c0"),r("2a75")),l=r("9b9c"),u=r("814a"),s=r("5f87"),c={name:"Firmware",dicts:["iot_yes_no"],components:{fileUpload:o["a"]},data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,firmwareList:[],productShortList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,firmwareName:null,productName:null,tenantName:null,isSys:null},form:{version:1},rules:{firmwareName:[{required:!0,message:"固件名称不能为空",trigger:"blur"}],productId:[{required:!0,message:"产品ID不能为空",trigger:"blur"}],productName:[{required:!0,message:"产品名称不能为空",trigger:"blur"}],version:[{required:!0,message:"固件版本不能为空",trigger:"blur"}],filePath:[{required:!0,message:"文件路径不能为空",trigger:"blur"}]},upload:{isUploading:!1,headers:{Authorization:"Bearer "+Object(s["a"])()},url:"/prod-api/iot/tool/upload",fileList:[]}}},created:function(){this.getList(),this.getProductShortList()},methods:{handleViewProduct:function(e){this.$router.push({path:"/iot/product-edit",query:{t:Date.now(),productId:e}})},getDownloadUrl:function(e){return window.location.origin+"/prod-api"+e},getList:function(){var e=this;this.loading=!0,Object(u["e"])(this.queryParams).then((function(t){e.firmwareList=t.rows,e.total=t.total,e.loading=!1}))},getProductShortList:function(){var e=this;Object(l["f"])().then((function(t){e.productShortList=t.data}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={firmwareId:null,firmwareName:null,productId:null,productName:null,tenantId:null,tenantName:null,isSys:null,version:1,filePath:null,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark: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.firmwareId})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加产品固件",this.upload.fileList=[]},handleUpdate:function(e){var t=this;this.reset();var r=e.firmwareId||this.ids;Object(u["c"])(r).then((function(e){t.form=e.data,t.open=!0,t.title="修改产品固件",t.upload.fileList=[{name:t.form.firmwareName,url:t.form.filePath}]}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.firmwareId?Object(u["f"])(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):Object(u["a"])(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,r=e.firmwareId||this.ids;this.$modal.confirm('是否确认删除产品固件编号为"'+r+'"的数据项?').then((function(){return Object(u["b"])(r)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/firmware/export",Object(i["a"])({},this.queryParams),"firmware_".concat((new Date).getTime(),".xlsx"))},selectProduct:function(e){for(var t=0;t<this.productShortList.length;t++)if(this.productShortList[t].id==e)return void(this.form.productName=this.productShortList[t].name)},getFilePath:function(e){console.log(e),this.form.filePath=e},submitUpload:function(){this.$refs.upload.submit()},handleFileUploadProgress:function(e,t,r){this.upload.isUploading=!0},handleFileSuccess:function(e,t,r){this.upload.isUploading=!1,this.form.filePath=e.url,this.$modal.msgSuccess(e.msg)},handleDownload:function(e){window.open("/prod-api"+e.filePath)}}},d=c,m=r("2877"),f=Object(m["a"])(d,a,n,!1,null,null,null);t["default"]=f.exports},"814a":function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return l})),r.d(t,"f",(function(){return u})),r.d(t,"b",(function(){return s}));var a=r("b775");function n(e){return Object(a["a"])({url:"/iot/firmware/list",method:"get",params:e})}function i(e){return Object(a["a"])({url:"/iot/firmware/getLatest/"+e,method:"get"})}function o(e){return Object(a["a"])({url:"/iot/firmware/"+e,method:"get"})}function l(e){return Object(a["a"])({url:"/iot/firmware",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/iot/firmware",method:"put",data:e})}function s(e){return Object(a["a"])({url:"/iot/firmware/"+e,method:"delete"})}},"9b9c":function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"f",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"a",(function(){return l})),r.d(t,"g",(function(){return u})),r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return c}));var a=r("b775");function n(e){return Object(a["a"])({url:"/iot/product/list",method:"get",params:e})}function i(){return Object(a["a"])({url:"/iot/product/shortList",method:"get"})}function o(e){return Object(a["a"])({url:"/iot/product/"+e,method:"get"})}function l(e){return Object(a["a"])({url:"/iot/product",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/iot/product",method:"put",data:e})}function s(e){return Object(a["a"])({url:"/iot/product/status/",method:"put",data:e})}function c(e){return Object(a["a"])({url:"/iot/product/"+e,method:"delete"})}}}]);