<template>
  <div class="wraap">
    <header>
      <div class="addbox">
        <baseNewForm
            ref="mainForm"
            :lookFlag="lookFlag"
            :spanNumber="24"
            :formRow="formRow"
            :ruleForm="ruleForm"
            :isFunBtn="false"
            @onSubmit="onSubmitHandle"
            @onSelect="selectChangeHandle"
            @onChangeRadio="onChangeRadioHandle"
        ></baseNewForm>
      </div>
    </header>
    <div class="chunk" v-show="ruleForm.plug == 2">
      <div class="title"><h1>链接对照表</h1></div>
      <div class="link">
        <div class="left">
          <BaseLink
              v-loading="linkloading"
              ref="link"
              :lookFlag="lookFlag"
              :leftData="linkData.leftData"
              :rightData="linkData.rightData"
              @linechange="getLineData"
          ></BaseLink>
        </div>
        <div class="right">
          <div class="title">
            <h1 style="font-size: 16px">连接结果</h1>
          </div>
          <div>
            <div
                v-for="item in linkData.lineData"
                :key="item.leftid"
                class="result"
            >
              <div class="left" :style="{ color: item.stroke }">
                {{ item.leftTitle }}
              </div>
              <div class="middle">-</div>
              <div class="right" :style="{ color: item.stroke }">
                {{ item.rightTitle }}
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <footer>
      <div class="btn">
        <el-button
            type="primary"
            @click="commitForm"
            :loading="commitloading"
            v-if="!lookFlag"
        >提交
        </el-button
        >
        <el-button @click="$router.back()">取消</el-button>
      </div>
    </footer>
  </div>
</template>

<script>
import BaseLink from "./compoments/baseLink/index.vue";
import BaseNewForm from "./compoments/baseNewForm";
import baseTableForm from "./compoments/baseTableForm_v2.vue";
import {getApiModuleApi} from "@/api/apiChunks/index.js";
import {deepClone} from "@/utils/index.js";

export default {
  data() {
    return {
      lookFlag: false,
      commitloading: false,
      linkloading: false,
      apiOutActiveIndex: "1",
      apiInActiveIndex: "1",
      ruleForm: {
        plug: "2",
      },
      formRow: [
        {
          elCol: [
            {
              type: "input",
              title: "场景编码",
              id: "ref_code",
              row: 8,
              required: true,
            },
            {
              type: "input",
              title: "场景名称",
              id: "ref_name",
              row: 8,
              required: true,
            },
            {
              type: "select",
              title: "场景分类",
              id: "ref_type",
              row: 8,
              required: true,
              options: [
                {
                  label: "测试",
                  id: 1,
                },
              ],
            },
          ],
        },
        {
          elCol: [
            {
              type: "select",
              title: "源应用",
              id: "source_api_app",
              row: 8,
              options: [],
            },
            {
              type: "select",
              title: "标应用",
              id: "target_api_app",
              row: 8,
              options: [],
            },
            {
              type: "input",
              title: "场景描述",
              id: "description",
              row: 8,
            },
          ],
        },
        {
          elCol: [
            {
              foucus: false,
              refName: "sourceApiId",
              type: "newSelect",
              title: "源连接器",
              id: "source_api_id",
              apiInfo: {
                tl: "appApiService",
                as: "appApi",
                dj: "queryPage",
              },
              row: 8,
              options: [],
              prop: {
                label: "apiName",
                id: "id",
              },
              searchApiInfo: {
                tl: "appApiService",
                as: "appApi",
                dj: "queryEntity",
              },
              searchKey: "id",
            },
            {
              foucus: false,
              refName: "targetApiId",
              prop: {
                label: "apiName",
                id: "id",
              },
              type: "newSelect",
              title: "标连接器",
              id: "target_api_id",
              apiInfo: {
                tl: "appApiService",
                as: "appApi",
                dj: "queryPage",
              },
              row: 8,
              options: [],
              searchApiInfo: {
                tl: "appApiService",
                as: "appApi",
                dj: "queryEntity",
              },
              searchKey: "id",
            },
          ],
        },
        {
          elCol: [
            {
              type: "textrea",
              title: "备注",
              id: "remark",
              row: 24,
            },
          ],
        },
        {
          elCol: [
            {
              type: "radio",
              title: "使用插件",
              id: "plug",
              row: 8,
              options: [
                {
                  label: "是",
                  id: "1",
                },
                {
                  label: "否",
                  id: "2",
                },
              ],
            },
            {
              refName: "plugId",
              type: "newSelect",
              title: "插件列表",
              id: "plug_id",
              row: 8,
              show: false,
              options: [],
              apiInfo: {
                tl: "pluginService",
                as: "plugins",
                dj: "queryPluginsByType",
              },
              apiBody: {
                pluginType: "1",
              },
              searchApiInfo: {
                tl: "pluginService",
                as: "plugins",
                dj: "queryPluginById",
              },
              searchKey: "pluginId",
              prop: {
                label: "pluginLabel",
                id: "pluginId",
              },
            },
          ],
        },
      ],
      funData: [
        {
          type: "addattr",
          text: "添加属性",
          color: "blue",
        },
        {
          type: "dele",
          text: "删除",
          color: "red",
        },
      ],
      // 暂时不用的两个数据
      apiInTableInfo: [
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "1",
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "2",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "3",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "4",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
      ],
      apiOutTableInfo: [
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "1",
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "2",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "3",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
        {
          id: "requestHeader",
          tableData: [
            {
              id: 3,
              parameterName: "4",
              children: [{id: 4}],
            },
          ],
          detailFields: [
            {
              type: "input",
              title: "参数名称",
              id: "parameterName",
              width: 250,
            },
            {
              type: "select",
              title: "参数类型",
              id: "parameterType",
            },
            {
              type: "select",
              title: "具体类型",
              id: "concreteType",
            },
            {
              type: "switch",
              title: "必选",
              id: "required",
              width: 80,
            },
            {
              type: "number",
              title: "长度",
              id: "length",
              width: 100,
            },
            {
              type: "input",
              title: "示例",
              id: "example",
            },
            {
              type: "input",
              title: "描述",
              id: "description",
            },
            {
              type: "number",
              title: "文档顺序",
              id: "sorts",
              width: 100,
            },
          ],
        },
      ],
      parameterTypeOptions: [
        {
          label: "基本类型",
          id: "fundamental",
        },
        {
          label: "复杂类型",
          id: "complex",
        },
        {
          label: "基本列表",
          id: "fundamentallist",
        },
        {
          label: "复杂列表",
          id: "complexlist",
        },
      ],
      concreteTypeOptions: {
        fundamental: [
          {
            label: "String",
            id: "String",
          },
          {
            label: "Int",
            id: "Int",
          },
          {
            label: "Long",
            id: "Long",
          },
          {
            label: "Float",
            id: "Float",
          },
          {
            label: "Double",
            id: "Double",
          },
          {
            label: "Boolean",
            id: "Boolean",
          },
        ],
        complex: [
          {
            label: "Object",
            id: "Object",
          },
          {
            label: "Map",
            id: "Map",
          },
        ],
        fundamentallist: [
          {
            label: "String",
            id: "String",
          },
          {
            label: "Int",
            id: "Int",
          },
          {
            label: "Long",
            id: "Long",
          },
          {
            label: "Float",
            id: "Float",
          },
          {
            label: "Double",
            id: "Double",
          },
          {
            label: "Boolean",
            id: "Boolean",
          },
        ],
        complexlist: [
          {
            label: "Object",
            id: "ObjectCom",
          },
        ],
        authport: [
          {
            label: "String",
            id: "String",
          },
          {
            label: "Int",
            id: "Int",
          },
          {
            label: "Long",
            id: "Long",
          },
          {
            label: "Float",
            id: "Float",
          },
          {
            label: "Double",
            id: "Double",
          },
          {
            label: "Boolean",
            id: "Boolean",
          },
        ],
      },
      linkData: {
        leftData: [],
        rightData: [],
        lineData: [],
      },
      appSelectOptions: [],
    };
  },
  methods: {

    // 是否使用插件按钮改变后
    onChangeRadioHandle(val, index, indexRow, row) {
      if (row.id == "plug") {
        if (val == 2) {
          if (this.ruleForm.plug_id) {
            this.ruleForm.plug_id = "";
          }
        }
        this.formRow[4].elCol[1].show = val == 1;
        this.$nextTick(() => {
          this.$refs.link.resizeHeight();
        });
      }
    },
    // 读取api信息
    async getApiInfo(id) {
      const res = await getApiModuleApi(
          {
            tl: "appApiService",
            as: "appApi",
            dj: "queryEntity",
          },
          {id}
      );
      if (res.status == 200) {
        return res.attribute;
      }
    },
    async getApiModuleHandle(obj = {}, index = 1) {
      const res = await getApiModuleApi(
          {
            tl: "appApiService",
            as: "appApi",
            dj: "queryPage",
          },
          {
            pageNum: index,
            pageSize: 1000,
            ...obj,
          }
      );
      if (res.status == 200) {
        return res.attribute.list;
      }
    },
    // 保存表单接口
    async saveFormHandle(obj) {
      this.commitloading = true;
      try {
        const res = await getApiModuleApi(
            {
              tl: "apiReflectionService",
              as: "sys_api_reflectionService",
              dj: this.$route.query.id
                  ? "updateApiReflection"
                  : "saveApiReflection",
            },
            obj
        );
        if (res.status == 200) {
          this.$message({
            type: "success",
            message: "保存成功！",
          });
          this.$router.back();
        }
      } catch (error) {
        this.commitloading = false;
      }
    },
    // appId
    async initSysSelect() {
      const res = await getApiModuleApi({
        tl: "sysAppService",
        as: "app",
        dj: "queryList",
      });
      if (res.status == 200) {

        this.appSelectOptions = res.attribute;
        res.attribute.forEach((item) => {
          this.formRow[1]["elCol"][0]["options"].push({
            id: item.id,
            label: item.name,
          });
          this.formRow[1]["elCol"][1]["options"].push({
            id: item.id,
            label: item.name,
          });
        });
      }
    },
    commitForm() {
      this.$refs.mainForm.submitForm();
    },
    // 获取连线数据 x y坐标等等
    getLineData(data) {
      this.linkData.lineData = data;
    },
    // 点击提交并且校验通过后
    onSubmitHandle() {
      let obj = {};
      obj = {...this.ruleForm};
      obj["details"] = [];
      if (this.$route.query.id) {
        obj["id"] = this.$route.query.id;
      }
      this.linkData.lineData.forEach((item) => {
        //参考2 连线数据保存
        let tempObj = {};
        tempObj["source_field"] = item["leftTitle"].split(".").slice(-1);
        tempObj["source_name"] = item["leftTitle"];
        tempObj["source_path"] = item["leftTitle"];
        tempObj["target_field"] = item["rightTitle"].split(".").slice(-1);
        tempObj["target_path"] = item["rightTitle"];
        tempObj["source_field_path"] = item["leftidarr"];
        tempObj["target_field_path"] = item["rightidarr"];
        tempObj["coordinate"] = item;
        obj["details"].push(tempObj);
      });
      this.saveFormHandle(obj);
    },
    // 添加行
    addTableData(tabledata) {
      tabledata.push({id: Date.now()});
    },
    // 清楚线数据（递归）
    cleanLineData(arr, flag) {
      arr.forEach((item) => {
        if (item.isline) {
          item.isline = false;
          item.value = false;
        }
        if (item.children && item.children.length) {
          this.cleanLineData(item.children);
        }
      });
    },
    // select下拉
    selectChangeHandle(val = false, index, indexRow, row, flag = false) {
      if (row.id == "source_api_app") {
        if (!flag) {
          this.linkData.leftData = [];
          this.$refs.link.cleanActive("left");
          this.formRow[2]["elCol"][0].options = [];
          this.cleanLineData(this.linkData.rightData, "right");
          if (this.ruleForm["source_api_id"]) {
            this.ruleForm["source_api_id"] = "";
          }
          this.$nextTick(() => {
            this.$refs.link.resizeHeight();
          });
        }
        if (!val) {
          this.$refs.mainForm.$refs.sourceApiId[0].clearOptions();
        } else {
          let obj = {};
          obj["appID"] = val;
          this.$refs.mainForm.$refs.sourceApiId[0].getUserModuleHandle(
              null,
              obj
          );
          this.getApiModuleHandle(obj).then((val) => {
            val.forEach((item) => {
              this.formRow[2]["elCol"][0].options.push({
                id: item.id,
                label: item.apiCode,
              });
            });
          });
        }
      }
      if (row.id == "target_api_app") {
        if (!flag) {
          this.$refs.link.cleanActive("right");
          this.cleanLineData(this.linkData.leftData, "left");
          if (this.ruleForm["target_api_id"]) {
            this.ruleForm["target_api_id"] = "";
          }
          this.linkData.rightData = [];
          this.formRow[2]["elCol"][1].options = [];
          this.$nextTick(() => {
            this.$refs.link.resizeHeight();
          });
        }
        if (!val) {
          this.$refs.mainForm.$refs.targetApiId[0].clearOptions();
        } else {
          let obj = {};
          obj["appID"] = val;
          this.$refs.mainForm.$refs.targetApiId[0].getUserModuleHandle(
              null,
              obj
          );
          this.getApiModuleHandle(obj).then((val) => {
            val.forEach((item) => {
              this.formRow[2]["elCol"][1].options.push({
                id: item.id,
                label: item.apiCode,
              });
            });
          });
        }
      }
      if (row.id === "source_api_id") {
        if (!flag) {
          this.$refs.link.cleanActive("left");
          this.cleanLineData(this.linkData.rightData, "right");
          this.linkData.leftData = [];
        }
        this.$nextTick(() => {
          if (val) {
            this.getApiInfo(val).then((val) => {
              let tempArr = [];
              this.selectDataHanlde(tempArr, JSON.parse(val["bodyOut"]));
              this.linkData.leftData = tempArr;
              // 查看或者编辑模式 重新回显线
              if (flag) {
                flag.forEach((item) => {
                  let leftArr = JSON.parse(item.source_field_path);
                  let targetid = leftArr[leftArr.length - 1];
                  let rightArr = JSON.parse(item.target_field_path);
                  let saveId = rightArr[rightArr.length - 1];
                  this.lineDataHandle(
                      targetid,
                      this.linkData.leftData,
                      "rightid",
                      saveId
                  );
                });
              }
              this.$nextTick(() => {
                this.$refs.link.resizeHeight();
              });
            });
          }
        });
      }
      if (row.id === "target_api_id") {
        if (!flag) {
          this.cleanLineData(this.linkData.leftData, "left");
          this.$refs.link.cleanActive("right");
          this.linkData.rightData = [];
        }
        this.$nextTick(() => {
          if (val) {
            //需要做参考的地方
            this.getApiInfo(val).then((val) => {
              let tempArr = [];
              this.selectDataHanlde(tempArr, JSON.parse(val["bodyIn"]));
              this.linkData.rightData = tempArr;
              // 查看或者编辑模式 重新回显线
              if (flag) {
                flag.forEach((item) => {
                  let leftArr = JSON.parse(item.source_field_path);
                  let saveId = leftArr[leftArr.length - 1];
                  let rightArr = JSON.parse(item.target_field_path);
                  let targetid = rightArr[rightArr.length - 1];
                  this.lineDataHandle(
                      targetid,
                      this.linkData.rightData,
                      "leftid",
                      saveId
                  );
                });
              }
              this.$nextTick(() => {
                this.$refs.link.resizeHeight();
              });
            });
          }
        });
      }
    },
    // 递归查找线数据
    lineDataHandle(targetid, arr, saveName, saveId) {
      arr.some((item) => {
        if (item.id === targetid) {
          this.$set(item, "value", true);
          this.$set(item, "isline", true);
          this.$set(item, saveName, saveId);
          return true;
        } else if (item.children && item.children.length) {
          this.lineDataHandle(targetid, item.children, saveName, saveId);
          return false;
        }
      });
    },
    // 递归处理函数
    selectDataHanlde(resultArr, arr) {
      arr.forEach((item) => {
        let obj = {};
        resultArr.push(obj);
        obj["label"] = item.parameterName;
        obj["id"] = item.id;
        obj["type"] = item.concreteType;
        if (item.children) {
          obj["children"] = [];
          this.selectDataHanlde(obj["children"], item.children);
        }
      });
    },
    // 查询
    async searchScenne(id) {
      const res = await getApiModuleApi(
          {
            tl: "apiReflectionService",
            as: "sys_api_reflectionService",
            dj: "queryOneById",
          },
          {id}
      );
      if (res.status == 200) {
        // source_api_app
        this.ruleForm = res.attribute.main;
        this.formRow[4].elCol[1].show = this.ruleForm.plug == 1;
        if (this.ruleForm["source_api_app"]) {
          this.selectChangeHandle(
              this.ruleForm["source_api_app"],
              1,
              1,
              {
                id: "source_api_app",
              },
              true
          );
        }
        if (this.ruleForm["target_api_app"]) {
          this.selectChangeHandle(
              this.ruleForm["target_api_app"],
              1,
              1,
              {
                id: "target_api_app",
              },
              true
          );
        }
        if (this.ruleForm["source_api_id"]) {
          this.selectChangeHandle(
              this.ruleForm["source_api_id"],
              1,
              1,
              {
                id: "source_api_id",
              },
              res.attribute.details
          );
        }
        if (this.ruleForm["target_api_id"]) {
          this.selectChangeHandle(
              this.ruleForm["target_api_id"],
              1,
              1,
              {
                id: "target_api_id",
              },
              res.attribute.details
          );
        }
        res.attribute.details.forEach((item) => {
          if (item.coordinate) {
            this.linkData.lineData.push(JSON.parse(item.coordinate));
          }
        });
      }
    },
  },
  computed: {
    funWidth() {
      return this.funData.length * 70;
    },
  },
  components: {
    BaseNewForm,
    baseTableForm,
    BaseLink,
  },
  mounted() {
    this.initSysSelect();
    if (this.$route.query.id) {
      this.searchScenne(this.$route.query.id);
      if (this.$route.query.lookFlag) {
        this.lookFlag = true;
      }
    }
  },
};
</script>

<style scoped lang='scss'>
::v-deep .el-checkbox__inner {
  width: 20px;
  height: 20px;
  border-radius: 50% !important;
  text-align: center;
  line-height: 20px;
}

::v-deep .el-checkbox__inner::after {
  border: none !important;
}

.wraap {
  width: 100%;

  .title {
    border-radius: 20px;
    margin-bottom: 10px;
    font-size: 18px;
  }

  .addbox {
    border-radius: 20px;
    background-color: #fff;
    padding: 20px 0;
    border-radius: 18px;
  }

  header {
    border-radius: 20px;

    .top {
      background-color: #fff;
      display: flex;
      justify-content: space-between;

      .right {
        padding: 20px;
      }
    }
  }

  main {
    margin-top: 20px;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    background-color: #fff;
  }

  .add {
    margin-top: 30px;
    border: 1px dotted #ccc;
    text-align: center;
    height: 50px;
    line-height: 50px;
  }

  .chunk {
    margin-top: 10px;
    background-color: #fff;
    padding: 20px;
    width: 100%;
    border-radius: 20px;
    padding-bottom: 50px;

    .link {
      padding: 30px;
      display: flex;
      width: 100%;

      > .left {
        width: 850px;
        min-height: 300px;
      }

      > .right {
        margin-left: 50px;
        width: 30vw;
        overflow: hidden;

        .result {
          margin-top: 30px;
          display: flex;
          justify-content: space-between;

          > .left {
            padding: 0 10px;
          }

          > .right {
            padding: 0 10px;
          }
        }
      }
    }
  }

  footer {
    width: 100%;
    position: fixed;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    background-color: #fff;
    z-index: 2;
    padding: 10px 20px;
    border-radius: 20px;
  }
}
</style>
