|
@@ -22,34 +22,31 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="os" label="系统类型" align="center" width="100px" />
|
|
|
<el-table-column prop="updateTimeText" label="更新时间" align="center" />
|
|
|
- <el-table-column prop="status" label="当前状态" align="center" :formatter="statusFormatter" width="100px" />
|
|
|
+ <el-table-column prop="status" label="当前状态" align="center" :formatter="statusFormatter"
|
|
|
+ width="100px" />
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="scope.row.status === 0" type="text" @click="getDialog(scope.row, '上架')">上架</el-button>
|
|
|
- <el-button v-else type="text" @click="getDialog(scope.row, '下架')">下架</el-button>
|
|
|
+ <el-button v-if="scope.row.status === 0" type="text" @click="getShelves(scope.row, 1)">上架
|
|
|
+ </el-button>
|
|
|
+ <el-button v-else type="text" @click="getShelves(scope.row, 0)">下架</el-button>
|
|
|
<el-button type="text" @click="getDialog(scope.row, '更新')">更新</el-button>
|
|
|
<el-button type="text" @click="getDialog(scope.row, '编辑')">编辑</el-button>
|
|
|
- <el-button type="text" v-clipboard:copy="scope.row.downUrl">复制下载地址</el-button>
|
|
|
- <!-- <el-dropdown @command="getCommand" style="margin-left: 10px">
|
|
|
+ <el-dropdown @command="getCommand($event, scope.row)" style="margin-left: 10px">
|
|
|
<el-button type="text">更多</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="copy" v-clipboard:copy="scope.row.downUrl">复制下载地址</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="copy" v-clipboard:copy="scope.row.downUrl">复制下载地址
|
|
|
+ </el-dropdown-item>
|
|
|
<el-dropdown-item command="history">查看版本记录</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
- </el-dropdown>-->
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="versionForm.pageNum"
|
|
|
- :limit.sync="versionForm.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="versionForm.pageNum"
|
|
|
+ :limit.sync="versionForm.pageSize" @pagination="getList" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div class="from-btn">
|
|
|
+ <div class="form-btn">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
<el-button type="primary" @click="getSubmit">确定</el-button>
|
|
|
</div>
|
|
@@ -57,29 +54,25 @@
|
|
|
<!-- 新增弹窗 -->
|
|
|
<el-dialog :visible.sync="dialogVisible" :before-close="getCancel" :title="title" width="500px">
|
|
|
<el-form :model="addForm" ref="addForm" label-width="100px">
|
|
|
- <el-form-item v-show="title !== '更新'" label="应用名称:">
|
|
|
+ <el-form-item v-if="title !== '更新'" label="应用名称:">
|
|
|
<el-input v-model="addForm.name" placeholder="请输入应用名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="title === '新增'" label="系统类型:">
|
|
|
+ <el-form-item v-if="title === '新增'" label="系统类型:">
|
|
|
<el-select v-model="addForm.os" placeholder="请选择系统类型">
|
|
|
- <el-option
|
|
|
- v-for="item in dict.type.phone_sys_type"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
+ <el-option v-for="item in dict.type.phone_sys_type" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="title !== '更新'" label="应用Logo:">
|
|
|
+ <el-form-item v-if="title !== '更新'" label="应用Logo:">
|
|
|
<Upload :url="addForm.pic" listType="picture-card" @upload="getUpload($event, 'logo')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="title !== '编辑'" label="版本号:">
|
|
|
+ <el-form-item v-if="title !== '编辑'" label="版本号:">
|
|
|
<el-input v-model="addForm.version" placeholder="请输入版本号" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="title !== '编辑'" label="更新内容:">
|
|
|
+ <el-form-item v-if="title !== '编辑'" label="更新内容:">
|
|
|
<Editor v-model="addForm.updateContent" :height="192" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="title !== '编辑'" label="安装包:">
|
|
|
+ <el-form-item v-if="title !== '编辑'" label="安装包:">
|
|
|
<Upload @upload="getUpload($event, 'file')" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -88,11 +81,36 @@
|
|
|
<el-button type="primary" @click="getChange">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 历史记录 -->
|
|
|
+ <el-dialog :visible.sync="dialogVisible_history" title="历史记录" width="1000px">
|
|
|
+ <el-table :data="historyData">
|
|
|
+ <el-table-column label="序号" type="index" align="center" />
|
|
|
+ <el-table-column label="应用版本" prop="version" align="center" />
|
|
|
+ <el-table-column label="更新内容" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span class="updateContent" v-html="scope.row.updateContent" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="系统类型" prop="os" align="center" />
|
|
|
+ <el-table-column label="更新时间" prop="updateTimeText" align="center" />
|
|
|
+ <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
|
+ <el-table-column lang="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-if="scope.row.status === 0" type="text" @click="getShelves(scope.row, 1)">上架
|
|
|
+ </el-button>
|
|
|
+ <el-button v-else type="text" @click="getShelves(scope.row, 0)">下架</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination v-show="historyTotal>0" :total="historyTotal" :page.sync="historyForm.pageNum"
|
|
|
+ :limit.sync="historyForm.pageSize" @pagination="getHistoryPage" />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { add, edit, update, updateAdd, updatePage } from "@/api/project/list";
|
|
|
+import { add, edit, update, appEdit, updateAdd, updatePage, historyPage, shelves } from "@/api/project/list";
|
|
|
import Upload from "@/components/Upload/index";
|
|
|
import Editor from "@/components/Editor";
|
|
|
export default {
|
|
@@ -105,7 +123,7 @@ export default {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: false,
|
|
|
-
|
|
|
+ projectId: 0,
|
|
|
// 项目表单
|
|
|
projectForm: {},
|
|
|
// 新增表单
|
|
@@ -117,17 +135,26 @@ export default {
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
total: 0,
|
|
|
+ // 历史记录列表
|
|
|
+ historyData: [],
|
|
|
+ historyForm: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
+ historyTotal: 0,
|
|
|
|
|
|
// 新增弹窗
|
|
|
dialogVisible: false,
|
|
|
title: "",
|
|
|
+ // 历史记录弹窗
|
|
|
+ dialogVisible_history: false
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
let row = JSON.parse(this.$route.query.row);
|
|
|
if (row) {
|
|
|
this.projectForm = row;
|
|
|
- this.addForm.projectId = this.versionForm.projectId = row.id;
|
|
|
+ this.projectId = row.id
|
|
|
this.getList();
|
|
|
}
|
|
|
},
|
|
@@ -135,6 +162,7 @@ export default {
|
|
|
// 获取版本管理分页
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
+ this.versionForm.projectId = this.projectId
|
|
|
updatePage(this.versionForm).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
this.versionData = res.data.records;
|
|
@@ -147,21 +175,26 @@ export default {
|
|
|
// 打开弹窗
|
|
|
getDialog(e, key) {
|
|
|
this.title = key ? key : "新增";
|
|
|
- if (e) {
|
|
|
- this.addForm = e;
|
|
|
- }
|
|
|
-
|
|
|
- if (key === "上架") {
|
|
|
- this.loading = true;
|
|
|
- this.addForm.status = 1;
|
|
|
- this.getChange();
|
|
|
- } else if (key === "下架") {
|
|
|
- this.loading = true;
|
|
|
- this.addForm.status = 0;
|
|
|
- this.getChange();
|
|
|
- } else {
|
|
|
- this.dialogVisible = true;
|
|
|
+ if (this.title === '编辑') {
|
|
|
+ this.addForm = {
|
|
|
+ id: e.id,
|
|
|
+ name: e.name,
|
|
|
+ pic: e.pic
|
|
|
+ }
|
|
|
+ } else if (this.title === '更新') {
|
|
|
+ this.addForm = {
|
|
|
+ downUrl: e.downUrl,
|
|
|
+ id: e.id,
|
|
|
+ size: e.size,
|
|
|
+ updateContent: e.updateContent,
|
|
|
+ version: e.version
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.addForm = {
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
}
|
|
|
+ this.dialogVisible = true;
|
|
|
},
|
|
|
|
|
|
// 上传
|
|
@@ -178,40 +211,62 @@ export default {
|
|
|
|
|
|
// 新增 / 更新版本
|
|
|
getChange() {
|
|
|
- if (this.title !== "编辑") {
|
|
|
- updateAdd(this.addForm).then((res) => {
|
|
|
+ if (this.title === '编辑') {
|
|
|
+ appEdit(this.addForm).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
- this.$message.success("新增成功!");
|
|
|
- this.dialogVisible = false;
|
|
|
- this.getList();
|
|
|
+ this.$message.success(`${this.title}成功!`)
|
|
|
+ this.dialogVisible = false,
|
|
|
+ this.getList()
|
|
|
}
|
|
|
- });
|
|
|
- } else {
|
|
|
+ })
|
|
|
+ } else if (this.title === '更新') {
|
|
|
update(this.addForm).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
- this.$message.success(`${this.title}成功!`);
|
|
|
+ this.$message.success(`${this.title}成功!`)
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ updateAdd(this.addForm).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.success("新增成功!");
|
|
|
this.dialogVisible = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- // if (this.title === "新增") {
|
|
|
- // updateAdd(this.addForm).then((res) => {
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.$message.success("新增成功!");
|
|
|
- // this.dialogVisible = false;
|
|
|
- // this.getList();
|
|
|
- // }
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // update(this.addForm).then((res) => {
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.$message.success(`${this.title}成功!`);
|
|
|
- // this.dialogVisible = false;
|
|
|
- // this.getList();
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 上下架
|
|
|
+ getShelves(row, status) {
|
|
|
+ shelves({
|
|
|
+ id: row.id,
|
|
|
+ status: status
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更多
|
|
|
+ getCommand(e, row) {
|
|
|
+ if (e === 'history') {
|
|
|
+ this.dialogVisible_history = true
|
|
|
+ this.historyForm.projectUpdateId = row.id
|
|
|
+ this.getHistoryPage()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 历史记录
|
|
|
+ getHistoryPage() {
|
|
|
+ this.historyForm.projectId = this.projectId
|
|
|
+ historyPage(this.historyForm).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.historyData = res.data.records
|
|
|
+ this.historyTotal = res.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 取消
|