|
|
@@ -70,41 +70,41 @@
|
|
|
|
|
|
<script>
|
|
|
import baseButton from '../../../components/base-button.vue'
|
|
|
-import {bytesToSize} from "../../../utils/tools.js";
|
|
|
+import { bytesToSize } from '@/utils/tools.js'
|
|
|
|
|
|
export default {
|
|
|
- name: "dialog_info",
|
|
|
- components: {baseButton},
|
|
|
+ name: 'dialog_info',
|
|
|
+ components: { baseButton },
|
|
|
props: {
|
|
|
id: String
|
|
|
},
|
|
|
watch: {
|
|
|
id: {
|
|
|
- handler() {
|
|
|
+ handler () {
|
|
|
this.getFileInfo()
|
|
|
},
|
|
|
immediate: true
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
size: '',
|
|
|
info: {}
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getFileInfo()
|
|
|
},
|
|
|
methods: {
|
|
|
- getFileInfo() {
|
|
|
- this.$api.database.fileInfo({id: this.id}).then(res => {
|
|
|
+ getFileInfo () {
|
|
|
+ this.$api.database.fileInfo({ id: this.id }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.info = res.data
|
|
|
this.toSize()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- toSize() {
|
|
|
+ toSize () {
|
|
|
this.size = bytesToSize(this.info.volume)
|
|
|
}
|
|
|
}
|