first commit
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
|
||||
const QC = (arr1,arr2,key)=>{
|
||||
let json = arr1.concat(arr2)
|
||||
let newArr = []
|
||||
for(let item1 of json){
|
||||
let flag = true
|
||||
for(let item2 of newArr){
|
||||
if(item1[key]==item2[key]){
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
newArr.push(item1)
|
||||
}
|
||||
}
|
||||
return newArr
|
||||
}
|
||||
|
||||
|
||||
|
||||
//查询用户
|
||||
const selectUser = async (key,pageSize) => {
|
||||
const {data} = await $.get("/platform/Common/selectUser",{ key: key,pageSize: pageSize})
|
||||
return data
|
||||
}
|
||||
|
||||
//获取所有的教代会
|
||||
const getAllJdh = async () => {
|
||||
const {data} = await $.get("/platform/jdh/Common/getAllJdhxx")
|
||||
return data
|
||||
}
|
||||
|
||||
//获取所有开启的教代会
|
||||
const getOpenJdh = async () => {
|
||||
const {data} = await $.get("/platform/jdh/Common/getOpenJdhxx")
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
//获取教代会工作资料类型
|
||||
const getGzzllx = async () => {
|
||||
const {data} = await $.get("/platform/jdh/Common/getGzzllx")
|
||||
return data
|
||||
}
|
||||
|
||||
//获取字典表里的代表团名称 需要提前录入好
|
||||
// const getDbt = async () => {
|
||||
// const {data} = await $.get("/platform/jdh/Common/getDbt")
|
||||
// return data
|
||||
// }
|
||||
|
||||
|
||||
//根据教代会获取代表团
|
||||
const getDbtList = async (jdhid)=>{
|
||||
const {data} = await $.get("/platform/jdh/Common/getDbtListByJdhId",{jdhid:jdhid})
|
||||
return data
|
||||
}
|
||||
|
||||
//查询当前用户管理的基层工会
|
||||
const getUnion = async () => {
|
||||
const {data} = await $.get("/platform/Common/getUnion")
|
||||
return data
|
||||
}
|
||||
|
||||
//查询当前用户管理的基层工会下的单位
|
||||
const getUnit = async (unionid) => {
|
||||
const {data} = await $.get("/platform/Common/getUnit",{unionid:unionid})
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const GET = (url,params)=>{
|
||||
return new Promise((resolve,reject) => {
|
||||
$.ajax({
|
||||
url:base+url,
|
||||
method:'GET',
|
||||
data:params
|
||||
}).then(res=>{
|
||||
if(res && res.code===0) {
|
||||
resolve(res)
|
||||
}else{
|
||||
ELEMENT.Notification.error('系统错误!')
|
||||
return reject(url)
|
||||
|
||||
}
|
||||
}).fail(err=>{
|
||||
ELEMENT.Notification.error(err.status+'')
|
||||
return
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const POST = (url,params,isLoading=false)=>{
|
||||
return new Promise((resolve,reject) => {
|
||||
if(isLoading)
|
||||
sublime.showLoadingbar()
|
||||
$.ajax({
|
||||
url:base+url,
|
||||
method:'POST',
|
||||
data:params
|
||||
}).then(res=>{
|
||||
if(res && res.code===0){
|
||||
if(!isLoading){
|
||||
ELEMENT.Message.success(res.msg)
|
||||
}
|
||||
resolve(res)
|
||||
}else {
|
||||
ELEMENT.Notification.error('系统错误!')
|
||||
return reject(url)
|
||||
}
|
||||
}).fail(err=>{
|
||||
ELEMENT.Notification.error(err.status+'')
|
||||
return
|
||||
}).always(()=>{
|
||||
sublime.closeLoadingbar()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user