|
@@ -1,7 +1,7 @@
|
|
|
<style lang="scss" scoped>
|
|
|
-.blue {
|
|
|
- background: red !important;
|
|
|
-}
|
|
|
+ .blue {
|
|
|
+ background: red !important;
|
|
|
+ }
|
|
|
</style>
|
|
|
<template>
|
|
|
<section class="content">
|
|
@@ -11,89 +11,47 @@
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label-width="10" style="margin-left: 10px">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- >新增版本</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增版本</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="list"
|
|
|
- style="width: 100%; margin-top: 10px"
|
|
|
- height="50vh"
|
|
|
- >
|
|
|
+ <el-table v-loading="loading" :data="list" style="width: 100%; margin-top: 10px" height="50vh">
|
|
|
<el-table-column align="center" prop="version" label="版本号" />
|
|
|
<el-table-column align="center" prop="android_version" label="android版本" />
|
|
|
<el-table-column align="center" prop="android_url" label="andorid安装包地址" />
|
|
|
<el-table-column align="center" prop="ios_url" label="ios安装包地址" />
|
|
|
<el-table-column align="center" prop="force" label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.force==0">待发布</span>
|
|
|
- <span>已发布</span>
|
|
|
+ <span v-if="scope.row.force==0">待发布</span>
|
|
|
+ <span>已发布</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="ctime" label="创建时间" />
|
|
|
<el-table-column align="center" prop="date" label="操作" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="edit(scope.row)" size="mini" type="warning"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button @click="del(scope.row.id)" size="mini" type="danger"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button @click="edit(scope.row)" size="mini" type="warning">编辑</el-button>
|
|
|
+ <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <Page
|
|
|
- ref="pageButton"
|
|
|
- :current="form.page"
|
|
|
- :page_size="form.page_size"
|
|
|
- :total="total"
|
|
|
- @pageChange="gopage"
|
|
|
- />
|
|
|
+ <Page ref="pageButton" :current="form.page" :page_size="form.page_size" :total="total" @pageChange="gopage" />
|
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
<el-form-item label="版本号" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入版本号"
|
|
|
- ></el-input>
|
|
|
+ <el-input clearable v-model="form.name" placeholder="请输入版本号"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="android版本号" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入android版本号"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="android版本号" prop="android_version">
|
|
|
+ <el-input clearable v-model="form.android_version" placeholder="请输入android版本号"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="ios版本号" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入ios版本号"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="ios版本号" prop="version">
|
|
|
+ <el-input clearable v-model="form.version" placeholder="请输入ios版本号"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="android安装包地址" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入android安装包地址"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="android安装包地址" prop="android_url">
|
|
|
+ <el-input clearable v-model="form.android_url" placeholder="请输入android安装包地址"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="ios安装包地址" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入ios安装包地址"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="ios安装包地址" prop="ios_url">
|
|
|
+ <el-input clearable v-model="form.ios_url" placeholder="请输入ios安装包地址"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -104,166 +62,176 @@
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import Page from "../../components/Page";
|
|
|
-import { FullCalendar } from "vue-fullcalendar";
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- Page,
|
|
|
- "full-calendar": require("vue-fullcalendar"),
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- monthData: [],
|
|
|
- dateRange: ["2021-12-01", "2022-01-02"],
|
|
|
- loading: false,
|
|
|
- queryParams: {
|
|
|
- page: 1,
|
|
|
- },
|
|
|
- form: {monthData:[]},
|
|
|
- list: [{}, {}],
|
|
|
- total: 0,
|
|
|
- title: "新增版本",
|
|
|
- open: false,
|
|
|
- matchList: [],
|
|
|
- groupList: [],
|
|
|
- userList: [],
|
|
|
- matchStatus:[{
|
|
|
- label:"待发布",
|
|
|
- value:1,
|
|
|
- },{
|
|
|
- label:"开始报名",
|
|
|
- value:2,
|
|
|
- },{
|
|
|
- label:"比赛中",
|
|
|
- value:3,
|
|
|
- },{
|
|
|
- label:"已结束",
|
|
|
- value:4,
|
|
|
- }]
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- del(id) {
|
|
|
- this.$confirm("确定删除吗?", "提示", {
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.$api.delMatch({ id: id }).then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getData();
|
|
|
- });
|
|
|
- });
|
|
|
+ import Page from "../../components/Page";
|
|
|
+ import {
|
|
|
+ FullCalendar
|
|
|
+ } from "vue-fullcalendar";
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ Page,
|
|
|
+ "full-calendar": require("vue-fullcalendar"),
|
|
|
},
|
|
|
- edit(row) {
|
|
|
- this.open = true;
|
|
|
- this.form = row;
|
|
|
- this.monthData = JSON.parse(row.calendar);
|
|
|
- },
|
|
|
- gopage(size) {
|
|
|
- if (size) {
|
|
|
- this.queryParams.page_size = size;
|
|
|
- }
|
|
|
- this.queryParams.page = this.$refs.pageButton.page;
|
|
|
- this.getData();
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ monthData: [],
|
|
|
+ dateRange: ["2021-12-01", "2022-01-02"],
|
|
|
+ loading: false,
|
|
|
+ queryParams: {
|
|
|
+ page: 1,
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ monthData: []
|
|
|
+ },
|
|
|
+ list: [{}, {}],
|
|
|
+ total: 0,
|
|
|
+ title: "新增版本",
|
|
|
+ open: false,
|
|
|
+ matchList: [],
|
|
|
+ groupList: [],
|
|
|
+ userList: [],
|
|
|
+ matchStatus: [{
|
|
|
+ label: "待发布",
|
|
|
+ value: 1,
|
|
|
+ }, {
|
|
|
+ label: "开始报名",
|
|
|
+ value: 2,
|
|
|
+ }, {
|
|
|
+ label: "比赛中",
|
|
|
+ value: 3,
|
|
|
+ }, {
|
|
|
+ label: "已结束",
|
|
|
+ value: 4,
|
|
|
+ }]
|
|
|
+ };
|
|
|
},
|
|
|
- getData() {
|
|
|
- this.loading = true;
|
|
|
- //
|
|
|
- this.$api.getVersionList(this.queryParams).then((res) => {
|
|
|
- this.list = res.data.data.list;
|
|
|
- this.total = res.data.data.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- handleAdd() {
|
|
|
- this.open = true;
|
|
|
- this.title = "新增赛事";
|
|
|
- this.form = {};
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (this.monthData.length == 0) {
|
|
|
- this.$message.error("请设置报单日历!");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.form.calendar = JSON.stringify(this.monthData);
|
|
|
- let valid_dates = [];
|
|
|
- this.monthData.forEach((item) => {
|
|
|
- valid_dates.push(item.start);
|
|
|
- });
|
|
|
- this.form.valid_dates = valid_dates;
|
|
|
- this.valid_dates = JSON.stringify(valid_dates);
|
|
|
- if (this.form.id != null) {
|
|
|
- this.$api.updateMatch(this.form).then((response) => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getData();
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$api.addMatch(this.form).then((response) => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getData();
|
|
|
+ methods: {
|
|
|
+ del(id) {
|
|
|
+ this.$confirm("确定删除吗?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.$api.delMatch({
|
|
|
+ id: id
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success",
|
|
|
});
|
|
|
+ this.getData();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ edit(row) {
|
|
|
+ this.open = true;
|
|
|
+ this.$api.getVersionInfo({
|
|
|
+ id: row.id
|
|
|
+ }).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gopage(size) {
|
|
|
+ if (size) {
|
|
|
+ this.queryParams.page_size = size;
|
|
|
+ }
|
|
|
+ this.queryParams.page = this.$refs.pageButton.page;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ this.loading = true;
|
|
|
+ //
|
|
|
+ this.$api.getVersionList(this.queryParams).then((res) => {
|
|
|
+ this.list = res.data.data.list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.open = true;
|
|
|
+ this.title = "新增赛事";
|
|
|
+ this.form = {};
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ this.$api.editVersion(this.form).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.msgSuccess("成功!");
|
|
|
+ this.open = false;
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.msgError(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.addVersion(this.form).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.msgSuccess("成功!");
|
|
|
+ this.open = false;
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.msgError(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formatDate(date) {
|
|
|
+ var y = date.getFullYear();
|
|
|
+ var m = date.getMonth() + 1;
|
|
|
+ m = m < 10 ? "0" + m : m;
|
|
|
+ var d = date.getDate();
|
|
|
+ d = d < 10 ? "0" + d : d;
|
|
|
+ return y + "-" + m + "-" + d;
|
|
|
+ },
|
|
|
+ // 选择月份
|
|
|
+ changeMonth(start, end, current) {
|
|
|
+ console.log("changeMonth", start, end, current);
|
|
|
+ },
|
|
|
+ // 点击事件
|
|
|
+ eventClick(event, jsEvent, pos) {
|
|
|
+ console.log("eventClick", event, jsEvent, pos);
|
|
|
+ },
|
|
|
+ // 点击当天
|
|
|
+ dayClick(day, jsEvent) {
|
|
|
+ let curDate = this.formatDate(new Date(day));
|
|
|
+ let selDate = {
|
|
|
+ title: "报单",
|
|
|
+ start: curDate,
|
|
|
+ end: curDate
|
|
|
+ };
|
|
|
+ if (this.monthData.filter((item) => item.start == curDate).length == 0) {
|
|
|
+ this.monthData.push(selDate);
|
|
|
+ } else {
|
|
|
+ this.removeAaary(this.monthData, selDate)
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- formatDate(date) {
|
|
|
- var y = date.getFullYear();
|
|
|
- var m = date.getMonth() + 1;
|
|
|
- m = m < 10 ? "0" + m : m;
|
|
|
- var d = date.getDate();
|
|
|
- d = d < 10 ? "0" + d : d;
|
|
|
- return y + "-" + m + "-" + d;
|
|
|
- },
|
|
|
- // 选择月份
|
|
|
- changeMonth(start, end, current) {
|
|
|
- console.log("changeMonth", start, end, current);
|
|
|
- },
|
|
|
- // 点击事件
|
|
|
- eventClick(event, jsEvent, pos) {
|
|
|
- console.log("eventClick", event, jsEvent, pos);
|
|
|
- },
|
|
|
- // 点击当天
|
|
|
- dayClick(day, jsEvent) {
|
|
|
- let curDate = this.formatDate(new Date(day));
|
|
|
- let selDate = { title: "报单", start: curDate, end: curDate };
|
|
|
- if (this.monthData.filter((item) => item.start == curDate).length == 0) {
|
|
|
- this.monthData.push(selDate);
|
|
|
- } else {
|
|
|
- this.removeAaary(this.monthData,selDate)
|
|
|
- }
|
|
|
- },
|
|
|
- // 查看更多
|
|
|
- moreClick(day, events, jsEvent) {
|
|
|
- console.log("moreCLick", day, events, jsEvent);
|
|
|
- },
|
|
|
- removeAaary(_arr, _obj) {
|
|
|
- var length = _arr.length;
|
|
|
- for (var i = 0; i < length; i++) {
|
|
|
-
|
|
|
- if (_arr[i].start === _obj.start) {
|
|
|
- if (i == 0) {
|
|
|
- _arr.shift(); //删除并返回数组的第一个元素
|
|
|
- return _arr;
|
|
|
- } else if (i == length - 1) {
|
|
|
- _arr.pop(); //删除并返回数组的最后一个元素
|
|
|
- return _arr;
|
|
|
- } else {
|
|
|
- _arr.splice(i, 1); //删除下标为i的元素
|
|
|
- return _arr;
|
|
|
+ },
|
|
|
+ // 查看更多
|
|
|
+ moreClick(day, events, jsEvent) {
|
|
|
+ console.log("moreCLick", day, events, jsEvent);
|
|
|
+ },
|
|
|
+ removeAaary(_arr, _obj) {
|
|
|
+ var length = _arr.length;
|
|
|
+ for (var i = 0; i < length; i++) {
|
|
|
+
|
|
|
+ if (_arr[i].start === _obj.start) {
|
|
|
+ if (i == 0) {
|
|
|
+ _arr.shift(); //删除并返回数组的第一个元素
|
|
|
+ return _arr;
|
|
|
+ } else if (i == length - 1) {
|
|
|
+ _arr.pop(); //删除并返回数组的最后一个元素
|
|
|
+ return _arr;
|
|
|
+ } else {
|
|
|
+ _arr.splice(i, 1); //删除下标为i的元素
|
|
|
+ return _arr;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
},
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getData();
|
|
|
- },
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|