first commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
vant.Toast.allowMultiple();
|
||||
|
||||
const modal = {
|
||||
// 消息提示
|
||||
msg(content) {
|
||||
vant.Toast(content)
|
||||
},
|
||||
// 错误消息
|
||||
msgError(content) {
|
||||
vant.Toast.fail(content)
|
||||
},
|
||||
// 成功消息
|
||||
msgSuccess(content) {
|
||||
vant.Toast.success(content)
|
||||
},
|
||||
// 弹出提示
|
||||
alert(content) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: content
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
},
|
||||
// 确认窗体
|
||||
confirm(content) {
|
||||
return new Promise((resolve, reject) => {
|
||||
vant.Dialog.confirm({
|
||||
title: '提示',
|
||||
message: content,
|
||||
}).then(() => {
|
||||
resolve()
|
||||
}).catch(() => {
|
||||
// reject()
|
||||
})
|
||||
})
|
||||
},
|
||||
// 提示信息
|
||||
showToast(option) {
|
||||
if (typeof option === "object") {
|
||||
vant.Toast(option)
|
||||
} else {
|
||||
vant.Toast.loading({
|
||||
message: option,
|
||||
forbidClick: true,
|
||||
loadingType: 'spinner',
|
||||
duration: 2500
|
||||
});
|
||||
}
|
||||
},
|
||||
// 打开遮罩层
|
||||
loading(content) {
|
||||
vant.Toast.loading({
|
||||
message: content,
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
});
|
||||
},
|
||||
// 关闭遮罩层
|
||||
closeLoading() {
|
||||
vant.Toast.clear();
|
||||
}
|
||||
}
|
||||
Vue.prototype.$modal = modal
|
||||
@@ -0,0 +1,54 @@
|
||||
const mCommon = {
|
||||
unitList: [],
|
||||
unionList: [],
|
||||
async getUnionList() {
|
||||
const {data} = await $.get("/platform/vi/common/unions")
|
||||
data.forEach(v => {
|
||||
v.text = v.unionname
|
||||
v.value = v.id
|
||||
})
|
||||
data.unshift({text: "全部工会", value: null})
|
||||
this.unionList = data
|
||||
},
|
||||
async getUnitList(unionId) {
|
||||
const {data} = await $.get("/platform/vi/common/units", {unionId})
|
||||
data.forEach(v => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
data.unshift({text: "全部单位", value: null})
|
||||
this.unitList = data
|
||||
},
|
||||
previewFile(filepath, filename, fileList, index, fileId) {
|
||||
const FILE_DOMAIN = "${AppFileDomain!}";
|
||||
const APP_DOMAIN = "${AppDomain!}";
|
||||
const doctype = ['doc', 'docx', 'xls', 'xlsx'];
|
||||
const pictype = ['jpg', 'png', 'gif', 'jpeg'];
|
||||
let filetype = filepath.substring(filepath.lastIndexOf('.') + 1, filepath.length);
|
||||
if (doctype.indexOf(filetype) > -1) {
|
||||
const path = APP_DOMAIN + "/file/mange/preview?filepath=" + filepath + "&fileid=" + fileId
|
||||
window.open(path);
|
||||
} else if (pictype.indexOf(filetype) > -1) {
|
||||
let ele = document.createElement("div");
|
||||
fileList.forEach(v => {
|
||||
let fp = v.filepath.substring(v.filepath.lastIndexOf('.') + 1, v.filepath.length);
|
||||
if (pictype.indexOf(fp) > -1) {
|
||||
const image = new Image();
|
||||
const src = FILE_DOMAIN + v.filepath
|
||||
image.src = src
|
||||
image.alt = v.filename
|
||||
ele.appendChild(image);
|
||||
}
|
||||
|
||||
})
|
||||
const viewer = new Viewer(ele, {
|
||||
title: function (img, obj) {
|
||||
return img.getAttribute("alt");
|
||||
}
|
||||
});
|
||||
viewer.show();
|
||||
} else {
|
||||
alert('该文件不支持在手机端预览')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
const mCondolence = {
|
||||
typeList: [],
|
||||
async getType() {
|
||||
const {data} = await $.get("/platform/condolence/type/getAll")
|
||||
data.forEach(v => {
|
||||
v.text = v.name + '(' + v.code + ')'
|
||||
v.value = v.id
|
||||
})
|
||||
data.unshift({text: "全部类型", value: null})
|
||||
this.typeList = data
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const mProposal = {
|
||||
|
||||
async getAllSession() {
|
||||
const {data} = await $.get('/mobile/proposal/common/getAllSession')
|
||||
return data
|
||||
},
|
||||
|
||||
async getDelegation(sessionId) {
|
||||
const {data} = await $.get('/mobile/proposal/common/getDelegation', {sessionId})
|
||||
return data
|
||||
},
|
||||
async getDelegateType() {
|
||||
const {data} = await $.get('/mobile/proposal/common/getDelegateType')
|
||||
return data
|
||||
},
|
||||
async getProposalType() {
|
||||
const {data} = await $.get('/mobile/proposal/common/getProposalType')
|
||||
return data
|
||||
},
|
||||
async getProposalDict() {
|
||||
const {data} = await $.get('/mobile/proposal/common/getProposalDict')
|
||||
return data
|
||||
},
|
||||
async GetProposalStateCode(proposal_id) {
|
||||
const {data} = await $.post("/platform/proposal/common/getProposalStateCode", {proposal_id})
|
||||
return data;
|
||||
},
|
||||
|
||||
async GetProposalResultCode(proposal_id) {
|
||||
const {data} = await $.post("/platform/proposal/common/getProposalResultCode", {proposal_id})
|
||||
return data;
|
||||
},
|
||||
async getProposalUndertake() {
|
||||
const {data} = await $.get("/platform/proposal/common/getProposalUndertake")
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
const mobileMixins = {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
mLoading: false,
|
||||
finished: false,
|
||||
loading: false,
|
||||
refreshing: false,
|
||||
formData: {},
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 5,
|
||||
totalCount: 0
|
||||
},
|
||||
themeColor: '#1867b0',
|
||||
pageDataUrl: null,
|
||||
yearList: []
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
date(value) {
|
||||
return value ? moment(value).format('YYYY-MM-DD') : ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async pageData() {
|
||||
this.mLoading = true
|
||||
if (this.pageDataUrl == null) {
|
||||
this.pageDataUrl = loc() + '/pageData'
|
||||
}
|
||||
$.post(this.pageDataUrl, 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;
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
this.mLoading = false
|
||||
},
|
||||
async onRefresh() {
|
||||
this.tableData = []
|
||||
this.refreshing = true;
|
||||
this.finished = false;
|
||||
this.pageForm.pageNumber = 0
|
||||
this.loading = true;
|
||||
await this.pageData();
|
||||
},
|
||||
GetQueryString(name) {
|
||||
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
const r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
return "";
|
||||
},
|
||||
createYearList() {
|
||||
for (let i = new Date().getFullYear() - 50; i <= new Date().getFullYear(); i++) {
|
||||
this.yearList.unshift({value: i, text: i + '年'},)
|
||||
}
|
||||
},
|
||||
startLoading() {
|
||||
this.vLoading = vant.Toast.loading({
|
||||
message: '加载中...',
|
||||
forbidClick: true,
|
||||
duration: 0
|
||||
})
|
||||
},
|
||||
closeLoading() {
|
||||
setTimeout(() => {
|
||||
this.vLoading.close()
|
||||
}, 500)
|
||||
},
|
||||
doSearch() {
|
||||
this.tableKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.tableData = []
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.createYearList()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user