@ajaxjs/ui 1.3.0 → 1.3.2

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.
Files changed (134) hide show
  1. package/.browserslistrc +3 -0
  2. package/.eslintrc.js +26 -0
  3. package/babel.config.js +5 -0
  4. package/deprecated/api-helper.zip +0 -0
  5. package/deprecated/api-helper2.zip +0 -0
  6. package/deprecated/api-selector.zip +0 -0
  7. package/deprecated/common-ui.zip +0 -0
  8. package/deprecated/data-source.zip +0 -0
  9. package/deprecated/table-selector.zip +0 -0
  10. package/deprecated/utils.js +220 -0
  11. package/dist/@ajaxjs/widgets.common.js +4084 -0
  12. package/dist/@ajaxjs/widgets.common.js.map +1 -0
  13. package/dist/@ajaxjs/widgets.css +1 -0
  14. package/dist/@ajaxjs/widgets.umd.js +4095 -0
  15. package/dist/@ajaxjs/widgets.umd.js.map +1 -0
  16. package/dist/@ajaxjs/widgets.umd.min.js +2 -0
  17. package/dist/@ajaxjs/widgets.umd.min.js.map +1 -0
  18. package/dist/demo.html +1 -0
  19. package/examples/App.vue +137 -0
  20. package/package.json +50 -41
  21. package/public/favicon.ico +0 -0
  22. package/public/index.html +17 -0
  23. package/{dist → src}/data-source/data-source.ts +16 -14
  24. package/{dist → src}/iam/iam.ts +2 -4
  25. package/{dist → src}/iam/user.vue +19 -16
  26. package/src/index.js +48 -0
  27. package/src/iview-ext/fast-iview-table.ts +131 -0
  28. package/src/iview-ext/fast-iview-table.vue +67 -0
  29. package/{dist/iView-ext/fast-iview-table → src/iview-ext}/list.ts +11 -12
  30. package/{dist/table-selector → src/iview-ext}/table-selector.vue +17 -12
  31. package/{dist/iView-ext → src/iview-ext}/tips.vue +5 -2
  32. package/src/main.ts +7 -0
  33. package/src/shims-tsx.d.ts +11 -0
  34. package/{dist → src}/shims-vue.d.ts +4 -4
  35. package/src/style/common-functions.less +286 -0
  36. package/src/style/reset.less +19 -0
  37. package/src/style/reset2.less +49 -0
  38. package/tsconfig.json +40 -0
  39. package/vue.config.js +14 -0
  40. package/LICENSE +0 -201
  41. package/dist/api-helper/common/arg.vue +0 -46
  42. package/dist/api-helper/common/http-method.vue +0 -53
  43. package/dist/api-helper/common/input-table.vue +0 -128
  44. package/dist/api-helper/document/document-render.d.ts +0 -10
  45. package/dist/api-helper/document/document-render.js +0 -38
  46. package/dist/api-helper/document/document-render.js.map +0 -1
  47. package/dist/api-helper/document/document-render.ts +0 -35
  48. package/dist/api-helper/document/document-render.vue +0 -155
  49. package/dist/api-helper/document/document.d.ts +0 -31
  50. package/dist/api-helper/document/document.js +0 -55
  51. package/dist/api-helper/document/document.js.map +0 -1
  52. package/dist/api-helper/document/document.ts +0 -55
  53. package/dist/api-helper/document/document.vue +0 -78
  54. package/dist/api-helper/document/perview.vue +0 -0
  55. package/dist/api-helper/index.js +0 -142
  56. package/dist/api-helper/index.vue +0 -108
  57. package/dist/api-helper/request-body.vue +0 -66
  58. package/dist/api-helper/table.d.ts +0 -7
  59. package/dist/api-helper/table.js +0 -13
  60. package/dist/api-helper/table.js.map +0 -1
  61. package/dist/api-helper/table.ts +0 -10
  62. package/dist/api-helper/table.vue +0 -103
  63. package/dist/api-helper/xhr.js +0 -100
  64. package/dist/api-helper2/api-helper.d.ts +0 -194
  65. package/dist/api-helper2/api-helper.vue +0 -144
  66. package/dist/api-helper2/bookmark.vue +0 -168
  67. package/dist/api-helper2/common/arg.vue +0 -46
  68. package/dist/api-helper2/common/http-method.vue +0 -53
  69. package/dist/api-helper2/document/document-render.vue +0 -189
  70. package/dist/api-helper2/document/document.vue +0 -130
  71. package/dist/api-helper2/document/perview.vue +0 -0
  72. package/dist/api-helper2/env.vue +0 -140
  73. package/dist/api-helper2/history.vue +0 -116
  74. package/dist/api-helper2/main.vue +0 -70
  75. package/dist/api-helper2/request-body.vue +0 -68
  76. package/dist/api-helper2/table.vue +0 -116
  77. package/dist/api-selector/api-list-dataservice.d.ts +0 -18
  78. package/dist/api-selector/api-list-dataservice.js +0 -209
  79. package/dist/api-selector/api-list-dataservice.js.map +0 -1
  80. package/dist/api-selector/api-list-dataservice.ts +0 -232
  81. package/dist/api-selector/api-list-swagger.d.ts +0 -28
  82. package/dist/api-selector/api-list-swagger.js +0 -179
  83. package/dist/api-selector/api-list-swagger.js.map +0 -1
  84. package/dist/api-selector/api-list-swagger.ts +0 -206
  85. package/dist/api-selector/api-list.d.ts +0 -80
  86. package/dist/api-selector/api-list.js +0 -129
  87. package/dist/api-selector/api-list.js.map +0 -1
  88. package/dist/api-selector/api-list.ts +0 -135
  89. package/dist/api-selector/index.vue +0 -125
  90. package/dist/api-selector/test-dataservice.d.ts +0 -23
  91. package/dist/api-selector/test-dataservice.js +0 -74
  92. package/dist/api-selector/test-dataservice.js.map +0 -1
  93. package/dist/api-selector/test-swagger.d.ts +0 -901
  94. package/dist/api-selector/test-swagger.js +0 -656
  95. package/dist/api-selector/test-swagger.js.map +0 -1
  96. package/dist/data-source/data-source.css +0 -44
  97. package/dist/data-source/data-source.d.ts +0 -14
  98. package/dist/data-source/data-source.html +0 -59
  99. package/dist/data-source/data-source.js +0 -97
  100. package/dist/data-source/data-source.js.map +0 -1
  101. package/dist/iView-ext/fast-iview-table/fast-iview-table.d.ts +0 -37
  102. package/dist/iView-ext/fast-iview-table/fast-iview-table.js +0 -72
  103. package/dist/iView-ext/fast-iview-table/fast-iview-table.js.map +0 -1
  104. package/dist/iView-ext/fast-iview-table/fast-iview-table.ts +0 -75
  105. package/dist/iView-ext/fast-iview-table/fast-iview-table.vue +0 -52
  106. package/dist/iView-ext/fast-iview-table/list.d.ts +0 -44
  107. package/dist/iView-ext/fast-iview-table/list.js +0 -97
  108. package/dist/iView-ext/fast-iview-table/list.js.map +0 -1
  109. package/dist/iam/iam.d.ts +0 -16
  110. package/dist/iam/iam.js +0 -54
  111. package/dist/iam/iam.js.map +0 -1
  112. package/dist/index.d.ts +0 -57
  113. package/dist/index.js +0 -22
  114. package/dist/index.js.map +0 -1
  115. package/dist/index.ts +0 -18
  116. package/dist/libs/entity.d.ts +0 -26
  117. package/dist/libs/entity.js +0 -1
  118. package/dist/libs/entity.js.map +0 -1
  119. package/dist/libs/iview-widgets.d.ts +0 -59
  120. package/dist/libs/iview-widgets.js +0 -2
  121. package/dist/libs/iview-widgets.js.map +0 -1
  122. package/dist/main.d.ts +0 -1
  123. package/dist/main.js +0 -24
  124. package/dist/main.js.map +0 -1
  125. package/dist/main.ts +0 -22
  126. package/dist/table-selector/table-selector.htm +0 -28
  127. package/dist/table-selector/table-selector.js +0 -149
  128. /package/{dist → src}/data-source/data-source.less +0 -0
  129. /package/{dist → src}/data-source/data-source.vue +0 -0
  130. /package/{dist → src}/libs/api-helper.d.ts +0 -0
  131. /package/{dist → src}/libs/api-list.d.ts +0 -0
  132. /package/{dist → src}/libs/common.d.ts +0 -0
  133. /package/{dist → src}/libs/entity.ts +0 -0
  134. /package/{dist → src}/libs/iview-widgets.ts +0 -0
package/dist/iam/iam.js DELETED
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const xhr_1 = require("@ajaxjs/util/dist/util/xhr");
4
- /**
5
- * 获取登录信息
6
- *
7
- * @returns 用户 JWT
8
- */
9
- exports.default = {
10
- /**
11
- *
12
- *
13
- * @param loginUrl 登录页面地址
14
- * @param thisPageUrl 前端页面的地址,最后返回这里
15
- * @returns
16
- */
17
- getLoginInfo(loginUrl, thisPageUrl) {
18
- const token = getQueryParam("token", false);
19
- let accessToken = localStorage.getItem("accessToken");
20
- if (!accessToken && !token) {
21
- console.log('你未登录!');
22
- let target = `${loginUrl}?web_url=${encodeURIComponent(thisPageUrl)}`;
23
- confirm('你未登录。是否跳转到登录页面?') && location.assign(target);
24
- return;
25
- }
26
- if (token) {
27
- accessToken = decodeURIComponent(token);
28
- localStorage.setItem("accessToken", accessToken);
29
- // 只需要第一次的参数,之后不需要,现在清除
30
- const url = new URL(location.href); // 创建一个包含查询参数的URL
31
- const params = new URLSearchParams(url.search); // 获取URL中的查询参数
32
- params.delete('token'); // 删除名为'b'的参数
33
- url.search = params.toString(); // 更新URL的查询参数
34
- location.assign(url.href);
35
- }
36
- // window.JWT_TOKEN = JSON.parse(accessToken);
37
- (0, xhr_1.setBaseHeadParams)({ Authorization: 'Bearer ' + accessToken });
38
- // 将 JWT Token 拆分为三个部分
39
- const tokenParts = accessToken.split('.');
40
- const payload = JSON.parse(atob(tokenParts[1])); // 解析载荷
41
- return payload;
42
- }
43
- };
44
- function getQueryParam(variable, isParent) {
45
- var query = (isParent ? parent.location : window.location).search.substring(1);
46
- var vars = query.split("&");
47
- for (var i = 0; i < vars.length; i++) {
48
- var pair = vars[i].split("=");
49
- if (pair[0] == variable)
50
- return pair[1];
51
- }
52
- return null;
53
- }
54
- //# sourceMappingURL=iam.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iam.js","sourceRoot":"","sources":["../../src/iam/iam.ts"],"names":[],"mappings":";;AAEA,oDAA+D;AAE/D;;;;GAIG;AACH,kBAAe;IACX;;;;;;OAMG;IACH,YAAY,CAAC,QAAgB,EAAE,WAAmB;QAC9C,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,WAAW,GAAW,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAE9D,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,IAAI,MAAM,GAAW,GAAG,QAAQ,YAAY,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YAE9E,OAAO,CAAC,iBAAiB,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAEtD,OAAO;SACV;QAED,IAAI,KAAK,EAAE;YACP,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;YACxC,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;YAEjD,8BAA8B;YAC9B,MAAM,GAAG,GAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB;YAC1D,MAAM,MAAM,GAAoB,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA,cAAc;YAC9E,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA,aAAa;YACpC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA,aAAa;YAE5C,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC7B;QAED,8CAA8C;QAC9C,IAAA,uBAAiB,EAAC,EAAE,aAAa,EAAE,SAAS,GAAG,WAAW,EAAE,CAAC,CAAC;QAE9D,sBAAsB;QACtB,MAAM,UAAU,GAAa,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;QAExD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAC;AAEF,SAAS,aAAa,CAAC,QAAgB,EAAE,QAAiB;IACtD,IAAI,KAAK,GAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvF,IAAI,IAAI,GAAa,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,IAAI,GAAa,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ;YACnB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,57 +0,0 @@
1
- import iViewListCommon from './iView-ext/fast-iview-table/fast-iview-table.vue';
2
- /**
3
- * 暴露各个组件
4
- */
5
- declare const _default: {
6
- ApiHelper: import("vue").VueConstructor<iViewListCommon<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => iViewListCommon<Record<string, any>, Record<string, any>, never, never, any>>>;
7
- ApiSelector: import("vue").VueConstructor<iViewListCommon<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => iViewListCommon<Record<string, any>, Record<string, any>, never, never, any>>>;
8
- Fast_iViewTable: {
9
- afterDelete(cb?: Function): Function;
10
- delInfo(index: number): void;
11
- id: {
12
- title: string;
13
- width: number;
14
- key: string;
15
- align: string;
16
- };
17
- createDate: {
18
- title: string;
19
- width: number;
20
- align: string;
21
- render(h: Function, params: any): any;
22
- };
23
- tags: {
24
- title: string;
25
- minWidth: number;
26
- key: string;
27
- align: string;
28
- ellipsis: boolean;
29
- };
30
- status: {
31
- title: string;
32
- width: number;
33
- render(h: Function, params: any): any;
34
- };
35
- getPageList(self: any, listArray: any, callback?: Function): (json: {}, text: string) => void;
36
- copyBeanClean(bean: {}): {};
37
- };
38
- iViewListCommon: import("vue").VueConstructor<iViewListCommon<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => iViewListCommon<Record<string, any>, Record<string, any>, never, never, any>>>;
39
- DataSource: {
40
- data(): {};
41
- mounted(): void;
42
- methods: {
43
- active(item: any): void;
44
- getList(cb: any): void;
45
- add(): void;
46
- create(): void;
47
- update(): void;
48
- del(id: any, name: any): void;
49
- test(): void;
50
- };
51
- };
52
- TableSelector: import("vue").VueConstructor<iViewListCommon<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => iViewListCommon<Record<string, any>, Record<string, any>, never, never, any>>>;
53
- IAM: {
54
- getLoginInfo(loginUrl: string, thisPageUrl: string): any;
55
- };
56
- };
57
- export default _default;
package/dist/index.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // import * as sys_config from './util/system/config';
3
- // import * as util from './util/utils';
4
- // import { setBaseHeadParams } from './util/xhr';
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const list_1 = __importDefault(require("./iView-ext/fast-iview-table/list"));
10
- const fast_iview_table_vue_1 = __importDefault(require("./iView-ext/fast-iview-table/fast-iview-table.vue"));
11
- const index_vue_1 = __importDefault(require("./api-selector/index.vue"));
12
- const index_vue_2 = __importDefault(require("./api-helper/index.vue"));
13
- const data_source_1 = __importDefault(require("./data-source/data-source"));
14
- const table_selector_vue_1 = __importDefault(require("./table-selector/table-selector.vue"));
15
- const iam_1 = __importDefault(require("./iam/iam"));
16
- /**
17
- * 暴露各个组件
18
- */
19
- exports.default = {
20
- ApiHelper: index_vue_2.default, ApiSelector: index_vue_1.default, Fast_iViewTable: list_1.default, iViewListCommon: fast_iview_table_vue_1.default, DataSource: data_source_1.default, TableSelector: table_selector_vue_1.default, IAM: iam_1.default
21
- };
22
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,wCAAwC;AACxC,kDAAkD;;;;;AAElD,6EAAgE;AAChE,6GAAgF;AAChF,yEAAmD;AACnD,uEAA+C;AAC/C,4EAAmD;AACnD,6FAAgE;AAChE,oDAA4B;AAE5B;;GAEG;AACH,kBAAe;IACX,SAAS,EAAT,mBAAS,EAAE,WAAW,EAAX,mBAAW,EAAE,eAAe,EAAf,cAAe,EAAE,eAAe,EAAf,8BAAe,EAAE,UAAU,EAAV,qBAAU,EAAE,aAAa,EAAb,4BAAa,EAAE,GAAG,EAAH,aAAG;CAC3F,CAAC"}
package/dist/index.ts DELETED
@@ -1,18 +0,0 @@
1
- // import * as sys_config from './util/system/config';
2
- // import * as util from './util/utils';
3
- // import { setBaseHeadParams } from './util/xhr';
4
-
5
- import Fast_iViewTable from './iView-ext/fast-iview-table/list';
6
- import iViewListCommon from './iView-ext/fast-iview-table/fast-iview-table.vue';
7
- import ApiSelector from './api-selector/index.vue';
8
- import ApiHelper from './api-helper/index.vue';
9
- import DataSource from './data-source/data-source';
10
- import TableSelector from './table-selector/table-selector.vue';
11
- import IAM from './iam/iam';
12
-
13
- /**
14
- * 暴露各个组件
15
- */
16
- export default {
17
- ApiHelper, ApiSelector, Fast_iViewTable, iViewListCommon, DataSource, TableSelector, IAM
18
- };
@@ -1,26 +0,0 @@
1
- type Entity = {
2
- /**
3
- * 类型
4
- */
5
- type: string;
6
- /**
7
- * 数据长度
8
- */
9
- width: number;
10
- /**
11
- * 是否允许为空
12
- */
13
- isNotNull: boolean;
14
- /**
15
- * 默认值
16
- */
17
- defaultValue: any;
18
- /**
19
- * 校验规则
20
- */
21
- regexp: RegExp;
22
- /**
23
- * 注释说明
24
- */
25
- comment: string;
26
- };
@@ -1 +0,0 @@
1
- //# sourceMappingURL=entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/libs/entity.ts"],"names":[],"mappings":""}
@@ -1,59 +0,0 @@
1
- /**
2
- * iView Table 配置字段, data 字段
3
- */
4
- type TableListConfig = {
5
- /**
6
- * 列定义
7
- */
8
- columns: any[];
9
- /**
10
- * 表格数据
11
- */
12
- data: any[];
13
- /**
14
- * 记录总数
15
- */
16
- total: number;
17
- /**
18
- * MySQL 分页方式 start
19
- */
20
- start?: number;
21
- /**
22
- * MySQL 分页方式 limit
23
- */
24
- limit?: number;
25
- /**
26
- * 页码,表示第几页
27
- */
28
- pageNo?: number;
29
- /**
30
- * 每页记录数,等同于 MySQL 分页方式 limit
31
- */
32
- pageSize?: number;
33
- /**
34
- * 表格处于加载中状态
35
- */
36
- loading?: boolean;
37
- };
38
- /**
39
- * iView Table 配置方法
40
- */
41
- type TableListMethod = {
42
- /**
43
- * 异步加载列表数据
44
- */
45
- getData(): void;
46
- /**
47
- * 打开详情 UI
48
- *
49
- * @param id
50
- */
51
- openInfo?(id: number): void;
52
- /**
53
- * 删除
54
- *
55
- * @param id
56
- * @param index 行号
57
- */
58
- deleteInfo?(id: number, index: number): void;
59
- };
@@ -1,2 +0,0 @@
1
- // iView 组件的配置定义
2
- //# sourceMappingURL=iview-widgets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iview-widgets.js","sourceRoot":"","sources":["../../src/libs/iview-widgets.ts"],"names":[],"mappings":"AAAA,gBAAgB"}
package/dist/main.d.ts DELETED
@@ -1 +0,0 @@
1
- import 'view-design/dist/styles/iview.css';
package/dist/main.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const vue_1 = __importDefault(require("vue"));
7
- const index_vue_1 = __importDefault(require("./api-selector/index.vue"));
8
- const index_vue_2 = __importDefault(require("./api-helper/index.vue"));
9
- const view_design_1 = __importDefault(require("view-design"));
10
- require("view-design/dist/styles/iview.css");
11
- vue_1.default.config.productionTip = false;
12
- vue_1.default.use(view_design_1.default);
13
- const apiSelectorFn = h => h(index_vue_1.default, {
14
- props: {
15
- apiRoot: 'foo'
16
- }
17
- });
18
- const apiHelperFn = h => h(index_vue_2.default, {
19
- props: {
20
- apiRoot: 'foo'
21
- }
22
- });
23
- new vue_1.default({ render: apiHelperFn }).$mount('#app');
24
- //# sourceMappingURL=main.js.map
package/dist/main.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,yEAAmD;AACnD,uEAA+C;AAC/C,8DAAiC;AACjC,6CAA2C;AAE3C,aAAG,CAAC,MAAM,CAAC,aAAa,GAAG,KAAK,CAAC;AACjC,aAAG,CAAC,GAAG,CAAC,qBAAM,CAAC,CAAC;AAEhB,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAW,EAAE;IACtC,KAAK,EAAE;QACH,OAAO,EAAE,KAAK;KACjB;CACJ,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,EAAE;IAClC,KAAK,EAAE;QACH,OAAO,EAAE,KAAK;KACjB;CACJ,CAAC,CAAC;AAEH,IAAI,aAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"}
package/dist/main.ts DELETED
@@ -1,22 +0,0 @@
1
- import Vue from 'vue'
2
- import apiSelector from './api-selector/index.vue';
3
- import apiHelper from './api-helper/index.vue';
4
- import ViewUI from 'view-design';
5
- import 'view-design/dist/styles/iview.css';
6
-
7
- Vue.config.productionTip = false;
8
- Vue.use(ViewUI);
9
-
10
- const apiSelectorFn = h => h(apiSelector, {
11
- props: {
12
- apiRoot: 'foo'
13
- }
14
- });
15
-
16
- const apiHelperFn = h => h(apiHelper, {
17
- props: {
18
- apiRoot: 'foo'
19
- }
20
- });
21
-
22
- new Vue({ render: apiHelperFn }).$mount('#app');
@@ -1,28 +0,0 @@
1
- <template id="table-selector-tpl">
2
- <div class="table-selector">
3
- <Row style="margin:20px 0;" type="flex" justify="center" align="middle">
4
- <i-Col v-if="isCrossDb" span="6" style="padding-right:10px;">
5
- <i-Select placeholder="请选择数据库名" v-model="databaseName">
6
- <i-Option v-for="d in databaseList" :key="d" :value="d">{{d}}</i-Option>
7
- </i-Select>
8
- </i-Col>
9
- <i-Col :span="isCrossDb ? 6 : 12">
10
- <i-Input search enter-button placeholder="按表名模糊搜索" @on-keyup="search" ref="inputEl"></i-Input>
11
- </i-Col>
12
- <i-Col span="12">
13
- &nbsp;&nbsp;&nbsp;<a @click="resetData">重置</a>
14
- </i-Col>
15
- </Row>
16
-
17
- <i-Table :columns="list_column" :data="data" width="100%" @on-selection-change="onSelect" max-height="300" :loading="loading" class="table-selector-table">
18
- <template slot-scope="{row}" slot="select">
19
- <a @click="$emit('on-select', row, databaseName)">选择</a>
20
- </template>
21
- </i-Table>
22
- <br />
23
-
24
- <div class="ivu-mt ivu-text-right" v-if="!isFilter">
25
- <Page :total="total" :current.sync="current" show-total :page-size="pageSize" />
26
- </div>
27
- </div>
28
- </template>
@@ -1,149 +0,0 @@
1
- Vue.component('table-selector', {
2
- template: '#table-selector-tpl',
3
- data() {
4
- return {
5
- // isCrossDb: false,
6
- list_column: [
7
- {
8
- title: "#",
9
- // key: 'id',
10
- width: 60,
11
- type: "index",
12
- // type: 'selection'
13
- },
14
- {
15
- title: "表名",
16
- key: 'tableName',
17
- },
18
- {
19
- title: "说明",
20
- key: 'comment',
21
- },
22
- {
23
- title: "操作",
24
- slot: 'select'
25
- }
26
- ],
27
- listData: [], // 显示数据
28
- data: [], // 全部数据
29
- total: 0,
30
- current: 1,
31
- pageSize: 5,
32
- isFilter: false,
33
- start: 0,
34
- searchKeyword: "",
35
- loading: false,
36
- databaseList: [],
37
- databaseName: "",
38
- }
39
- },
40
- props: {
41
- apiUrl: { type: String, required: true },
42
- isCrossDb: { type: Boolean, required: true },
43
- dataSourceId: { type: Number, required: true },
44
- },
45
- mounted() {
46
- // this.isCrossDb = true;
47
- // this.getData();
48
- },
49
- methods: {
50
- getData() {
51
- this.loading = true;
52
- let url = `${DS_CONFIG.API_ROOT}/admin/${this.dataSourceId}/getAllTables?start=${this.start}&limit=${this.pageSize}`;
53
-
54
- if (this.searchKeyword)
55
- url += `&tablename=${this.searchKeyword}`;
56
- if (this.databaseName)
57
- url += `&dbName=${this.databaseName}`;
58
-
59
- aj.xhr.get(url, j => {
60
- if (j.status) {
61
- this.data = j.data;
62
- this.total = j.total;
63
- } else
64
- this.$Message.error(j.message);
65
-
66
- this.loading = false;
67
- });
68
- },
69
- handleChangePageSize() {
70
- let start = (this.current - 1) * this.pageSize,
71
- end = start + this.pageSize;
72
-
73
- this.listData = this.data.slice(start, end);
74
- },
75
- onSelect(arr) {
76
- arr.forEach((item) => {
77
- this.data.forEach((_item) => { });
78
- });
79
- },
80
- resetData() {
81
- this.searchKeyword = "";
82
-
83
- this.start = 0;
84
- this.getData();
85
- this.$refs.inputEl.$el.querySelector("input").value = "";
86
- },
87
- search(ev) {
88
- let input = ev.target,
89
- v = input.value;
90
-
91
- if (v) {
92
- this.searchKeyword = v;
93
- this.start = 0;
94
- this.current = 1;
95
- this.getData();
96
- }
97
- },
98
- onkeypress(ev) {
99
- let input = ev.target,
100
- v = input.value;
101
-
102
- if (v) {
103
- this.isFilter = true;
104
- let arr = this.data.filter((item) => item.tableName.indexOf(v) != -1);
105
- this.listData = arr;
106
- } else {
107
- this.resetData();
108
- }
109
- },
110
- },
111
- watch: {
112
- /**
113
- * 分页
114
- *
115
- * @param v
116
- */
117
- current(v) {
118
- this.start = (v - 1) * this.pageSize;
119
- this.getData();
120
- },
121
- dataSourceId(id) {
122
- if (id) {
123
- if (this.isCrossDb)
124
- aj.xhr.get(`${DS_CONFIG.API_ROOT}/admin/${this.dataSourceId}/get_databases`, j => {
125
- if (j.status) {
126
- // 过滤 mysql 自带的库
127
- let not = ['information_schema', 'performance_schema', 'sys', 'mysql'];
128
- let arr = j.data.filter(db => !not.includes(db));
129
-
130
- this.databaseList = arr;
131
-
132
- // 默认选中第一个
133
- this.start = 0;
134
- this.current = 1;
135
- this.databaseName = arr[0];
136
- } else
137
- this.$Message.error(j.message);
138
- });
139
- else {
140
- this.databaseName = null;
141
- this.getData();
142
- }
143
- }
144
- },
145
- databaseName(v) {
146
- this.getData(); // 会重复请求
147
- },
148
- },
149
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes