yuang-framework-ui-common 1.0.61 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ import { alertMessageBox } from '../utils/messageBoxUtils';
10
10
 
11
11
  import { application } from '../config/applicationConfig';
12
12
  import { getSsoLoginUrl, clearSsoAccessToken, setSsoAccessToken } from '../utils/ssoUtils';
13
+ import { getIsDebug, setIsDebug } from '../utils/htmlUtils';
13
14
 
14
15
  import { clearGateway, initGateway } from '../config/gatewayConfig';
15
16
 
@@ -51,7 +52,9 @@ http.interceptors.response.use(async (res: any) => {
51
52
  showErrorMessage(messageMap.responseSturctError);
52
53
  return Promise.reject(new Error(messageMap.responseSturctError));
53
54
  }
54
- debugger
55
+ if(getIsDebug()) {
56
+ debugger
57
+ }
55
58
  if (res?.data?.statusCode !== 200) {
56
59
  // 登录过期处理
57
60
  if (res?.data?.statusCode === 401) {
@@ -0,0 +1,63 @@
1
+ /**
2
+ * 接口统一返回结果
3
+ */
4
+ export interface FrameworkJsonResult<T> {
5
+ /** 状态码 */
6
+ statusCode: number;
7
+ /** 状态信息 */
8
+ message?: string;
9
+ /** 返回数据 */
10
+ data?: T;
11
+ }
12
+
13
+ /**
14
+ * 分页查询统一结果
15
+ */
16
+ export interface FrameworkPageResult<T> {
17
+ /** 返回数据 */
18
+ records: T[];
19
+ /** 总数量 */
20
+ totalCount: number;
21
+ }
22
+
23
+ /**
24
+ * 基础属性
25
+ */
26
+ export interface FrameworkBase {
27
+ /** 用户id */
28
+ id?: string;
29
+ /** 父母id */
30
+ parentId?: string;
31
+ /** 应用id */
32
+ uimsApplicationId?: string;
33
+ sequence?: number;
34
+ remark?: string;
35
+ createUserAccount?: string;
36
+ createUserName?: string;
37
+ /** 创建时间 */
38
+ createTime?: string;
39
+ lastUpdateUserAccount?: string;
40
+ lastUpdateUserName?: string;
41
+
42
+ lastUpdateTime?: Date;
43
+ }
44
+ /**
45
+ * 基础查询基本参数
46
+ */
47
+ export interface FrameworkBaseQueryParam {
48
+ /** 第几页 */
49
+ currentPage?: number;
50
+ /** 每页多少条 */
51
+ pageSize?: number;
52
+ // /** 排序字段 */
53
+ // sort?: string;
54
+ // /** 排序方式, asc升序, desc降序 */
55
+ // order?: string;
56
+ queryFor?: string;
57
+ levelNum?: number;
58
+
59
+ /** 应用id */
60
+ uimsApplicationId?: string;
61
+ /** 上级id */
62
+ parentId?: string;
63
+ }
@@ -0,0 +1,45 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from './frameworkBase';
2
+
3
+ /**
4
+ * 配置
5
+ */
6
+ export interface FrameworkConfig extends FrameworkBase {
7
+ frameworkGroupId?: string;
8
+ /** 配置名称 */
9
+ name?: string;
10
+ /** 配置代码 */
11
+ code?: string;
12
+ /** 配置状态 */
13
+ status?: number;
14
+ /** 配置类型 */
15
+ type?: string;
16
+ /** 配置选项 */
17
+ options?: string;
18
+ optionList?: Option[];
19
+ /** 配置占据的列数 */
20
+ colspan?: number;
21
+ /** 配置默认值 */
22
+ defaultValue?: string;
23
+ /** 配置是否必填 */
24
+ isRequired?: boolean;
25
+ /** 配置值 */
26
+ value?: string;
27
+ /** 配置描述 */
28
+ description?: string;
29
+ }
30
+
31
+ interface Option {
32
+ name: string;
33
+ value: any;
34
+ }
35
+
36
+ /**
37
+ * 配置搜索条件
38
+ */
39
+ export interface FrameworkConfigQueryParam extends FrameworkBaseQueryParam {
40
+ /** 配置名称 */
41
+ nameForLike?: string;
42
+ codeForEqual?: string;
43
+ codeForLike?: string;
44
+ statusForEqual?: number;
45
+ }
@@ -0,0 +1,19 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from './frameworkBase';
2
+
3
+ /**
4
+ * 分组
5
+ */
6
+ export interface FrameworkGroup extends FrameworkBase {
7
+ /** 分组名称 */
8
+ name?: string;
9
+ code?: string;
10
+ status?: number;
11
+ }
12
+
13
+ /**
14
+ * 分组搜索条件
15
+ */
16
+ export interface FrameworkGroupQueryParam extends FrameworkBaseQueryParam {
17
+ /** 分组名称 */
18
+ nameForLike?: string;
19
+ }
@@ -0,0 +1,74 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from './frameworkBase';
2
+
3
+ /**
4
+ * 日志
5
+ */
6
+ export interface FrameworkLog extends FrameworkBase {
7
+ /** 应用名称 */
8
+ applicationName?: string;
9
+
10
+ /** 日志级别 */
11
+ level?: string;
12
+
13
+ /** 日志类型 */
14
+ type?: string;
15
+
16
+ levelType?: string;
17
+
18
+ /** 请求id */
19
+ requestId?: string;
20
+ /** 请求操作系统 */
21
+ requestOs?: string;
22
+
23
+ /**请求浏览器*/
24
+ requestBrowser?: string;
25
+ /**请求ip*/
26
+ requestIp?: string;
27
+ /** 请求位置 */
28
+ requestLocation?: string;
29
+
30
+ /** 请求网址 */
31
+ requestUrl?: string;
32
+ /** 请求内容类型 */
33
+ requestContentType?: string;
34
+ /** 请求方法 */
35
+ requestMethod?: string;
36
+
37
+ /** 请求头 */
38
+ requestHeaders?: string;
39
+ /** 请求参数 */
40
+ requestParam?: string;
41
+
42
+ /** 请求表单 */
43
+ requestForm?: string;
44
+
45
+ /** 请求体 */
46
+ requestBody?: string;
47
+
48
+ /** 请求结果 */
49
+ requestResult?: string;
50
+
51
+ /** 请求耗时 */
52
+ requestSpendTime?: number;
53
+ /** 堆栈跟踪 */
54
+ stackTrace?: string;
55
+ /** 内容 */
56
+ content?: string;
57
+
58
+ /** gateway访问令牌 */
59
+ gatewayAccessToken?: string;
60
+
61
+ /** sso访问令牌 */
62
+ ssoAccessToken?: string;
63
+ }
64
+
65
+ /**
66
+ * 日志搜索条件
67
+ */
68
+ export interface FrameworkLogQueryParam extends FrameworkBaseQueryParam {
69
+ levelForEqual?: string;
70
+ typeForEqual?: string;
71
+ requestIdForLike?: string;
72
+
73
+ uimsApplicationCodeForEqual?: string;
74
+ }
@@ -0,0 +1,4 @@
1
+ export interface FrameworkTree {
2
+ label: string;
3
+ children?: FrameworkTree[];
4
+ }
@@ -0,0 +1,23 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * Api
5
+ */
6
+ export interface UimsApi extends FrameworkBase {
7
+ /** Api名称 */
8
+ name?: string;
9
+ code?: string;
10
+ status?: number;
11
+ /** Api地址 */
12
+ url?: string;
13
+ }
14
+
15
+ /**
16
+ * Api搜索条件
17
+ */
18
+ export interface UimsApiQueryParam extends FrameworkBaseQueryParam {
19
+ /** Api名称 */
20
+ nameForLike?: string;
21
+ /** Api地址 */
22
+ urlForLike?: string;
23
+ }
@@ -0,0 +1,39 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * 应用
5
+ */
6
+ export interface UimsApplication extends FrameworkBase {
7
+ /** 应用名称 */
8
+ name?: string;
9
+ /** 应用名称 */
10
+ code?: string;
11
+ /** 应用设备 */
12
+ device?: string;
13
+ /** 应用状态 */
14
+ status?: number;
15
+ /** 过期时间 */
16
+ expiresTime?: Date;
17
+ /** 应用主页 */
18
+ homeUrl?: string;
19
+ /** 应用Api上下文路径 */
20
+ apiContextPath?: string;
21
+ /** 可信域名 */
22
+ trustDomain?: string;
23
+ /** IP白名单 */
24
+ ipWhiteList?: string;
25
+ /** 描述 */
26
+ description?: string;
27
+ }
28
+
29
+ /**
30
+ * 应用搜索条件
31
+ */
32
+ export interface UimsApplicationQueryParam extends FrameworkBaseQueryParam {
33
+ /** 应用名称 */
34
+ nameForLike?: string;
35
+ codeForLike?: string;
36
+
37
+ /** 应用状态 */
38
+ statusForEqual?: number;
39
+ }
@@ -0,0 +1,35 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * 菜单
5
+ */
6
+ export interface UimsMenu extends FrameworkBase {
7
+ /** 菜单名称 */
8
+ name?: string;
9
+ /** 菜单代码 */
10
+ code?: string;
11
+ /** 菜单状态 */
12
+ status?: number;
13
+ /** 菜单图标 */
14
+ icon?: string;
15
+ /** 菜单图片代码 */
16
+ imageCode?: string;
17
+ /** 菜单url */
18
+ url?: string;
19
+ /** 菜单目标 */
20
+ target?: string;
21
+ /** 子级菜单 */
22
+ children?: UimsMenu[];
23
+
24
+ isHasChildren?: boolean;
25
+ }
26
+
27
+ /**
28
+ * 菜单搜索条件
29
+ */
30
+ export interface UimsMenuQueryParam extends FrameworkBaseQueryParam {
31
+ parentId?: string;
32
+ nameForLike?: string;
33
+ // codeForLike?: string;
34
+ urlForLike?: string;
35
+ }
@@ -0,0 +1,29 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * 机构
5
+ */
6
+ export interface UimsOrganization extends FrameworkBase {
7
+ /** 机构名称 */
8
+ name?: string;
9
+ /** 机构代码 */
10
+ code?: string;
11
+ /** 机构状态 */
12
+ status?: number;
13
+ /** 机构类型 */
14
+ type?: string;
15
+ /** 子级 */
16
+ children?: UimsOrganization[];
17
+
18
+ isHasChildren?: boolean;
19
+ }
20
+
21
+ /**
22
+ * 机构搜索条件
23
+ */
24
+ export interface UimsOrganizationQueryParam extends FrameworkBaseQueryParam {
25
+ /** 机构名称 */
26
+ nameForLike?: string;
27
+ /** 机构代码 */
28
+ codeForLike?: string;
29
+ }
@@ -0,0 +1,23 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * 角色
5
+ */
6
+ export interface UimsRole extends FrameworkBase {
7
+ /** 角色代码 */
8
+ code?: string;
9
+ /** 角色名称 */
10
+ name?: string;
11
+
12
+ status?: number;
13
+ }
14
+
15
+ /**
16
+ * 角色搜索条件
17
+ */
18
+ export interface UimsRoleQueryParam extends FrameworkBaseQueryParam {
19
+ /** 角色名称 */
20
+ nameForLike?: string;
21
+ /** 角色标识 */
22
+ codeForLike?: string;
23
+ }
@@ -0,0 +1,41 @@
1
+ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/frameworkBase';
2
+
3
+ /**
4
+ * 用户
5
+ */
6
+ export interface UimsUser extends FrameworkBase {
7
+ /** 用户账号 */
8
+ account?: string;
9
+ /** 用户姓名 */
10
+ name?: string;
11
+ /** 用户性别 */
12
+ gender?: string;
13
+ status?: number;
14
+ /** 机构id */
15
+ organizationId?: string;
16
+ password?: string;
17
+ surePassword?: string;
18
+ rsaAesKey?: string;
19
+
20
+ isRecursiveOrganization?: Boolean;
21
+ mobile?: string;
22
+ email?: string;
23
+ birthday?: string;
24
+ idCard?: string;
25
+ address?: string;
26
+
27
+ avatarCode?: string;
28
+ avatarUrl?: string;
29
+ }
30
+
31
+ /**
32
+ * 用户搜索条件
33
+ */
34
+ export interface UimsUserQueryParam extends FrameworkBaseQueryParam {
35
+ /** 用户姓名 */
36
+ nameForLike?: string;
37
+ /** 用户账号 */
38
+ accountForLike?: string;
39
+ /** 是否递归机构 */
40
+ isRecursiveOrganization?: boolean;
41
+ }
@@ -1,4 +1,5 @@
1
1
 
2
+
2
3
  /**
3
4
  * 加载脚本
4
5
  * @param src
@@ -114,4 +115,22 @@ const getFileSize = (url: string) => {
114
115
  }
115
116
 
116
117
 
117
- export { loadScript, loadLink, loadIframe, getFileSize };
118
+ /**
119
+ * 设置是否调试
120
+ * @param value
121
+ */
122
+ const setIsDebug = (value: boolean) => {
123
+ localStorage.setItem('is-debug', value.toString());
124
+ }
125
+
126
+ /**
127
+ * 获取是否调试
128
+ */
129
+ const getIsDebug = () => {
130
+ let value = localStorage.getItem('is-debug');
131
+ if(value == 'true') {
132
+ return true;
133
+ }
134
+ return false;
135
+ }
136
+ export { loadScript, loadLink, loadIframe, getFileSize, setIsDebug, getIsDebug };
@@ -6,10 +6,20 @@
6
6
  * @returns {string|null}
7
7
  */
8
8
  const getParameter = (name: string, url?: string) : string => {
9
- url = url || window.location.search;
9
+ if (typeof(url) == 'undefined') {
10
+ // 格式:?name=chenghui
11
+ url = window.location.search;
12
+ } else {
13
+ if (url.indexOf('?') != -1) {
14
+ // 格式:?name=chenghui
15
+ url = url.substring(url.indexOf('?'));
16
+ }
17
+ }
10
18
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
11
19
  var r = url.substr(1).match(reg);
12
- if (r != null) return decodeURIComponent(r[2]);
20
+ if (r != null) {
21
+ return decodeURIComponent(r[2]);
22
+ }
13
23
  return '';
14
24
  }
15
25
 
@@ -19,8 +29,15 @@ const getParameter = (name: string, url?: string) : string => {
19
29
  * @returns {map|null}
20
30
  */
21
31
  const getParameterMap = (url?: string): Map<string, string> => {
22
- url = url || window.location.search;
23
-
32
+ if (typeof(url) == 'undefined') {
33
+ // 格式:?name=chenghui
34
+ url = window.location.search;
35
+ } else {
36
+ if (url.indexOf('?') != -1) {
37
+ // 格式:?name=chenghui
38
+ url = url.substring(url.indexOf('?'));
39
+ }
40
+ }
24
41
  let arrObj = url.split("?") as any;
25
42
  let params = Object.create(null);
26
43
  if (arrObj.length > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-common",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -49,6 +49,15 @@ const router = createRouter({
49
49
  isSsoExcluded: true
50
50
  }
51
51
  },
52
+ {
53
+ path: '/utils/http-utils',
54
+ component: () => import('@/views/utils/http-utils.vue'),
55
+ meta: {
56
+ isSsoExcluded: true
57
+ }
58
+ },
59
+
60
+
52
61
 
53
62
  {
54
63
  path: '/example/table/index',
@@ -10,7 +10,7 @@ import { ElMessage } from 'element-plus/es';
10
10
 
11
11
  const sendRequest = () => {
12
12
  // 测试
13
- http.get("/framework-api/standard/framework-captcha/getSliderCaptcha", { params: {} }).then((res) => {
13
+ http.get("/framework-api/core/framework-captcha/getSliderCaptcha", { params: {} }).then((res) => {
14
14
  ElMessage.success('发送成功');
15
15
  });
16
16
  }
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div>http</div>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { onMounted, ref } from 'vue';
7
+ import { ElLoading } from 'element-plus';
8
+
9
+ import { http } from '../../../lib/config/httpConfig';
10
+
11
+
12
+ onMounted(async () => {
13
+ const loading = ElLoading.service({
14
+ lock: true,
15
+ text: '加载中...'
16
+ });
17
+ try {
18
+ let res = await http.get('/framework-api/core/framework-attachment/closeEditInfo');
19
+
20
+ res = await http.get('/framework-api/core/framework-attachment/closeAddInfo');
21
+ loading.close();
22
+ }catch{
23
+ loading.close();
24
+ }
25
+
26
+ })
27
+
28
+ </script>
29
+
30
+ <style scoped>
31
+
32
+ </style>
@@ -3,10 +3,9 @@
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
- import {onMounted, ref, getCurrentInstance} from 'vue';
6
+ import {onMounted, ref} from 'vue';
7
7
  import {getSsoEncrypt} from '../../../lib/utils/ssoUtils';
8
8
 
9
- const {proxy} = getCurrentInstance() as any;
10
9
 
11
10
  let ssoEncrypt = ref('');
12
11