@toolspack/ttd-common 0.1.21 → 0.2.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": "@toolspack/ttd-common",
3
- "version": "0.1.21",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "main": "lib/ttd-common.umd.min.js",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div id="app">
3
- <pdf-view :pdfurl="testD.pdfurl" :scale="1" marginAuto></pdf-view>
3
+ <el-button @click="viewImg">预览</el-button>
4
+ <img :src="pdfurl+'&w=120'" />
4
5
  </div>
5
6
  </template>
6
7
 
@@ -11,11 +12,7 @@ export default {
11
12
  data() {
12
13
  const obj = { a: 2 }
13
14
  return {
14
- testD: {
15
- ...obj,
16
- pdfurl: 'https://opentest.totodi.com/visit/totodi-contract/20210728-46234f90113748a7b84da8ba9567c574-1DABA7.pdf?expireDataTime=1627474098651',
17
- name: 2323,
18
- },
15
+ pdfurl: 'https://opentest.totodi.com/visit/totodi-other/20210913-42b48e947cc34a40b140a09acd039861-6.png?expireDataTime=1631521122550',
19
16
  }
20
17
  },
21
18
  methods: {
@@ -23,7 +20,7 @@ export default {
23
20
  },
24
21
  viewImg(url) {
25
22
  this.$ImgPreview({
26
- url,
23
+ url: this.pdfurl,
27
24
  closeColor: '#ffffff',
28
25
  keyboard: 'open',
29
26
  clickMaskCLose: 'open',
@@ -430,11 +430,11 @@ export default {
430
430
  try {
431
431
  // 序列号等数据,通过 验签工具包,或者 签章工具包,都可以获取
432
432
  const subjectDN = '';// this.PDFCtrl.GetSignCertInfo('SubjectCN')
433
- const issuerDN = '';// this.PDFCtrl.GetSignCertInfo('IssuerDN')
433
+ const issuerDN = 'CFCA ACS ';// this.PDFCtrl.GetSignCertInfo('IssuerDN')
434
434
  const certSN = serialNo || '';// this.PDFCtrl.GetSignCertInfo('SerialNumber')
435
435
 
436
436
  console.log('证书序列号,精确匹配', certSN)
437
- this.PDFCtrl.SelectSignCert(subjectDN, issuerDN, certSN, '')
437
+ this.PDFCtrl.SelectSignCert(subjectDN, issuerDN, `${certSN}`, '')
438
438
  // 添加一个设置服务器时间戳的方法
439
439
  this.PDFCtrl.SetTimestampServer('http://210.74.41.195/timestamp')
440
440
  return true
@@ -505,7 +505,7 @@ export default {
505
505
  lacotionX = Number(item.X) + 47
506
506
  lacotionY = Number(item.height) - Number(item.Y) - 47
507
507
  } else {
508
- // 于静 的签章标签,是未经处理的(无需Y轴颠倒),所以处理方式,和江湖的不一样,
508
+ // 于静 的 签章标签,是未经处理的(无需Y轴颠倒),所以处理方式,和江湖的不一样,
509
509
  lacotionX = Number(item.X) + 47
510
510
  lacotionY = Number(item.Y) - 47
511
511
  }
@@ -1,36 +1,3 @@
1
- <!--
2
- * __----~~~~~~~~~~~------___
3
- * . . ~~//====...... __--~ ~~
4
- * -. \_|// |||\\ ~~~~~~::::... /~
5
- * ___-==_ _-~o~ \/ ||| \\ _/~~-
6
- * __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~
7
- * _-~~ .=~ | \\-_ '-~7 /- / || \ /
8
- * .~ .~ | \\ -_ / /- / || \ /
9
- * / ____ / | \\ ~-_/ /|- _/ .|| \ /
10
- * |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\
11
- * ' ~-| /| |-~\~~ __--~~
12
- * |-~~-_/ | | ~\_ _-~ /\
13
- * / \ \__ \/~ \__
14
- * _--~ _/ | .-~~____--~-/ ~~==.
15
- * ((->/~ '.|||' -_| ~~-/ , . _||
16
- * -_ ~\ ~~---l__i__i__i--~~_/
17
- * _-~-__ ~) \--______________--~~
18
- * //.-~~~-~_--~- |-------~~~~~~~~
19
- * //.-~~~--\
20
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
- *
22
- * 神兽保佑 永无BUG
23
- -->
24
-
25
- <!--
26
- * @Author: your name
27
- * @Date: 2021-03-08 21:11:32
28
- * @LastEditTime: 2021-03-08 22:37:42
29
- * @LastEditors: Please set LastEditors
30
- * @Description: In User Settings Edit
31
- * @FilePath: /hevue-img-preview/src/lib/hevue-img-preview.vue
32
- -->
33
-
34
1
  <template>
35
2
  <transition name="fade">
36
3
  <div
@@ -44,10 +11,9 @@
44
11
  :style="'background:' + mainBackground"
45
12
  >
46
13
  <!-- 用于临时在手机端展示一些调试信息 -->
47
- <!-- <div>{{ logText }}</div> -->
14
+ <!-- <div>{{ logText }}--{{imgState}}</div> -->
48
15
  <div class="he-img-wrap">
49
- <img src="./loading.gif" v-show="imgState === 1" />
50
- <!-- <div class="iconfont loading">&#xe6b1;</div> -->
16
+ <img src="https://jzwsp.totodi.com/jz/image-loading.gif" v-show="imgState === 1" />
51
17
  <img
52
18
  :src="imgurl"
53
19
  ref="heImView"
@@ -303,6 +269,7 @@ export default {
303
269
  img.src = url;
304
270
  img.onload = () => {
305
271
  // 如果加载出来图片当下标不是当前显示图片当下标,则不予显示(用户点击过快当时候,会出现用户点到第三张了,此时第一张图片才加载完当情况)
272
+ console.log(`onload: index=${index}--imgIndex=${this.imgIndex}--imgState=${ this.imgState}`)
306
273
  if (index !== undefined && index === this.imgIndex) {
307
274
  this.imgState = 2;
308
275
  this.imgurl = url;
@@ -310,6 +277,7 @@ export default {
310
277
  this.imgState = 2;
311
278
  this.imgurl = url;
312
279
  }
280
+ console.log('imgState=', this.imgState)
313
281
  };
314
282
  img.onerror = () => {
315
283
  if (index !== undefined && index === this.imgIndex) {
@@ -317,6 +285,7 @@ export default {
317
285
  } else if (index === undefined) {
318
286
  this.imgState = 3;
319
287
  }
288
+ console.log(`onerror : index=${index}--imgIndex=${this.imgIndex}--imgState=${ this.imgState}`)
320
289
  };
321
290
  },
322
291
  // 旋转图片
@@ -1,9 +1,3 @@
1
- /*
2
- * @Author: heyongsheng
3
- * @Date: 2020-04-22 15:40:42
4
- * @Last Modified by: heyongsheng
5
- * @Last Modified time: 2020-07-08 22:49:13
6
- */
7
1
  import Vue from 'vue';
8
2
  import VueToast from './hevue-img-preview.vue';
9
3
 
@@ -435,7 +435,7 @@ export default {
435
435
  /* *
436
436
  前端使用的坐标系统为,左上角为零点, 后台合标签使用的是左下角为零点;
437
437
  所以X坐标不变,Y坐标的需要计算(页面高度- y 再加上 标签的高度 )
438
- 后端忽略了 标签的高度,所以我们给他修复一下 yAxis= Y坐标 + 标签高度
438
+ 后端忽略了 标签的高度,所以我给他修复一下 yAxis= Y坐标 + 标签高度
439
439
  文本标签不做修改
440
440
  */
441
441
  let yAxis = ''
@@ -177,7 +177,11 @@ export default {
177
177
  // console.log('-----encodeURI------', url)
178
178
  // }
179
179
  console.log('----PdfView---', url)
180
- PDFJS.getDocument(encodeURI(url)).promise.then((pdfDoc_) => {
180
+ PDFJS.getDocument({
181
+ url: encodeURI(url),
182
+ cMapUrl: 'https://unpkg.com/pdfjs-dist@2.2.228/cmaps/',
183
+ cMapPacked: true,
184
+ }).promise.then((pdfDoc_) => {
181
185
  // 初始化pdf
182
186
  if (this.pdfDoc) {
183
187
  console.log('pdfDocument is ready destroy,,')
@@ -185,7 +189,7 @@ export default {
185
189
  }
186
190
  this.pdfDoc = pdfDoc_
187
191
  this.page_count = pdfDoc_.numPages
188
- console.log('this.page_count 2.912', this.page_count)
192
+ console.log('this.page_count 22.37', this.page_count)
189
193
  this.$emit('numPages', pdfDoc_.numPages)
190
194
  this.renderPage(this.pageNum)
191
195
  })/* .catch((err) => {
@@ -80,7 +80,7 @@ export default {
80
80
  }
81
81
  try {
82
82
  const subjectDNFilter = ''
83
- const issuerDNFilter = ''
83
+ const issuerDNFilter = 'CFCA ACS '
84
84
  // 此处获取SerialNumber 会报错
85
85
  const serialNumFilter = serialNo;// this.GetSignCertInfoUkey('SerialNumber');
86
86
 
@@ -98,7 +98,7 @@ export default {
98
98
  }
99
99
  return bSelectCertResult
100
100
  } catch (e) {
101
- console.log('SelectCertificateOnClick', e)
101
+ console.log('SelectCertificateOnClick catch', e)
102
102
  const errorDescE = this.CryptoAgent.GetLastErrorDesc();
103
103
  alert(`${errorDescE }/error`);
104
104
  return false
@@ -95,12 +95,12 @@ export default {
95
95
  }
96
96
  try {
97
97
  const subjectDNFilter = '';
98
- const issuerDNFilter = '';
98
+ const issuerDNFilter = 'CFCA ACS ';// CFCA ACS OCA31 ,CFCA ACS OCA32, CFCA ACS TEST OCA31
99
99
  const serialNumFilter = serialNo;
100
- const cspName = 'CFCA FOR UKEY CSP v1.1.0'
100
+ const bstrSM2CSPNameList = 'CFCA FOR UKEY CSP v1.1.0'
101
101
  let bSelectCertResult = '';
102
- console.log('无纸化 选证书 selectSignCert, serialNo(非毕传)=', serialNo)
103
- bSelectCertResult = this.CryptoAgent.SelectCertificate(subjectDNFilter, issuerDNFilter, serialNumFilter, cspName);
102
+ console.log('无纸化 选证书 selectSignCert, serialNo(非传)=', serialNo)
103
+ bSelectCertResult = this.CryptoAgent.SelectCertificate(subjectDNFilter, issuerDNFilter, serialNumFilter, bstrSM2CSPNameList);
104
104
  // Opera浏览器,NPAPI函数执行结果为false时,不能触发异常,需要自己判断返回值。
105
105
  if (!bSelectCertResult) {
106
106
  const errorDesc = this.CryptoAgent.GetLastErrorDesc();
Binary file
Binary file
Binary file
Binary file