iv-npm 1.0.13 → 1.0.16

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.
package/README.md CHANGED
@@ -1,6 +1,52 @@
1
1
  <!--
2
2
  * @Author: Mr.Cong Wei
3
- * @Date: 2022-08-08 15:35:55
4
- * @LastEditTime: 2022-08-08 16:31:10
3
+ * @Date: 2022-08-09 13:41:52
4
+ * @LastEditTime: 2022-08-09 14:14:15
5
5
  -->
6
- #iv-npm
6
+ # iv-npm
7
+
8
+ 使用pnpm+workspace+turborepo实现的monorepo管理方式的公共npm包
9
+ 项目使用pnpm作为包管理工具。请自行全局下载。
10
+ ## 安装依赖
11
+
12
+ > cd packages\shared
13
+ > pnpm install
14
+
15
+ ## 打包
16
+
17
+ > pnpm run build
18
+
19
+ ## 发布
20
+
21
+ 在登陆过npm情况下,发布需要修改**根下version**,并关闭所有的private属性。
22
+
23
+ > npm publish
24
+
25
+ ## 使用
26
+
27
+ > npm i iv-npm
28
+
29
+ ```ts
30
+ // main.ts
31
+ import ivUi from "iv-npm/packages/ui";
32
+ app.use(ivUi)
33
+ ```
34
+
35
+ ```vue
36
+ // UI组件使用方法
37
+ <template>
38
+ <IVMrpModal v-model:show="Visible"></IVMrpModal>
39
+ </template>
40
+ <script setup lang="ts">
41
+ import { IVMrpModal } from "iv-npm/packages/ui";
42
+ </script>
43
+ ```
44
+
45
+ ```vue
46
+ // 工具函数使用方法
47
+ <script setup lang="ts">
48
+ import { findTree } from "iv-npm/packages/shared/utils";
49
+ </script>
50
+
51
+ ```
52
+
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "iv-npm",
3
- "version": "1.0.13",
4
- "description": "公共通用包",
5
- "author": "Mr.Cong",
6
- "license": "ISC",
7
- "private": false,
8
- "packageManager": "pnpm@7.9.0",
9
- "scripts": {
10
- "build": "turbo run build",
11
- "build:pkg": "pnpm run prepare -r"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "https://e.coding.net/itemvector/cloud-stec/tx-npm.git"
16
- },
17
- "keywords": [
18
- "iv"
19
- ],
20
- "turbo": {
21
- "npmClient": "pnpm",
22
- "pipeline": {
23
- "build": {
24
- "dependsOn": [
25
- "^build"
26
- ],
27
- "outputs": [
28
- "dist/**",
29
- ".umi/**",
30
- ".next/**"
31
- ]
32
- },
33
- "deploy": {
34
- "dependsOn": [
35
- "build"
36
- ]
37
- },
38
- "dev": {
39
- "cache": false
40
- }
41
- }
42
- },
43
- "devDependencies": {
44
- "turbo": "^1.4.2"
45
- }
46
- }
1
+ {
2
+ "name": "iv-npm",
3
+ "version": "1.0.16",
4
+ "description": "公共通用包",
5
+ "author": "Mr.Cong",
6
+ "license": "ISC",
7
+ "private": false,
8
+ "packageManager": "pnpm@7.9.0",
9
+ "scripts": {
10
+ "build": "turbo run build",
11
+ "build:pkg": "pnpm run prepare -r"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://e.coding.net/itemvector/cloud-stec/tx-npm.git"
16
+ },
17
+ "keywords": [
18
+ "iv"
19
+ ],
20
+ "turbo": {
21
+ "npmClient": "pnpm",
22
+ "pipeline": {
23
+ "build": {
24
+ "dependsOn": [
25
+ "^build"
26
+ ],
27
+ "outputs": [
28
+ "dist/**",
29
+ ".umi/**",
30
+ ".next/**"
31
+ ]
32
+ },
33
+ "deploy": {
34
+ "dependsOn": [
35
+ "build"
36
+ ]
37
+ },
38
+ "dev": {
39
+ "cache": false
40
+ }
41
+ }
42
+ },
43
+ "devDependencies": {
44
+ "turbo": "^1.4.2"
45
+ }
46
+ }
@@ -0,0 +1,16 @@
1
+ # @IVNPM/shared
2
+
3
+ 工具函数包
4
+
5
+ ## 使用
6
+
7
+ > npm i iv-npm
8
+
9
+ ```vue
10
+ // 工具函数使用方法
11
+ <script setup lang="ts">
12
+ import { findTree } from "iv-npm/packages/shared/utils";
13
+ </script>
14
+
15
+ ```
16
+
@@ -1,6 +1,7 @@
1
- declare enum AppType {
2
- Web = 1,
3
- Mobile = 2
1
+ interface TreeList {
2
+ parentId: string | null;
3
+ id: string;
4
+ children?: TreeList[];
4
5
  }
5
6
 
6
- export { AppType };
7
+ export { TreeList };
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
5
  var __copyProps = (to, from, except, desc) => {
10
6
  if (from && typeof from === "object" || typeof from === "function") {
11
7
  for (let key of __getOwnPropNames(from))
@@ -18,16 +14,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
18
14
 
19
15
  // types/index.ts
20
16
  var types_exports = {};
21
- __export(types_exports, {
22
- AppType: () => AppType
23
- });
24
17
  module.exports = __toCommonJS(types_exports);
25
- var AppType = /* @__PURE__ */ ((AppType2) => {
26
- AppType2[AppType2["Web"] = 1] = "Web";
27
- AppType2[AppType2["Mobile"] = 2] = "Mobile";
28
- return AppType2;
29
- })(AppType || {});
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- AppType
33
- });
@@ -1,9 +0,0 @@
1
- // types/index.ts
2
- var AppType = /* @__PURE__ */ ((AppType2) => {
3
- AppType2[AppType2["Web"] = 1] = "Web";
4
- AppType2[AppType2["Mobile"] = 2] = "Mobile";
5
- return AppType2;
6
- })(AppType || {});
7
- export {
8
- AppType
9
- };
@@ -1,10 +1,15 @@
1
+ export { TreeList } from '../types/index.js';
2
+
1
3
  declare function arrToTree(list: any[], parentMark: string, childrenMark: string): any;
2
- interface List {
4
+ interface TreeList {
3
5
  parentId: string | null;
4
6
  id: string;
5
- children?: List[];
7
+ children?: TreeList[];
6
8
  }
7
- declare function tranListToTreeData<T extends List>(list: T[]): T[];
9
+ /**
10
+ * 根据parentId===id进行判断
11
+ */
12
+ declare function tranListToTreeData<T extends TreeList>(list: T[]): T[];
8
13
  /**
9
14
  * 树结构查询元素
10
15
  */
@@ -1,33 +1,22 @@
1
- {
2
- "name": "@IVNPM/shared",
3
- "version": "1.0.0",
4
- "description": "IVNPM/shared",
5
- "scripts": {
6
- "prepare": "npm run build",
7
- "dev": "tsup --watch",
8
- "build": "tsup"
9
- },
10
- "files": [
11
- "index.js",
12
- "dist"
13
- ],
14
- "browser": {
15
- "./types": "./dist/types/index.js",
16
- "./utils": "./dist/utils/index.js"
17
- },
18
- "exports": {
19
- "./types": {
20
- "import": "./dist/types/index.mjs",
21
- "require": "./dist/types/index.js"
22
- },
23
- "./utils": {
24
- "import": "./dist/utils/index.mjs",
25
- "require": "./dist/utils/index.js"
26
- }
27
- },
28
- "author": "Mr.Cong",
29
- "license": "ISC",
30
- "devDependencies": {
31
- "tsup": "^6.2.1"
32
- }
33
- }
1
+ {
2
+ "name": "@IVNPM/shared",
3
+ "version": "1.0.0",
4
+ "description": "IVNPM/shared",
5
+ "scripts": {
6
+ "prepare": "npm run build",
7
+ "dev": "tsup --watch",
8
+ "build": "tsup"
9
+ },
10
+ "main": "dist/utils/index.mjs",
11
+ "module": "dist/utils/index.mjs",
12
+ "types": "dist/utils/index.d.ts",
13
+ "files": [
14
+ "index.js",
15
+ "dist"
16
+ ],
17
+ "author": "Mr.Cong",
18
+ "license": "ISC",
19
+ "devDependencies": {
20
+ "tsup": "^6.2.1"
21
+ }
22
+ }
@@ -0,0 +1,26 @@
1
+ # @IVNPM/ui
2
+
3
+ ui工具包
4
+
5
+ ## 使用
6
+
7
+ > npm i iv-npm
8
+
9
+ ```ts
10
+ // main.ts
11
+ import ivUi from "iv-npm/packages/ui";
12
+ app.use(ivUi)
13
+ ```
14
+
15
+ ```vue
16
+ // UI组件使用方法
17
+ <template>
18
+ <IVMrpModal v-model:show="Visible"></IVMrpModal>
19
+ </template>
20
+ <script setup lang="ts">
21
+ import { IVMrpModal } from "iv-npm/packages/ui";
22
+ </script>
23
+ ```
24
+
25
+
26
+
@@ -1,83 +1,91 @@
1
- @charset "UTF-8";
2
- /* 模态框 */
3
- body .detail-class[data-v-3e4642c0] {
4
- top: -50px;
5
- }
6
-
7
- /* body .ant-modal{
8
- width: 84vw!important;
9
- height: 80vh!important;
10
- } */
11
- body .module-class .ant-modal-header[data-v-3e4642c0] {
12
- padding: 0;
13
- }
14
-
15
- body .module-class .ant-modal-body[data-v-3e4642c0] {
16
- position: relative;
17
- padding: 100px 0 100px 100px;
18
- }
19
-
20
- body .detail-class .ant-modal-body[data-v-3e4642c0] {
21
- overflow: auto;
22
- padding: 0 0 30px 0;
23
- }
24
-
25
- body .module-class.not-padding .ant-modal-body[data-v-3e4642c0] {
26
- position: relative;
27
- padding: 0;
28
- }
29
-
30
- body .module-class.pwd .ant-modal-body[data-v-3e4642c0] {
31
- position: relative;
32
- padding: 100px 0;
33
- }
34
-
35
- .ant-scrolling-effect[data-v-3e4642c0] {
36
- width: 100% !important;
37
- }
38
-
39
- /* 组件模态框 */
40
- body .module-class.modal-components .ant-modal[data-v-3e4642c0] {
41
- top: 5%;
42
- left: 0px;
43
- margin-left: 5%;
44
- margin-right: 5%;
45
- height: 40%;
46
- width: auto !important;
47
- }
48
-
49
- body .module-class.modal-components .ant-modal .ant-modal-content[data-v-3e4642c0] {
50
- height: 100%;
51
- }
52
-
53
- body .module-class .ant-modal-content[data-v-3e4642c0] {
54
- box-sizing: border-box;
55
- border-radius: 10px;
56
- overflow: hidden;
57
- /* border: 5px solid #f1f1f1; */
58
- }
59
-
60
- body .module-class.modal-components .ant-modal .ant-modal-content .ant-modal-body[data-v-3e4642c0] {
61
- height: 100%;
62
- overflow-y: auto;
63
- }
64
-
65
- body .module-class.modal-components .ant-modal .ant-modal-content .ant-modal-body[data-v-3e4642c0]::-webkit-scrollbar {
66
- width: 15px;
67
- height: 20px;
68
- }
69
-
70
- body .module-class.modal-components .ant-modal .ant-modal-content .ant-modal-body[data-v-3e4642c0]::-webkit-scrollbar-track {
71
- border-radius: 100vh;
72
- background: #f7f4ed;
73
- }
74
-
75
- body .module-class.modal-components .ant-modal .ant-modal-content .ant-modal-body[data-v-3e4642c0]::-webkit-scrollbar-thumb {
76
- background: #e0cbcb;
77
- border-radius: 100vh;
78
- border: 3px solid #f6f7ed;
79
- }
80
-
81
- body .module-class.modal-components .ant-modal .ant-modal-content .ant-modal-body[data-v-3e4642c0]::-webkit-scrollbar-thumb:hover {
82
- background: #c0a0b9;
83
- }
1
+ /* 模态框 */
2
+ body .detail-class {
3
+ top: -50px;
4
+ }
5
+ /* body .ant-modal{
6
+ width: 84vw!important;
7
+ height: 80vh!important;
8
+ } */
9
+ body .module-class .ant-modal-header {
10
+ padding: 0;
11
+ }
12
+ body .module-class .ant-modal-body {
13
+ position: relative;
14
+ padding: 100px 0 100px 100px;
15
+ }
16
+
17
+ body .detail-class .ant-modal-body {
18
+ overflow: auto;
19
+ padding: 0 0 30px 0;
20
+ }
21
+
22
+ body .module-class.not-padding .ant-modal-body {
23
+ position: relative;
24
+ padding: 0;
25
+ }
26
+ body .module-class.pwd .ant-modal-body {
27
+ position: relative;
28
+ padding: 100px 0;
29
+ }
30
+
31
+ .ant-scrolling-effect {
32
+ width: 100% !important;
33
+ }
34
+ /* 组件模态框 */
35
+ body .module-class.modal-components .ant-modal {
36
+ top: 5%;
37
+ left: 0px;
38
+ margin-left: 5%;
39
+ margin-right: 5%;
40
+ height: 40%;
41
+ width: auto !important;
42
+ }
43
+ body .module-class.modal-components .ant-modal .ant-modal-content {
44
+ height: 100%;
45
+ }
46
+ body .module-class .ant-modal-content {
47
+ box-sizing: border-box;
48
+ border-radius: 10px;
49
+ overflow: hidden;
50
+ /* border: 5px solid #f1f1f1; */
51
+ }
52
+ body
53
+ .module-class.modal-components
54
+ .ant-modal
55
+ .ant-modal-content
56
+ .ant-modal-body {
57
+ height: 100%;
58
+ overflow-y: auto;
59
+ }
60
+ body
61
+ .module-class.modal-components
62
+ .ant-modal
63
+ .ant-modal-content
64
+ .ant-modal-body::-webkit-scrollbar {
65
+ width: 15px;
66
+ height: 20px;
67
+ }
68
+ body
69
+ .module-class.modal-components
70
+ .ant-modal
71
+ .ant-modal-content
72
+ .ant-modal-body::-webkit-scrollbar-track {
73
+ border-radius: 100vh;
74
+ background: #f7f4ed;
75
+ }
76
+ body
77
+ .module-class.modal-components
78
+ .ant-modal
79
+ .ant-modal-content
80
+ .ant-modal-body::-webkit-scrollbar-thumb {
81
+ background: #e0cbcb;
82
+ border-radius: 100vh;
83
+ border: 3px solid #f6f7ed;
84
+ }
85
+ body
86
+ .module-class.modal-components
87
+ .ant-modal
88
+ .ant-modal-content
89
+ .ant-modal-body::-webkit-scrollbar-thumb:hover {
90
+ background: #c0a0b9;
91
+ }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
 
7
- var _hoisted_1 = /*#__PURE__*/vue.createTextVNode("npm包");
7
+ var _hoisted_1$1 = /*#__PURE__*/vue.createTextVNode("npm包");
8
8
  /**
9
9
  * show:Boolean 是否显示弹窗 v-model:show="Visible"
10
10
  *
@@ -19,7 +19,7 @@ var _hoisted_1 = /*#__PURE__*/vue.createTextVNode("npm包");
19
19
  *
20
20
  * */
21
21
 
22
- var script = /*#__PURE__*/vue.defineComponent({
22
+ var script$1 = /*#__PURE__*/vue.defineComponent({
23
23
  __name: 'IVMrpModal',
24
24
  props: {
25
25
  show: {
@@ -59,7 +59,7 @@ var script = /*#__PURE__*/vue.defineComponent({
59
59
  }, {
60
60
  title: vue.withCtx(function () {
61
61
  return [vue.renderSlot(_ctx.$slots, "title", {}, function () {
62
- return [_hoisted_1];
62
+ return [_hoisted_1$1];
63
63
  })];
64
64
  }),
65
65
  closeIcon: vue.withCtx(function () {
@@ -80,16 +80,130 @@ var script = /*#__PURE__*/vue.defineComponent({
80
80
  }
81
81
  });
82
82
 
83
- script.__scopeId = "data-v-3e4642c0";
84
- script.__file = "src/function-ui/component/IVMrpModal.vue";
83
+ script$1.__file = "src/function-ui/component/IVMrpModal.vue";
84
+
85
+ // utils/arr/tree.ts
86
+
87
+ function _loadChildren(obj, list) {
88
+ var arr = list.filter(function (x) {
89
+ return x.parentId == obj.id;
90
+ });
91
+ if (!arr.length) return;
92
+ obj.children = arr;
93
+ obj.children.forEach(function (x) {
94
+ _loadChildren(x, list);
95
+ });
96
+ return obj;
97
+ }
98
+
99
+ function tranListToTreeData(list) {
100
+ var results = list.filter(function (x) {
101
+ return x.parentId == null;
102
+ });
103
+ results.forEach(function (x) {
104
+ return _loadChildren(x, list);
105
+ });
106
+ return results;
107
+ }
108
+
109
+ var _hoisted_1 = /*#__PURE__*/vue.createElementVNode("div", {
110
+ "class": "text-[#0000006D] text-[14px]"
111
+ }, "所属组织", -1
112
+ /* HOISTED */
113
+ );
114
+ var script = /*#__PURE__*/vue.defineComponent({
115
+ __name: 'IVMrpOrgDropdown',
116
+ props: {
117
+ data: {
118
+ type: Array,
119
+ required: true
120
+ },
121
+ value: {
122
+ type: null,
123
+ required: true
124
+ },
125
+ replaceFields: {
126
+ type: Object,
127
+ required: false
128
+ }
129
+ },
130
+ emits: ["update:value"],
131
+ setup: function setup(__props, _a) {
132
+ var _b;
133
+
134
+ var emit = _a.emit;
135
+ var props = __props;
136
+ var replaceFields = vue.ref((_b = props.replaceFields) !== null && _b !== void 0 ? _b : {
137
+ children: "children",
138
+ label: "displayName",
139
+ key: "id",
140
+ value: "id"
141
+ });
142
+ var dataV = vue.computed(function () {
143
+ console.log(props.data, "npm-------------------------------props.data,");
144
+ console.log(dataV, "npm-------------------------------dataV");
145
+ return tranListToTreeData(props.data);
146
+ });
147
+ var inputV = vue.computed({
148
+ get: function get() {
149
+ return props.value;
150
+ },
151
+ set: function set(value) {
152
+ emit("update:value", value);
153
+ }
154
+ });
155
+ return function (_ctx, _cache) {
156
+ var _component_a_tree_select = vue.resolveComponent("a-tree-select");
157
+
158
+ var _component_a_form_item = vue.resolveComponent("a-form-item");
159
+
160
+ return vue.openBlock(), vue.createBlock(_component_a_form_item, {
161
+ name: "organizationId",
162
+ rules: [{
163
+ required: true,
164
+ message: '请选择所属组织'
165
+ }]
166
+ }, {
167
+ label: vue.withCtx(function () {
168
+ return [_hoisted_1];
169
+ }),
170
+ "default": vue.withCtx(function () {
171
+ return [vue.createVNode(_component_a_tree_select, {
172
+ value: vue.unref(inputV),
173
+ "onUpdate:value": _cache[0] || (_cache[0] = function ($event) {
174
+ return vue.isRef(inputV) ? inputV.value = $event : null;
175
+ }),
176
+ "tree-data": vue.unref(dataV),
177
+ getPopupContainer: function getPopupContainer(triggerNode) {
178
+ return triggerNode.parentNode;
179
+ },
180
+ placeholder: "请选择",
181
+ showArrow: "",
182
+ treeDefaultExpandAll: "",
183
+ style: {
184
+ "width": "300px"
185
+ },
186
+ replaceFields: replaceFields.value
187
+ }, null, 8
188
+ /* PROPS */
189
+ , ["value", "tree-data", "getPopupContainer", "replaceFields"])];
190
+ }),
191
+ _: 1
192
+ /* STABLE */
193
+
194
+ });
195
+ };
196
+ }
197
+ });
198
+
199
+ script.__file = "src/business-ui/component/IVMrpOrgDropdown.vue";
85
200
 
86
201
  /*
87
202
  * @Author: Mr.Cong Wei
88
203
  * @Date: 2022-08-08 18:47:06
89
- * @LastEditTime: 2022-08-09 11:16:28
204
+ * @LastEditTime: 2022-08-09 14:11:28
90
205
  */
91
-
92
- var components = [script];
206
+ var components = [script$1, script];
93
207
  installComponents(); // 单独引用
94
208
 
95
209
  function installComponents() {
@@ -111,5 +225,6 @@ var cAll = {
111
225
  install: install
112
226
  };
113
227
 
114
- exports.IVMrpModal = script;
228
+ exports.IVMrpModal = script$1;
229
+ exports.IVMrpOrgDropdown = script;
115
230
  exports["default"] = cAll;