leisure-core 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,21 +2,52 @@
2
2
  <div>
3
3
  <el-form :inline="true" :model="searchData">
4
4
  <el-form-item label="领用时间">
5
- <el-date-picker v-model="timeArr" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至"
6
- start-placeholder="开始日期" end-placeholder="结束日期">
5
+ <el-date-picker
6
+ v-model="timeArr"
7
+ type="datetimerange"
8
+ value-format="yyyy-MM-dd HH:mm:ss"
9
+ range-separator="至"
10
+ start-placeholder="开始日期"
11
+ end-placeholder="结束日期"
12
+ >
7
13
  </el-date-picker>
8
14
  </el-form-item>
9
15
  <el-form-item label="优惠券状态">
10
16
  <el-select v-model="status" placeholder="选择状态" clearable>
11
- <el-option v-for="item in statusOptions" :label="item.value" :value="item.id" :key="item.id"></el-option>
17
+ <el-option
18
+ v-for="item in statusOptions"
19
+ :label="item.value"
20
+ :value="item.id"
21
+ :key="item.id"
22
+ ></el-option>
12
23
  </el-select>
13
24
  </el-form-item>
14
- <el-form-item><el-button type="primary" @click="list">查询</el-button></el-form-item>
25
+ <el-form-item
26
+ ><el-button type="primary" @click="list">查询</el-button></el-form-item
27
+ >
15
28
  </el-form>
16
- <el-table :data="tableData" border row-key="id" :max-height="tableHeight"
17
- :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" stripe
18
- style="width: 100%">
19
- <el-table-column prop="id" label="优惠券id"></el-table-column>
29
+ <el-table
30
+ :data="tableData"
31
+ border
32
+ row-key="id"
33
+ :max-height="tableHeight"
34
+ :header-cell-style="{ 'text-align': 'center' }"
35
+ :cell-style="{ 'text-align': 'center' }"
36
+ stripe
37
+ style="width: 100%"
38
+ >
39
+ <el-table-column
40
+ prop="id"
41
+ label="优惠券id"
42
+ show-overflow-tooltip
43
+ tooltip-effect="dark"
44
+ ></el-table-column>
45
+ <el-table-column
46
+ prop="uid"
47
+ label="用户id"
48
+ show-overflow-tooltip
49
+ tooltip-effect="dark"
50
+ ></el-table-column>
20
51
  <el-table-column prop="oid" label="使用的订单id">
21
52
  <template slot-scope="scope">
22
53
  {{ scope.row.status == 1 ? scope.row.oid : "" }}
@@ -24,9 +55,25 @@
24
55
  </el-table-column>
25
56
  <el-table-column prop="title" label="优惠券标题"></el-table-column>
26
57
  <el-table-column prop="caption" label="优惠券描述"></el-table-column>
27
- <el-table-column prop="cdate" label="领用时间" :formatter="dateFormatter"></el-table-column>
28
- <el-table-column prop="udate" label="使用时间" :formatter="dateFormatter"></el-table-column>
29
- <el-table-column prop="date_end" label="过期时间" :formatter="dateFormatter"></el-table-column>
58
+ <el-table-column
59
+ prop="cdate"
60
+ label="领用时间"
61
+ show-overflow-tooltip
62
+ tooltip-effect="dark"
63
+ :formatter="dateFormatter"
64
+ ></el-table-column>
65
+ <el-table-column
66
+ prop="udate"
67
+ label="使用时间"
68
+ :formatter="dateFormatter"
69
+ ></el-table-column>
70
+ <el-table-column
71
+ prop="date_end"
72
+ label="过期时间"
73
+ show-overflow-tooltip
74
+ tooltip-effect="dark"
75
+ :formatter="dateFormatter"
76
+ ></el-table-column>
30
77
  <el-table-column label="是否已经使用">
31
78
  <template slot-scope="scope">
32
79
  <span v-if="scope.row.status == 0">未使用</span>
@@ -38,78 +85,84 @@
38
85
  <el-table-column prop="note" label="备注"></el-table-column>
39
86
  </el-table>
40
87
  <div style="text-align: center; margin-top: 30px">
41
- <el-pagination background layout="prev, pager, next" :total="searchData.total" :page-size="10"
42
- @current-change="current_change">></el-pagination>
88
+ <el-pagination
89
+ background
90
+ layout="prev, pager, next"
91
+ :total="searchData.total"
92
+ :page-size="10"
93
+ @current-change="current_change"
94
+ >></el-pagination
95
+ >
43
96
  </div>
44
97
  </div>
45
98
  </template>
46
99
  <script>
