/**
 * 
菜单权限列表：eaptpl.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/yhcdqxlb.store/SqlEntity_NTqEeq7n.sqlentity
/amrept-web/hcm/xtgl/xtfg/xtsy/funcdir/sygn.func

首页左侧菜单数据集：
eaptpl.pro/ptpz.dir/xtgn.dir/sy.modeldir/datadir.datadir/syzccd.store/SqlEntity_r3hx80TL.sqlentity
菜单权限列表：eaptpl.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/yhcdqxlb.store/SqlEntity_NTqEeq7n.sqlentity
取数功能路径：/project/xtgl/xtfg/xtsy/funcdir/sygn.func
测试地址：http://192.168.1.183:5001/amrept-web/project/ptpz/xtgj/sjdxzs/funcdir/sjdxzs.func

cxf 跨域查询
	url: http://192.168.100.183:5001/amrept-web/server/WebServiceWadl/{projectN}/cxfService/query
	方式：get
	参数：
	"body":查询条件
	"modelFilePath":数据集业务路径
	"queryCdion":
	"pageSize":每页数据条数
	"pageNum":页数
	"treePath":
	"funcpath":功能路径
	"queryCache":是否应用查询缓存

	跨域保存
	URL: http://192.168.100.183:5001/amrept-web/server/WebServiceWadl/{projectN}/cxfService/save
	方式：get
	参数：同上

*/
import { projectName,codeProjectName } from '../config'
import request from '../utils/request'
let hi_request=null;
if(window.HIVUI_SETTING&&window.HIVUI_SETTING.request){
	hi_request=window.HIVUI_SETTING.request;
}
function _request(opt){
  if(hi_request){
    return hi_request(opt);
  }else{
    return request(opt);
  }
}
const __base=(window.HIVUI_SETTING.serverUrl||codeProjectName);
const queryUrl = (import.meta.env.VITE_APP_QUERYDATA||process.env.VITE_APP_QUERYDATA).replace("[projectName]",projectName)
export function getMenus() {
	///amrept-web/data/query.do
	/*let body={
		"queryCdions": {
			"join": "and",
			"items": [
				{
					"sign": "in",
					"name": "isShow",
					"desc": "",
					"dataType": "dbString",
					"value": [1,3,5],
					"enabled": true
				}
			]
		}
	}
	return request({
		url: queryUrl,
		method: 'post',
		data: qs.stringify({
			modelFilePath: `${projectName}.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/yhcdqxlb.store/SqlEntity_NTqEeq7n.sqlentity`,
			__funcpath: `/${projectName}/xtgl/xtfg/xtsy/funcdir/sygn.func`,
			pageNum: -1,
			pageSize: -1,
			__body:JSON.stringify(body)
		})
	})*/


	return _request({
		url: window.customSysCofig.customGetUserMenu||(__base+"/login/user/menu"),
		method: 'get',
	})

}
//首面左侧快速导航
export function getQuickNav() {
	///amrept-web/data/query.do
	let body={
		"queryCdions": {
			"join": "and",
			"items": [
				{
					"sign": "in",
					"name": "isShow",
					"desc": "",
					"dataType": "dbString",
					"value": [4,5],
					"enabled": true
				}
			]
		}
	}
	/*return _request({
		url: queryUrl,
		method: 'post',
		data: qs.stringify({
			modelFilePath: `${projectName}.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/yhcdqxlb.store/SqlEntity_NTqEeq7n.sqlentity`,
			__funcpath: `/${projectName}/xtgl/xtfg/xtsy/funcdir/sygn.func`,
			pageNum: -1,
			pageSize: -1,
			__body:JSON.stringify(body)
		})
	})*/
}

export function getPortalMenus() {
	///amrept-web/data/query.do
	let body={
		"queryCdions": {
			"join": "and",
			"items": [
				{
					"sign": "in",
					"name": "isShow",
					"desc": "",
					"dataType": "dbString",
					"value": [6],
					"enabled": true
				}
			]
		}
	}
	/*return _request({
		url: queryUrl,
		method: 'post',
		data: qs.stringify({
			modelFilePath: `${projectName}.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/yhcdqxlb.store/SqlEntity_NTqEeq7n.sqlentity`,
			__funcpath: `/${projectName}/xtgl/xtfg/xtsy/funcdir/sygn.func`,
			pageNum: -1,
			pageSize: -1,
			__body:JSON.stringify(body)
		})
	})*/
}
//最近使用
export function getLeastRecentlyUsed(username) {
	///amrept-web/data/query.do
	/*let body={
		"queryCdions": {
			"join": "and",
			"items": [
				{
					"sign": "eq",
					"name": "FUSERNAME",
					"desc": "",
					"dataType": "dbString",
					"value": username,
					"enabled": true
				}
			]
		}
	}
	return _request({
		url: queryUrl,
		method: 'post',
		data: qs.stringify({
			modelFilePath: `${projectName}.pro/ptpz.dir/xtgn.dir/zjyy.modeldir/datadir.datadir/zjyy.store/SqlEntity_DrYlHLl6.sqlentity`,
			__funcpath: `/${projectName}/xtgl/xtfg/xtsy/funcdir/sygn.func`,
			pageNum: 1,
			pageSize: 10,
			__body:JSON.stringify(body)
		})
	})*/
	return _request({
		url: __base+"/sys/recent/get",
		method: 'get',
	})
}

//取功能权限
export function getPermissions(username) {
	///amrept-web/data/query.do
	let body={
		"queryCdions": {
			"join": "and",
			"items": [
				{
					"sign": "eq",
					"name": "userName",
					"desc": "",
					"dataType": "dbString",
					"value": username,
					"enabled": true
				}
			]
		}
	}
	/*return _request({
		url: queryUrl,
		method: 'post',
		data: qs.stringify({
			modelFilePath: `${projectName}.pro/ptpz.dir/xtgn.dir/gnqxcz.modeldir/data.datadir/qxurllb.store/SqlEntity_nAIsAP3H.sqlentity`,
			__funcpath: `/${projectName}/xtgl/xtfg/xtsy/funcdir/sygn.func`,
			pageNum: -1,
			pageSize: -1,
			__body:JSON.stringify(body)
		})
	})*/
}


