更新
This commit is contained in:
parent
cd95a6fc93
commit
bbb6e9f384
@ -230,4 +230,35 @@ export function routineStatusApi(id, data) {
|
||||
*/
|
||||
export function routineInfo() {
|
||||
return request.get(`config/setting/routine/config`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查看app版本详情
|
||||
*/
|
||||
export function appDetail(id) {
|
||||
return request.get(`app/version/detail/${id}`)
|
||||
}
|
||||
/**
|
||||
* @description 创建app版本
|
||||
*/
|
||||
export function appCreate(data) {
|
||||
return request.post(`app/version/create`, data)
|
||||
}
|
||||
/**
|
||||
* @description 获取app版本列表
|
||||
*/
|
||||
export function appLst(data) {
|
||||
return request.get(`app/version/lst`, data)
|
||||
}
|
||||
/**
|
||||
* @description 编辑app版本详情
|
||||
*/
|
||||
export function appEdit(id,data) {
|
||||
return request.post(`app/version/edit/${id}`,data)
|
||||
}
|
||||
/**
|
||||
* @description 删除app版本
|
||||
*/
|
||||
export function appDelete(id) {
|
||||
return request.post(`app/version/delete/${id}`)
|
||||
}
|
||||
|
@ -28,6 +28,14 @@ const appRouter =
|
||||
},
|
||||
component: () => import('@/views/app/wechat/menus/index')
|
||||
},
|
||||
{
|
||||
path: 'version',
|
||||
name: `appversion`,
|
||||
meta: {
|
||||
title: 'app版本管理'
|
||||
},
|
||||
component: () => import('@/views/system/appvison')
|
||||
},
|
||||
{
|
||||
path: 'wechat/reply',
|
||||
name: 'wechatReply',
|
||||
|
416
src/views/system/appvison/index.vue
Normal file
416
src/views/system/appvison/index.vue
Normal file
@ -0,0 +1,416 @@
|
||||
<template>
|
||||
<div class="divBox">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-button size="small" type="primary" class="mb20" @click="onAdd">添加app版本</el-button>
|
||||
|
||||
</div>
|
||||
<el-card class="box-card">
|
||||
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small">
|
||||
<el-table-column label="ID" prop="id" min-width="100" />
|
||||
<el-table-column label="标题" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.title.length > 10 ? scope.row.title.slice(0, 9) : scope.row.title }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="版本号" prop="version" min-width="100" />
|
||||
|
||||
<el-table-column label="下载地址" prop="dow_url" min-width="200" />
|
||||
|
||||
<el-table-column label="分类" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.type == 1 ? 'Android' : "IOS" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="100" />
|
||||
|
||||
|
||||
<el-table-column label="操作" min-width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="onSet(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetail(scope.row.id)">详情</el-button>
|
||||
<el-button type="text" size="small" @click="onDelete(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange"
|
||||
@current-change="pageChange" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!--审核-->
|
||||
<el-dialog v-if="dialogVisible" :before-close="handleClose" :title="isExamine ? '新增' : '编辑'"
|
||||
:visible.sync="dialogVisible" width="700px">
|
||||
<div v-loading="loading">
|
||||
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="120px" class="demo-ruleForm">
|
||||
<el-form-item label="版本标题:" prop="title">
|
||||
<el-input v-model="ruleForm.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本内容:" prop="content">
|
||||
<el-input type="textarea" v-model="ruleForm.content" :rows="3" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统类型:" prop="type">
|
||||
<el-radio-group v-model="ruleForm.type">
|
||||
<el-radio :label="2">IOS</el-radio>
|
||||
<el-radio :label="1">Android</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新类型:" prop="is_wgt">
|
||||
<el-radio-group v-model="ruleForm.is_wgt">
|
||||
<el-radio :label="0">app安装包更新</el-radio>
|
||||
<el-radio :label="1">wgt热更新</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="ruleForm.version" placeholder="版本号" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="上传版本:">
|
||||
<div class="upload-wrap">
|
||||
<el-upload ref="upload" :action="fileUrl" :on-success="handleSuccess" :headers="myHeaders"
|
||||
:show-file-list="false" multiple>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
只能上传apk文件.
|
||||
</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="下载地址" prop="dow_url">
|
||||
<el-input v-model="ruleForm.dow_url" placeholder="下载地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="强制更新:" prop="force">
|
||||
<el-radio-group v-model="ruleForm.force">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="静默更新:" prop="quiet">
|
||||
<el-radio-group v-model="ruleForm.quiet">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit(formData)">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-if="dialogVisible1" :before-close="handleClose1" title="详情" :visible.sync="dialogVisible1"
|
||||
width="700px">
|
||||
|
||||
<el-form ref="ruleForm1" :model="ruleForm1" label-width="120px" class="demo-ruleForm">
|
||||
<el-form-item label="标题:">
|
||||
{{ ruleForm1.title }}
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="上传内容:">
|
||||
{{ ruleForm1.content }}
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="类型:">
|
||||
<el-radio-group v-model="ruleForm1.type">
|
||||
<!-- <el-radio :label="3">WGT</el-radio> -->
|
||||
<el-radio :label="2">IOS</el-radio>
|
||||
<el-radio :label="1">Android</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机平台">
|
||||
{{ ruleForm1.phone_brand }}
|
||||
</el-form-item>
|
||||
<el-form-item label="下载地址">
|
||||
{{ ruleForm1.dow_url }}
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="dialogVisible1 = false">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import { appEdit, appDetail, appDelete, appLst, appCreate } from '@/api/app'
|
||||
import log from '@/libs/util.log';
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: 'communityTopic',
|
||||
data() {
|
||||
|
||||
return {
|
||||
moren: require("@/assets/images/f.png"),
|
||||
colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
|
||||
|
||||
listLoading: true,
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
|
||||
|
||||
|
||||
},
|
||||
fileList: [],
|
||||
headers: {},
|
||||
|
||||
dialogVisible1: false,
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
formData: {},
|
||||
rules: {
|
||||
type: [
|
||||
{ required: true, message: '请选择审核状态', trigger: 'change' }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: '请填写标题', trigger: 'blur' }
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: '请填写版本内容', trigger: 'blur' }
|
||||
],
|
||||
phone_brand: [
|
||||
{ required: true, message: '请填写手机平台', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '请填写版本号', trigger: 'blur' }
|
||||
],
|
||||
dow_url: [
|
||||
{ required: true, message: '请填写下载地址', trigger: 'blur' }
|
||||
],
|
||||
is_wgt: [
|
||||
{ required: true, message: '请选择更新类型', trigger: 'blur' }
|
||||
],
|
||||
force: [
|
||||
{ required: true, message: '请选择是否强制更新', trigger: 'blur' }
|
||||
],
|
||||
quiet: [
|
||||
{ required: true, message: '请选择是否静默更新', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
myHeaders: {
|
||||
"X-Token": getToken(),
|
||||
|
||||
},
|
||||
ruleForm: {
|
||||
title: '',
|
||||
type: 1,
|
||||
title: '',
|
||||
phone_brand: '',
|
||||
version: '',
|
||||
dow_url: '',
|
||||
is_wgt: 0,
|
||||
force: 0,
|
||||
quiet: 0
|
||||
},
|
||||
ruleForm1: {
|
||||
|
||||
},
|
||||
id: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
fileUrl() {
|
||||
return (
|
||||
SettingMer.https +
|
||||
`/upload/app`
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 上传成功
|
||||
handleSuccess(response) {
|
||||
if (response.status === 200) {
|
||||
this.$message.success("上传成功");
|
||||
console.log(response)
|
||||
this.ruleForm.dow_url = response.data.src
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
},
|
||||
|
||||
change(e) {
|
||||
this.$forceUpdate(); //强制刷新
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page
|
||||
appLst(this.tableFrom).then(res => {
|
||||
this.tableData.data = res.data.list
|
||||
this.tableData.total = res.data.count
|
||||
this.listLoading = false
|
||||
}).catch(res => {
|
||||
this.listLoading = false
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page
|
||||
this.getList('')
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val
|
||||
this.getList('')
|
||||
},
|
||||
onAdd() {
|
||||
this.isExamine = true
|
||||
this.ruleForm = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
onSet(row) {
|
||||
this.isExamine = false
|
||||
this.dialogVisible = true
|
||||
this.ruleForm = row
|
||||
this.id = row.id
|
||||
},
|
||||
|
||||
onSubmit(item) {
|
||||
|
||||
if (this.isExamine) {
|
||||
|
||||
|
||||
appCreate(this.ruleForm).then((res) => {
|
||||
this.$message.success(res.message)
|
||||
this.dialogVisible = false
|
||||
|
||||
this.formData = res.data
|
||||
this.getList()
|
||||
this.$forceUpdate()
|
||||
}).catch(({ message }) => {
|
||||
this.dialogVisible = false
|
||||
this.$message.error(message)
|
||||
})
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
appEdit(this.id, this.ruleForm).then((res) => {
|
||||
this.$message.success(res.message)
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
this.ruleForm.refusal = ''
|
||||
this.formData = res.data
|
||||
}).catch(({ message }) => {
|
||||
this.dialogVisible = false
|
||||
this.$message.error(message)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//关闭弹窗
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.ruleForm = {
|
||||
title: '',
|
||||
type: 1,
|
||||
title: '',
|
||||
phone_brand: '',
|
||||
version: '',
|
||||
dow_url: ''
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
handleClose1() {
|
||||
this.dialogVisible1 = false
|
||||
this.ruleForm1 = {}
|
||||
|
||||
},
|
||||
//删除
|
||||
onDelete(id) {
|
||||
appDelete(id).then((res) => {
|
||||
this.$message.success(res.message)
|
||||
this.getList()
|
||||
}).catch(({ message }) => {
|
||||
this.$message.error(message)
|
||||
})
|
||||
},
|
||||
// 详情
|
||||
onDetail(id) {
|
||||
this.dialogVisible1 = true;
|
||||
|
||||
appDetail(id).then((res) => {
|
||||
|
||||
this.ruleForm1 = res.data
|
||||
}).catch(({ message }) => {
|
||||
this.$message.error(message)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.upload-wrap>div {
|
||||
border: 1px dashed #D9D9D9;
|
||||
border-radius: 6px;
|
||||
width: 240px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.box-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.box-container .list {
|
||||
float: left;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.box-container .sp {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.box-container .sp3 {
|
||||
width: 33.3333%;
|
||||
}
|
||||
|
||||
.box-container .sp100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box-container .list .name {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.box-container .list.image {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.box-container .list.image img {
|
||||
position: relative;
|
||||
top: 40px;
|
||||
}
|
||||
|
||||
/deep/.el-form-item__content .el-rate {
|
||||
position: relative;
|
||||
top: 8px;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user