zydx-plus 1.32.220 → 1.32.222

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": "zydx-plus",
3
- "version": "1.32.220",
3
+ "version": "1.32.222",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
File without changes
@@ -0,0 +1,146 @@
1
+ <template>
2
+ <div class="direct" v-show="direct" :style="position"
3
+ @mousedown="mousedown"
4
+ @mousemove="mousemove"
5
+ @mouseup="mouseup"
6
+ @mouseleave="mousemove">
7
+ <video ref="video" :style="videoStyle" autoplay playsinline></video>
8
+ </div>
9
+ <video ref="video2" autoplay playsinline></video>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: "zydx-directSeeding",
15
+ data() {
16
+ return {
17
+ ws: null,
18
+ lockReconnect: false,
19
+ x: 0,//left:x
20
+ y: 0,//top:y
21
+ width: 230,
22
+ height: 170,
23
+ leftOffset: 0,
24
+ topOffset: 0,
25
+ isMove: false,
26
+ direct: false
27
+ }
28
+ },
29
+ mounted() {
30
+ this.init();
31
+ },
32
+ computed: {
33
+ position() {
34
+ return `top:${this.y}px;left:${this.x}px;width:${this.width}px;height:${this.height}px;`;
35
+ },
36
+ videoStyle() {
37
+ return `width:${this.width}px;height:${this.height}px;`;
38
+ }
39
+ },
40
+ methods: {
41
+ init() {
42
+ let clientWidth = document.documentElement.clientWidth;
43
+ let clientHeight = document.documentElement.clientHeight;
44
+ this.x = clientWidth / 2 + this.width;
45
+ this.y = clientHeight / 2 + this.height;
46
+ },
47
+ mousedown(event) {
48
+ event.preventDefault()
49
+ //鼠标按下事件
50
+ this.leftOffset = event.offsetX;
51
+ this.topOffset = event.offsetY;
52
+ this.isMove = true;
53
+ },
54
+ //鼠标移动
55
+ mousemove(event) {
56
+ if (!this.isMove) return;
57
+ this.x = event.clientX - this.leftOffset;
58
+ this.y = event.clientY - this.topOffset;
59
+ },
60
+ //鼠标抬起
61
+ mouseup() {
62
+ this.isMove = false;
63
+ },
64
+ open(url) {
65
+ let that = this
66
+ that.ws = new WebSocket(url);
67
+ that.ws.onopen = async function (evt) {
68
+ await that.seeding()
69
+ };
70
+ that.ws.onmessage = function (evt) {
71
+ console.log("Received Message: " + evt.data);
72
+ };
73
+ that.ws.onerror = function (evt) {
74
+ that.reconnect(url); // 重连
75
+ };
76
+ that.ws.onclose = function (evt) {
77
+ that.reconnect(url); // 重连
78
+ };
79
+ },
80
+ async seeding() {
81
+ this.direct = true
82
+ const video = this.$refs.video
83
+ const video2 = this.$refs.video2
84
+ const pc1 = new RTCPeerConnection()
85
+ const localStream = await navigator.mediaDevices.getUserMedia({
86
+ video: true,
87
+ audio: true,
88
+ })
89
+ video.srcObject = localStream
90
+ localStream.getTracks().forEach(function (track) {
91
+ pc1.addTrack(track, localStream)
92
+ })
93
+ const offer = await pc1.createOffer()
94
+ await pc1.setLocalDescription(offer);
95
+
96
+ const pc2 = new RTCPeerConnection()
97
+ pc1.onicecandidate = e => {
98
+ if (e.candidate) {
99
+ // pc2.addIceCandidate(e.candidate);
100
+ // // navigator.mediaDevices.getUserMedia({
101
+ // // video: true,
102
+ // // // audio: true,
103
+ // // })
104
+ // const offerSdp = new RTCSessionDescription({ type: offer.type, sdp: offer.sdp });
105
+ // pc2.setRemoteDescription(offerSdp).then(() => {
106
+ // pc2.createAnswer(answer => {
107
+ // pc1.setLocalDescription(answer)
108
+ // });
109
+ // });
110
+ }
111
+ };
112
+ // pc2.ontrack = e => {
113
+ // if (e && e.streams) {
114
+ // video2.srcObject = e.streams[0]
115
+ // }
116
+ // };
117
+ },
118
+ send(v) {
119
+ this.ws.send(JSON.stringify(v));
120
+ },
121
+ close(v) {
122
+ // this.ws.send(JSON.stringify(v));
123
+ // this.ws.close();
124
+ },
125
+ // 重连
126
+ reconnect(url) {
127
+ if (this.lockReconnect) return;
128
+ this.lockReconnect = true;
129
+ //没连接上会一直重连,设置延迟避免请求过多
130
+ setTimeout(() => {
131
+ this.open(url);
132
+ this.lockReconnect = false;
133
+ }, 2000);
134
+ }
135
+ }
136
+ }
137
+ </script>
138
+
139
+ <style scoped>
140
+ .direct {
141
+ position: fixed;
142
+ top: 0;
143
+ right: 0;
144
+ z-index: 999;
145
+ }
146
+ </style>
@@ -18,7 +18,7 @@
18
18
  <editor-content class="editor" :editor="editor" :style="heightStyleCont" />
19
19
  </div>
20
20
  <div class="editor-but" v-if="butText !== '' && readOnly">
