|
@@ -1,61 +1,60 @@
|
|
|
-import req from "ui-jz-v4-common/src/utils/zt-data";
|
|
|
-import axios from "@/utils/req";
|
|
|
-import request from "@/utils/request";
|
|
|
+import req from "ui-jz-v4-common/src/utils/zt-data"
|
|
|
+import axios from "@/utils/req"
|
|
|
+import request from "@/utils/request"
|
|
|
import handleSearchCondition from "@/utils/searchable"
|
|
|
|
|
|
// 将一维数组转换成树形结构
|
|
|
function treeUtil(data, key = { id: "id", pid: "pid" }) {
|
|
|
- let result = [];
|
|
|
+ let result = []
|
|
|
if (!Array.isArray(data)) {
|
|
|
- return result;
|
|
|
+ return result
|
|
|
}
|
|
|
data.forEach(item => {
|
|
|
- delete item.children;
|
|
|
- });
|
|
|
- let map = {};
|
|
|
+ delete item.children
|
|
|
+ })
|
|
|
+ let map = {}
|
|
|
data.forEach(item => {
|
|
|
- map[item[key.id]] = item;
|
|
|
- });
|
|
|
+ map[item[key.id]] = item
|
|
|
+ })
|
|
|
data.forEach(item => {
|
|
|
- let parent = map[item[key.pid] || item[key.pid.toLocaleUpperCase()]];
|
|
|
+ let parent = map[item[key.pid] || item[key.pid.toLocaleUpperCase()]]
|
|
|
if (parent) {
|
|
|
- (parent.children || (parent.children = [])).push(item);
|
|
|
+ ;(parent.children || (parent.children = [])).push(item)
|
|
|
} else {
|
|
|
- result.push(item);
|
|
|
+ result.push(item)
|
|
|
}
|
|
|
- });
|
|
|
- return result;
|
|
|
+ })
|
|
|
+ return result
|
|
|
}
|
|
|
|
|
|
/** next delete...
|
|
|
* 机构树列表
|
|
|
*/
|
|
|
export function getOrgMtTree(data) {
|
|
|
- return req.post("/orgInfo/orgMtTreeYB", data);
|
|
|
+ return req.post("/orgInfo/orgMtTreeYB", data)
|
|
|
}
|
|
|
|
|
|
// 机构列表 *懒加载
|
|
|
export function getTree(data) {
|
|
|
- data.type = data.type || "APP";
|
|
|
+ data.type = data.type || "APP"
|
|
|
// data.id = data.id || '7F08CCC3C4984A2586C9D3F0A6B804E5';
|
|
|
- return axios.post("/authsvr/v2/authorginfo/org/tree/catalog", data);
|
|
|
+ return axios.post("/authsvr/v2/authorginfo/org/tree/catalog", data)
|
|
|
}
|
|
|
|
|
|
// 机构树-正确的树 (权限过滤后的)
|
|
|
export function getOrgTree(data) {
|
|
|
- data.type = data.type || "APP";
|
|
|
- return axios.post("/authsvr/v2/authorginfo/org/tree/catalog", data);
|
|
|
-
|
|
|
+ data.type = data.type || "APP"
|
|
|
+ return axios.post("/authsvr/v2/authorginfo/org/tree/catalog", data)
|
|
|
}
|
|
|
|
|
|
// 机构列表 *查询本级
|
|
|
export function getBaseTree(data) {
|
|
|
- return axios.get(`/authsvr/v2/authorginfo/org/tree/node/${data.id}`);
|
|
|
+ return axios.get(`/authsvr/v2/authorginfo/org/tree/node/${data.id}`)
|
|
|
}
|
|
|
|
|
|
// 厂商列表
|
|
|
export function externalTree(data) {
|
|
|
- return axios.post("/appsvr/app/externalTree", data);
|
|
|
+ return axios.post("/appsvr/app/externalTree", data)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -64,7 +63,7 @@ export function externalTree(data) {
|
|
|
*/
|
|
|
export function treeMatch(data) {
|
|
|
// return axios.post(`orgsvr/v2/org/tree/match`, data);
|
|
|
- return request({
|
|
|
+ return request({
|
|
|
url: "/authsvr/v2/authorginfo/org/tree/match",
|
|
|
method: "POST",
|
|
|
data
|
|
@@ -77,60 +76,60 @@ export function treeMatch(data) {
|
|
|
* type: police 警员、auxiliaryPolice 辅警、externalPersonnel 外部人员、manager 管理员、govUser 政府人员
|
|
|
*/
|
|
|
export function downTemplate(params) {
|
|
|
- return axios.arraybuffer("/downloadTemplate/downTemplate", params);
|
|
|
+ return axios.arraybuffer("/downloadTemplate/downTemplate", params)
|
|
|
}
|
|
|
|
|
|
// 导入文件
|
|
|
export function importFile(url, data) {
|
|
|
- return request({
|
|
|
- url,
|
|
|
- method: "GET",
|
|
|
- params: data
|
|
|
- })
|
|
|
+ return request({
|
|
|
+ url,
|
|
|
+ method: "GET",
|
|
|
+ params: data
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
export function uniClass() {
|
|
|
return req.post("/duacm/codeSon/v2/data/T_MD_UNIT_CLASS.ation").then(res => {
|
|
|
- const arr = res.data;
|
|
|
+ const arr = res.data
|
|
|
|
|
|
return {
|
|
|
arr,
|
|
|
tree: treeUtil(arr, { id: "CODE", pid: "pcode" })
|
|
|
- };
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 单位类别 新新新
|
|
|
export function uniClass2() {
|
|
|
return req.post("/duacm/codeSon/v2/data/T_MD_UNIT_CLASS.ation").then(res => {
|
|
|
- const arr = res.data;
|
|
|
+ const arr = res.data
|
|
|
|
|
|
return {
|
|
|
arr,
|
|
|
tree: treeUtil(arr, { id: "CODE", pid: "pcode" })
|
|
|
- };
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 分配范围
|
|
|
export function distribuAction(data) {
|
|
|
return req.get("/authsvr/v2/orgQuota/distributionRange", data).then(res => {
|
|
|
if (res.data && res.status == 200) {
|
|
|
- return res.data.content;
|
|
|
+ return res.data.content
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 菜单树 一次性查询
|
|
|
* */
|
|
|
export function menuTree({ appId }) {
|
|
|
- return axios.get(`/authsvr/v2/appfuninfo/menuTreeList`, { appId });
|
|
|
+ return axios.get(`/authsvr/v2/appfuninfo/menuTreeList`, { appId })
|
|
|
}
|
|
|
|
|
|
// 根据appId 获取菜单
|
|
|
export function getAppfunMenu(appId) {
|
|
|
- return axios.get(`/authsvr/v2/appfuninfo/menu/${appId}`);
|
|
|
+ return axios.get(`/authsvr/v2/appfuninfo/menu/${appId}`)
|
|
|
}
|
|
|
|
|
|
// 标签树
|
|
@@ -138,13 +137,24 @@ export function getBusinessTagTree(data) {
|
|
|
return request({
|
|
|
url: `/authsvr/v2/dataauth/businessTreeList`,
|
|
|
method: "get"
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-export function getDropdownApp(url,condition) {
|
|
|
- return request({
|
|
|
- url,
|
|
|
- method: "POST",
|
|
|
- data: handleSearchCondition(condition)
|
|
|
- })
|
|
|
-}
|
|
|
+export function getDropdownApp(url, condition) {
|
|
|
+ return request({
|
|
|
+ url,
|
|
|
+ method: "POST",
|
|
|
+ data: handleSearchCondition(condition)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 令牌在线查询接口
|
|
|
+ */
|
|
|
+export function getOnline(data) {
|
|
|
+ return request({
|
|
|
+ url: `/authsvr/v2/token-info/online-query`,
|
|
|
+ method: "POST",
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|