sohelp-eleplus 1.1.19 → 1.1.21

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.
@@ -32,10 +32,7 @@
32
32
  ></grid-filter-keywords>
33
33
  </template>
34
34
  <template #scheme>
35
- <grid-filter-scheme
36
- v-model="filterConfig.filter.scheme"
37
- :properties="propertiesArray"
38
- ></grid-filter-scheme>
35
+ <grid-filter-scheme v-model="filterConfig.filter.scheme" :properties="propertiesArray"></grid-filter-scheme>
39
36
  </template>
40
37
  <template #config>
41
38
  <grid-filter-config v-model="filterConfig"></grid-filter-config>
@@ -50,7 +47,7 @@
50
47
  </ele-modal>
51
48
  </template>
52
49
  <script setup>
53
- import { defineProps, onMounted, ref, watch } from "vue";
50
+ import { defineProps, onMounted, ref, watch } from 'vue';
54
51
 
55
52
  import GridFilterField from './grid-filter-field.vue';
56
53
  import GridFilterSort from './grid-filter-sort.vue';
@@ -75,7 +72,6 @@ import { defineProps, onMounted, ref, watch } from "vue";
75
72
  const tabsKey = ref(0);
76
73
  const propertiesArray = ref([]);
77
74
 
78
-
79
75
  const gridActiveTab = ref('list');
80
76
  const gridTabs = [
81
77
  {
@@ -97,7 +93,8 @@ import { defineProps, onMounted, ref, watch } from "vue";
97
93
  {
98
94
  name: 'scheme',
99
95
  label: '筛选场景'
100
- },{
96
+ },
97
+ {
101
98
  name: 'config',
102
99
  label: '基本配置'
103
100
  }
@@ -115,7 +112,7 @@ import { defineProps, onMounted, ref, watch } from "vue";
115
112
  }
116
113
  );
117
114
 
