修改2、5、6、22、26

This commit is contained in:
RenCheng 2025-06-04 22:55:59 +08:00
parent d0a2e3d94b
commit a164ff10dc
7 changed files with 46 additions and 37 deletions

View File

@ -58,7 +58,7 @@
<div class="linese"></div> <div class="linese"></div>
</a-col> </a-col>
</a-row> </a-row>
<tablelist ref="modalForm" @ok="getTableDataList"></tablelist> <tablelist ref="modalForm" ></tablelist>
</a-card> </a-card>
</template> </template>
<script> <script>

View File

@ -213,20 +213,38 @@ export default {
// 0 // 0
currentRow.percentage = 0 currentRow.percentage = 0
const _20M = 20 * 1024 * 1024 // const _20M = 20 * 1024 * 1024 //
if (file.size > _20M) { // 20M let that =this;
this.uploadByPieces({ // this.getMd5(file)
file, // .then((res) => {
currentRow, let fileMD5Value = res
success: (data) => { verifyFileExist({ fileMD5Value: fileMD5Value })
currentRow.percentage = 100 .then((res) => {
}, if (res.result.exist) { //
error: (e) => { that.$message.warning(file.name+'文件已存在');
currentRow.percentage = 0 } else { //
if (file.size > _20M) { // 20M
that.uploadByPieces({ //
file, //
currentRow,
success: (data) => {
currentRow.percentage = 100
},
error: (e) => {
currentRow.percentage = 0
}
})
} else { // 20M
that.uploadDirectly(currentRow, file)
} }
}) }
} else { // 20M })
this.uploadDirectly(currentRow, file) .catch((e) => {
} this.$message.warning(e);
})
})
.catch((e) => {
console.error('MD5计算错误', e)
})
} }
}, },
getMd5 (file, chunkSize) { getMd5 (file, chunkSize) {
@ -293,6 +311,7 @@ export default {
currentRow.percentage = 100 currentRow.percentage = 100
currentRow.uploadStatus = 2 currentRow.uploadStatus = 2
currentRow.result = res currentRow.result = res
this.$message.warning(file.name+'文件已存在');
} else { // } else { //
const formData = this.buildFileFormData(file.name, file.size, fileMD5Value, 0, 0, file, false,fileMD5Value) const formData = this.buildFileFormData(file.name, file.size, fileMD5Value, 0, 0, file, false,fileMD5Value)
const url = '/fileDataLink/uploadFile' const url = '/fileDataLink/uploadFile'
@ -341,16 +360,6 @@ export default {
const sumSlicingCount = Math.ceil(file.size / slicingSize) // const sumSlicingCount = Math.ceil(file.size / slicingSize) //
currentRow.remarks = '正在获取hash值...' currentRow.remarks = '正在获取hash值...'
this.getMd5(file, slicingSize)
.then((res) => {
this.fileMD5[file.uid] = res
currentRow.remarks = ''
this.readFileMD5(file, currentRow, slicingSize, sumSlicingCount, success, error)
})
.catch((e) => {
console.error('MD5计算错误', e)
})
}, },
// file currentIndex slicingSize // file currentIndex slicingSize
getSlicingInfo (file, currentIndex, slicingSize) { getSlicingInfo (file, currentIndex, slicingSize) {
@ -376,11 +385,11 @@ export default {
this.uploadSliceFile(file, currentRow, slicingSize, sumSlicingCount, shareIndex + 1, success, error) this.uploadSliceFile(file, currentRow, slicingSize, sumSlicingCount, shareIndex + 1, success, error)
} }
} else { // 0 } else { // 0
this.uploadSliceFile(file, currentRow, slicingSize, sumSlicingCount, 0, success, error) this.uploadSliceFile(file, currentRow, slicingSize, sumSlicingCount, 0, success, error)
} }
}) })
.catch((e) => { .catch((e) => {
error && error(e) this.$message.warning(e);
}) })
}, },
/** /**

View File

@ -231,6 +231,7 @@ import { datasyncqueryPage,
this.selectDataBase = true; this.selectDataBase = true;
this.createSchemaboll = true; this.createSchemaboll = true;
let model = {}; let model = {};
this.datamodel.database=null
model.ip = ""; model.ip = "";
model.port = 0; model.port = 0;
model.username = ''; model.username = '';
@ -253,6 +254,7 @@ import { datasyncqueryPage,
this.selectDataBase = true; this.selectDataBase = true;
this.createSchemaboll = true; this.createSchemaboll = true;
this.testConnBool = false; this.testConnBool = false;
this.datamodel.database=null;
datasyncqueryById({id:record.id}).then((res) => { datasyncqueryById({id:record.id}).then((res) => {
if (res.success) { if (res.success) {
let model = {}; let model = {};
@ -285,7 +287,7 @@ import { datasyncqueryPage,
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
console.log('values',values) console.log('values',values)
this.datamodel = values; this.datamodel = values;
if(this.datamodel.database==null){ if(this.datamodel.database==null || this.datamodel.database==""){
this.$message.warning("源数据库未选择"); this.$message.warning("源数据库未选择");
return false; return false;
} }

View File

@ -31,10 +31,10 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px"> <div class="table-operator" style="margin-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('角色信息')">导出</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls('角色信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload> -->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">

View File

@ -34,10 +34,10 @@
<div class="table-operator" style="margin: 5px 0 10px 2px"> <div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
<!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>--> <!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>-->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button> -->
</div> </div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
@ -75,9 +75,7 @@
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)"> <a @click="handleDelete1(record.id)">删除</a>
<a>删除</a>
</a-popconfirm>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>

View File

@ -66,10 +66,10 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button> <a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload> -->
<a-button type="primary" icon="hdd" @click="recycleBinVisible=true">回收站</a-button> <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">回收站</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay" @click="handleMenuClick"> <a-menu slot="overlay" @click="handleMenuClick">

View File

@ -9,7 +9,7 @@
:visible="visible" :visible="visible"
style="overflow: auto;padding-bottom: 53px;" class="userrolemodel"> style="overflow: auto;padding-bottom: 53px;" class="userrolemodel">
<a-form> <a-form style="height:calc(100vh - 58px);">
<a-form-item label='所拥有的权限'> <a-form-item label='所拥有的权限'>
<a-tree <a-tree
checkable checkable