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