@lx-frontend/wrap-element-ui 1.0.1-beta.2 → 1.0.1-beta.4
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 +45 -45
- package/package.json +15 -16
- package/src/components/AddMembers/index.vue +157 -157
- package/src/components/AuditSteps/index.vue +140 -140
- package/src/components/DemoComponent/index.vue +20 -20
- package/src/components/EditableTable/README.md +147 -147
- package/src/components/EditableTable/index.less +724 -716
- package/src/components/EditableTable/index.vue +914 -841
- package/src/components/EditableTable/types.ts +116 -94
- package/src/components/EditableTable/useCellHover.ts +71 -71
- package/src/components/EditableTable/useColumnHeaderOperation.ts +325 -187
- package/src/components/EditableTable/useDefaultOperation.ts +95 -95
- package/src/components/EditableTable/useDragSort.ts +290 -291
- package/src/components/EditableTable/usePagination.ts +30 -33
- package/src/components/EditableTable/useRowBgColor.ts +50 -50
- package/src/components/EditableTable/useViewSetting.ts +119 -67
- package/src/components/Ellipsis/MultilineEllipsis.vue +141 -141
- package/src/components/Ellipsis/index.vue +119 -119
- package/src/components/LxTable/index.vue +296 -296
- package/src/components/PopoverForm/index.vue +66 -66
- package/src/components/SearchForm/index.vue +243 -243
- package/src/components/SearchSelect/index.vue +153 -153
- package/src/components/index.ts +24 -24
- package/src/components/singleMessage/index.ts +44 -44
- package/dist/AddMembers/index.vue.d.ts +0 -31
- package/dist/AuditSteps/index.vue.d.ts +0 -46
- package/dist/DemoComponent/index.vue.d.ts +0 -2
- package/dist/EditableTable/index.vue.d.ts +0 -186
- package/dist/EditableTable/types.d.ts +0 -123
- package/dist/EditableTable/useCellHover.d.ts +0 -11
- package/dist/EditableTable/useColumnHeaderOperation.d.ts +0 -106
- package/dist/EditableTable/useDefaultOperation.d.ts +0 -22
- package/dist/EditableTable/useDragSort.d.ts +0 -15
- package/dist/EditableTable/usePagination.d.ts +0 -13
- package/dist/EditableTable/useRowBgColor.d.ts +0 -16
- package/dist/EditableTable/useViewSetting.d.ts +0 -58
- package/dist/Ellipsis/MultilineEllipsis.vue.d.ts +0 -91
- package/dist/Ellipsis/index.vue.d.ts +0 -89
- package/dist/LxTable/index.vue.d.ts +0 -2
- package/dist/PopoverForm/index.vue.d.ts +0 -50
- package/dist/SearchForm/index.vue.d.ts +0 -105
- package/dist/SearchSelect/index.vue.d.ts +0 -53
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.mjs +0 -40826
- package/dist/singleMessage/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
### 介绍
|
|
2
|
-
|
|
3
|
-
`wrap-element-ui` 是一款基于 `element-UI` 二次封装的前端组件库,主要用于快速开发 PC 网站中后台产品
|
|
4
|
-
|
|
5
|
-
### 使用 npm 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm i wrap-element-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### 组件使用
|
|
12
|
-
|
|
13
|
-
可以局部注册所需的组件,适用于与其他框架组合使用的场景
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import { DemoComponent } from "@lx-frontend/wrap-element-ui";
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
components: {
|
|
20
|
-
DemoComponent,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
在模板中,用 `<DemoComponent></DemoComponent>` 自定义标签的方式使用组件
|
|
26
|
-
|
|
27
|
-
```xml
|
|
28
|
-
<template>
|
|
29
|
-
<div>
|
|
30
|
-
<DemoComponent>这是一个 demo 组件</DemoComponent>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 开发指南
|
|
36
|
-
|
|
37
|
-
新增或修改组件时,使用 `pnpm sb:dev` 可以实时预览 stories。
|
|
38
|
-
|
|
39
|
-
开发完成后,可以使用 `pnpm sb:dist` 预览打包后的组件是否能正常工作。与 `pnpm sb:dev` 的区别在于,该命令修改了组件的引用地址,指向了打包后的组件。该命令不能实时预览修改。
|
|
40
|
-
|
|
41
|
-
`build:lib`命令用于打包组件库,生成组件代码及类型定义文件。
|
|
42
|
-
|
|
43
|
-
`build:sb` 用于生成 stories 静态预览文件。
|
|
44
|
-
|
|
45
|
-
`pnpm preview` 用于预览`build:sb`生成的静态文件。
|
|
1
|
+
### 介绍
|
|
2
|
+
|
|
3
|
+
`wrap-element-ui` 是一款基于 `element-UI` 二次封装的前端组件库,主要用于快速开发 PC 网站中后台产品
|
|
4
|
+
|
|
5
|
+
### 使用 npm 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i wrap-element-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### 组件使用
|
|
12
|
+
|
|
13
|
+
可以局部注册所需的组件,适用于与其他框架组合使用的场景
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { DemoComponent } from "@lx-frontend/wrap-element-ui";
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
DemoComponent,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
在模板中,用 `<DemoComponent></DemoComponent>` 自定义标签的方式使用组件
|
|
26
|
+
|
|
27
|
+
```xml
|
|
28
|
+
<template>
|
|
29
|
+
<div>
|
|
30
|
+
<DemoComponent>这是一个 demo 组件</DemoComponent>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 开发指南
|
|
36
|
+
|
|
37
|
+
新增或修改组件时,使用 `pnpm sb:dev` 可以实时预览 stories。
|
|
38
|
+
|
|
39
|
+
开发完成后,可以使用 `pnpm sb:dist` 预览打包后的组件是否能正常工作。与 `pnpm sb:dev` 的区别在于,该命令修改了组件的引用地址,指向了打包后的组件。该命令不能实时预览修改。
|
|
40
|
+
|
|
41
|
+
`build:lib`命令用于打包组件库,生成组件代码及类型定义文件。
|
|
42
|
+
|
|
43
|
+
`build:sb` 用于生成 stories 静态预览文件。
|
|
44
|
+
|
|
45
|
+
`pnpm preview` 用于预览`build:sb`生成的静态文件。
|
package/package.json
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lx-frontend/wrap-element-ui",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.4",
|
|
4
4
|
"description": "wrap-element-ui",
|
|
5
5
|
"author": "",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "src/components/index.ts",
|
|
7
7
|
"private": false,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"clean": "rimraf dist",
|
|
10
|
-
"sb:dev": "cross-env MODE=development storybook dev -p 6006",
|
|
11
|
-
"sb:dist": "cross-env MODE=production pnpm build:lib && storybook dev -p 6006",
|
|
12
|
-
"build:lib": "pnpm clean && vite build",
|
|
13
|
-
"build:sb": "cross-env MODE=production rimraf storybook-static && pnpm build:lib && storybook build",
|
|
14
|
-
"preview": "serve ./storybook-static",
|
|
15
|
-
"publish:dev": "npm publish --access public --tag beta",
|
|
16
|
-
"publish:prod": "npm publish --access public",
|
|
17
|
-
"cdn": "gulp oss",
|
|
18
|
-
"lint": "eslint src"
|
|
19
|
-
},
|
|
20
8
|
"files": [
|
|
21
|
-
"dist",
|
|
22
9
|
"README.md",
|
|
23
10
|
"package.json",
|
|
24
11
|
"src/components"
|
|
@@ -69,5 +56,17 @@
|
|
|
69
56
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
70
57
|
"vite-tsconfig-paths": "^4.3.2",
|
|
71
58
|
"vue-template-compiler": "^2.6.10"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"clean": "rimraf dist",
|
|
62
|
+
"sb:dev": "cross-env MODE=development storybook dev -p 6006",
|
|
63
|
+
"sb:dist": "cross-env MODE=production pnpm build:lib && storybook dev -p 6006",
|
|
64
|
+
"build:lib": "pnpm clean && vite build",
|
|
65
|
+
"build:sb": "cross-env MODE=production rimraf storybook-static && pnpm build:lib && storybook build",
|
|
66
|
+
"preview": "serve ./storybook-static",
|
|
67
|
+
"publish:dev": "npm publish --access public --tag beta",
|
|
68
|
+
"publish:prod": "npm publish --access public",
|
|
69
|
+
"cdn": "gulp oss",
|
|
70
|
+
"lint": "eslint src"
|
|
72
71
|
}
|
|
73
|
-
}
|
|
72
|
+
}
|
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<PopoverForm
|
|
4
|
-
:title="title"
|
|
5
|
-
:with-submit-btn="false"
|
|
6
|
-
:width="360"
|
|
7
|
-
@on-change="handleCloseSelectPopup"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
slot="form"
|
|
11
|
-
class="team-setting__members-popover"
|
|
12
|
-
>
|
|
13
|
-
<div class="team-setting__members-select">
|
|
14
|
-
<el-input
|
|
15
|
-
v-model="searchQuery"
|
|
16
|
-
placeholder="请输入姓名"
|
|
17
|
-
@input="handleInputSearch(searchQuery, $attrs.keyId)"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
20
|
-
<div
|
|
21
|
-
v-if="searchQuery && !options.length && !fetchLoading"
|
|
22
|
-
class="team-setting__empty-members-options"
|
|
23
|
-
>
|
|
24
|
-
{{ $attrs.empty || '系统未登记该员工,请先添加员工账号' }}
|
|
25
|
-
</div>
|
|
26
|
-
<ul
|
|
27
|
-
v-else
|
|
28
|
-
class="team-setting__members-options"
|
|
29
|
-
>
|
|
30
|
-
<li
|
|
31
|
-
class="team-setting__members-option"
|
|
32
|
-
v-for="item in options"
|
|
33
|
-
:key="item[$attrs.showConfig.id]"
|
|
34
|
-
>
|
|
35
|
-
<div class="team-setting__members-option-left" v-if="isShowRoles">
|
|
36
|
-
{{ `${item[$attrs.showConfig.name]} | ${item.roles}` }}
|
|
37
|
-
</div>
|
|
38
|
-
<div class="team-setting__members-option-left" v-else>
|
|
39
|
-
{{item[$attrs.showConfig.name]}}
|
|
40
|
-
</div>
|
|
41
|
-
<el-button
|
|
42
|
-
v-if="item.is_selected"
|
|
43
|
-
type="text"
|
|
44
|
-
disabled
|
|
45
|
-
>
|
|
46
|
-
已添加
|
|
47
|
-
</el-button>
|
|
48
|
-
<el-button
|
|
49
|
-
v-else
|
|
50
|
-
type="text"
|
|
51
|
-
@click="handleAdd($attrs.keyId, item)"
|
|
52
|
-
>
|
|
53
|
-
添加
|
|
54
|
-
</el-button>
|
|
55
|
-
</li>
|
|
56
|
-
</ul>
|
|
57
|
-
</div>
|
|
58
|
-
<el-button
|
|
59
|
-
slot="reference"
|
|
60
|
-
type="text"
|
|
61
|
-
icon="el-icon-plus"
|
|
62
|
-
>
|
|
63
|
-
{{ title }}
|
|
64
|
-
</el-button>
|
|
65
|
-
</PopoverForm>
|
|
66
|
-
</div>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<script>
|
|
70
|
-
import PopoverForm from '../PopoverForm'
|
|
71
|
-
export default {
|
|
72
|
-
name: 'AddMembers',
|
|
73
|
-
components: {
|
|
74
|
-
PopoverForm
|
|
75
|
-
},
|
|
76
|
-
props: {
|
|
77
|
-
/** 成员数据 */
|
|
78
|
-
technicianOptions: Array,
|
|
79
|
-
/** 获取数据加载中 */
|
|
80
|
-
fetchTechniciansLoading: Boolean,
|
|
81
|
-
/** 弹窗标题 */
|
|
82
|
-
title: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: '添加成员',
|
|
85
|
-
},
|
|
86
|
-
/** 角色名称展示 */
|
|
87
|
-
isShowRoles: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: true,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
data() {
|
|
93
|
-
return {
|
|
94
|
-
searchQuery: '',
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
watch: {
|
|
98
|
-
},
|
|
99
|
-
methods: {
|
|
100
|
-
handleCloseSelectPopup(show) {
|
|
101
|
-
if (show) return;
|
|
102
|
-
this.searchQuery = '';
|
|
103
|
-
this.$emit('update:options', []);
|
|
104
|
-
},
|
|
105
|
-
handleInputSearch(query, keyId) {
|
|
106
|
-
this.$emit('fetchMethods', { query, keyId });
|
|
107
|
-
},
|
|
108
|
-
handleAdd(id, item) {
|
|
109
|
-
const query = { id, item };
|
|
110
|
-
this.$emit('handleAdd', query);
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<style lang="less">
|
|
117
|
-
.team-setting {
|
|
118
|
-
&__members-popover {
|
|
119
|
-
padding: 20px 0;
|
|
120
|
-
margin: 0 20px;
|
|
121
|
-
height: 350px;
|
|
122
|
-
overflow-y: auto;
|
|
123
|
-
}
|
|
124
|
-
&__empty-members {
|
|
125
|
-
&-options {
|
|
126
|
-
font-size: 12px;
|
|
127
|
-
color: #80838e;
|
|
128
|
-
text-align: center;
|
|
129
|
-
margin-top: 10px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
&__members-options {
|
|
133
|
-
display: flex;
|
|
134
|
-
flex-direction: column;
|
|
135
|
-
}
|
|
136
|
-
&__members-option {
|
|
137
|
-
display: flex;
|
|
138
|
-
justify-content: space-between;
|
|
139
|
-
align-items: center;
|
|
140
|
-
height: 30px;
|
|
141
|
-
&-left {
|
|
142
|
-
width: 250px;
|
|
143
|
-
overflow: hidden;
|
|
144
|
-
text-overflow: ellipsis;
|
|
145
|
-
white-space: nowrap;
|
|
146
|
-
color: #80838e;
|
|
147
|
-
}
|
|
148
|
-
&-right {
|
|
149
|
-
color: #1890ff;
|
|
150
|
-
&--selected {
|
|
151
|
-
color: #80838e;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<PopoverForm
|
|
4
|
+
:title="title"
|
|
5
|
+
:with-submit-btn="false"
|
|
6
|
+
:width="360"
|
|
7
|
+
@on-change="handleCloseSelectPopup"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
slot="form"
|
|
11
|
+
class="team-setting__members-popover"
|
|
12
|
+
>
|
|
13
|
+
<div class="team-setting__members-select">
|
|
14
|
+
<el-input
|
|
15
|
+
v-model="searchQuery"
|
|
16
|
+
placeholder="请输入姓名"
|
|
17
|
+
@input="handleInputSearch(searchQuery, $attrs.keyId)"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div
|
|
21
|
+
v-if="searchQuery && !options.length && !fetchLoading"
|
|
22
|
+
class="team-setting__empty-members-options"
|
|
23
|
+
>
|
|
24
|
+
{{ $attrs.empty || '系统未登记该员工,请先添加员工账号' }}
|
|
25
|
+
</div>
|
|
26
|
+
<ul
|
|
27
|
+
v-else
|
|
28
|
+
class="team-setting__members-options"
|
|
29
|
+
>
|
|
30
|
+
<li
|
|
31
|
+
class="team-setting__members-option"
|
|
32
|
+
v-for="item in options"
|
|
33
|
+
:key="item[$attrs.showConfig.id]"
|
|
34
|
+
>
|
|
35
|
+
<div class="team-setting__members-option-left" v-if="isShowRoles">
|
|
36
|
+
{{ `${item[$attrs.showConfig.name]} | ${item.roles}` }}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="team-setting__members-option-left" v-else>
|
|
39
|
+
{{item[$attrs.showConfig.name]}}
|
|
40
|
+
</div>
|
|
41
|
+
<el-button
|
|
42
|
+
v-if="item.is_selected"
|
|
43
|
+
type="text"
|
|
44
|
+
disabled
|
|
45
|
+
>
|
|
46
|
+
已添加
|
|
47
|
+
</el-button>
|
|
48
|
+
<el-button
|
|
49
|
+
v-else
|
|
50
|
+
type="text"
|
|
51
|
+
@click="handleAdd($attrs.keyId, item)"
|
|
52
|
+
>
|
|
53
|
+
添加
|
|
54
|
+
</el-button>
|
|
55
|
+
</li>
|
|
56
|
+
</ul>
|
|
57
|
+
</div>
|
|
58
|
+
<el-button
|
|
59
|
+
slot="reference"
|
|
60
|
+
type="text"
|
|
61
|
+
icon="el-icon-plus"
|
|
62
|
+
>
|
|
63
|
+
{{ title }}
|
|
64
|
+
</el-button>
|
|
65
|
+
</PopoverForm>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
import PopoverForm from '../PopoverForm'
|
|
71
|
+
export default {
|
|
72
|
+
name: 'AddMembers',
|
|
73
|
+
components: {
|
|
74
|
+
PopoverForm
|
|
75
|
+
},
|
|
76
|
+
props: {
|
|
77
|
+
/** 成员数据 */
|
|
78
|
+
technicianOptions: Array,
|
|
79
|
+
/** 获取数据加载中 */
|
|
80
|
+
fetchTechniciansLoading: Boolean,
|
|
81
|
+
/** 弹窗标题 */
|
|
82
|
+
title: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '添加成员',
|
|
85
|
+
},
|
|
86
|
+
/** 角色名称展示 */
|
|
87
|
+
isShowRoles: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
data() {
|
|
93
|
+
return {
|
|
94
|
+
searchQuery: '',
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
watch: {
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
handleCloseSelectPopup(show) {
|
|
101
|
+
if (show) return;
|
|
102
|
+
this.searchQuery = '';
|
|
103
|
+
this.$emit('update:options', []);
|
|
104
|
+
},
|
|
105
|
+
handleInputSearch(query, keyId) {
|
|
106
|
+
this.$emit('fetchMethods', { query, keyId });
|
|
107
|
+
},
|
|
108
|
+
handleAdd(id, item) {
|
|
109
|
+
const query = { id, item };
|
|
110
|
+
this.$emit('handleAdd', query);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style lang="less">
|
|
117
|
+
.team-setting {
|
|
118
|
+
&__members-popover {
|
|
119
|
+
padding: 20px 0;
|
|
120
|
+
margin: 0 20px;
|
|
121
|
+
height: 350px;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
}
|
|
124
|
+
&__empty-members {
|
|
125
|
+
&-options {
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
color: #80838e;
|
|
128
|
+
text-align: center;
|
|
129
|
+
margin-top: 10px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
&__members-options {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
}
|
|
136
|
+
&__members-option {
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
align-items: center;
|
|
140
|
+
height: 30px;
|
|
141
|
+
&-left {
|
|
142
|
+
width: 250px;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
text-overflow: ellipsis;
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
color: #80838e;
|
|
147
|
+
}
|
|
148
|
+
&-right {
|
|
149
|
+
color: #1890ff;
|
|
150
|
+
&--selected {
|
|
151
|
+
color: #80838e;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
</style>
|