free-fe-core-modules 0.0.30 → 0.0.32

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,7 +32,7 @@
32
32
 
33
33
  <q-expansion-item
34
34
  v-if="m.Sub && m.Sub.length > 0"
35
- :modelValue="m.Sub.filter(s => $route.fullPath.startsWith(s.Route)).length > 0"
35
+ :modelValue="m.Sub.filter(s => $route.fullPath === s.Route || $route.fullPath.startsWith(`${s.Route}/`.replace(/\/\//g, '/'))).length > 0"
36
36
  exact
37
37
  class="expansion"
38
38
  :class="`${group} level_${level || 0}`"
@@ -11,6 +11,7 @@
11
11
  ((i < data.length && data[i + 1] && data[i + 1].button) ? ' last-summary' : '')
12
12
  "
13
13
  :style="'width: 20%;'"
14
+ @click="$emit('clicked', item)"
14
15
  >
15
16
  <e-icon
16
17
  v-if="item.icon && !item.button"
@@ -82,6 +83,7 @@ import { useObjectData, objectDataProps } from '../../composible/useObjectData';
82
83
 
83
84
  export default defineComponent({
84
85
  name: 'SummaryHead',
86
+ emits: ['clicked'],
85
87
  props: {
86
88
  ...objectDataProps,
87
89
  has_multiple_head: { type: Boolean, default: false },
@@ -380,7 +380,7 @@ export default defineComponent({
380
380
  localFiles.value = localFiles.value.filter((f) => !info.files.includes(f));
381
381
 
382
382
  setFieldData([
383
- ...fieldData.value,
383
+ ...(fieldData.value || []),
384
384
  ...uploadedFiles
385
385
  ], emit);
386
386
  selfValidate();
@@ -289,7 +289,7 @@ export default defineComponent({
289
289
  localFiles.value = localFiles.value.filter((f) => !info.files.includes(f));
290
290
 
291
291
  setFieldData([
292
- ...fieldData.value,
292
+ ...(fieldData.value || []),
293
293
  ...uploadedFiles
294
294
  ], emit);
295
295
  selfValidate();
@@ -47,8 +47,8 @@
47
47
  v-for="(label, index) in fieldData.value"
48
48
  :key="index"
49
49
  removable
50
- :value="!!fieldData[index]"
51
- @remove="fieldData.splice(index,1) && $emit('input')"
50
+ :value="!!fieldData.value[index]"
51
+ @remove="fieldData.value.splice(index,1) && $emit('input')"
52
52
  :color="Field.BgColor || 'primary'"
53
53
  :text-color="Field.Color || 'white'"
54
54
  >{{label}}</q-chip>
@@ -413,7 +413,7 @@ export default defineComponent({
413
413
  filterFunc: (val, update) => {
414
414
  if (val === '') {
415
415
  update(() => {
416
- localOptions.value = this.Field.Options || [];
416
+ localOptions.value = props.Field.Options || [];
417
417
  })
418
418
  return;
419
419
  }
@@ -421,7 +421,7 @@ export default defineComponent({
421
421
  update(() => {
422
422
  const needle = val.toLowerCase();
423
423
 
424
- localOptions.value = (this.Field.Options || []).filter(opt => {
424
+ localOptions.value = (props.Field.Options || []).filter(opt => {
425
425
  return `${opt.Label || opt.Value || opt}`.toLowerCase().indexOf(needle) > -1;
426
426
  });
427
427
  })
package/index.js CHANGED
@@ -192,6 +192,8 @@ export default (app, root) => {
192
192
 
193
193
  const appStore = useAppStore();
194
194
 
195
+ const validatorMobilePhone = (d) => !d || /^(0|86|17951)?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/.test(d);
196
+ const validatorEmail = (d) => !d || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(d);
195
197
  return {
196
198
  config: {
197
199
  backendDependencies: ["core-modules"],
@@ -376,9 +378,9 @@ export default (app, root) => {
376
378
 
377
379
  validators: {
378
380
  validatorNotEmpty: (d) => d !== void 0 && d.length > 0 && d.trim().length > 0,
379
- validatorMobilePhone: (d) => !d || /^(0|86|17951)?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/.test(d),
380
- validatorEmail: (d) => !d || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(d),
381
- validatorPhoneOrEmail: (d) => d !== void 0 && d.length > 0 && (this.validatorMobilePhone(d) || this.validatorEmail(d)),
381
+ validatorMobilePhone,
382
+ validatorEmail,
383
+ validatorPhoneOrEmail: (d) => d !== void 0 && d.length > 0 && (validatorMobilePhone(d) || validatorEmail(d)),
382
384
  // validatorMinLength: (d, len = 0) => d !== undefined && d.length >= len,
383
385
  validatorChinaIDNumber: (d) => !d || /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(d),
384
386
  // validatorSame: (d, to) => d === to,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",
@@ -4,7 +4,7 @@
4
4
  <q-table
5
5
  flat
6
6
  bordered
7
- :rows="data ? data.docs : []"
7
+ :rows="data?.docs || []"
8
8
  :columns="columns"
9
9
  row-key="id"
10
10
  :hide-bottom="!pagination"