-
资产列表(蓝色为单位新增资产)
+
资产列表(蓝色为单位新增资产)
@@ -404,7 +406,7 @@
+const handleRedirect = () => {
+ if (hasRedirected.value) return;
+
+ // 从 permissionStore 获取路由
+ const routes = permissionStore.defaultRoutes || [];
+ console.log("当前路由数据:", routes);
+
+ const validRoutes = routes.filter(
+ (item) => !item.hidden && item.path && item.path !== "/"
+ );
+
+ if (validRoutes.length === 0) {
+ return;
+ }
-
+ const firstChild = validRoutes[0]?.children?.[0];
+ if (!firstChild?.path) {
+ return;
+ }
+ hasRedirected.value = true;
+ const formatPath = (path) => {
+ return path.startsWith("/") ? path.slice(1) : path;
+ };
+
+ const targetPath = userStore.roles.includes("unit")
+ ? `/${formatPath(firstChild.path)}`
+ : `/${formatPath(validRoutes[0].path)}/${formatPath(firstChild.path)}`;
+
+ console.log("跳转至:", targetPath);
+ router.push(targetPath).catch((err) => {
+ console.error("路由跳转异常:", err);
+ });
+};
+
+watch(
+ () => permissionStore.defaultRoutes || [],
+ (newVal) => {
+ if (newVal.length > 0) handleRedirect();
+ },
+ { immediate: true, deep: true }
+);
+
diff --git a/src/views/myAssets/myOfficialAccount/index.vue b/src/views/myAssets/myOfficialAccount/index.vue
index f25351e..254a156 100644
--- a/src/views/myAssets/myOfficialAccount/index.vue
+++ b/src/views/myAssets/myOfficialAccount/index.vue
@@ -311,28 +311,45 @@ function handleExport() {
`公众号资产${new Date().getTime()}.xlsx`
);
}
-function handleAdd() {
+const handleAdd = () => {
+ proxy.setActiveMenu("/myAssets2/myOfficialAccount");
router.push({
- name: "myAssetsAuth",
+ path: "/assetsManage2/xcxZC-info",
query: {
pageType: "add",
- type: 2,
- },
- });
-}
-// 查看/编辑详情
-const goInfo = (row, id) => {
- router.push({
- name: "myAssetsAuth",
- query: {
- pageType: id === 1 ? "look" : "change",
- type: 2,
- id: row.id,
- queryData: formInline.value,
+ type: 1,
+ queryData: formInline,
name: "MyOfficialAccount",
},
});
};
+const goInfo = (row, id) => {
+ if (id === 1) {
+ proxy.setActiveMenu("/myAssets2/myOfficialAccount");
+ router.push({
+ path: "/assetsManage2/xcxZC-info",
+ query: {
+ name: "MyOfficialAccount",
+ pageType: "look",
+ type: 1,
+ id: row.id,
+ queryData: formInline.value,
+ },
+ });
+ } else if (id === 2) {
+ proxy.setActiveMenu("/myAssets2/myOfficialAccount");
+ router.push({
+ path: "/assetsManage2/xcxZC-info",
+ query: {
+ name: "MyOfficialAccount",
+ pageType: "change",
+ type: 1,
+ id: row.id,
+ queryData: formInline.value,
+ },
+ });
+ }
+};
// 表格行样式
const tableRowClassName = ({ rowIndex }) => {
diff --git a/src/views/myAssets/myProgram/index.vue b/src/views/myAssets/myProgram/index.vue
index ebfa43a..787637f 100644
--- a/src/views/myAssets/myProgram/index.vue
+++ b/src/views/myAssets/myProgram/index.vue
@@ -1,6 +1,12 @@
-
-