|
|
|
@ -111,7 +111,7 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="updateTime" label="更新时间" width="170" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" width="200"> |
|
|
|
|
<el-table-column label="操作" width="200" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button> |
|
|
|
|
<el-button type="text" @click="download(scope.row)" v-auth>下载</el-button> |
|
|
|
@ -280,16 +280,19 @@ export default { |
|
|
|
|
let introduce = ''// 对应股票的介绍,规则为无children则取上级 |
|
|
|
|
let dataSource = '' // 数据来源,同上 |
|
|
|
|
let action |
|
|
|
|
let isFirst = true // 判断是否是第一条数据 |
|
|
|
|
// 取得选中的那一栏 |
|
|
|
|
function actionId(arr) {//传入res |
|
|
|
|
arr && arr.map((e, i) => { |
|
|
|
|
e.id = String(e.id) |
|
|
|
|
if (!i) { |
|
|
|
|
if (!i && isFirst) { |
|
|
|
|
// 获取介绍和来源 |
|
|
|
|
if (e.introduce) introduce = e.introduce |
|
|
|
|
if (e.dataSource) dataSource = e.dataSource |
|
|
|
|
if (!action) action = e.children[0].children.length ? String(e.children[0].children[0].id) : String(e.children[0].id) |
|
|
|
|
} |
|
|
|
|
// 标识是否第一个分类 |
|
|
|
|
if (i) isFirst = false |
|
|
|
|
if (typeId && e.id == typeId) {// 若id匹配 |
|
|
|
|
action = String(e.id) |
|
|
|
|
if (e.children.length) {// 若有下级 |
|
|
|
@ -299,7 +302,7 @@ export default { |
|
|
|
|
action = String(e.children[0].children[0].id) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (e.children.length) {// id不匹配,递归找 |
|
|
|
|
} else if (e.children.length) { // id不匹配,递归找 |
|
|
|
|
actionId(e.children) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -352,19 +355,21 @@ export default { |
|
|
|
|
getDeepest(data[0].children) |
|
|
|
|
} else { |
|
|
|
|
select = data[0].id |
|
|
|
|
if (data[0].introduce) introduce = data[0].introduce |
|
|
|
|
if (data[0].dataSource) dataSource = data[0].dataSource |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
function handleData(data) { |
|
|
|
|
data.map((n, i) => { |
|
|
|
|
// 匹配到点击的分类,默认展开子级第一个分类 |
|
|
|
|
if (n.id == index) { |
|
|
|
|
if (n.introduce) introduce = n.introduce |
|
|
|
|
if (n.dataSource) dataSource = n.dataSource |
|
|
|
|
// 如果有子级,则递归取到最下面的第一级子级id,如果没有子级,则取当前id |
|
|
|
|
if (n.children.length) { |
|
|
|
|
getDeepest(n.children) |
|
|
|
|
} else { |
|
|
|
|
select = index |
|
|
|
|
if (n.introduce) introduce = n.introduce |
|
|
|
|
if (n.dataSource) dataSource = n.dataSource |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
handleData(n.children) |
|
|
|
@ -577,6 +582,9 @@ export default { |
|
|
|
|
&.is-active{ |
|
|
|
|
color: #fff; |
|
|
|
|
background-color: #0070FF; |
|
|
|
|
span { |
|
|
|
|
color: #fff; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.level-6 { |
|
|
|
|