提交代码

This commit is contained in:
unknown
2023-05-11 16:22:07 +08:00
parent 309b4e2fb6
commit fcd9576fd9
128 changed files with 20369 additions and 157 deletions

View File

@@ -96,4 +96,4 @@ export default {
this.$refs.dataForm.resetFields()
}
}
}
}

View File

@@ -1,8 +1,8 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 14:24:29
* @LastEditors: zhp
* @LastEditTime: 2023-04-18 14:28:38
* @Description:
*/
export default {
@@ -13,7 +13,7 @@ export default {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportUrl: ''
exportURL: ''
},
addOrEditTitle: '',
tableData: [],
@@ -164,7 +164,7 @@ export default {
// 导出
exportHandle(name) {
this.$http
.get(this.urlOptions.exportUrl, { responseType: "blob" })
.get(this.urlOptions.exportURL, { responseType: "blob" })
.then(({ data: res }) => {
var date = new Date();
var year = date.getFullYear();
@@ -190,4 +190,4 @@ export default {
.catch(() => { });
}
}
}
}

196
src/mixins/basic-search.js Normal file
View File

@@ -0,0 +1,196 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zhp
* @LastEditTime: 2023-02-24 16:16:54
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportUrl: ''
},
addOrEditTitle: '',
tableData: [],
listQuery: {
limit: 10,
page: 1,
total: 1,
},
dataListLoading: false,
addOrUpdateVisible: false,
}
},
created() {
},
activated() {
this.getDataList();
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
this.tableData = res.data.list;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
// 每页数
// sizeChangeHandle(val) {
// this.listQuery.limit = val;
// this.listQuery.page = 1;
// this.getDataList();
// },
// // 当前页
// currentChangeHandle(val) {
// this.listQuery.page = val;
// this.getDataList();
// },
//查看
searchOrUpdateHandle() {
this.searchOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.searchOrUpdate.init();
});
},
handleSearchReset() {
this.$refs.addOrUpdate.formClear();
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
// changeStatus(id) {
// this.$http
// .post(this.urlOptions.statusUrl, { id })
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg);
// }
// this.$refs["popover-" + id].showPopper = false;
// this.$message({
// message: this.$t("prompt.success"),
// type: "success",
// duration: 500,
// onClose: () => {
// this.getDataList();
// },
// });
// })
// .catch(() => { });
// },
//tableBtn点击
// handleClick(val) {
// if (val.type === "edit") {
// this.addOrUpdateVisible = true;
// this.addOrEditTitle = "编辑";
// this.$nextTick(() => {
// this.$refs.addOrUpdate.init(val.data.id);
// });
// } else if (val.type === "delete") {
// this.deleteHandle(val.data.id,val.data.name)
// }
// },
// 删除
// deleteHandle(id, name) {
// this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
// if (data && data.code === 0) {
// this.$message({
// message: "操作成功",
// type: "success",
// duration: 1500,
// onClose: () => {
// this.getDataList();
// },
// });
// } else {
// this.$message.error(data.msg);
// }
// });
// })
// .catch(() => { });
// },
//search-bar点击
// buttonClick(val) {
// switch (val.btnName) {
// case "search":
// this.listQuery.xm1 = val.xm1;
// this.listQuery.xm2 = val.xm2;
// this.listQuery.page = 1;
// this.getDataList();
// break;
// case "add":
// this.addOrEditTitle = '新增'
// this.addOrUpdateVisible = true;
// this.addOrUpdateHandle()
// break;
// default:
// console.log(val)
// }
// },
handleSearchCancel() {
this.$refs.searchOrUpdate.formClear()
this.searchOrUpdateVisible = false
this.searchOrEditTitle = ''
},
handleSearchConfirm() {
this.$refs.searchOrUpdate.handleConditionSearch()
},
searchSuccessSubmit() {
this.handleSearchCancel()
this.getDataList()
},
// 导出
// exportHandle(name) {
// this.$http
// .get(this.urlOptions.exportUrl, { responseType: "blob" })
// .then(({ data: res }) => {
// var date = new Date();
// var year = date.getFullYear();
// var month = date.getMonth() + 1;
// var strDate = date.getDate();
// if (month >= 1 && month <= 9) {
// month = "0" + month;
// }
// if (strDate >= 0 && strDate <= 9) {
// strDate = "0" + strDate;
// }
// var currentdate = year + "-" + month + "-" + strDate;
// const blob = new Blob([res]);
// const downloadElement = document.createElement("a");
// const href = window.URL.createObjectURL(blob); // 创建下载的链接
// downloadElement.href = href;
// downloadElement.download = `${name + currentdate}.xls`; // 下载后文件名
// document.body.appendChild(downloadElement);
// downloadElement.click(); // 点击下载
// document.body.removeChild(downloadElement); // 下载完成移除元素
// window.URL.revokeObjectURL(href);
// })
// .catch(() => { });
// }
}
}

View File

@@ -1,8 +1,8 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2022-09-16 14:19:44
* @LastEditors: zhp
* @LastEditTime: 2023-04-07 10:26:58
* @Description:
*/
export default {
@@ -149,4 +149,4 @@ export default {
.catch(() => {});
}
}
}
}