he wei
2022-11-13 b4816f6294646157b50bb49f1d19eaf306e0ac8c
src/components/contextMenu.vue
@@ -62,6 +62,7 @@
      width="800px"
    >
      <file-info
        v-if="fileInfoVisible"
        :info="fileData"
        @ok="editOk"
        @cancel="editCancel"
@@ -79,7 +80,8 @@
  updateStation,
  deleteStation,
  delFileFromStation,
  getXmlValue,
  getParamByFileId,
  updateFileParam,
} from "@/apis";
export default {
  name: "ContextMenu",
@@ -182,7 +184,7 @@
      currFile: {
        name: "",
        url: "",
        fileId: undefined
        fileId: undefined,
      },
    };
  },
@@ -233,17 +235,14 @@
      });
    },
    openFile() {
      let { url, fileId } = this.contextData;
      const params = {
        filePath: url
      };
      getXmlValue(params).then((res) => {
      let { url, fileId, label } = this.contextData;
      getParamByFileId(fileId).then((res) => {
        const { code, data, data2 } = res.data;
        if (code && data) {
          // console.log(data2);
          this.fileData = data2.fileParam;
          this.currFile.name = data2.fileName;
          this.currFile.url = data2.fileUrl;
          this.fileData = data2;
          this.currFile.name = label;
          this.currFile.url = url;
          this.currFile.fileId = fileId;
          this.fileInfoVisible = true;
        } else {
@@ -456,6 +455,14 @@
    },
    editOk(data) {
      this.fileInfoVisible = false;
      updateFileParam(this.currFile.fileId, data).then((res) => {
        const { code, data } = res.data;
        if (code && data) {
          this.$message.success('修改成功');
        } else {
          this.$message.error('修改失败');
        }
      });
      this.toRes();
    },
    editCancel(data) {
@@ -469,7 +476,7 @@
        path: "/result/" + name,
        query: {
          url,
          fileId
          fileId,
        },
      });
      this.$bus.$emit("checkScroll");