fix: 修改安装包模块出现的问题
This commit is contained in:
parent
1f7755386d
commit
58e0e2c7aa
@ -1,38 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="component-upload-image">
|
<div class="component-upload-image">
|
||||||
<el-upload
|
<el-upload
|
||||||
multiple
|
ref="imageUpload"
|
||||||
:action="uploadImgUrl"
|
:action="uploadImgUrl"
|
||||||
list-type="picture-card"
|
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
|
:class="{hide: this.fileList.length >= this.limit}"
|
||||||
|
:file-list="fileList"
|
||||||
|
:headers="headers"
|
||||||
:limit="limit"
|
:limit="limit"
|
||||||
|
:list-type="listType"
|
||||||
:on-error="handleUploadError"
|
:on-error="handleUploadError"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
ref="imageUpload"
|
|
||||||
:on-remove="handleDelete"
|
|
||||||
:show-file-list="true"
|
|
||||||
:headers="headers"
|
|
||||||
:file-list="fileList"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-preview="handlePictureCardPreview"
|
||||||
:class="{hide: this.fileList.length >= this.limit}"
|
:on-remove="handleDelete"
|
||||||
|
:on-success="handleUploadSuccess"
|
||||||
|
:show-file-list="true"
|
||||||
|
multiple
|
||||||
>
|
>
|
||||||
<i class="el-icon-plus"></i>
|
<i v-if="listType=='picture-card'" class="el-icon-plus"></i>
|
||||||
|
<el-button v-else icon="el-icon-upload" size="small" type="primary">上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
请上传
|
请上传
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b></template>
|
||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
|
append-to-body
|
||||||
title="预览"
|
title="预览"
|
||||||
width="800"
|
width="800"
|
||||||
append-to-body
|
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
:src="dialogImageUrl"
|
:src="dialogImageUrl"
|
||||||
@ -43,7 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@ -51,17 +52,21 @@ export default {
|
|||||||
// 图片数量限制
|
// 图片数量限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 大小限制(MB)
|
// 大小限制(MB)
|
||||||
fileSize: {
|
fileSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: {
|
fileType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ["png", "jpg", "jpeg"],
|
default: () => ['png', 'jpg', 'jpeg']
|
||||||
|
},
|
||||||
|
listType: {
|
||||||
|
type: String,
|
||||||
|
default: 'picture-card'
|
||||||
},
|
},
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
isShowTip: {
|
isShowTip: {
|
||||||
@ -73,37 +78,37 @@ export default {
|
|||||||
return {
|
return {
|
||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
dialogImageUrl: "",
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
hideUpload: false,
|
hideUpload: false,
|
||||||
baseUrl: process.env.VUE_APP_BASE_API,
|
baseUrl: process.env.VUE_APP_BASE_API,
|
||||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: 'Bearer ' + getToken()
|
||||||
},
|
},
|
||||||
fileList: []
|
fileList: []
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
// 首先将值转为数组
|
// 首先将值转为数组
|
||||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
const list = Array.isArray(val) ? val : this.value.split(',')
|
||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map(item => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === 'string') {
|
||||||
if (item.indexOf(this.baseUrl) === -1) {
|
if (item.indexOf(this.baseUrl) === -1) {
|
||||||
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
item = { name: this.baseUrl + item, url: this.baseUrl + item }
|
||||||
} else {
|
} else {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: item }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
this.fileList = [];
|
this.fileList = []
|
||||||
return [];
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
@ -113,105 +118,108 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
showTip() {
|
showTip() {
|
||||||
return this.isShowTip && (this.fileType || this.fileSize);
|
return this.isShowTip && (this.fileType || this.fileSize)
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 上传前loading加载
|
// 上传前loading加载
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
let isImg = false;
|
let isImg = false
|
||||||
if (this.fileType.length) {
|
if (this.fileType.length) {
|
||||||
let fileExtension = "";
|
let fileExtension = ''
|
||||||
if (file.name.lastIndexOf(".") > -1) {
|
if (file.name.lastIndexOf('.') > -1) {
|
||||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1)
|
||||||
}
|
}
|
||||||
isImg = this.fileType.some(type => {
|
isImg = this.fileType.some(type => {
|
||||||
if (file.type.indexOf(type) > -1) return true;
|
if (file.type.indexOf(type) > -1) return true
|
||||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
if (fileExtension && fileExtension.indexOf(type) > -1) return true
|
||||||
return false;
|
return false
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
isImg = file.type.indexOf("image") > -1;
|
isImg = file.type.indexOf('image') > -1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isImg) {
|
if (!isImg) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}图片格式文件!`)
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
if (this.fileSize) {
|
if (this.fileSize) {
|
||||||
const isLt = file.size / 1024 / 1024 < this.fileSize;
|
const isLt = file.size / 1024 / 1024 < this.fileSize
|
||||||
if (!isLt) {
|
if (!isLt) {
|
||||||
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
|
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`)
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$modal.loading("正在上传图片,请稍候...");
|
this.$modal.loading('正在上传图片,请稍候...')
|
||||||
this.number++;
|
this.number++
|
||||||
},
|
},
|
||||||
// 文件个数超出
|
// 文件个数超出
|
||||||
handleExceed() {
|
handleExceed() {
|
||||||
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res, file) {
|
handleUploadSuccess(res, file) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
this.uploadList.push({ name: res.fileName, url: res.fileName, size: res.fileSize })
|
||||||
this.uploadedSuccessfully();
|
this.uploadedSuccessfully()
|
||||||
} else {
|
} else {
|
||||||
this.number--;
|
this.number--
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading()
|
||||||
this.$modal.msgError(res.msg);
|
this.$modal.msgError(res.msg)
|
||||||
this.$refs.imageUpload.handleRemove(file);
|
this.$refs.imageUpload.handleRemove(file)
|
||||||
this.uploadedSuccessfully();
|
this.uploadedSuccessfully()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除图片
|
// 删除图片
|
||||||
handleDelete(file) {
|
handleDelete(file) {
|
||||||
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
const findex = this.fileList.map(f => f.name).indexOf(file.name)
|
||||||
if(findex > -1) {
|
if (findex > -1) {
|
||||||
this.fileList.splice(findex, 1);
|
this.fileList.splice(findex, 1)
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError() {
|
handleUploadError() {
|
||||||
this.$modal.msgError("上传图片失败,请重试");
|
this.$modal.msgError('上传图片失败,请重试')
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading()
|
||||||
},
|
},
|
||||||
// 上传结束处理
|
// 上传结束处理
|
||||||
uploadedSuccessfully() {
|
uploadedSuccessfully() {
|
||||||
if (this.number > 0 && this.uploadList.length === this.number) {
|
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.fileList = this.fileList.concat(this.uploadList)
|
||||||
this.uploadList = [];
|
console.log(this.fileList)
|
||||||
this.number = 0;
|
this.uploadList = []
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.number = 0
|
||||||
this.$modal.closeLoading();
|
this.$emit('input', this.listToString(this.fileList))
|
||||||
|
this.$emit('getSize', this.fileList)
|
||||||
|
this.$modal.closeLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 预览
|
// 预览
|
||||||
handlePictureCardPreview(file) {
|
handlePictureCardPreview(file) {
|
||||||
this.dialogImageUrl = file.url;
|
this.dialogImageUrl = file.url
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
// 对象转成指定字符串分隔
|
// 对象转成指定字符串分隔
|
||||||
listToString(list, separator) {
|
listToString(list, separator) {
|
||||||
let strs = "";
|
let strs = ''
|
||||||
separator = separator || ",";
|
separator = separator || ','
|
||||||
for (let i in list) {
|
for (let i in list) {
|
||||||
if (list[i].url) {
|
if (list[i].url) {
|
||||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
strs += list[i].url.replace(this.baseUrl, '') + separator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
return strs != '' ? strs.substr(0, strs.length - 1) : ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style lang="scss" scoped>
|
||||||
// .el-upload--picture-card 控制加号部分
|
// .el-upload--picture-card 控制加号部分
|
||||||
::v-deep.hide .el-upload--picture-card {
|
::v-deep.hide .el-upload--picture-card {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去掉动画效果
|
// 去掉动画效果
|
||||||
::v-deep .el-list-enter-active,
|
::v-deep .el-list-enter-active,
|
||||||
::v-deep .el-list-leave-active {
|
::v-deep .el-list-leave-active {
|
||||||
|
@ -176,6 +176,22 @@ export const dynamicRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/build/install',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ['build:install:edit'],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'edit',
|
||||||
|
component: () => import('@/views/FDS/installationList/edit'),
|
||||||
|
name: 'InstallEdit',
|
||||||
|
meta: { title: '编辑安装包', activeMenu: '/build/installationList' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/build/install',
|
path: '/build/install',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -221,7 +237,7 @@ export const dynamicRoutes = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/build/whiteListManagement',
|
path: '/build/whiteList',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
permissions: ['build:whiteListManagement:add'],
|
permissions: ['build:whiteListManagement:add'],
|
||||||
@ -236,7 +252,7 @@ export const dynamicRoutes = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/build/whiteListManagement',
|
path: '/build/whiteList',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
permissions: ['build:whiteListManagement:detail'],
|
permissions: ['build:whiteListManagement:detail'],
|
||||||
@ -251,7 +267,7 @@ export const dynamicRoutes = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/build/whiteListManagement',
|
path: '/build/whiteList',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
permissions: ['build:whiteListManagement:addConfig'],
|
permissions: ['build:whiteListManagement:addConfig'],
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="状态" prop="uploading_status">
|
<el-table-column align="center" label="状态" prop="uploading_status">
|
||||||
<template slot-scope="scopeA">
|
<template slot-scope="scopeA">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>
|
<dict-tag :options="dict.type.uploading_status" :value="scopeA.row.uploadingStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||||
@ -107,7 +107,7 @@
|
|||||||
// import { listINFO, getINFO, delINFO, addINFO, updateINFO } from "@/api/deploy/INFO";
|
// import { listINFO, getINFO, delINFO, addINFO, updateINFO } from "@/api/deploy/INFO";
|
||||||
export default {
|
export default {
|
||||||
name: 'ChannelManagement',
|
name: 'ChannelManagement',
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ['sys_yes_no', 'uploading_status'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -30,15 +30,21 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包文件" prop="sysApk">
|
<el-form-item label="安装包文件" prop="sysApk">
|
||||||
<el-upload ref="sysApk" v-model="formData.sysApk" :action="field101Action"
|
|
||||||
:before-upload="field101BeforeUpload"
|
<image-upload v-model="formData.sysApk" :fileType="['apk','txt','png','excel']" :limit="1"
|
||||||
:file-list="field101fileList"
|
:listType="'text'"
|
||||||
>
|
@getSize="getSize"
|
||||||
<el-button icon="el-icon-upload" size="small" type="primary">上传文件</el-button>
|
/>
|
||||||
</el-upload>
|
|
||||||
|
<!-- <el-upload ref="sysApk" v-model="formData.sysApk" :action="actionUrl"-->
|
||||||
|
<!-- :before-upload="field101BeforeUpload"-->
|
||||||
|
<!-- :file-list="field101fileList"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <el-button icon="el-icon-upload" size="small" type="primary">上传文件</el-button>-->
|
||||||
|
<!-- </el-upload>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包大小" prop="sysApkSize">
|
<el-form-item label="安装包大小" prop="sysApkSize">
|
||||||
<el-input v-model="formData.sysApkSize" :style="{width: '100%'}" clearable placeholder="请输入安装包大小">
|
<el-input v-model="formData.sysApkSize" :style="{width: '100%'}" placeholder="请输入安装包大小" readonly>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包类型" prop="sysType">
|
<el-form-item label="安装包类型" prop="sysType">
|
||||||
@ -61,7 +67,7 @@
|
|||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
<el-form-item size="large">
|
<el-form-item size="large">
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
<el-button @click="resetForm">重置</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -71,7 +77,7 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addINFO, updateINFO } from '@/api/FDS/installList'
|
import { addINFO } from '@/api/FDS/installList'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InstallAdd',
|
name: 'InstallAdd',
|
||||||
@ -79,14 +85,12 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
field102: 1,
|
uploadingType: 1,
|
||||||
field103: undefined,
|
sysApkName: undefined,
|
||||||
field104: undefined,
|
version: undefined,
|
||||||
field101: null,
|
sysApk: null,
|
||||||
field105: undefined,
|
sysApkSize: undefined,
|
||||||
field106: 'Android',
|
sysType: ''
|
||||||
field107: undefined,
|
|
||||||
field108: undefined
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
uploadingType: [
|
uploadingType: [
|
||||||
@ -100,49 +104,38 @@ export default {
|
|||||||
],
|
],
|
||||||
sysType: [
|
sysType: [
|
||||||
{ required: true, message: '安装包类型不能为空', trigger: 'change' }
|
{ required: true, message: '安装包类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkSize: [
|
||||||
|
{ required: true, message: '安装包大小不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
sysApk: [
|
||||||
|
{ required: true, message: '安装包不能为空', trigger: 'change' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
field101Action: 'https://jsonplaceholder.typicode.com/posts/',
|
actionUrl: 'http://192.168.1.23:1024/dev-api/common/upload',
|
||||||
field101fileList: [],
|
field101fileList: [],
|
||||||
activeTabs: '1'
|
activeTabs: '1'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
mounted() {
|
|
||||||
this.activeTabs = this.$route.query.activeTabs
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['elForm'].validate(valid => {
|
this.$refs['elForm'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != undefined) {
|
addINFO(this.formData).then(response => {
|
||||||
updateINFO(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess('修改成功')
|
|
||||||
this.closeModal()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
addINFO(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess('新增成功')
|
this.$modal.msgSuccess('新增成功')
|
||||||
this.closeModal()
|
|
||||||
})
|
})
|
||||||
}
|
this.$router.push({ path: '/build/installationList' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 重置表单
|
getSize(e) {
|
||||||
resetForm() {
|
this.formData.sysApkSize = e[0].size + 'kb'
|
||||||
this.$refs['elForm'].resetFields()
|
|
||||||
},
|
|
||||||
field101BeforeUpload(file) {
|
|
||||||
let isRightSize = file.size / 1024 / 1024 < 2
|
|
||||||
if (!isRightSize) {
|
|
||||||
this.$message.error('文件大小超过 2MB')
|
|
||||||
}
|
|
||||||
return isRightSize
|
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.history.back()
|
this.$router.push({ path: '/build/installationList' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,19 +10,31 @@
|
|||||||
<el-form ref="form" :model="form" label-width="150px" size="mini">
|
<el-form ref="form" :model="form" label-width="150px" size="mini">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上传方式:">{{ form.uploadingType }}</el-form-item>
|
<el-form-item label="上传方式:">
|
||||||
|
|
||||||
|
<dict-tag :options="dict.type.sys_apk_uploading_type" :value="form.uploadingType"/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="安装包名称:"
|
label="安装包名称:"
|
||||||
>{{ form.sysApkName }}
|
>{{ form.sysApkName }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="安装包文件名称:">{{ form.sysApk }}</el-form-item>
|
<el-form-item label="安装包文件名称:">{{ form.sysApk }}</el-form-item>
|
||||||
<el-form-item label="安装包大小:">{{ form.sysApkSize }}</el-form-item>
|
<el-form-item label="安装包大小:">{{ form.sysApkSize }}</el-form-item>
|
||||||
<el-form-item label="适用系统:">{{ form.sysApkSize }}</el-form-item>
|
<el-form-item label="适用系统:">
|
||||||
|
|
||||||
|
<dict-tag :options="dict.type.sys_apk_type" :value="form.sysType"/>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
|
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
|
||||||
<el-form-item label="上传时间:">{{ form.create_time }}</el-form-item>
|
<el-form-item label="上传时间:">{{ form.createTime }}</el-form-item>
|
||||||
<el-form-item label="上传状态:">{{ form.uploadingStatus }}</el-form-item>
|
<el-form-item label="上传状态:">
|
||||||
|
<dict-tag :options="dict.type.uploading_status" :value="form.uploadingStatus"/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
|
||||||
<el-form-item label="上传日志:">日志日志</el-form-item>
|
<el-form-item label="上传日志:">日志日志</el-form-item>
|
||||||
|
<el-form-item size="large">
|
||||||
|
<el-button @click="cancel">关 闭</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -38,7 +50,7 @@ import { getINFO } from '@/api/FDS/installList'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InstallDetail',
|
name: 'InstallDetail',
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -53,10 +65,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/** 查询安装包管理详情 */
|
/** 查询安装包管理详情 */
|
||||||
getInfo() {
|
getInfo() {
|
||||||
this.loading = false
|
getINFO(this.$route.query.id).then(response => {
|
||||||
getINFO(this.id).then(response => {
|
this.form = response.data
|
||||||
this.form = response.rows
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.$router.push({ path: '/build/installationList' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
183
sf-ui/src/views/FDS/installationList/edit.vue
Normal file
183
sf-ui/src/views/FDS/installationList/edit.vue
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div>编辑安装包</div>
|
||||||
|
<el-divider/>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<div class="form-main">
|
||||||
|
<el-form ref="elForm" :model="formData" :rules="rules" label-width="100px" size="medium">
|
||||||
|
<el-form-item label="上传方式" prop="uploadingType">
|
||||||
|
<el-radio-group v-model="formData.uploadingType" size="medium">
|
||||||
|
<el-radio v-for="(item, index) in dict.type.sys_apk_uploading_type" :key="index"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:label="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="activeTabs==='1'" label="安装包名称" prop="sysApkName">
|
||||||
|
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-else label="模块包名称" prop="field107">-->
|
||||||
|
<!-- <el-input v-model="formData.field107" :style="{width: '100%'}" clearable placeholder="请输入模块包名称">-->
|
||||||
|
<!-- </el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="版本号" prop="version">
|
||||||
|
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包文件" prop="sysApk">
|
||||||
|
|
||||||
|
<image-upload v-model="formData.sysApk" :fileType="['apk','txt','png','excel']" :limit="1"
|
||||||
|
:listType="'text'"
|
||||||
|
@getSize="getSize"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- <el-upload ref="sysApk" v-model="formData.sysApk" :action="actionUrl"-->
|
||||||
|
<!-- :before-upload="field101BeforeUpload"-->
|
||||||
|
<!-- :file-list="field101fileList"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <el-button icon="el-icon-upload" size="small" type="primary">上传文件</el-button>-->
|
||||||
|
<!-- </el-upload>-->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包大小" prop="sysApkSize">
|
||||||
|
<el-input v-model="formData.sysApkSize" :style="{width: '100%'}" placeholder="请输入安装包大小" readonly>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安装包类型" prop="sysType">
|
||||||
|
<el-radio-group v-model="formData.sysType" size="medium">
|
||||||
|
<el-radio v-for="(item, index) in dict.type.sys_apk_type" :key="index" :disabled="item.disabled"
|
||||||
|
:label="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">-->
|
||||||
|
<!-- <el-select v-model="formData.field108" clearable placeholder="请选择对应的模块">-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="dict in dict.type.sys_yes_no"-->
|
||||||
|
<!-- :key="dict.value"-->
|
||||||
|
<!-- :label="dict.label"-->
|
||||||
|
<!-- :value="dict.value"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item size="large">
|
||||||
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getINFO, updateINFO } from '@/api/FDS/installList'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'InstallAdd',
|
||||||
|
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formData: {
|
||||||
|
uploadingType: 1,
|
||||||
|
sysApkName: undefined,
|
||||||
|
version: undefined,
|
||||||
|
sysApk: null,
|
||||||
|
sysApkSize: undefined,
|
||||||
|
sysType: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
uploadingType: [
|
||||||
|
{ required: true, message: '上传类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkName: [
|
||||||
|
{ required: true, message: '安装包名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
version: [
|
||||||
|
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
sysType: [
|
||||||
|
{ required: true, message: '安装包类型不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
sysApkSize: [
|
||||||
|
{ required: true, message: '安装包大小不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
sysApk: [
|
||||||
|
{ required: true, message: '安装包不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
actionUrl: 'http://192.168.1.23:1024/dev-api/common/upload',
|
||||||
|
field101fileList: [],
|
||||||
|
activeTabs: '1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (to) {
|
||||||
|
this.getInfo()
|
||||||
|
console.log(to)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.activeTabs = this.$route.query.activeTabs
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['elForm'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
updateINFO(this.formData).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
})
|
||||||
|
this.$router.push({ path: '/build/installationList' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询安装包管理详情 */
|
||||||
|
getInfo() {
|
||||||
|
getINFO(this.$route.query.id).then(response => {
|
||||||
|
this.formData = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSize(e) {
|
||||||
|
this.formData.sysApkSize = e[0].size + 'kb'
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.$router.push({ path: '/build/installationList' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background: #ffffff;
|
||||||
|
margin: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-main {
|
||||||
|
width: 700px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input.is-disabled .el-input__inner, .el-textarea.is-disabled .el-textarea__inner {
|
||||||
|
border: 1px solid #E4E7ED !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload__tip {
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
</style>
|
@ -129,14 +129,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column align="center" label="状态" prop="uploading_status">
|
<el-table-column align="center" label="状态" prop="uploading_status">
|
||||||
<template slot-scope="scopeA">
|
<template slot-scope="scopeA">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>
|
<dict-tag :options="dict.type.uploading_status" :value="scopeA.row.uploadingStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:config:dowmload']"
|
v-hasPermi="['system:config:dowmload']"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleDownload(scope.row)"
|
@click="handleDownload(scope.row)"
|
||||||
@ -152,7 +152,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['system:config:detail']"
|
v-hasPermi="['system:config:detail']"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-view"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleDetail(scope.row)"
|
@click="handleDetail(scope.row)"
|
||||||
@ -226,6 +226,11 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (to) this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
@ -252,11 +257,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
const params = {
|
const query = {
|
||||||
type: 'add',
|
|
||||||
activeTabs: this.activeTabs
|
activeTabs: this.activeTabs
|
||||||
}
|
}
|
||||||
this.$tab.openPage('新增安装包', '/build/install/add/', params)
|
this.$router.push({
|
||||||
|
path: '/build/install/add/',
|
||||||
|
query: query
|
||||||
|
})
|
||||||
|
// this.$tab.openPage('新增安装包', '/build/install/add/', params)
|
||||||
|
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
@ -279,15 +287,24 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleEdit(row) {
|
handleEdit(row) {
|
||||||
const params = {
|
const query = {
|
||||||
type: 'edit',
|
activeTabs: this.activeTabs,
|
||||||
activeTabs: this.activeTabs
|
id: row.id
|
||||||
}
|
}
|
||||||
this.$tab.openPage('编辑安装包', '/build/install/add/', params)
|
this.$router.push({
|
||||||
|
path: '/build/install/edit/',
|
||||||
|
query: query
|
||||||
|
})
|
||||||
|
|
||||||
|
// this.$tab.openPage('编辑安装包', '/build/install/add/', params)
|
||||||
},
|
},
|
||||||
/** 查看详情弹窗 **/
|
/** 查看详情弹窗 **/
|
||||||
handleDetail(row) {
|
handleDetail(row) {
|
||||||
this.$tab.openPage('编辑安装包', '/build/install/add/', row.id)
|
|
||||||
|
const params = {
|
||||||
|
id: row.id
|
||||||
|
}
|
||||||
|
this.$tab.openPage('安装包详情', '/build/install/detail/', params)
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 切换TAB触发的事件 */
|
/** 切换TAB触发的事件 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user