|
@@ -40,7 +40,9 @@ export default {
|
|
|
shareModel: "",
|
|
|
pageNo: 1,
|
|
|
dataList: [],
|
|
|
- total: 0
|
|
|
+ total: 0,
|
|
|
+ itemCopyClass: "itemCopy",
|
|
|
+ morehoverClass: "morehover"
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -73,6 +75,22 @@ export default {
|
|
|
this.getTestList(true);
|
|
|
},
|
|
|
methods: {
|
|
|
+ more(isShow, item, index) {
|
|
|
+ item.isMore = isShow;
|
|
|
+ this.dataList.splice(index, 1, item);
|
|
|
+ },
|
|
|
+ operationCommand(command, item, index) {
|
|
|
+ if (command == "download") {
|
|
|
+ console.log("下载");
|
|
|
+ this.download(item);
|
|
|
+ } else if (command == "share") {
|
|
|
+ console.log("分享");
|
|
|
+ this.shareTest(item);
|
|
|
+ } else if (command == "del") {
|
|
|
+ console.log("删除");
|
|
|
+ this.deleteTest(item, index);
|
|
|
+ }
|
|
|
+ },
|
|
|
dataformat(val) {
|
|
|
return timeFormat.dateStr(val);
|
|
|
},
|
|
@@ -128,6 +146,30 @@ export default {
|
|
|
createTest() {
|
|
|
this.$router.push({ path: '/cncTestLists' });
|
|
|
},
|
|
|
+ download(item) {
|
|
|
+ let data = {
|
|
|
+ "id": item._id
|
|
|
+ }
|
|
|
+ console.log("下载数据", data);
|
|
|
+ api.exportExcelPath(data).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ console.log("下载数据", res);
|
|
|
+ this.$message.success("下载成功");
|
|
|
+ var tempLink = document.createElement("a");
|
|
|
+ tempLink.style.display = "none";
|
|
|
+ tempLink.href = res.data.single;
|
|
|
+ tempLink.setAttribute("download", "用户来源导出表");
|
|
|
+ if (typeof tempLink.download === "undefined") {
|
|
|
+ tempLink.setAttribute("target", "_blank");
|
|
|
+ }
|
|
|
+ document.body.appendChild(tempLink);
|
|
|
+ tempLink.click();
|
|
|
+ document.body.removeChild(tempLink);
|
|
|
+ } else {
|
|
|
+ this.$message.error("下载失败,请重试");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
deleteTest(item, index) {
|
|
|
const h = this.$createElement;
|
|
|
this.$msgbox({
|
|
@@ -207,6 +249,29 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ excelReport(item) {
|
|
|
+ console.log(item);
|
|
|
+ let maindata = {
|
|
|
+ houseId: this.houseId
|
|
|
+ };
|
|
|
+ console.log("***expot***", maindata);
|
|
|
+ editorApi.exportStaffSource(maindata).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ var tempLink = document.createElement("a");
|
|
|
+ tempLink.style.display = "none";
|
|
|
+ tempLink.href = result.data.single.url;
|
|
|
+ tempLink.setAttribute("download", "用户来源导出表");
|
|
|
+ if (typeof tempLink.download === "undefined") {
|
|
|
+ tempLink.setAttribute("target", "_blank");
|
|
|
+ }
|
|
|
+ document.body.appendChild(tempLink);
|
|
|
+ tempLink.click();
|
|
|
+ document.body.removeChild(tempLink);
|
|
|
+ } else {
|
|
|
+ this.$message.error(result.data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
closeShare() {
|
|
|
this.currItem = "";
|
|
|
this.isShareSetting = false;
|