14 changed files with 888 additions and 152 deletions
@ -0,0 +1,53 @@ |
|||
<template> |
|||
<el-upload |
|||
class="upload-demo" |
|||
ref="upload" |
|||
:action="uploadFile" |
|||
:on-preview="handlePreview" |
|||
:on-remove="handleRemove" |
|||
:on-progress="handleSuccess" |
|||
:file-list="fileList" |
|||
:limit="1" |
|||
name="file" |
|||
:data="fileInfo" |
|||
:auto-upload="false"> |
|||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|||
</el-upload> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { upload_frameFile } from '@/api/Common/Upload' |
|||
export default { |
|||
props: { |
|||
fileInfo: { |
|||
type: Object |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
fileList: [], |
|||
uploadFile: upload_frameFile |
|||
} |
|||
}, |
|||
created() { |
|||
this.fileList = [] |
|||
this.uploadFile = upload_frameFile |
|||
}, |
|||
methods: { |
|||
handleSuccess(event, file, fileList) { |
|||
console.log(file, fileList) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log(file, fileList) |
|||
}, |
|||
handlePreview(file) { |
|||
console.log(file) |
|||
}, |
|||
submitUpload() { |
|||
console.log(this.fileInfo) |
|||
this.$refs.upload.submit() |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,144 @@ |
|||
<template> |
|||
<div><!----> |
|||
<el-upload class="avatar-uploader" :headers="accessToken" :action="uploadFile" :accept="accept" :data="uploadData" :on-success="uploadImgSuccess_FuJian" :on-remove="handleRemove" :limit="1" :file-list="files" list-type="picture-card" :on-preview="handlePictureCardPreview"> |
|||
<i class="el-icon-plus avatar-uploader-icon"/> |
|||
</el-upload> |
|||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
|||
<img width="100%" :src="dialogImageUrl" alt=""> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { uploadFileIcon } from '@/api/Common/Upload' |
|||
import { getStorage } from '@/utils/auth.js' // token |
|||
|
|||
export default { |
|||
model: { |
|||
prop: 'name', |
|||
event: 'change' |
|||
}, |
|||
props: { |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bucket: { |
|||
type: String, |
|||
default: 'abc' |
|||
}, |
|||
// 长度 |
|||
width: { |
|||
type: String, |
|||
default: '270px' |
|||
}, |
|||
limit: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
accept: { |
|||
type: String, |
|||
default: |
|||
'.jpg,.jpeg,.png,.JPG,.JPEG,' |
|||
}, |
|||
// 文件名称 |
|||
name: { |
|||
type: Array, |
|||
required: true |
|||
}, |
|||
uploadData: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
accessToken: null, |
|||
uploadFile: uploadFileIcon, |
|||
fileList_FuJian: [], |
|||
enclosure: '', |
|||
file_add: '', |
|||
file_catch: '', |
|||
files: [], |
|||
files_list: [], |
|||
filedUrl: '', |
|||
// fileUrl: fileUrl, |
|||
// showpicture:false, |
|||
isview: false, |
|||
nameArr: '', |
|||
loadding: false, |
|||
stateName: '', |
|||
/* uploadData: { modelSid: '' },*/ |
|||
sid: '' |
|||
} |
|||
}, |
|||
watch: { |
|||
name: { |
|||
deep: true, |
|||
immediate: true, |
|||
handler(newVal, oldVal) { |
|||
console.log('aaaa1', newVal) |
|||
this.files = newVal |
|||
console.log('aaaa2', this.files) |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.Init() |
|||
}) |
|||
}, |
|||
created() { |
|||
this.uploadFile = uploadFileIcon // 接口 |
|||
this.accessToken = { |
|||
token: getStorage() |
|||
} |
|||
}, |
|||
methods: { |
|||
// 页面第一次加载 |
|||
Init() { |
|||
if (this.name !== undefined) { |
|||
this.files = [] |
|||
for (var i = 0; i < this.name.length; i++) { |
|||
this.files.push({ |
|||
name: this.name[i], |
|||
url: this.name[i] |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
// 上传方案--成功后执行 |
|||
uploadImgSuccess_FuJian(response, file, fileList) { |
|||
let _this = this |
|||
console.log('您选择的file:', file) |
|||
// console.log('您传递的data:', _this.uploadData) |
|||
if (file.response.code === '200') { |
|||
this.loadding = false |
|||
// 返显图片 |
|||
this.filedUrl = this.fileUrl + file.response.data |
|||
// var uid = file.response.data |
|||
const files = [] |
|||
files.push({ |
|||
name: file.response.data.sourceFileName, |
|||
url: file.response.data.fullUrl, |
|||
size: file.response.data.size |
|||
}) |
|||
this.$emit('change', files) |
|||
} |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log('file:' + JSON.stringify(file)) |
|||
console.log('fileList:' + JSON.stringify(fileList)) |
|||
}, |
|||
handlePictureCardPreview(file) { |
|||
this.dialogVisible = true |
|||
this.dialogImageUrl = file.url |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,53 @@ |
|||
<template> |
|||
<el-upload |
|||
class="upload-demo" |
|||
ref="upload" |
|||
:action="uploadFile" |
|||
:on-preview="handlePreview" |
|||
:on-remove="handleRemove" |
|||
:on-progress="handleSuccess" |
|||
:file-list="fileList" |
|||
:limit="1" |
|||
name="multipartFile" |
|||
:data="fileInfo" |
|||
:auto-upload="false"> |
|||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|||
</el-upload> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { upload_UpdateFile } from '@/api/Common/Upload' |
|||
export default { |
|||
props: { |
|||
fileInfo: { |
|||
type: Object |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
fileList: [], |
|||
uploadFile: upload_UpdateFile |
|||
} |
|||
}, |
|||
created() { |
|||
this.fileList = [] |
|||
this.uploadFile = upload_UpdateFile |
|||
}, |
|||
methods: { |
|||
handleSuccess(event, file, fileList) { |
|||
console.log(file, fileList) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log(file, fileList) |
|||
}, |
|||
handlePreview(file) { |
|||
console.log(file) |
|||
}, |
|||
submitUpload() { |
|||
console.log(this.fileInfo) |
|||
this.$refs.upload.submit() |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,111 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存 |
|||
</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>apk上传</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item> |
|||
<upload_frameApk ref="uploadMoreImg" v-model="imgList" bucket="map" :fileInfo ="formobj"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件icon</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item> |
|||
<upload_icon ref="uploadIcon" v-model="list" bucket="map" @change="backIcon" :upload-data="{type:'0002'}"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span>版本描述</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item><el-input v-model="formobj.upgradeInfo" type="textarea" resize="none" :autosize="{ minRows: 2, maxRows: 50}" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import upload_frameApk from '@/components/uploadFile/upload_frameApk' |
|||
import upload_icon from '@/components/uploadFile/upload_icon' |
|||
|
|||
export default { |
|||
name: 'frame', |
|||
components: { |
|||
upload_frameApk, |
|||
upload_icon |
|||
}, |
|||
data() { |
|||
return { |
|||
tableKey: 0, |
|||
index: 0, |
|||
viewTitle: '', |
|||
dialogStatus: '', |
|||
sid: '', |
|||
isShow: true, |
|||
list: [], |
|||
imgList: [], |
|||
formobj: { |
|||
iconUrl: '', |
|||
upgradeInfo: '' |
|||
}, |
|||
rules: {}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
methods: { |
|||
showAdd() { |
|||
this.dialogStatus = 'add' |
|||
this.viewTitle = '更新框架' |
|||
}, |
|||
handleSave() { |
|||
this.$refs['form_obj'].validate(valid => { |
|||
if (valid) { |
|||
this.$refs.uploadMoreImg.submitUpload() |
|||
this.handleReturn('true') |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
backIcon(val) { |
|||
if (val.length > 0) { |
|||
this.formobj.iconUrl = val[0].url |
|||
} |
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.dialogStatus = '' |
|||
this.formobj = { |
|||
iconUrl: '', |
|||
upgradeInfo: '' |
|||
} |
|||
this.list = [] |
|||
this.imgList = [] |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.addInput { |
|||
width: 30%; |
|||
} |
|||
</style> |
@ -0,0 +1,232 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存 |
|||
</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件名称</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item prop="appName"><el-input v-model="formobj.appName" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件icon</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item> |
|||
<upload_icon ref="uploadIcon" v-model="list" bucket="map" @change="backIcon" :upload-data="{type:'0002'}"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>关联主程序</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item><el-input v-model="formobj.linkSid" class="addInput" clearable placeholder="" readonly /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件标识</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item><el-input v-model="formobj.appSid" class="addInput" clearable placeholder="" readonly /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>启动名称</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item prop="modulePluginName"><el-input v-model="formobj.modulePluginName" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>主页路由</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item prop="sourceAction"><el-input v-model="formobj.sourceAction" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件包名</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item prop="sourcePackage"><el-input v-model="formobj.sourcePackage" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>插件类型</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item prop="type"> |
|||
<el-select v-model="formobj.type" placeholder="请选择" filterable clearable class="addInput"> |
|||
<el-option v-for="item in type_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span><span class="icon">*</span>apk上传</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item> |
|||
<upload_updateApk ref="uploadMoreImg" v-model="imgList" bucket="map" :fileInfo ="formobj"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span>更新内容</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item><el-input v-model="formobj.upgradeInfo" type="textarea" resize="none" :autosize="{ minRows: 2, maxRows: 50}" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
<el-col :span="5" class="tleftb"> |
|||
<span>排序号</span> |
|||
</el-col> |
|||
<el-col :span="19"> |
|||
<el-form-item><el-input v-model="formobj.sortNo" class="addInput" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import upload_updateApk from '@/components/uploadFile/upload_updateApk' |
|||
import upload_icon from '@/components/uploadFile/upload_icon' |
|||
|
|||
export default { |
|||
name: 'updateplugin', |
|||
components: { |
|||
upload_updateApk, |
|||
upload_icon |
|||
}, |
|||
data() { |
|||
return { |
|||
tableKey: 0, |
|||
index: 0, |
|||
viewTitle: '', |
|||
dialogStatus: '', |
|||
sid: '', |
|||
isShow: true, |
|||
list: [], |
|||
imgList: [], |
|||
type_list: [ |
|||
{ |
|||
dictKey: 0, |
|||
dictValue: '内置Activity' |
|||
}, |
|||
{ |
|||
dictKey: 1, |
|||
dictValue: '内置WebView' |
|||
}, |
|||
{ |
|||
dictKey: 2, |
|||
dictValue: 'RePlugin插件' |
|||
} |
|||
], |
|||
formobj: { |
|||
appName: '', |
|||
appSid: '', |
|||
iconUrl: '', |
|||
linkSid: '147694bb-c765-4426-8f67-d19a66585f31', |
|||
sourceAction: '', |
|||
sourcePackage: '', |
|||
type: '', |
|||
upgradeInfo: '', |
|||
modulePluginName: '', |
|||
sortNo: '' |
|||
}, |
|||
rules: { |
|||
appName: [{ required: true, message: '插件名称不能为空', trigger: 'blur' }], |
|||
modulePluginName: [{ required: true, message: '启动名称不能为空', trigger: 'blur' }], |
|||
sourceAction: [{ required: true, message: '主页路由不能为空', trigger: 'blur' }], |
|||
sourcePackage: [{ required: true, message: '插件包名不能为空', trigger: 'blur' }], |
|||
type: [{ required: true, message: '插件类型不能为空', trigger: 'change' }] |
|||
}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
methods: { |
|||
init() {}, |
|||
showEdit(row) { |
|||
console.log(row, 8585) |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '更新插件' |
|||
this.dialogStatus = 'edit' |
|||
this.formobj.appName = row.appName |
|||
this.formobj.iconUrl = row.iconUrl |
|||
this.formobj.linkSid = row.linkSid |
|||
this.formobj.appSid = row.appSid |
|||
this.formobj.modulePluginName = row.modulePluginName |
|||
this.formobj.sourceAction = row.sourceAction |
|||
this.formobj.sourcePackage = row.sourcePackage |
|||
this.list.push({ |
|||
name: '', |
|||
url: this.formobj.iconUrl |
|||
}) |
|||
let bb = null |
|||
this.type_list.forEach((e) => { |
|||
if (e.dictKey == row.type) { |
|||
bb = { |
|||
type: e.dictValue |
|||
} |
|||
} |
|||
}) |
|||
this.formobj.type = bb.type |
|||
}, |
|||
handleSave() { |
|||
this.$refs['form_obj'].validate(valid => { |
|||
if (valid) { |
|||
let bb = null |
|||
this.type_list.forEach((e) => { |
|||
if (e.dictValue === this.formobj.type) { |
|||
bb = { |
|||
key: e.dictKey |
|||
} |
|||
} |
|||
}) |
|||
this.formobj.type = bb.key |
|||
this.$refs.uploadMoreImg.submitUpload() |
|||
this.handleReturn('true') |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
backIcon(val) { |
|||
if (val.length > 0) { |
|||
this.formobj.iconUrl = val[0].url |
|||
} |
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.dialogStatus = '' |
|||
this.formobj = { |
|||
appName: '', |
|||
appSid: '', |
|||
iconUrl: '', |
|||
linkSid: '147694bb-c765-4426-8f67-d19a66585f31', |
|||
sourceAction: '', |
|||
sourcePackage: '', |
|||
type: '', |
|||
upgradeInfo: '', |
|||
modulePluginName: '', |
|||
sortNo: '' |
|||
} |
|||
this.list = [] |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.addInput { |
|||
width: 30%; |
|||
} |
|||
</style> |
Loading…
Reference in new issue