zydx-plus 1.17.76 → 1.17.78
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 +1 -1
- package/src/components/biz_taskInfo/src/bizTaskInfo.vue +0 -5
- package/src/components/dragPopup/src/dragPopup.vue +6 -0
- package/src/components/editor/src/editor.vue +6 -1
- package/src/components/editor2/src/editor.vue +9 -4
- package/src/components/flip/src/flip.vue +76 -13
- package/src/components/input/index.js +6 -0
- package/src/components/input/src/input.vue +219 -0
- package/src/components/tipBox/src/zydxStyle.css +1 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -107,6 +107,8 @@ export default {
|
|
|
107
107
|
this.isMove = false;
|
|
108
108
|
},
|
|
109
109
|
close() {
|
|
110
|
+
this.isMove = false
|
|
111
|
+
this.footIsMove = false
|
|
110
112
|
this.$emit('close');
|
|
111
113
|
}
|
|
112
114
|
}
|
|
@@ -140,6 +142,7 @@ export default {
|
|
|
140
142
|
z-index: 1;
|
|
141
143
|
display: inline-block;
|
|
142
144
|
cursor: ns-resize;
|
|
145
|
+
user-select: none;
|
|
143
146
|
}
|
|
144
147
|
.in{
|
|
145
148
|
position: absolute;
|
|
@@ -150,6 +153,7 @@ export default {
|
|
|
150
153
|
z-index: 1;
|
|
151
154
|
display: inline-block;
|
|
152
155
|
cursor: nwse-resize;
|
|
156
|
+
user-select: none;
|
|
153
157
|
}
|
|
154
158
|
.right{
|
|
155
159
|
position: absolute;
|
|
@@ -160,6 +164,7 @@ export default {
|
|
|
160
164
|
z-index: 1;
|
|
161
165
|
display: inline-block;
|
|
162
166
|
cursor: ew-resize;
|
|
167
|
+
user-select: none;
|
|
163
168
|
}
|
|
164
169
|
.drag-head i {
|
|
165
170
|
position: absolute;
|
|
@@ -191,6 +196,7 @@ export default {
|
|
|
191
196
|
color: #fff;
|
|
192
197
|
border-top-left-radius: 3px;
|
|
193
198
|
border-top-right-radius: 3px;
|
|
199
|
+
user-select: none;
|
|
194
200
|
}
|
|
195
201
|
.drag-cont{
|
|
196
202
|
height: calc(100% - 60px);
|
|
@@ -37,7 +37,7 @@ export default defineComponent({
|
|
|
37
37
|
},
|
|
38
38
|
readOnly: {
|
|
39
39
|
type: Boolean,
|
|
40
|
-
default:
|
|
40
|
+
default: false
|
|
41
41
|
},
|
|
42
42
|
butShow: {
|
|
43
43
|
type: Boolean,
|
|
@@ -61,6 +61,11 @@ export default defineComponent({
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
emits: ['confirm'],
|
|
64
|
+
watch: {
|
|
65
|
+
html() {
|
|
66
|
+
this.formData.html = this.html
|
|
67
|
+
}
|
|
68
|
+
},
|
|
64
69
|
methods: {
|
|
65
70
|
confirm() {
|
|
66
71
|
this.syncContent() //强制同步数据
|
|
@@ -107,7 +107,13 @@ export default {
|
|
|
107
107
|
default: false
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
emits: ['see','complete'],
|
|
110
|
+
emits: ['see','complete','update:data'],
|
|
111
|
+
watch:{
|
|
112
|
+
data(e) {
|
|
113
|
+
this.editor.commands.setContent(json2html({node: "root",child: (e.html === undefined)? [] : e.html}))
|
|
114
|
+
this.uploadAttData = (e.enclosure === undefined)? [] : e.enclosure
|
|
115
|
+
},
|
|
116
|
+
},
|
|
111
117
|
mounted() {
|
|
112
118
|
this.uploadAttData = (this.data.enclosure === undefined)? [] : this.data.enclosure
|
|
113
119
|
this.heightStyle = (this.height === '100%')? {height: '100%'} : {'min-height': this.height}
|
|
@@ -162,7 +168,6 @@ export default {
|
|
|
162
168
|
const file = e.target.files[0]
|
|
163
169
|
if(this.uploadType) {
|
|
164
170
|
if(v === 'uploadAtt') {
|
|
165
|
-
console.log(file)
|
|
166
171
|
this.uploadAttData.push(file)
|
|
167
172
|
}else {
|
|
168
173
|
this.uploadFile(file).then(r => {
|
|
@@ -219,7 +224,7 @@ export default {
|
|
|
219
224
|
download(index) {
|
|
220
225
|
const url = this.uploadImage.url + this.uploadAttData[index].filePath
|
|
221
226
|
let a = document.createElement('a');
|
|
222
|
-
a.style = '
|
|
227
|
+
a.style.display = 'none';
|
|
223
228
|
a.download = this.uploadAttData[index].filename;
|
|
224
229
|
a.href = url;
|
|
225
230
|
document.body.appendChild(a);
|
|
@@ -308,7 +313,7 @@ export default {
|
|
|
308
313
|
}
|
|
309
314
|
.editor{
|
|
310
315
|
border-radius: 3px;
|
|
311
|
-
padding:
|
|
316
|
+
padding: 10px;
|
|
312
317
|
outline: none;
|
|
313
318
|
}
|
|
314
319
|
.editor img{
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="docView">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
<div v-show="show" class="load-pop">
|
|
4
|
+
<div class="load">
|
|
5
|
+
<span>文件较大耐心等待</span>
|
|
6
|
+
<div class="loading">
|
|
7
|
+
<div class="loading-cont" :style="{'width': loadWidth +'%'}"></div>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-show="!show" style="height: 100%;">
|
|
12
|
+
<div class="pdf-container">
|
|
13
|
+
<canvas :id="'pdf-canvas'+ index" v-for="(item,index) in pdfPages" class="pdf-canvas"></canvas>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="book">
|
|
16
|
+
<flipbook class="flipbook" :startPage="pageIndex" :pages="imgArr" @flip-left-end="flipLeft($event,false)" @flip-right-end="flipRight($event,false)" v-slot="flipbook" :singlePage="singlePage" :ambient="0" :gloss="1" :dragToFlip="false" :pagesHiRes="0">
|
|
17
|
+
<div class="but" v-if="butShow">
|
|
18
|
+
<button class="but-brown" :class="{'but-act': pageIndex === 1}" @click="flipbook.flipLeft">上一页</button>
|
|
19
|
+
<button class="but-brown" :class="{'but-act': pageIndex === pdfPages}" @click="flipbook.flipRight">下一页</button>
|
|
20
|
+
</div>
|
|
21
|
+
</flipbook>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
14
24
|
</div>
|
|
15
25
|
</template>
|
|
16
26
|
|
|
@@ -26,7 +36,10 @@ export default {
|
|
|
26
36
|
pdfPages: 0,
|
|
27
37
|
imgArr: [],
|
|
28
38
|
hei: 0,
|
|
29
|
-
pageIndex: this.page
|
|
39
|
+
pageIndex: this.page,
|
|
40
|
+
show: false,
|
|
41
|
+
load: 0,
|
|
42
|
+
loadWidth: 0
|
|
30
43
|
}
|
|
31
44
|
},
|
|
32
45
|
props: {
|
|
@@ -74,6 +87,7 @@ export default {
|
|
|
74
87
|
},
|
|
75
88
|
readPdf() {
|
|
76
89
|
let that = this
|
|
90
|
+
if(that.pdfPages > 30) that.show = true
|
|
77
91
|
const loadingTask = PdfJs.getDocument(this.source)
|
|
78
92
|
loadingTask.promise.then((pdf) => {
|
|
79
93
|
that.pdfPages = pdf.numPages // 获取pdf文件的总页数
|
|
@@ -95,13 +109,28 @@ export default {
|
|
|
95
109
|
viewport: viewport
|
|
96
110
|
}
|
|
97
111
|
page.render(renderContext)
|
|
112
|
+
if(that.pdfPages > 30) {
|
|
113
|
+
that.load = i + 1
|
|
114
|
+
that.loadWidth = Math.floor(that.load / that.pdfPages * 100)
|
|
115
|
+
}
|
|
98
116
|
});
|
|
99
117
|
}
|
|
100
|
-
setTimeout(()
|
|
118
|
+
setTimeout(function () {
|
|
101
119
|
for (let i = 0; i < that.pdfPages; i++) {
|
|
102
120
|
const canvas = document.getElementById('pdf-canvas' + i)
|
|
103
121
|
const dataURL = canvas.toDataURL("image/jpeg", 1); //获取Base64编码
|
|
104
122
|
that.imgArr.push(dataURL)
|
|
123
|
+
that.load = i + 1
|
|
124
|
+
if(that.pdfPages > 30) {
|
|
125
|
+
if(that.load >= that.pdfPages) {
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
that.show = false
|
|
128
|
+
that.load = 0
|
|
129
|
+
},100)
|
|
130
|
+
}else {
|
|
131
|
+
that.loadWidth = Math.floor(that.load / that.pdfPages * 100)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
105
134
|
}
|
|
106
135
|
}, 500)
|
|
107
136
|
})
|
|
@@ -111,6 +140,40 @@ export default {
|
|
|
111
140
|
</script>
|
|
112
141
|
|
|
113
142
|
<style scoped>
|
|
143
|
+
.load-pop{
|
|
144
|
+
width: 100%;
|
|
145
|
+
height: 100%;
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
}
|
|
149
|
+
.load{
|
|
150
|
+
display: inline-block;
|
|
151
|
+
margin: 0 auto;
|
|
152
|
+
}
|
|
153
|
+
.load>span{
|
|
154
|
+
display: inline-block;
|
|
155
|
+
width: 100%;
|
|
156
|
+
text-align: center;
|
|
157
|
+
padding-bottom: 10px;
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
}
|
|
160
|
+
.loading{
|
|
161
|
+
width: 200px;
|
|
162
|
+
height: 10px;
|
|
163
|
+
border-radius: 20px;
|
|
164
|
+
position: relative;
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
background-color: #ccc;
|
|
167
|
+
}
|
|
168
|
+
.loading-cont{
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 0;
|
|
171
|
+
left: 0;
|
|
172
|
+
z-index: 1;
|
|
173
|
+
background-color: #5daf34;
|
|
174
|
+
height: 100%;
|
|
175
|
+
border-radius: 20px;
|
|
176
|
+
}
|
|
114
177
|
#docView{
|
|
115
178
|
height: 100%;
|
|
116
179
|
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input_wrapper"
|
|
3
|
+
:class="{ 'border': border }">
|
|
4
|
+
<slot name="prefix"></slot>
|
|
5
|
+
<template v-if="['input', 'text', 'password', 'email', 'number'].includes(type)">
|
|
6
|
+
<input :value="value"
|
|
7
|
+
class="input"
|
|
8
|
+
:type="type"
|
|
9
|
+
:maxlength="maxlength"
|
|
10
|
+
:min="min"
|
|
11
|
+
:max="max"
|
|
12
|
+
:minlength="minLength"
|
|
13
|
+
:placeholder="readonly ? '' : placeholder"
|
|
14
|
+
:readonly="readonly"
|
|
15
|
+
@input="onInput"
|
|
16
|
+
@blur="onBlur" />
|
|
17
|
+
<template v-if="hasSuffixSlot">
|
|
18
|
+
<div class="suffix_container">
|
|
19
|
+
<slot name="suffix"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-if="type === 'textarea'">
|
|
24
|
+
<textarea :value="value"
|
|
25
|
+
class="textarea"
|
|
26
|
+
ref="target"
|
|
27
|
+
:type="type"
|
|
28
|
+
:maxlength="maxlength"
|
|
29
|
+
:minlength="minLength"
|
|
30
|
+
:placeholder="placeholder"
|
|
31
|
+
:readonly="readonly"
|
|
32
|
+
@input="onInput" />
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { defineComponent } from 'vue';
|
|
39
|
+
|
|
40
|
+
export default defineComponent({
|
|
41
|
+
name: 'zydx-input',
|
|
42
|
+
props: {
|
|
43
|
+
type: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: 'text'
|
|
46
|
+
},
|
|
47
|
+
maxlength: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: null
|
|
50
|
+
},
|
|
51
|
+
step: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 1
|
|
54
|
+
},
|
|
55
|
+
minLength: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
placeholder: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
readonly: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
row: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: () => null
|
|
70
|
+
},
|
|
71
|
+
border: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
value: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ''
|
|
78
|
+
},
|
|
79
|
+
max: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: Infinity
|
|
82
|
+
},
|
|
83
|
+
min: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: -Infinity
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
mounted() {
|
|
93
|
+
this.setDefaultHeight()
|
|
94
|
+
},
|
|
95
|
+
methods: {
|
|
96
|
+
onInput(e) {
|
|
97
|
+
this.$emit('update:value', this.sanitize(e.target.value))
|
|
98
|
+
if (this.type === 'textarea') {
|
|
99
|
+
this.triggerResize()
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
onBlur: function (e) {
|
|
103
|
+
if (this.type === 'number') {
|
|
104
|
+
let value = Number(e.target.value)
|
|
105
|
+
value > this.max && (value = this.max)
|
|
106
|
+
value < this.min && (value = this.min)
|
|
107
|
+
if (String(value).indexOf('.') !== -1) {
|
|
108
|
+
let digits = Math.log10((1 / this.step))
|
|
109
|
+
value = value.toFixed(digits)
|
|
110
|
+
}
|
|
111
|
+
e.target.value = String(value)
|
|
112
|
+
this.$emit('update:value', String(value))
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
setDefaultHeight: function () {
|
|
117
|
+
if (this.type !== 'textarea') return
|
|
118
|
+
if (!this.row) return
|
|
119
|
+
const { min } = this.row
|
|
120
|
+
this.$refs.target.style.height = `${min * 30}px`
|
|
121
|
+
},
|
|
122
|
+
sanitize: function (input) {
|
|
123
|
+
return input.replace(/<\/?[^>]+>/ig, "");
|
|
124
|
+
},
|
|
125
|
+
triggerResize: function () {
|
|
126
|
+
let element = this.$refs.target
|
|
127
|
+
if (!element) return
|
|
128
|
+
if (!element.scrollHeight) {
|
|
129
|
+
element.style.height = '30px'
|
|
130
|
+
} else {
|
|
131
|
+
if (!this.row) {
|
|
132
|
+
element.style.height = `${element.scrollHeight}px`
|
|
133
|
+
} else {
|
|
134
|
+
const { min, max } = this.row
|
|
135
|
+
if (element.scrollHeight < min * 30) {
|
|
136
|
+
element.style.height = `${min * 30}px`
|
|
137
|
+
} else if (element.scrollHeight > max * 30) {
|
|
138
|
+
element.style.height = `${max * 30}px`
|
|
139
|
+
} else {
|
|
140
|
+
element.style.height = `${element.scrollHeight}px`
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
computed: {
|
|
147
|
+
hasSuffixSlot() {
|
|
148
|
+
return !!this.$slots.suffix;
|
|
149
|
+
},
|
|
150
|
+
hasPreffixSlot() {
|
|
151
|
+
return !!this.$slots.prefix;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<style scoped>
|
|
158
|
+
.input_wrapper {
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: auto;
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: flex-start;
|
|
164
|
+
border-radius: 3px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.input_wrapper.border {
|
|
168
|
+
border: 1px solid #ccc
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.input_wrapper .input {
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 30px;
|
|
174
|
+
border: none;
|
|
175
|
+
outline: none;
|
|
176
|
+
background: transparent;
|
|
177
|
+
padding: 0 10px;
|
|
178
|
+
font-size: 14px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.input_wrapper .textarea {
|
|
182
|
+
width: 100%;
|
|
183
|
+
border: none;
|
|
184
|
+
outline: none;
|
|
185
|
+
background: transparent;
|
|
186
|
+
height: 30px;
|
|
187
|
+
padding: 0 10px;
|
|
188
|
+
font-size: 14px;
|
|
189
|
+
line-height: 30px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.prefix_container {
|
|
193
|
+
width: 24px;
|
|
194
|
+
height: 24px;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.suffix_container {
|
|
201
|
+
width: auto;
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
padding: 0 10px
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.suffix_container:deep(*) {
|
|
209
|
+
width: auto;
|
|
210
|
+
height: 16px;
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
white-space: nowrap;
|
|
213
|
+
line-height: 16px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.textarea::-webkit-scrollbar {
|
|
217
|
+
display: none;
|
|
218
|
+
}
|
|
219
|
+
</style>
|