@lx-frontend/wrap-element-ui 1.0.0-beta.6 → 1.0.0-beta.8

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/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "wrap-element-ui",
5
5
  "author": "",
6
- "main": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
6
+ "main": "src/components/index.ts",
8
7
  "private": false,
9
8
  "scripts": {
10
9
  "clean": "rimraf dist",
@@ -19,7 +18,6 @@
19
18
  "lint": "eslint src"
20
19
  },
21
20
  "files": [
22
- "dist",
23
21
  "README.md",
24
22
  "package.json",
25
23
  "src/components"
@@ -65,7 +63,7 @@
65
63
  "storybook": "7.6.19",
66
64
  "through2": "^4.0.2",
67
65
  "typescript": "^4.9.5",
68
- "vite": "^3.2.7",
66
+ "vite": "^4.5.3",
69
67
  "vite-plugin-dts": "^3.9.1",
70
68
  "vite-plugin-lib-inject-css": "^2.1.1",
71
69
  "vite-tsconfig-paths": "^4.3.2",
@@ -4,37 +4,40 @@
4
4
  :title="title"
5
5
  :with-submit-btn="false"
6
6
  :width="360"
7
- @on-change="handleCloseTechniciansSelectPopup"
7
+ @on-change="handleCloseSelectPopup"
8
8
  >
9
9
  <div
10
10
  slot="form"
11
- class="team-setting__technicians-popover"
11
+ class="team-setting__members-popover"
12
12
  >
13
- <div class="team-setting__technicians-select">
13
+ <div class="team-setting__members-select">
14
14
  <el-input
15
- v-model="techniciansSearchQuery"
15
+ v-model="searchQuery"
16
16
  placeholder="请输入姓名"
17
- @input="handleInputTechniciansSearch"
17
+ @input="handleInputSearch(searchQuery, $attrs.keyId)"
18
18
  />
19
19
  </div>
20
20
  <div
21
- v-if="techniciansSearchQuery && !technicianOptions.length && !fetchTechniciansLoading"
22
- class="team-setting__empty-technicians-options"
21
+ v-if="searchQuery && !options.length && !fetchLoading"
22
+ class="team-setting__empty-members-options"
23
23
  >
24
24
  {{ $attrs.empty || '系统未登记该员工,请先添加员工账号' }}
25
25
  </div>
26
26
  <ul
27
27
  v-else
28
- class="team-setting__technicians-options"
28
+ class="team-setting__members-options"
29
29
  >
30
30
  <li
31
- class="team-setting__technicians-option"
32
- v-for="item in technicianOptions"
31
+ class="team-setting__members-option"
32
+ v-for="item in options"
33
33
  :key="item[$attrs.showConfig.id]"
34
34
  >
35
- <div class="team-setting__technicians-option-left">
35
+ <div class="team-setting__members-option-left" v-if="isShowRoles">
36
36
  {{ `${item[$attrs.showConfig.name]} | ${item.roles}` }}
37
37
  </div>
38
+ <div class="team-setting__members-option-left" v-else>
39
+ {{item[$attrs.showConfig.name]}}
40
+ </div>
38
41
  <el-button
39
42
  v-if="item.is_selected"
40
43
  type="text"
@@ -45,7 +48,7 @@
45
48
  <el-button
46
49
  v-else
47
50
  type="text"
48
- @click="handleAddTechnician($attrs.keyId, item)"
51
+ @click="handleAdd($attrs.keyId, item)"
49
52
  >
50
53
  添加
51
54
  </el-button>
@@ -80,26 +83,31 @@ export default {
80
83
  type: String,
81
84
  default: '添加成员',
82
85
  },
86
+ /** 角色名称展示 */
87
+ isShowRoles: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
83
91
  },
84
92
  data() {
85
93
  return {
86
- techniciansSearchQuery: '',
94
+ searchQuery: '',
87
95
  }
88
96
  },
89
97
  watch: {
90
98
  },
91
99
  methods: {
92
- handleCloseTechniciansSelectPopup(show) {
100
+ handleCloseSelectPopup(show) {
93
101
  if (show) return;
94
- this.techniciansSearchQuery = '';
95
- this.$emit('update:technicianOptions', []);
102
+ this.searchQuery = '';
103
+ this.$emit('update:options', []);
96
104
  },
97
- handleInputTechniciansSearch(query) {
98
- this.$emit('fetchTechniciansMethods', query);
105
+ handleInputSearch(query, keyId) {
106
+ this.$emit('fetchMethods', { query, keyId });
99
107
  },
100
- handleAddTechnician(id, item) {
108
+ handleAdd(id, item) {
101
109
  const query = { id, item };
102
- this.$emit('handleAddTechnician', query);
110
+ this.$emit('handleAdd', query);
103
111
  },
104
112
  },
105
113
  };
@@ -107,25 +115,25 @@ export default {
107
115
 
108
116
  <style lang="less">
109
117
  .team-setting {
110
- &__technicians-popover {
111
- padding: 20px;
118
+ &__members-popover {
119
+ padding: 20px 0;
120
+ margin: 0 20px;
112
121
  height: 350px;
113
122
  overflow-y: auto;
114
123
  }
115
- &__technicians-select {
116
- width: 320px;
117
- }
118
- &__empty-technicians-options {
119
- font-size: 12px;
120
- color: #80838e;
121
- text-align: center;
122
- margin-top: 10px;
124
+ &__empty-members {
125
+ &-options {
126
+ font-size: 12px;
127
+ color: #80838e;
128
+ text-align: center;
129
+ margin-top: 10px;
130
+ }
123
131
  }
124
- &__technicians-options {
132
+ &__members-options {
125
133
  display: flex;
126
134
  flex-direction: column;
127
135
  }
128
- &__technicians-option {
136
+ &__members-option {
129
137
  display: flex;
130
138
  justify-content: space-between;
131
139
  align-items: center;
@@ -1,31 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{
2
- /** 成员数据 */
3
- technicianOptions: ArrayConstructor;
4
- /** 获取数据加载中 */
5
- fetchTechniciansLoading: BooleanConstructor;
6
- /** 弹窗标题 */
7
- title: {
8
- type: StringConstructor;
9
- default: string;
10
- };
11
- }, {}, {
12
- techniciansSearchQuery: string;
13
- }, {}, {
14
- handleCloseTechniciansSelectPopup(show: any): void;
15
- handleInputTechniciansSearch(query: any): void;
16
- handleAddTechnician(id: any, item: any): void;
17
- }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
18
- /** 成员数据 */
19
- technicianOptions: ArrayConstructor;
20
- /** 获取数据加载中 */
21
- fetchTechniciansLoading: BooleanConstructor;
22
- /** 弹窗标题 */
23
- title: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- }>>, {
28
- fetchTechniciansLoading: boolean;
29
- title: string;
30
- }>;
31
- export default _default;
@@ -1,46 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{
2
- candidates: {
3
- type: ArrayConstructor;
4
- };
5
- value: {
6
- type: ArrayConstructor;
7
- default(): never[];
8
- };
9
- maxSelect: {
10
- type: NumberConstructor;
11
- default: number;
12
- };
13
- stepNum: {
14
- type: NumberConstructor;
15
- default: number;
16
- };
17
- }, {}, {}, {
18
- isAdd(): boolean;
19
- }, {
20
- syncSteps(modification: any): void;
21
- handleEditCandidate(val: any, index: any): void;
22
- handleDeleteStep(i: any): void;
23
- handleAddStep(): void;
24
- isValidateSteps(): boolean;
25
- }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
26
- candidates: {
27
- type: ArrayConstructor;
28
- };
29
- value: {
30
- type: ArrayConstructor;
31
- default(): never[];
32
- };
33
- maxSelect: {
34
- type: NumberConstructor;
35
- default: number;
36
- };
37
- stepNum: {
38
- type: NumberConstructor;
39
- default: number;
40
- };
41
- }>>, {
42
- value: unknown[];
43
- maxSelect: number;
44
- stepNum: number;
45
- }>;
46
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,291 +0,0 @@
1
- import { ITableDataItem, IColumnConfig, IDefaultOperationType, IColorList } from './types';
2
-
3
- interface IProps {
4
- /** 表格数据 */
5
- dataList: ITableDataItem[];
6
- /** 列配置 */
7
- columnConfig: IColumnConfig[];
8
- /** 是否展示展开行 */
9
- hasExpandRow?: boolean;
10
- /** 是否展示序号 */
11
- hasIndexColumn?: boolean;
12
- /** 是否展示选择列 */
13
- hasSelectionColumn?: boolean;
14
- /** 是否支持行拖拽 */
15
- rowDragAble?: boolean;
16
- /** 表格总条数 */
17
- total: number;
18
- /** 自定义列操作,当前支持行编辑(edit),删除(delete),置顶(top) */
19
- defaultOperations?: IDefaultOperationType[];
20
- /** 行背景色列表 */
21
- colorList?: IColorList;
22
- /** 左侧固定列数 */
23
- leftFixedCount?: number;
24
- /** 性能优化参数,调整拖拽的范围 */
25
- dragSemiRange?: number;
26
- /** 是否显示加载 */
27
- loading?: boolean;
28
- /** 是否隐藏显示设置按钮 */
29
- hideViewSettingBtn?: boolean;
30
- /** 设置的缓存的key */
31
- settingStorgeKey?: string;
32
- /** 前端排序,默认关闭 */
33
- localSort?: boolean;
34
- /** 前端过滤,默认关闭 */
35
- localFilter?: boolean;
36
- /** 页码 */
37
- currentPage: number;
38
- }
39
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IProps>, {
40
- dataList: () => never[];
41
- columnConfig: () => never[];
42
- hasExpandRow: boolean;
43
- hasIndexColumn: boolean;
44
- hasSelectionColumn: boolean;
45
- rowDragAble: boolean;
46
- total: number;
47
- defaultOperations: () => never[];
48
- colorList: () => never[];
49
- leftFixedCount: number;
50
- dragSemiRange: number;
51
- loading: boolean;
52
- hideViewSettingBtn: boolean;
53
- settingStorgeKey: string;
54
- localSort: boolean;
55
- localFilter: boolean;
56
- currentPage: number;
57
- }>, {
58
- closeAllExpandedRows: () => void;
59
- openViewSetting: () => void;
60
- elTableRef: any;
61
- setSort: (params: {
62
- order: "descending" | "ascending";
63
- prop: string;
64
- }) => void;
65
- clearSort: () => void;
66
- setSearchParams: (params: Record<string, any>) => void;
67
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
68
- "selection-change": (selection: any) => void;
69
- "row-bg-change": (param: {
70
- colorId: number;
71
- row: ITableDataItem;
72
- rowIndex: number;
73
- }) => void;
74
- "row-drag-drop": (param: {
75
- row: any;
76
- fromIndex: number;
77
- toIndex: number;
78
- page: number;
79
- size: number;
80
- }) => void;
81
- "row-delete": (param: {
82
- row: any;
83
- index: number;
84
- page: number;
85
- size: number;
86
- }) => void;
87
- "row-edit": (param: {
88
- row: any;
89
- index: number;
90
- page: number;
91
- size: number;
92
- }) => void;
93
- "row-pin-to-top": (param: {
94
- row: any;
95
- rawIndex: number;
96
- page: number;
97
- size: number;
98
- }) => void;
99
- "row-edit-save": (param: {
100
- page: number;
101
- size: number;
102
- row: any;
103
- changedData: Record<string, any>;
104
- }) => void;
105
- "row-edit-cancel": (param: {
106
- row: any;
107
- page: number;
108
- size: number;
109
- }) => void;
110
- "page-change": (param: {
111
- page: number;
112
- size: number;
113
- }) => void;
114
- search: (param: Record<string, any>) => void;
115
- "sort-change": (param: {
116
- order: "descending" | "ascending" | null;
117
- prop: string;
118
- }) => void;
119
- }, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IProps>, {
120
- dataList: () => never[];
121
- columnConfig: () => never[];
122
- hasExpandRow: boolean;
123
- hasIndexColumn: boolean;
124
- hasSelectionColumn: boolean;
125
- rowDragAble: boolean;
126
- total: number;
127
- defaultOperations: () => never[];
128
- colorList: () => never[];
129
- leftFixedCount: number;
130
- dragSemiRange: number;
131
- loading: boolean;
132
- hideViewSettingBtn: boolean;
133
- settingStorgeKey: string;
134
- localSort: boolean;
135
- localFilter: boolean;
136
- currentPage: number;
137
- }>>>, {
138
- colorList: IColorList;
139
- hasExpandRow: boolean;
140
- dataList: ITableDataItem[];
141
- columnConfig: IColumnConfig[];
142
- hasIndexColumn: boolean;
143
- hasSelectionColumn: boolean;
144
- rowDragAble: boolean;
145
- total: number;
146
- defaultOperations: IDefaultOperationType[];
147
- leftFixedCount: number;
148
- dragSemiRange: number;
149
- loading: boolean;
150
- hideViewSettingBtn: boolean;
151
- settingStorgeKey: string;
152
- localSort: boolean;
153
- localFilter: boolean;
154
- currentPage: number;
155
- }>, Partial<Record<string, (_: {
156
- [x: string]: any;
157
- value: string | number;
158
- text: string;
159
- }) => any>> & Partial<Record<string, (_: {
160
- [x: string]: any;
161
- value: string | number;
162
- text: string;
163
- }) => any>> & Partial<Record<string, (_: {
164
- [x: string]: any;
165
- prop: string;
166
- label: string;
167
- editType?: import('./types').IEditType | undefined;
168
- sortable?: boolean | undefined;
169
- slotName?: string | undefined;
170
- isAlwaysShow?: boolean | undefined;
171
- defaultHide?: boolean | undefined;
172
- search?: boolean | {
173
- /** 行背景色列表 */
174
- prop: string;
175
- label: string;
176
- validator?: ((value: string) => boolean) | undefined;
177
- }[] | undefined;
178
- summary?: boolean | undefined;
179
- summaryMethod?: ((values: any[]) => string | number) | undefined;
180
- filters?: {
181
- type?: "checkbox" | "radio" | undefined;
182
- options: {
183
- [key: string]: any;
184
- value: string | number;
185
- text: string;
186
- }[];
187
- /** 是否展示展开行 */
188
- default?: string | number | string[] | number[] | undefined;
189
- } | {
190
- [key: string]: any;
191
- value: string | number;
192
- text: string;
193
- }[] | undefined;
194
- } | {
195
- [x: string]: any;
196
- prop: string;
197
- label: string;
198
- editType?: import('./types').IEditType | undefined;
199
- sortable?: boolean | undefined;
200
- slotName?: string | undefined;
201
- isAlwaysShow?: boolean | undefined;
202
- defaultHide?: boolean | undefined;
203
- search?: boolean | {
204
- /** 行背景色列表 */
205
- prop: string;
206
- label: string;
207
- validator?: ((value: string) => boolean) | undefined;
208
- }[] | undefined;
209
- summary?: boolean | undefined;
210
- summaryMethod?: ((values: any[]) => string | number) | undefined;
211
- filters?: {
212
- type?: "checkbox" | "radio" | undefined;
213
- options: {
214
- [key: string]: any;
215
- value: string | number;
216
- text: string;
217
- }[];
218
- /** 是否展示展开行 */
219
- default?: string | number | string[] | number[] | undefined;
220
- } | {
221
- [key: string]: any;
222
- value: string | number;
223
- text: string;
224
- }[] | undefined;
225
- inputType: string | number;
226
- } | {
227
- [x: string]: any;
228
- prop: string;
229
- label: string;
230
- editType?: import('./types').IEditType | undefined;
231
- sortable?: boolean | undefined;
232
- slotName?: string | undefined;
233
- isAlwaysShow?: boolean | undefined;
234
- defaultHide?: boolean | undefined;
235
- search?: boolean | {
236
- /** 行背景色列表 */
237
- prop: string;
238
- label: string;
239
- validator?: ((value: string) => boolean) | undefined;
240
- }[] | undefined;
241
- summary?: boolean | undefined;
242
- summaryMethod?: ((values: any[]) => string | number) | undefined;
243
- filters?: {
244
- type?: "checkbox" | "radio" | undefined;
245
- options: {
246
- [key: string]: any;
247
- value: string | number;
248
- text: string;
249
- }[];
250
- /** 是否展示展开行 */
251
- default?: string | number | string[] | number[] | undefined;
252
- } | {
253
- [key: string]: any;
254
- value: string | number;
255
- text: string;
256
- }[] | undefined;
257
- options: {
258
- [key: string]: any;
259
- key: string;
260
- value: string | number;
261
- }[];
262
- }) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<any, (_: {
263
- scope: any;
264
- column: IColumnConfig;
265
- }) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<any, (_: any) => any>> & Partial<Record<any, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
266
- expand?(_: any): any;
267
- "custom-operation"?(_: any): any;
268
- }>;
269
- export default _default;
270
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
271
- type __VLS_TypePropsToRuntimeProps<T> = {
272
- [K in keyof T]-?: {} extends Pick<T, K> ? {
273
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
274
- } : {
275
- type: import('vue').PropType<T[K]>;
276
- required: true;
277
- };
278
- };
279
- type __VLS_WithDefaults<P, D> = {
280
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
281
- default: D[K];
282
- }> : P[K];
283
- };
284
- type __VLS_Prettify<T> = {
285
- [K in keyof T]: T[K];
286
- } & {};
287
- type __VLS_WithTemplateSlots<T, S> = T & {
288
- new (): {
289
- $scopedSlots: S;
290
- };
291
- };
@@ -1,151 +0,0 @@
1
- export declare enum IEditType {
2
- INPUT = "input",
3
- SELECT = "select",
4
- DATE_ONLY = "date"
5
- }
6
- export interface IColumnConfigRequired {
7
- prop: string;
8
- label: string;
9
- editType?: IEditType;
10
- sortable?: boolean;
11
- slotName?: string;
12
- isAlwaysShow?: boolean;
13
- /** 默认隐藏,显示设置中,该列默认隐藏 */
14
- defaultHide?: boolean;
15
- /** 列是否允许搜索,true则表头弹窗会多一个搜索框,一列中有多个搜索字段时传数组进行配置 */
16
- search?: boolean | ISearchOptions;
17
- summary?: boolean;
18
- summaryMethod?: (values: any[]) => string | number;
19
- /** 过滤,传数组时默认复选框 */
20
- filters?: {
21
- type?: 'checkbox' | 'radio';
22
- options: FiltersOption[];
23
- default?: string | number | string[] | number[];
24
- } | FiltersOption[];
25
- [key: string]: any;
26
- }
27
- type FiltersOption = {
28
- value: string | number;
29
- text: string;
30
- [key: string]: any;
31
- };
32
- type ISearchOptions = {
33
- prop: string;
34
- label: string;
35
- validator?: (value: string) => boolean;
36
- }[];
37
- type IInputColumn = IColumnConfigRequired & {
38
- inputType: string | number;
39
- };
40
- type ISelectColumn = IColumnConfigRequired & {
41
- options: {
42
- key: string;
43
- value: string | number;
44
- [key: string]: any;
45
- }[];
46
- };
47
- type IDateOnlyColumn = IColumnConfigRequired;
48
- type IDateTimeColumn = IColumnConfigRequired;
49
- export type IColumnConfig = IInputColumn | ISelectColumn | IDateOnlyColumn | IDateTimeColumn;
50
- export type IColorList = {
51
- name: string;
52
- textColor: string;
53
- sampleColor: string;
54
- bgColor: string;
55
- id: number;
56
- default?: boolean;
57
- }[];
58
- type IPointLoc = {
59
- x: number;
60
- y: number;
61
- };
62
- export type IDraggingData = {
63
- isDragging?: boolean;
64
- startPosition?: IPointLoc;
65
- draggingRow?: HTMLElement | HTMLElement[];
66
- draggingIndex?: number;
67
- dropIndex?: number;
68
- rowDoms?: Record<number, HTMLElement[]>;
69
- rowHeight?: number;
70
- rowsRange?: ([number, number] | undefined)[];
71
- hiddenTds?: HTMLElement[];
72
- fullScreenDiv?: HTMLElement;
73
- };
74
- export type IDefaultOperationType = 'edit' | 'delete' | 'top';
75
- export type ITableDataItem = {
76
- colorId?: number;
77
- isPinned?: boolean;
78
- [k: string]: any;
79
- };
80
- export interface IProps {
81
- dataList: ITableDataItem[];
82
- columnConfig: IColumnConfig[];
83
- hasExpandRow?: boolean;
84
- hasIndexColumn?: boolean;
85
- hasSelectionColumn?: boolean;
86
- rowDragAble?: boolean;
87
- total: number;
88
- defaultOperations?: IDefaultOperationType[];
89
- colorList?: IColorList;
90
- leftFixedCount?: number;
91
- dragSemiRange?: number;
92
- loading?: boolean;
93
- settingStorgeKey?: string;
94
- localSort?: boolean;
95
- localFilter?: boolean;
96
- currentPage: number;
97
- }
98
- export interface IEmits {
99
- (e: 'selection-change', selection: any): void;
100
- (e: 'row-bg-change', param: {
101
- colorId: number;
102
- row: ITableDataItem;
103
- rowIndex: number;
104
- }): void;
105
- (e: 'row-drag-drop', param: {
106
- row: any;
107
- fromIndex: number;
108
- toIndex: number;
109
- page: number;
110
- size: number;
111
- }): void;
112
- (e: 'row-delete', param: {
113
- row: any;
114
- index: number;
115
- page: number;
116
- size: number;
117
- }): void;
118
- (e: 'row-edit', param: {
119
- row: any;
120
- index: number;
121
- page: number;
122
- size: number;
123
- }): void;
124
- (e: 'row-pin-to-top', param: {
125
- row: any;
126
- rawIndex: number;
127
- page: number;
128
- size: number;
129
- }): void;
130
- (e: 'row-edit-save', param: {
131
- page: number;
132
- size: number;
133
- row: any;
134
- changedData: Record<string, any>;
135
- }): void;
136
- (e: 'row-edit-cancel', param: {
137
- row: any;
138
- page: number;
139
- size: number;
140
- }): void;
141
- (e: 'page-change', param: {
142
- page: number;
143
- size: number;
144
- }): void;
145
- (e: 'search', param: Record<string, any>): void;
146
- (e: 'sort-change', param: {
147
- order: 'descending' | 'ascending' | null;
148
- prop: string;
149
- }): void;
150
- }
151
- export {};