doway-coms 1.1.56 → 1.1.58

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": "doway-coms",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -13,7 +13,7 @@
13
13
  "build:test": "vue-cli-service build --report"
14
14
  },
15
15
 
16
- "peerDependencies": {
16
+ "dependencies": {
17
17
  "ant-design-vue": "1.7.8",
18
18
  "vue": "2.7.14",
19
19
  "vuex": "3.6.2",
@@ -0,0 +1,8 @@
1
+ // 导入组件,组件必须声明 name
2
+ import BasePrintPreview from './src/index.vue';
3
+ // 为组件提供 install 安装方法,供按需引入
4
+ BasePrintPreview.install = function(Vue) {
5
+ Vue.component(BasePrintPreview.name, BasePrintPreview);
6
+ };
7
+ // 默认导出组件
8
+ export default BasePrintPreview;
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <vxe-modal
3
+ append-to-body
4
+ :maskClosable="false"
5
+ :keyboard="false"
6
+ width="85%"
7
+ :closable="true"
8
+ title="打印预览"
9
+ v-if="isShow"
10
+ :visible="isShow"
11
+ wrap-class-name="full-modal"
12
+ @cancel="closeModal"
13
+ >
14
+ <iframe
15
+ name="printFrame"
16
+ id="printFrame"
17
+ ref="printFrame"
18
+ style="height: 100%"
19
+ frameborder="0"
20
+ width="100%"
21
+ height="300px"
22
+ :src="url"
23
+ >
24
+ </iframe>
25
+ </vxe-modal>
26
+ </template>
27
+ <script>
28
+ import {request} from '../../utils/request'
29
+ export default {
30
+ name: 'BasePrintPreview',
31
+ props: {},
32
+ data() {
33
+ return {
34
+ isShow: false,
35
+ url: '',
36
+ postData: '',
37
+ requestToken: '',
38
+ tempData: '',
39
+ }
40
+ },
41
+ methods: {
42
+ showPreview(url, data, isReplace) {
43
+ this.isShow = true
44
+ let ids = ''
45
+ if (isReplace) {
46
+ ids = JSON.stringify(data).replaceAll('"', '')
47
+ } else {
48
+ ids = JSON.stringify(data)
49
+ }
50
+ this.url = url + '?token=' + this.$store.getters.token + '&ids=' + ids
51
+ },
52
+ closeModal() {
53
+ this.$emit('close')
54
+ },
55
+ },
56
+ }
57
+ </script>
58
+
59
+ <style lang="less" scoped>
60
+ .full-modal {
61
+ .ant-modal {
62
+ max-width: 100%;
63
+ top: 0;
64
+ padding-bottom: 0;
65
+ margin: 0;
66
+ }
67
+ .ant-modal-content {
68
+ display: flex;
69
+ flex-direction: column;
70
+ height: calc(100vh);
71
+ }
72
+ .ant-modal-body {
73
+ flex: 1;
74
+ }
75
+ }
76
+ </style>
package/packages/index.js CHANGED
@@ -16,6 +16,7 @@ import BasePulldown from './BasePulldown/index';
16
16
  import BaseIntervalInput from './BaseIntervalInput/index';
17
17
  import BaseForm from './BaseForm/index';
18
18
  import BasePictureCard from './BasePictureCard/index';
19
+ import BasePrintPreview from './BasePrintPreview/index';
19
20
 
20
21
  import store from './utils/store'
21
22
  import request from './utils/request'
@@ -24,7 +25,7 @@ import BaseGrid from './BaseGrid/index';
24
25
  // 存储组件列表
25
26
  const components = [BaseInput,BaseCheckbox,BaseDate,BaseDatetime,BaseDateWeek,BaseTextArea,BaseSelect,BaseSelectMulti
26
27
  ,BaseTime,BasePagination,
27
- BaseNumberInput,BaseTool,BaseToolStatus,BasePulldown,BaseIntervalInput,BaseForm,BasePictureCard,BaseGrid];
28
+ BaseNumberInput,BaseTool,BaseToolStatus,BasePulldown,BaseIntervalInput,BaseForm,BasePictureCard,BaseGrid,BasePrintPreview];
28
29
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
29
30
 
30
31
  import 'vxe-table/lib/style.css'
@@ -65,6 +66,23 @@ VXETable.interceptor.add('event.clearFilter', (params) => {
65
66
  return popupInterceptor(params)
66
67
  })
67
68
 
69
+ //表格自定义格式化
70
+ VXETable.formats.mixin({
71
+ // 格式化下拉选项
72
+ formatSelect(scope) {
73
+ let dataSource = scope.column.params.dataSource
74
+ if (!dataSource) {
75
+ // console.error(scope.cellValue + ' 字典缺失')
76
+ return scope.cellValue
77
+ }
78
+ const item = dataSource.find(item => item.value === scope.cellValue)
79
+ return item ? item.caption : scope.cellValue
80
+ }
81
+ })
82
+
83
+
84
+
85
+
68
86
 
69
87
 
70
88
  const install = function (Vue) {
@@ -133,6 +151,7 @@ export {
133
151
  BaseForm,
134
152
  BaseGrid,
135
153
  BasePictureCard,
154
+ BasePrintPreview,
136
155
  store,
137
156
  request,
138
157
  }