-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
875cb0e
commit 5accb54
Showing
24 changed files
with
159 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import DialogInput from './DialogInput' | ||
import DialogSelect from './DialogSelect' | ||
import DialogCodeMirror from './DialogCodeMirror' | ||
import DialogFile from './DialogFile' | ||
|
||
export default { | ||
'dialog-input': DialogInput, | ||
'dialog-select': DialogSelect, | ||
'dialog-codemirror': DialogCodeMirror, | ||
'dialog-file': DialogFile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<div class="mp-dialog-input"> | ||
<label>{{ title }}</label> | ||
<input type="file" name="picture" @change="handleFile"> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.mp-dialog-input { | ||
overflow: auto; | ||
} | ||
.mp-dialog-input label { | ||
float: left; | ||
padding-top: 5px; | ||
vertical-align: top; | ||
margin-right: 10px; | ||
width: 20%; | ||
font-size: 14px; | ||
color: #666; | ||
} | ||
.mp-dialog-input input { | ||
float: left; | ||
width: 70%; | ||
color: #999; | ||
padding: 8px; | ||
border: 1px solid #ddd; | ||
} | ||
</style> | ||
|
||
<script> | ||
import abstractInputComponent from './AbstractDialogComponent' | ||
export default { | ||
name: 'file', | ||
extends: abstractInputComponent, | ||
methods: { | ||
async handleFile (event) { | ||
let file = event.target.files[0] | ||
this.fieldValue = await this.param.callback(file) | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div class="dialog-form"> | ||
<div class="mp-dialog-field" v-for="field in fields" :key="field.name"> | ||
<component :is="field.type || field.component" :request-field="field" v-model="data[field.name]"></component> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import DialogComponents from './DialogComponentMap' | ||
export default { | ||
name: 'dialog-form', | ||
props: { | ||
fields: { | ||
type: Array, | ||
required: true | ||
}, | ||
value: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
model: { | ||
prop: 'value', | ||
event: 'change' | ||
}, | ||
computed: { | ||
data: { | ||
get () { | ||
return this.value | ||
}, | ||
set (value) { | ||
this.$emit('change', value) | ||
} | ||
} | ||
}, | ||
methods: { | ||
close () { | ||
this.$emit('close') | ||
}, | ||
finish () { | ||
this.$emit('finish', this.response) | ||
} | ||
}, | ||
components: DialogComponents, | ||
inject: ['t'] | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.mp-dialog-field { | ||
margin: 10px 8px; | ||
overflow:auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import axios from 'axios' | ||
|
||
function ImageUploaderFactory (uploadURL, fieldName) { | ||
return async (file) => { | ||
let form = new FormData() | ||
form.append(fieldName, file, file.name) | ||
|
||
return axios.post(uploadURL, form) | ||
} | ||
} | ||
|
||
export { ImageUploaderFactory } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters