修改添加文件夹input

This commit is contained in:
jmal 2020-02-14 18:00:10 +08:00
parent 439dc48216
commit 36b9ea7790

View File

@ -26,10 +26,10 @@
<svg-icon icon-class="folder-upload" /><span class="menuitem text">上传文件夹</span> <svg-icon icon-class="folder-upload" /><span class="menuitem text">上传文件夹</span>
</label> </label>
</li> </li>
<li> <li @click.prevent="newFolder">
<a href="#" class="menuitem" @click.prevent="newFolder"><svg-icon icon-class="folder-add" /><span class="menuitem text">新建文件夹</span> <a href="#" class="menuitem"><svg-icon icon-class="folder-add" /><span class="menuitem text">新建文件夹</span>
<form v-show="showNewFolder" class="folder-name-form"> <div v-show="showNewFolder" class="folder-name-form">
<el-input v-model="newFolderName" placeholder="请输入内容"> <el-input v-model="newFolderName" placeholder="请输入文件夹名称" :clearable="true" @change="newFolderNameClick">
<el-button <el-button
slot="append" slot="append"
v-loading="newFolderLoading" v-loading="newFolderLoading"
@ -40,7 +40,7 @@
> >
</el-button> </el-button>
</el-input> </el-input>
</form> </div>
</a> </a>
</li> </li>
</ul> </ul>
@ -200,6 +200,7 @@
</template> </template>
<script> <script>
/* eslint-disable */
// import MenuPopover from '@/components/popover/MenuPopover' // import MenuPopover from '@/components/popover/MenuPopover'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
// import defaultSettings from '@/settings' // import defaultSettings from '@/settings'
@ -378,6 +379,7 @@ export default {
}, },
// 新建文件夹 // 新建文件夹
newFolderNameClick() { newFolderNameClick() {
console.log(68790)
this.newFolderLoading = true this.newFolderLoading = true
api.uploadFolder({ api.uploadFolder({
isFolder: true, isFolder: true,
@ -396,7 +398,7 @@ export default {
type: 'success', type: 'success',
duration: 1000 duration: 1000
}) })
}).catch(e => {}) })
}, },
getFileList() { getFileList() {
this.tableLoading = true this.tableLoading = true
@ -507,11 +509,13 @@ export default {
// this.$set(this.tableHead, 2, item_name) // this.$set(this.tableHead, 2, item_name)
// this.$set(this.tableHead, 2, item_more) // this.$set(this.tableHead, 2, item_more)
// this.$set(this.tableHead, 5, item_size) // this.$set(this.tableHead, 5, item_size)
console.log('selectRowData', this.selectRowData)
console.log('rowContextData', this.rowContextData)
}, },
// cell-style通过返回值可以实现样式变换利用传递过来的数组index循环改变样式 // cell-style通过返回值可以实现样式变换利用传递过来的数组index循环改变样式
rowRed({ row, column, rowIndex, columnIndex }) { rowRed({ row, column, rowIndex, columnIndex }) {
if (this.indexList.length < 1 && columnIndex === 2 && this.cellMouseIndex === rowIndex) { if (this.indexList.length < 1 && columnIndex === 2 && this.cellMouseIndex === rowIndex) {
return { cursor: 'pointer', color: '#19acff' } return { cursor: 'pointer', color: "#19ACF9" }
} }
for (let i = 0; i < this.indexList.length; i++) { for (let i = 0; i < this.indexList.length; i++) {
if (rowIndex === this.indexList[i]) { if (rowIndex === this.indexList[i]) {
@ -694,7 +698,7 @@ export default {
break break
case 'open': case 'open':
console.log('open', '打开') console.log('open', '打开')
this.fileClick(this.selectRowData[0]) this.fileClick(this.rowContextData)
break break
case 'deselect': case 'deselect':
console.log('deselect', '取消选定') console.log('deselect', '取消选定')
@ -713,15 +717,16 @@ export default {
break break
case 'rename': case 'rename':
console.log('重命名') console.log('重命名')
if (!this.rowContextData.isFolder) { this.editingIndex = this.rowContextData.index
this.editingIndex = this.rowContextData.index // if (!this.rowContextData.isFolder) {
} else { // this.editingIndex = this.rowContextData.index
this.$notify({ // } else {
title: '暂不支持文件夹重命名', // this.$notify({
type: 'warning', // title: '暂不支持文件夹重命名',
duration: 2000 // type: 'warning',
}) // duration: 2000
} // })
// }
break break
case 'copy': case 'copy':
console.log('移动或复制') console.log('移动或复制')
@ -734,7 +739,7 @@ export default {
fileIds.push(value.id) fileIds.push(value.id)
}) })
} else { } else {
fileIds.push(this.selectRowData[0].id) fileIds.push(this.rowContextData.id)
} }
window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self') window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
break break
@ -801,10 +806,10 @@ export default {
console.log(row) console.log(row)
if (row.isFolder) { if (row.isFolder) {
// 打开文件 // 打开文件
this.path += '/' + row.name this.path += '/' + row.pathname
const item1 = {} const item1 = {}
item1['folder'] = row.name item1['folder'] = row.pathname
item1['index'] = this.pathList.length - 1 item1['index'] = this.pathList.length - 1
const item2 = {} const item2 = {}
@ -827,6 +832,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.dashboard { .dashboard {
&-container { &-container {
min-width:500px;
margin: 10px 10px 10px 15px; margin: 10px 10px 10px 15px;
} }
&-text { &-text {
@ -878,15 +884,17 @@ export default {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 16px; font-size: 16px;
min-width: 136px;
} }
.newFileMenu li:hover { .newFileMenu li:hover {
cursor: pointer; cursor: pointer;
border-radius: 5px; border-radius: 5px;
background-color: #409eff14; /*background-color: #409eff14;*/
background-color: #409eff30;
} }
.newFileMenu li > .menuitem { .newFileMenu li > .menuitem {
cursor: pointer; cursor: pointer;
line-height: 44px; line-height: 38px;
margin-left: 10%; margin-left: 10%;
} }
.newFileMenu li > .menuitem > .text { .newFileMenu li > .menuitem > .text {
@ -899,7 +907,7 @@ export default {
} }
.menuitem /deep/ .el-loading-spinner { .menuitem /deep/ .el-loading-spinner {
top: 0; top: 0;
margin-top: 0; margin-top: 0.75rem;
width: 100%; width: 100%;
text-align: center; text-align: center;
position: absolute; position: absolute;
@ -949,9 +957,6 @@ export default {
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
} }
>>>.el-popover {
padding: 5px;
}
/deep/ .ctx-menu-container { /deep/ .ctx-menu-container {
border: 0 solid rgba(0, 0, 0, 0); border: 0 solid rgba(0, 0, 0, 0);