修改网页跳转

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

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

@ -10,13 +10,22 @@ new Vue({
treeId: null, treeId: null,
tableData: [], tableData: [],
tableIds: [], tableIds: [],
defaultCheckedKeys:[]
}; };
}, },
mounted() { async mounted() {
this.getTree() 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: { methods: {
handleNodeClick(data) { handleNodeClick(data) {
console.log(data)
$.post(ctx + 'manage/base_file/fileList', {name: data.value}, (e) => { $.post(ctx + 'manage/base_file/fileList', {name: data.value}, (e) => {
this.tableData = e.data.map((e, i) => { this.tableData = e.data.map((e, i) => {
return { return {
@ -113,8 +122,8 @@ new Vue({
}); });
}, },
getTree() { async getTree() {
$.get(ctx + 'broad/home/queryCustomer', {}, (e) => { await $.get(ctx + 'broad/home/queryCustomer', {}, (e) => {
console.log(e) console.log(e)
this.treeData = e.data.map(e => { this.treeData = e.data.map(e => {
return { return {

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

@ -26,7 +26,7 @@
<div class="centerImg" id="app"> <div class="centerImg" id="app">
<div class="left"> <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>
<div class="left1"> <div class="left1">
<el-button <el-button

Loading…
Cancel
Save