sh-view 2.5.2 → 2.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -29,12 +29,12 @@
29
29
  "jszip": "^3.10.1",
30
30
  "popper.js": "^1.16.1",
31
31
  "resize-observer-polyfill": "^1.5.1",
32
- "sh-tools": "^2.0.1",
32
+ "sh-tools": "^2.1.4",
33
33
  "tinymce": "^5.10.5",
34
34
  "vue": "^3.3.4",
35
35
  "vue-masonry": "^0.16.0",
36
36
  "vue-router": "^4.2.4",
37
- "vxe-table": "^4.5.10",
37
+ "vxe-table": "^4.5.11",
38
38
  "vxe-table-plugin-export-pdf": "^3.0.4",
39
39
  "vxe-table-plugin-export-xlsx": "^3.0.5",
40
40
  "xe-clipboard": "^1.10.2",
@@ -67,7 +67,7 @@ export default defineComponent({
67
67
  return types.includes(props.type) ? props.type : 'info'
68
68
  })
69
69
  const resultTitle = computed(() => {
70
- return typeof props.title === 'string' ? props.title : resultTitleMap[resultType.value]
70
+ return props.title ? props.title || resultTitleMap[resultType.value] : false
71
71
  })
72
72
  const resultIcon = computed(() => {
73
73
  return resultIconMap[resultType.value]
@@ -4,9 +4,8 @@ import { columnDefaultFilterMethod, tableFooterCompute, getTransfarFields, getFi
4
4
  const globalConfigDefault = {
5
5
  tableName: '',
6
6
  title: false, // 是否显示 tableName
7
- checkbox: true, // 是否展示复选框
8
- radio: false, // 是否展示单选框
9
- seq: true, // 是否展示序号列
7
+ selectType: '', // 是否选择框 空 radio checkbox
8
+ seq: false, // 是否展示序号列
10
9
  ghost: false, // 是否开启透明
11
10
  search: false, // 表格是否开启查询,默认不开启,根据columns配置字段 search 为 true
12
11
  globalFilter: false, // 表格是否开启全局过滤
@@ -37,11 +36,11 @@ const toolsList = [
37
36
  // 表头默认值
38
37
  const columnObjDefault = { minWidth: 120, sortable: true, filter: true }
39
38
  // 表头默认列
40
- const columnsConfigDefault = [
41
- { title: '', type: 'checkbox', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-checkbox' },
42
- { title: '单选', type: 'radio', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-radio' },
43
- { title: '序号', type: 'seq', width: 70, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-seq' }
44
- ]
39
+ const columnsMapDefault = {
40
+ checkbox: { title: '', type: 'checkbox', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-checkbox' },
41
+ radio: { title: '单选', type: 'radio', width: 60, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-radio' },
42
+ seq: { title: '序号', type: 'seq', width: 70, align: 'center', fixed: 'left', sortable: false, resizable: false, className: 'table-row-seq' }
43
+ }
45
44
 
46
45
  export default function (props, context, proxy, isGrid) {
47
46
  const { $vUtils, $vxePluginNames } = proxy
@@ -70,9 +69,18 @@ export default function (props, context, proxy, isGrid) {
70
69
  return toolsList.filter(tool => tools.includes(tool.code))
71
70
  })
72
71
  const tableViewData = computed(() => tableFilterData.value || props.dataSourse)
72
+ const tablePrevColumns = computed(() => {
73
+ let prevColumns = []
74
+ let prevFields = ['seq', 'selectType']
75
+ prevFields.forEach(prev => {
76
+ if (tableGlobalConfig.value[prev]) {
77
+ prevColumns.push(columnsMapDefault[prev])
78
+ }
79
+ })
80
+ return prevColumns
81
+ })
73
82
  const tableColumns = computed(() => {
74
- let defaultColumns = columnsConfigDefault.filter(item => tableGlobalConfig.value[item.type])
75
- return defaultColumns.concat(tableColumnsFixed.value)
83
+ return tablePrevColumns.value.concat(tableColumnsFixed.value)
76
84
  })
77
85
  const tableColumnObjConfig = computed(() => Object.assign({}, columnObjDefault, props.columnObj))
78
86
  const tableColumnConfig = computed(() => Object.assign({ isCurrent: false, isHover: true, resizable: true }, props.columnConfig))
@@ -157,7 +165,7 @@ export default function (props, context, proxy, isGrid) {
157
165
  let cellValue = $vUtils.get(row, property)
158
166
  if (!$vUtils.isNone(cellValue)) {
159
167
  let { rvalue, rtext } = $vUtils.formatRender(cellValue, property, row, rname, rprops, proxy)
160
- $vUtils.set(row, property, rtext)
168
+ $vUtils.set(row, property, ['$vMoney'].includes(rname) ? rtext : rvalue)
161
169
  }
162
170
  })
163
171
  })
@@ -184,8 +192,7 @@ export default function (props, context, proxy, isGrid) {
184
192
  return footerData
185
193
  }
186
194
  const tableFooterSpanMethod = ({ $rowIndex, column, $columnIndex, data }) => {
187
- let defaultColumns = columnsConfigDefault.filter(item => tableGlobalConfig.value[item.type])
188
- let colspan = defaultColumns.length || 1
195
+ let colspan = tablePrevColumns.value.length || 1
189
196
  if (column.type === 'seq') {
190
197
  return { rowspan: 1, colspan: colspan }
191
198
  } else if (column.type === 'checkbox' || column.type === 'radio') {
@@ -533,6 +540,7 @@ export default function (props, context, proxy, isGrid) {
533
540
  renderKey,
534
541
  wrapHeight,
535
542
  tableGlobalConfig,
543
+ tablePrevColumns,
536
544
  tableColumns,
537
545
  tableColumnConfig,
538
546
  tableColumnObjConfig,
@@ -553,7 +561,6 @@ export default function (props, context, proxy, isGrid) {
553
561
  tableSlots,
554
562
  selectionRows,
555
563
  importVisible,
556
- columnsConfigDefault,
557
564
  tableFooterMethod,
558
565
  tableFooterSpanMethod,
559
566
  onCurrentChange,
@@ -116,8 +116,8 @@
116
116
  @toolbar-button-click="onToolbarButtonClick"
117
117
  @toolbar-tool-click="onToolbarToolClick"
118
118
  @option-click="handleGoptionClick">
119
- <template v-for="(column, columnIndex) in columnsConfigDefault" :key="columnIndex">
120
- <vxe-column v-if="!!tableGlobalConfig[column.type]" v-bind="column"></vxe-column>
119
+ <template v-for="(column, columnIndex) in tablePrevColumns" :key="columnIndex">
120
+ <vxe-column v-bind="column"></vxe-column>
121
121
  </template>
122
122
  <template v-for="(column, columnIndex) in columns" :key="columnIndex">
123
123
  <sh-column :column="column"></sh-column>
@@ -1,6 +1,7 @@
1
1
  <template>
2
+ <sh-result v-if="queryErrorText" class="sh-tree-result" type="error" :title="false" :text="queryErrorText"></sh-result>
2
3
  <vxe-grid
3
- v-if="treeServerComplate && !queryErrorText"
4
+ v-else
4
5
  ref="tableRef"
5
6
  :key="renderKey"
6
7
  :class="{ 'sh-vxe-tree-table': true, 'is--hidecheck': globalConfig.checkHide }"
@@ -15,7 +16,6 @@
15
16
  <sh-empty :icon="emptyIcon" :content="emptyText"></sh-empty>
16
17
  </template>
17
18
  </vxe-grid>
18
- <sh-result v-else-if="queryErrorText" class="sh-tree-result" type="error" :text="queryErrorText"></sh-result>
19
19
  </template>
20
20
 
21
21
  <script>
@@ -109,7 +109,7 @@ export default defineComponent({
109
109
  }
110
110
  // 获取请求配置数据
111
111
  const getServerConfigDataSourse = async () => {
112
- const { serverConfig, serverParams, parseParams, queryCacheParams, serverCache, valueData, globalConfig, multiple, nodeKey, labelField } = props
112
+ const { serverConfig, serverParams, parseParams, serverCache, valueData, globalConfig, multiple, nodeKey, labelField } = props
113
113
  if (!serverConfig.url) {
114
114
  treeServerComplate.value = true
115
115
  return true
@@ -123,7 +123,7 @@ export default defineComponent({
123
123
  params[key] = $vUtils.format(params[key], valueData)
124
124
  }
125
125
  })
126
- if (!$vUtils.isEqual(queryCacheParams, params)) {
126
+ if (!$vUtils.isEqual(queryCacheParams.value, params)) {
127
127
  treeServerComplate.value = false
128
128
  }
129
129
  if (serverCache && treeServerComplate.value) {
@@ -34,10 +34,6 @@
34
34
  }
35
35
 
36
36
  .sh-tree-select-dropdown {
37
- .tree-skeleton{
38
- width: 100%;
39
- height: 230px;
40
- }
41
37
  }
42
38
 
43
39
  .sh-vxe-tree-table{
@@ -49,6 +45,4 @@
49
45
 
50
46
  .sh-tree-result{
51
47
  position: relative;
52
- top: 50%;
53
- transform: translateY(-60%);
54
48
  }
@@ -13,7 +13,6 @@
13
13
  </div>
14
14
  <div class="sh-tree-select-dropdown-content">
15
15
  <table-tree v-if="pulldownDrop" v-bind="tableTreeProps" @datacall="onDataCall" @select="onChange"></table-tree>
16
- <div v-else class="tree-skeleton"></div>
17
16
  </div>
18
17
  </template>
19
18
  </vxe-pulldown>
@@ -69,7 +69,7 @@ const getFixedProp = (renderOpts, params) => {
69
69
  name = props.colRenderName
70
70
  }
71
71
  let rturnProps = Object.assign({}, defaultPublicProps, defaultProps[name], props)
72
- let transKeys = ['disabled', 'multiple', 'isLeaf', 'commafy', 'border', 'calculate']
72
+ let transKeys = ['transfer', 'disabled', 'multiple', 'isLeaf', 'commafy', 'border', 'filterable', 'showWordCount', 'editable']
73
73
  transKeys.forEach(key => {
74
74
  if (rturnProps[key] !== null && rturnProps[key] !== undefined && typeof rturnProps[key] === 'string') {
75
75
  rturnProps[key] = Boolean(+rturnProps[key])