|
@@ -39,12 +39,18 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="说明信息" align="left" prop="apkInfo" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="APK大小" align="left" prop="fileData" >
|
|
|
+ <template slot-scope="scope" v-if="scope.row.fileData">
|
|
|
+ <p>{{scope.row.fileData.size}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="创建人" align="left" prop="createBy" />
|
|
|
<el-table-column label="创建时间" align="left" prop="createTime" />
|
|
|
<el-table-column label="操作" align="left" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex;justify-content: flex-start;">
|
|
|
<p style="color: #0183fa;cursor: pointer" @click="handleClick('',scope.row,'download')">下载</p>
|
|
|
+ <p style="color: #0183fa;cursor: pointer;margin-left: 20px" @click="handleClick('',scope.row,'edit')">编辑</p>
|
|
|
<p style="color: #0183fa;cursor: pointer;margin-left: 20px" @click="handleClick('',scope.row,'delete')">删除</p>
|
|
|
</div>
|
|
|
|
|
@@ -132,7 +138,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { listLog, apkUploadList, getApkUploadList,addApkUpload,apkUploadDelete} from "@/api/laboratory/apkfile";
|
|
|
+import {
|
|
|
+ listLog,
|
|
|
+ apkUploadList,
|
|
|
+ getApkUploadList,
|
|
|
+ addApkUpload,
|
|
|
+ apkUploadDelete,
|
|
|
+ editApkList
|
|
|
+} from '@/api/laboratory/apkfile'
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import axios from 'axios'
|
|
|
import SparkMD5 from 'spark-md5'
|
|
@@ -192,7 +205,15 @@
|
|
|
},
|
|
|
},
|
|
|
//上传数据
|
|
|
- upForm:{},
|
|
|
+ upForm:{
|
|
|
+ id:'',
|
|
|
+ versionName:null,
|
|
|
+ version:null,
|
|
|
+ apkInfo:null,
|
|
|
+ onepcType:null,
|
|
|
+ apkFileUpload:null,
|
|
|
+
|
|
|
+ },
|
|
|
// apk上传表单校验
|
|
|
apkRules: {
|
|
|
versionName: [
|
|
@@ -293,6 +314,18 @@
|
|
|
handleClick(index,row,doType){
|
|
|
if(doType=='download'){
|
|
|
window.open(window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_API + row.apkFileUpload)
|
|
|
+ }else if(doType=='edit'){
|
|
|
+ this.upForm.id=row.id
|
|
|
+ this.upForm.versionName=row.versionName
|
|
|
+ this.upForm.version=row.version
|
|
|
+ this.upForm.apkInfo=row.apkInfo
|
|
|
+ this.upForm.onepcType=row.onepcType.toString()
|
|
|
+ this.upForm.apkFileUpload=row.apkFileUpload
|
|
|
+ if(row.fileData){
|
|
|
+ this.upForm.fileData=row.fileData
|
|
|
+ this.fileData=row.fileData
|
|
|
+ }
|
|
|
+ this.openUp=true
|
|
|
}else if(doType=='delete'){
|
|
|
this.$confirm('确认要删除?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -313,9 +346,14 @@
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
apkUploadList(this.queryParams).then( response => {
|
|
|
- this.logList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ this.logList = response.rows;
|
|
|
+ this.logList.forEach(function(item) {
|
|
|
+ if(item.fileData){
|
|
|
+ item.fileData=JSON.parse(item.fileData)
|
|
|
+ }
|
|
|
+ })
|
|
|
});
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
@@ -458,25 +496,52 @@
|
|
|
if(this.loading){
|
|
|
return
|
|
|
}
|
|
|
- this.$refs["upForm"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- let obj = {
|
|
|
- versionName:this.upForm.versionName,
|
|
|
- version:this.upForm.version,
|
|
|
- apkInfo:this.upForm.apkInfo,
|
|
|
- onepcType:this.upForm.onepcType,
|
|
|
- apkFileUpload:this.upForm.apkFileUpload,
|
|
|
- };
|
|
|
- addApkUpload(obj).then( response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.getList()
|
|
|
- this.openUp = false;
|
|
|
- this.upForm = {};
|
|
|
- this.fileList=[];
|
|
|
- this.fileData = {};
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ if(this.upForm.id){//编辑
|
|
|
+ this.$refs["upForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let obj = {
|
|
|
+ id:this.upForm.id,
|
|
|
+ versionName:this.upForm.versionName,
|
|
|
+ version:this.upForm.version,
|
|
|
+ apkInfo:this.upForm.apkInfo,
|
|
|
+ onepcType:this.upForm.onepcType,
|
|
|
+ apkFileUpload:this.upForm.apkFileUpload,
|
|
|
+ fileData:JSON.stringify(this.fileData),
|
|
|
+ };
|
|
|
+ editApkList(obj).then( response => {
|
|
|
+ this.msgSuccess("编辑成功");
|
|
|
+ this.getList()
|
|
|
+ this.openUp = false;
|
|
|
+ this.upForm = {};
|
|
|
+ this.fileList=[];
|
|
|
+ this.fileData = {};
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }else{//添加
|
|
|
+ this.$refs["upForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let obj = {
|
|
|
+ versionName:this.upForm.versionName,
|
|
|
+ version:this.upForm.version,
|
|
|
+ apkInfo:this.upForm.apkInfo,
|
|
|
+ onepcType:this.upForm.onepcType,
|
|
|
+ apkFileUpload:this.upForm.apkFileUpload,
|
|
|
+ fileData:JSON.stringify(this.fileData),
|
|
|
+ };
|
|
|
+ addApkUpload(obj).then( response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.getList()
|
|
|
+ this.openUp = false;
|
|
|
+ this.upForm = {};
|
|
|
+ this.fileList=[];
|
|
|
+ this.fileData = {};
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
};
|