优化拉取文件并且去重

jcbranch
fanluyan 11 months ago
parent fe4a57e796
commit b731461e46

@ -1005,11 +1005,11 @@
<el-form-item label="文件路径:" prop="pullFile"> <el-form-item label="文件路径:" prop="pullFile">
<el-input <el-input
type="textarea" type="textarea"
:autosize="{ minRows: 2, maxRows: 8 }" :autosize="{ minRows: 2, maxRows: 6 }"
v-model="pullFileForm.pullFile" v-model="pullFileForm.pullFile"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-checkbox-group <!-- <el-checkbox-group
v-model="checkedName" v-model="checkedName"
@change="handleCheckedCitiesChange" @change="handleCheckedCitiesChange"
> >
@ -1019,10 +1019,16 @@
:key="item.name" :key="item.name"
>{{ item.desc }}{{ item.name }}</el-checkbox >{{ item.desc }}{{ item.name }}</el-checkbox
> >
</el-checkbox-group> </el-checkbox-group> -->
<!-- <ul> <ul>
<li @click="handlepullPath(item)">{{ item.desc }}{{ item.name }}</li> <li
</ul> --> @click="handlepullPath(item)"
v-for="(item, index) in pullpathOption"
:key="item.name"
>
{{ item.desc }}{{ item.name }}
</li>
</ul>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="pullFileVisible = false"> </el-button> <el-button @click="pullFileVisible = false"> </el-button>
@ -1527,6 +1533,10 @@ export default {
name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat", name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat",
desc: "AI识别文件", desc: "AI识别文件",
}, },
{
name: "/sdcard/com.xypower.mpmaster/data/Master.json",
desc: "运维配置文件",
},
], ],
pullpathOption: [ pullpathOption: [
{ {
@ -1577,6 +1587,10 @@ export default {
name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat", name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat",
desc: "AI识别文件", desc: "AI识别文件",
}, },
{
name: "/sdcard/com.xypower.mpmaster/data/Master.json",
desc: "运维配置文件",
},
], ],
checkedName: [], checkedName: [],
//base64 //base64
@ -2381,31 +2395,29 @@ export default {
}); });
}, },
// //
handleCheckedCitiesChange(value) { handlepullPath(item) {
// 便 console.log(item);
this.pullFileForm.pullFile = value this.pullFileForm.pullFile += item.name + "\n";
.map((name) => name + "\n") // console.log(this.pullFileForm.pullFile);
.join(""); //
//
if (this.pullFileForm.pullFile.endsWith("\n")) {
this.pullFileForm.pullFile = this.pullFileForm.pullFile.slice(0, -1);
}
}, },
handlePull() { handlePull() {
console.log(this.$refs.pullFileFormref); console.log(this.$refs.pullFileFormref);
//
let uniquePaths = [
...new Set(
this.pullFileForm.pullFile.split(/\r\n|\n|\r/).filter(Boolean)
),
];
this.$refs.pullFileFormref.validate((valid) => { this.$refs.pullFileFormref.validate((valid) => {
if (valid) { if (valid) {
var params = { var params = {
action: "pull_files", action: "pull_files",
paths: this.pullFileForm.pullFile paths: uniquePaths,
.split(/\r\n|\n|\r/)
.filter(Boolean),
termIds: this.idArray, termIds: this.idArray,
}; };
console.log(params); console.log(params);
this.changeIssue(params); // this.changeIssue(params);
this.pullFileVisible = false; //this.pullFileVisible = false;
} }
}); });
}, },
@ -3041,6 +3053,22 @@ export default {
} }
} }
} }
.pullBoxDialog {
.el-dialog__body {
padding: 12px 12px;
}
ul {
li {
list-style: none;
font-size: 13px;
line-height: 22px;
cursor: pointer;
&:hover {
background-color: #b9e2dd;
}
}
}
}
.deleteDialog { .deleteDialog {
.el-dialog__body { .el-dialog__body {
height: auto; height: auto;

Loading…
Cancel
Save