47
- import moment from "moment";
48
- import { listByUid } from "@/api/coupon";
49
- export default {
50
- name: "le-coupon-details",
51
- data() {
52
- return {
53
- tableHeight: 200,
54
- tableData: [],
55
- searchData: {
56
- uid: "",
57
- pageNo: 1,
58
- total: 1,
59
- date_end: "",
60
- date_start: "",
61
- },
62
- timeArr: "",
63
- status: 0,
64
- statusOptions: [
65
- { id: 0, value: "未使用" },
66
- { id: 1, value: "已经使用" },
67
- { id: 2, value: "已经过期" },
68
- { id: 3, value: "已经作废" },
69
- ],
70
- };
100
+ import moment from "moment";
101
+ import { listByUid } from "@/api/coupon";
102
+ export default {
103
+ name: "le-coupon-details",
104
+ data() {
105
+ return {
106
+ tableHeight: 200,
107
+ tableData: [],
108
+ searchData: {
109
+ uid: "",
110
+ pageNo: 1,
111
+ total: 1,
112
+ date_end: "",
113
+ date_start: "",
114
+ },
115
+ timeArr: "",
116
+ status: 0,
117
+ statusOptions: [
118
+ { id: 0, value: "未使用" },
119
+ { id: 1, value: "已经使用" },
120
+ { id: 2, value: "已经过期" },
121
+ { id: 3, value: "已经作废" },
122
+ ],
123
+ };
124
+ },
125
+ mounted() {
126
+ this.list();
127
+ this.$nextTick(() => {
128
+ this.tableHeight = window.innerHeight - 255;
129
+ });
130
+ },
131
+ methods: {
132
+ dateFormatter(row, column, cellValue, index) {
133
+ if (cellValue) return moment.unix(cellValue).format("YYYY-MM-DD HH:mm");
71
134
  },
72
- mounted() {
135
+ current_change(currentPage) {
136
+ this.searchData.pageNo = currentPage;
73
137
  this.list();
74
- this.$nextTick(() => {
75
- this.tableHeight = window.innerHeight - 255;
76
- });
77
138
  },
78
- methods: {
79
- dateFormatter(row, column, cellValue, index) {
80
- if (cellValue) return moment.unix(cellValue).format("YYYY-MM-DD HH:mm");
81
- },
82
- current_change(currentPage) {
83
- this.searchData.pageNo = currentPage;
84
- this.list();
85
- },
86
- filterParams(obj) {
87
- var _newPar = {};
88
- for (var key in obj) {
89
- if (
90
- (obj[key] === false || obj[key]) &&
91
- obj[key].toString().replace(/(^\s*)|(\s*$)/g, "") !== ""
92
- ) {
93
- _newPar[key] = obj[key];
94
- }
139
+ filterParams(obj) {
140
+ var _newPar = {};
141
+ for (var key in obj) {
142
+ if (
143
+ (obj[key] === false || obj[key]) &&
144
+ obj[key].toString().replace(/(^\s*)|(\s*$)/g, "") !== ""
145
+ ) {
146
+ _newPar[key] = obj[key];
95
147
  }
96
- return _newPar;
97
- },
98
- list() {
99
- if (this.timeArr && this.timeArr.length == 2) {
100
- this.searchData.date_start = new Date(this.timeArr[0]).getTime() / 1000;
101
- this.searchData.date_end = new Date(this.timeArr[1]).getTime() / 1000;
102
- } else {
103
- this.searchData.date_start = 0;
104
- this.searchData.date_end = 0;
105
- }
106
- let params = this.filterParams(this.searchData);
107
- params.status = this.status;
108
- listByUid(params).then((res) => {
109
- this.tableData = res.data.data.list;
110
- this.searchData.total = res.data.data.count;
111
- });
112
- },
148
+ }
149
+ return _newPar;
150
+ },
151
+ list() {
152
+ if (this.timeArr && this.timeArr.length == 2) {
153
+ this.searchData.date_start = new Date(this.timeArr[0]).getTime() / 1000;
154
+ this.searchData.date_end = new Date(this.timeArr[1]).getTime() / 1000;
155
+ } else {
156
+ this.searchData.date_start = 0;
157
+ this.searchData.date_end = 0;
158
+ }
159
+ let params = this.filterParams(this.searchData);
160
+ params.status = this.status;
161
+ listByUid(params).then((res) => {
162
+ this.tableData = res.data.data.list;
163
+ this.searchData.total = res.data.data.count;
164
+ });
113
165
  },
114
- };
115
- </script>
166
+ },
167
+ };
168
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",