118
- onMounted(()=>{
115
+ onMounted(() => {
119
116
  originFilterConfigValue.value = JSON.parse(JSON.stringify(props.config));
120
117
  propertiesArray.value = props.config?.properties
121
118
  ?.map(({ name, label, hidden }) => {
@@ -165,7 +162,7 @@ import { defineProps, onMounted, ref, watch } from "vue";
165
162
  if (res.meta.success) {
166
163
  emit('update:modelValue', false);
167
164
  moduleCache.clear();
168
- emit('done',filterConfig.value);
165
+ emit('done', filterConfig.value);
169
166
  ElMessage.success(res?.meta.message || '操作成功');
170
167
  } else {
171
168
  ElMessage.error(res?.meta.message || '操作成功');
@@ -25,20 +25,22 @@
25
25
  <!-- advanced -->
26
26
  <div class="advanced-box" ref="advancedBoxRef">
27
27
  <filter-condition-item
28
+ @search="filter"
28
29
  v-for="(item, index) in getFilterList"
29
30
  :key="item.name"
30
31
  v-model="filterValue.filter[index]"
31
32
  :properties="propertiesMap?.[item.name]"
32
33
  :ref="(el) => setItemRef(el, item.name)"
33
34
  ></filter-condition-item>
34
-
35
+ </div>
36
+ <template #footer>
35
37
  <div
36
38
  class="footer-top-right"
37
39
  v-if="filterList.length > 0 && config.filter?.config.filterPosition !== 'MODAL'"
38
40
  ref="searchButtonRef"
39
41
  >
40
- <el-button size="small" plain @click="reset">{{ t('grid.toolbar.reset') }}</el-button>
41
- <el-button type="primary" size="small" @click="filter">{{ t('grid.toolbar.filter') }}</el-button>
42
+ <el-button size="small" plain @click="reset" :icon="Refresh">{{ t('grid.toolbar.reset') }}</el-button>
43
+ <el-button type="primary" size="small" @click="filter" :icon="Search">{{ t('grid.toolbar.filter') }}</el-button>
42
44
  <el-link
43
45
  plain
44
46
  @click="toggleFilter"
@@ -53,7 +55,7 @@
53
55
  <ele-text size="xs" :icon="Minus" v-else> 收缩</ele-text>
54
56
  </el-link>
55
57
  </div>
56
- </div>
58
+ </template>
57
59
  </ele-card>
58
60
  </template>
59
61
 
@@ -62,7 +64,7 @@
62
64
  import FilterConditionItem from '../../sohelp-grid/components/filter-condition-item.vue';
63
65
  import { useMobile } from '@/utils/use-mobile';
64
66
  import { useI18n } from 'vue-i18n';
65
- import { Plus, Minus } from '@element-plus/icons-vue';
67
+ import { Plus, Minus, Search, Refresh } from '@element-plus/icons-vue';
66
68
 
67
69
  const { mobile } = useMobile();
68
70
  const { t } = useI18n();
@@ -163,7 +165,7 @@
163
165
  if (filterPosition?.toUpperCase() === 'TOP') {
164
166
  maxRowsConfig.current.index = filterList.value.length;
165
167
  maxRowsConfig.height = advancedBoxRef.value?.offsetHeight + 'px';
166
- const advancedRow = advancedBoxRef.value.querySelector('.sohelp-filter-condition');
168
+ const advancedRow = advancedBoxRef.value?.querySelector('.sohelp-filter-condition');
167
169
  if (advancedRow) {
168
170
  maxRowsConfig.rowHeight = advancedRow.offsetHeight;
169
171
  }
@@ -278,13 +280,11 @@
278
280
  }
279
281
  }
280
282
  }
281
-
282
- .footer-top-right {
283
- text-align: right;
284
- margin-left: auto;
285
- }
286
283
  }
287
-
284
+ .footer-top-right {
285
+ text-align: right;
286
+ margin-left: auto;
287
+ }
288
288
  .sohelp-filter {
289
289
  .footer-right {
290
290
  display: flex;
@@ -298,11 +298,12 @@
298
298
  .scheme-box {
299
299
  padding-top: 10px;
300
300
  display: flex;
301
- align-items: center;
301
+ align-items: flex-start;
302
302
  gap: 10px;
303
303
 
304
304
  .scheme-list {
305
305
  display: flex;
306
+ gap: 5px;
306
307
  }
307
308
  }
308
309
 
@@ -374,7 +375,7 @@
374
375
 
375
376
  .sohelp-filter.right {
376
377
  width: 100%;
377
- height: calc(100% - 70px);
378
+ height: calc(100% - 25px);
378
379
  padding-left: 10px;
379
380
  margin-left: 0px;
380
381
  box-sizing: border-box;
@@ -391,11 +392,14 @@
391
392
 
392
393
  :deep(.ele-card-footer) {
393
394
  width: calc(100% - 30px);
394
- background: #fff;
395
- z-index: 99999;
395
+ z-index: 999;
396
396
  bottom: 0px;
397
397
  position: absolute;
398
398
  }
399
+
400
+ .scheme-box {
401
+ flex-direction: column;
402
+ }
399
403
  }
400
404
 
401
405
  .sohelp-filter.right .sohelp-filter-condition {
@@ -416,7 +420,7 @@
416
420
 
417
421
  .sohelp-filter.right :deep(.ele-card-body) {
418
422
  flex: 1;
419
- max-height: calc(100% - 75px);
423
+ height: 100%;
420
424
  }
421
425
 
422
426
  .sohelp-filter.modal :deep(.ele-card-body) {
@@ -4,6 +4,7 @@
4
4
  import { computed, ref } from 'vue';
5
5
  import FilterConfig from './config/index.vue';
6
6
  import { useI18n } from 'vue-i18n';
7
+ import { Search, Refresh } from '@element-plus/icons-vue';
7
8
 
8
9
  const emit = defineEmits('change', 'filter', 'update:modelValue', 'close', 'reset', 'save', 'changeFilterScheme');
9
10
 
@@ -143,8 +144,10 @@
143
144
  ></filter-form>
144
145
  <template #footer>
145
146
  <div class="footer-right" v-if="config.filter.config.filterPosition !== 'TOP'">
146
- <el-button size="small" plain @click="reset">{{ t('grid.toolbar.reset') }}</el-button>
147
- <el-button type="primary" size="small" @click="filter(false)">{{ t('grid.toolbar.filter') }}</el-button>
147
+ <el-button size="small" plain @click="reset" :icon="Refresh">{{ t('grid.toolbar.reset') }}</el-button>
148
+ <el-button type="primary" size="small" @click="filter(false)" :icon="Search">{{
149
+ t('grid.toolbar.filter')
150
+ }}</el-button>
148
151
  </div>
149
152
  </template>
150
153
  </ele-modal>
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, reactive, ref, watch } from 'vue';
2
+ import { computed, nextTick, reactive, ref, watch } from 'vue';
3
3
  import { useMobile } from '@/utils/use-mobile';
4
4
  import SohelpFilter from './filter/index.vue';
5
5
  import SohelpGrid from '../sohelp-grid/index.vue';
@@ -106,8 +106,8 @@
106
106
  });
107
107
 
108
108
  //工具栏按钮点击事件
109
- const toolbarButtonClick = (config) => {
110
- emit('toolbarButtonClick', config);
109
+ const toolbarButtonClick = (config, rows) => {
110
+ emit('toolbarButtonClick', config, rows);
111
111
  };
112
112
  //右击菜单按钮点击事件
113
113
  const menuRightClick = (config) => {
@@ -128,19 +128,28 @@
128
128
 
129
129
  /**
130
130
  * 查询数据
131
- * @param param 区分是高级筛选,还是列筛选
131
+ * @param params 区分是高级筛选,还是列筛选
132
132
  */
133
- const reload = (param = {}, callback) => {
134
- sohelpGridRef.value.reload(param, callback);
133
+ const reload = (params = {}, callback) => {
134
+ sohelpGridRef.value.reload(params, callback);
135
135
  };
136
- const load = (param = {}, callback) => {
137
- sohelpGridRef.value.load(param, callback);
136
+ /**
137
+ * 加载数据
138
+ * @param params
139
+ * @param callback
140
+ */
141
+ const load = (params = {}, callback) => {
142
+ sohelpGridRef.value.load(params, callback);
138
143
  };
144
+ /**
145
+ * 刷新数据
146
+ */
139
147
  const refresh = () => {
140
148
  sohelpGridRef.value.refresh();
141
149
  };
142
150
 
143
151
  const changeFilterScheme = (schemeValue, filterValue) => {
152
+ sohelpGridRef.value.reload({});
144
153
  emit('changeFilterScheme', schemeValue, filterValue);
145
154
  };
146
155
  /**
@@ -249,7 +258,11 @@
249
258
  @operationButtonClick="operationButtonClick"
250
259
  @editClosed="editClosed"
251
260
  @currentColumnChange="currentColumnChange"
252
- ></sohelp-grid>
261
+ >
262
+ <template v-for="(_, name) in $slots" #[name]="slotProps">
263
+ <slot :name="name" v-bind="slotProps" />
264
+ </template>
265
+ </sohelp-grid>
253
266
  </template>
254
267
  </ele-split-panel>
255
268
  </div>