mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update admin.js
This commit is contained in:
parent
08c885a47d
commit
59dba244d1
@ -838,10 +838,20 @@ $(function () {
|
|||||||
this.id = this.dataset.id = this.id || (function (date) {
|
this.id = this.dataset.id = this.id || (function (date) {
|
||||||
return (date + Math.random()).replace('0.', '');
|
return (date + Math.random()).replace('0.', '');
|
||||||
})(layui.util.toDateString(Date.now(), 'yyyyMMddHHmmss-'));
|
})(layui.util.toDateString(Date.now(), 'yyyyMMddHHmmss-'));
|
||||||
// 上传图片,支持单图或多图选择,分别是 images|images
|
// 上传图片,支持单图或多图选择,分别是 image|images
|
||||||
if (typeof this.dataset.file === 'string' && /^images?$/.test(this.dataset.file)) {
|
if (typeof this.dataset.file === 'string' && /^images?$/.test(this.dataset.file)) {
|
||||||
$.form.modal(tapiRoot + '/api.upload/image', this.dataset, '图片管理器')
|
return $.form.modal(tapiRoot + '/api.upload/image', this.dataset, '图片选择器')
|
||||||
} else if ($(this).data('inited') !== true) (function (that) {
|
}
|
||||||
|
// 上传视频,支持单视频或多视频选择,分别是 video|videos
|
||||||
|
if (typeof this.dataset.file === 'string' && /^videos?$/.test(this.dataset.file)) {
|
||||||
|
return $.form.modal(tapiRoot + '/api.upload/video', this.dataset, '视频选择器')
|
||||||
|
}
|
||||||
|
// 上传文档,支持单视频或多视频选择,分别是 document|documents
|
||||||
|
if (typeof this.dataset.file === 'string' && /^videos?$/.test(this.dataset.file)) {
|
||||||
|
return $.form.modal(tapiRoot + '/api.upload/document', this.dataset, '文档选择器')
|
||||||
|
}
|
||||||
|
// 其他文件上传
|
||||||
|
if ($(this).data('inited') !== true) (function (that) {
|
||||||
that.uploadFile(undefined, function () {
|
that.uploadFile(undefined, function () {
|
||||||
that.trigger('upload.start');
|
that.trigger('upload.start');
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user