修改文件选择器

This commit is contained in:
Anyon 2022-07-12 11:40:15 +08:00
parent 24b17f900a
commit af69c61d11
5 changed files with 3569 additions and 8 deletions

View File

@ -153,9 +153,8 @@ class Upload extends Controller
SystemFile::mQuery()->layTable(function () { SystemFile::mQuery()->layTable(function () {
$this->title = '文件选择器'; $this->title = '文件选择器';
}, function (QueryHelper $query) { }, function (QueryHelper $query) {
$query->like('name,hash')->dateBetween('create_at');
$query->whereLike('mime', 'image/%')->order('id desc');
$query->where(['status' => 2, 'issafe' => 0, 'uuid' => AdminService::getUserId()]); $query->where(['status' => 2, 'issafe' => 0, 'uuid' => AdminService::getUserId()]);
$query->like('name,hash')->in('xext#type')->dateBetween('create_at')->order('id desc');
}); });
} }

View File

@ -13,11 +13,12 @@
<div class="uploadimage" :style="x.style"></div> <div class="uploadimage" :style="x.style"></div>
<p class="image-dialog-item-name layui-elip" v-text="x.name"></p> <p class="image-dialog-item-name layui-elip" v-text="x.name"></p>
<span class="image-dialog-item-size">{{formatSize(x.size)}}</span> <span class="image-dialog-item-size">{{formatSize(x.size)}}</span>
<span class="image-dialog-item-type">{{x.xext.toUpperCase()}}</span>
</div> </div>
</div> </div>
<div class="image-dialog-foot"> <div class="image-dialog-foot">
<div id="ImageDialogPage" class="image-dialog-page"></div> <div id="ImageDialogPage" class="image-dialog-page"></div>
<div id="ImageDialogButton" class="image-dialog-button" v-if="data.length>0" @click="confirm">{{ data.length }}</div> <div id="ImageDialogButton layui-hide" class="image-dialog-button" v-if="data.length>0" @click="confirm">{{ data.length }}</div>
</div> </div>
</div> </div>
@ -35,7 +36,9 @@
this.$btn = $('#{$get.id|default=""}'); this.$btn = $('#{$get.id|default=""}');
this.$ups = $('#ImageDialogUploadLayout [data-file]'); this.$ups = $('#ImageDialogUploadLayout [data-file]');
this.mult = "{$get.file|default='image'}" === 'images'; this.mult = "{$get.file|default='image'}" === 'images';
this.loadPage(); this.loadPage(), setTimeout(function () {
$('#ImageDialogButton').removeClass('layui-hide');
}, 1000);
}, },
methods: { methods: {
// 搜索刷新数据 // 搜索刷新数据
@ -101,6 +104,7 @@
// 加载页面数据 // 加载页面数据
loadPage: function () { loadPage: function () {
this.params = {page: this.page, limit: this.limit, output: 'layui.table', name: this.keys || ''}; this.params = {page: this.page, limit: this.limit, output: 'layui.table', name: this.keys || ''};
this.params.type = '{$get.type|default="png,jpg,jpeg"}';
$.form.load('{:url("image")}', this.params, 'get', function (ret) { $.form.load('{:url("image")}', this.params, 'get', function (ret) {
return app.setList(ret.data, ret.count), false; return app.setList(ret.data, ret.count), false;
}); });

View File

@ -988,9 +988,8 @@ input:not(.layui-hide,[type=hidden]) {
margin: 0; margin: 0;
} }
&-size { &-type, &-size {
top: 2px; top: 2px;
right: 1px;
color: #FFF; color: #FFF;
padding: 0 6px; padding: 0 6px;
position: absolute; position: absolute;
@ -1001,6 +1000,14 @@ input:not(.layui-hide,[type=hidden]) {
border-radius: 20px; border-radius: 20px;
} }
&-type {
left: 1px;
}
&-size {
right: 1px;
}
&-name { &-name {
left: 0; left: 0;
right: 0; right: 0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long