|
@@ -1,16 +1,12 @@
|
|
|
<template>
|
|
|
<view class="msilde">
|
|
|
<view class="left">
|
|
|
- <u-collapse accordion >
|
|
|
- <u-collapse-item :title="d.deptName" :name="d.deptId" v-for="(d, index) in list" :key="d.deptName">
|
|
|
- <view :class="{ active: index == i.current }" v-for="(i, index) in d.children" :key="i.deptName" class="item" @click="selected(i, index)">{{ i.deptName }}</view>
|
|
|
- </u-collapse-item>
|
|
|
- </u-collapse>
|
|
|
+ <view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="selected(item, index)">{{ item.deptName }}</view>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
<view class="contents">
|
|
|
- <u-divider :text="item.deptName + '介绍'" v-if="item.deptName"></u-divider>
|
|
|
- <u-parse :content="item.brief"></u-parse>
|
|
|
+ <u-parse :content="item.brief" v-if="item.brief"></u-parse>
|
|
|
+ <u-empty v-else text="整理资料中..."></u-empty>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -20,6 +16,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ current: 0,
|
|
|
item: {},
|
|
|
list: []
|
|
|
};
|
|
@@ -33,17 +30,19 @@ export default {
|
|
|
url: '/app/department/list',
|
|
|
success: (res) => {
|
|
|
this.list = res.data.data;
|
|
|
+ this.selected(this.list[0], 0);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
selected(item, index) {
|
|
|
- this.list.flatMap((i) => i.children).forEach((j) => (j.current = -1));
|
|
|
- item.current = index;
|
|
|
+ this.current = index;
|
|
|
this.http.request({
|
|
|
url: '/app/department/detail/' + item.deptId,
|
|
|
success: (res) => {
|
|
|
this.item = res.data.data;
|
|
|
- this.item.brief = res.data.data.brief.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
|
|
|
+ if (res.data.data.brief) {
|
|
|
+ this.item.brief = res.data.data.brief.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|