doway-coms 1.1.56 → 1.1.57

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.57",
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'
@@ -133,6 +134,7 @@ export {
133
134
  BaseForm,
134
135
  BaseGrid,
135
136
  BasePictureCard,
137
+ BasePrintPreview,
136
138
  store,
137
139
  request,
138
140
  }