JD ACE VMS - vms.jd.com

12/7/2020, 6:06:10 PM

07.12.2020 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        JD ACE VMS - vms.jd.com
// @namespace   Violentmonkey Scripts
// @match       http://vms.jd.com/Integration/Apply
// @grant       none
// @version     1.0
// @author      tinymins
// @description 12/7/2020, 6:06:10 PM
// ==/UserScript==

$('#jacp_card_id').after('<button style="margin: 5px; height: 30px; transform: translateY(2px);">ACE</button>').next().click(() => {
  $("#apply_type").val(4).change();
  const d = new Date();
  d.setTime(d.getTime() + 86400e3 * 30);
  $("#expect_online_date").val(
    [d.getFullYear(), d.getMonth() + 1, d.getDate()]
      .map((a) => (a < 10 ? "0" + a : a))
      .join("-")
  );
  $("#version_server").val("0");
  $("#test_content").val("无");
  $("#module_id").val("73").change();
  $("#self_test").val(0);
  $("#modification_explanation").val("无");
  $("#affect_range").val("无");
  $('[name="degrade_switch_apply"][value="0"]+ins').click();
  $('[name="pressure_test"][value="0"]+ins').click();
  $("#interface_name").val("无");
  $("#test_data").val("无");
  $("#test_address").val("http://beta-ace.jd.com/launch/");
  $("#review_result").val(1).change();
  $("#request-memo").val("无");
  const fetch = (url) => {
    const a = new XMLHttpRequest();
    a.open("GET", url, !1);
    a.withCredentials = !0;
    a.send();
    return a.responseText;
  };
  const fix_erp_tags = async (id, erp) => {
    const data = await $.ajax(
      "http://vms.jd.com/user/get_user_base_info?keyword=" + erp
    ).then((a) => a.info.data.find(({ user_name }) => user_name === erp));
    $(
      `<input id="${id}-hide" type="hidden" value="${JSON.stringify([
        data,
      ]).replace(/"/g, "&quot;")}" />`
    ).insertAfter($("#" + id));
    query_erp("#" + id);
  };
  const card = JSON.parse(
    fetch(
      "http://jagile.jd.com/jacp/api/v1/bizSpaceCard/cardDetail?id=" +
        jacp_card_dom.val()
    )
  );
  const roles = JSON.parse(
    fetch(
      "http://jagile.jd.com/jacp/api/v1/bizConfig/space/kv/" + card.data.spaceId
    )
  ).data.reduce((a, b) => {
    if ((b.name + b.group + "").match(/测试/)) a[b.code] = 1;
    return a;
  }, {});
  fix_erp_tags("code-review-operator", "bihuiting");
  fix_erp_tags("product-operator", card.data.creator.erp);
  fix_erp_tags(
    "test-operator",
    (
      card.data.personHours.find((a) => roles[a.roleCode]) || {
        erp: "leixuepei",
      }
    ).erp
  );
})