123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <template>
- <div class="version-manage">
- <div class="part-box part-box-pad">
- <el-button type="primary" @click="addVersion">新增版本</el-button>
- </div>
- <div class="part-box part-box-pad">
- <el-table :data="dataList">
- <el-table-column type="index" label="序号"></el-table-column>
- <el-table-column
- prop="clientVersion"
- label="客户端版本"
- ></el-table-column>
- <el-table-column
- prop="softVersion"
- label="服务端版本"
- ></el-table-column>
- <el-table-column
- class-name="action-column"
- label="操作"
- fixed="right"
- width="100"
- >
- <template slot-scope="scope">
- <el-button
- class="btn-primary"
- type="text"
- @click="toEdit(scope.row)"
- >管理</el-button
- >
- <el-button
- class="btn-danger"
- type="text"
- @click="toDelete(scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- background
- layout="total, sizes, prev, pager, next, jumper"
- :pager-count="5"
- :current-page="current"
- :total="total"
- :page-size="size"
- @current-change="toPage"
- @size-change="pageSizeChange"
- >
- </el-pagination>
- </div>
- </div>
- <modify-version ref="modifyVersion"></modify-version>
- </div>
- </template>
- <script>
- import ModifyVersion from "../components/ModifyVersion.vue";
- import { versionList, versionDelete } from "@/modules/admin/api";
- export default {
- name: "version-manage",
- components: {
- ModifyVersion,
- },
- data() {
- return {
- dataList: [],
- current: 1,
- size: this.GLOBAL.pageSize,
- total: 0,
- curRow: {},
- };
- },
- mounted() {
- this.getList();
- },
- methods: {
- async getList() {
- const datas = {
- pageNumber: this.current,
- pageSize: this.size,
- };
- const data = await versionList(datas);
- this.dataList = data.records;
- this.total = data.total;
- },
- toPage(page) {
- this.current = page;
- this.getList();
- },
- addVersion() {
- this.curRow = {};
- this.$refs.modifyVersion.open();
- },
- toEdit(row) {
- this.curRow = row;
- this.$refs.modifyVersion.open();
- },
- toDelete(row) {
- this.$confirm("确定删除该版本吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- await versionDelete(row.id);
- this.$message.success("删除成功");
- this.getList();
- })
- .catch(() => {});
- },
- },
- };
- </script>
|