ci-plus 1.2.9 → 1.3.0

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": "ci-plus",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
@@ -6,16 +6,15 @@
6
6
  * @since : 创建时间 2024-03-15 15:16:12
7
7
  */
8
8
  // import { scan_card_code_get } from '@/api/InventoryBatch'
9
- import { ElMessage } from 'element-plus'
9
+ import { ElMessage, MessageParamsWithType } from 'element-plus'
10
10
  import { setDate } from '@/utils/Dayjs'
11
11
  import apis from '@/utils/baseApi'
12
12
  import axios from 'axios'
13
13
  import { ref } from 'vue'
14
14
  const { storageModule } = apis
15
15
 
16
- let baseUrls = new URL(storageModule).origin + '/' // 图片的地址前缀
17
-
18
- let url = storageModule + 'scan_card_code_get/'
16
+ let baseUrls = storageModule //new URL(storageModule).origin + '/' // 图片的地址前缀
17
+ let apiurl = storageModule + 'scan_card_code_get/'
19
18
 
20
19
  export const cardPrint = (
21
20
  cParams: any,
@@ -23,7 +22,7 @@ export const cardPrint = (
23
22
  baseUrl?: string,
24
23
  ): any => {
25
24
  // 通过表示卡号获取打印信息
26
- let _URL = baseUrl ? baseUrl : url
25
+ let _URL = baseUrl ? baseUrl : apiurl
27
26
  axios
28
27
  .get(_URL, {
29
28
  params: {
@@ -31,12 +30,12 @@ export const cardPrint = (
31
30
  ...cParams,
32
31
  },
33
32
  })
34
- .then((_res) => {
33
+ .then((_res: { data: { code: number; data: any[]; msg: MessageParamsWithType } }) => {
35
34
  console.log('res: ', _res)
36
- if (_res.data.code != 200) return ElMessage.error(_res.data.msg)
37
- if (_res.data.data && _res.data.data.length < 1)
35
+ if (_res.data.code != 200 || (_res.data.data && _res.data.data.length < 1)) {
36
+ callback([])
38
37
  return ElMessage.error(_res.data.msg)
39
-
38
+ }
40
39
  let data = _res.data.data
41
40
  console.log('data: ', data)
42
41
  let dataInfo: any[] = []
@@ -775,11 +774,11 @@ export const cardPrint = (
775
774
 
776
775
  dataInfo.push(obj)
777
776
  })
778
- console.log('dataInfo: ', dataInfo)
777
+ console.log('处理好的标识卡信息:', dataInfo)
779
778
  callback(dataInfo)
780
779
  })
781
- .catch((err) => {
782
- console.log('err: ', err)
780
+ .catch((err: any) => {
781
+ console.log('错误: ', err)
783
782
  callback([])
784
783
  })
785
784
  }