sh-view 1.6.5 → 1.7.1

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": "1.6.5",
3
+ "version": "1.7.1",
4
4
  "description": "基于vxe-table、view-ui-plus二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -10,7 +10,6 @@ import ShIvForm from './global-components/sh-iv-form/index.vue'
10
10
  import ShLayout from './global-components/sh-layout/index.vue'
11
11
  import ShLoading from './global-components/sh-loading/index.vue'
12
12
  import ShNoticeBar from './global-components/sh-noticebar/index.vue'
13
- import ShPreview from './global-components/sh-preview/index.vue'
14
13
  import ShPullRefresh from './global-components/sh-pull-refresh/index.vue'
15
14
  import ShResult from './global-components/sh-result/index.vue'
16
15
  import ShUpload from './global-components/sh-upload/index.vue'
@@ -35,7 +34,6 @@ const components = {
35
34
  ShLayout,
36
35
  ShLoading,
37
36
  ShNoticeBar,
38
- ShPreview,
39
37
  ShPullRefresh,
40
38
  ShResult,
41
39
  ShUpload,
@@ -50,8 +48,9 @@ const components = {
50
48
  }
51
49
 
52
50
  const index = {
53
- install: function (Vue) {
54
- Object.keys(components).forEach(key => {
51
+ install: function (Vue, { excludeComponents = [] }) {
52
+ let globalComponentKeys = Object.keys(components).filter(key => !excludeComponents.includes(key))
53
+ globalComponentKeys.forEach(key => {
55
54
  Vue.component(key, components[key])
56
55
  })
57
56
  }
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import ShWord from '@vue-office/docx'
8
+ import * as ShWord from '@vue-office/docx'
9
9
  import '@vue-office/docx/lib/index.css'
10
10
  import * as ShExcel from '@vue-office/excel'
11
11
  import '@vue-office/excel/lib/index.css'
package/packages/index.js CHANGED
@@ -9,15 +9,15 @@ import mixin from './mixin/index'
9
9
  import './css/index'
10
10
 
11
11
  // 全局公共封装组件
12
- const install = function (root) {
12
+ const install = function (root, option = {}) {
13
13
  if (install.installed) return
14
14
  root.config.globalProperties.$vUtils = utils
15
15
  root.mixin(mixin)
16
- root.use(VueMasonryPlugin)
16
+ root.use(VueMasonryPlugin, option)
17
17
  root.use(directive)
18
- root.use(iview)
19
- root.use(vxeTable)
20
- root.use(globalComponents)
18
+ root.use(iview, option)
19
+ root.use(vxeTable, option)
20
+ root.use(globalComponents, option)
21
21
  }
22
22
 
23
23
  const ShUI = {
@@ -8,7 +8,7 @@ ViewUI.Message.config({
8
8
  })
9
9
 
10
10
  const index = {
11
- install: function (Vue) {
11
+ install: function (Vue, { viewOption = {} }) {
12
12
  let ViewUiOption = {
13
13
  transfer: true,
14
14
  capture: false,
@@ -17,7 +17,8 @@ const index = {
17
17
  arrowSize: 20
18
18
  }
19
19
  }
20
- Vue.use(ViewUI, ViewUiOption)
20
+ let setupOption = Object.assign(ViewUiOption, viewOption)
21
+ Vue.use(ViewUI, setupOption)
21
22
  Vue.config.globalProperties.$ViewUI = ViewUI
22
23
  }
23
24
  }
@@ -154,23 +154,27 @@ let vxeOptions = {
154
154
  }
155
155
  }
156
156
 
157
- VXETable.renderer.mixin(defaultPublicRenders)
158
- VXETable.renderer.mixin(defaultExtraRenders)
159
- VXETable.renderer.mixin(defaultFilterRenders)
160
- VXETable.setup(vxeOptions)
161
- VXETablePluginExportPDF.setup({
157
+ let vxePdfOptions = {
162
158
  // 设置全局默认字体
163
159
  fontName: 'SourceHanSans-Normal',
164
160
  beforeMethod: ({ $pdf, options, columns, datas }) => {}
165
- })
161
+ }
162
+
163
+ VXETable.renderer.mixin(defaultPublicRenders)
164
+ VXETable.renderer.mixin(defaultExtraRenders)
165
+ VXETable.renderer.mixin(defaultFilterRenders)
166
166
  VXETable.use(VXETablePluginExportXLSX)
167
167
  VXETable.use(VXETablePluginExportPDF)
168
168
 
169
169
  const index = {
170
- install: function (Vue) {
170
+ install: function (Vue, { vxeOption = {}, vxePdfOption = {} }) {
171
+ let setupOption = Object.assign(vxeOptions, vxeOption)
172
+ let pdfSetUpOption = Object.assign(vxePdfOptions, vxePdfOption)
173
+ VXETable.setup(setupOption)
174
+ VXETablePluginExportPDF.setup(pdfSetUpOption)
171
175
  Vue.use(VXETable)
172
176
  Vue.config.globalProperties.$vTable = VXETable
173
- Vue.config.globalProperties.$vTableSetup = vxeOptions
177
+ Vue.config.globalProperties.$vTableSetup = setupOption
174
178
  Vue.config.globalProperties.$vxePluginNames = defaultPublicRendersNames
175
179
  Vue.config.globalProperties.$vClipboard = XEClipboard
176
180
  }