|
|
|
@ -72,6 +72,10 @@ export default { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
rowClickSelect: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
enableUpgrade: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
@ -97,6 +101,7 @@ export default { |
|
|
|
remark:'' |
|
|
|
}, |
|
|
|
fileList:[], |
|
|
|
currentSelectedRowId: null, |
|
|
|
upgradeVisible:false, |
|
|
|
upgradeLoading:false, |
|
|
|
upgradeFileList:[], |
|
|
|
@ -111,8 +116,44 @@ export default { |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
handleSelectionChange(val){ |
|
|
|
if (this.rowClickSelect) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.selectionDataList = val |
|
|
|
}, |
|
|
|
rowStyle ({ row }) { |
|
|
|
if (!this.rowClickSelect) { |
|
|
|
return {} |
|
|
|
} |
|
|
|
if (this.currentSelectedRowId && row.id === this.currentSelectedRowId) { |
|
|
|
return { 'background-color': '#E8F7F6', cursor: 'pointer' } |
|
|
|
} |
|
|
|
return { cursor: 'pointer' } |
|
|
|
}, |
|
|
|
handleRowClick (row) { |
|
|
|
if (!this.rowClickSelect) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.selectionDataList = row ? [row] : [] |
|
|
|
this.currentSelectedRowId = row ? row.id : null |
|
|
|
if (this.$refs.table) { |
|
|
|
this.$refs.table.setCurrentRow(row || null) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleCurrentChange (row) { |
|
|
|
if (!this.rowClickSelect) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.selectionDataList = row ? [row] : [] |
|
|
|
this.currentSelectedRowId = row ? row.id : null |
|
|
|
}, |
|
|
|
resetRowSelection () { |
|
|
|
this.selectionDataList = [] |
|
|
|
this.currentSelectedRowId = null |
|
|
|
if (this.$refs.table) { |
|
|
|
this.$refs.table.setCurrentRow() |
|
|
|
} |
|
|
|
}, |
|
|
|
handleQuery(){ |
|
|
|
if (!this.params.orderRef1 && !this.params.orderRef2){ |
|
|
|
return; |
|
|
|
@ -124,6 +165,19 @@ export default { |
|
|
|
queryOss(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.dataList = data.rows; |
|
|
|
if (this.rowClickSelect && this.currentSelectedRowId) { |
|
|
|
const selectedRow = (this.dataList || []).find(item => item.id === this.currentSelectedRowId) |
|
|
|
if (selectedRow) { |
|
|
|
this.selectionDataList = [selectedRow] |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.table) { |
|
|
|
this.$refs.table.setCurrentRow(selectedRow) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.resetRowSelection() |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
@ -273,7 +327,9 @@ export default { |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.upgradeVisible = false; |
|
|
|
this.handleQuery(); |
|
|
|
if (this.$refs.table){ |
|
|
|
if (this.rowClickSelect) { |
|
|
|
this.resetRowSelection(); |
|
|
|
} else if (this.$refs.table){ |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
} |
|
|
|
}else { |
|
|
|
@ -384,7 +440,11 @@ export default { |
|
|
|
link.target = '_blank'; // 打开新窗口预览 |
|
|
|
link.click(); |
|
|
|
URL.revokeObjectURL(link.href); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
if (this.rowClickSelect) { |
|
|
|
this.resetRowSelection(); |
|
|
|
} else if (this.$refs.table) { |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -410,6 +470,7 @@ export default { |
|
|
|
this.ossForm.orderRef2 = this.orderRef2; |
|
|
|
this.ossForm.orderRef3 = this.orderRef3; |
|
|
|
this.dataList = []; |
|
|
|
this.resetRowSelection(); |
|
|
|
this.handleQuery(); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -442,9 +503,12 @@ export default { |
|
|
|
ref="table" |
|
|
|
v-loading="queryLoading" |
|
|
|
border |
|
|
|
:row-style="rowStyle" |
|
|
|
@row-click="handleRowClick" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
style="width: 100%;margin-top: 5px"> |
|
|
|
<el-table-column type="selection" label="序号" align="center"/> |
|
|
|
<el-table-column v-if="!rowClickSelect" type="selection" label="序号" align="center"/> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columns" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -494,7 +558,6 @@ export default { |
|
|
|
<el-col :span="12" v-if="requireFileNoRev"> |
|
|
|
<el-form-item label="版本号"> |
|
|
|
<el-input class="inlineNumber numInput" v-model="ossForm.rev" :min="1" :step="1" type="number" style="width: 100%;"></el-input> |
|
|
|
<!-- <el-input-number v-model="ossForm.rev" :min="1" :step="1" controls-position="right" style="width: 100%;"></el-input-number>--> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
@ -525,26 +588,26 @@ export default { |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="附件升版" :visible.sync="upgradeVisible" v-drag width="500px" append-to-body :close-on-click-modal="false"> |
|
|
|
<el-form :model="upgradeForm" label-width="100px"> |
|
|
|
<el-dialog title="附件升版" :visible.sync="upgradeVisible" v-drag width="520px" append-to-body :close-on-click-modal="false"> |
|
|
|
<el-form :model="upgradeForm" label-position="top"> |
|
|
|
<el-row :gutter="10"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="文件编码"> |
|
|
|
<el-input v-model="upgradeForm.fileNo" readonly></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="当前版本"> |
|
|
|
<el-input :value="upgradeForm.currentRev" readonly></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="新版本"> |
|
|
|
<el-input-number v-model="upgradeForm.newRev" :min="1" :step="1" controls-position="right" style="width: 100%;"></el-input-number> |
|
|
|
<el-input class="inlineNumber numInput" v-model="upgradeForm.newRev" :min="1" :step="1" type="number" style="width: 100%;"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="新版本文件"> |
|
|
|
<el-form-item label="新版本文件" class="auto"> |
|
|
|
<el-upload drag |
|
|
|
action="#" |
|
|
|
ref="upgradeUpload" |
|
|
|
@ -560,8 +623,8 @@ export default { |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input type="textarea" v-model="upgradeForm.fileRemark" resize="none" :autosize="{minRows: 3, maxRows: 3}"></el-input> |
|
|
|
<el-form-item label="备注" class="auto"> |
|
|
|
<el-input type="textarea" v-model="upgradeForm.fileRemark" resize="none" :autosize="{minRows: 3, maxRows: 3}" style="width: 100%;"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -579,4 +642,8 @@ export default { |
|
|
|
height: auto; |
|
|
|
line-height: 1; |
|
|
|
} |
|
|
|
.auto /deep/ .el-upload, |
|
|
|
.auto /deep/ .el-upload-dragger{ |
|
|
|
height: auto; |
|
|
|
} |
|
|
|
</style> |