yh-hiprint 1.0.9 → 1.0.11

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.
@@ -1,7 +1,4 @@
1
- import {
2
- hiprint as h,
3
- defaultElementTypeProvider as p,
4
- } from "../libs/hiprint.bundle.js";
1
+ import { hiprint as h, defaultElementTypeProvider as p } from "../libs/hiprint.bundle.js";
5
2
  // 调用浏览器打印js
6
3
  import "../libs/plugins/jquery.hiwprint.js";
7
4
  // 默认配置
@@ -14,11 +11,7 @@ import { ref, computed } from "vue";
14
11
  export const hiprint = h;
15
12
  export const defaultElementTypeProvider = p;
16
13
 
17
- export function print(
18
- provider = defaultElementTypeProvider,
19
- template,
20
- ...args
21
- ) {
14
+ export function print(provider = defaultElementTypeProvider, template, ...args) {
22
15
  hiprint.init({
23
16
  providers: [new provider()],
24
17
  });
@@ -29,11 +22,7 @@ export function print(
29
22
  return hiprintTemplate;
30
23
  }
31
24
 
32
- export function print2(
33
- provider = defaultElementTypeProvider,
34
- template,
35
- ...args
36
- ) {
25
+ export function print2(provider = defaultElementTypeProvider, template, ...args) {
37
26
  hiprint.init({
38
27
  providers: [new provider()],
39
28
  });
@@ -140,6 +129,7 @@ export function useDataSource(axios) {
140
129
  formCode.value = "";
141
130
  }
142
131
  detailData.value = res.data.data;
132
+ return Promise.resolve(res.data.data);
143
133
  });
144
134
  }
145
135
  const listCode = ref([]);
@@ -172,9 +162,7 @@ export function useDataSource(axios) {
172
162
  .then((res) => {
173
163
  res.data.list.forEach((item) => {
174
164
  if (item.columns) {
175
- codeMapDataSource.value[item.code] = item?.columns
176
- ?.split(",")
177
- ?.map((col) => `$${item.code}[${col.toUpperCase()}]`) || [];
165
+ codeMapDataSource.value[item.code] = item?.columns?.split(",")?.map((col) => `$${item.code}[${col.toUpperCase()}]`) || [];
178
166
  }
179
167
  if (item.type === "LIST") {
180
168
  dataSourceList.value.push({