1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<template>
<div class="edition-wrapper height100">
<div class="search-container">
<el-form :inline="true" :model="form">
<el-form-item>
<el-date-picker
v-model="form.dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item>
<div class="btn-group">
<el-button type="primary" @click="onSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</div>
</el-form-item>
</el-form>
<div class="page-tip">
<span class="page-tip-title">页面说明:</span>
<span class="page-tips"
>可查看系统使用过的所有app版本信息,可设置其中一个版本为当前使用版本。可产看安装包详情信息。可上传新的安装包,“*”为必填项。</span
>
</div>
</div>
<div class="table-content">
<div class="btn-group">
<el-button type="primary" @click="addBox">上传安装包</el-button>
</div>
<div class="party-table">
<el-table
border
style="width: 100%; height: 100%"
height="100%"
:data="tableData"
>
<el-table-column type="index" width="120" label="序号" align="center">
<template slot-scope="scope">
<span>{{ (page._index - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
label="app版本号"
prop="appVersion"
align="center"
></el-table-column>
<el-table-column align="center" label="是否为最新版本">
<template slot-scope="scope">
<span>{{ scope.row.isCurrent ? "是" : "否" }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="上传时间"
prop="createTime"
></el-table-column>
<el-table-column
align="center"
label="操作者"
prop="userName"
></el-table-column>
<el-table-column align="center" label="操作" header-align="center">
<template slot-scope="scope" width="220">
<div class="table-btn-group">
<el-tooltip content="详情" placement="top">
<el-button circle @click="handleDetail(scope.row)">
<i class="icon-table icon-detail"></i>
</el-button>
</el-tooltip>
<el-tooltip content="启用" placement="top">
<el-button circle :disabled="!!scope.row.isCurrent" @click="ableBtn(scope.row)">
<i class="icon-table icon-enable"></i>
</el-button>
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
</div>
<party-pagination :page="page" @changePage="handleCurrentChange" />
</div>
<add-dialog ref="addDialog" @refreshFn="onSearch" />
<detail-dialog ref="detailDialog" />
</div>
</template>
<script>
import { partyPagination } from "@/components/index";
import { addDialog, detailDialog } from "./components/index";
export default {
data() {
return {
page: {
_index: 1,
_size: 10,
total: 0,
},
form: {
dateRange: [],
},
tableData: [],
};
},
components: { partyPagination, addDialog, detailDialog },
mounted() {
this.onSearch();
},
methods: {
// 查询
onSearch() {
this.page._index = 1;
this.requestForm = JSON.parse(JSON.stringify(this.form))
this.getTableData();
},
// 获得数据接口
getTableData() {
let vm = this;
let param = {
_index: this.page._index,
_size: this.page._size,
startDate: this.requestForm.dateRange.length ? this.requestForm.dateRange[0] : "",
endDate: this.requestForm.dateRange.length ? this.requestForm.dateRange[1] : "",
};
vm.$https(
{
url: "tAppVersion/getPageList",
method: "post",
authType: this.backToken,
},
vm.$qs.stringify(param)
)
.then((res) => {
if (res.data.resultCode === "200") {
let data = res.data.data;
vm.page.total = data.total;
vm.tableData = data.records;
} else {
this.$message.error(res.data.message);
}
})
.catch(function (err) {
console.log(err);
});
},
// 新增弹框打开
addBox() {
this.$refs.addDialog.backFn();
},
// 详情弹框打开
handleDetail(item) {
this.$refs.detailDialog.backFn(item);
},
// 启用
ableBtn(row) {
const _this = this;
this.$confirm("确定要设置为最新版本?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.updateVersion(row);
})
.catch(() => {
this.$message("已取消");
});
},
// 启用
updateVersion(row) {
let vm = this;
let param = {
id: row.id,
isCurrent: 1,
};
vm.$https(
{
url: "tAppVersion/update",
method: "put",
authType: this.backToken,
},
vm.$qs.stringify(param)
)
.then((res) => {
if (res.data.resultCode === "200") {
this.$message.success("操作成功");
this.onSearch();
} else {
this.$message.error(res.data.message);
}
})
.catch(function (err) {
console.log(err);
});
},
// 重置
handleReset() {
this.form = {
dateRange: [],
};
this.onSearch();
},
// 分页
handleCurrentChange(val) {
this.page._index = val;
this.getTableData();
},
},
};
</script>
<style lang="less">
@import "~@/style/table.less";
@import "~@/style/pagination.less";
</style>