|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- 本地挂接 --> |
|
|
|
|
|
<el-dialog title="本地挂接" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="localHitchVisible" :before-close="handleCancel" @opened="opened"> |
|
|
|
|
|
|
|
|
<!-- 本地挂接 / 远程挂接 --> |
|
|
|
|
|
<el-dialog :title="connectionTitle" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="localHitchVisible" :before-close="handleCancel" @opened="opened"> |
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
|
|
<el-form-item label="重复验证方式" prop="checkRepeatType"> |
|
|
<el-form-item label="重复验证方式" prop="checkRepeatType"> |
|
|
<el-select v-model="form.checkRepeatType" placeholder="请选择" style="width: 400px;"> |
|
|
<el-select v-model="form.checkRepeatType" placeholder="请选择" style="width: 400px;"> |
|
@ -55,8 +55,8 @@ |
|
|
</div> |
|
|
</div> |
|
|
<el-input v-show="false" v-model="form.file" /> |
|
|
<el-input v-show="false" v-model="form.file" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-if="connectionType" label="挂接类型" prop="batchType"> |
|
|
|
|
|
<el-select v-model="form.batchType" placeholder="请选择" style="width: 400px;"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="connectionType" label="挂接类型" prop="protocol"> |
|
|
|
|
|
<el-select v-model="form.protocol" placeholder="请选择" style="width: 400px;" @change="changeProtocol"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in batchTypeOptions" |
|
|
v-for="item in batchTypeOptions" |
|
|
:key="item.value" |
|
|
:key="item.value" |
|
@ -66,7 +66,32 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-if="connectionType" label="文件路径" prop="filePath"> |
|
|
<el-form-item v-if="connectionType" label="文件路径" prop="filePath"> |
|
|
<el-input v-model="form.filePath" style="width: 400px;" /> |
|
|
|
|
|
|
|
|
<el-select v-model="form.filePath" placeholder="请选择" value-key="id" style="width: 400px;" @change="changeFilePath"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="(item,index) in filePathOptions" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
:value="item" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item |
|
|
|
|
|
v-if="connectionType" |
|
|
|
|
|
label="" |
|
|
|
|
|
prop="fileRemote" |
|
|
|
|
|
class="file_remote-style" |
|
|
|
|
|
:rules="form.filePath !== null ? rules.fileRemote : []" |
|
|
|
|
|
:required="form.filePath !== null" |
|
|
|
|
|
> |
|
|
|
|
|
<el-button v-if="form.filePath && fileRemoteLoading" type="primary" :loading="fileRemoteLoading" style="border: none; display: block; padding: 0 0 4px 0;">文件列表加载中</el-button> |
|
|
|
|
|
<el-radio-group v-model="form.fileRemote"> |
|
|
|
|
|
<el-radio |
|
|
|
|
|
v-for="item in fileRemoteOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
>{{ item.name }}</el-radio> |
|
|
|
|
|
</el-radio-group> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
@ -79,7 +104,8 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { crud } from '@crud/crud' |
|
|
import { crud } from '@crud/crud' |
|
|
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category' |
|
|
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category' |
|
|
import { batchMountUpload } from '@/utils/upload' |
|
|
|
|
|
|
|
|
import { FetchFindDetailsByProtocol, FetchFileByRemoteConnection } from '@/api/system/remoteConnection' |
|
|
|
|
|
import { batchMountUpload, remoteConnectiontUpload } from '@/utils/upload' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
export default { |
|
|
export default { |
|
|
name: 'LocalHitch', |
|
|
name: 'LocalHitch', |
|
@ -95,6 +121,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
connectionTitle: '本地挂接', |
|
|
localHitchVisible: false, |
|
|
localHitchVisible: false, |
|
|
hitchRemarkArray: [], |
|
|
hitchRemarkArray: [], |
|
|
connectionType: 0, |
|
|
connectionType: 0, |
|
@ -104,8 +131,9 @@ export default { |
|
|
matchingMode: 1, |
|
|
matchingMode: 1, |
|
|
fields: null, |
|
|
fields: null, |
|
|
file: null, |
|
|
file: null, |
|
|
batchType: null, |
|
|
|
|
|
filePath: null |
|
|
|
|
|
|
|
|
protocol: null, |
|
|
|
|
|
filePath: null, |
|
|
|
|
|
fileRemote: null |
|
|
}, |
|
|
}, |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
typeOptions: [ |
|
|
typeOptions: [ |
|
@ -151,6 +179,9 @@ export default { |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
fieldOptions: [], |
|
|
fieldOptions: [], |
|
|
|
|
|
filePathOptions: [], |
|
|
|
|
|
fileRemoteLoading: false, |
|
|
|
|
|
fileRemoteOptions: [], |
|
|
rules: { |
|
|
rules: { |
|
|
checkRepeatType: [ |
|
|
checkRepeatType: [ |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
@ -164,11 +195,14 @@ export default { |
|
|
matchingMode: [ |
|
|
matchingMode: [ |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
batchType: [ |
|
|
|
|
|
|
|
|
protocol: [ |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
filePath: [ |
|
|
filePath: [ |
|
|
{ required: true, message: '请选择', trigger: 'blur' } |
|
|
|
|
|
|
|
|
{ required: true, message: '请选择', trigger: 'change' } |
|
|
|
|
|
], |
|
|
|
|
|
fileRemote: [ |
|
|
|
|
|
{ required: true, message: '请选择指定文件', trigger: 'change' } |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -204,9 +238,11 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleComfired() { |
|
|
handleComfired() { |
|
|
if (this.fileList.length === 0) { |
|
|
|
|
|
this.$message({ message: '请先选择相关文件!', offset: 8 }) |
|
|
|
|
|
return false |
|
|
|
|
|
|
|
|
if (!this.connectionType) { |
|
|
|
|
|
if (this.fileList.length === 0) { |
|
|
|
|
|
this.$message({ message: '请先选择相关文件!', offset: 8 }) |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.hitchRemarkArray.length === 1 && this.hitchRemarkArray[0] === '*') { |
|
|
if (this.hitchRemarkArray.length === 1 && this.hitchRemarkArray[0] === '*') { |
|
@ -219,26 +255,54 @@ export default { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
let newhitchRemark = this.hitchRemarkArray.map(item => item.replace(/^\$|\$$|\*$/g, '')) |
|
|
let newhitchRemark = this.hitchRemarkArray.map(item => item.replace(/^\$|\$$|\*$/g, '')) |
|
|
newhitchRemark = newhitchRemark.filter(item => item !== '') |
|
|
newhitchRemark = newhitchRemark.filter(item => item !== '') |
|
|
const params = { |
|
|
|
|
|
'categoryId': this.currentCategory.id, |
|
|
|
|
|
'mountType': 1, // 挂接方式 1.本地挂接 2.远程挂接 3.上传目录 (目前只有1) |
|
|
|
|
|
'checkRepeatType': this.form.checkRepeatType, |
|
|
|
|
|
'matchingMode': this.form.matchingMode, |
|
|
|
|
|
'fields': newhitchRemark |
|
|
|
|
|
} |
|
|
|
|
|
console.log(params) |
|
|
|
|
|
batchMountUpload(this.baseApi + '/api/collect/batchMount', |
|
|
|
|
|
this.fileList, |
|
|
|
|
|
params |
|
|
|
|
|
).then(res => { |
|
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
|
this.$message({ message: '操作成功', type: 'success', offset: 8 }) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ message: '上传附件失败', type: 'error', offset: 8 }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.connectionType) { |
|
|
|
|
|
const params = { |
|
|
|
|
|
'categoryId': this.currentCategory.id, |
|
|
|
|
|
'mountType': 1, // 挂接方式 1.本地挂接 2.远程挂接 3.上传目录 (目前只有1) |
|
|
|
|
|
'checkRepeatType': this.form.checkRepeatType, |
|
|
|
|
|
'matchingMode': this.form.matchingMode, |
|
|
|
|
|
'fields': newhitchRemark |
|
|
} |
|
|
} |
|
|
this.handleCancel() |
|
|
|
|
|
this.crud.refresh() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
console.log(params) |
|
|
|
|
|
batchMountUpload(this.baseApi + '/api/collect/batchMount', |
|
|
|
|
|
this.fileList, |
|
|
|
|
|
params |
|
|
|
|
|
).then(res => { |
|
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
|
this.$message({ message: '操作成功', type: 'success', offset: 8 }) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ message: '上传附件失败', type: 'error', offset: 8 }) |
|
|
|
|
|
} |
|
|
|
|
|
this.handleCancel() |
|
|
|
|
|
this.crud.refresh() |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
const params = { |
|
|
|
|
|
'account': this.form.filePath.account, |
|
|
|
|
|
'cAddress': this.form.filePath.caddress, |
|
|
|
|
|
'cPassword': this.form.filePath.cpassword, |
|
|
|
|
|
'cPort': this.form.filePath.cport, |
|
|
|
|
|
'categoryId': this.currentCategory.id, |
|
|
|
|
|
'checkRepeatType': this.form.checkRepeatType, |
|
|
|
|
|
'matchingMode': this.form.matchingMode, |
|
|
|
|
|
'fields': newhitchRemark, |
|
|
|
|
|
'protocol': this.form.protocol, |
|
|
|
|
|
'zipFilePath': this.form.filePath.rootDirectory + '/' + this.form.fileRemote // rootDirectory+勾选的文件名称 组成一个路径 |
|
|
|
|
|
} |
|
|
|
|
|
console.log(params) |
|
|
|
|
|
remoteConnectiontUpload(this.baseApi + '/api/collect/remoteMount', |
|
|
|
|
|
params |
|
|
|
|
|
).then(res => { |
|
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
|
this.$message({ message: '操作成功', type: 'success', offset: 8 }) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ message: '操作失败', type: 'error', offset: 8 }) |
|
|
|
|
|
} |
|
|
|
|
|
this.handleCancel() |
|
|
|
|
|
this.crud.refresh() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
@ -296,6 +360,31 @@ export default { |
|
|
this.hitchRemarkArray.unshift(symbol) |
|
|
this.hitchRemarkArray.unshift(symbol) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
changeProtocol(val) { |
|
|
|
|
|
if (val) { |
|
|
|
|
|
this.form.filePath = null |
|
|
|
|
|
this.filePathOptions = [] |
|
|
|
|
|
this.fileRemoteOptions = [] |
|
|
|
|
|
FetchFindDetailsByProtocol({ 'protocol': val }).then(res => { |
|
|
|
|
|
this.filePathOptions = res |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
changeFilePath(val) { |
|
|
|
|
|
this.fileRemoteLoading = true |
|
|
|
|
|
if (val) { |
|
|
|
|
|
this.fileRemoteOptions = [] |
|
|
|
|
|
FetchFileByRemoteConnection({ 'id': val.id }).then(res => { |
|
|
|
|
|
this.fileRemoteOptions = res.map(item => { |
|
|
|
|
|
const json = {} |
|
|
|
|
|
json.value = item |
|
|
|
|
|
json.name = item |
|
|
|
|
|
return json |
|
|
|
|
|
}) |
|
|
|
|
|
this.fileRemoteLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
removeTag(tag) { |
|
|
removeTag(tag) { |
|
|
const index = this.hitchRemarkArray.indexOf(tag) |
|
|
const index = this.hitchRemarkArray.indexOf(tag) |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
@ -306,6 +395,8 @@ export default { |
|
|
this.$refs.form.resetFields() |
|
|
this.$refs.form.resetFields() |
|
|
this.hitchRemarkArray = [] |
|
|
this.hitchRemarkArray = [] |
|
|
this.fileList = [] |
|
|
this.fileList = [] |
|
|
|
|
|
this.filePathOptions = [] |
|
|
|
|
|
this.fileRemoteOptions = [] |
|
|
this.localHitchVisible = false |
|
|
this.localHitchVisible = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -341,4 +432,21 @@ export default { |
|
|
margin-right: 6px; |
|
|
margin-right: 6px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.file_remote-style{ |
|
|
|
|
|
::v-deep .el-form-item__content{ |
|
|
|
|
|
width:400px !important; |
|
|
|
|
|
.el-radio-group{ |
|
|
|
|
|
display: block; |
|
|
|
|
|
max-height: 60px; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
overflow-y: scroll; |
|
|
|
|
|
.el-radio{ |
|
|
|
|
|
display: block; |
|
|
|
|
|
padding: 3px 0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |