@lx-frontend/wrap-element-ui 1.0.28 → 2.0.0-beta.1

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 (32) hide show
  1. package/package.json +21 -12
  2. package/src/components/AddMembers/index.vue +100 -89
  3. package/src/components/AuditSteps/index.vue +107 -74
  4. package/src/components/DemoComponent/index.vue +8 -5
  5. package/src/components/EditableTable/bizHooks/useColumnHeaderOperation.ts +5 -4
  6. package/src/components/EditableTable/bizHooks/useDefaultOperation.ts +12 -4
  7. package/src/components/EditableTable/bizHooks/useDragSort.ts +6 -2
  8. package/src/components/EditableTable/bizHooks/useRowBgColor.ts +6 -2
  9. package/src/components/EditableTable/bizHooks/useViewSetting.ts +2 -1
  10. package/src/components/EditableTable/features/bizColorSelect.vue +4 -3
  11. package/src/components/EditableTable/features/bizEditCell.vue +6 -6
  12. package/src/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue +3 -3
  13. package/src/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue +3 -4
  14. package/src/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue +8 -8
  15. package/src/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue +2 -2
  16. package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue +2 -2
  17. package/src/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue +3 -4
  18. package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +28 -19
  19. package/src/components/EditableTable/features/bizTableOperatePopover.vue +11 -9
  20. package/src/components/EditableTable/features/bizViewSettingDialog.vue +10 -6
  21. package/src/components/EditableTable/index.less +189 -186
  22. package/src/components/EditableTable/index.vue +25 -15
  23. package/src/components/EditableTable/types/index.ts +4 -4
  24. package/src/components/Ellipsis/MultilineEllipsis.vue +96 -109
  25. package/src/components/Ellipsis/index.vue +114 -89
  26. package/src/components/LxTable/index.vue +98 -143
  27. package/src/components/PopoverForm/index.vue +52 -47
  28. package/src/components/SearchForm/index.vue +128 -138
  29. package/src/components/SearchForm/types/index.ts +4 -4
  30. package/src/components/SearchSelect/index.vue +83 -67
  31. package/src/components/index.ts +1 -1
  32. package/src/components/singleMessage/index.ts +15 -44
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.28",
4
- "description": "wrap-element-ui",
3
+ "version": "2.0.0-beta.1",
4
+ "description": "wrap-element-ui Vue 3 + Element Plus 组件库",
5
5
  "author": "",
6
6
  "main": "src/components/index.ts",
7
7
  "private": false,
@@ -13,7 +13,7 @@
13
13
  "build:sb": "cross-env MODE=production rimraf storybook-static && pnpm build:lib && storybook build",
14
14
  "preview": "serve ./storybook-static",
15
15
  "publish:dev": "npm publish --access public --tag beta",
16
- "publish:prod": "npm publish --access public",
16
+ "publish:prod": "npm publish --access public --tag latest",
17
17
  "cdn": "gulp oss",
18
18
  "lint": "eslint src"
19
19
  },
@@ -24,11 +24,12 @@
24
24
  ],
25
25
  "peerDependencies": {
26
26
  "dayjs": "^1.11.13",
27
- "element-ui": "^2.15.14",
27
+ "element-plus": "^2.5.0",
28
28
  "lodash": "^4.17.21",
29
- "vue": "~2.7.16"
29
+ "vue": "^3.4.0"
30
30
  },
31
31
  "devDependencies": {
32
+ "@element-plus/icons-vue": "^2.3.2",
32
33
  "@faker-js/faker": "^8.4.1",
33
34
  "@storybook/addon-docs": "7.6.19",
34
35
  "@storybook/addon-essentials": "7.6.19",
@@ -39,19 +40,23 @@
39
40
  "@storybook/react": "7.6.19",
40
41
  "@storybook/react-vite": "7.6.19",
41
42
  "@storybook/test": "7.6.19",
42
- "@storybook/vue": "7.6.19",
43
- "@storybook/vue-vite": "7.6.19",
43
+ "@storybook/vue3": "7.6.19",
44
+ "@storybook/vue3-vite": "7.6.19",
44
45
  "@types/jest": "^24.0.11",
45
46
  "@types/lodash": "^4.17.5",
46
47
  "@typescript-eslint/eslint-plugin": "^7.16.0",
47
48
  "@typescript-eslint/parser": "^7.16.0",
48
49
  "@vitejs/plugin-legacy": "^4.1.1",
49
- "@vitejs/plugin-vue2": "^2.3.1",
50
+ "@vitejs/plugin-vue": "^5.0.0",
51
+ "@vue/compiler-core": "^3.5.38",
52
+ "@vue/compiler-dom": "^3.5.38",
50
53
  "@vue/eslint-config-typescript": "^13.0.0",
51
- "@vue/test-utils": "1.0.0-beta.29",
54
+ "@vue/shared": "^3.5.38",
55
+ "@vue/test-utils": "^2.4.0",
52
56
  "ali-oss": "^6.20.0",
53
57
  "autoprefixer": "^10.4.19",
54
58
  "cross-env": "^7.0.3",
59
+ "element-plus": "^2.5.0",
55
60
  "eslint": "^8.57.0",
56
61
  "eslint-plugin-vue": "^9.27.0",
57
62
  "gulp": "^4.0.2",
@@ -63,11 +68,15 @@
63
68
  "serve": "^14.2.3",
64
69
  "storybook": "7.6.19",
65
70
  "through2": "^4.0.2",
66
- "typescript": "^4.9.5",
67
- "vite": "^4.5.3",
71
+ "typescript": "^5.3.0",
72
+ "vite": "^5.0.0",
68
73
  "vite-plugin-dts": "^3.9.1",
69
74
  "vite-plugin-lib-inject-css": "^2.1.1",
70
75
  "vite-tsconfig-paths": "^4.3.2",
71
- "vue-template-compiler": "^2.6.10"
76
+ "vue": "^3.4.0"
77
+ },
78
+ "volta": {
79
+ "node": "20.20.2",
80
+ "pnpm": "8.15.9"
72
81
  }
73
82
  }
@@ -6,103 +6,113 @@
6
6
  :width="360"
7
7
  @on-change="handleCloseTechniciansSelectPopup"
8
8
  >
9
- <div
10
- slot="form"
11
- class="team-setting__technicians-popover"
12
- >
13
- <div class="team-setting__technicians-select">
14
- <el-input
15
- v-model="techniciansSearchQuery"
16
- placeholder="请输入姓名"
17
- @input="handleInputTechniciansSearch"
18
- />
19
- </div>
9
+ <template #form>
20
10
  <div
21
- v-if="techniciansSearchQuery && !technicianOptions.length && !fetchTechniciansLoading"
22
- class="team-setting__empty-technicians-options"
23
- >
24
- {{ $attrs.empty || '系统未登记该员工,请先添加员工账号' }}
25
- </div>
26
- <ul
27
- v-else
28
- class="team-setting__technicians-options"
11
+ class="team-setting__technicians-popover"
29
12
  >
30
- <li
31
- class="team-setting__technicians-option"
32
- v-for="item in technicianOptions"
33
- :key="item[$attrs.showConfig.id]"
13
+ <div class="team-setting__technicians-select">
14
+ <el-input
15
+ v-model="techniciansSearchQuery"
16
+ placeholder="请输入姓名"
17
+ @input="handleInputTechniciansSearch"
18
+ />
19
+ </div>
20
+ <div
21
+ v-if="techniciansSearchQuery && !technicianOptions.length && !fetchTechniciansLoading"
22
+ class="team-setting__empty-technicians-options"
34
23
  >
35
- <div class="team-setting__technicians-option-left">
36
- {{ `${item[$attrs.showConfig.name]} | ${item.roles}` }}
37
- </div>
38
- <el-button
39
- v-if="item.is_selected"
40
- type="text"
41
- disabled
42
- >
43
- 已添加
44
- </el-button>
45
- <el-button
46
- v-else
47
- type="text"
48
- @click="handleAddTechnician($attrs.keyId, item)"
24
+ {{ attrs.empty || '系统未登记该员工,请先添加员工账号' }}
25
+ </div>
26
+ <ul
27
+ v-else
28
+ class="team-setting__technicians-options"
29
+ >
30
+ <li
31
+ class="team-setting__technicians-option"
32
+ v-for="item in technicianOptions"
33
+ :key="item[attrs.showConfig!.id]"
49
34
  >
50
- 添加
51
- </el-button>
52
- </li>
53
- </ul>
54
- </div>
55
- <el-button
56
- slot="reference"
57
- type="text"
58
- icon="el-icon-plus"
59
- >
60
- {{ title }}
61
- </el-button>
35
+ <div class="team-setting__technicians-option-left">
36
+ {{ `${item[attrs.showConfig!.name]} | ${item.roles}` }}
37
+ </div>
38
+ <el-button
39
+ v-if="item.is_selected"
40
+ type="text"
41
+ disabled
42
+ >
43
+ 已添加
44
+ </el-button>
45
+ <el-button
46
+ v-else
47
+ type="text"
48
+ @click="handleAddTechnician(attrs.keyId, item)"
49
+ >
50
+ 添加
51
+ </el-button>
52
+ </li>
53
+ </ul>
54
+ </div>
55
+ </template>
56
+ <template #reference>
57
+ <el-button
58
+ type="text"
59
+ :icon="Plus"
60
+ >
61
+ {{ title }}
62
+ </el-button>
63
+ </template>
62
64
  </PopoverForm>
63
65
  </div>
64
66
  </template>
65
67
 
66
- <script>
67
- import PopoverForm from '../PopoverForm'
68
- export default {
69
- name: 'AddMembers',
70
- components: {
71
- PopoverForm
72
- },
73
- props: {
74
- /** 成员数据 */
75
- technicianOptions: Array,
76
- /** 获取数据加载中 */
77
- fetchTechniciansLoading: Boolean,
78
- /** 弹窗标题 */
79
- title: {
80
- type: String,
81
- default: '添加成员',
82
- },
83
- },
84
- data() {
85
- return {
86
- techniciansSearchQuery: '',
87
- }
88
- },
89
- watch: {
90
- },
91
- methods: {
92
- handleCloseTechniciansSelectPopup(show) {
93
- if (show) return;
94
- this.techniciansSearchQuery = '';
95
- this.$emit('update:technicianOptions', []);
96
- },
97
- handleInputTechniciansSearch(query) {
98
- this.$emit('fetchTechniciansMethods', query);
99
- },
100
- handleAddTechnician(id, item) {
101
- const query = { id, item };
102
- this.$emit('handleAddTechnician', query);
103
- },
104
- },
105
- };
68
+ <script setup lang="ts">
69
+ import { ref, useAttrs } from 'vue'
70
+ import { Plus } from '@element-plus/icons-vue'
71
+ import PopoverForm from '../PopoverForm/index.vue'
72
+
73
+ defineOptions({ name: 'AddMembers' })
74
+
75
+ interface IProps {
76
+ technicianOptions?: any[]
77
+ fetchTechniciansLoading?: boolean
78
+ title?: string
79
+ }
80
+
81
+ interface IEmits {
82
+ (e: 'update:technicianOptions', val: any[]): void
83
+ (e: 'fetchTechniciansMethods', query: string): void
84
+ (e: 'handleAddTechnician', query: { id: any; item: any }): void
85
+ }
86
+
87
+ withDefaults(defineProps<IProps>(), {
88
+ technicianOptions: () => [],
89
+ fetchTechniciansLoading: false,
90
+ title: '添加成员',
91
+ })
92
+
93
+ const emit = defineEmits<IEmits>()
94
+ const attrs = useAttrs() as {
95
+ empty?: string
96
+ showConfig?: { id: string; name: string }
97
+ keyId?: any
98
+ }
99
+
100
+ const techniciansSearchQuery = ref('')
101
+
102
+ const handleCloseTechniciansSelectPopup = (show: boolean) => {
103
+ if (show) return
104
+ techniciansSearchQuery.value = ''
105
+ emit('update:technicianOptions', [])
106
+ }
107
+
108
+ const handleInputTechniciansSearch = (query: string) => {
109
+ emit('fetchTechniciansMethods', query)
110
+ }
111
+
112
+ const handleAddTechnician = (id: any, item: any) => {
113
+ const query = { id, item }
114
+ emit('handleAddTechnician', query)
115
+ }
106
116
  </script>
107
117
 
108
118
  <style lang="less">
@@ -111,6 +121,7 @@ export default {
111
121
  padding: 20px;
112
122
  height: 350px;
113
123
  overflow-y: auto;
124
+ overflow-x: hidden;
114
125
  }
