commit
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
const ddmixins = {
|
||||
data(){
|
||||
return{
|
||||
pageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch () {
|
||||
this.pageForm.pageNumber = 1;
|
||||
this.pageData();
|
||||
},
|
||||
pageOrder: function (column) {//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {//页码更新操作
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange: function (val) {//分页大小更新操作
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
const initTableMixins = {
|
||||
data() {
|
||||
return {
|
||||
festival: ['元旦、春节', '劳动节、端午节', '中秋节、国庆节', '其它'],
|
||||
submitLoading: false,
|
||||
searchMore: false,
|
||||
tableSize: '',
|
||||
tableKey: '',
|
||||
formData: {},
|
||||
formRules: {},
|
||||
formLoading: false,
|
||||
tableLoading: false,
|
||||
tableData: [],
|
||||
tableColumns: [],
|
||||
pageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: ""
|
||||
},
|
||||
guavaIndex: 'index',
|
||||
unionGroups: [],
|
||||
threeUnits: []
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
date(value) {
|
||||
return value ? moment(value).format('YYYY-MM-DD') : ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand({action, value}) {
|
||||
if (action) action(value)
|
||||
},
|
||||
|
||||
fileHandleRemove(file, fileList) {
|
||||
return fileList;
|
||||
},
|
||||
fileHandleChange(file, fileList, {type, size}) {
|
||||
const removeFile = () => {
|
||||
fileList.splice(fileList.findIndex(v => v === file))
|
||||
}
|
||||
|
||||
if (!file.size) {
|
||||
this.notifyWarning('您选择的是空文件!')
|
||||
removeFile()
|
||||
}
|
||||
|
||||
if (type && type.length && !type.includes(file.name.split('.').pop().toLowerCase())) {
|
||||
this.notifyWarning(`文件只能是 ${type.map(v => v.toUpperCase()).join('/')} 格式!`)
|
||||
removeFile()
|
||||
}
|
||||
|
||||
if (size && !file.size < size) {
|
||||
this.notifyWarning(`文件大小不能超过 ${size / 1024 / 1024}MB!`)
|
||||
removeFile()
|
||||
}
|
||||
|
||||
return fileList;
|
||||
},
|
||||
|
||||
columnChange(val) {
|
||||
this.tableLoading = true
|
||||
this.tableColumns = val
|
||||
this.tableLoading = false
|
||||
},
|
||||
tableSizeChange(size) {
|
||||
this.tableSize = size
|
||||
},
|
||||
indexMethod(index) {
|
||||
return index + (this.pageForm.pageNumber - 1) * this.pageForm.pageSize + 1
|
||||
},
|
||||
doSearch() {
|
||||
this.tableKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData(url) {
|
||||
const address = url ? url : loc() + "/pageData"
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(address, this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code == 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
notifySuccess(msg) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: msg,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notifyWarning(msg) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: msg,
|
||||
type: 'warning'
|
||||
});
|
||||
},
|
||||
notifyError(msg) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: msg
|
||||
});
|
||||
},
|
||||
async getThreeUnits() {
|
||||
this.$set(this.pageForm, 'threeUnitId', null)
|
||||
this.threeUnits = []
|
||||
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unitId, this.pageForm.unionGroupId)
|
||||
},
|
||||
launchFullscreen() {
|
||||
const element = document.documentElement
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen();
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if (element.webkitRequestFullscreen) {
|
||||
element.webkitRequestFullscreen();
|
||||
} else if (element.msRequestFullscreen) {
|
||||
element.msRequestFullscreen();
|
||||
}
|
||||
this.calcSignTableHeight()
|
||||
},
|
||||
exitFullscreen() {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
},
|
||||
toggleFullScreen() {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement.requestFullscreen();
|
||||
} else {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
const refreshSearchMixins = {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
finished: false,
|
||||
refreshing: false,
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
pageNumber: 0,
|
||||
pageSize: 5,
|
||||
totalCount: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async pageData() {
|
||||
this.pageForm.pageNumber++
|
||||
$.post(loc() + "/pageData", this.pageForm, (res) => {
|
||||
const {code, data} = res
|
||||
if (this.refreshing) {
|
||||
this.tableData = [];
|
||||
this.refreshing = false;
|
||||
}
|
||||
this.loading = false;
|
||||
|
||||
if (code === 0) {
|
||||
this.tableData = this.tableData.concat(data.list)
|
||||
this.pageForm.totalCount = data.totalCount
|
||||
|
||||
if (this.tableData.length == 0) {
|
||||
this.finished = true;
|
||||
} else {
|
||||
this.none_data = false
|
||||
if (this.tableData.length >= this.pageForm.totalCount) {
|
||||
this.finished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async onRefresh() {
|
||||
this.refreshing = true;
|
||||
this.finished = false;
|
||||
this.pageForm.pageNumber = 0
|
||||
this.loading = true;
|
||||
await this.pageData();
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user