zydx-plus 1.11.43 → 1.11.45
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
|
@@ -37,9 +37,9 @@ export default defineComponent({
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
},
|
|
40
|
-
onInputChange({ event, accept =
|
|
40
|
+
onInputChange({ event, accept = [], file_size = 2, cb, disabled }) {
|
|
41
|
+
if (disabled) return
|
|
41
42
|
let file = event.target.files[0]
|
|
42
|
-
let accept_list = accept.split(',')
|
|
43
43
|
if (file.size > file_size * 1024 * 1024) {
|
|
44
44
|
this.$messages({
|
|
45
45
|
title: '提示',
|
|
@@ -48,10 +48,10 @@ export default defineComponent({
|
|
|
48
48
|
})
|
|
49
49
|
return
|
|
50
50
|
}
|
|
51
|
-
if (!
|
|
51
|
+
if (accept.length && !accept.includes(file.type)) {
|
|
52
52
|
this.$messages({
|
|
53
53
|
title: '提示',
|
|
54
|
-
promptContent: `请选择${
|
|
54
|
+
promptContent: `请选择${accept.join('、')}格式的文件`,
|
|
55
55
|
cancelShow: false,
|
|
56
56
|
})
|
|
57
57
|
return
|
|
@@ -83,9 +83,11 @@ export default defineComponent({
|
|
|
83
83
|
{this.active_state[idx] ? active_name : name}
|
|
84
84
|
</button>
|
|
85
85
|
case 'file':
|
|
86
|
-
return <label class=
|
|
86
|
+
return <label class={disabled ? 'z-button disabled' : 'z-button'} >
|
|
87
87
|
<span>{name}</span>
|
|
88
|
-
|
|
88
|
+
{
|
|
89
|
+
disabled ? null : <input type="file" class="hidden" onClick={(e) => e.target.value = null} onChange={(e) => onInputChange({ event: e, accept, file_size, cb: onClick, disabled })}></input>
|
|
90
|
+
}
|
|
89
91
|
</label>
|
|
90
92
|
case 'search':
|
|
91
93
|
return is_show_search
|
|
@@ -157,6 +159,12 @@ export default defineComponent({
|
|
|
157
159
|
box-sizing: border-box;
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
.z-button.disabled {
|
|
163
|
+
background-color: #ffffff;
|
|
164
|
+
color: #717171;
|
|
165
|
+
border: #717171 1px solid;
|
|
166
|
+
}
|
|
167
|
+
|
|
160
168
|
.search_container {
|
|
161
169
|
width: 180px;
|
|
162
170
|
height: 20px;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
<div class="tip-img" v-if="type === 'input'">
|
|
16
16
|
<div class="tip-input" v-for="(item,index) in inputArr" :key="index">
|
|
17
|
-
<span>{{ item.name }}</span>
|
|
17
|
+
<span v-if="item.name">{{ item.name }}</span>
|
|
18
18
|
<input v-if="item.type === 'input'" type="text" :placeholder="item.placeholder"
|
|
19
19
|
v-model="item.value" :disabled="item.disabled"/>
|
|
20
20
|
<div style="display: inline-block;">
|