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.
package/components.js CHANGED
@@ -44,3 +44,5 @@ export { default as SohelpTenantSelect } from './sohelp-tenant-select/index.vue'
44
44
  export { default as SohelpVxeGridSelect } from './sohelp-vxe-grid-select/index.vue';
45
45
  export { default as SohelpIconSelect } from './sohelp-icon-select/index.vue';
46
46
  export { default as SohelpModal } from './sohelp-modal/index.vue';
47
+ export { default as SohelpCard } from './sohelp-card/index.vue';
48
+ export { default as SohelpPage } from './sohelp-page/index.vue';
@@ -18,9 +18,11 @@ export const SohelpHttp = {
18
18
  * @param _url
19
19
  * @param param
20
20
  * @param fileName
21
+ * @param onProgress
22
+ * @param config
21
23
  * @returns {Promise<never>}
22
24
  */
23
- download: async function(_url, param, fileName) {
25
+ download: async function(_url, param, fileName, onProgress, config = {}) {
24
26
  if (window.$axios == null) {
25
27
  console.error("请在配置main.js中配置window.$axios实例!!");
26
28
  return;
@@ -29,10 +31,17 @@ export const SohelpHttp = {
29
31
  if (!fileName) {
30
32
  fileName = (new Date()).getTime();
31
33
  }
32
- // 发起GET请求,设置responseType为blob
33
- const response = await window.$axios.get(_url, {
34
- responseType: "blob",
35
- params: param
34
+ // 发起POST请求,设置responseType为blob
35
+ const response = await window.$axios.post(_url, param || {}, {
36
+ responseType: 'blob',
37
+ ...config,
38
+ onDownloadProgress: (evt) => {
39
+ if (typeof onProgress === "function") {
40
+ const total = evt?.total || 0;
41
+ const loaded = evt?.loaded || 0;
42
+ onProgress(loaded, total);
43
+ }
44
+ }
36
45
  }).catch(e => {
37
46
  return Promise.reject(e.message);
38
47
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sohelp-eleplus",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "description": "SohelpEleplus Extension Components",
5
5
  "public": true,
6
6
  "main": "index.js",
@@ -0,0 +1,13 @@
1
+ <script setup>
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <ele-card flex-table v-bind="$attrs" v-on="$attrs">
7
+ <slot></slot>
8
+ </ele-card>
9
+ </template>
10
+
11
+ <style scoped lang="scss">
12
+
13
+ </style>
@@ -11,10 +11,19 @@
11
11
  padding-right: 6px;
12
12
  padding-top: 3px;
13
13
  padding-bottom: 3px;
14
+ display: flex;
15
+ align-items: center;
14
16
  "
15
17
  v-for="(item, index) in valueData"
16
18
  :key="item.value"
17
- >{{ item.label }}
19
+ >
20
+ <el-icon :size="18" style="margin: 2px 5px 0 0">
21
+ <component :is="ElementPlusIcons[icon]" v-if="ElementPlusIcons[icon]" />
22
+ <component :is="EleAdminPlusIcons[icon]" v-else-if="EleAdminPlusIcons[icon]" />
23
+ <span :class="icon" v-else></span>
24
+ </el-icon>
25
+
26
+ {{ item.label }}
18
27
  </el-text>
19
28
  </template>
20
29
  <template v-else-if="type === 'tag'">
@@ -27,6 +36,11 @@
27
36
  :key="item.value"
28
37
  :disable-transitions="true"
29
38
  >
39
+ <el-icon :size="18" style="margin: 2px 5px 0 0">
40
+ <component :is="ElementPlusIcons[icon]" v-if="ElementPlusIcons[icon]" />
41
+ <component :is="EleAdminPlusIcons[icon]" v-else-if="EleAdminPlusIcons[icon]" />
42
+ <span :class="icon" v-else></span>
43
+ </el-icon>
30
44
  {{ item.label }}
31
45
  </el-tag>
32
46
  </div>
@@ -39,6 +53,11 @@
39
53
  @change="change"
40
54
  >
41
55
  <el-radio v-for="item in data.value" :key="item.value" :label="item.value">
56
+ <el-icon :size="18" style="margin: 2px 5px 0 0">
57
+ <component :is="ElementPlusIcons[icon]" v-if="ElementPlusIcons[icon]" />
58
+ <component :is="EleAdminPlusIcons[icon]" v-else-if="EleAdminPlusIcons[icon]" />
59
+ <span :class="icon" v-else></span>
60
+ </el-icon>
42
61
  {{ item.label }}
43
62
  </el-radio>
44
63
  </el-radio-group>
@@ -50,6 +69,11 @@
50
69
  @change="change"
51
70
  >
52
71
  <el-checkbox v-for="item in data.value" :key="item.value" :label="item.value">
72
+ <el-icon :size="18" style="margin: 2px 5px 0 0">
73
+ <component :is="ElementPlusIcons[icon]" v-if="ElementPlusIcons[icon]" />
74
+ <component :is="EleAdminPlusIcons[icon]" v-else-if="EleAdminPlusIcons[icon]" />
75
+ <span :class="icon" v-else></span>
76
+ </el-icon>
53
77
  {{ item.label }}
54
78
  </el-checkbox>
55
79
  </el-checkbox-group>
@@ -7,14 +7,13 @@ export const prop = {
7
7
  required: true
8
8
  },
9
9
 
10
-
11
- mappingFields:{
10
+ mappingFields: {
12
11
  type: Object,
13
12
  default: () => {
14
13
  return {
15
14
  label: 'label',
16
15
  value: 'value'
17
- }
16
+ };
18
17
  }
19
18
  },
20
19
 
@@ -27,6 +26,7 @@ export const prop = {
27
26
  type: String,
28
27
  default: '请选择'
29
28
  },
29
+
30
30
  modelValue: {
31
31
  type: Array || String || Number,
32
32
  required: true
@@ -64,4 +64,4 @@ export const prop = {
64
64
  * 事件
65
65
  */
66
66
 
67
- export const emit = ['update:modelValue','change'];
67
+ export const emit = ['update:modelValue', 'change'];
@@ -36,6 +36,7 @@
36
36
  import { useMobile } from '@/utils/use-mobile';
37
37
  import { useI18n } from 'vue-i18n';
38
38
  import { EleMessage } from '@/components/ele-admin-plus/components';
39
+ import { SohelpInput, SohelpNumberInput } from '../components';
39
40
 
40
41
  const { query } = useRoute();
41
42
  const formValue = ref({});
@@ -88,6 +89,8 @@
88
89
  * @type {Ref<UnwrapRef<*[]>>}
89
90
  */
90
91
  const items = ref([]);
92
+ // 初始化表单配置
93
+ const initFormValue = ref({});
91
94
  /**
92
95
  * 默认显示1列
93
96
  * @type {Ref<UnwrapRef<number>>}
@@ -167,6 +170,24 @@
167
170
  const getRef = (refName) => {
168
171
  return proFormRef.value.getRef(refName);
169
172
  };
173
+
174
+ /**
175
+ * placeholder占位符映射
176
+ */
177
+ const placeholderMap = {
178
+ SohelpSelect: '请选择',
179
+ SohelpTreeSelect: '请选择',
180
+ SohelpDict: '请选择',
181
+ SohelpUserSelect: '请选择用户',
182
+ SohelpDeptSelect: '请选择部门',
183
+ SohelpRoleSelect: '请选择角色',
184
+ SohelpDatePicker: '请选择日期',
185
+ SohelpTimePicker: '请选择时间',
186
+ SohelpDateTimePicker: '请选择日期时间',
187
+ SohelpInput: '请输入',
188
+ SohelpNumberInput: '请输入'
189
+ };
190
+
170
191
  /**根据实体表单配置初始化表单数据 */
171
192
  const loadConfig = async (refid = props?.refid) => {
172
193
  if (!refid) {
@@ -191,12 +212,13 @@
191
212
  }
192
213
  let editParams = item?.editorParam ? JSON.parse(item.editorParam) : {};
193
214
  if (item.editor === 'SohelpDict') {
194
- editParams['code'] = item.dict || editParams?.code;
215
+ editParams['code'] = editParams?.code || item?.dict;
195
216
  }
196
217
  if (item['length'] > 0) {
197
218
  editParams['maxlength'] = item['length'];
198
219
  }
199
220
  editParams.readonly = item?.readonly || false;
221
+ editParams.placeholder = item?.placeholder || placeholderMap[item?.editor] || '';
200
222
 
201
223
  return {
202
224
  key: item?.name || 'tempKey' + index,
@@ -216,6 +238,7 @@
216
238
  };
217
239
  })
218
240
  .filter((p) => p.hidden !== true);
241
+
219
242
  labelWidth.value = props.labelWidth || entityFormConfig.labelWidth || 'auto';
220
243
  grid.value = mobile.value ? 1 : entityFormConfig.gridNum || props.gridNum;
221
244
 
@@ -278,12 +301,14 @@
278
301
  * @param _data 数据对象
279
302
  */
280
303
 
281
- const setFormData = async (_formData = {}) => {
304
+ const setFormData = async (_formData = {}, params = {}) => {
305
+ const data = { ..._formData, ...params };
306
+ initFormValue.value = params;
282
307
  loading.value = true;
283
-
284
308
  await isConfigDone();
285
- Object.assign(formData.value, _formData);
286
- setFormValue(switchFormValue(_formData));
309
+ Object.assign(formData.value, data);
310
+ setFormValue(switchFormValue(data));
311
+ emit('update:modelValue', formData.value);
287
312
  setTimeout(() => {
288
313
  clearValidate();
289
314
  }, 0);
@@ -319,7 +344,7 @@
319
344
  changedProps[key] = newObj[key];
320
345
  }
321
346
  }
322
- return { id: oldObj?.id || newObj?.id || '', ...changedProps };
347
+ return { id: oldObj?.id || newObj?.id || '', ...changedProps, ...initFormValue.value };
323
348
  }
324
349
 
325
350
  /**
@@ -15,7 +15,7 @@
15
15
  }
16
16
  });
17
17
 
18
- const emit = defineEmits(['update:modelValue', 'change']);
18
+ const emit = defineEmits(['update:modelValue', 'change', 'search']);
19
19
  const condition = reactive({});
20
20
 
21
21
  const dropDownRef = ref(null);
@@ -24,6 +24,10 @@
24
24
  return typeof val === 'number';
25
25
  };
26
26
 
27
+ const search = () => {
28
+ emit('search', condition);
29
+ };
30
+
27
31
  const getComparisonByEditor = (type) => {
28
32
  let data = null;
29
33
  if (comparisonType[type]) {
@@ -80,7 +84,7 @@
80
84
  };
81
85
  </script>
82
86
  <template>
83
- <div class="sohelp-filter-condition" v-if="properties">
87
+ <el-form class="sohelp-filter-condition" v-if="properties" @keyup.enter="search" @submit.prevent="">
84
88
  <el-form-item :label="t(properties.i18n) || properties.label">
85
89
  <ele-dropdown
86
90
  ref="dropDownRef"
@@ -112,8 +116,10 @@
112
116
  :code="properties?.dict || properties.editorParam?.code"
113
117
  style="width: 160px"
114
118
  :teleported="teleported"
119
+ :placeholder="properties.editorParam?.placeholder || '请选择'"
115
120
  class="filter-condition"
116
121
  />
122
+
117
123
  <div v-else-if="properties.editor === 'SohelpProcess'">
118
124
  <sohelp-number-range
119
125
  v-model="condition.value"
@@ -275,7 +281,7 @@
275
281
  style="width: 160px"
276
282
  class="filter-condition"
277
283
  ></sohelp-input>
278
- </div>
284
+ </el-form>
279
285
  </template>
280
286
 
281
287
  <style lang="scss" scoped>