Skip to content

Commit

Permalink
优化列表数据排序
Browse files Browse the repository at this point in the history
  • Loading branch information
liyinchigithub committed Nov 20, 2020
1 parent 01df2ed commit 6e6d32c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 65 deletions.
Binary file added server/prototypeFile/产品原型管理工具.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 6 additions & 36 deletions server/public/Category.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,15 @@
{
"category": [
{
"category_id": "1",
"category_name": "业务线1",
"category_create_time": "2020-06-22-09-00-00",
"category_id": "0001",
"category_name": "分类1",
"category_create_time": "2020-11-20-10-51-41",
"category_is_delete": false
},
{
"category_id": "2",
"category_name": "业务线2",
"category_create_time": "2020-06-22-08-00-00",
"category_is_delete": false
},
{
"category_id": "3",
"category_name": "业务线3",
"category_create_time": "2020-06-22-07-00-00",
"category_is_delete": false
},
{
"category_id": "4",
"category_name": "业务线4",
"category_create_time": "2020-06-23-07-00-00",
"category_is_delete": false
},
{
"category_id": "5",
"category_name": "业务线5",
"category_create_time": "2020-06-24-07-00-00",
"category_is_delete": false
},
{
"category_id": "6",
"category_name": "业务线2",
"category_create_time": "2020-06-24-07-00-00",
"category_is_delete": false
},
{
"category_id": "7",
"category_name": "业务线7",
"category_create_time": "2020-5-28-21-24-31",
"category_id": "0002",
"category_name": "分类2",
"category_create_time": "2020-11-20-10-51-50",
"category_is_delete": false
}
]
Expand Down
27 changes: 8 additions & 19 deletions server/public/User.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"user": [
{
"user_id": "1",
"user_id": "01",
"user_name": "admin",
"password": "123456",
"password": "",
"function_permission": [
1,
2,
Expand All @@ -21,14 +21,15 @@
14,
15
],
"user_create_time": "2020-06-27-14-00-00",
"user_create_time": "2020-11-20-10-53-17",
"user_is_delete": false
},
{
"user_id": "2",
"user_name": "admin2",
"password": "123456",
"user_id": "02",
"user_name": "admin02",
"password": "",
"function_permission": [
1,
2,
3,
4,
Expand All @@ -44,19 +45,7 @@
14,
15
],
"user_create_time": "2020-06-27-15-00-00",
"user_is_delete": false
},
{
"user_id": "3",
"user_name": "liyinchi",
"password": "",
"function_permission": [
1,
2,
3
],
"user_create_time": "2020-5-28-21-25-51",
"user_create_time": "2020-11-20-10-53-32",
"user_is_delete": false
}
]
Expand Down
31 changes: 27 additions & 4 deletions src/components/Pages/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
tableData.slice((currentPage - 1) * PageSize, currentPage * PageSize)
"
style="width: 100%"
:default-sort="{ prop: 'category_name', order: 'descending' }"
:default-sort="{ prop: 'category_create_time', order: 'descending' }"
>

<el-table-column
Expand Down Expand Up @@ -675,10 +675,33 @@ export default {
const property = column["property"];
return row[property] === value;
},
/**
* @description 获取当前时间 格式:年-月-日-时-分-秒
*/
getTime() {
var D = new Date();
return `${D.getFullYear()}-${D.getMonth()}-${D.getDate()}-${D.getHours()}-${D.getMinutes()}-${D.getSeconds()}`;
var date = new Date();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentDate1 =
date.getFullYear() +
"-" +
month +
"-" +
strDate +
"-" +
date.getHours() +
"-" +
date.getMinutes() +
"-" +
date.getSeconds();
var currentDate2 = `${date.getFullYear()}${month}${strDate}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`;
return currentDate1;
},
},
watch: {
Expand Down
37 changes: 34 additions & 3 deletions src/components/Pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
tableData.slice((currentPage - 1) * PageSize, currentPage * PageSize)
"
style="width: 100%"
:default-sort="{ prop: 'prototype_data_id', order: 'descending' }"
:default-sort="{ prop: 'prototype_data_create_time', order: 'descending' }"
>
<el-table-column
type="index"
Expand Down Expand Up @@ -402,6 +402,13 @@
</el-tooltip>
</template>
</el-table-column>
<el-table-column
prop="prototype_data_create_time"
sortable
label="创建时间"
width="250"
align="center"
></el-table-column>
<el-table-column
prop="prototype_data_remark"
sortable
Expand Down Expand Up @@ -869,9 +876,33 @@ export default {
const property = column["property"];
return row[property] === value;
},
/**
* @description 获取当前时间 格式:年-月-日-时-分-秒
*/
getTime() {
var D = new Date();
return `${D.getFullYear()}-${D.getMonth()}-${D.getDate()}-${D.getHours()}-${D.getMinutes()}-${D.getSeconds()}`;
var date = new Date();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentDate1 =
date.getFullYear() +
"-" +
month +
"-" +
strDate +
"-" +
date.getHours() +
"-" +
date.getMinutes() +
"-" +
date.getSeconds();
var currentDate2 = `${date.getFullYear()}${month}${strDate}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`;
return currentDate1;
},
ChildByValueZipFileUpload(value) {
this.prototype_data_form.prototype_data = value[2];
Expand Down
30 changes: 27 additions & 3 deletions src/components/Pages/Username.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
tableData.slice((currentPage - 1) * PageSize, currentPage * PageSize)
"
style="width: 100%"
:default-sort="{ prop: 'user_name', order: 'descending' }"
:default-sort="{ prop: 'user_create_time', order: 'descending' }"
>
<el-table-column
type="index"
Expand Down Expand Up @@ -719,9 +719,33 @@ export default {
const property = column["property"];
return row[property] === value;
},
/**
* @description 获取当前时间 格式:年-月-日-时-分-秒
*/
getTime() {
var D = new Date();
return `${D.getFullYear()}-${D.getMonth()}-${D.getDate()}-${D.getHours()}-${D.getMinutes()}-${D.getSeconds()}`;
var date = new Date();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentDate1 =
date.getFullYear() +
"-" +
month +
"-" +
strDate +
"-" +
date.getHours() +
"-" +
date.getMinutes() +
"-" +
date.getSeconds();
var currentDate2 = `${date.getFullYear()}${month}${strDate}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`;
return currentDate1;
},
formatter(row, column) {
var array = row.function_permission;
Expand Down

0 comments on commit 6e6d32c

Please sign in to comment.