| xqd
@@ -51,7 +51,7 @@
|
|
|
>
|
|
|
<el-button type="primary" @click="Exports">全部导出</el-button>
|
|
|
<el-button type="primary" @click="batchExports">批量导出</el-button>
|
|
|
- <el-button type="primary">下载</el-button>
|
|
|
+ <el-button type="primary" @click="downLoadSql">下载</el-button>
|
|
|
<el-button type="danger" @click="moreDelete">删除</el-button>
|
|
|
</div>
|
|
|
</el-row>
|
| xqd
@@ -138,15 +138,18 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <!--修改出票人弹窗 -->
|
|
|
- <el-dialog title="修改出票人" :visible.sync="dialogVisible" width="500px">
|
|
|
- <el-form ref="form" label-width="80px">
|
|
|
- <el-form-item label="备注" >
|
|
|
- <el-input style="width: 100%"></el-input>
|
|
|
+ <!--修改备注弹窗 -->
|
|
|
+ <el-dialog title="修改备注" :visible.sync="dialogVisible" width="500px">
|
|
|
+ <el-form ref="form" :model="tableData" label-width="80px">
|
|
|
+ <el-form-item label="文件名称">
|
|
|
+ <el-input v-model="tableData.fileName" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="tableData.remark" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" >提交修改</el-button>
|
|
|
+ <el-button type="primary" @click="submitDelete(tableData.fileName)">提交修改</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
| xqd
@@ -228,6 +231,7 @@ export default {
|
|
|
value2: "",
|
|
|
exportExcelData1: [], //导出列表缓存数据整页
|
|
|
exportExcelData2:[],//导出列表缓存数据单选
|
|
|
+ multipleSelection:[],//下载sql文件数据
|
|
|
};
|
|
|
},
|
|
|
|
| xqd
@@ -243,7 +247,6 @@ export default {
|
|
|
};
|
|
|
getDatabase({ ...params, ...searchForm }).then((res) => {
|
|
|
const { data } = res;
|
|
|
- console.log(data);
|
|
|
this.temporaryList = data.result;
|
|
|
this.srcList = data.result;
|
|
|
this.total = res.data.total;
|
| xqd
@@ -312,67 +315,73 @@ export default {
|
|
|
|
|
|
/* 下载数据备份 */
|
|
|
download(fileName) {
|
|
|
- window.open(
|
|
|
- "https://ht.9026.com/api/Database/export?fileName=" + fileName
|
|
|
- );
|
|
|
- // this.$request({
|
|
|
- // url:'/api/Database/export',
|
|
|
- // method:'post',
|
|
|
- // data:{
|
|
|
- // fileName:fileName
|
|
|
- // }
|
|
|
- // }).then((res)=>{
|
|
|
- // console.log(res)
|
|
|
- // })
|
|
|
+ this.$request({
|
|
|
+ url:'/api/Database/download',
|
|
|
+ method:'post',
|
|
|
+ data:{
|
|
|
+ fileNameList:[fileName]
|
|
|
+ }
|
|
|
+ }).then((res)=>{
|
|
|
+ window.open(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 下载多条数据备份 */
|
|
|
+ downLoadSql(){
|
|
|
+ let fileNameList = this.multipleSelection.map((item,value)=>{
|
|
|
+ return item.fileName
|
|
|
+ })
|
|
|
+ this.$request({
|
|
|
+ url:'/api/Database/download',
|
|
|
+ method:'post',
|
|
|
+ data:{
|
|
|
+ fileNameList
|
|
|
+ }
|
|
|
+ }).then((res)=>{
|
|
|
+ window.open(res.data)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
- // recover(fileName) {
|
|
|
- // this.$request({
|
|
|
- // url: "/api/Database/restore",
|
|
|
- // method: "post",
|
|
|
- // headers: {
|
|
|
- // "Content-Type": "application/json",
|
|
|
- // },
|
|
|
- // data: {
|
|
|
- // fileName: fileName,
|
|
|
- // },
|
|
|
- // }).then((res) => {
|
|
|
- // console.log(res);
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: "恢复成功",
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // type: "danger",
|
|
|
- // message: "恢复失败",
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
|
|
|
/* 修改备注 */
|
|
|
modifyRemarks(fileName){
|
|
|
- console.log(fileName);
|
|
|
- // this.dialogVisible = true;
|
|
|
- // let params ={
|
|
|
- // fileNameList:fileName
|
|
|
- // }
|
|
|
- // deletDatabase({...params}).then(res=>{
|
|
|
- // console.log(res);
|
|
|
- // })
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.$request({
|
|
|
+ url:'/api/Database/backups',
|
|
|
+ method:'post',
|
|
|
+ data:{
|
|
|
+ fileName
|
|
|
+ }
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableData = res.data.result[0]
|
|
|
+ })
|
|
|
},
|
|
|
- // // 修改信息弹窗
|
|
|
- // modify(id) {
|
|
|
+
|
|
|
+ /* 提交修改 */
|
|
|
+ submitDelete(){
|
|
|
+ this.$request({
|
|
|
+ url:'/api/Database/update',
|
|
|
+ method:'post',
|
|
|
+ data:this.tableData
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.code === 200){
|
|
|
+ this.$message({
|
|
|
+ type:'success',
|
|
|
+ message:'修改成功'
|
|
|
+ })
|
|
|
+ this.getAllList()
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type:'danger',
|
|
|
+ message:'修改失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
|
|
|
- // this.$request({
|
|
|
- // url: "/api/Drawer/" + id,
|
|
|
- // method: "get",
|
|
|
- // }).then((res) => {
|
|
|
- // this.tableData = res.data;
|
|
|
- // this.talbeData = this.$route.query.id;
|
|
|
- // });
|
|
|
- // },
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
deleted(fileName) {
|
|
|
this.$request({
|
| xqd
@@ -423,11 +432,14 @@ export default {
|
|
|
|
|
|
/* 批量导出 */
|
|
|
handleSelectionChange(data) {
|
|
|
+ this.multipleSelection = data
|
|
|
+ console.log(this.multipleSelection);
|
|
|
this.exportExcelData1.push(data);
|
|
|
this.exportExcelData2 = [...new Set( this.exportExcelData1.flat(Infinity))];
|
|
|
|
|
|
},
|
|
|
handleAll(data) {
|
|
|
+ this.multipleSelection = data
|
|
|
this.exportExcelData1.push(data);
|
|
|
},
|
|
|
/* 批量导出数据 */
|
| xqd
@@ -476,7 +488,7 @@ export default {
|
|
|
fileName: "",
|
|
|
|
|
|
};
|
|
|
- getDatabase({ data }).then((res) => {
|
|
|
+ getDatabase({ ...data }).then((res) => {
|
|
|
const { result } = res.data;
|
|
|
this.multipleSelection = result;
|
|
|
});
|