piexlmax
3 years ago
20 changed files with 708 additions and 699 deletions
-
4server/source/system/api.go
-
4server/source/system/casbin.go
-
62web/src/components/customPic/index.vue
-
64web/src/components/upload/image.vue
-
13web/src/components/warningBar/warningBar.vue
-
61web/src/mixins/infoList.js
-
11web/src/utils/format.js
-
50web/src/view/about/index.vue
-
51web/src/view/dashboard/dashboardCharts/echartsLine.vue
-
32web/src/view/dashboard/dashboardTable/dashboardTable.vue
-
34web/src/view/dashboard/index.vue
-
146web/src/view/example/breakpoint/breakpoint.vue
-
111web/src/view/example/customer/customer.vue
-
64web/src/view/example/excel/excel.vue
-
136web/src/view/example/upload/upload.vue
-
5web/src/view/superAdmin/menu/menu.vue
-
4web/src/view/superAdmin/operation/sysOperationRecord.vue
-
50web/src/view/system/state.vue
-
7web/src/view/systemTools/autoCode/component/previewCodeDialg.vue
-
2web/src/view/systemTools/system/system.vue
@ -1,61 +0,0 @@ |
|||
import { getDict } from '@/utils/dictionary' |
|||
import { formatTimeToStr } from '@/utils/date' |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
page: 1, |
|||
total: 10, |
|||
pageSize: 10, |
|||
tableData: [], |
|||
searchInfo: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
formatBoolean: function(bool) { |
|||
if (bool !== null) { |
|||
return bool ? '是' : '否' |
|||
} else { |
|||
return '' |
|||
} |
|||
}, |
|||
formatDate: function(time) { |
|||
if (time !== null && time !== '') { |
|||
var date = new Date(time) |
|||
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss') |
|||
} else { |
|||
return '' |
|||
} |
|||
}, |
|||
filterDict(value, type) { |
|||
const rowLabel = this[type + 'Options'] && this[type + 'Options'].filter(item => item.value === value) |
|||
return rowLabel && rowLabel[0] && rowLabel[0].label |
|||
}, |
|||
async getDict(type) { |
|||
const dicts = await getDict(type) |
|||
this[type + 'Options'] = dicts |
|||
return dicts |
|||
}, |
|||
handleSizeChange(val) { |
|||
this.pageSize = val |
|||
this.getTableData() |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.page = val |
|||
this.getTableData() |
|||
}, |
|||
// @params beforeFunc function 请求发起前执行的函数 默认为空函数
|
|||
// @params afterFunc function 请求完成后执行的函数 默认为空函数
|
|||
async getTableData(beforeFunc = () => {}, afterFunc = () => {}) { |
|||
beforeFunc() |
|||
const table = await this.listApi({ page: this.page, pageSize: this.pageSize, ...this.searchInfo }) |
|||
if (table.code === 0) { |
|||
this.tableData = table.data.list |
|||
this.total = table.data.total |
|||
this.page = table.data.page |
|||
this.pageSize = table.data.pageSize |
|||
} |
|||
afterFunc() |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue