feat: 完成前端业务闭环与后端联调
This commit is contained in:
+12
-30
@@ -158,17 +158,6 @@
|
||||
@select-action="openMemberAction"
|
||||
/>
|
||||
|
||||
<AppDialog
|
||||
:visible="unavailableActionVisible"
|
||||
eyebrow="服务状态"
|
||||
:title="unavailableAction?.label || '当前操作'"
|
||||
:message="
|
||||
unavailableAction?.unavailableCopy || '这项功能还在准备中,暂时无法使用。'
|
||||
"
|
||||
confirm-text="我知道了"
|
||||
@confirm="unavailableActionVisible = false"
|
||||
@cancel="unavailableActionVisible = false"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -176,7 +165,6 @@
|
||||
import { computed, nextTick, ref } from "vue";
|
||||
import { onLoad, onShow, onUnload } from "@dcloudio/uni-app";
|
||||
import AppAvatar from "@/components/AppAvatar.vue";
|
||||
import AppDialog from "@/components/AppDialog.vue";
|
||||
import AppLoading from "@/components/AppLoading.vue";
|
||||
import MemberActionPanel from "@/components/tree/MemberActionPanel.vue";
|
||||
import ModulePageBackground from "@/components/ModulePageBackground.vue";
|
||||
@@ -198,8 +186,6 @@ const genealogyId = ref("");
|
||||
const treeState = ref("loading");
|
||||
const selectedMember = ref(null);
|
||||
const memberActionPanelVisible = ref(false);
|
||||
const unavailableActionVisible = ref(false);
|
||||
const unavailableAction = ref(null);
|
||||
const treeScrollLeft = ref(90);
|
||||
const currentTreeScrollLeft = ref(90);
|
||||
const centeredTreeScrollLeft = ref(90);
|
||||
@@ -282,13 +268,6 @@ const memberActions = Object.freeze([
|
||||
routeKey: "T04",
|
||||
relationType: memberRelationTypes.DAUGHTER,
|
||||
},
|
||||
{
|
||||
key: "BIND_INVITE",
|
||||
label: "邀请绑定",
|
||||
group: "MANAGEMENT",
|
||||
unavailableCopy:
|
||||
"邀请绑定暂未开放,请稍后再试。",
|
||||
},
|
||||
{
|
||||
key: "EDIT_PROFILE",
|
||||
label: "编辑信息",
|
||||
@@ -370,7 +349,7 @@ const loadTree = async (query = {}) => {
|
||||
genealogyId.value = String(
|
||||
query.genealogyId || genealogyContext.getCurrentGenealogyId() || "",
|
||||
);
|
||||
if (!genealogyId.value) {
|
||||
if (!/^[1-9]\d*$/.test(genealogyId.value)) {
|
||||
members.value = [];
|
||||
treeState.value = "empty";
|
||||
return;
|
||||
@@ -488,7 +467,7 @@ const recenterSelectedMember = async () => {
|
||||
const nodeGridStyle = treeNodeGridStyle;
|
||||
const handleStateAction = () => {
|
||||
if (treeState.value === "empty") {
|
||||
if (!genealogyId.value) return Promise.resolve(false);
|
||||
if (!/^[1-9]\d*$/.test(genealogyId.value)) return Promise.resolve(false);
|
||||
return openPage(
|
||||
"T04",
|
||||
{ genealogyId: genealogyId.value, mode: "first" },
|
||||
@@ -534,13 +513,8 @@ const closeMemberActionPanel = () => {
|
||||
memberActionPanelVisible.value = false;
|
||||
};
|
||||
const openMemberAction = (action) => {
|
||||
if (!selectedMember.value) return Promise.resolve(false);
|
||||
if (!selectedMember.value || !action?.routeKey) return Promise.resolve(false);
|
||||
closeMemberActionPanel();
|
||||
if (!action.routeKey) {
|
||||
unavailableAction.value = action;
|
||||
unavailableActionVisible.value = true;
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
const params = {
|
||||
genealogyId: genealogyId.value,
|
||||
personId: String(selectedMember.value.id),
|
||||
@@ -589,12 +563,20 @@ const openMemberAction = (action) => {
|
||||
}
|
||||
.tree-toolbar__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
color: $brand-red;
|
||||
font-size: clamp(14px, 23rpx, 17px);
|
||||
}
|
||||
.tree-toolbar__actions > text {
|
||||
display: flex;
|
||||
min-height: var(--app-touch-min);
|
||||
align-items: center;
|
||||
}
|
||||
.tree-stage {
|
||||
min-height: 0;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.tree-action--pressed {
|
||||
@@ -832,7 +814,7 @@ const openMemberAction = (action) => {
|
||||
.tree-state-card__action {
|
||||
display: grid;
|
||||
width: 360rpx;
|
||||
min-height: 70rpx;
|
||||
min-height: var(--app-touch-min);
|
||||
margin: 22rpx auto 0;
|
||||
}
|
||||
.tree-state-card__action image {
|
||||
|
||||
Reference in New Issue
Block a user