fix: 初始化
This commit is contained in:
41
packages/icpx-platform/src/api/README.md
Normal file
41
packages/icpx-platform/src/api/README.md
Normal file
@ -0,0 +1,41 @@
|
||||
## Axios Typescript 使用说明
|
||||
|
||||
目前推荐封装请求方法直接使用 `src/utils/request.ts`
|
||||
使用案例如下:
|
||||
|
||||
#### GET
|
||||
|
||||
```ts
|
||||
async function getUser(id: number) {
|
||||
return request.get<id, UserInfo>(`/user/${id}`);
|
||||
}
|
||||
// 返回结果为
|
||||
// Promise<UserInfo>
|
||||
```
|
||||
|
||||
#### POST / PUT
|
||||
|
||||
```ts
|
||||
async function saveUser(user: UserInfo) {
|
||||
// 定义用于得知是 新增 还是 修改
|
||||
// 可根据自己业务自定义逻辑判断
|
||||
const isNewRecord = user.id > 0;
|
||||
return request<UserInfo, boolean>({
|
||||
url: isNewRecord ? `/user/${id}` : `/user/`,
|
||||
method: isNewRecord ? 'POST' : 'PUT',
|
||||
data: user,
|
||||
});
|
||||
}
|
||||
// 返回结果为
|
||||
// Promise<boolean>
|
||||
```
|
||||
|
||||
#### DELETE
|
||||
|
||||
```ts
|
||||
async function deleteUser(id: number) {
|
||||
return request.delete<number, boolean>(`/user/${id}`);
|
||||
}
|
||||
// 返回结果为
|
||||
// Promise<boolean>
|
||||
```
|
139
packages/icpx-platform/src/api/commonApi/index.ts
Normal file
139
packages/icpx-platform/src/api/commonApi/index.ts
Normal file
@ -0,0 +1,139 @@
|
||||
import type { APIMethod } from '@crami/bui-types';
|
||||
//通用接口参数处理
|
||||
import { getInfo, ICP_CONFIG } from '@/utils/commMethods';
|
||||
import { computed, reactive } from 'vue';
|
||||
|
||||
export const commonApi = () => {
|
||||
const commonParams = computed(() => {
|
||||
return getInfo(ICP_CONFIG);
|
||||
});
|
||||
|
||||
const studioCacheParam = reactive({
|
||||
//产品线
|
||||
productLine: commonParams.value?.project,
|
||||
//语言
|
||||
lang: commonParams.value?.lang,
|
||||
//视图名称
|
||||
// name: commonParams.value?.listView,
|
||||
//行政组
|
||||
// userDept: commonParams.value?.userDept,
|
||||
// //用户组
|
||||
// userGroup: commonParams.value?.userGroup,
|
||||
//项目实例
|
||||
projectCode: commonParams.value?.projectCode,
|
||||
// 多时区
|
||||
timeZone: commonParams.value?.TIME_ZONE,
|
||||
});
|
||||
const systemParam = reactive({
|
||||
// viewName: commonParams.value?.listViewName,
|
||||
lang: commonParams.value?.lang,
|
||||
//数据库连接
|
||||
connect: commonParams.value?.connect,
|
||||
//所属租户
|
||||
companyId: commonParams.value?.companyId,
|
||||
//行政组
|
||||
userDept: commonParams.value?.userDept,
|
||||
//用户组
|
||||
userGroup: commonParams.value?.userGroup,
|
||||
projectCode: commonParams.value?.projectCode,
|
||||
// 多时区
|
||||
timeZone: commonParams.value?.TIME_ZONE,
|
||||
});
|
||||
const paraList = {
|
||||
loadAllStructure: false,
|
||||
lang: commonParams.value?.lang,
|
||||
connect: commonParams.value?.connect,
|
||||
companyId: commonParams.value?.companyId,
|
||||
userGroup: commonParams.value?.userGroup,
|
||||
projectCode: commonParams.value?.projectCode,
|
||||
userDept: commonParams.value?.userDept,
|
||||
};
|
||||
return {
|
||||
studioCache: {
|
||||
getMetaInfo: {
|
||||
url: '/api/studio-cache/page/getMetaInfo',
|
||||
params: studioCacheParam,
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getByProjectAndType: {
|
||||
url: '/api/studio-cache/metaData/getByProjectAndType',
|
||||
params: {
|
||||
// TODO:jjf临时修改
|
||||
// productLine: commonParams.value?.project,
|
||||
// projectCode: commonParams.value?.projectCode,
|
||||
project: 'PLMBASE,PLM_PRODUCT,PLMPRODUCT',
|
||||
productLine: 'PLMBASE,PLM_PRODUCT,PLMPRODUCT',
|
||||
projectCode: 'PLMBASE',
|
||||
timeZone: commonParams.value?.TIME_ZONE,
|
||||
},
|
||||
method: 'get' as APIMethod,
|
||||
},
|
||||
},
|
||||
system: {
|
||||
getData: {
|
||||
url: '/api/system/view/getData',
|
||||
params: systemParam,
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getGetOnePageGridDataList: {
|
||||
url: '/api/system/model/getGetOnePageGridDataList',
|
||||
params: {
|
||||
...systemParam,
|
||||
objectType: '',
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getGetOnePageGridDataListByTenant: {
|
||||
url: '/api/system/tenant/getGetOnePageGridDataList',
|
||||
params: {
|
||||
...systemParam,
|
||||
objectType: '',
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getSltData: {
|
||||
url: '/api/system/model/getSltData',
|
||||
params: {
|
||||
...systemParam,
|
||||
userId: commonParams.value?.user_id,
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getGetTreeRootDataList: {
|
||||
url: '/api/system/model/getGetTreeRootDataList',
|
||||
params: {
|
||||
...systemParam,
|
||||
paraList: JSON.stringify(paraList),
|
||||
type: 'tree',
|
||||
loadAllStructure: false,
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getGetTreeChildDataList: {
|
||||
url: '/api/system/model/getGetTreeChildDataList',
|
||||
params: {
|
||||
...systemParam,
|
||||
type: 'treeChildren',
|
||||
loadAllStructure: false,
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
getObjectDataTestList: {
|
||||
url: '/api/system/model/GetObjectDataTestList',
|
||||
params: {
|
||||
...systemParam,
|
||||
userId: commonParams.value?.user_id,
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
saveObjectData: {
|
||||
url: '/api/msg/sender/saveOrEditMsgSender',
|
||||
params: {
|
||||
...systemParam,
|
||||
userId: commonParams.value?.user_id,
|
||||
},
|
||||
method: 'post' as APIMethod,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
122
packages/icpx-platform/src/api/dashboard/analysis.ts
Normal file
122
packages/icpx-platform/src/api/dashboard/analysis.ts
Normal file
@ -0,0 +1,122 @@
|
||||
import { reactive } from 'vue';
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface VisitDataItem {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface SalesDataItem {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface SearchDataItem {
|
||||
index: number | string;
|
||||
keyword: string;
|
||||
count: number;
|
||||
range: number;
|
||||
status: number;
|
||||
}
|
||||
|
||||
export interface OfflineDataItem {
|
||||
name: string;
|
||||
cvr: number;
|
||||
}
|
||||
|
||||
export interface OfflineChartDataItem {
|
||||
x: number;
|
||||
y1: number;
|
||||
y2: number;
|
||||
}
|
||||
|
||||
export interface RadarDataItem {
|
||||
name: string;
|
||||
label: string;
|
||||
value: number | string;
|
||||
}
|
||||
|
||||
export interface ChartData {
|
||||
offlineChartData: OfflineChartDataItem[];
|
||||
offlineData: OfflineDataItem[];
|
||||
radarData: RadarDataItem[];
|
||||
salesData: SalesDataItem[];
|
||||
salesTypeData: SalesDataItem[];
|
||||
salesTypeDataOffline: SalesDataItem[];
|
||||
salesTypeDataOnline: SalesDataItem[];
|
||||
searchData: SearchDataItem[];
|
||||
visitData: VisitDataItem[];
|
||||
visitData2: VisitDataItem[];
|
||||
}
|
||||
|
||||
export function getAnalysisChartData(): Promise<ChartData> {
|
||||
return request.get('dashboard/fake_chart_data');
|
||||
}
|
||||
|
||||
export type SalesRangeType = [string, string];
|
||||
|
||||
export function getAnalysisSalesData(range: SalesRangeType): Promise<SalesDataItem[]> {
|
||||
return request.get('dashboard/fake_chart_sales_data', {
|
||||
params: {
|
||||
range,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export interface AnalysisData {
|
||||
state: {
|
||||
loading: boolean;
|
||||
chartData: ChartData;
|
||||
};
|
||||
fetchAllData: () => void;
|
||||
fetchSalesData: (rangeDate: [string, string]) => void;
|
||||
}
|
||||
|
||||
export const useAnalysisData = (): AnalysisData => {
|
||||
const state = reactive({
|
||||
loading: true,
|
||||
chartData: {
|
||||
offlineChartData: [],
|
||||
offlineData: [],
|
||||
radarData: [],
|
||||
salesData: [],
|
||||
salesTypeData: [],
|
||||
salesTypeDataOffline: [],
|
||||
salesTypeDataOnline: [],
|
||||
searchData: [],
|
||||
visitData: [],
|
||||
visitData2: [],
|
||||
} as ChartData,
|
||||
});
|
||||
|
||||
const fetchAllData = () => {
|
||||
state.loading = true;
|
||||
// fetch backend JSON api data.
|
||||
getAnalysisChartData()
|
||||
.then(res => {
|
||||
state.chartData = {
|
||||
...res,
|
||||
};
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
const fetchSalesData = (rangeDate: [string, string]) => {
|
||||
state.loading = true;
|
||||
getAnalysisSalesData(rangeDate)
|
||||
.then(res => {
|
||||
state.chartData.salesData = res;
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
state,
|
||||
fetchAllData,
|
||||
fetchSalesData,
|
||||
};
|
||||
};
|
5
packages/icpx-platform/src/api/dashboard/monitor.ts
Normal file
5
packages/icpx-platform/src/api/dashboard/monitor.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function queryTags(): Promise<any> {
|
||||
return request.get('/tags');
|
||||
}
|
17
packages/icpx-platform/src/api/dashboard/workplace.ts
Normal file
17
packages/icpx-platform/src/api/dashboard/workplace.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function queryProjectNotice(): Promise<any> {
|
||||
return request('/project/notice');
|
||||
}
|
||||
|
||||
export async function queryActivities(): Promise<any> {
|
||||
return request('/activities');
|
||||
}
|
||||
|
||||
export async function fakeChartData(): Promise<any> {
|
||||
return request('/fake_chart_data');
|
||||
}
|
||||
|
||||
export async function queryCurrent(): Promise<any> {
|
||||
return request('/currentUser');
|
||||
}
|
25
packages/icpx-platform/src/api/form/basic-form.ts
Normal file
25
packages/icpx-platform/src/api/form/basic-form.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ResponseBody } from '../typing';
|
||||
|
||||
export interface BasicFormData {
|
||||
title?: string;
|
||||
date?: [string, string];
|
||||
goal?: string;
|
||||
standard?: string;
|
||||
}
|
||||
|
||||
export interface BasicFormResponse {
|
||||
saveId: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save basic form data to backend
|
||||
*
|
||||
* @param formData
|
||||
* @return Promise<ResponseBody<BasicFormResponse>>
|
||||
*/
|
||||
export function saveBasicFormData(
|
||||
formData: BasicFormData,
|
||||
): Promise<ResponseBody<BasicFormResponse>> {
|
||||
return request.post('forms/basic-form', formData);
|
||||
}
|
7
packages/icpx-platform/src/api/form/step-form.ts
Normal file
7
packages/icpx-platform/src/api/form/step-form.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// use request util will ignore `/api/` path
|
||||
|
||||
export async function fakeSubmitForm(params = {}) {
|
||||
return request.post('forms', params);
|
||||
}
|
8
packages/icpx-platform/src/api/list/basic-list.ts
Normal file
8
packages/icpx-platform/src/api/list/basic-list.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request';
|
||||
import type { TableListItem } from '@/views/list/typing';
|
||||
|
||||
export async function queryFakeList(params = {}) {
|
||||
return request.get<any, TableListItem[]>('/fake_list', {
|
||||
params,
|
||||
});
|
||||
}
|
7
packages/icpx-platform/src/api/list/card-list.ts
Normal file
7
packages/icpx-platform/src/api/list/card-list.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function queryFakeList(params = {}): Promise<any> {
|
||||
return request.get('/fake_list', {
|
||||
params,
|
||||
});
|
||||
}
|
100
packages/icpx-platform/src/api/list/table-list.ts
Normal file
100
packages/icpx-platform/src/api/list/table-list.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import request from '@/utils/request';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
export async function queryRule(params?: { [key: string]: any }): Promise<RuleResponse> {
|
||||
return request.get('/rule', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function removeRule(params: Record<string, any>) {
|
||||
return request('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
method: 'delete',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function addRule(params: Record<string, any>) {
|
||||
return request('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
method: 'post',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateRule(params: Record<string, any>) {
|
||||
return request('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
method: 'update',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
interface RuleItem {
|
||||
key: string | number;
|
||||
callNo: number;
|
||||
avatar: string;
|
||||
desc: string;
|
||||
disabled: false;
|
||||
href: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
progress: number;
|
||||
status: number;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
interface RuleResponse {
|
||||
current: number;
|
||||
data: RuleItem[];
|
||||
pageSize: string;
|
||||
success: boolean;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function useRuleData() {
|
||||
const state = reactive({
|
||||
loading: true,
|
||||
current: 0,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
dataSource: [] as RuleItem[],
|
||||
});
|
||||
|
||||
const fetchRule = (params?: Record<string, any>) => {
|
||||
// 使 table 打开加载状态指示
|
||||
state.loading = true;
|
||||
// 发起 AJAX 请求到后端
|
||||
queryRule(
|
||||
Object.assign(
|
||||
{
|
||||
current: state.current,
|
||||
pageSize: state.pageSize,
|
||||
},
|
||||
params,
|
||||
),
|
||||
)
|
||||
.then((res: RuleResponse) => {
|
||||
// 更新数据
|
||||
state.dataSource = res.data;
|
||||
state.total = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
// 使 table 关闭加载状态指示
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
state,
|
||||
fetch: fetchRule,
|
||||
};
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface PageList {
|
||||
current?: number;
|
||||
size?: number;
|
||||
}
|
||||
export interface MsgChannel {
|
||||
channelCode: string;
|
||||
channelName: string;
|
||||
organizationId: string;
|
||||
sendImpl: string;
|
||||
userMappping: string;
|
||||
contentConstructor: string;
|
||||
isUse?: string;
|
||||
configParam?: {
|
||||
configCode: string;
|
||||
configItem: string;
|
||||
configValue: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IsUseStates {
|
||||
ids: Array<string>;
|
||||
isUse: string;
|
||||
}
|
||||
export interface IsUseState {
|
||||
ids: string;
|
||||
isUse: string;
|
||||
}
|
||||
export interface Channel {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface EditMsgChannel {
|
||||
id: string;
|
||||
field_28: string;
|
||||
// channelCode: string;
|
||||
channelName: string;
|
||||
organization: string;
|
||||
sendImpl: string;
|
||||
userMappping: string;
|
||||
contentConstructor: string;
|
||||
isUse?: string;
|
||||
configParam?: {
|
||||
id: string;
|
||||
field_29: string;
|
||||
//configCode: string;
|
||||
configItem: string;
|
||||
configValue: string;
|
||||
};
|
||||
}
|
||||
|
||||
export async function getList(params: PageList) {
|
||||
return (
|
||||
request.request < PageList,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/queryChannelList',
|
||||
method: 'GET',
|
||||
params,
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function addMsgChannel(data: MsgChannel) {
|
||||
return (
|
||||
request.request < MsgChannel,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function batchChangeIsUse(params: IsUseStates) {
|
||||
return (
|
||||
request.request < IsUseStates,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/updateStates',
|
||||
method: 'GET',
|
||||
params,
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function changeIsUse(params: IsUseState) {
|
||||
return (
|
||||
request.request < IsUseState,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/updateState',
|
||||
method: 'GET',
|
||||
params,
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function queryByChannelCode(params: Channel) {
|
||||
return (
|
||||
request.request < Channel,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/queryByChannelCode',
|
||||
method: 'GET',
|
||||
params,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function updateChannel(data: EditMsgChannel) {
|
||||
return (
|
||||
request.request < EditMsgChannel,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/update',
|
||||
method: 'POST',
|
||||
data,
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function deleteChannel(data: Channel) {
|
||||
return (
|
||||
request.request < Channel,
|
||||
any >
|
||||
{
|
||||
url: '/msg/channel/delete',
|
||||
method: 'GET',
|
||||
data,
|
||||
}
|
||||
);
|
||||
}
|
@ -0,0 +1,244 @@
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { h, ref } from 'vue';
|
||||
import bus from '@/utils/bus';
|
||||
import router from '@/router';
|
||||
import { message, Divider } from '@crami/ui';
|
||||
import _store from '@/store/index';
|
||||
import { useI18n } from '@crami/locale';
|
||||
import UserAvatar from '@/views/platform/components/UserAvatar.vue';
|
||||
import { changeRouterByMsg } from '@/views/platform/Message/utils/generateMsgContent';
|
||||
import { divide } from 'lodash';
|
||||
|
||||
let key;
|
||||
|
||||
const NOTIFICATION_CLS = 'message-prompt-notification';
|
||||
const BUI_CONTAINER_CLS = 'bui-assoQuery-container';
|
||||
const BUI_ITEM_CLS = 'bui-assoQuery-item';
|
||||
|
||||
const createStyleSheet = () => {
|
||||
let style = document.createElement("style");
|
||||
// WebKit处理
|
||||
style.appendChild(document.createTextNode(""));
|
||||
style.setAttribute('type', 'text/css');
|
||||
style.setAttribute(`${NOTIFICATION_CLS}-style`, '');
|
||||
document.head.appendChild(style);
|
||||
|
||||
const addCSSRule = (sheet, selector, rules, index) => sheet.insertRule ?
|
||||
sheet.insertRule(selector + "{" + rules + "}", index) :
|
||||
sheet.addRule(selector, rules, index);
|
||||
|
||||
const sheet = style.sheet;
|
||||
addCSSRule(sheet, `.${NOTIFICATION_CLS}`, `border-radius: 8px`);
|
||||
}
|
||||
|
||||
requestIdleCallback(() => {
|
||||
createStyleSheet();
|
||||
})
|
||||
|
||||
const clickNotification = (e, result, t) => {
|
||||
notification.close(key);
|
||||
const allowRouters = _store.getters['user/allowRouters'] || [];
|
||||
// 存在消息中心导航菜单
|
||||
const messageCenter = allowRouters.find(route => route.name === 'MessageCenter');
|
||||
// 存在我收到的导航菜单
|
||||
if (
|
||||
messageCenter &&
|
||||
messageCenter?.meta?.frontHidden !== true &&
|
||||
messageCenter.children && messageCenter.children.length
|
||||
) {
|
||||
const receivedMsgPage = messageCenter.children.find(route => route.name === 'ReceivedMsg');
|
||||
if (receivedMsgPage && receivedMsgPage?.meta?.frontHidden !== true) {
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: `/platform/Message/MessageCenter/ReceivedMsg/Index`,
|
||||
query: {
|
||||
activeKey: result.msgType,
|
||||
eid: result.msgReceivedEid,
|
||||
},
|
||||
});
|
||||
}, 300);
|
||||
} else {
|
||||
message.warning(`${t('messageGlobl.notification.noAuth')}`);
|
||||
}
|
||||
} else {
|
||||
message.warning(`${t('messageGlobl.notification.noAuth')}`);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取正常的跳转部分配置
|
||||
const getLinkContent = (result) => {
|
||||
let messageContentUrlJson = {};
|
||||
try {
|
||||
messageContentUrlJson = JSON.parse(result.messageContentUrl);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
return Object.values(messageContentUrlJson);
|
||||
}
|
||||
|
||||
// 获取content里可跳转的a标签内容
|
||||
const getAtagContent = ({ messageContent: content }) => {
|
||||
let result = [];
|
||||
// 测试用
|
||||
// content = "<p>当前信息:流程消息提示插件;您收到一条待办信息,请查收!,点击:<a href='http://10.0.88.239:33380/platform/workflow/myWorkflow/viewWorkflow?operationMode=need&processInstanceId=22906fd2b2f44ffebd0892b9c416d521&taskId=ae7086a1b0e349bda61308031b632ae1&processDefinitionId=fee5a95babb54d389915a4b805884255&isView=false&viewed=&EID=22906fd2b2f44ffebd0892b9c416d521¤tNodeKeys=Activity_0th4m4g&entryId=1596104410415521794&nodeType=a56123d295d' target='_blank'>办理</a></p>";
|
||||
if (!content) return result;
|
||||
|
||||
try {
|
||||
let _dom = document.createElement('div');
|
||||
_dom.innerHTML = content;
|
||||
const aDom = _dom.querySelectorAll('a');
|
||||
if (aDom && aDom.length) {
|
||||
result = [].map.call(aDom, a => ({
|
||||
name: a.innerText,
|
||||
target: a.getAttribute('target'),
|
||||
url: a.getAttribute('href'),
|
||||
}));
|
||||
}
|
||||
_dom = null;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 业务联查部分
|
||||
const renderBusiAssoQuery = (result) => {
|
||||
const messageContentItems = getLinkContent(result);
|
||||
const extraContentItems = getAtagContent(result);
|
||||
if (!messageContentItems.length && !extraContentItems.length) return null;
|
||||
|
||||
const renderItem = (item, type = 'common') => {
|
||||
const default_props = {
|
||||
class: BUI_ITEM_CLS,
|
||||
style: {
|
||||
width: '48%',
|
||||
background: '#E8F0FD',
|
||||
borderRadius: '4px',
|
||||
overflow: 'hidden',
|
||||
color: '#3979F9',
|
||||
height: '28px',
|
||||
lineHeight: '28px',
|
||||
textAlign: 'center',
|
||||
cursor: 'pointer',
|
||||
marginBottom: '12px',
|
||||
},
|
||||
}
|
||||
const extra_props = {};
|
||||
switch (type) {
|
||||
case 'a':
|
||||
default_props.onClick = (e) => {
|
||||
item.url && window.open(item.url);
|
||||
e.stopPropagation();
|
||||
};
|
||||
break;
|
||||
case 'common':
|
||||
default_props.onClick = (e) => {
|
||||
item.url && changeRouterByMsg(item);
|
||||
e.stopPropagation();
|
||||
};
|
||||
break;
|
||||
default:
|
||||
default_props.onClick = () => {};
|
||||
}
|
||||
|
||||
return h('div', Object.assign({}, default_props, extra_props), item.name);
|
||||
}
|
||||
|
||||
return h('div', {}, [
|
||||
h(Divider, {
|
||||
style: {
|
||||
borderColor: '#E9E9E9',
|
||||
margin: '16px 0',
|
||||
},
|
||||
dashed: true,
|
||||
}),
|
||||
h('div', {
|
||||
class: BUI_CONTAINER_CLS,
|
||||
style: {
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '-12px',
|
||||
},
|
||||
}, [
|
||||
...messageContentItems.map(item => renderItem(item, 'common')),
|
||||
...extraContentItems.map(item => renderItem(item, 'a')),
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
||||
const notificationContent = (result, t) => h(
|
||||
'div',
|
||||
{
|
||||
fontSize: '14px',
|
||||
onClick: (e) => clickNotification(e, result, t),
|
||||
},
|
||||
[
|
||||
// 因为数据问题先不展示
|
||||
// h('div', {
|
||||
// class: `${NOTIFICATION_CLS}-msgInfo`,
|
||||
// style: {
|
||||
// display: 'flex',
|
||||
// alignItems: 'center',
|
||||
// marginBottom: '12px'
|
||||
// }
|
||||
// }, [
|
||||
// h(UserAvatar, {
|
||||
// userInfo: result,
|
||||
// avaterField: 'sender_avatar',
|
||||
// size: 24,
|
||||
// style: {
|
||||
// marginRight: '8px',
|
||||
// }
|
||||
// }),
|
||||
// h('div', {
|
||||
// style: {
|
||||
// marginRight: '8px',
|
||||
// color: '#666666',
|
||||
// }
|
||||
// }, result.senderName),
|
||||
// h('div', {
|
||||
// style: {
|
||||
// fontSize: '12px',
|
||||
// color: '#999',
|
||||
// }
|
||||
// }, `[${t('messageGlobl.notification.newMessage')}]`),
|
||||
// ]),
|
||||
h('div', {
|
||||
style: {
|
||||
color: '#333333',
|
||||
fontWeight: '500',
|
||||
height: '21px',
|
||||
lineHeight: '21px',
|
||||
marginBottom: '8px',
|
||||
}
|
||||
}, `${t('messageGlobl.notification.title')}: ${result?.messageTitle}`),
|
||||
h('div', {
|
||||
style: {
|
||||
color: '#666666',
|
||||
height: '21px',
|
||||
lineHeight: '21px',
|
||||
}
|
||||
}, `${t('messageGlobl.notification.abstract')}: ${result?.abstractContent}`),
|
||||
renderBusiAssoQuery(result),
|
||||
],
|
||||
)
|
||||
|
||||
const handleMessage = (result) => {
|
||||
bus.emit('getMessageData');
|
||||
|
||||
const { t } = useI18n();
|
||||
key = result.messageId || `open${Date.now()}`;
|
||||
|
||||
if (result.messageTitle || result.abstractContent || result.messageContent) {
|
||||
notification.open({
|
||||
message: ``,
|
||||
key,
|
||||
class: NOTIFICATION_CLS,
|
||||
description: notificationContent(result, t),
|
||||
// duration: 10000,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default handleMessage;
|
@ -0,0 +1,187 @@
|
||||
import { useHttp } from '@crami/http';
|
||||
import { getInfo, ICP_CONFIG } from '@/utils/commMethods';
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { h, ref } from 'vue';
|
||||
import { UserOutlined } from '@ant-design/icons-vue';
|
||||
import bus from '@/utils/bus';
|
||||
import router from '@/router';
|
||||
import { message } from '@crami/ui';
|
||||
|
||||
import _store from '@/store/index';
|
||||
|
||||
let socket = null;
|
||||
const messageUrl = ref();
|
||||
const getUrl = async () => {
|
||||
const data = await useHttp({
|
||||
url: '/api/msg/serverUrl/getWebsocketServerUrl',
|
||||
method: 'get',
|
||||
});
|
||||
if (data.code === 200) {
|
||||
return data.data;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
//处理消息弹窗内容,返回innerhtml
|
||||
const handleMessageData = (messageContentParams, messageContentUrlParams) => {
|
||||
if (!messageContentUrlParams) return;
|
||||
let messageContent = messageContentParams;
|
||||
const messageUrl = JSON.parse(messageContentUrlParams);
|
||||
for (const i in messageUrl) {
|
||||
const reg = new RegExp(`\%${i}\%`, 'g');
|
||||
messageContent = messageContent.replace(
|
||||
reg,
|
||||
`<a href='javascript:void(0)' onclick="aClic('` +
|
||||
messageUrl[i].name +
|
||||
`')">` +
|
||||
messageUrl[i].name +
|
||||
`</a>`,
|
||||
);
|
||||
}
|
||||
window.aClic = aClic;
|
||||
return messageContent;
|
||||
};
|
||||
const aClic = e => {
|
||||
for (const i in messageUrl.value) {
|
||||
if (messageUrl.value[i].name == e) {
|
||||
console.log(messageUrl.value[i].params);
|
||||
if (messageUrl.value[i]?.url.includes('/changeManage/changeManageMainPage')) {
|
||||
router.push({
|
||||
name: 'changeNoticeInspectorRouter',
|
||||
query: {
|
||||
objectEID: messageUrl.value[i].params,
|
||||
},
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
router.push({
|
||||
path: messageUrl.value[i].url,
|
||||
query: {
|
||||
key: JSON.stringify(messageUrl.value[i].params),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const setSocket = async (opts = {}) => {
|
||||
if (socket && [socket.CONNECTING, socket.OPEN].includes(socket.readyState)) return;
|
||||
const router = opts.router;
|
||||
const userInfo = getInfo(ICP_CONFIG);
|
||||
const socketUrl = await getUrl();
|
||||
if (!userInfo || !socketUrl) return;
|
||||
const URL = `${socketUrl}${userInfo.user_id}`;
|
||||
socket = new WebSocket(URL);
|
||||
socket.addEventListener('message', event => {
|
||||
const { data } = event;
|
||||
bus.emit('getMessageData');
|
||||
let result: Record<string, any> = {};
|
||||
try {
|
||||
result = JSON.parse(data);
|
||||
} catch (e) {
|
||||
// TODO
|
||||
}
|
||||
const key = result.messageId || `open${Date.now()}`;
|
||||
if (result.messageTitle || result.abstractContent || result.messageContent) {
|
||||
//0830 处理content数据
|
||||
const messageContentData = handleMessageData(result.messageContent, result.messageContentUrl);
|
||||
if (result.messageContentUrl) {
|
||||
messageUrl.value = JSON.parse(result.messageContentUrl);
|
||||
}
|
||||
notification.open({
|
||||
message: ``,
|
||||
key,
|
||||
description: h(
|
||||
'div',
|
||||
{
|
||||
fontSize: '14px',
|
||||
fontWeight: '900',
|
||||
onClick: e => {
|
||||
if (e.target.nodeName !== 'A') {
|
||||
notification.close(key);
|
||||
const allowRouters = _store.getters['user/allowRouters'] || [];
|
||||
// 存在消息中心导航菜单
|
||||
const messageCenter = allowRouters.find(route => route.name === 'MessageCenter');
|
||||
// 存在我收到的导航菜单
|
||||
if (
|
||||
messageCenter &&
|
||||
messageCenter?.meta?.frontHidden !== true &&
|
||||
messageCenter.children && messageCenter.children.length
|
||||
) {
|
||||
const receivedMsgPage = messageCenter.children.find(route => route.name === 'ReceivedMsg');
|
||||
if (receivedMsgPage && receivedMsgPage?.meta?.frontHidden !== true) {
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: `/platform/Message/MessageCenter/ReceivedMsg/Index`,
|
||||
query: {
|
||||
activeKey: result.msgType,
|
||||
eid: result.msgReceivedEid,
|
||||
},
|
||||
});
|
||||
}, 300);
|
||||
} else {
|
||||
message.warning(`“消息中心-我收到的”菜单未授权`);
|
||||
}
|
||||
} else {
|
||||
message.warning(`“消息中心-我收到的”菜单未授权`);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// e.preventDefault()
|
||||
// }
|
||||
},
|
||||
},
|
||||
[
|
||||
h('div', { style: { display: 'flex', width: '100%', marginBottom: '10px' } }, [
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
style: { width: `50px`, fontSize: '30px' },
|
||||
},
|
||||
[h(UserOutlined, { style: 'color: #108ee9' })],
|
||||
),
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
style: { width: `calc(100% - 50px)`, lineHeight: '50px' },
|
||||
},
|
||||
`[一条新消息]`,
|
||||
),
|
||||
]),
|
||||
h('p', { innerHTML: `标题: ${result?.messageTitle}` }),
|
||||
h('p', { innerHTML: `摘要: ${result?.abstractContent}` }),
|
||||
result.messageContent && messageContentData
|
||||
? h('p', { innerHTML: `内容: ${messageContentData}` })
|
||||
: null,
|
||||
// h('div', { style: { display: 'flex', width: '100%', marginTop: '10px' } }, [
|
||||
// h(
|
||||
// Button,
|
||||
// {
|
||||
// style: { width: `40%` },
|
||||
// onClick: () => {
|
||||
// console.log('业务联查1');
|
||||
// },
|
||||
// },
|
||||
// `业务联查1`,
|
||||
// ),
|
||||
// h(
|
||||
// Button,
|
||||
// {
|
||||
// style: { width: `40%` },
|
||||
// onClick: () => {
|
||||
// console.log('业务联查2');
|
||||
// },
|
||||
// },
|
||||
// `业务联查2`,
|
||||
// ),
|
||||
// ]),
|
||||
],
|
||||
),
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const closeSocket = async () => {
|
||||
socket.close();
|
||||
};
|
||||
export { setSocket, closeSocket };
|
@ -0,0 +1,42 @@
|
||||
// 业务联查功能使用时socket切换到该文件
|
||||
import { useHttp } from '@crami/http';
|
||||
import { getInfo, ICP_CONFIG } from '@/utils/commMethods';
|
||||
// import handleMessage from './messageHandle';
|
||||
|
||||
let socket = null;
|
||||
const getUrl = async () => {
|
||||
const data = await useHttp({
|
||||
url: '/api/msg/serverUrl/getWebsocketServerUrl',
|
||||
method: 'get',
|
||||
});
|
||||
if (data.code === 200) {
|
||||
return data.data;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const setSocket = async (opts = {}) => {
|
||||
if (socket && [socket.CONNECTING, socket.OPEN].includes(socket.readyState)) return;
|
||||
const router = opts.router;
|
||||
const userInfo = getInfo(ICP_CONFIG);
|
||||
const socketUrl = await getUrl();
|
||||
if (!userInfo || !socketUrl) return;
|
||||
const URL = `${socketUrl}${userInfo.user_id}`;
|
||||
socket = new WebSocket(URL);
|
||||
socket.addEventListener('message', event => {
|
||||
const { data } = event;
|
||||
let result: Record<string, any> = {};
|
||||
try {
|
||||
result = JSON.parse(data);
|
||||
} catch (e) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// handleMessage(result);
|
||||
});
|
||||
};
|
||||
const closeSocket = async () => {
|
||||
socket.close();
|
||||
};
|
||||
export { setSocket, closeSocket };
|
71
packages/icpx-platform/src/api/platform/ImpExp/Export.ts
Normal file
71
packages/icpx-platform/src/api/platform/ImpExp/Export.ts
Normal file
@ -0,0 +1,71 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
export interface saveData {
|
||||
ObjectType: string;
|
||||
companyId: string;
|
||||
connect: string;
|
||||
data: {
|
||||
ECODE: string;
|
||||
EID: string;
|
||||
ENAME: string;
|
||||
EXPORTTYPE: string;
|
||||
FILETYPE: string;
|
||||
MAXCOUNT: string;
|
||||
SETTING: string;
|
||||
STATE: string;
|
||||
TEMPLATE: string;
|
||||
};
|
||||
lang: string;
|
||||
mode: string;
|
||||
modelName: string;
|
||||
newObject: string;
|
||||
objectID: string;
|
||||
productLine: string;
|
||||
projectCode: string;
|
||||
type: string;
|
||||
userId: string;
|
||||
}
|
||||
export async function saveDataAPI(data: any) {
|
||||
return await useHttp({
|
||||
url: '/system/model/saveObjectData',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: {
|
||||
//根据接扣文档需要加的请求头
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export interface editData {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
objectID: string;
|
||||
// projectCode: string;
|
||||
// userDept: string;
|
||||
// userGroup: string;
|
||||
// userId: string;
|
||||
}
|
||||
export async function editDataAPI(data: editData) {
|
||||
return await useHttp({
|
||||
url: '/system/model/GetObjectDataTestList',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export interface deleteRule {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
eidstr: string[];
|
||||
}
|
||||
export async function deleteRuleAPI(data: deleteRule) {
|
||||
return await useHttp({
|
||||
url: '/exportservice/exportMaintain/deleteRule',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
149
packages/icpx-platform/src/api/platform/ImpExp/Import.ts
Normal file
149
packages/icpx-platform/src/api/platform/ImpExp/Import.ts
Normal file
@ -0,0 +1,149 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
export interface saveData {
|
||||
ObjectType: string;
|
||||
companyId: string;
|
||||
connect: string;
|
||||
data: {
|
||||
ECODE: string;
|
||||
EID: string;
|
||||
ENAME: string;
|
||||
ERROPTION: string;
|
||||
FILETYPE: string;
|
||||
MAXCOUNT: string;
|
||||
SETTING: string;
|
||||
STATEID: string;
|
||||
TEMPLATE: string;
|
||||
};
|
||||
lang: string;
|
||||
mode: string;
|
||||
modelName: string;
|
||||
newObject: string;
|
||||
objectID: string;
|
||||
productLine: string;
|
||||
projectCode: string;
|
||||
type: string;
|
||||
userId: string;
|
||||
}
|
||||
export async function saveDataAPI(data: saveData) {
|
||||
return await useHttp({
|
||||
url: '/system/model/saveObjectData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export interface editData {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
objectID: string;
|
||||
// userId: string;
|
||||
}
|
||||
export async function editDataAPI(data: editData) {
|
||||
return await useHttp({
|
||||
url: '/system/model/GetObjectDataTestList',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// sheet页
|
||||
export interface analysis {
|
||||
dataList: any;
|
||||
dataCache: string; //可以为空
|
||||
companyId: string;
|
||||
objectID: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
userId: string;
|
||||
}
|
||||
export async function analysisTableAPI(data: analysis) {
|
||||
return await useHttp({
|
||||
url: '/importservice/importMaintain/getSheetNameTab',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//校验
|
||||
export interface analysis2 {
|
||||
dataList: any;
|
||||
dataCache: string; //可以为空
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
userId: string;
|
||||
}
|
||||
export async function verifyDataAPI(data: analysis2) {
|
||||
return await useHttp({
|
||||
url: '/importservice/import/checkData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//解析
|
||||
export interface analysisData {
|
||||
fileId: string;
|
||||
dataList: any;
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
userId: string;
|
||||
}
|
||||
export async function analysisDataAPI(data: analysisData) {
|
||||
return await useHttp({
|
||||
url: '/importservice/import/extractData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//下载获取文件id
|
||||
export async function getFileId(data: analysis) {
|
||||
return await useHttp({
|
||||
url: '/importservice/importMaintain/getFileId',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//导入
|
||||
export interface importErrList {
|
||||
ecode: string; //编码 导入按钮上默认配置
|
||||
dataCache: string; //数据缓存key
|
||||
customValid: [];
|
||||
companyId: string;
|
||||
connect: string;
|
||||
userId: string;
|
||||
lang: string;
|
||||
}
|
||||
export async function importErrListAPI(data: importErrList) {
|
||||
return await useHttp({
|
||||
url: '/importservice/import/saveData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export interface ExpRule {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
lang: string;
|
||||
objectType: string;
|
||||
dataRoute: string;
|
||||
dataCache: string;
|
||||
viewName: string;
|
||||
isAll: string;
|
||||
eids: [];
|
||||
}
|
||||
|
||||
export async function ExpDataAPI(data: ExpRule) {
|
||||
return await useHttp({
|
||||
url: '/exportservice/export/exportGridData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
29
packages/icpx-platform/src/api/platform/ImpExp/expGuide.ts
Normal file
29
packages/icpx-platform/src/api/platform/ImpExp/expGuide.ts
Normal file
@ -0,0 +1,29 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
export interface ExpRule {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
filter: [
|
||||
{
|
||||
andOrFlag: string;
|
||||
field: string;
|
||||
operation: string;
|
||||
value: string;
|
||||
},
|
||||
];
|
||||
lang: string;
|
||||
objectType: string;
|
||||
page: number;
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
data: any;
|
||||
}
|
||||
|
||||
export async function ExpDataAPI(data: ExpRule) {
|
||||
return await useHttp({
|
||||
url: '/exportservice/export/exportGridData',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
43
packages/icpx-platform/src/api/platform/ImpExp/upload.ts
Normal file
43
packages/icpx-platform/src/api/platform/ImpExp/upload.ts
Normal file
@ -0,0 +1,43 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
export interface fileUpload {
|
||||
file: string;
|
||||
filePath: string;
|
||||
fileShowName: string;
|
||||
}
|
||||
export async function FileUploadAPI(data: any) {
|
||||
return await useHttp({
|
||||
url: '/api/file/applicationFile/upload',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export interface downloadUrl {
|
||||
fileId: string;
|
||||
}
|
||||
export async function downloadUrlAPI(fileId: string) {
|
||||
return await useHttp({
|
||||
url: `/api/file/applicationFile/template/downloadUrl/${fileId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export interface soleData {
|
||||
Data: {
|
||||
coding: string;
|
||||
};
|
||||
NewObject: boolean;
|
||||
connect: string;
|
||||
lang: string;
|
||||
objectID: string;
|
||||
objectType: string;
|
||||
}
|
||||
export async function soleDataAPI(data: soleData) {
|
||||
return await useHttp({
|
||||
url: '/api/system/model/CheckObjectUnique',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
30
packages/icpx-platform/src/api/platform/auth/index.ts
Normal file
30
packages/icpx-platform/src/api/platform/auth/index.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
interface SaveMenu {
|
||||
lang: string;
|
||||
connect: string;
|
||||
companyId: string;
|
||||
objectId: string;
|
||||
appId: string;
|
||||
permissionType: string; // PC/MOBILE/API
|
||||
userId: string;
|
||||
data: Array<any>;
|
||||
}
|
||||
|
||||
// 获取授权应用
|
||||
export async function getApplication() {
|
||||
return request.request<any, any>({
|
||||
url: '/system/fun/getApplication',
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
// 授权菜单保存
|
||||
export async function saveMenu(data: SaveMenu) {
|
||||
return await useHttp({
|
||||
url: '/api/menupermission/menuPer/saveMenuPer',
|
||||
method: 'post',
|
||||
params: data,
|
||||
});
|
||||
}
|
52
packages/icpx-platform/src/api/platform/demo/demoList.ts
Normal file
52
packages/icpx-platform/src/api/platform/demo/demoList.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
interface MetaData {
|
||||
EID: string;
|
||||
ECODE: string;
|
||||
ENAME: string;
|
||||
PUBLISHER: string;
|
||||
PUBLISHDATE: string;
|
||||
}
|
||||
|
||||
export interface RegisterResp {
|
||||
data: Record<any, any>;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
interface deleteData {
|
||||
EID: string;
|
||||
}
|
||||
|
||||
// 新增
|
||||
export async function addList(data: MetaData) {
|
||||
return request.request<MetaData, RegisterResp>({
|
||||
url: '/practice/tclBook/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询
|
||||
export async function searchList(data: MetaData) {
|
||||
return request.request<MetaData, RegisterResp>({
|
||||
url: '/practice/tclBook/list ',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteList(data: deleteData) {
|
||||
return request.request<deleteData, RegisterResp>({
|
||||
url: '/practice/tclBook/delete',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateList(data: MetaData) {
|
||||
return request.request<MetaData, RegisterResp>({
|
||||
url: '/practice/tclBook/update',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
15
packages/icpx-platform/src/api/platform/dict/dict.ts
Normal file
15
packages/icpx-platform/src/api/platform/dict/dict.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
project: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function getByProjectAndType(data: MetaData) {
|
||||
return request.request<MetaData, any>({
|
||||
url: '/studio-cache/page/getMetaInfo',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
17
packages/icpx-platform/src/api/platform/fileService/dict.ts
Normal file
17
packages/icpx-platform/src/api/platform/fileService/dict.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { commonApi } from '@/api/commonApi';
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function getByProjectAndType(params: MetaData) {
|
||||
return useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
interface saveTransfer {
|
||||
transferStrategyName: string;
|
||||
transferStrategyDescription: string;
|
||||
transferStrategyCode: string;
|
||||
inUse: string;
|
||||
eid: string;
|
||||
strategyList: Array<any>;
|
||||
companyId: string;
|
||||
}
|
||||
|
||||
interface deleteTransferr {
|
||||
eidList: Array<any>;
|
||||
}
|
||||
|
||||
interface getOneTransfer {
|
||||
eid: string;
|
||||
}
|
||||
|
||||
//替换当前版本
|
||||
|
||||
export async function getPluginList() {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/transfer/getPluginList',
|
||||
});
|
||||
}
|
||||
|
||||
// 传输策略新增
|
||||
|
||||
export async function saveTransfer(params: saveTransfer) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/transfer/saveTransfer',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 传输策略编辑
|
||||
|
||||
export async function editTransfer(params: saveTransfer) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/transfer/editTransfer',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 传输策略编辑回显
|
||||
|
||||
export async function getOneTransfer(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/transfer/getOneTransfer?eid=' + eid,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
export async function deleteTransferr(params: deleteTransferr) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/transfer/deleteTransfer',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getList() {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/transfer/getPluginList',
|
||||
});
|
||||
}
|
||||
|
||||
// 拓展插件删除
|
||||
|
||||
export async function deleteExtensions(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/transfer/deleteExtensions?eid=' + eid,
|
||||
});
|
||||
}
|
||||
|
||||
// 1.查看插件详情
|
||||
export async function getExtensionsDetail(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/transfer/getExtensionsDetail/${eid}`,
|
||||
});
|
||||
}
|
274
packages/icpx-platform/src/api/platform/fileService/operation.ts
Normal file
274
packages/icpx-platform/src/api/platform/fileService/operation.ts
Normal file
@ -0,0 +1,274 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
|
||||
interface createFileVolume {
|
||||
appCode: string;
|
||||
volumeCode: string;
|
||||
volumeName: string;
|
||||
volumeDescription: string;
|
||||
storageCode: string;
|
||||
}
|
||||
interface editFileVolume {
|
||||
eid: string;
|
||||
appCode: string;
|
||||
volumeCode: string;
|
||||
volumeName: string;
|
||||
volumeDescription: string;
|
||||
storageCode: string;
|
||||
}
|
||||
|
||||
interface editApplication {
|
||||
eid: string;
|
||||
appCode: string;
|
||||
appName: string;
|
||||
appDescription: string;
|
||||
}
|
||||
|
||||
interface createApplication {
|
||||
appCode: string;
|
||||
appName: string;
|
||||
appDescription: string;
|
||||
}
|
||||
|
||||
interface deleteFileVolume {
|
||||
EID: string;
|
||||
}
|
||||
|
||||
interface fileList {
|
||||
eid: string;
|
||||
appCode: string;
|
||||
volumeCode: string;
|
||||
filePath: string;
|
||||
fileShowName: string;
|
||||
fileDescription: string;
|
||||
versionCode: string;
|
||||
metaInfo: string;
|
||||
expiresOn: string;
|
||||
isgeneralfile: string;
|
||||
}
|
||||
|
||||
interface createExtensions {
|
||||
eid: string;
|
||||
extensionName: string; //插件名称
|
||||
extensionDescription: string; //插件描述
|
||||
extensionId: string; //插string;件标识
|
||||
serviceCode: string; //服务标识
|
||||
inUse: string; //是否启用
|
||||
fileTypes: string; //文件类型
|
||||
}
|
||||
|
||||
interface createStorage {
|
||||
eid: string;
|
||||
storageName: string; //存储名称
|
||||
storageDescription: string; //存储描述
|
||||
states: string; //状态
|
||||
accAddress: string; //地址
|
||||
accUser: string; //用户
|
||||
accPwd: string; //密码
|
||||
}
|
||||
|
||||
/*
|
||||
新建文件卷
|
||||
*/
|
||||
|
||||
export async function createFileVolume(params: createFileVolume) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/fileVolume/createFileVolume',
|
||||
params,
|
||||
});
|
||||
}
|
||||
/*
|
||||
编辑文件卷
|
||||
*/
|
||||
|
||||
export async function editFileVolume(params: editFileVolume) {
|
||||
return await useHttp({
|
||||
method: 'put',
|
||||
url: '/api/file/fileVolume/editFileVolume',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
删除文件卷
|
||||
*/
|
||||
|
||||
export async function deleteFileVolume(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/fileVolume/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
新建文件卷获取主存储集群数据
|
||||
*/
|
||||
|
||||
export async function duplicationStrategy() {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/storage/getOtherStrategy',
|
||||
});
|
||||
}
|
||||
/*
|
||||
编辑文件卷回显主集群数据
|
||||
*/
|
||||
|
||||
export async function getDetail(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/fileVolume/getDetailMsg/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
//删除历史版本
|
||||
|
||||
export async function deleteHistory(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'delete',
|
||||
url: `/api/file/applicationFile/deleteHistoryFile/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
//替换当前版本
|
||||
|
||||
export async function updateHistory(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/applicationFile/changeHistoryVersion/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 新增应用仓库
|
||||
|
||||
export async function createApplication(params: createApplication) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/applications/createApplication',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑应用仓库
|
||||
|
||||
export async function editApplication(params: editApplication) {
|
||||
return await useHttp({
|
||||
method: 'put',
|
||||
url: '/api/file/applications/editApplication',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除应用仓库
|
||||
export async function deleteApplication(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'delete',
|
||||
url: `/api/file/applications/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 新建文件信息保存
|
||||
|
||||
export async function createApplicationFile(params: fileList) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/applicationFile/createApplicationFile',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑文件信息保存
|
||||
|
||||
export async function editApplicationFile(params: fileList) {
|
||||
return await useHttp({
|
||||
method: 'put',
|
||||
url: '/api/file/applicationFile/editApplicationFile',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除文件信息列表
|
||||
|
||||
export async function applicationFile(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'delete',
|
||||
url: `/api/file/applicationFile/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 存储结构禁用
|
||||
|
||||
export async function changeStateDisable(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/storage/changeStateDisable/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 存储结构启用
|
||||
export async function changeStateEnable(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/storage/changeStateEnable/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 传输策略启用
|
||||
export async function transferEnable(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/transfer/changeStateEnable/${eid}`,
|
||||
});
|
||||
}
|
||||
// 传输策略禁用
|
||||
export async function transferDisable(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/transfer/changeStateDisable/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
// 插件管理新增保存
|
||||
export async function createExtensions(params: createExtensions) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/transfer/createExtensions',
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 插件管理编辑保存
|
||||
|
||||
export async function editExtensions(params: createExtensions) {
|
||||
return await useHttp({
|
||||
method: 'put',
|
||||
url: '/api/file/transfer/editExtensions',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 存储结构新增保存
|
||||
|
||||
export async function createStorage(params: createStorage) {
|
||||
return await useHttp({
|
||||
method: 'post',
|
||||
url: '/api/file/storage/createStorage',
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 存储结构编辑保存
|
||||
export async function editStorage(params: createStorage) {
|
||||
return await useHttp({
|
||||
method: 'put',
|
||||
url: '/api/file/storage/editStorage',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 存储结构管理删除
|
||||
export async function deleteStorage(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'delete',
|
||||
url: `/api/file/storage/Storage/${eid}`,
|
||||
});
|
||||
}
|
102
packages/icpx-platform/src/api/platform/fileService/select.ts
Normal file
102
packages/icpx-platform/src/api/platform/fileService/select.ts
Normal file
@ -0,0 +1,102 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
import { commonApi } from '@/api/commonApi/index';
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
name: string;
|
||||
mode: string;
|
||||
}
|
||||
|
||||
export interface treeData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
// name: string;
|
||||
loadAll: boolean;
|
||||
objectType: string;
|
||||
treeViewName: string;
|
||||
userDept: string;
|
||||
userGroup: string;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export async function getSelectData(params: MetaData) {
|
||||
return await useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function storageListAPI() {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: '/api/file/storage/getVolumeAcquireDuplicationStrategy',
|
||||
});
|
||||
}
|
||||
|
||||
export async function storageChildListAPI(eid: string) {
|
||||
return await useHttp({
|
||||
method: 'get',
|
||||
url: `/api/file/storage/getOtherStorage/${eid}`,
|
||||
});
|
||||
}
|
||||
|
||||
export interface saveData {
|
||||
eid: string;
|
||||
mainStorageName: string;
|
||||
mainStorageId: string; //主存储集群标识
|
||||
duplicationParam: string; //调度参数
|
||||
duplicationMode: string; //启动方式
|
||||
inUse: string; //启用中
|
||||
expiresMode: string; //过期策略
|
||||
blockMode: string; //阻塞模式
|
||||
expiresTimeLong: string; //任务超时时间
|
||||
mayFailTime: string; //默认重试次数
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
sequenceList: {};
|
||||
}
|
||||
|
||||
export async function saveDataAPI(params: saveData) {
|
||||
return await useHttp({
|
||||
url: '/api/file/duplicationStrategy/saveDuplicationStrategy',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function showListAPI(storageId) {
|
||||
return await useHttp({
|
||||
url: `/api/file/orgStorage/${storageId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export interface saveList {
|
||||
storageId: string;
|
||||
organizationIds: string[];
|
||||
}
|
||||
|
||||
export async function saveDataListAPI(params: saveList) {
|
||||
return await useHttp({
|
||||
url: '/api/file/orgStorage/saveOrgStorage',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getDuplicationAPI() {
|
||||
return await useHttp({
|
||||
url: '/api/file/duplicationStrategy/getDuplicationStrategy',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export async function getByProjectAndType(params: treeData) {
|
||||
return useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
// import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
import { commonApi } from '@/api/commonApi/index';
|
||||
|
||||
interface uploadFile {
|
||||
eid: string;
|
||||
filePath: string;
|
||||
fileShowName: string;
|
||||
fileDescription: string;
|
||||
versionCode: string;
|
||||
metaInfo: string;
|
||||
}
|
||||
|
||||
interface uploadFinished {
|
||||
eid: string;
|
||||
storageId: string;
|
||||
bucketCode: string;
|
||||
objectCode: string;
|
||||
fileId: string;
|
||||
templateUrl: string;
|
||||
fileShowName: string;
|
||||
versionCode: string;
|
||||
}
|
||||
|
||||
interface downloadUrl {
|
||||
fileId: string;
|
||||
}
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
name: string;
|
||||
mode: string;
|
||||
}
|
||||
|
||||
export async function getByProjectAndType(params: MetaData) {
|
||||
return await useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function uploadFile(params: uploadFile) {
|
||||
return await useHttp({
|
||||
url: '/api/file/applicationFile/template/uploadUrl',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function uploadFinished(params: uploadFinished) {
|
||||
return await useHttp({
|
||||
url: '/api/file/applicationFile/template/uploadFinished',
|
||||
method: 'put',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function downloadUrl(fileId: string) {
|
||||
return await useHttp({
|
||||
url: `/api/file/applicationFile/template/downloadUrl/${fileId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export async function uploadMessage(eid: string) {
|
||||
return await useHttp({
|
||||
url: `/api/file/applicationFile/getOneFile/${eid}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
|
144
packages/icpx-platform/src/api/platform/lifeCycle/index.ts
Normal file
144
packages/icpx-platform/src/api/platform/lifeCycle/index.ts
Normal file
@ -0,0 +1,144 @@
|
||||
//import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
import { commonApi } from '@/api/commonApi/index';
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function getLifeCycleData(params: MetaData) {
|
||||
return useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取生命周期状态分组
|
||||
export async function getLiftStatusList(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/getLifeStatusList',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取生命周期详情
|
||||
export async function getLiftCycleInfo(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeCycle/getLifeCircleById',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取使用对象数据
|
||||
export async function getModelList(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeCycle/getModelList',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 保存生命周期
|
||||
export async function saveLifeCircleData(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeCycle/saveLifeCircleData',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 删除生命周期
|
||||
export async function deleteLifeCircleDatas(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeCycle/deleteLifeCircleData',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 删除生命周期校验
|
||||
export async function deleteLifeCircleCheck(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeCycle/deleteLifeCircleCheck',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//删除状态列表
|
||||
export async function deleteState(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/deleteLifeStatus',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//删除状态列表校验
|
||||
export async function checkDeleteState(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/checkDelete',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取节点插件数据
|
||||
export async function getLifeCyclePlugins(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/getLifeCyclePlugins',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//获取状态分类下拉列表
|
||||
export async function getStateTypeList(params: any) {
|
||||
return useHttp({
|
||||
//commonApi().system.getSltData.url
|
||||
url: commonApi().system.getSltData.url,
|
||||
method: commonApi().system.getSltData.method,
|
||||
params,
|
||||
});
|
||||
}
|
||||
//保存生命周期状态
|
||||
export async function saveState(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/saveLifeStatus',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//获取多语言列表
|
||||
export async function getLangList(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/getMutilLanuageList',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//上传文件
|
||||
export async function uploadFile(data: any) {
|
||||
return useHttp({
|
||||
url: '/api/file/applicationFile/upload',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
//获取单条数据
|
||||
export async function getData(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/getSingleData',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//ID唯一性校验
|
||||
export async function checkIDUnique(params: any) {
|
||||
return useHttp({
|
||||
url: '/api/lifecycle/lifeStatus/checkObjectUnique',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
import { commonApi } from '@/api/commonApi/index';
|
||||
|
||||
export interface MetaData {
|
||||
type: string;
|
||||
productLine: string;
|
||||
name: string;
|
||||
}
|
||||
export interface UserData {
|
||||
lang: string;
|
||||
connect: string;
|
||||
companyId: string;
|
||||
data: { id: string; ids: string };
|
||||
}
|
||||
|
||||
export async function getByProjectAndType(params: MetaData) {
|
||||
return useHttp({
|
||||
url: commonApi().studioCache.getMetaInfo.url,
|
||||
method: commonApi().studioCache.getMetaInfo.method,
|
||||
params,
|
||||
});
|
||||
}
|
||||
export async function saveUser(params: UserData) {
|
||||
return useHttp({
|
||||
url: '/system/dept/saveUser',
|
||||
method: 'post',
|
||||
params,
|
||||
});
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface getUserSetData {
|
||||
}
|
||||
|
||||
export interface UserSetData {
|
||||
// ENAME: string;
|
||||
// USER_EMAIL: string;
|
||||
// POST_IDS: string;
|
||||
// USER_PHONE: string;
|
||||
// USER_ADDRESS: string;
|
||||
// AVATAR: string;
|
||||
// PREFER:boolean;
|
||||
// data:any;
|
||||
// NewObject:boolean;
|
||||
// ObjectType:string;
|
||||
}
|
||||
|
||||
export interface UserSetResp {
|
||||
data: Record<any, any>;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateUserPassword {
|
||||
|
||||
|
||||
}
|
||||
|
||||
//获取用户设置信息
|
||||
export async function getUserSetting() {
|
||||
return request.request<getUserSetData, UserSetResp>({
|
||||
url: '/system/user/getUseInfo',
|
||||
method: 'GET',
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
//更新用户信息,更新用户偏好选择
|
||||
export async function updateUserSetting(data: UserSetData) {
|
||||
return request.request<UserSetData, UserSetResp>({
|
||||
url: '/system/user/saveUserData',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
//更新登录密码
|
||||
export async function updateUserPassword(data: UpdateUserPassword) {
|
||||
return request.request<UpdateUserPassword, UserSetResp>({
|
||||
url: '/system/user/updatePwd',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function getLoginPageInfo() {
|
||||
return request.get<any, any>('/system/loginPageElement/GetLoginPageInfo');
|
||||
}
|
||||
|
||||
export async function saveLoginPageInfo(params) {
|
||||
return request.post<any, any>('/system/loginPageElement/saveLoginPageInfo', params);
|
||||
}
|
149
packages/icpx-platform/src/api/platform/user/login.ts
Normal file
149
packages/icpx-platform/src/api/platform/user/login.ts
Normal file
@ -0,0 +1,149 @@
|
||||
import request from '@/utils/request';
|
||||
import { useHttp } from '@crami/http';
|
||||
export type LoginData = 'account' | 'telephone';
|
||||
export type LoginStatus = 'ok' | 'error';
|
||||
import { commonApi } from '@/api/commonApi';
|
||||
|
||||
export interface LoginParams {
|
||||
username: string;
|
||||
password: string;
|
||||
code: string;
|
||||
uuid: string;
|
||||
loginMode?: string;
|
||||
}
|
||||
|
||||
export interface LoginResp {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
// currentAuthority: string;
|
||||
}
|
||||
|
||||
export interface UserInfo {
|
||||
companyId: string;
|
||||
connect: string;
|
||||
avatar: string;
|
||||
lang: string;
|
||||
user_id: string;
|
||||
user_name: string;
|
||||
email: string;
|
||||
group: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
signature: string;
|
||||
user_type: string;
|
||||
role: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
export interface CaptchaResp {
|
||||
captcha: number;
|
||||
}
|
||||
|
||||
export interface SmsCaptchaRequest {
|
||||
mobile: string;
|
||||
}
|
||||
|
||||
// 后端的结构体定义
|
||||
export type RouteItem = {
|
||||
id: number | string;
|
||||
parentId: number | string;
|
||||
name: string;
|
||||
path: string;
|
||||
redirect: string;
|
||||
component: string;
|
||||
meta: {
|
||||
title: string | false;
|
||||
icon?: string;
|
||||
target?: '_blank' | '_self';
|
||||
hideInMenu?: boolean;
|
||||
hideChildrenInMenu?: boolean;
|
||||
authority?: string | string[];
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
|
||||
export interface PermissionRequest {
|
||||
lang: string;
|
||||
objectId: string;
|
||||
productLine: string;
|
||||
companyId: string;
|
||||
connect: string;
|
||||
userType: string;
|
||||
userName: string;
|
||||
orgId: string;
|
||||
projectCode: string;
|
||||
permissionType: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
export async function getLoginCode() {
|
||||
return request.get<any, any>('/code');
|
||||
}
|
||||
|
||||
export async function getTenant() {
|
||||
return request.get<any, any>('/system/tenant/getTenant');
|
||||
}
|
||||
|
||||
export async function postAccountLogin(params: LoginParams) {
|
||||
return request.post<LoginParams, LoginResp>('/auth/login', params);
|
||||
}
|
||||
|
||||
// 获取组织列表接口
|
||||
export async function getOrgByUserName(params) {
|
||||
return request.post<any, any>('/system/org/getOrgByUserName', params);
|
||||
}
|
||||
|
||||
export async function getLoginOrg() {
|
||||
return request.get<any, any>('/system/org/getOrg');
|
||||
}
|
||||
|
||||
export async function getCurrentUser(info: any) {
|
||||
return request.get<any, UserInfo>('/system/user/getUseInfo', { params: info });
|
||||
}
|
||||
|
||||
export async function getProjectRoutes(info: any) {
|
||||
const method = commonApi().studioCache.getByProjectAndType.method;
|
||||
const url = commonApi().studioCache.getByProjectAndType.url;
|
||||
return request[method]<any, any>(url.replace('/api', ''), { params: info });
|
||||
}
|
||||
|
||||
export async function getCurrentUserNav() {
|
||||
return request.get<any, RouteItem[]>('/currentUserNav');
|
||||
}
|
||||
|
||||
// export async function postLogout() {
|
||||
// return request.delete<any, any>('/auth/logout');
|
||||
// }
|
||||
|
||||
export async function postLogout(isClear) {
|
||||
const url = isClear ? '/api/auth/logout/1' : '/api/auth/logout/0';
|
||||
return await useHttp({
|
||||
method: 'delete',
|
||||
url: url,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getSmsCaptcha(params: SmsCaptchaRequest) {
|
||||
return request.get<SmsCaptchaRequest, CaptchaResp>('/message/captcha/sms', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前用户的导航和menu权限
|
||||
export async function getPermissionData(params: PermissionRequest) {
|
||||
return request.post<any, any>('/menuperservice/function/getPermissionData', params);
|
||||
}
|
||||
|
||||
// 获取当前用户的导航和menu权限
|
||||
export async function changeOrgIdOfUserInRedis(params: any) {
|
||||
return request.post<any, any>('/auth/changeOrgIdOfUserInRedis', params);
|
||||
}
|
||||
|
||||
// 根据当前用户获取默认的登录方式
|
||||
export async function getLoginModeByUserName(params: any) {
|
||||
return request.post<any, any>('/system/org/getLoginModeByUserName', params);
|
||||
}
|
27
packages/icpx-platform/src/api/platform/user/notice.ts
Normal file
27
packages/icpx-platform/src/api/platform/user/notice.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request';
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
export type NoticeIconData = {
|
||||
avatar?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
datetime?: string;
|
||||
extra?: string;
|
||||
style?: CSSProperties;
|
||||
key?: string | number;
|
||||
read?: boolean;
|
||||
};
|
||||
|
||||
export type NoticeItem = {
|
||||
id: string;
|
||||
type: string;
|
||||
status: string;
|
||||
} & NoticeIconData;
|
||||
|
||||
export async function queryNotices() {
|
||||
return request.get<any, NoticeItem[]>('/notices');
|
||||
}
|
||||
|
||||
export async function changeNoticeReadState(notices: any[]): Promise<any> {
|
||||
return request.post('/change-notices-read', notices);
|
||||
}
|
30
packages/icpx-platform/src/api/platform/user/register.ts
Normal file
30
packages/icpx-platform/src/api/platform/user/register.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface RegisterData {
|
||||
lang: string;
|
||||
connect: string;
|
||||
project: string;
|
||||
companyId: string;
|
||||
orgId: string;
|
||||
roleId: string;
|
||||
username: string;
|
||||
password: string;
|
||||
password2: string;
|
||||
userPhone: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface RegisterResp {
|
||||
data: Record<any, any>;
|
||||
success: boolean;
|
||||
code?: number | undefined;
|
||||
msg?: string | undefined;
|
||||
}
|
||||
|
||||
export async function postRegister(data) {
|
||||
return request.request({
|
||||
url: '/user/register',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
21
packages/icpx-platform/src/api/typing.ts
Normal file
21
packages/icpx-platform/src/api/typing.ts
Normal file
@ -0,0 +1,21 @@
|
||||
export interface ResponseBody<T = any> {
|
||||
message: string;
|
||||
code: number;
|
||||
data?: T | T[];
|
||||
}
|
||||
|
||||
/** 统一返回结构体 */
|
||||
|
||||
export interface PageResult<T = any> {
|
||||
data: T[];
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
total?: number;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export interface RequestResult<T = any> {
|
||||
data: T;
|
||||
success: boolean;
|
||||
errorMessage: string;
|
||||
}
|
89
packages/icpx-platform/src/api/user/login.ts
Normal file
89
packages/icpx-platform/src/api/user/login.ts
Normal file
@ -0,0 +1,89 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export type LoginType = 'account' | 'telephone';
|
||||
export type LoginStatus = 'ok' | 'error';
|
||||
|
||||
export interface LoginParams {
|
||||
type: LoginType;
|
||||
username: string;
|
||||
password: string;
|
||||
code: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface LoginResp {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
// currentAuthority: string;
|
||||
}
|
||||
|
||||
export interface UserInfo {
|
||||
user_id: string | number;
|
||||
address: string;
|
||||
avatar: string;
|
||||
country: string;
|
||||
email: string;
|
||||
group: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
signature: string;
|
||||
role: {
|
||||
[key: string]: any;
|
||||
};
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface CaptchaResp {
|
||||
captcha: number;
|
||||
}
|
||||
|
||||
export interface SmsCaptchaRequest {
|
||||
mobile: string;
|
||||
}
|
||||
|
||||
// 后端的结构体定义
|
||||
export type RouteItem = {
|
||||
id: number | string;
|
||||
parentId: number | string;
|
||||
name: string;
|
||||
path: string;
|
||||
redirect: string;
|
||||
component: string;
|
||||
meta: {
|
||||
title: string | false;
|
||||
icon?: string;
|
||||
target?: '_blank' | '_self';
|
||||
hideInMenu?: boolean;
|
||||
hideChildrenInMenu?: boolean;
|
||||
authority?: string | string[];
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
|
||||
export async function postAccountLogin(params: LoginParams) {
|
||||
return request.post<LoginParams, LoginResp>('/auth/login', params);
|
||||
}
|
||||
|
||||
// export async function getCurrentUser() {
|
||||
// return request.get<any, UserInfo>('/currentUser');
|
||||
// }
|
||||
export async function getCurrentUser(userName: string) {
|
||||
return request.get<any, UserInfo>(`/thor/user`);
|
||||
}
|
||||
|
||||
export async function getCurrentUserNav() {
|
||||
return request.get<any, RouteItem[]>('/currentUserNav');
|
||||
}
|
||||
|
||||
export async function postLogout() {
|
||||
return request.delete('/thor/user/logout');
|
||||
}
|
||||
|
||||
export async function getSmsCaptcha(params: SmsCaptchaRequest) {
|
||||
return request.get<SmsCaptchaRequest, CaptchaResp>('/message/captcha/sms', {
|
||||
params,
|
||||
});
|
||||
}
|
27
packages/icpx-platform/src/api/user/notice.ts
Normal file
27
packages/icpx-platform/src/api/user/notice.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request';
|
||||
import type { CSSProperties } from '@vue/runtime-dom';
|
||||
|
||||
export type NoticeIconData = {
|
||||
avatar?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
datetime?: string;
|
||||
extra?: string;
|
||||
style?: CSSProperties;
|
||||
key?: string | number;
|
||||
read?: boolean;
|
||||
};
|
||||
|
||||
export type NoticeItem = {
|
||||
id: string;
|
||||
type: string;
|
||||
status: string;
|
||||
} & NoticeIconData;
|
||||
|
||||
export async function queryNotices() {
|
||||
return request.get<any, NoticeItem[]>('/notices');
|
||||
}
|
||||
|
||||
export async function changeNoticeReadState(notices: any[]): Promise<any> {
|
||||
return request.post('/change-notices-read', notices);
|
||||
}
|
22
packages/icpx-platform/src/api/user/register.ts
Normal file
22
packages/icpx-platform/src/api/user/register.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export interface RegisterData {
|
||||
email: string;
|
||||
username: string;
|
||||
password: string;
|
||||
password2: string;
|
||||
captcha: string;
|
||||
}
|
||||
|
||||
export interface RegisterResp {
|
||||
data: Record<any, any>;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export async function postRegister(data: RegisterData) {
|
||||
return request.request<RegisterData, RegisterResp>({
|
||||
url: '/register',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
19
packages/icpx-platform/src/api/user/role.ts
Normal file
19
packages/icpx-platform/src/api/user/role.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request';
|
||||
import type { PageResult } from '../typing';
|
||||
import type { Permission, Role } from '@/store/modules/user/typing';
|
||||
|
||||
export async function getRoles() {
|
||||
return request.get<any, PageResult<Role>>('/roles');
|
||||
}
|
||||
|
||||
export async function getPermissions(): Promise<PageResult<Permission>> {
|
||||
return request.get<any, PageResult<Permission>>('/permissions');
|
||||
}
|
||||
|
||||
export async function addPermission(data: Permission) {
|
||||
return request.post<Permission, any>('/permission', data);
|
||||
}
|
||||
|
||||
export async function updatePermission(data: Permission) {
|
||||
return request.put<Permission, any>('/permission', data);
|
||||
}
|
Reference in New Issue
Block a user