1429 lines
54 KiB
Vue
1429 lines
54 KiB
Vue
<script>
|
|
// 实例计费面板:串联升级、自动续费、退款/停用申请及安全验证重试。
|
|
import "~/assets/styles/KkyUpgrade.CkDmxFBM.css";
|
|
import "~/assets/styles/MfCloudUpgrade.N7TNG8F1.css";
|
|
import "~/assets/styles/ConfigBandwidth.CWSH1WJZ.css";
|
|
import "~/assets/styles/MfCloudResourceUpgrade.bSwLWjPg.css";
|
|
import "~/assets/styles/InstanceRenewDialog.BHDAL6d3.css";
|
|
import "~/assets/styles/LegacyProductUpgrade.dzWGwGgY.css";
|
|
import "~/assets/styles/RemfUpgrade.4stQ5ASH.css";
|
|
import "~/assets/styles/GeetestField.DiieTibK.css";
|
|
import "~/assets/styles/CaptchaField.BSN3ZbsD.css";
|
|
import "~/assets/styles/SecurityVerificationDialog.skYFo4v7.css";
|
|
import "~/assets/styles/InstanceBilling.CvIGLT2J.css";
|
|
import { toDisplayString } from "vue";
|
|
import { onMounted } from "vue";
|
|
import { useId } from "vue";
|
|
import { normalizeClass } from "vue";
|
|
import { onBeforeUnmount } from "vue";
|
|
import { watch } from "vue";
|
|
import { createBlock } from "vue";
|
|
import { ref } from "vue";
|
|
import { withCtx } from "vue";
|
|
import { createCommentVNode } from "vue";
|
|
import { computed } from "vue";
|
|
import { reactive } from "vue";
|
|
import { isRef } from "vue";
|
|
import { createElementBlock } from "vue";
|
|
import { Fragment } from "vue";
|
|
import { createElementVNode } from "vue";
|
|
import { createTextVNode } from "vue";
|
|
import { unref } from "vue";
|
|
import { defineComponent } from "vue";
|
|
import { createVNode } from "vue";
|
|
import { openBlock } from "vue";
|
|
import { navigateTo } from "#app";
|
|
import { sanitizeMessage } from "~/lib/auth.js";
|
|
import { useApi } from "~/lib/auth.js";
|
|
import { assertSecurityComplete } from "~/lib/auth.js";
|
|
import { securityChallenge } from "~/lib/auth.js";
|
|
import dialog from "primevue/dialog";
|
|
import button from "primevue/button";
|
|
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
|
|
import message from "primevue/message";
|
|
import { r as dict_r } from "~/lib/dict.js";
|
|
import select from "primevue/select";
|
|
import OperationNotice from "~/components/OperationNotice.vue";
|
|
import textarea from "primevue/textarea";
|
|
import tag from "primevue/tag";
|
|
import toggleswitch from "primevue/toggleswitch";
|
|
import SecurityVerificationDialog from "~/components/SecurityVerificationDialog.vue";
|
|
import RemfUpgrade from "~/components/instance/RemfUpgrade.vue";
|
|
import LegacyProductUpgrade from "~/components/instance/LegacyProductUpgrade.vue";
|
|
import InstanceRenewDialog from "~/components/instance/InstanceRenewDialog.vue";
|
|
import InstanceStatusTag from "~/components/instance/InstanceStatusTag.vue";
|
|
import MfCloudResourceUpgrade from "~/components/mfcloud/MfCloudResourceUpgrade.vue";
|
|
import MfCloudUpgrade from "~/components/mfcloud/MfCloudUpgrade.vue";
|
|
import KkyUpgrade from "~/components/kkyecs/KkyUpgrade.vue";
|
|
var Se = {
|
|
class: `bill`,
|
|
},
|
|
Ce = {
|
|
class: `block`,
|
|
},
|
|
we = {
|
|
class: `info-table`,
|
|
},
|
|
Te = {
|
|
class: `kv`,
|
|
},
|
|
Ee = {
|
|
class: `kv`,
|
|
},
|
|
De = {
|
|
class: `kv`,
|
|
},
|
|
Oe = {
|
|
class: `price`,
|
|
},
|
|
ke = {
|
|
key: 0,
|
|
class: `kv`,
|
|
},
|
|
Ae = {
|
|
class: `kv`,
|
|
},
|
|
je = {
|
|
class: `kv`,
|
|
},
|
|
Me = {
|
|
class: `action-cell`,
|
|
},
|
|
Ne = {
|
|
key: 1,
|
|
class: `kv`,
|
|
},
|
|
Pe = [`for`],
|
|
Fe = {
|
|
class: `auto-renew`,
|
|
},
|
|
Ie = {
|
|
key: 2,
|
|
class: `kv`,
|
|
},
|
|
Le = {
|
|
class: `block-actions`,
|
|
},
|
|
Re = {
|
|
key: 3,
|
|
class: `refund-state`,
|
|
},
|
|
ze = {
|
|
class: `kv`,
|
|
},
|
|
Be = {
|
|
class: `kv`,
|
|
},
|
|
Ve = {
|
|
key: 0,
|
|
class: `kv`,
|
|
},
|
|
He = {
|
|
class: `price`,
|
|
},
|
|
Ue = {
|
|
class: `kv`,
|
|
},
|
|
We = {
|
|
key: 1,
|
|
class: `refund-reject`,
|
|
},
|
|
Ge = {
|
|
key: 1,
|
|
class: `block`,
|
|
},
|
|
Ke = {
|
|
class: `info-table`,
|
|
},
|
|
qe = {
|
|
class: `kv`,
|
|
},
|
|
Je = {
|
|
class: `action-cell`,
|
|
},
|
|
Ye = {
|
|
class: `upgrade-dialog-body`,
|
|
},
|
|
Xe = {
|
|
class: `dlg`,
|
|
},
|
|
Ze = {
|
|
class: `form-row`,
|
|
},
|
|
Qe = [`id`],
|
|
$e = {
|
|
key: 0,
|
|
class: `form-row`,
|
|
},
|
|
et = [`for`],
|
|
tt = {
|
|
key: 1,
|
|
class: `form-row`,
|
|
},
|
|
nt = [`id`],
|
|
S = Object.assign(
|
|
_plugin_vue_export_helper_t(
|
|
defineComponent({
|
|
__name: `InstanceBilling`,
|
|
props: {
|
|
productState: {},
|
|
host: {},
|
|
info: {},
|
|
hostId: {},
|
|
module: {},
|
|
disks: {},
|
|
provisioned: {
|
|
type: Boolean,
|
|
},
|
|
upgradeAllowed: {
|
|
type: Boolean,
|
|
default: !0,
|
|
},
|
|
},
|
|
emits: [`pay`, `refresh`],
|
|
setup(g, { emit: x }) {
|
|
let S = g,
|
|
C = x,
|
|
w = useApi(),
|
|
T = useId(),
|
|
E = ref(``),
|
|
D = ref(``),
|
|
O = !1,
|
|
k = 0,
|
|
A = (e, t) => !O && e === S.hostId && t === k;
|
|
onBeforeUnmount(() => {
|
|
((O = !0), k++);
|
|
});
|
|
let j = ref(!1),
|
|
M = ref(!1),
|
|
N = computed(
|
|
() =>
|
|
S.upgradeAllowed !== !1 &&
|
|
S.host.upgrade_allowed !== !1 &&
|
|
!Number(S.host.change_billing_cycle_id),
|
|
);
|
|
function rt() {
|
|
N.value && S.provisioned && (M.value = !0);
|
|
}
|
|
watch(
|
|
N,
|
|
(e) => {
|
|
e || (M.value = !1);
|
|
},
|
|
{
|
|
flush: `sync`,
|
|
},
|
|
);
|
|
function P(e) {
|
|
((M.value = !1), C(`pay`, e));
|
|
}
|
|
function it() {
|
|
if (Number(S.host.change_billing_cycle_id)) {
|
|
D.value = `请先取消到期转换计划后再续费`;
|
|
return;
|
|
}
|
|
j.value = !0;
|
|
}
|
|
let F = ref(null),
|
|
I = ref(!1),
|
|
L = ref(``),
|
|
R = 0;
|
|
// 自动续费只接受接口明确返回的 0/1,并用请求序号避免旧响应覆盖新设置。
|
|
async function z() {
|
|
let e = S.hostId,
|
|
t = k,
|
|
n = ++R;
|
|
L.value = ``;
|
|
try {
|
|
let r = await w.get(`/host/${e}/renew/auto`);
|
|
if (!A(e, t) || n !== R) return;
|
|
if (r?.status !== 0 && r?.status !== 1)
|
|
throw Error(`自动续费设置响应无效`);
|
|
F.value = r.status;
|
|
} catch (r) {
|
|
if (!A(e, t) || n !== R) return;
|
|
((L.value =
|
|
r instanceof Error ? r.message : `自动续费设置加载失败`),
|
|
(F.value = null));
|
|
}
|
|
}
|
|
async function at(e) {
|
|
if (I.value || F.value === null) return;
|
|
let t = S.hostId,
|
|
n = k;
|
|
R++;
|
|
let r = +!!e;
|
|
((I.value = !0), (E.value = ``), (D.value = ``));
|
|
try {
|
|
if (
|
|
(await w.put(`/host/${t}/renew/auto`, {
|
|
status: r,
|
|
}),
|
|
!A(t, n))
|
|
)
|
|
return;
|
|
F.value = r;
|
|
} catch (e) {
|
|
if (!A(t, n)) return;
|
|
((D.value = e instanceof Error ? e.message : `设置失败`),
|
|
await z());
|
|
} finally {
|
|
A(t, n) && (I.value = !1);
|
|
}
|
|
}
|
|
let ot = {
|
|
Pending: {
|
|
label: `待审核`,
|
|
severity: `warn`,
|
|
},
|
|
Suspending: {
|
|
label: `待停用`,
|
|
severity: `warn`,
|
|
},
|
|
Suspend: {
|
|
label: `停用中`,
|
|
severity: `info`,
|
|
},
|
|
Suspended: {
|
|
label: `已停用`,
|
|
severity: `info`,
|
|
},
|
|
Refund: {
|
|
label: `已退款`,
|
|
severity: `success`,
|
|
},
|
|
Reject: {
|
|
label: `审核驳回`,
|
|
severity: `danger`,
|
|
},
|
|
Cancelled: {
|
|
label: `已取消`,
|
|
severity: `secondary`,
|
|
},
|
|
},
|
|
B = ref(null),
|
|
V = ref(null),
|
|
H = ref(!1),
|
|
U = ref(!1),
|
|
W = ref(!1),
|
|
G = ref(!1),
|
|
st = ref({}),
|
|
K = ref(null),
|
|
q = ref(``),
|
|
J = 0,
|
|
ct = computed(
|
|
() =>
|
|
!U.value &&
|
|
!q.value &&
|
|
[`Pending`, `Suspending`, `Suspend`].includes(
|
|
V.value?.status || ``,
|
|
),
|
|
),
|
|
Y = computed(
|
|
() =>
|
|
!U.value &&
|
|
!q.value &&
|
|
Number(B.value?.allow_refund) === 1 &&
|
|
(!V.value || [`Reject`, `Cancelled`].includes(V.value.status)),
|
|
);
|
|
// 同时读取退款规则和当前申请,决定能否申请、可选原因以及撤销入口。
|
|
async function X() {
|
|
let e = S.hostId,
|
|
t = k,
|
|
n = ++J;
|
|
((U.value = !0), (q.value = ``));
|
|
try {
|
|
let [r, i] = await Promise.all([
|
|
w.get(`/refund`, {
|
|
host_id: e,
|
|
}),
|
|
w.get(`/refund/host/${e}/refund`),
|
|
]);
|
|
if (!A(e, t) || n !== J) return;
|
|
if (!r || !i || !(`refund` in i)) throw Error(`退款信息响应无效`);
|
|
((B.value = r), (V.value = i.refund));
|
|
} catch (r) {
|
|
if (!A(e, t) || n !== J) return;
|
|
((B.value = null),
|
|
(V.value = null),
|
|
(q.value =
|
|
r instanceof Error ? r.message : `退款信息加载失败`));
|
|
} finally {
|
|
A(e, t) && n === J && (U.value = !1);
|
|
}
|
|
}
|
|
let Z = reactive({
|
|
type: `Expire`,
|
|
reasonId: null,
|
|
reasonText: ``,
|
|
});
|
|
function lt() {
|
|
Y.value &&
|
|
!W.value &&
|
|
((Z.type = `Expire`),
|
|
(Z.reasonId = B.value?.reasons?.[0]?.id ?? null),
|
|
(Z.reasonText = ``),
|
|
(E.value = ``),
|
|
(D.value = ``),
|
|
(H.value = !0));
|
|
}
|
|
// 按后台要求提交自定义原因或原因 ID;遇到安全挑战时保留请求等待验证。
|
|
async function ut(e) {
|
|
if (W.value || G.value || !Y.value) return;
|
|
let t = S.hostId,
|
|
n = k,
|
|
r = B.value;
|
|
if (!r) return;
|
|
let i = r.reason_custom
|
|
? Z.reasonText.trim()
|
|
: Z.reasonId
|
|
? [Z.reasonId]
|
|
: null;
|
|
if (!i) {
|
|
E.value = r.reason_custom ? `请填写停用原因` : `请选择停用原因`;
|
|
return;
|
|
}
|
|
((W.value = !0), (E.value = ``), (D.value = ``));
|
|
let a = {
|
|
host_id: t,
|
|
suspend_reason: i,
|
|
type: Z.type,
|
|
...(e || {}),
|
|
};
|
|
try {
|
|
let e = await w.post(`/refund`, a);
|
|
if (!A(t, n)) return;
|
|
(assertSecurityComplete(e),
|
|
(H.value = !1),
|
|
await X(),
|
|
C(`refresh`));
|
|
} catch (e) {
|
|
if (!A(t, n)) return;
|
|
let r = securityChallenge(e);
|
|
if (r) {
|
|
((K.value = {
|
|
host_id: t,
|
|
suspend_reason: i,
|
|
type: a.type,
|
|
}),
|
|
(st.value = r),
|
|
(G.value = !0));
|
|
return;
|
|
}
|
|
D.value = e instanceof Error ? e.message : `提交失败`;
|
|
} finally {
|
|
A(t, n) && (W.value = !1);
|
|
}
|
|
}
|
|
// 将安全验证字段合入原申请重试;再次收到挑战不能视为申请成功。
|
|
async function dt(e) {
|
|
if (!K.value || W.value) return;
|
|
let t = {
|
|
...K.value,
|
|
...e,
|
|
},
|
|
n = S.hostId,
|
|
r = k;
|
|
((W.value = !0), (D.value = ``));
|
|
try {
|
|
let e = await w.post(`/refund`, t);
|
|
if (!A(n, r)) return;
|
|
(assertSecurityComplete(e),
|
|
(K.value = null),
|
|
(G.value = !1),
|
|
(H.value = !1),
|
|
await X(),
|
|
C(`refresh`));
|
|
} catch (e) {
|
|
if (!A(n, r)) return;
|
|
let t = securityChallenge(e);
|
|
t
|
|
? ((st.value = t), (D.value = `安全验证尚未完成,请重试`))
|
|
: (D.value = e instanceof Error ? e.message : `提交失败`);
|
|
} finally {
|
|
A(n, r) && (W.value = !1);
|
|
}
|
|
}
|
|
async function ft() {
|
|
if (!V.value || W.value || !ct.value) return;
|
|
let e = S.hostId,
|
|
t = k;
|
|
((W.value = !0), (E.value = ``), (D.value = ``));
|
|
try {
|
|
if ((await w.put(`/refund/${V.value.id}/cancel`), !A(e, t)))
|
|
return;
|
|
await X();
|
|
} catch (n) {
|
|
if (!A(e, t)) return;
|
|
D.value = n instanceof Error ? n.message : `取消失败`;
|
|
} finally {
|
|
A(e, t) && (W.value = !1);
|
|
}
|
|
}
|
|
let pt = computed(() => ({
|
|
cpu: S.info.cpu,
|
|
memory: S.info.memory,
|
|
bw: S.info.bw,
|
|
protect: S.info.protect,
|
|
}));
|
|
// 实例切换后使旧请求失效,并重新加载该实例的计费、退款与优惠码状态。
|
|
function mt() {
|
|
(k++,
|
|
(F.value = null),
|
|
(I.value = W.value = !1),
|
|
(B.value = V.value = null),
|
|
(H.value = G.value = !1),
|
|
(K.value = null),
|
|
z(),
|
|
X(),
|
|
ht());
|
|
}
|
|
let Q = ref([]),
|
|
$ = ref(``);
|
|
async function ht() {
|
|
let e = S.hostId,
|
|
t = k;
|
|
(($.value = ``), (Q.value = []));
|
|
try {
|
|
let n = await w.get(`/promo_code/host/${e}/promo_code`);
|
|
if (!A(e, t)) return;
|
|
if (!Array.isArray(n?.promo_code))
|
|
throw Error(`优惠信息响应无效`);
|
|
Q.value = n.promo_code.filter((e) => typeof e == `string`);
|
|
} catch (n) {
|
|
A(e, t) &&
|
|
($.value = n instanceof Error ? n.message : `优惠信息加载失败`);
|
|
}
|
|
}
|
|
return (
|
|
onMounted(mt),
|
|
watch(() => S.hostId, mt),
|
|
(t, n) => {
|
|
let i = OperationNotice,
|
|
a = button,
|
|
s = message,
|
|
u = InstanceStatusTag,
|
|
ee = toggleswitch,
|
|
ie = tag,
|
|
y = RemfUpgrade,
|
|
b = LegacyProductUpgrade,
|
|
x = MfCloudResourceUpgrade,
|
|
S = MfCloudUpgrade,
|
|
C = KkyUpgrade,
|
|
w = dialog,
|
|
O = InstanceRenewDialog,
|
|
k = select,
|
|
A = textarea,
|
|
R = SecurityVerificationDialog;
|
|
return (
|
|
openBlock(),
|
|
createElementBlock(`div`, Se, [
|
|
createVNode(
|
|
i,
|
|
{
|
|
message: unref(D),
|
|
severity: `error`,
|
|
},
|
|
null,
|
|
8,
|
|
[`message`],
|
|
),
|
|
createElementVNode(`section`, Ce, [
|
|
(n[23] ||= createElementVNode(
|
|
`h4`,
|
|
{
|
|
class: `block-title`,
|
|
},
|
|
`计费信息`,
|
|
-1,
|
|
)),
|
|
unref(L)
|
|
? (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 0,
|
|
severity: `error`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref(L)) + ` `,
|
|
1,
|
|
),
|
|
createVNode(a, {
|
|
label: `重试自动续费设置`,
|
|
text: ``,
|
|
onClick: z,
|
|
}),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref(q)
|
|
? (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 1,
|
|
severity: `error`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref(q)) + ` `,
|
|
1,
|
|
),
|
|
createVNode(a, {
|
|
label: `重试退款信息`,
|
|
text: ``,
|
|
onClick: X,
|
|
}),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref($)
|
|
? (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 2,
|
|
severity: `error`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref($)) + ` `,
|
|
1,
|
|
),
|
|
createVNode(a, {
|
|
label: `重试优惠信息`,
|
|
text: ``,
|
|
onClick: ht,
|
|
}),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(`div`, we, [
|
|
createElementVNode(`div`, Te, [
|
|
(n[12] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`计费方式`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(
|
|
g.info.billMethodName ||
|
|
g.host.billing_cycle_name ||
|
|
g.host.billing_cycle ||
|
|
`—`,
|
|
),
|
|
1,
|
|
),
|
|
]),
|
|
createElementVNode(`div`, Ee, [
|
|
(n[13] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`产品状态`,
|
|
-1,
|
|
)),
|
|
createVNode(
|
|
u,
|
|
{
|
|
state: g.productState,
|
|
power: g.info.powerStatus,
|
|
lifecycle: g.host.status,
|
|
},
|
|
null,
|
|
8,
|
|
[`state`, `power`, `lifecycle`],
|
|
),
|
|
]),
|
|
createElementVNode(`div`, De, [
|
|
(n[14] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`续费金额`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
Oe,
|
|
`¥` + toDisplayString(g.host.renew_amount),
|
|
1,
|
|
),
|
|
]),
|
|
unref(Q).length
|
|
? (openBlock(),
|
|
createElementBlock(`div`, ke, [
|
|
(n[15] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`已应用优惠码`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(unref(Q).join(`、`)),
|
|
1,
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(`div`, Ae, [
|
|
(n[16] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`开通时间`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(
|
|
(`formatTime` in t ? t.formatTime : unref(dict_r))(
|
|
g.host.active_time,
|
|
),
|
|
),
|
|
1,
|
|
),
|
|
]),
|
|
createElementVNode(`div`, je, [
|
|
(n[17] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`到期时间`,
|
|
-1,
|
|
)),
|
|
createElementVNode(`div`, Me, [
|
|
createTextVNode(
|
|
toDisplayString(
|
|
(`formatTime` in t
|
|
? t.formatTime
|
|
: unref(dict_r))(g.host.due_time),
|
|
),
|
|
1,
|
|
),
|
|
createVNode(a, {
|
|
label: `续费`,
|
|
icon: `pi pi-wallet`,
|
|
onClick: it,
|
|
}),
|
|
]),
|
|
]),
|
|
unref(F) === null
|
|
? createCommentVNode(``, !0)
|
|
: (openBlock(),
|
|
createElementBlock(`div`, Ne, [
|
|
createElementVNode(
|
|
`label`,
|
|
{
|
|
for: `${unref(T)}-auto-renew`,
|
|
},
|
|
`自动续费`,
|
|
8,
|
|
Pe,
|
|
),
|
|
createElementVNode(`div`, Fe, [
|
|
createElementVNode(
|
|
`span`,
|
|
{
|
|
class: normalizeClass([
|
|
`auto-renew-state`,
|
|
{
|
|
on: unref(F) === 1,
|
|
},
|
|
]),
|
|
},
|
|
toDisplayString(
|
|
unref(F) === 1 ? `已开启` : `已关闭`,
|
|
),
|
|
3,
|
|
),
|
|
createVNode(
|
|
ee,
|
|
{
|
|
"input-id": `${unref(T)}-auto-renew`,
|
|
modelValue: unref(F),
|
|
trueValue: 1,
|
|
falseValue: 0,
|
|
disabled: unref(I),
|
|
"onUpdate:modelValue": at,
|
|
},
|
|
null,
|
|
8,
|
|
[`input-id`, `modelValue`, `disabled`],
|
|
),
|
|
]),
|
|
])),
|
|
unref(ct) || unref(Y)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Ie, [
|
|
(n[18] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`退款`,
|
|
-1,
|
|
)),
|
|
createElementVNode(`div`, Le, [
|
|
unref(ct)
|
|
? (openBlock(),
|
|
createBlock(
|
|
a,
|
|
{
|
|
key: 0,
|
|
label: `取消退款申请`,
|
|
icon: `pi pi-times`,
|
|
size: `small`,
|
|
severity: `secondary`,
|
|
outlined: ``,
|
|
loading: unref(W),
|
|
onClick: ft,
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`],
|
|
))
|
|
: unref(Y)
|
|
? (openBlock(),
|
|
createBlock(a, {
|
|
key: 1,
|
|
label: `申请退款`,
|
|
icon: `pi pi-undo`,
|
|
size: `small`,
|
|
severity: `secondary`,
|
|
outlined: ``,
|
|
onClick: lt,
|
|
}))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
unref(V)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Re, [
|
|
createElementVNode(`div`, ze, [
|
|
(n[19] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`退款状态`,
|
|
-1,
|
|
)),
|
|
createVNode(
|
|
ie,
|
|
{
|
|
value:
|
|
ot[unref(V).status]?.label ?? unref(V).status,
|
|
severity:
|
|
ot[unref(V).status]?.severity ?? `secondary`,
|
|
},
|
|
null,
|
|
8,
|
|
[`value`, `severity`],
|
|
),
|
|
]),
|
|
createElementVNode(`div`, Be, [
|
|
(n[20] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`退款方式`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(
|
|
unref(V).type === `Immediate`
|
|
? `立即退款`
|
|
: `到期退款`,
|
|
),
|
|
1,
|
|
),
|
|
]),
|
|
Number(unref(V).amount) >= 0
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Ve, [
|
|
(n[21] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`退款金额`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
He,
|
|
`¥` + toDisplayString(unref(V).amount),
|
|
1,
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(`div`, Ue, [
|
|
(n[22] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`申请时间`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(
|
|
(`formatTime` in t
|
|
? t.formatTime
|
|
: unref(dict_r))(unref(V).create_time),
|
|
),
|
|
1,
|
|
),
|
|
]),
|
|
unref(V).reject_reason
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
We,
|
|
`驳回原因:` +
|
|
toDisplayString(
|
|
unref(sanitizeMessage)(
|
|
unref(V).reject_reason,
|
|
),
|
|
),
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
unref(N)
|
|
? createCommentVNode(``, !0)
|
|
: (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 0,
|
|
severity: `info`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(
|
|
unref(sanitizeMessage)(
|
|
g.host.upgrade_block_reason ||
|
|
`此实例暂不支持配置升降级。`,
|
|
),
|
|
),
|
|
1,
|
|
),
|
|
]),
|
|
_: 1,
|
|
},
|
|
)),
|
|
unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`section`, Ge, [
|
|
(n[29] ||= createElementVNode(
|
|
`h4`,
|
|
{
|
|
class: `block-title`,
|
|
},
|
|
`升降级`,
|
|
-1,
|
|
)),
|
|
createElementVNode(`div`, Ke, [
|
|
createElementVNode(`div`, qe, [
|
|
(n[25] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`配置调整`,
|
|
-1,
|
|
)),
|
|
createElementVNode(`div`, Je, [
|
|
(n[24] ||= createElementVNode(
|
|
`p`,
|
|
{
|
|
class: `upgrade-desc`,
|
|
},
|
|
`调整实例的计算资源、网络或套餐配置。`,
|
|
-1,
|
|
)),
|
|
createVNode(
|
|
a,
|
|
{
|
|
label: `升降级`,
|
|
icon: `pi pi-sliders-h`,
|
|
disabled: !g.provisioned,
|
|
onClick: rt,
|
|
},
|
|
null,
|
|
8,
|
|
[`disabled`],
|
|
),
|
|
]),
|
|
]),
|
|
]),
|
|
createVNode(
|
|
w,
|
|
{
|
|
visible: unref(M),
|
|
"onUpdate:visible": (n[1] ||= (e) =>
|
|
isRef(M) ? (M.value = e) : null),
|
|
header: `升降级`,
|
|
modal: ``,
|
|
style: {
|
|
width: `1080px`,
|
|
maxWidth: `calc(100vw - 32px)`,
|
|
},
|
|
draggable: !1,
|
|
class: `upgrade-dialog`,
|
|
},
|
|
{
|
|
footer: withCtx(() => [
|
|
createVNode(a, {
|
|
label: `关闭`,
|
|
severity: `secondary`,
|
|
outlined: ``,
|
|
onClick: (n[0] ||= (e) => (M.value = !1)),
|
|
}),
|
|
]),
|
|
default: withCtx(() => [
|
|
createElementVNode(`div`, Ye, [
|
|
createVNode(
|
|
s,
|
|
{
|
|
severity: `info`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(n[26] ||= [
|
|
createElementVNode(
|
|
`strong`,
|
|
null,
|
|
`升降级配置计费说明`,
|
|
-1,
|
|
),
|
|
createElementVNode(
|
|
`p`,
|
|
null,
|
|
`选择新的资源配置后,系统将按当前计费周期计算差价。确认配置与费用后提交订单,支付完成后生效。`,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
createVNode(
|
|
s,
|
|
{
|
|
severity: `warn`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(n[27] ||= [
|
|
createTextVNode(
|
|
`配置变更可能重启实例,请提前保存工作并备份重要数据。`,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
g.provisioned
|
|
? g.module === `remf_finance`
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 1,
|
|
},
|
|
[
|
|
createVNode(
|
|
y,
|
|
{
|
|
"host-id": g.hostId,
|
|
"upgrade-allowed": unref(N),
|
|
onPay: P,
|
|
},
|
|
null,
|
|
8,
|
|
[`host-id`, `upgrade-allowed`],
|
|
),
|
|
createVNode(
|
|
b,
|
|
{
|
|
"host-id": g.hostId,
|
|
module: `remf_finance`,
|
|
"upgrade-allowed": unref(N),
|
|
onPay: P,
|
|
},
|
|
null,
|
|
8,
|
|
[`host-id`, `upgrade-allowed`],
|
|
),
|
|
],
|
|
64,
|
|
))
|
|
: g.module === `mf_cloud` ||
|
|
g.module === `remf_cloud`
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 2,
|
|
},
|
|
[
|
|
g.info.raw.recommend_config?.id
|
|
? (openBlock(),
|
|
createBlock(
|
|
S,
|
|
{
|
|
key: 1,
|
|
module: g.module,
|
|
"host-id": g.hostId,
|
|
current: g.info.raw,
|
|
"upgrade-allowed": unref(N),
|
|
onPay: P,
|
|
},
|
|
null,
|
|
8,
|
|
[
|
|
`module`,
|
|
`host-id`,
|
|
`current`,
|
|
`upgrade-allowed`,
|
|
],
|
|
))
|
|
: (openBlock(),
|
|
createBlock(
|
|
x,
|
|
{
|
|
key: 0,
|
|
module: g.module,
|
|
"host-id": g.hostId,
|
|
"product-id":
|
|
g.host.product_id,
|
|
current: g.info.raw,
|
|
"upgrade-allowed": unref(N),
|
|
onPay: P,
|
|
},
|
|
null,
|
|
8,
|
|
[
|
|
`module`,
|
|
`host-id`,
|
|
`product-id`,
|
|
`current`,
|
|
`upgrade-allowed`,
|
|
],
|
|
)),
|
|
],
|
|
64,
|
|
))
|
|
: (openBlock(),
|
|
createBlock(
|
|
C,
|
|
{
|
|
key: 3,
|
|
"host-id": g.hostId,
|
|
disks: g.disks,
|
|
current: unref(pt),
|
|
"upgrade-allowed": unref(N),
|
|
onPay: P,
|
|
},
|
|
null,
|
|
8,
|
|
[
|
|
`host-id`,
|
|
`disks`,
|
|
`current`,
|
|
`upgrade-allowed`,
|
|
],
|
|
))
|
|
: (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 0,
|
|
severity: `info`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(n[28] ||= [
|
|
createTextVNode(
|
|
`实例尚未开通,暂不能升降级。`,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
)),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[`visible`],
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
createVNode(
|
|
O,
|
|
{
|
|
modelValue: unref(j),
|
|
"onUpdate:modelValue": (n[2] ||= (e) =>
|
|
isRef(j) ? (j.value = e) : null),
|
|
"host-id": g.hostId,
|
|
onPaid: (n[3] ||= (e) =>
|
|
(`navigateTo` in t ? t.navigateTo : unref(navigateTo))(
|
|
`/orders`,
|
|
)),
|
|
},
|
|
null,
|
|
8,
|
|
[`modelValue`, `host-id`],
|
|
),
|
|
createVNode(
|
|
w,
|
|
{
|
|
visible: unref(H),
|
|
"onUpdate:visible": (n[9] ||= (e) =>
|
|
isRef(H) ? (H.value = e) : null),
|
|
header: `申请退款`,
|
|
modal: ``,
|
|
draggable: !1,
|
|
style: {
|
|
width: `520px`,
|
|
},
|
|
},
|
|
{
|
|
footer: withCtx(() => [
|
|
createVNode(a, {
|
|
label: `取消`,
|
|
severity: `secondary`,
|
|
text: ``,
|
|
onClick: (n[7] ||= (e) => (H.value = !1)),
|
|
}),
|
|
createVNode(
|
|
a,
|
|
{
|
|
label: `提交申请`,
|
|
loading: unref(W),
|
|
onClick: (n[8] ||= () => ut()),
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`],
|
|
),
|
|
]),
|
|
default: withCtx(() => [
|
|
createElementVNode(`div`, Xe, [
|
|
createVNode(
|
|
s,
|
|
{
|
|
severity: `warn`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(n[30] ||= [
|
|
createTextVNode(
|
|
` 提交后实例将按所选方式停用并申请退款,审核通过前可在计费页撤销。 `,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
createElementVNode(`div`, Ze, [
|
|
createElementVNode(
|
|
`span`,
|
|
{
|
|
id: `${unref(T)}-refund-type-label`,
|
|
class: `form-label`,
|
|
},
|
|
`停用方式`,
|
|
8,
|
|
Qe,
|
|
),
|
|
createVNode(
|
|
k,
|
|
{
|
|
"input-id": `${unref(T)}-refund-type`,
|
|
"aria-labelledby": `${unref(T)}-refund-type-label`,
|
|
modelValue: unref(Z).type,
|
|
"onUpdate:modelValue": (n[4] ||= (e) =>
|
|
(unref(Z).type = e)),
|
|
disabled: unref(W) || unref(G),
|
|
options: [
|
|
{
|
|
label: `到期退款(到期后停用)`,
|
|
value: `Expire`,
|
|
},
|
|
{
|
|
label: `立即退款(审核通过后立即停用)`,
|
|
value: `Immediate`,
|
|
},
|
|
],
|
|
optionLabel: `label`,
|
|
optionValue: `value`,
|
|
class: `grow`,
|
|
},
|
|
null,
|
|
8,
|
|
[
|
|
`input-id`,
|
|
`aria-labelledby`,
|
|
`modelValue`,
|
|
`disabled`,
|
|
],
|
|
),
|
|
]),
|
|
unref(B)?.reason_custom
|
|
? (openBlock(),
|
|
createElementBlock(`div`, $e, [
|
|
createElementVNode(
|
|
`label`,
|
|
{
|
|
for: `${unref(T)}-refund-reason`,
|
|
},
|
|
`停用原因`,
|
|
8,
|
|
et,
|
|
),
|
|
createVNode(
|
|
A,
|
|
{
|
|
id: `${unref(T)}-refund-reason`,
|
|
modelValue: unref(Z).reasonText,
|
|
"onUpdate:modelValue": (n[5] ||= (e) =>
|
|
(unref(Z).reasonText = e)),
|
|
disabled: unref(W) || unref(G),
|
|
rows: `3`,
|
|
placeholder: `请说明停用原因`,
|
|
autoResize: ``,
|
|
class: `grow`,
|
|
},
|
|
null,
|
|
8,
|
|
[`id`, `modelValue`, `disabled`],
|
|
),
|
|
]))
|
|
: (openBlock(),
|
|
createElementBlock(`div`, tt, [
|
|
createElementVNode(
|
|
`span`,
|
|
{
|
|
id: `${unref(T)}-refund-reason-label`,
|
|
class: `form-label`,
|
|
},
|
|
`停用原因`,
|
|
8,
|
|
nt,
|
|
),
|
|
createVNode(
|
|
k,
|
|
{
|
|
"input-id": `${unref(T)}-refund-reason`,
|
|
"aria-labelledby": `${unref(T)}-refund-reason-label`,
|
|
modelValue: unref(Z).reasonId,
|
|
"onUpdate:modelValue": (n[6] ||= (e) =>
|
|
(unref(Z).reasonId = e)),
|
|
disabled: unref(W) || unref(G),
|
|
options: unref(B)?.reasons ?? [],
|
|
optionLabel: `content`,
|
|
optionValue: `id`,
|
|
placeholder: `请选择停用原因`,
|
|
class: `grow`,
|
|
},
|
|
null,
|
|
8,
|
|
[
|
|
`input-id`,
|
|
`aria-labelledby`,
|
|
`modelValue`,
|
|
`disabled`,
|
|
`options`,
|
|
],
|
|
),
|
|
])),
|
|
unref(E)
|
|
? (openBlock(),
|
|
createBlock(
|
|
s,
|
|
{
|
|
key: 2,
|
|
severity: `error`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref(E)),
|
|
1,
|
|
),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[`visible`],
|
|
),
|
|
createVNode(
|
|
R,
|
|
{
|
|
visible: unref(G),
|
|
"onUpdate:visible": (n[10] ||= (e) =>
|
|
isRef(G) ? (G.value = e) : null),
|
|
challenge: unref(st),
|
|
busy: unref(W),
|
|
"request-error": unref(D),
|
|
context: {
|
|
scene: `account`,
|
|
action: `host_refund`,
|
|
},
|
|
onVerified: dt,
|
|
onCancel: (n[11] ||= (e) => (K.value = null)),
|
|
},
|
|
null,
|
|
8,
|
|
[`visible`, `challenge`, `busy`, `request-error`],
|
|
),
|
|
])
|
|
);
|
|
}
|
|
);
|
|
},
|
|
}),
|
|
[[`__scopeId`, `data-v-4e83e0f6`]],
|
|
),
|
|
{
|
|
__name: `InstanceBilling`,
|
|
},
|
|
);
|
|
export {};
|
|
export default S;
|
|
</script>
|