Browse Source

图书检索馆藏配置分配

master
xuhuajiao 1 month ago
parent
commit
25258a804c
  1. 7
      api/book.js
  2. 1
      pages/lendCar/lendCar.vue
  3. 60
      subpkg/pages/book-detail/book-detail.vue

7
api/book.js

@ -1,4 +1,11 @@
import request from '../utils/request'; import request from '../utils/request';
// 字典项 - 馆代码
export function FetchDictionaryTree(data) {
return request({
url: '/api/dictionary/initDictionaryTree',
data
})
}
// 查询读者当前借阅(群) // 查询读者当前借阅(群)
// http://192.168.99.63:14000/api/screenSetting/rdloanlist?rdid=420703GD0000748&sm4Key=86ACEF6CE6A65A4A&thirdAppid=feitian_gdlib&thirdSecret=edi56b6p5hi69dwk03so86uv2olhszqp&thirdUrl=http://218.200.95.251:8088/openlib // http://192.168.99.63:14000/api/screenSetting/rdloanlist?rdid=420703GD0000748&sm4Key=86ACEF6CE6A65A4A&thirdAppid=feitian_gdlib&thirdSecret=edi56b6p5hi69dwk03so86uv2olhszqp&thirdUrl=http://218.200.95.251:8088/openlib

1
pages/lendCar/lendCar.vue

@ -25,6 +25,7 @@
<view class="item-title line-clamp-2">{{ item.title || '暂无标题' }}</view> <view class="item-title line-clamp-2">{{ item.title || '暂无标题' }}</view>
<view class="tag-box"> <view class="tag-box">
<text class="item-author">{{ item.author || '佚名' }}</text> <text class="item-author">{{ item.author || '佚名' }}</text>
<!-- 索书号 -->
<text v-if="item.callno" class="item-callno">{{ item.callno }}</text> <text v-if="item.callno" class="item-callno">{{ item.callno }}</text>
</view> </view>
<view class="item-desc"> <view class="item-desc">

60
subpkg/pages/book-detail/book-detail.vue

@ -54,12 +54,11 @@
</view> </view>
<view> <view>
<text class="info-item-title">所在馆</text> <text class="info-item-title">所在馆</text>
<!-- item.orglib || '葛店经济技术开发区图书馆' -->
<text>葛店经济技术开发区图书馆</text>
<text>{{ getLibraryName(item.orglib) }}</text>
</view> </view>
<view> <view>
<text class="info-item-title">当前馆藏地</text> <text class="info-item-title">当前馆藏地</text>
<text>{{ item.orglocal || '葛店图书馆' }}</text>
<text>{{ getLocationName(item.orglocal) }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -97,7 +96,7 @@
<script> <script>
import { FetchInitScreenSetting } from '@/api/user'; import { FetchInitScreenSetting } from '@/api/user';
import { FetchFindbookByQuery } from '@/api/book';
import { FetchFindbookByQuery, FetchDictionaryTree } from '@/api/book';
import config from '@/utils/config'; import config from '@/utils/config';
export default { export default {
@ -111,6 +110,9 @@ export default {
fromRecommend: false, fromRecommend: false,
bookInfo: {}, bookInfo: {},
holdingsData: [], holdingsData: [],
dictionaryTree: {},
libraryMap: {},
locationMap: {}
}; };
}, },
onLoad(options) { onLoad(options) {
@ -129,6 +131,7 @@ export default {
this.bookrecno = options.bookrecno || ""; this.bookrecno = options.bookrecno || "";
this.fromRecommend = false; this.fromRecommend = false;
this.getOpacUrl(); this.getOpacUrl();
this.getDictionaryTree();
}, },
computed: { computed: {
// //
@ -150,6 +153,38 @@ export default {
onImgError(e) { onImgError(e) {
e.target.src = "/static/images/default-book.png"; e.target.src = "/static/images/default-book.png";
}, },
// -
async getDictionaryTree() {
try {
const res = await FetchDictionaryTree();
console.log('dictionaryTree',res);
const data = res.data || [];
// 1.
const fgItem = data.find(item => item.dictionaryCode === 'FG' && item.dictionaryName === '分馆');
if (fgItem && fgItem.childDictionarys) {
// dictionaryCode -> dictionaryName
this.libraryMap = {};
fgItem.childDictionarys.forEach(child => {
this.libraryMap[child.dictionaryCode] = child.dictionaryName;
});
}
// 2.
const gcdItem = data.find(item => item.dictionaryCode === 'GCD' && item.dictionaryName === '馆藏地点');
if (gcdItem && gcdItem.childDictionarys) {
// dictionaryCode -> dictionaryName
this.locationMap = {};
gcdItem.childDictionarys.forEach(child => {
this.locationMap[child.dictionaryCode] = child.dictionaryName;
});
}
this.dictionaryTree = data;
} catch (err) {
console.error('获取字典树失败', err);
}
},
// //
async getOpacUrl() { async getOpacUrl() {
try { try {
@ -204,6 +239,18 @@ export default {
return map[state] || '未知'; return map[state] || '未知';
}, },
//
getLibraryName(orglib) {
if (!orglib) return '葛店经济技术开发区图书馆';
return this.libraryMap[orglib] || orglib || '葛店经济技术开发区图书馆';
},
//
getLocationName(orglocal) {
if (!orglocal) return '葛店图书馆';
return this.locationMap[orglocal] || orglocal || '葛店图书馆';
},
// //
checkCollectStatus() { checkCollectStatus() {
const list = uni.getStorageSync('collectList') || []; const list = uni.getStorageSync('collectList') || [];
@ -312,7 +359,10 @@ export default {
padding: 10px; padding: 10px;
margin-bottom: 10px; margin-bottom: 10px;
border: 1px solid #eee; border: 1px solid #eee;
border-radius: 10px;
&:last-child {
margin-bottom: 0;
}
} }
.store-info-item view { .store-info-item view {
display: flex; display: flex;

Loading…
Cancel
Save