✨ 图片设置权限功能
This commit is contained in:
11
resources/js/bootstrap.js
vendored
11
resources/js/bootstrap.js
vendored
@@ -2,15 +2,12 @@ window._ = require('lodash');
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
window.toastr = require('toastr');
|
||||
window.Swal = require('sweetalert2')
|
||||
window.Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
window.Swal = window.Swal.mixin({
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"debug": false,
|
||||
|
||||
@@ -615,7 +615,42 @@
|
||||
},
|
||||
visibility: {
|
||||
text: '设置可见性',
|
||||
action: e => {},
|
||||
action: e => {
|
||||
Swal.fire({
|
||||
title: '选择一个权限',
|
||||
text: '选择公开将会出现在画廊中(若平台开启了画廊)',
|
||||
input: 'select',
|
||||
inputOptions: {
|
||||
public: '公开',
|
||||
private: '私有',
|
||||
},
|
||||
confirmButtonText: '确认设置',
|
||||
inputPlaceholder: '请选择一个权限',
|
||||
showCancelButton: true,
|
||||
inputValidator: (value) => {
|
||||
return new Promise((resolve) => {
|
||||
if (value === '') {
|
||||
resolve('请选择正确的权限')
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
}
|
||||
}).then(result => {
|
||||
let selected = ds.getSelection().map(item => $(item).data('id'));
|
||||
axios.put('{{ route('user.images.permission') }}', {
|
||||
ids: selected,
|
||||
permission: result.value,
|
||||
}).then(response => {
|
||||
if (response.data.status) {
|
||||
ds.clearSelection();
|
||||
toastr.success(response.data.message);
|
||||
} else {
|
||||
toastr.warning(response.data.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
// 点击容器
|
||||
|
||||
Reference in New Issue
Block a user