This commit is contained in:
pushuo 2022-07-12 20:15:24 +08:00
parent c30810ae49
commit ecb09c87cb
5 changed files with 36 additions and 11 deletions

View File

@ -2065,6 +2065,17 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _js_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../js/http */ "./resources/js/http.js"); /* harmony import */ var _js_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../js/http */ "./resources/js/http.js");
window.$http = _js_http__WEBPACK_IMPORTED_MODULE_0__["default"]; window.$http = _js_http__WEBPACK_IMPORTED_MODULE_0__["default"];
function randomString(length) {
var str = '';
for (; str.length < length; str += Math.random().toString(36).substr(2)) {
;
}
return str.substr(0, length);
}
$(document).ready(function ($) { $(document).ready(function ($) {
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {

View File

@ -1,6 +1,12 @@
import http from "../../../js/http"; import http from "../../../js/http";
window.$http = http; window.$http = http;
function randomString(length) {
let str = '';
for (; str.length < length; str += Math.random().toString(36).substr(2));
return str.substr(0, length);
}
$(document).ready(function ($) { $(document).ready(function ($) {
$.ajaxSetup({ $.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},

View File

@ -58,6 +58,9 @@
@endforeach @endforeach
<script> <script>
var $language = @json($languages);
var $language_id = {{ current_language_id() }};
let app = new Vue({ let app = new Vue({
el: '#app', el: '#app',
data: { data: {

View File

@ -33,7 +33,7 @@
</div> </div>
<div :class="'pb-images-list ' + (item.show ? 'active' : '')"> <div :class="'pb-images-list ' + (item.show ? 'active' : '')">
<div class="pb-images-top"> <div class="pb-images-top">
{{-- <pb-image-selector v-model="item.image"></pb-image-selector> --}} <pb-image-selector v-model="item.image"></pb-image-selector>
<div class="tag">建议尺寸 1920 x 600</div> <div class="tag">建议尺寸 1920 x 600</div>
</div> </div>
{{-- <link-selector v-model="item.link"></link-selector> --}} {{-- <link-selector v-model="item.link"></link-selector> --}}

View File

@ -51,9 +51,9 @@
<div class="filemanager-content" v-loading="loading" element-loading-background="rgba(255, 255, 255, 0.5)"> <div class="filemanager-content" v-loading="loading" element-loading-background="rgba(255, 255, 255, 0.5)">
<div class="content-head"> <div class="content-head">
<div class="left"> <div class="left">
<el-link :underline="false" :disabled="editingFileIndex === null" icon="el-icon-download">下载</el-link> <el-link :underline="false" :disabled="editingImageIndex === null" icon="el-icon-download">下载</el-link>
<el-link :underline="false" :disabled="editingFileIndex === null" @click="deleteFile" icon="el-icon-delete">删除</el-link> <el-link :underline="false" :disabled="editingImageIndex === null" @click="deleteFile" icon="el-icon-delete">删除</el-link>
<el-link :underline="false" :disabled="editingFileIndex === null" @click="openInputBox('image')" icon="el-icon-edit">重命名</el-link> <el-link :underline="false" :disabled="editingImageIndex === null" @click="openInputBox('image')" icon="el-icon-edit">重命名</el-link>
</div> </div>
<div class="right"><el-button size="mini" type="primary">上传文件</el-button></div> <div class="right"><el-button size="mini" type="primary">上传文件</el-button></div>
</div> </div>
@ -76,7 +76,7 @@
:total="image_total"> :total="image_total">
</el-pagination> </el-pagination>
</div> </div>
<div class="right"><el-button size="mini" type="primary" @click="fileChecked" :disabled="editingFileIndex === null">选择</el-button></div> <div class="right"><el-button size="mini" type="primary" @click="fileChecked" :disabled="editingImageIndex === null">选择</el-button></div>
</div> </div>
</div> </div>
</div> </div>
@ -93,7 +93,7 @@
loading: false, loading: false,
editingFileIndex: null, editingImageIndex: null,
treeInit: [ treeInit: [
{ {
@ -205,20 +205,25 @@
}, },
checkedImage(index) { checkedImage(index) {
this.editingFileIndex = index; this.editingImageIndex = index;
this.images.map(e => !e.index ? e.selected = false : '') this.images.map(e => !e.index ? e.selected = false : '')
this.images[index].selected = !this.images[index].selected this.images[index].selected = !this.images[index].selected
}, },
fileChecked() { fileChecked() {
console.log(this.editingFileIndex) // console.log(this.editingImageIndex)
console.log(this.images[this.editingImageIndex])
// 关闭弹窗
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}, },
deleteFile() { deleteFile() {
this.$confirm('是否要删除选中文件', '提示', { this.$confirm('是否要删除选中文件', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.images.splice(this.editingFileIndex, 1); this.images.splice(this.editingImageIndex, 1);
this.$message({type: 'success',message: '删除成功!'}); this.$message({type: 'success',message: '删除成功!'});
}).catch(_=>{}); }).catch(_=>{});
}, },
@ -235,7 +240,7 @@
openInputBox(type, data) { openInputBox(type, data) {
// console.log(data) // console.log(data)
// console.log(this.editingFileIndex) // console.log(this.editingImageIndex)
this.$prompt('', type=='addFolder' ? '新建文件夹' : '重命名', { this.$prompt('', type=='addFolder' ? '新建文件夹' : '重命名', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -266,7 +271,7 @@
$(document).ready(function() { $(document).ready(function() {
$(document).on('click', function (e) { $(document).on('click', function (e) {
if ($(e.target).closest('.content-center .image-list, .content-head, .content-footer').length === 0) { if ($(e.target).closest('.content-center .image-list, .content-head, .content-footer').length === 0) {
app.editingFileIndex = null; app.editingImageIndex = null;
app.images.map(e => e.selected = false) app.images.map(e => e.selected = false)
} }
}) })