115
126
  &__technicians-select {
116
127
  width: 320px;
@@ -1,86 +1,118 @@
1
1
  <template>
2
2
  <div class="audit-steps">
3
3
  <ElSteps direction="vertical">
4
- <ElStep class="audit-steps__step-item" v-for="(item, index) in value" :key="index">
5
- <div slot="icon">{{index + 1}}</div>
6
- <div :class="{'el-name-box': item.id}" slot="description">
7
- <span :class="[ 'audit-steps__step-order', {first: index===0} ]">{{index + 1}}</span>
8
- <ElSelect
9
- :value="item.employees"
10
- @input="val => handleEditCandidate(val, index)"
11
- multiple
12
- :multiple-limit="maxSelect"
13
- placeholder="请选择">
14
- <ElOption
15
- v-for="v in candidates"
16
- :key="v.id"
17
- :label="v.name"
18
- :value="v.id" />
19
- </ElSelect>
20
- <i class="el-name" v-if="item.id">{{item.miniName}}</i>
21
- <i class="el-icon-delete" v-if="index" @click="handleDeleteStep(index)" ></i>
22
- </div>
4
+ <ElStep
5
+ class="audit-steps__step-item"
6
+ v-for="(item, index) in modelValue"
7
+ :key="index"
8
+ >
9
+ <template #icon>
10
+ {{ index + 1 }}
11
+ </template>
12
+ <template #description>
13
+ <div :class="{'el-name-box': item.id}">
14
+ <span :class="[ 'audit-steps__step-order', {first: index===0} ]">{{ index + 1 }}</span>
15
+ <ElSelect
16
+ :model-value="item.employees"
17
+ @update:model-value="val => handleEditCandidate(val, index)"
18
+ multiple
19
+ :multiple-limit="maxSelect"
20
+ placeholder="请选择"
21
+ >
22
+ <ElOption
23
+ v-for="v in candidates"
24
+ :key="v.id"
25
+ :label="v.name"
26
+ :value="v.id"
27
+ />
28
+ </ElSelect>
29
+ <i
30
+ class="el-name"
31
+ v-if="item.id"
32
+ >{{ item.miniName }}</i>
33
+ <el-icon
34
+ v-if="index"
35
+ class="el-icon-delete"
36
+ @click="handleDeleteStep(index)"
37
+ >
38
+ <Delete />
39
+ </el-icon>
40
+ </div>
41
+ </template>
23
42
  </ElStep>
24
43
  </ElSteps>
25
- <ElButton v-if="isAdd" type="text" class="audit-steps__add" icon="circle-plus" @click="handleAddStep">添加审核环节</ElButton>
44
+ <ElButton
45
+ v-if="isAdd"
46
+ type="text"
47
+ class="audit-steps__add"
48
+ icon="circle-plus"
49
+ @click="handleAddStep"
50
+ >
51
+ 添加审核环节
52
+ </ElButton>
26
53
  </div>
27
54
  </template>
28
55
 
29
- <script>
30
- export default {
31
- name: 'AuditSteps',
32
- props: {
33
- candidates: {
34
- type: Array
35
- },
36
- value: {
37
- type: Array,
38
- default () {
39
- return []
40
- }
41
- },
42
- maxSelect: {
43
- type: Number,
44
- default: 3
45
- },
46
- stepNum: {
47
- type: Number,
48
- default: 2
49
- }
50
- },
51
- computed: {
52
- isAdd () {
53
- return this.value.length < this.stepNum
54
- }
55
- },
56
- methods: {
57
- syncSteps (modification) {
58
- const _steps = [ ...this.value ]
59
- this.$emit('input', modification(_steps))
60
- },
61
- handleEditCandidate (val, index) {
62
- this.syncSteps(_steps => {
63
- _steps[index].employees = val
64
- return _steps
65
- })
66
- },
67
- handleDeleteStep (i) {
68
- this.syncSteps(_steps => {
69
- _steps.splice(i, 1)
70
- return _steps
71
- })
72
- },
73
- handleAddStep () {
74
- this.syncSteps(_steps => {
75
- return _steps.concat([{ employees: [] }])
76
- })
77
- },
78
- // 判断是不是每一个步骤都选有审核人
79
- isValidateSteps () {
80
- return !this.value.some(_steps => _steps.employees.length <= 0)
81
- }
82
- }
56
+ <script setup lang="ts">
57
+ import { computed } from 'vue'
58
+ import { Delete } from '@element-plus/icons-vue'
59
+ import { ElSteps, ElStep, ElSelect, ElOption, ElButton } from 'element-plus'
60
+
61
+ defineOptions({ name: 'AuditSteps' })
62
+
63
+ interface StepItem {
64
+ employees: any[]
65
+ id?: any
66
+ miniName?: string
67
+ }
68
+
69
+ interface IProps {
70
+ candidates?: any[]
71
+ modelValue?: StepItem[]
72
+ maxSelect?: number
73
+ stepNum?: number
74
+ }
75
+
76
+ interface IEmits {
77
+ (e: 'update:modelValue', val: StepItem[]): void
78
+ }
79
+
80
+ const props = withDefaults(defineProps<IProps>(), {
81
+ candidates: () => [],
82
+ modelValue: () => [],
83
+ maxSelect: 3,
84
+ stepNum: 2,
85
+ })
86
+
87
+ const emit = defineEmits<IEmits>()
88
+
89
+ const isAdd = computed(() => props.modelValue.length < props.stepNum)
90
+
91
+ const syncSteps = (modification: (_steps: StepItem[]) => StepItem[]) => {
92
+ const _steps = [...props.modelValue]
93
+ emit('update:modelValue', modification(_steps))
94
+ }
95
+
96
+ const handleEditCandidate = (val: any[], index: number) => {
97
+ syncSteps(_steps => {
98
+ _steps[index].employees = val
99
+ return _steps
100
+ })
83
101
  }
102
+
103
+ const handleDeleteStep = (i: number) => {
104
+ syncSteps(_steps => {
105
+ _steps.splice(i, 1)
106
+ return _steps
107
+ })
108
+ }
109
+
110
+ const handleAddStep = () => {
111
+ syncSteps(_steps => {
112
+ return _steps.concat([{ employees: [] }])
113
+ })
114
+ }
115
+
84
116
  </script>
85
117
 
86
118
  <style lang="less">
@@ -104,6 +136,7 @@ export default {
104
136
  margin-left: 10px;
105
137
  font-size: 16px;
106
138
  cursor: pointer;
139
+ vertical-align: middle;
107
140
  }
108
141
  }
109
142
 
@@ -1,12 +1,15 @@
1
1
  <template>
2
2
  <div class="demo-component__input">
3
- <ElInput title="DemoComponent" lable="DemoComponent" />
3
+ <ElInput
4
+ title="DemoComponent"
5
+ lable="DemoComponent"
6
+ />
4
7
  </div>
5
8
  </template>
6
- <script>
7
- export default{
8
- name: 'DemoComponent'
9
- }
9
+ <script setup lang="ts">
10
+ import { ElInput } from 'element-plus'
11
+
12
+ defineOptions({ name: 'DemoComponent' })
10
13
  </script>
11
14
 
12
15
  <style lang="less">
@@ -120,10 +120,11 @@ export function useColumnHeaderOperation({ props, tableDomRef, emit, showingColu
120
120
  }
121
121
 
122
122
  const closeSortAndFilterPopover = (exceptProp?: string) => {
123
- document.querySelectorAll('span[data-popper-name]').forEach((item: any) => {
124
- if (!exceptProp || exceptProp !== item.dataset.prop) {
125
- item?.__vue__?.doClose?.();
126
- }
123
+ document.querySelectorAll('.editable-table-sort-filter').forEach((item: any) => {
124
+ try {
125
+ const vm = item.__vueParentComponent?.proxy || item.__vue__;
126
+ vm?.doClose?.() || vm?.hide?.();
127
+ } catch {}
127
128
  });
128
129
  }
129
130
 
@@ -25,12 +25,16 @@ export function useDefaultOperation({ emit, pageSize, props, tableDomRef, hasExp
25
25
  }
26
26
 
27
27
  const closeOperationPopover = () => {
28
- operationPopoverRef.value?.forEach((item) => item?.doClose());
28
+ const refs = operationPopoverRef.value;
29
+ if (!refs) return;
30
+ const list = Array.isArray(refs) ? refs : [refs];
31
+ list.forEach((item) => item?.doClose?.());
29
32
  }
30
33
 
31
34
  const closeAllExpandedRows = () => {
32
35
  if (!hasExpandRow) return
33
- tableDomRef.value?.data.forEach((item) => {
36
+ const data = tableDomRef.value?.data ?? tableDomRef.value?.store?.states?.data?.value;
37
+ data?.forEach((item) => {
34
38
  tableDomRef.value?.toggleRowExpansion(item, false)
35
39
  })
36
40
  }
@@ -47,13 +51,17 @@ export function useDefaultOperation({ emit, pageSize, props, tableDomRef, hasExp
47
51
 
48
52
  const handleRowPinToTop = (scope) => {
49
53
  const { row, $index: index, store } = scope;
50
- const dataList = store.states.data;
54
+ const dataList = store.states.data.value ?? store.states.data;
51
55
  const newList = [
52
56
  ...dataList.slice(0, index),
53
57
  ...dataList.slice(index + 1)
54
58
  ];
55
59
  newList.unshift({ ...row, isPinned: true });
56
- store.states.data = newList;
60
+ if (typeof store.states.data.value !== 'undefined') {
61
+ store.states.data.value = newList;
62
+ } else {
63
+ store.states.data = newList;
64
+ }
57
65
  emit('row-pin-to-top', { row, rawIndex: index, page: props.currentPage, size: pageSize.value });
58
66
  closeOperationPopover();
59
67
  }
@@ -188,14 +188,18 @@ export function useDragSort({ props, emit, viewSettingDragSortOptions, pageSize,
188
188
  const handleDragDrop = (event, scope) => {
189
189
  if (!scope) return
190
190
  const { draggingIndex = 0, dropIndex = draggingIndex } = draggingData.value;
191
- const dataList = scope.store.states.data;
191
+ const dataList = scope.store.states.data.value ?? scope.store.states.data;
192
192
  const movedRow = dataList[draggingIndex];
193
193
  const newList = [
194
194
  ...dataList.slice(0, +draggingIndex),
195
195
  ...dataList.slice(draggingIndex + 1)
196
196
  ];
197
197
  newList.splice(dropIndex, 0, movedRow);
198
- scope.store.states.data = newList;
198
+ if (typeof scope.store.states.data.value !== 'undefined') {
199
+ scope.store.states.data.value = newList;
200
+ } else {
201
+ scope.store.states.data = newList;
202
+ }
199
203
  emit('row-drag-drop', {
200
204
  row: movedRow,
201
205
  fromIndex: draggingIndex,
@@ -27,11 +27,15 @@ export function useRowBgColor({ colorList, emit }: IUseRowBgColorParams) {
27
27
 
28
28
  const handleColorChange = async (colorId: number, scope) => {
29
29
  const { row, $index: rowIndex, store } = scope;
30
- const dataList = store.states.data;
30
+ const dataList = store.states.data.value ?? store.states.data;
31
31
  const curRow = { ...dataList[rowIndex], colorId: +colorId };
32
32
  const newList = [...dataList];
33
33
  newList.splice(rowIndex, 1, curRow);
34
- store.states.data = newList;
34
+ if (store.states.data.value !== undefined) {
35
+ store.states.data.value = newList;
36
+ } else {
37
+ store.states.data = newList;
38
+ }
35
39
  emit('row-bg-change', { colorId, row, rowIndex });
36
40
  };
37
41
 
@@ -115,7 +115,7 @@ export function useViewSetting({
115
115
  () => props.columnConfig,
116
116
  async(val) => {
117
117
  const _cache = localStorage.getItem(storageKey.value);
118
- const setColumns = () => updateShowingColumns(val.filter(v => !v.defaultHide).map(c => c.prop));
118
+ const setColumns = () => updateShowingColumns(val.filter(v => !v.defaultHide || v.isAlwaysShow).map(c => c.prop));
119
119
  if (!_cache) {
120
120
  setColumns();
121
121
  leftFixedColumnCount.value = props.leftFixedCount as number;
@@ -156,6 +156,7 @@ export function useViewSetting({
156
156
 
157
157
  updateShowingColumns(
158
158
  val.filter(v => {
159
+ if (v.isAlwaysShow) return true;
159
160
  return cache.config.fields[v.prop] ? !cache.config.fields[v.prop].hidden : !v.defaultHide
160
161
  }).sort((a, b) => {
161
162
  return (cache.config.fields[a.prop]?.order ?? 0) - (cache.config.fields[b.prop]?.order ?? 0)
@@ -1,7 +1,8 @@
1
1
  <!-- 行颜色选择组件 -->
2
2
  <template>
3
3
  <el-popover
4
- v-model="visible"
4
+ v-model:visible="visible"
5
+ :width="'auto'"
5
6
  placement="right"
6
7
  trigger="click"
7
8
  popper-class="editable-table-color-popover"
@@ -21,7 +22,7 @@
21
22
  </div>
22
23
  </div>
23
24
 
24
- <div slot="reference">
25
+ <template #reference>
25
26
  <div
26
27
  v-if="isDefaultColor(scope.row.colorId)"
27
28
  class="editable-table__color-icon"
@@ -31,7 +32,7 @@
31
32
  class="editable-table__selected-color"
32
33
  :style="{ backgroundColor: getColorById(scope.row.colorId, 'sample') }"
33
34
  />
34
- </div>
35
+ </template>
35
36
  </el-popover>
36
37
  </template>
37
38