21
- <button class="but" @click="complete">{{ butText }}</button>
21
+ <button class="buts" @click="complete">{{ butText }}</button>
22
22
  </div>
23
23
  <div class="enclosure" v-if="uploadAttData.length > 0 && enclosureShow">
24
24
  <p :style="enclosureStyle">{{ enclosureText }}</p>
@@ -399,22 +399,30 @@ export default {
399
399
  // 保存
400
400
  preservation() {
401
401
  let that = this
402
- that.mindMap.export('png', false, '123213', true).then(r => {
403
- that.$emit('preservation', {
404
- data: that.mindMap.getData(),
405
- url: r
406
- })
402
+ that.$emit('preservation', {
403
+ data: that.mindMap.getData(),
404
+ url: ''
407
405
  })
406
+ // that.mindMap.doExport.png().then((data) => {
407
+ // that.$emit('preservation', {
408
+ // data: that.mindMap.getData(),
409
+ // url: data
410
+ // })
411
+ // })
408
412
  },
409
413
  getContent() {
410
414
  let that = this
411
415
  return new Promise((rl,rs) => {
412
- that.mindMap.export('png', false, '123213', true).then(r => {
413
- rl({
414
- data: that.mindMap.getData(),
415
- url: r
416
- })
416
+ rl({
417
+ data: that.mindMap.getData(),
418
+ url: ''
417
419
  })
420
+ // that.mindMap.export('png', false, '123213', true).then(r => {
421
+ // rl({
422
+ // data: that.mindMap.getData(),
423
+ // url: r
424
+ // })
425
+ // })
418
426
  })
419
427
  },
420
428
  nodeStyle() {
@@ -646,4 +654,4 @@ export default {
646
654
  width: 100%;
647
655
  height: 100%;
648
656
  }
649
- </style>
657
+ </style>
@@ -8,7 +8,7 @@ render(divNode, document.body)
8
8
  const container = divNode.el
9
9
 
10
10
  // 导出函数可通过调用 Confirm() 函数动态创建 XtxConfirm 组件
11
- const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText, promptContent, middle, cancelShow, inputArr }) => {
11
+ const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText,closeShow, promptContent, middle, cancelShow, inputArr }) => {
12
12
  // 返回 Promise 对象
13
13
  return new Promise((resolve, reject) => {
14
14
  // 2. 点击确认按钮,触发resolve同时销毁组件
@@ -49,7 +49,7 @@ const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText,
49
49
  render(null, container)
50
50
  }
51
51
  // 1. 创建 XtxConfirm 组件
52
- const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, cancelText, promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr, submit, cancel, close })
52
+ const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, cancelText, closeShow,promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr, submit, cancel, close })
53
53
  render(VNode, container)
54
54
  })
55
55
  }
@@ -129,7 +129,7 @@ export default {
129
129
  type: Boolean,
130
130
  default: true
131
131
  },
132
- closeShow: { //是否显示取消按钮
132
+ closeShow: { //是否显示关闭按钮
133
133
  type: Boolean,
134
134
  default: false
135
135
  },
@@ -123,6 +123,9 @@
123
123
  .choice-span{
124
124
  padding-left: 20px;
125
125
  }
126
+ .choice-color{
127
+ color: #00ff00;
128
+ }
126
129
  .paper-textarea{
127
130
  width: calc(100% - 2em);
128
131
  height: 85px;
@@ -19,7 +19,7 @@
19
19
  @click="choiceTap(item,index)"
20
20
  :disabled="!item.choice"
21
21
  :style="{border: !item.choice?'1px solid #ccc': '1px solid #000'}">
22
- {{ choiceState? '选择题目' : item.choice?'撤销选择': '选择题目' }}
22
+ {{ choiceState? choiceText.choice : item.choice?choiceText.cancel: choiceText.choice }}
23
23
  </button>
24
24
  </b>
25
25
  <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="collapse" ref="b">
@@ -40,7 +40,7 @@
40
40
  <div class="choice-box" v-for="(ts,ind) in item.testKey">
41
41
  <label>
42
42
  <input class="choice-input" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,index)" :type="ques(item.quesType)?'radio':'checkbox'" :name="index" />
43
- <span :class="{'choice-span': chooseAnswer}">{{ ts.index }}. {{ ts.content[0] }}</span>
43
+ <span :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked}">{{ ts.index }}. {{ ts.content[0] }}</span>
44
44
  </label>
45
45
  </div>
46
46
  </div>
@@ -131,6 +131,13 @@ export default {
131
131
  type: Boolean,
132
132
  default: false
133
133
  },
134
+ choiceText: {
135
+ type: Object,
136
+ default: {
137
+ choice: '选择题目',
138
+ cancel: '撤销选择'
139
+ }
140
+ },
134
141
  titleText: {
135
142
  type: String,
136
143
  default: '材料'
@@ -116,7 +116,7 @@ export default {
116
116
  for (let i = 0; i < data.length; i++) {
117
117
  let text = data[i].offsetHeight
118
118
  if((this.pHeight + text) > this.max) {
119
- if(data[i].children.length === 0) {
119
+ if(data[i].children.length === 0 || data[i].className.indexOf('paper-choice') !== -1) {
120
120
  this.htmlArr.push(this.html)
121
121
  this.pHeight = 0
122
122
  this.html = ''
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.220',
82
+ version: '1.32.222',
83
83
  install,
84
84
  Calendar,
85
85
  Message,