diff --git a/index.html b/index.html index 91057ba..8672a37 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,55 @@ src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=2KLQUajGSpNL2DInxT6BwdPklMNpG3hw"> --> + + + + + + + +
diff --git a/src/assets/zzdcommon/config/index.js b/src/assets/zzdcommon/config/index.js new file mode 100644 index 0000000..ba4cbc2 --- /dev/null +++ b/src/assets/zzdcommon/config/index.js @@ -0,0 +1,13 @@ +// 应用配置项,需按实际项目进行修改 +const appConfig = { + SappId: "48017", + SappName: "lyxjbggfwjzzfxt", + appKey: "lyxjbggfwjzzfxt-1D38yW3MZJ3mee", // 应用APPKey + // serviceCode: '123456', // 单点登录代码 + // servicePwd: '123456', // 单点登录密码 + // appCode: 'test', // 应用编码, + // accessKey: '', // AK,IRS组件商店查看 + // secret: '', // SK,IRS组件商店查看 +}; + +export default appConfig; diff --git a/src/assets/zzdcommon/zzdlog.js b/src/assets/zzdcommon/zzdlog.js new file mode 100644 index 0000000..587633d --- /dev/null +++ b/src/assets/zzdcommon/zzdlog.js @@ -0,0 +1,79 @@ +import appConfig from './config/index.js'; +// import { inject } from 'vue' +// const users = inject("user"); //引入 + + + +//接收3个参数:page_id,page_name,page_url +export function queue(metaId, metaName, metaPath,) { + // console.log(Vue.prototype.getzzduserId,Vue.prototype.getzzdname) + // console.log(metaId, metaName, metaPath, '1111111111111111111111111') + //单页应用或“单个页面”需异步补充PV日志参数还需进行如下埋点: + // console.log('执行埋点') + // console.log(users); + //基础埋点 + aplus_queue.push({ + action: 'aplus.setMetaInfo', + arguments: ['aplus-waiting', 'MAN'] + }); // + // 单页应用路由切换后 或 在异步获取到pv日志所需的参数后再执行sendPV: + aplus_queue.push({ + 'action': 'aplus.sendPV', + 'arguments': [{ + is_auto: false + }, { + //当前你的应用信息,此两行按应用实际参数修改,不可自定义。 + sapp_id: appConfig.SappId, + sapp_name: appConfig.SappName, + // 自定义PV参数key-value键值对(只能是这种平铺的json,不能做多层嵌套),如: + page_id: metaId, //'页面ID,与page 参数配合使用,保证唯一性', + page_name: metaName, //'页面中文名称' + page_url: metaPath + }] + }) + + //用户信息埋点 + // 如采集用户信息是异步行为需要先执行这个BLOCK埋点 + aplus_queue.push({ + action: 'aplus.setMetaInfo', + arguments: ['_hold', 'BLOCK'] + }); + + // 设置会员昵称 + aplus_queue.push({ + action: "aplus.setMetaInfo", + arguments: ["_user_nick", localStorage.getItem('getzzdname') || 'login'], + + }); + + + // 设置会员ID + aplus_queue.push({ + action: "aplus.setMetaInfo", + arguments: ["_user_id", localStorage.getItem('getzzduserId') || '40906000'] + }); + + // aplus_queue.push({ + // action: "aplus.setMetaInfo", + // arguments: ["_dev_id", "yourDeviceId"] + // }); + + // 如采集用户信息是异步行为,需要先设置完用户信息后再执行这个START埋点 + // 此时被block住的日志会携带上用户信息逐条发出 + aplus_queue.push({ + action: 'aplus.setMetaInfo', + arguments: ['_hold', 'START'] + }); + + //埋点end + + // for (const key in aplus_queue) { + // console.log(aplus_queue[key]); + // } + // console.log(window.aplus_queue); + // console.log(localStorage.getItem('getzzdname'), localStorage.getItem('getzzduserId')); +}; + + + + diff --git a/src/router/index.js b/src/router/index.js index 0faf9d3..0a1680e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,6 +3,8 @@ import http from "@/utils/request.js"; import tools from "@/utils/tools"; // import { namespaceContextKey } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus"; +import { queue } from "../assets/zzdcommon/zzdlog"; + const routerHistory = createWebHashHistory(); const router = createRouter({ @@ -15,140 +17,162 @@ const router = createRouter({ { name: "引导页", path: "/guide", + meta: { id: "1" }, component: () => import("../view/guide.vue"), }, { name: "401", path: "/error/401", + meta: { id: "2" }, component: () => import("../view/error/401.vue"), }, { name: "403", path: "/error/403", + meta: { id: "3" }, component: () => import("../view/error/403.vue"), }, { name: "404", path: "/error/404", + meta: { id: "4" }, component: () => import("../view/error/404.vue"), }, { name: "500", path: "/error/500", + meta: { id: "5" }, component: () => import("../view/error/500.vue"), }, { name: "无网络", path: "/error/noNetwork", + meta: { id: "6" }, component: () => import("../view/error/noNetwork.vue"), }, { name: "建设中", path: "/error/emptyPage", + meta: { id: "7" }, component: () => import("../view/error/emptyPage.vue"), }, { name: "查询为空", path: "/error/noResults", + meta: { id: "8" }, component: () => import("../view/error/noResults.vue"), }, { name: "通用空页面", path: "/error/noConstruction", + meta: { id: "9" }, component: () => import("../view/error/noConstruction.vue"), }, { name: "未享受人员", path: "/person/rwTable", + meta: { id: "10" }, component: () => import("../view/person/rwTable.vue"), }, { name: "人员推送详情", path: "/person/pushRecords", + meta: { id: "11" }, component: () => import("../view/person/pushRecords.vue"), }, { + name: "主页", path: "/home", + meta: { id: "25" }, component: () => import("../view/home.vue"), + children: [ { name: "首页", path: "/home/index", + meta: { id: "12" }, component: () => import("../view/sy.vue"), }, { name: "养老", path: "/home/yl", + meta: { id: "13" }, component: () => import("../view/yl.vue"), }, { name: "卫生", path: "/home/hygiene", + meta: { id: "14" }, component: () => import("../view/hygiene.vue"), }, { name: "教育", path: "/home/education", + meta: { id: "15" }, component: () => import("../view/education.vue"), }, { name: "就业补助", path: "/home/work", + meta: { id: "16" }, component: () => import("../view/work.vue"), }, { name: "智能分析", path: "/home/analyze", + meta: { id: "17" }, component: () => import("../view/analyze.vue"), }, { name: "首页地图", path: "/home/index/map", + meta: { id: "18" }, component: () => import("../view/sy_map.vue"), }, { name: "首页表格", path: "/home/index/table", + meta: { id: "19" }, component: () => import("../view/sy_table.vue"), }, { name: "首页表格详情", path: "/home/index/table/details", + meta: { id: "20" }, component: () => import("../view/sy_details.vue"), }, { name: "首页表格交通便利详情", path: "/home/index/table/jtDetails", + meta: { id: "21" }, component: () => import("../view/jt_details.vue"), }, { name: "首页表格全民健身服务详情", path: "/home/index/table/fitnessServices", + meta: { id: "22" }, component: () => import("../view/js_details.vue"), }, { name: "首页表格校外活动服务详情", path: "/home/index/table/afterschoolActivities", + meta: { id: "23" }, component: () => import("../view/hd_details.vue"), }, { name: "人物图", path: "/home/index/person", + meta: { id: "24" }, component: () => import("../view/person/index.vue"), }, - - // { - // name: '地图编辑', - // path: '/home/index/mapEdit', - // component: () => import('../view/sy_map_fb.vue'), - // }, ], }, - ], }); router.beforeEach((to, form, next) => { + console.log(to); + queue(to.meta.id, to.name, to.path); let menu = tools.data.get("menu"); let token = tools.data.get("token"); // var token = getCookie('lytoken') @@ -176,9 +200,9 @@ router.beforeEach((to, form, next) => { if (!token) { next(); } else { - if (to.fullPath == '/home/index/map') { + if (to.fullPath == "/home/index/map") { //当未重新登录时,menu为空,或没有权限标识,无法访问, - if (!menu || menu.indexOf('ggfw:ystp') == -1) { + if (!menu || menu.indexOf("ggfw:ystp") == -1) { ElMessage.error("您无权限访问该模块,若有需求请联系大数据中心!"); } else { next(); @@ -188,7 +212,6 @@ router.beforeEach((to, form, next) => { } } - // next(); }); diff --git a/src/view/guide.vue b/src/view/guide.vue index 39ec9bf..3e88e42 100644 --- a/src/view/guide.vue +++ b/src/view/guide.vue @@ -137,8 +137,6 @@ const getCookie = (cname) => { }; // 登录 const login = () => { - console.log(111111111); - let backurl = tools.data.get("backUrl"); dd.getAuthCode() .then((res) => { diff --git a/src/view/hd_details.vue b/src/view/hd_details.vue index 4d411c4..16528a0 100644 --- a/src/view/hd_details.vue +++ b/src/view/hd_details.vue @@ -130,6 +130,7 @@ const data = reactive({ { label: "时间", property: "sj", + width: "150", align: "center", }, { @@ -145,6 +146,7 @@ const data = reactive({ { label: "人数", property: "rs", + width: "150", align: "center", }, ],