| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="padding: 20px"> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <div> |
| | | <el-upload |
| | | class="upload-demo" |
| | | drag |
| | | :action="videoUrl" |
| | | ref="videoUpload" |
| | | accept=".mp4" |
| | | :auto-upload="false" |
| | | :limit="1" |
| | | :file-list="videoFileList" |
| | | :data="submitData" |
| | | :on-success="successHandle"> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">å°è§é¢æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | <div class="el-upload__tip" slot="tip">åªè½ä¸ä¼ mp4æä»¶ï¼ä¸ä¸è¶
è¿10MB</div> |
| | | </el-upload> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div> |
| | | <button class="btn" @click="videoSubmitUpload"></button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data () { |
| | | return { |
| | | videoUrl: '', |
| | | videoFileList: [], |
| | | submitData: { |
| | | lightemitId: '' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | lightemitStateId () { |
| | | return this.$store.state.led.lightemitId |
| | | } |
| | | }, |
| | | mounted () { |
| | | this.init() |
| | | }, |
| | | watch: { |
| | | lightemitStateId (curVal, oldVal) { |
| | | this.submitData.lightemitId = curVal |
| | | } |
| | | }, |
| | | methods: { |
| | | init () { |
| | | this.videoFileList = [] |
| | | this.submitData.lightemitId = this.$store.state.led.lightemitId |
| | | this.videoUrl = this.$http.adornUrl(`/pole/polelightemit/videoUpload?token=${this.$cookie.get('token')}`) |
| | | }, |
| | | onChangePhoto (file, fileList) { |
| | | this.photoFileList = fileList |
| | | }, |
| | | videoSubmitUpload () { |
| | | this.$refs.videoUpload.submit() |
| | | }, |
| | | // æä»¶ä¸ä¼ æååè°å½æ° |
| | | successHandle (response, file, fileList) { |
| | | if (response && response.code === 0) { |
| | | this.$message({ |
| | | message: 'æä½æå', |
| | | type: 'success', |
| | | duration: 1500, |
| | | onClose: () => { |
| | | this.videoFileList = [] |
| | | // this.visible = false |
| | | // this.$emit('refreshDataList') |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.error(response.msg) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .btn { |
| | | border-style: none; |
| | | width: 100px; |
| | | height: 35px; |
| | | background: url(~@/assets/img/btn-config.png); |
| | | background-repeat:no-repeat; |
| | | border-style: none; |
| | | background-size: 100%; |
| | | color: #fff; |
| | | font-size: 1.4em; |
| | | font-weight: 550; |
| | | }; |
| | | </style> |