|
@@ -1,13 +1,19 @@
|
|
|
<template>
|
|
|
<view class="msilde">
|
|
|
+ <view class="search">
|
|
|
+ <u-search placeholder="搜索科室" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/department/search')"></u-search>
|
|
|
+ </view>
|
|
|
<view class="left">
|
|
|
- <view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="selected(item, index)">{{ item.deptName }}</view>
|
|
|
+ <view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="current = index">{{ item.deptName }}</view>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
- <view class="contents">
|
|
|
- <u-parse :content="item.brief" v-if="item.brief"></u-parse>
|
|
|
- <u-empty v-else text="整理资料中..."></u-empty>
|
|
|
+ <view class="list" v-if="list.length > 0">
|
|
|
+ <view class="item" v-for="(item, index) in list[current].children" :key="item.deptId" @click="go('/pages/department/detail?id=' + item.deptId)">
|
|
|
+ <view class="title omit">{{ item.deptName }}</view>
|
|
|
+ <view class="icon"></view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <u-empty v-else text="整理资料中..."></u-empty>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -16,8 +22,8 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ title: '',
|
|
|
current: 0,
|
|
|
- item: {},
|
|
|
list: []
|
|
|
};
|
|
|
},
|
|
@@ -30,21 +36,11 @@ export default {
|
|
|
url: '/app/department/list',
|
|
|
success: (res) => {
|
|
|
this.list = res.data.data;
|
|
|
- this.selected(this.list[0], 0);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- selected(item, index) {
|
|
|
- this.current = index;
|
|
|
- this.http.request({
|
|
|
- url: '/app/department/detail/' + item.deptId,
|
|
|
- success: (res) => {
|
|
|
- this.item = res.data.data;
|
|
|
- if (res.data.data.brief) {
|
|
|
- this.item.brief = res.data.data.brief.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ go(url) {
|
|
|
+ uni.navigateTo({ url: url });
|
|
|
}
|
|
|
}
|
|
|
};
|