|
@@ -24,12 +24,29 @@
|
|
|
:on-error="handleError"
|
|
|
:on-success="handleSuccess"
|
|
|
>
|
|
|
- <el-button type="primary" style="margin-bottom: 20px"> 导入兑换码 </el-button>
|
|
|
+ <el-button type="primary" style="margin-bottom: 20px">
|
|
|
+ 导入兑换码
|
|
|
+ </el-button>
|
|
|
</el-upload>
|
|
|
|
|
|
- <save-form :inline="true" @submit="search" :model="searchForm">
|
|
|
+ <save-form
|
|
|
+ :inline="true"
|
|
|
+ @submit="search"
|
|
|
+ @reset="onReSet"
|
|
|
+ :model="searchForm"
|
|
|
+ >
|
|
|
+ <el-form-item label="关键字">
|
|
|
+ <el-input
|
|
|
+ size="default"
|
|
|
+ placeholder="编号/版本号/描述"
|
|
|
+ clearable
|
|
|
+ v-model="searchForm.keyword"
|
|
|
+ style="max-width: 180px"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="客户端">
|
|
|
- <el-select clearable v-model="searchForm.search">
|
|
|
+ <el-select clearable v-model="searchForm.platform">
|
|
|
<el-option
|
|
|
v-for="(item, index) in sectionList"
|
|
|
:key="index"
|
|
@@ -38,8 +55,21 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.status"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="状态"
|
|
|
+ >
|
|
|
+ <el-option label="最新" value="newest"></el-option>
|
|
|
+ <el-option label="历史" value="history"></el-option>
|
|
|
+ <el-option label="审核中" value="auditing"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="danger" native-type="submit">搜索</el-button>
|
|
|
+ <el-button type="primary" native-type="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</save-form>
|
|
|
|
|
@@ -48,13 +78,21 @@
|
|
|
:data="tableList"
|
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
>
|
|
|
- <el-table-column align="center" prop="id" label="编号"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="id"
|
|
|
+ label="编号"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column align="center" prop="platform" label="客户端">
|
|
|
<template slot-scope="scope">
|
|
|
<div>{{ scope.row.platform | editionFilter }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="version" label="版本号"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="version"
|
|
|
+ label="版本号"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column align="center" prop="isForceUpdate" label="强制更新">
|
|
|
<template slot-scope="scope">
|
|
|
<div>{{ scope.row.isForceUpdate ? "是" : "否" }}</div>
|
|
@@ -70,9 +108,17 @@
|
|
|
<overflow-text :text="scope.row.description"></overflow-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="downloadUrl" width="120" label="下载链接">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="downloadUrl"
|
|
|
+ width="120"
|
|
|
+ label="下载链接"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <overflow-text width="120px" :text="scope.row.downloadUrl"></overflow-text>
|
|
|
+ <overflow-text
|
|
|
+ width="120px"
|
|
|
+ :text="scope.row.downloadUrl"
|
|
|
+ ></overflow-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作">
|
|
@@ -101,7 +147,7 @@
|
|
|
<!-- v-if="sectionVisible" -->
|
|
|
<el-dialog
|
|
|
:title="isNew ? '版本添加' : '版本修改'"
|
|
|
- width="400px"
|
|
|
+ width="550px"
|
|
|
:visible.sync="sectionVisible"
|
|
|
v-if="sectionVisible"
|
|
|
>
|
|
@@ -113,11 +159,12 @@
|
|
|
label-width="80px"
|
|
|
v-if="sectionVisible"
|
|
|
>
|
|
|
- <el-form-item label="客户端" prop="platform" v-if="isNew">
|
|
|
+ <el-form-item label="客户端" prop="platform">
|
|
|
<el-select
|
|
|
v-model="sectionForm.platform"
|
|
|
style="width: 100% !important"
|
|
|
clearable
|
|
|
+ :disabled="!isNew"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in sectionList"
|
|
@@ -127,8 +174,9 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="版本号" prop="version" v-if="isNew">
|
|
|
+ <el-form-item label="版本号" prop="version">
|
|
|
<el-input
|
|
|
+ :disabled="!isNew"
|
|
|
v-model.trim="sectionForm.version"
|
|
|
@mousewheel.native.prevent
|
|
|
></el-input>
|
|
@@ -153,17 +201,57 @@
|
|
|
<el-option label="历史" value="history"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="下载链接" prop="downloadUrl">
|
|
|
- <el-input v-model.trim="sectionForm.downloadUrl" type="textarea"></el-input>
|
|
|
+ <el-form-item
|
|
|
+ label="上传文件"
|
|
|
+ prop="downloadUrl"
|
|
|
+ :rules="[{ required: false }]"
|
|
|
+ v-if="
|
|
|
+ [
|
|
|
+ 'android-teacher',
|
|
|
+ 'android-student',
|
|
|
+ 'android-education'
|
|
|
+ ].includes(sectionForm.platform)
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- 'ios-electron',
|
|
|
+ 'win-electron' -->
|
|
|
+ <singe-file-upload
|
|
|
+ tips="仅支持上传 APK, DMG, EXE"
|
|
|
+ accept=".apk,.dmg,.exe"
|
|
|
+ v-model="sectionForm.downloadUrl"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="下载链接"
|
|
|
+ prop="downloadUrl"
|
|
|
+ v-if="
|
|
|
+ [
|
|
|
+ 'android-teacher',
|
|
|
+ 'android-student',
|
|
|
+ 'android-education'
|
|
|
+ ].includes(sectionForm.platform)
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model.trim="sectionForm.downloadUrl"
|
|
|
+ type="textarea"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述" prop="description">
|
|
|
- <el-input type="textarea" v-model="sectionForm.description"></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="sectionForm.description"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="sectionVisible = false">取 消</el-button>
|
|
|
- <el-button v-if="isNew" type="primary" @click="createEdition">确 定</el-button>
|
|
|
- <el-button v-if="!isNew" type="primary" @click="resetEdition">确 定</el-button>
|
|
|
+ <el-button v-if="isNew" type="primary" @click="createEdition"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ <el-button v-if="!isNew" type="primary" @click="resetEdition"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -172,15 +260,17 @@
|
|
|
import {
|
|
|
appVersionInfo,
|
|
|
addAppVersionInfo,
|
|
|
- resetAppVersionInfo,
|
|
|
+ resetAppVersionInfo
|
|
|
} from "@/api/systemManage";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import { getToken, getTenantId } from "@/utils/auth";
|
|
|
import { decode } from "js-base64";
|
|
|
import load from "@/utils/loading";
|
|
|
+import Upload from "@/components/Upload/index";
|
|
|
export default {
|
|
|
components: {
|
|
|
pagination,
|
|
|
+ Upload
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -191,10 +281,12 @@ export default {
|
|
|
limit: 10, // 限制显示条数
|
|
|
page: 1, // 当前页
|
|
|
total: 0, // 总条数
|
|
|
- page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
},
|
|
|
searchForm: {
|
|
|
- search: null,
|
|
|
+ keyword: null,
|
|
|
+ platform: null,
|
|
|
+ status: null
|
|
|
},
|
|
|
sectionList: [
|
|
|
{ value: "ios-teacher", label: "苹果-老师端" },
|
|
@@ -204,7 +296,7 @@ export default {
|
|
|
{ value: "android-student", label: "安卓-学生端" },
|
|
|
{ value: "android-education", label: "安卓-管理端" },
|
|
|
{ value: "ios-electron", label: "苹果-桌面端" },
|
|
|
- { value: "win-electron", label: "win-桌面端" },
|
|
|
+ { value: "win-electron", label: "win-桌面端" }
|
|
|
],
|
|
|
sectionForm: {
|
|
|
platform: "",
|
|
@@ -212,19 +304,28 @@ export default {
|
|
|
isForceUpdate: "",
|
|
|
downloadUrl: "",
|
|
|
status: "",
|
|
|
- id: "",
|
|
|
+ id: ""
|
|
|
},
|
|
|
sectionRules: {
|
|
|
- platform: [{ required: true, message: "请选择客户端", trigger: "blur" }],
|
|
|
+ platform: [
|
|
|
+ { required: true, message: "请选择客户端", trigger: "blur" }
|
|
|
+ ],
|
|
|
version: [{ required: true, message: "请输入版本号", trigger: "blur" }],
|
|
|
- isForceUpdate: [{ required: true, message: "请选择是否强更", trigger: "blur" }],
|
|
|
- status: [{ required: true, message: "请选择版本状态", trigger: "blur" }],
|
|
|
+ isForceUpdate: [
|
|
|
+ { required: true, message: "请选择是否强更", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ status: [
|
|
|
+ { required: true, message: "请选择版本状态", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ downloadUrl: [
|
|
|
+ { required: true, message: "请输入下载链接", trigger: "blur" }
|
|
|
+ ]
|
|
|
},
|
|
|
isNew: false,
|
|
|
headers: {
|
|
|
Authorization: getToken(),
|
|
|
- tenantId: getTenantId(),
|
|
|
- },
|
|
|
+ tenantId: getTenantId()
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
@@ -238,20 +339,31 @@ export default {
|
|
|
this.rules.page = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ onReSet() {
|
|
|
+ // 重置搜索
|
|
|
+ this.searchForm = {
|
|
|
+ platform: "",
|
|
|
+ version: "",
|
|
|
+ isForceUpdate: "",
|
|
|
+ downloadUrl: "",
|
|
|
+ status: "",
|
|
|
+ id: ""
|
|
|
+ };
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
init() {
|
|
|
this.getList();
|
|
|
},
|
|
|
getList() {
|
|
|
- this.searchForm.search ? this.searchForm.search : (this.searchForm.search = null);
|
|
|
appVersionInfo({
|
|
|
- search: this.searchForm.search,
|
|
|
+ ...this.searchForm,
|
|
|
page: this.rules.page,
|
|
|
- rows: this.rules.limit,
|
|
|
- }).then((res) => {
|
|
|
+ rows: this.rules.limit
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.tableList = res.data.rows.map((item) => ({
|
|
|
+ this.tableList = res.data.rows.map(item => ({
|
|
|
...item,
|
|
|
- downloadUrl: decode(item.downloadUrl || ""),
|
|
|
+ downloadUrl: decode(item.downloadUrl || "")
|
|
|
}));
|
|
|
this.rules.total = res.data.total;
|
|
|
}
|
|
@@ -271,7 +383,7 @@ export default {
|
|
|
this.$alert(str, "导入结果", {
|
|
|
confirmButtonText: "确定",
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- callback: (action) => {},
|
|
|
+ callback: action => {}
|
|
|
});
|
|
|
} else {
|
|
|
this.$message.error(response.msg);
|
|
@@ -285,9 +397,9 @@ export default {
|
|
|
this.sectionVisible = true;
|
|
|
},
|
|
|
createEdition() {
|
|
|
- this.$refs.sectionForm.validate((v) => {
|
|
|
+ this.$refs.sectionForm.validate(v => {
|
|
|
if (v) {
|
|
|
- addAppVersionInfo(this.sectionForm).then((res) => {
|
|
|
+ addAppVersionInfo(this.sectionForm).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("新增成功");
|
|
|
this.sectionVisible = false;
|
|
@@ -307,14 +419,14 @@ export default {
|
|
|
},
|
|
|
resetEdition() {
|
|
|
// 修改
|
|
|
- resetAppVersionInfo(this.sectionForm).then((res) => {
|
|
|
+ resetAppVersionInfo(this.sectionForm).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("修改成功");
|
|
|
this.sectionVisible = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
filters: {
|
|
|
statusFilter(val) {
|
|
@@ -325,7 +437,7 @@ export default {
|
|
|
return "历史";
|
|
|
}
|
|
|
return "";
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
sectionVisible(val) {
|
|
@@ -336,12 +448,12 @@ export default {
|
|
|
isForceUpdate: "",
|
|
|
downloadUrl: "",
|
|
|
status: "",
|
|
|
- id: "",
|
|
|
+ id: ""
|
|
|
};
|
|
|
this.$refs["sectionForm"].resetFields();
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="sass"></style>
|