FastBee/docker/data/nginx/vue/static/js/chunk-54603630.0cfb0177.js

1 line
10 KiB
JavaScript
Raw Permalink Normal View History

2025-07-07 09:21:15 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-54603630","chunk-722c5e57"],{"3aec":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-dialog",{attrs:{title:t.upload.title,visible:t.upload.importDeviceDialog,width:"550px","append-to-body":""},on:{"update:visible":function(e){return t.$set(t.upload,"importDeviceDialog",e)}}},[o("el-form",{ref:"importForm",attrs:{"label-width":"100px",model:t.importForm,rules:t.importRules}},[o("el-form-item",{attrs:{label:"",prop:"productName"}},[o("template",{slot:"label"},[t._v(" "+t._s(t.$t("device.device-edit.148398-4"))+" ")]),o("el-input",{staticStyle:{width:"360px"},attrs:{readonly:"",placeholder:t.$t("device.device-edit.148398-5")},model:{value:t.importForm.productName,callback:function(e){t.$set(t.importForm,"productName",e)},expression:"importForm.productName"}},[o("el-button",{attrs:{slot:"append"},on:{click:function(e){return t.selectProduct()}},slot:"append"},[t._v(t._s(t.$t("device.device-edit.148398-6")))])],1)],2),o("el-form-item",{attrs:{label:t.$t("uploadFile"),prop:"fileList"}},[o("el-upload",{ref:"upload",attrs:{limit:1,accept:".xlsx, .xls",headers:t.upload.headers,action:t.upload.url+"?productId="+t.importForm.productId,disabled:t.upload.isUploading,"on-progress":t.handleFileUploadProgress,"on-success":t.handleFileSuccess,"auto-upload":!1,"on-change":t.handleChange,"on-remove":t.handleRemove,drag:""},model:{value:t.importForm.fileList,callback:function(e){t.$set(t.importForm,"fileList",e)},expression:"importForm.fileList"}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[t._v(" "+t._s(t.$t("dragFileTips"))+" "),o("em",[t._v(t._s(t.$t("clickFileTips")))])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[o("div",{staticStyle:{"margin-top":"10px"}},[o("span",[t._v(t._s(t.$t("device.batch-import-dialog.850870-5")))])])])]),o("el-link",{staticStyle:{"font-size":"14px","vertical-align":"baseline"},attrs:{type:"primary",underline:!1},on:{click:t.importTemplate}},[o("i",{staticClass:"el-icon-download"}),t._v(" "+t._s(t.$t("device.batch-import-dialog.850870-6"))+" ")])],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitFileForm}},[t._v(t._s(t.$t("confirm")))]),o("el-button",{on:{click:function(e){t.upload.importDeviceDialog=!1}}},[t._v(t._s(t.$t("cancel")))])],1)],1),o("product-list",{ref:"productList",attrs:{productId:t.importForm.productId},on:{productEvent:function(e){return t.getProductData(e)}}})],1)},r=[],l=o("5f87"),a=o("e51f"),n={name:"batchImport",components:{productList:a["default"]},props:{device:{type:Object,default:null}},data:function(){return{type:1,importForm:{productId:null,fileList:[],productName:""},productList:[],file:null,upload:{importDeviceDialog:!1,title:this.$t("batchImport"),isUploading:!1,headers:{Authorization:"Bearer "+Object(l["a"])()},url:"/prod-api/iot/device/importData"},importRules:{productName:[{required:!0,message:this.$t("device.allot-import-dialog.060657-14"),trigger:"blur"}],fileList:[{required:!0,message:this.$t("plzUploadFile"),trigger:"change"}]}}},created:function(){},methods:{importTemplate:function(){this.download("/iot/device/uploadTemplate?type="+this.type,{},"device_template_".concat((new Date).getTime(),".xlsx"))},handleChange:function(t,e){this.importForm.fileList=e,this.importForm.fileList&&this.$refs.importForm.clearValidate("fileList")},handleRemove:function(t,e){this.importForm.fileList=e,this.$refs.importForm.validateField("fileList")},handleFileUploadProgress:function(t,e,o){this.upload.isUploading=!0},handleFileSuccess:function(t,e,o){this.upload.importDeviceDialog=!1,this.upload.isUploading=!1,this.$refs.upload.clearFiles(),this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"+t.msg+"</div>",this.$t("device.allot-import-dialog.060657-17"),{dangerouslyUseHTMLString:!0}),this.$parent.getList()},selectProduct:function(){this.$refs.productList.open=!