Files
jczxw-pc/.output/server/chunks/build/index-BpW8YK7f.mjs
赵忠林 528fe28ffc feat(api): 添加多路由代理处理实现
- 新增api目录下多个接口路径代理处理文件,支持动态拼接目标URL
- 根据环境变量选择不同的后端服务地址(如dev和生产环境)
- 统一添加TenantId和Authorization请求头传递租户及身份信息
- 实现请求参数及搜索参数的完整转发
- 引入better-sqlite3及node内建模块支持服务端功能
- 新增专家详情页面,实现文章、成果及预约咨询功能展示
- 页面实现加载骨架屏、标签页切换及空状态提示优化体验
2026-04-28 13:50:27 +08:00

1760 lines
98 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { a as _export_sfc, c as useHead, n as navigateTo } from './server.mjs';
import { defineComponent, computed, ref, reactive, resolveComponent, mergeProps, unref, withCtx, createTextVNode, createVNode, createBlock, openBlock, toDisplayString, Fragment, renderList, withDirectives, vShow, createCommentVNode, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderStyle } from 'vue/server-renderer';
import { message } from 'ant-design-vue';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import 'better-sqlite3';
import 'vue-router';
import '@babel/runtime/helpers/esm/extends';
import 'stylis';
import 'dayjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
__ssrInlineRender: true,
setup(__props) {
useHead({ title: "个人中心 - 决策咨询网" });
const isAuthed = computed(() => false);
const activeTab = ref("info");
const editing = ref(false);
const saving = ref(false);
const showChangePwd = ref(false);
const sideMenuItems = [
{ key: "info", label: "基本信息", icon: "👤" },
{ key: "suggestions", label: "我的建言", icon: "💬" },
{ key: "favorites", label: "我的收藏", icon: "⭐" },
{ key: "history", label: "浏览历史", icon: "📖" }
];
const userInfo = reactive({
nickname: "用户",
username: "",
avatar: "",
isAdmin: false,
phone: "",
email: "",
organization: "",
bio: ""
});
const editForm = reactive({
nickname: "",
phone: "",
email: "",
organization: "",
bio: ""
});
const pwdForm = reactive({
oldPwd: "",
newPwd: "",
confirmPwd: ""
});
const stats = reactive({
suggestions: 0,
favorites: 0,
views: 0
});
const mySuggestions = ref([]);
function getStatusColor(status) {
const map = { pending: "orange", processing: "blue", done: "green", rejected: "red" };
return map[status] || "default";
}
function getStatusText(status) {
const map = { pending: "待处理", processing: "处理中", done: "已处理", rejected: "已关闭" };
return map[status] || status;
}
function beforeUpload() {
return false;
}
function handleAvatarChange() {
}
async function saveInfo() {
saving.value = true;
try {
message.success("保存成功");
editing.value = false;
} catch (e) {
message.error(e?.message || "保存失败");
} finally {
saving.value = false;
}
}
async function handleChangePwd() {
if (pwdForm.newPwd !== pwdForm.confirmPwd) {
message.error("两次密码不一致");
return;
}
saving.value = true;
try {
message.success("密码修改成功,请重新登录");
showChangePwd.value = false;
} catch (e) {
message.error(e?.message || "修改失败");
} finally {
saving.value = false;
}
}
function clearHistory() {
message.info("已清空浏览历史");
}
return (_ctx, _push, _parent, _attrs) => {
const _component_a_result = resolveComponent("a-result");
const _component_a_button = resolveComponent("a-button");
const _component_a_row = resolveComponent("a-row");
const _component_a_col = resolveComponent("a-col");
const _component_a_upload = resolveComponent("a-upload");
const _component_a_tag = resolveComponent("a-tag");
const _component_a_space = resolveComponent("a-space");
const _component_a_form = resolveComponent("a-form");
const _component_a_form_item = resolveComponent("a-form-item");
const _component_a_input = resolveComponent("a-input");
const _component_a_textarea = resolveComponent("a-textarea");
const _component_a_empty = resolveComponent("a-empty");
const _component_a_modal = resolveComponent("a-modal");
const _component_a_input_password = resolveComponent("a-input-password");
_push(`<div${ssrRenderAttrs(mergeProps({ class: "profile-page" }, _attrs))} data-v-7f4a0583><div class="mx-auto max-w-screen-xl px-4 py-8" data-v-7f4a0583>`);
if (!unref(isAuthed)) {
_push(`<div class="not-authed" data-v-7f4a0583>`);
_push(ssrRenderComponent(_component_a_result, {
status: "403",
title: "请先登录",
"sub-title": "登录后可查看和编辑个人信息"
}, {
extra: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_button, {
type: "primary",
size: "large",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/login")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`去登录`);
} else {
return [
createTextVNode("去登录")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_button, {
type: "primary",
size: "large",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/login")
}, {
default: withCtx(() => [
createTextVNode("去登录")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<div data-v-7f4a0583>`);
_push(ssrRenderComponent(_component_a_row, { gutter: [32, 24] }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_col, {
xs: 24,
lg: 7
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="profile-card" data-v-7f4a0583${_scopeId2}><div class="avatar-section" data-v-7f4a0583${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_upload, {
name: "avatar",
"list-type": "picture-circle",
class: "avatar-uploader",
"show-upload-list": false,
"before-upload": beforeUpload,
onChange: handleAvatarChange
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div class="avatar-wrap" data-v-7f4a0583${_scopeId3}>`);
if (unref(userInfo).avatar) {
_push4(`<img${ssrRenderAttr("src", unref(userInfo).avatar)} alt="avatar" class="avatar-img" data-v-7f4a0583${_scopeId3}>`);
} else {
_push4(`<div class="avatar-placeholder" data-v-7f4a0583${_scopeId3}>${ssrInterpolate(unref(userInfo).nickname?.charAt(0) || "用")}</div>`);
}
_push4(`<div class="avatar-overlay" data-v-7f4a0583${_scopeId3}><span data-v-7f4a0583${_scopeId3}>更换头像</span></div></div>`);
} else {
return [
createVNode("div", { class: "avatar-wrap" }, [
unref(userInfo).avatar ? (openBlock(), createBlock("img", {
key: 0,
src: unref(userInfo).avatar,
alt: "avatar",
class: "avatar-img"
}, null, 8, ["src"])) : (openBlock(), createBlock("div", {
key: 1,
class: "avatar-placeholder"
}, toDisplayString(unref(userInfo).nickname?.charAt(0) || "用"), 1)),
createVNode("div", { class: "avatar-overlay" }, [
createVNode("span", null, "更换头像")
])
])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div><h2 class="user-name" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(unref(userInfo).nickname || unref(userInfo).username || "用户")}</h2><div class="user-role" data-v-7f4a0583${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_tag, {
color: unref(userInfo).isAdmin ? "red" : "blue"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(unref(userInfo).isAdmin ? "管理员" : "普通用户")}`);
} else {
return [
createTextVNode(toDisplayString(unref(userInfo).isAdmin ? "管理员" : "普通用户"), 1)
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div><div class="user-stats" data-v-7f4a0583${_scopeId2}><div class="stat-item" data-v-7f4a0583${_scopeId2}><div class="stat-num" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(unref(stats).suggestions)}</div><div class="stat-label" data-v-7f4a0583${_scopeId2}>建言</div></div><div class="stat-item" data-v-7f4a0583${_scopeId2}><div class="stat-num" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(unref(stats).favorites)}</div><div class="stat-label" data-v-7f4a0583${_scopeId2}>收藏</div></div><div class="stat-item" data-v-7f4a0583${_scopeId2}><div class="stat-num" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(unref(stats).views)}</div><div class="stat-label" data-v-7f4a0583${_scopeId2}>浏览</div></div></div><div class="side-menu" data-v-7f4a0583${_scopeId2}><!--[-->`);
ssrRenderList(sideMenuItems, (item) => {
_push3(`<div class="${ssrRenderClass([{ active: unref(activeTab) === item.key }, "side-menu-item"])}" data-v-7f4a0583${_scopeId2}><span class="menu-icon" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.icon)}</span><span data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.label)}</span></div>`);
});
_push3(`<!--]--></div></div>`);
} else {
return [
createVNode("div", { class: "profile-card" }, [
createVNode("div", { class: "avatar-section" }, [
createVNode(_component_a_upload, {
name: "avatar",
"list-type": "picture-circle",
class: "avatar-uploader",
"show-upload-list": false,
"before-upload": beforeUpload,
onChange: handleAvatarChange
}, {
default: withCtx(() => [
createVNode("div", { class: "avatar-wrap" }, [
unref(userInfo).avatar ? (openBlock(), createBlock("img", {
key: 0,
src: unref(userInfo).avatar,
alt: "avatar",
class: "avatar-img"
}, null, 8, ["src"])) : (openBlock(), createBlock("div", {
key: 1,
class: "avatar-placeholder"
}, toDisplayString(unref(userInfo).nickname?.charAt(0) || "用"), 1)),
createVNode("div", { class: "avatar-overlay" }, [
createVNode("span", null, "更换头像")
])
])
]),
_: 1
})
]),
createVNode("h2", { class: "user-name" }, toDisplayString(unref(userInfo).nickname || unref(userInfo).username || "用户"), 1),
createVNode("div", { class: "user-role" }, [
createVNode(_component_a_tag, {
color: unref(userInfo).isAdmin ? "red" : "blue"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(userInfo).isAdmin ? "管理员" : "普通用户"), 1)
]),
_: 1
}, 8, ["color"])
]),
createVNode("div", { class: "user-stats" }, [
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).suggestions), 1),
createVNode("div", { class: "stat-label" }, "建言")
]),
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).favorites), 1),
createVNode("div", { class: "stat-label" }, "收藏")
]),
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).views), 1),
createVNode("div", { class: "stat-label" }, "浏览")
])
]),
createVNode("div", { class: "side-menu" }, [
(openBlock(), createBlock(Fragment, null, renderList(sideMenuItems, (item) => {
return createVNode("div", {
key: item.key,
class: ["side-menu-item", { active: unref(activeTab) === item.key }],
onClick: ($event) => activeTab.value = item.key
}, [
createVNode("span", { class: "menu-icon" }, toDisplayString(item.icon), 1),
createVNode("span", null, toDisplayString(item.label), 1)
], 10, ["onClick"]);
}), 64))
])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_col, {
xs: 24,
lg: 17
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="content-panel" style="${ssrRenderStyle(unref(activeTab) === "info" ? null : { display: "none" })}" data-v-7f4a0583${_scopeId2}><div class="panel-header" data-v-7f4a0583${_scopeId2}><h3 data-v-7f4a0583${_scopeId2}>基本信息</h3>`);
if (!unref(editing)) {
_push3(ssrRenderComponent(_component_a_button, {
type: "primary",
onClick: ($event) => editing.value = true
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`编辑资料`);
} else {
return [
createTextVNode("编辑资料")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
_push3(ssrRenderComponent(_component_a_space, null, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_button, {
onClick: ($event) => editing.value = false
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`取消`);
} else {
return [
createTextVNode("取消")
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_button, {
type: "primary",
loading: unref(saving),
onClick: saveInfo
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`保存`);
} else {
return [
createTextVNode("保存")
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_button, {
onClick: ($event) => editing.value = false
}, {
default: withCtx(() => [
createTextVNode("取消")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
type: "primary",
loading: unref(saving),
onClick: saveInfo
}, {
default: withCtx(() => [
createTextVNode("保存")
]),
_: 1
}, 8, ["loading"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
}
_push3(`</div>`);
_push3(ssrRenderComponent(_component_a_form, {
model: unref(editForm),
layout: "vertical",
class: "info-form"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_row, { gutter: 16 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_form_item, { label: "昵称" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_form_item, { label: "昵称" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_form_item, { label: "手机号" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_form_item, { label: "手机号" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_form_item, { label: "工作单位" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_form_item, { label: "工作单位" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_col, { span: 24 }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_form_item, { label: "个人简介" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_form_item, { label: "个人简介" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "昵称" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "手机号" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "工作单位" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 24 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "个人简介" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "昵称" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "手机号" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "工作单位" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 24 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "个人简介" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`<div class="security-section" data-v-7f4a0583${_scopeId2}><h4 data-v-7f4a0583${_scopeId2}>账号安全</h4><div class="security-items" data-v-7f4a0583${_scopeId2}><div class="security-item" data-v-7f4a0583${_scopeId2}><div class="security-info" data-v-7f4a0583${_scopeId2}><span class="security-icon" data-v-7f4a0583${_scopeId2}>🔒</span><div data-v-7f4a0583${_scopeId2}><div class="security-name" data-v-7f4a0583${_scopeId2}>登录密码</div><div class="security-desc" data-v-7f4a0583${_scopeId2}>建议定期修改密码保护账户安全</div></div></div>`);
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => showChangePwd.value = true
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`修改`);
} else {
return [
createTextVNode("修改")
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div><div class="security-item" data-v-7f4a0583${_scopeId2}><div class="security-info" data-v-7f4a0583${_scopeId2}><span class="security-icon" data-v-7f4a0583${_scopeId2}>📱</span><div data-v-7f4a0583${_scopeId2}><div class="security-name" data-v-7f4a0583${_scopeId2}>绑定手机</div><div class="security-desc" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(unref(editForm).phone ? `已绑定 ${unref(editForm).phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}` : "未绑定手机号")}</div></div></div>`);
_push3(ssrRenderComponent(_component_a_button, { size: "small" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(unref(editForm).phone ? "修改" : "绑定")}`);
} else {
return [
createTextVNode(toDisplayString(unref(editForm).phone ? "修改" : "绑定"), 1)
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div></div></div></div><div class="content-panel" style="${ssrRenderStyle(unref(activeTab) === "suggestions" ? null : { display: "none" })}" data-v-7f4a0583${_scopeId2}><div class="panel-header" data-v-7f4a0583${_scopeId2}><h3 data-v-7f4a0583${_scopeId2}>我的建言</h3>`);
_push3(ssrRenderComponent(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`提交新建言`);
} else {
return [
createTextVNode("提交新建言")
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div>`);
if (unref(mySuggestions).length === 0) {
_push3(`<div class="empty-state" data-v-7f4a0583${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_empty, { description: "暂无建言记录" }, {
extra: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`立即建言`);
} else {
return [
createTextVNode("立即建言")
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx(() => [
createTextVNode("立即建言")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div>`);
} else {
_push3(`<!---->`);
}
_push3(`<div class="suggestion-list" data-v-7f4a0583${_scopeId2}><!--[-->`);
ssrRenderList(unref(mySuggestions), (item) => {
_push3(`<div class="suggestion-item" data-v-7f4a0583${_scopeId2}><div class="suggestion-header" data-v-7f4a0583${_scopeId2}><span class="suggestion-title" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.title)}</span>`);
_push3(ssrRenderComponent(_component_a_tag, {
color: getStatusColor(item.status)
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(getStatusText(item.status))}`);
} else {
return [
createTextVNode(toDisplayString(getStatusText(item.status)), 1)
];
}
}),
_: 2
}, _parent3, _scopeId2));
_push3(`</div><p class="suggestion-content" data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.content)}</p><div class="suggestion-meta" data-v-7f4a0583${_scopeId2}><span data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.createTime)}</span>`);
if (item.reply) {
_push3(`<span class="has-reply" data-v-7f4a0583${_scopeId2}>已回复</span>`);
} else {
_push3(`<!---->`);
}
_push3(`</div>`);
if (item.reply) {
_push3(`<div class="suggestion-reply" data-v-7f4a0583${_scopeId2}><span class="reply-label" data-v-7f4a0583${_scopeId2}>官方回复:</span><span data-v-7f4a0583${_scopeId2}>${ssrInterpolate(item.reply)}</span></div>`);
} else {
_push3(`<!---->`);
}
_push3(`</div>`);
});
_push3(`<!--]--></div></div><div class="content-panel" style="${ssrRenderStyle(unref(activeTab) === "favorites" ? null : { display: "none" })}" data-v-7f4a0583${_scopeId2}><div class="panel-header" data-v-7f4a0583${_scopeId2}><h3 data-v-7f4a0583${_scopeId2}>我的收藏</h3></div>`);
_push3(ssrRenderComponent(_component_a_empty, {
description: "暂无收藏内容",
style: { "padding": "60px 0" }
}, null, _parent3, _scopeId2));
_push3(`</div><div class="content-panel" style="${ssrRenderStyle(unref(activeTab) === "history" ? null : { display: "none" })}" data-v-7f4a0583${_scopeId2}><div class="panel-header" data-v-7f4a0583${_scopeId2}><h3 data-v-7f4a0583${_scopeId2}>浏览历史</h3>`);
_push3(ssrRenderComponent(_component_a_button, { onClick: clearHistory }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`清空历史`);
} else {
return [
createTextVNode("清空历史")
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div>`);
_push3(ssrRenderComponent(_component_a_empty, {
description: "暂无浏览记录",
style: { "padding": "60px 0" }
}, null, _parent3, _scopeId2));
_push3(`</div>`);
} else {
return [
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "基本信息"),
!unref(editing) ? (openBlock(), createBlock(_component_a_button, {
key: 0,
type: "primary",
onClick: ($event) => editing.value = true
}, {
default: withCtx(() => [
createTextVNode("编辑资料")
]),
_: 1
}, 8, ["onClick"])) : (openBlock(), createBlock(_component_a_space, { key: 1 }, {
default: withCtx(() => [
createVNode(_component_a_button, {
onClick: ($event) => editing.value = false
}, {
default: withCtx(() => [
createTextVNode("取消")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
type: "primary",
loading: unref(saving),
onClick: saveInfo
}, {
default: withCtx(() => [
createTextVNode("保存")
]),
_: 1
}, 8, ["loading"])
]),
_: 1
}))
]),
createVNode(_component_a_form, {
model: unref(editForm),
layout: "vertical",
class: "info-form"
}, {
default: withCtx(() => [
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "昵称" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "手机号" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "工作单位" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 24 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "个人简介" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}, 8, ["model"]),
createVNode("div", { class: "security-section" }, [
createVNode("h4", null, "账号安全"),
createVNode("div", { class: "security-items" }, [
createVNode("div", { class: "security-item" }, [
createVNode("div", { class: "security-info" }, [
createVNode("span", { class: "security-icon" }, "🔒"),
createVNode("div", null, [
createVNode("div", { class: "security-name" }, "登录密码"),
createVNode("div", { class: "security-desc" }, "建议定期修改密码保护账户安全")
])
]),
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => showChangePwd.value = true
}, {
default: withCtx(() => [
createTextVNode("修改")
]),
_: 1
}, 8, ["onClick"])
]),
createVNode("div", { class: "security-item" }, [
createVNode("div", { class: "security-info" }, [
createVNode("span", { class: "security-icon" }, "📱"),
createVNode("div", null, [
createVNode("div", { class: "security-name" }, "绑定手机"),
createVNode("div", { class: "security-desc" }, toDisplayString(unref(editForm).phone ? `已绑定 ${unref(editForm).phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}` : "未绑定手机号"), 1)
])
]),
createVNode(_component_a_button, { size: "small" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(editForm).phone ? "修改" : "绑定"), 1)
]),
_: 1
})
])
])
])
], 512), [
[vShow, unref(activeTab) === "info"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "我的建言"),
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx(() => [
createTextVNode("提交新建言")
]),
_: 1
}, 8, ["onClick"])
]),
unref(mySuggestions).length === 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "empty-state"
}, [
createVNode(_component_a_empty, { description: "暂无建言记录" }, {
extra: withCtx(() => [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx(() => [
createTextVNode("立即建言")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
])) : createCommentVNode("", true),
createVNode("div", { class: "suggestion-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(mySuggestions), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "suggestion-item"
}, [
createVNode("div", { class: "suggestion-header" }, [
createVNode("span", { class: "suggestion-title" }, toDisplayString(item.title), 1),
createVNode(_component_a_tag, {
color: getStatusColor(item.status)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getStatusText(item.status)), 1)
]),
_: 2
}, 1032, ["color"])
]),
createVNode("p", { class: "suggestion-content" }, toDisplayString(item.content), 1),
createVNode("div", { class: "suggestion-meta" }, [
createVNode("span", null, toDisplayString(item.createTime), 1),
item.reply ? (openBlock(), createBlock("span", {
key: 0,
class: "has-reply"
}, "已回复")) : createCommentVNode("", true)
]),
item.reply ? (openBlock(), createBlock("div", {
key: 0,
class: "suggestion-reply"
}, [
createVNode("span", { class: "reply-label" }, "官方回复:"),
createVNode("span", null, toDisplayString(item.reply), 1)
])) : createCommentVNode("", true)
]);
}), 128))
])
], 512), [
[vShow, unref(activeTab) === "suggestions"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "我的收藏")
]),
createVNode(_component_a_empty, {
description: "暂无收藏内容",
style: { "padding": "60px 0" }
})
], 512), [
[vShow, unref(activeTab) === "favorites"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "浏览历史"),
createVNode(_component_a_button, { onClick: clearHistory }, {
default: withCtx(() => [
createTextVNode("清空历史")
]),
_: 1
})
]),
createVNode(_component_a_empty, {
description: "暂无浏览记录",
style: { "padding": "60px 0" }
})
], 512), [
[vShow, unref(activeTab) === "history"]
])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_col, {
xs: 24,
lg: 7
}, {
default: withCtx(() => [
createVNode("div", { class: "profile-card" }, [
createVNode("div", { class: "avatar-section" }, [
createVNode(_component_a_upload, {
name: "avatar",
"list-type": "picture-circle",
class: "avatar-uploader",
"show-upload-list": false,
"before-upload": beforeUpload,
onChange: handleAvatarChange
}, {
default: withCtx(() => [
createVNode("div", { class: "avatar-wrap" }, [
unref(userInfo).avatar ? (openBlock(), createBlock("img", {
key: 0,
src: unref(userInfo).avatar,
alt: "avatar",
class: "avatar-img"
}, null, 8, ["src"])) : (openBlock(), createBlock("div", {
key: 1,
class: "avatar-placeholder"
}, toDisplayString(unref(userInfo).nickname?.charAt(0) || "用"), 1)),
createVNode("div", { class: "avatar-overlay" }, [
createVNode("span", null, "更换头像")
])
])
]),
_: 1
})
]),
createVNode("h2", { class: "user-name" }, toDisplayString(unref(userInfo).nickname || unref(userInfo).username || "用户"), 1),
createVNode("div", { class: "user-role" }, [
createVNode(_component_a_tag, {
color: unref(userInfo).isAdmin ? "red" : "blue"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(userInfo).isAdmin ? "管理员" : "普通用户"), 1)
]),
_: 1
}, 8, ["color"])
]),
createVNode("div", { class: "user-stats" }, [
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).suggestions), 1),
createVNode("div", { class: "stat-label" }, "建言")
]),
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).favorites), 1),
createVNode("div", { class: "stat-label" }, "收藏")
]),
createVNode("div", { class: "stat-item" }, [
createVNode("div", { class: "stat-num" }, toDisplayString(unref(stats).views), 1),
createVNode("div", { class: "stat-label" }, "浏览")
])
]),
createVNode("div", { class: "side-menu" }, [
(openBlock(), createBlock(Fragment, null, renderList(sideMenuItems, (item) => {
return createVNode("div", {
key: item.key,
class: ["side-menu-item", { active: unref(activeTab) === item.key }],
onClick: ($event) => activeTab.value = item.key
}, [
createVNode("span", { class: "menu-icon" }, toDisplayString(item.icon), 1),
createVNode("span", null, toDisplayString(item.label), 1)
], 10, ["onClick"]);
}), 64))
])
])
]),
_: 1
}),
createVNode(_component_a_col, {
xs: 24,
lg: 17
}, {
default: withCtx(() => [
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "基本信息"),
!unref(editing) ? (openBlock(), createBlock(_component_a_button, {
key: 0,
type: "primary",
onClick: ($event) => editing.value = true
}, {
default: withCtx(() => [
createTextVNode("编辑资料")
]),
_: 1
}, 8, ["onClick"])) : (openBlock(), createBlock(_component_a_space, { key: 1 }, {
default: withCtx(() => [
createVNode(_component_a_button, {
onClick: ($event) => editing.value = false
}, {
default: withCtx(() => [
createTextVNode("取消")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
type: "primary",
loading: unref(saving),
onClick: saveInfo
}, {
default: withCtx(() => [
createTextVNode("保存")
]),
_: 1
}, 8, ["loading"])
]),
_: 1
}))
]),
createVNode(_component_a_form, {
model: unref(editForm),
layout: "vertical",
class: "info-form"
}, {
default: withCtx(() => [
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "昵称" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).nickname,
"onUpdate:value": ($event) => unref(editForm).nickname = $event,
disabled: !unref(editing),
placeholder: "请输入昵称"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "手机号" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).phone,
"onUpdate:value": ($event) => unref(editForm).phone = $event,
disabled: !unref(editing),
placeholder: "请输入手机号"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "电子邮箱" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).email,
"onUpdate:value": ($event) => unref(editForm).email = $event,
disabled: !unref(editing),
placeholder: "请输入邮箱"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "工作单位" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(editForm).organization,
"onUpdate:value": ($event) => unref(editForm).organization = $event,
disabled: !unref(editing),
placeholder: "请输入工作单位"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 24 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "个人简介" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(editForm).bio,
"onUpdate:value": ($event) => unref(editForm).bio = $event,
disabled: !unref(editing),
rows: 3,
placeholder: "请输入个人简介"
}, null, 8, ["value", "onUpdate:value", "disabled"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}, 8, ["model"]),
createVNode("div", { class: "security-section" }, [
createVNode("h4", null, "账号安全"),
createVNode("div", { class: "security-items" }, [
createVNode("div", { class: "security-item" }, [
createVNode("div", { class: "security-info" }, [
createVNode("span", { class: "security-icon" }, "🔒"),
createVNode("div", null, [
createVNode("div", { class: "security-name" }, "登录密码"),
createVNode("div", { class: "security-desc" }, "建议定期修改密码保护账户安全")
])
]),
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => showChangePwd.value = true
}, {
default: withCtx(() => [
createTextVNode("修改")
]),
_: 1
}, 8, ["onClick"])
]),
createVNode("div", { class: "security-item" }, [
createVNode("div", { class: "security-info" }, [
createVNode("span", { class: "security-icon" }, "📱"),
createVNode("div", null, [
createVNode("div", { class: "security-name" }, "绑定手机"),
createVNode("div", { class: "security-desc" }, toDisplayString(unref(editForm).phone ? `已绑定 ${unref(editForm).phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}` : "未绑定手机号"), 1)
])
]),
createVNode(_component_a_button, { size: "small" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(editForm).phone ? "修改" : "绑定"), 1)
]),
_: 1
})
])
])
])
], 512), [
[vShow, unref(activeTab) === "info"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "我的建言"),
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx(() => [
createTextVNode("提交新建言")
]),
_: 1
}, 8, ["onClick"])
]),
unref(mySuggestions).length === 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "empty-state"
}, [
createVNode(_component_a_empty, { description: "暂无建言记录" }, {
extra: withCtx(() => [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => ("navigateTo" in _ctx ? _ctx.navigateTo : unref(navigateTo))("/suggestions")
}, {
default: withCtx(() => [
createTextVNode("立即建言")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
])) : createCommentVNode("", true),
createVNode("div", { class: "suggestion-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(mySuggestions), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "suggestion-item"
}, [
createVNode("div", { class: "suggestion-header" }, [
createVNode("span", { class: "suggestion-title" }, toDisplayString(item.title), 1),
createVNode(_component_a_tag, {
color: getStatusColor(item.status)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getStatusText(item.status)), 1)
]),
_: 2
}, 1032, ["color"])
]),
createVNode("p", { class: "suggestion-content" }, toDisplayString(item.content), 1),
createVNode("div", { class: "suggestion-meta" }, [
createVNode("span", null, toDisplayString(item.createTime), 1),
item.reply ? (openBlock(), createBlock("span", {
key: 0,
class: "has-reply"
}, "已回复")) : createCommentVNode("", true)
]),
item.reply ? (openBlock(), createBlock("div", {
key: 0,
class: "suggestion-reply"
}, [
createVNode("span", { class: "reply-label" }, "官方回复:"),
createVNode("span", null, toDisplayString(item.reply), 1)
])) : createCommentVNode("", true)
]);
}), 128))
])
], 512), [
[vShow, unref(activeTab) === "suggestions"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "我的收藏")
]),
createVNode(_component_a_empty, {
description: "暂无收藏内容",
style: { "padding": "60px 0" }
})
], 512), [
[vShow, unref(activeTab) === "favorites"]
]),
withDirectives(createVNode("div", { class: "content-panel" }, [
createVNode("div", { class: "panel-header" }, [
createVNode("h3", null, "浏览历史"),
createVNode(_component_a_button, { onClick: clearHistory }, {
default: withCtx(() => [
createTextVNode("清空历史")
]),
_: 1
})
]),
createVNode(_component_a_empty, {
description: "暂无浏览记录",
style: { "padding": "60px 0" }
})
], 512), [
[vShow, unref(activeTab) === "history"]
])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
}
_push(`</div>`);
_push(ssrRenderComponent(_component_a_modal, {
open: unref(showChangePwd),
"onUpdate:open": ($event) => isRef(showChangePwd) ? showChangePwd.value = $event : null,
title: "修改密码",
onOk: handleChangePwd,
"confirm-loading": unref(saving)
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_form, {
model: unref(pwdForm),
layout: "vertical"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_form_item, { label: "当前密码" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input_password, {
value: unref(pwdForm).oldPwd,
"onUpdate:value": ($event) => unref(pwdForm).oldPwd = $event,
placeholder: "请输入当前密码"
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input_password, {
value: unref(pwdForm).oldPwd,
"onUpdate:value": ($event) => unref(pwdForm).oldPwd = $event,
placeholder: "请输入当前密码"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "新密码" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input_password, {
value: unref(pwdForm).newPwd,
"onUpdate:value": ($event) => unref(pwdForm).newPwd = $event,
placeholder: "请输入新密码至少6位"
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input_password, {
value: unref(pwdForm).newPwd,
"onUpdate:value": ($event) => unref(pwdForm).newPwd = $event,
placeholder: "请输入新密码至少6位"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "确认新密码" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input_password, {
value: unref(pwdForm).confirmPwd,
"onUpdate:value": ($event) => unref(pwdForm).confirmPwd = $event,
placeholder: "请再次输入新密码"
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input_password, {
value: unref(pwdForm).confirmPwd,
"onUpdate:value": ($event) => unref(pwdForm).confirmPwd = $event,
placeholder: "请再次输入新密码"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_form_item, { label: "当前密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).oldPwd,
"onUpdate:value": ($event) => unref(pwdForm).oldPwd = $event,
placeholder: "请输入当前密码"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "新密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).newPwd,
"onUpdate:value": ($event) => unref(pwdForm).newPwd = $event,
placeholder: "请输入新密码至少6位"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "确认新密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).confirmPwd,
"onUpdate:value": ($event) => unref(pwdForm).confirmPwd = $event,
placeholder: "请再次输入新密码"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_form, {
model: unref(pwdForm),
layout: "vertical"
}, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "当前密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).oldPwd,
"onUpdate:value": ($event) => unref(pwdForm).oldPwd = $event,
placeholder: "请输入当前密码"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "新密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).newPwd,
"onUpdate:value": ($event) => unref(pwdForm).newPwd = $event,
placeholder: "请输入新密码至少6位"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "确认新密码" }, {
default: withCtx(() => [
createVNode(_component_a_input_password, {
value: unref(pwdForm).confirmPwd,
"onUpdate:value": ($event) => unref(pwdForm).confirmPwd = $event,
placeholder: "请再次输入新密码"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
}, 8, ["model"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/profile/index.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7f4a0583"]]);
export { index as default };
//# sourceMappingURL=index-BpW8YK7f.mjs.map