添加查看目录命令

jcbranch
fanluyan 9 months ago
parent b27f2d11ae
commit bd6bebccd1

@ -1230,6 +1230,40 @@
<!-- 修改配置文件 -->
<config ref="configRef" :multipleSelection="multipleSelection"></config>
<!-- 列出目录下文件名 -->
<el-dialog
title="列出目录下文件名"
:visible.sync="fileContentVisible"
:close-on-click-modal="false"
width="504px"
class="fileContentDialog"
>
<el-form
:model="fileContentForm"
ref="fileContentFormref"
:rules="fileContentRules"
>
<el-form-item label="目录路径:" prop="fileContent">
<el-input v-model="fileContentForm.fileContent"></el-input>
</el-form-item>
<el-form-item label="包含的字符串:" prop="filtername">
<el-input v-model="fileContentForm.filtername"></el-input>
</el-form-item>
<ul>
<li
v-for="(item, index) in filepathOption"
@click="handleFliePath(item)"
>
{{ item.desc }}{{ item.name }}
</li>
</ul>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="fileContentDialog = false"> </el-button>
<el-button type="primary" @click="handleFileDelete"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -1712,6 +1746,52 @@ export default {
3: "公田m2m10086",
4: "安徽",
},
//
fileContentVisible: false,
fileContentForm: {
fileContent: "",
filtername: "",
},
fileContentRules: {
fileContent: [
{
required: true,
message: "请输入文件路径",
trigger: "blur",
},
],
},
filepathOption: [
{
name: "/sdcard/com.xypower.mpapp/data/",
desc: "MpAPP配置目录",
},
{
name: "/sdcard/com.xypower.mpapp/photos/",
desc: "MpAPP照片目录",
},
{
name: "/sdcard/com.xypower.mpapp/sentPhotos/",
desc: "MpAPP已发送照片目录",
},
{
name: "/sdcard/com.xypower.mpapp/logs/",
desc: "MpAPP日志目录",
},
{
name: "/sdcard/com.xypower.mpmaster/data/",
desc: "运维配置目录",
},
{
name: "/sdcard/com.xypower.mpmaster/logs/",
desc: "运维日志目录",
},
{
name: "/data/system/dropbox/",
desc: "系统日志目录",
},
],
};
},
mounted() {
@ -2285,6 +2365,10 @@ export default {
this.$refs.configRef.display();
// this.getconfigList();
return;
case 16:
console.log("查看目录文件");
this.fileContentVisible = true;
return;
}
},
//
@ -2548,6 +2632,26 @@ export default {
}
});
},
//
handleFileDelete() {
console.log(this.$refs.fileContentFormref);
this.$refs.fileContentFormref.validate((valid) => {
if (valid) {
var params = {
action: "list_files",
path: this.fileContentForm.fileContent,
filter: this.fileContentForm.filtername,
termIds: this.idArray,
};
console.log(params);
this.changeIssue(params);
this.fileContentVisible = false;
}
});
},
handleFliePath(row) {
this.fileContentForm.fileContent = row.name;
},
//
handlepullPath(item) {
console.log(item);
@ -3241,6 +3345,22 @@ export default {
}
}
}
.fileContentDialog {
.el-dialog__body {
height: auto;
ul {
li {
list-style: none;
font-size: 13px;
line-height: 22px;
cursor: pointer;
&:hover {
background-color: #b9e2dd;
}
}
}
}
}
.configDialogBox {
ul {
margin-bottom: 12px;

@ -150,6 +150,43 @@
>apk版本{{ item.cmdMap.fileName }}</b
>
<b v-else>cmd{{ item.cmdMap }}</b>
<el-popover
placement="left"
title="目录"
width="400"
trigger="click"
>
<el-table :data="JSON.parse(item.content)">
<el-table-column
property="n"
label="名称"
></el-table-column>
<el-table-column property="s" label="大小(字节)">
<template slot-scope="scope">
<span
style="
display: inline-block;
width: 60px;
text-align: right;
"
>{{ scope.row.s }}</span
>
</template></el-table-column
>
<el-table-column property="m" label="时间">
<template slot-scope="scope">
{{ $moment(scope.row.m).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
</el-table>
<el-button
type="parimary"
size="mini"
v-if="item.content !== null"
slot="reference"
>查看目录</el-button
>
</el-popover>
</span>
</p>
</div>
@ -217,6 +254,7 @@ export default {
push_file: "推送文件",
dl_file: "推送大文件",
upd_cfg: "修改配置文件",
list_files: "列出目录下的文件名",
},
cmdtimer: null,
endtimer: null,

Loading…
Cancel
Save