sohelp-eleplus 1.1.17 → 1.1.19

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.
@@ -10,7 +10,7 @@ export default {
10
10
  props: {
11
11
  url: {
12
12
  type: String,
13
- defaultValue: "/engine/web/org/list",
13
+ default: "/engine/web/org/list",
14
14
  required: true
15
15
  }
16
16
  },
@@ -36,18 +36,18 @@ export default {
36
36
  /**网格列表配置ID*/
37
37
  refid: {
38
38
  type: String,
39
- defaultValue: "",
39
+ default: "",
40
40
  required: true
41
41
  },
42
42
  /**数据源URL**/
43
43
  url: {
44
44
  type: String,
45
- defaultValue: ""
45
+ default: ""
46
46
  },
47
47
  /**数据源URL**/
48
48
  where: {
49
49
  type: Object,
50
- defaultValue: {}
50
+ default: {}
51
51
  }
52
52
  },
53
53
  setup(props, {emit}) {
@@ -13,7 +13,7 @@
13
13
  </sohelp-drawer>
14
14
  </template>
15
15
  <script lang="ts">
16
- import SohelpVform from "../sohelp-vform/index.vue"
16
+ import SohelpVform from "../sohelp-vform-eleplus/index.vue"
17
17
  import SohelpDrawer from "../sohelp-drawer/index.vue"
18
18
  import {ref} from "vue";
19
19
  export default {
@@ -1,11 +1,14 @@
1
+ /**
2
+ * VxeGrid默认值选项
3
+ */
1
4
  export default {
2
5
  loading: false,
3
6
  customConfig: {
7
+ //默认不会将列设置保存到本地存储中
8
+ storage: false,
4
9
  placement: "top-right" // 自定义列工具栏位置
5
10
  },
6
-
7
11
  params: {},
8
-
9
12
  rowConfig: {
10
13
  useKey: true,
11
14
  //sortable 排序
@@ -68,28 +71,16 @@ export default {
68
71
  refresh: true,
69
72
  custom: true, //是否开启自定义列工具栏
70
73
  slots: {
71
- buttons: "searchSlot"
74
+ tools: "keywords"
72
75
  }
73
76
  },
74
- proxyConfig: {
75
- response: {
76
- result: "result",
77
- total: "page.total"
78
- },
79
- ajax: {}
80
- },
81
77
  menuConfig: {
82
78
  //右键菜单配置
83
79
  header: {
84
80
  options: []
85
81
  },
86
82
  body: {
87
- options: [
88
- [
89
- { code: "insert", name: "插入行", visible: true, disabled: false },
90
- { code: "copy", name: "复制行", prefixIcon: "vxe-icon-copy", visible: true, disabled: false }
91
- ]
92
- ]
83
+ options: []
93
84
  },
94
85
  footer: {
95
86
  options: []
@@ -1,37 +1,27 @@
1
+ /**
2
+ * SohelpVxeGrid对外默认属性
3
+ */
1
4
  export default {
2
5
  value: [Array, String],
3
- data: Array,
4
- /**网格列表配置ID*/
5
- refid: {
6
+ /**读取数据源URL**/
7
+ url: {
6
8
  type: String,
7
- defaultValue: '',
8
- required: true
9
+ default: ""
9
10
  },
10
11
  /**自动加载数据*/
11
12
  autoLoad: {
12
13
  type: Boolean,
13
- defaultValue: false
14
- },
15
- gridOptions:Object,
16
- /**数据源URL**/
17
- url: {
18
- type: String,
19
- defaultValue: ''
14
+ default: true
20
15
  },
16
+ gridOptions: Object,
21
17
  /**允许拖动记录*/
22
18
  drag: {
23
19
  type: Boolean,
24
20
  default: false
25
21
  },
26
- /**
27
- * 是否实体列表
28
- */
29
- isEntityGrid: {
30
- type: Boolean,
31
- default: false
32
- },
22
+ /**是否可以多选*/
33
23
  multiple: {
34
24
  type: Boolean,
35
25
  default: true
36
26
  }
37
- }
27
+ };
@@ -1,7 +1,7 @@
1
- import DefaultGridOptions from './DefaultGridOptions';
2
- import { nextTick, reactive, ref } from 'vue';
3
- import Sortable from 'sortablejs';
4
- import { moduleCache } from '../cache/ModuleCache';
1
+ import DefaultGridOptions from "./DefaultGridOptions";
2
+ import { nextTick, reactive, ref } from "vue";
3
+ import Sortable from "sortablejs";
4
+ import { moduleCache } from "../cache/ModuleCache";
5
5
 
6
6
  /**列转换*/
7
7
  const switchVxeProperty = (property) => {
@@ -12,14 +12,14 @@ const switchVxeProperty = (property) => {
12
12
  showOverflow: true
13
13
  };
14
14
 
15
- if (property.name === 'id') {
16
- editor['width'] = 50;
15
+ if (property.name === "id") {
16
+ editor["width"] = 50;
17
17
  }
18
18
 
19
19
  if (property.edit) {
20
- editor['editRender'] = {
20
+ editor["editRender"] = {
21
21
  enabled: true,
22
- name: property.editor || 'input'
22
+ name: property.editor || "input"
23
23
  };
24
24
  }
25
25
  return editor;
@@ -30,9 +30,10 @@ const sortable = ref();
30
30
  const rowDrop = (sohelpVxeGridRef) => {
31
31
  nextTick(() => {
32
32
  const xGTable = sohelpVxeGridRef.value;
33
- sortable.value = Sortable.create(xGTable.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {
34
- handle: '.drag-btn',
35
- onEnd: ({ newIndex, oldIndex }) => {}
33
+ sortable.value = Sortable.create(xGTable.$el.querySelector(".body--wrapper>.vxe-table--body tbody"), {
34
+ handle: ".drag-btn",
35
+ onEnd: ({ newIndex, oldIndex }) => {
36
+ }
36
37
  });
37
38
  });
38
39
  };
@@ -55,7 +56,7 @@ const filterFieldsByProperties = (_filter) => {
55
56
  filter.list = filterArray(filter.list);
56
57
  filter.filter.keywords = filterArray(filter.filter.keywords);
57
58
  filter.filter.sort = filterArray(filter.filter.sort);
58
- filter.filter.field = filterArray(filter.filter.field, 'name');
59
+ filter.filter.field = filterArray(filter.filter.field, "name");
59
60
  return filter;
60
61
  };
61
62
 
@@ -63,10 +64,10 @@ const filterFieldsByProperties = (_filter) => {
63
64
  export async function initial(sohelpVxeGridRef, props) {
64
65
  var data = null;
65
66
  if (props.refid) {
66
- data = props.isEntityGrid ? await moduleCache.getEntityGrid(props.refid) : await moduleCache.getGrid(props.refid);
67
+ data = await moduleCache.getGrid(props.refid);
67
68
 
68
69
  if (!data) {
69
- throw new Error('Invalid config data or missing code');
70
+ throw new Error(props.refid+" 不存在!");
70
71
  }
71
72
 
72
73
  try {
@@ -88,17 +89,17 @@ export async function initial(sohelpVxeGridRef, props) {
88
89
  //初始化属性列表配置
89
90
  DefaultGridOptions.columns = [
90
91
  {
91
- field: props.multiple ? 'checkbox' : 'radio',
92
- fixed: 'left',
93
- type: props.multiple ? 'checkbox' : 'radio',
92
+ field: props.multiple ? "checkbox" : "radio",
93
+ fixed: "left",
94
+ type: props.multiple ? "checkbox" : "radio",
94
95
  width: 35,
95
- align: 'center'
96
+ align: "center"
96
97
  },
97
98
  {
98
- type: 'seq',
99
- title: '#',
100
- fixe: 'left',
101
- align: 'center',
99
+ type: "seq",
100
+ title: "#",
101
+ fixe: "left",
102
+ align: "center",
102
103
  width: 40
103
104
  }
104
105
  ];
@@ -118,13 +119,13 @@ export async function initial(sohelpVxeGridRef, props) {
118
119
 
119
120
  if (drag) {
120
121
  DefaultGridOptions.columns.unshift({
121
- title: '',
122
- fixed: 'left',
122
+ title: "",
123
+ fixed: "left",
123
124
  width: 40,
124
- align: 'center',
125
+ align: "center",
125
126
  dragSort: true,
126
127
  slots: {
127
- default: 'draggableDefault'
128
+ default: "draggableDefault"
128
129
  }
129
130
  });
130
131
  }
@@ -136,7 +137,7 @@ export async function initial(sohelpVxeGridRef, props) {
136
137
  }
137
138
  const gridOptions = props.refid ? DefaultGridOptions : props.gridOptions || DefaultGridOptions;
138
139
 
139
- return { gridOptions, sohelpConfig: SohelpConfig, propertiesMap};
140
+ return { gridOptions, sohelpConfig: SohelpConfig, propertiesMap };
140
141
  }
141
142
 
142
143
  export default initial;