commit
9e7bf6dda5
@ -162,13 +162,13 @@
|
|||||||
placeholder="搜索"
|
placeholder="搜索"
|
||||||
v-model="searchFileName"
|
v-model="searchFileName"
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
@keyup.enter.native="searchFile(searchFileName)"
|
@keyup.enter.native="searchFileEnter(searchFileName)"
|
||||||
@focus="setInputFocus"
|
@focus="setInputFocus"
|
||||||
@input="searchFile(searchFileName)"
|
@input="searchFileEnter(searchFileName)"
|
||||||
@blur="setInputBlur()"
|
@blur="setInputBlur()"
|
||||||
@clear="searchFile(searchFileName)"
|
@clear="searchFileEnter(searchFileName)"
|
||||||
>
|
>
|
||||||
<el-button slot="prepend" @click="searchFile(searchFileName)">
|
<el-button slot="prepend" @click="searchFileEnter(searchFileName)">
|
||||||
<svg-icon icon-class="search" style="font-size: 22px" />
|
<svg-icon icon-class="search" style="font-size: 22px" />
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -809,6 +809,8 @@ import FileTree from '@/components/FileTree'
|
|||||||
|
|
||||||
import '@/utils/directives.js'
|
import '@/utils/directives.js'
|
||||||
|
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
import fileConfig from '@/utils/file-config'
|
import fileConfig from '@/utils/file-config'
|
||||||
import EditElement from '@/views/markdown/EditElement'
|
import EditElement from '@/views/markdown/EditElement'
|
||||||
import IframePreview from '@/components/preview/IframePreview.vue'
|
import IframePreview from '@/components/preview/IframePreview.vue'
|
||||||
@ -1088,6 +1090,7 @@ export default {
|
|||||||
permanentDeleteDisable: false, // 是否禁用永久删除选项
|
permanentDeleteDisable: false, // 是否禁用永久删除选项
|
||||||
selectDeleteFile: [], // 选中的删除文件
|
selectDeleteFile: [], // 选中的删除文件
|
||||||
deleteLoading: false, // 删除loading
|
deleteLoading: false, // 删除loading
|
||||||
|
debounceSearch: null,// 搜索防抖
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -1155,7 +1158,11 @@ export default {
|
|||||||
: ''
|
: ''
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {},
|
created() {
|
||||||
|
this.debounceSearch = _.debounce((key, onLoad) => {
|
||||||
|
this.searchFile(key, onLoad)
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to) {
|
$route(to) {
|
||||||
if (to.query.tagId && this.queryCondition.tagId !== this.$route.query.tagId) {
|
if (to.query.tagId && this.queryCondition.tagId !== this.$route.query.tagId) {
|
||||||
@ -2696,6 +2703,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
searchFileEnter(key, onLoad) {
|
||||||
|
this.debounceSearch(key, onLoad)
|
||||||
|
},
|
||||||
searchFile(key, onLoad) {
|
searchFile(key, onLoad) {
|
||||||
if (key) {
|
if (key) {
|
||||||
this.beforeLoadData(onLoad)
|
this.beforeLoadData(onLoad)
|
||||||
|
|||||||
@ -17,7 +17,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-form class="details-form">
|
<el-form class="details-form">
|
||||||
<el-form-item label="重建索引:" class="details-scan">
|
<el-form-item label="重建索引:" class="details-scan">
|
||||||
<el-button type="primary" size="mini" :loading="syncLoading" @click="scanDirectory(rowContextData)" ><i class="el-icon-refresh"></i></el-button>
|
<el-popover
|
||||||
|
placement="bottom"
|
||||||
|
trigger="click">
|
||||||
|
<p class="el-popconfirm__main">
|
||||||
|
<i class="el-popconfirm__icon el-icon-question" style="color: rgb(255, 153, 0);"></i>
|
||||||
|
是否开始扫描?
|
||||||
|
</p>
|
||||||
|
<div style="text-align: right; margin: 0">
|
||||||
|
<el-button size="mini" type="text" @click="cancelScan()">取消</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="scanDirectory(rowContextData)">确定</el-button>
|
||||||
|
</div>
|
||||||
|
<el-button slot="reference" id="scanDirectoryBtn-file" type="primary" size="small" :loading="syncLoading"><i class="el-icon-refresh"></i></el-button>
|
||||||
|
</el-popover>
|
||||||
<span v-show="syncPercent < 100">正在同步文件基本信息: {{ syncPercent }}%</span>
|
<span v-show="syncPercent < 100">正在同步文件基本信息: {{ syncPercent }}%</span>
|
||||||
<span v-show="indexingPercent > 0 && indexingPercent < 100">正在为文件内容创建索引: </span><span v-show="indexingPercent > 0 && indexingPercent < 100">{{ indexingPercent }}%</span>
|
<span v-show="indexingPercent > 0 && indexingPercent < 100">正在为文件内容创建索引: </span><span v-show="indexingPercent > 0 && indexingPercent < 100">{{ indexingPercent }}%</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -162,20 +174,18 @@ export default {
|
|||||||
}
|
}
|
||||||
this.syncLoading = !((this.syncPercent === 100 && this.indexingPercent === 100) || (this.syncPercent === 0 && this.indexingPercent === 0));
|
this.syncLoading = !((this.syncPercent === 100 && this.indexingPercent === 100) || (this.syncPercent === 0 && this.indexingPercent === 0));
|
||||||
},
|
},
|
||||||
|
cancelScan() {
|
||||||
|
document.getElementById('scanDirectoryBtn-file').click()
|
||||||
|
},
|
||||||
scanDirectory(file) {
|
scanDirectory(file) {
|
||||||
this.$confirm('是否开始扫描? ', '提示', {
|
this.cancelScan()
|
||||||
confirmButtonText: '确定',
|
this.syncLoading = true
|
||||||
cancelButtonText: '取消',
|
this.syncPercent = 0
|
||||||
type: 'warning'
|
this.clickSync = true
|
||||||
}).then(() => {
|
settingApi.syncUser({username: this.$store.state.user.name, path: decodeURIComponent(file.path + file.name)}).then(() => {
|
||||||
this.syncLoading = true
|
this.clickSync = false
|
||||||
this.syncPercent = 0
|
}).catch(() => {
|
||||||
this.clickSync = true
|
this.clickSync = false
|
||||||
settingApi.syncUser({username: this.$store.state.user.name, path: decodeURIComponent(file.path + file.name)}).then(() => {
|
|
||||||
this.clickSync = false
|
|
||||||
}).catch(() => {
|
|
||||||
this.clickSync = false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -216,6 +226,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
>>> .details-scan {
|
>>> .details-scan {
|
||||||
|
.el-form-item__label {
|
||||||
|
line-height: 32.5px;
|
||||||
|
}
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
.el-button--mini, .el-button--mini.is-round {
|
.el-button--mini, .el-button--mini.is-round {
|
||||||
padding: 5px 15px;
|
padding: 5px 15px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user