zydx-plus 1.12.46 → 1.12.50
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/buttonGroup/src/buttonGroup.vue +18 -6
- package/src/components/editor/src/editor.vue +1 -1
- package/src/components/flip/src/flip.vue +19 -6
- package/src/components/tipBox/index.js +9 -2
- package/src/components/tipBox/src/main.vue +18 -0
- package/src/components/tipBox/src/zydxStyle.css +17 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@ export default defineComponent({
|
|
|
11
11
|
accordian: {
|
|
12
12
|
type: Boolean,
|
|
13
13
|
default: false
|
|
14
|
+
},
|
|
15
|
+
reset: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
20
|
data() {
|
|
@@ -41,7 +45,7 @@ export default defineComponent({
|
|
|
41
45
|
if (disabled) return
|
|
42
46
|
let file = event.target.files[0]
|
|
43
47
|
if (file.size > file_size * 1024 * 1024) {
|
|
44
|
-
this.$
|
|
48
|
+
this.$message({
|
|
45
49
|
title: '提示',
|
|
46
50
|
promptContent: `文件大小不能超过${file_size}M`,
|
|
47
51
|
cancelShow: false,
|
|
@@ -49,7 +53,7 @@ export default defineComponent({
|
|
|
49
53
|
return
|
|
50
54
|
}
|
|
51
55
|
if (accept.length && !accept.includes(file.type)) {
|
|
52
|
-
this.$
|
|
56
|
+
this.$message({
|
|
53
57
|
title: '提示',
|
|
54
58
|
promptContent: `请选择${accept.join('、')}格式的文件`,
|
|
55
59
|
cancelShow: false,
|
|
@@ -68,15 +72,23 @@ export default defineComponent({
|
|
|
68
72
|
this.$emit('search', this.$el.querySelector('.search_input').value)
|
|
69
73
|
},
|
|
70
74
|
},
|
|
75
|
+
watch: {
|
|
76
|
+
reset: function (v) {
|
|
77
|
+
if (v) {
|
|
78
|
+
this.active_state = this.buttons.map(() => false)
|
|
79
|
+
this.is_show_search = false
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
71
83
|
render() {
|
|
72
84
|
const { trackClick, onInputChange, showSearch, handleSearch, handleClose, is_show_search } = this
|
|
73
|
-
const render = ({ type, name, accept = '', file_size, flip = null, onClick, disabled, idx }) => {
|
|
85
|
+
const render = ({ type, name, accept = '', file_size, flip = null, ignore = false, onClick, disabled, idx }) => {
|
|
74
86
|
let active_name = flip ? flip : name
|
|
75
87
|
switch (type) {
|
|
76
88
|
case 'button':
|
|
77
89
|
return <button
|
|
78
90
|
class={this.active_state[idx] ? 'z-button active' : 'z-button'}
|
|
79
|
-
onClick={() => { onClick(); trackClick(idx) }
|
|
91
|
+
onClick={() => { onClick(); ignore ? () => null : trackClick(idx) }
|
|
80
92
|
}
|
|
81
93
|
disabled={disabled}
|
|
82
94
|
>
|
|
@@ -116,8 +128,8 @@ export default defineComponent({
|
|
|
116
128
|
<div class="z-button-group">
|
|
117
129
|
{
|
|
118
130
|
this.buttons
|
|
119
|
-
.map(({ onClick, disabled, file_size, accept, flip, type = "button", name }, idx) => {
|
|
120
|
-
return render({ type, name, accept, file_size, flip, onClick, disabled, idx })
|
|
131
|
+
.map(({ onClick, disabled, file_size, accept, flip, ignore, type = "button", name }, idx) => {
|
|
132
|
+
return render({ type, name, accept, file_size, flip, ignore, onClick, disabled, idx })
|
|
121
133
|
}
|
|
122
134
|
)
|
|
123
135
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<we-toolbar v-if="!readOnly && toolbar.length > 0" class="toolbar" :handle="handle" />
|
|
3
3
|
<we-editable class="editable" :style="{'min-height': height + 'px'}" :handle="handle" v-model:html="formData.html" />
|
|
4
|
-
<div class="but">
|
|
4
|
+
<div class="but" v-if="!readOnly && toolbar.length > 0">
|
|
5
5
|
<button class="def-but" @click="confirm">完成</button>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<div class="book">
|
|
7
7
|
<flipbook class="flipbook" :pages="imgArr" @flip-left-end="flipLeft" @flip-right-end="flipRight" v-slot="flipbook" :singlePage="singlePage" :ambient="0" :gloss="1" :dragToFlip="false" :pagesHiRes="0">
|
|
8
8
|
<div class="but">
|
|
9
|
-
<button class="but-brown" @click="flipbook.flipLeft">上一页</button>
|
|
10
|
-
<button class="but-brown" @click="flipbook.flipRight">下一页</button>
|
|
9
|
+
<button class="but-brown" :class="{'but-act': pageIndex === 1}" @click="flipbook.flipLeft">上一页</button>
|
|
10
|
+
<button class="but-brown" :class="{'but-act': pageIndex === pdfPages}" @click="flipbook.flipRight">下一页</button>
|
|
11
11
|
</div>
|
|
12
12
|
</flipbook>
|
|
13
13
|
</div>
|
|
@@ -25,7 +25,8 @@ export default {
|
|
|
25
25
|
return {
|
|
26
26
|
pdfPages: 0,
|
|
27
27
|
imgArr: [],
|
|
28
|
-
hei: 0
|
|
28
|
+
hei: 0,
|
|
29
|
+
pageIndex: 1
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
props: {
|
|
@@ -45,10 +46,18 @@ export default {
|
|
|
45
46
|
},
|
|
46
47
|
methods: {
|
|
47
48
|
flipLeft(e) {
|
|
48
|
-
this
|
|
49
|
+
this.pageIndex = e
|
|
50
|
+
this.$emit('flip',{
|
|
51
|
+
page: e,
|
|
52
|
+
total: this.pdfPages
|
|
53
|
+
})
|
|
49
54
|
},
|
|
50
55
|
flipRight(e) {
|
|
51
|
-
this
|
|
56
|
+
this.pageIndex = e
|
|
57
|
+
this.$emit('flip',{
|
|
58
|
+
page: e,
|
|
59
|
+
total: this.pdfPages
|
|
60
|
+
})
|
|
52
61
|
},
|
|
53
62
|
readPdf() {
|
|
54
63
|
let that = this
|
|
@@ -81,7 +90,7 @@ export default {
|
|
|
81
90
|
const dataURL = canvas.toDataURL("image/jpeg",1); //获取Base64编码
|
|
82
91
|
that.imgArr.push(dataURL)
|
|
83
92
|
}
|
|
84
|
-
},
|
|
93
|
+
},500)
|
|
85
94
|
})
|
|
86
95
|
}
|
|
87
96
|
}
|
|
@@ -131,4 +140,8 @@ export default {
|
|
|
131
140
|
left: 0;
|
|
132
141
|
z-index: -100;
|
|
133
142
|
}
|
|
143
|
+
.but-act{
|
|
144
|
+
background-color: #bbbbbb;
|
|
145
|
+
color: #fff;
|
|
146
|
+
}
|
|
134
147
|
</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, promptContent, middle, cancelShow, inputArr }) => {
|
|
11
|
+
const Confirm = ({ type, url ,title,radioArr, promptContent, middle, cancelShow, inputArr }) => {
|
|
12
12
|
// 返回 Promise 对象
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
14
|
// 2. 点击确认按钮,触发resolve同时销毁组件
|
|
@@ -23,6 +23,13 @@ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
if(type === 'radio') {
|
|
27
|
+
for(let i=0; i< radioArr.length; i++) {
|
|
28
|
+
if(radioArr[i].checked) {
|
|
29
|
+
val.push(radioArr[i].value)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
26
33
|
render(null, container)
|
|
27
34
|
resolve(val)
|
|
28
35
|
}
|
|
@@ -32,7 +39,7 @@ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr
|
|
|
32
39
|
reject('点击取消')
|
|
33
40
|
}
|
|
34
41
|
// 1. 创建 XtxConfirm 组件
|
|
35
|
-
const VNode = createVNode(XtxConfirm, { type, url ,title, promptContent, middle, cancelShow, inputArr, submit, cancel })
|
|
42
|
+
const VNode = createVNode(XtxConfirm, { type, url ,title, promptContent,radioArr, middle, cancelShow, inputArr, submit, cancel })
|
|
36
43
|
render(VNode, container)
|
|
37
44
|
})
|
|
38
45
|
}
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
<div class="tip-img" v-if="type === 'img'">
|
|
13
13
|
<img :src="url"/>
|
|
14
14
|
</div>
|
|
15
|
+
<div v-if="type === 'radio'">
|
|
16
|
+
<div class="radio-list" v-for="(item,index) in radioArr" :key="index">
|
|
17
|
+
<label>
|
|
18
|
+
<input type="radio" name="radio" :value="item.value" :checked="item.checked" @change="radioTao(index)" />
|
|
19
|
+
<span>{{ item.label }}</span>
|
|
20
|
+
</label>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
15
23
|
<div class="tip-img" v-if="type === 'input'">
|
|
16
24
|
<div class="tip-input" v-for="(item,index) in inputArr" :key="index">
|
|
17
25
|
<span v-if="item.name">{{ item.name }}</span>
|
|
@@ -85,6 +93,10 @@ export default {
|
|
|
85
93
|
type: Array,
|
|
86
94
|
default: []
|
|
87
95
|
},
|
|
96
|
+
radioArr: { // 单选数据
|
|
97
|
+
type: Array,
|
|
98
|
+
default: []
|
|
99
|
+
},
|
|
88
100
|
// 确认按钮
|
|
89
101
|
submit: {
|
|
90
102
|
type: Function,
|
|
@@ -98,6 +110,12 @@ export default {
|
|
|
98
110
|
}
|
|
99
111
|
},
|
|
100
112
|
methods: {
|
|
113
|
+
radioTao(index){
|
|
114
|
+
this.radioArr.forEach(item => {
|
|
115
|
+
item.checked = false
|
|
116
|
+
})
|
|
117
|
+
this.radioArr[index].checked = true
|
|
118
|
+
},
|
|
101
119
|
focus() {
|
|
102
120
|
this.tip = true
|
|
103
121
|
},
|
|
@@ -99,7 +99,6 @@ font-size: 12px;
|
|
|
99
99
|
display: inline-block;
|
|
100
100
|
line-height: 30px;
|
|
101
101
|
padding-right: 10px;
|
|
102
|
-
min-width: 80px;
|
|
103
102
|
text-align: right;
|
|
104
103
|
}
|
|
105
104
|
.tip-input input{
|
|
@@ -151,4 +150,21 @@ font-size: 12px;
|
|
|
151
150
|
line-height: 30px;
|
|
152
151
|
border: 0;
|
|
153
152
|
border-left: 1px solid #ccc;
|
|
153
|
+
}
|
|
154
|
+
.radio-list{
|
|
155
|
+
padding: 10px 20px;
|
|
156
|
+
text-align: left;
|
|
157
|
+
font-size: 16px;
|
|
158
|
+
position: relative;
|
|
159
|
+
}
|
|
160
|
+
.radio-list span{
|
|
161
|
+
padding-left: 22px;
|
|
162
|
+
}
|
|
163
|
+
.radio-list input{
|
|
164
|
+
width: 16px;
|
|
165
|
+
height: 16px;
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: 12px;
|
|
168
|
+
left: 20px;
|
|
169
|
+
z-index: 1;
|
|
154
170
|
}
|