修改网页跳转

master
夜笙歌 1 year ago
parent 016a5432d2
commit 06446a6f6c

@ -26,12 +26,13 @@ $(() => {
let data = e?.data?.map(val => {
return {
name: val.customerName,
img: val.customerLogo
img: val.customerLogo,
objid:val.objid
}
})
data.forEach(e => {
let html = `
<div class="item">
<div class="item" onclick="routerSkip('board/doc','${e.objid}')">
<img src="${e.img}" height="100%" style="vertical-align: top">
<span>${e.name}</span>
</div>

@ -10,13 +10,22 @@ new Vue({
treeId: null,
tableData: [],
tableIds: [],
defaultCheckedKeys:[]
};
},
mounted() {
this.getTree()
async mounted() {
await this.getTree()
let thisId = location.href?.split('?')?.[1]?.split('=')?.[1]
if(thisId){
let thisTreeItem = this.treeData.find(e=>e.id.toString() === thisId)
this.handleNodeClick(thisTreeItem)
this.defaultCheckedKeys = [+thisId]
console.log(this.defaultCheckedKeys)
}
},
methods: {
handleNodeClick(data) {
console.log(data)
$.post(ctx + 'manage/base_file/fileList', {name: data.value}, (e) => {
this.tableData = e.data.map((e, i) => {
return {
@ -113,8 +122,8 @@ new Vue({
});
},
getTree() {
$.get(ctx + 'broad/home/queryCustomer', {}, (e) => {
async getTree() {
await $.get(ctx + 'broad/home/queryCustomer', {}, (e) => {
console.log(e)
this.treeData = e.data.map(e => {
return {

@ -6,11 +6,11 @@
<body class="white-bg">
<link href="../../board/board2.css" rel="stylesheet">
<script>
const routerSkip = (e) => {
const routerSkip = (e,params) => {
try {
$.modal.openTab('设备智能驾驶舱', ctx + e);
$.modal.openTab('设备智能驾驶舱', ctx + e,{id:params});
} catch (val) {
location.href = ctx + e
location.href = ctx + e +'?id='+params
}
}
const toLink = (e) => {

@ -26,7 +26,7 @@
<div class="centerImg" id="app">
<div class="left">
<el-tree :data="treeData" :highlight-current="true" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
<el-tree node-key="id" :default-checked-keys="defaultCheckedKeys" :data="treeData" :highlight-current="true" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
<div class="left1">
<el-button

Loading…
Cancel
Save