vue2-client 1.2.58 → 1.2.59
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
|
@@ -234,18 +234,10 @@
|
|
|
234
234
|
</a-form-model-item>
|
|
235
235
|
</a-col>
|
|
236
236
|
<a-col :span="8">
|
|
237
|
-
<a-form-model-item
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
<a-input v-model="item.accept" placeholder="指定文件类型,默认不限制,可选">
|
|
242
|
-
<a-popover slot="suffix" title="关于允许上传文件类型" placement="bottom">
|
|
243
|
-
<template slot="content">
|
|
244
|
-
<p>指定允许上传的文件类型扩展名,如:.doc,.docx等,详情请参考<a target="_blank" @click="visitAcceptFile">允许上传文件类型</a></p>
|
|
245
|
-
</template>
|
|
246
|
-
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
247
|
-
</a-popover>
|
|
248
|
-
</a-input>
|
|
237
|
+
<a-form-model-item v-if="item.formType === 'file'" label="允许上传文件类型" prop="accept">
|
|
238
|
+
<a-select v-model="item.accept" mode="tags" placeholder="指定文件类型,默认不限制" @change="itemAcceptChange">
|
|
239
|
+
<a-select-option v-for="type_item in fileType" :key="type_item.accept">{{ type_item.label }}</a-select-option>
|
|
240
|
+
</a-select>
|
|
249
241
|
</a-form-model-item>
|
|
250
242
|
</a-col>
|
|
251
243
|
<!-- TODO 配置文件上传表单-所属模块 -->
|
|
@@ -409,10 +401,10 @@
|
|
|
409
401
|
</template>
|
|
410
402
|
|
|
411
403
|
<script>
|
|
404
|
+
import { fileType } from '@vue2-client/config/CreateQueryConfig'
|
|
412
405
|
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
|
413
406
|
import JsonViewer from 'vue-json-viewer'
|
|
414
407
|
import FileSaver from 'file-saver'
|
|
415
|
-
import { queryType } from '@vue2-client/config/CreateQueryConfig'
|
|
416
408
|
import { mapState } from 'vuex'
|
|
417
409
|
import { commonApi, post } from '@vue2-client/services/api'
|
|
418
410
|
const DemoJson = [{ value: 'zhejiang', label: 'Zhejiang', children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }] }]
|
|
@@ -424,6 +416,7 @@ export default {
|
|
|
424
416
|
},
|
|
425
417
|
data () {
|
|
426
418
|
return {
|
|
419
|
+
fileType,
|
|
427
420
|
DemoJson,
|
|
428
421
|
// 页面宽度
|
|
429
422
|
screenWidth: document.documentElement.clientWidth,
|
|
@@ -782,6 +775,12 @@ export default {
|
|
|
782
775
|
item.slotKeyMap = item.selectKey
|
|
783
776
|
}
|
|
784
777
|
},
|
|
778
|
+
// 文件上传限制类型修改
|
|
779
|
+
itemAcceptChange (newVal) {
|
|
780
|
+
if (newVal.includes('*')) {
|
|
781
|
+
this.item.accept = ['*']
|
|
782
|
+
}
|
|
783
|
+
},
|
|
785
784
|
visitAcceptFile () {
|
|
786
785
|
window.open('https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/file#attr-accept')
|
|
787
786
|
},
|