master
xy 2 years ago
parent 23fdadcc87
commit aca5733394

@ -0,0 +1,5 @@
language: node_js
node_js: 10
script: npm run test
notifications:
email: false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -5,7 +5,24 @@
</template>
<script>
import { ossLogin } from "@/api/system/ossLogin"
import { setToken,getToken } from '@/utils/auth'
export default {
name: 'App'
name: 'App',
created() {
window.addEventListener('message',msg => {
if(msg.data.key === 'login'){
const { authToken } = msg.data.data
ossLogin({
auth_token: authToken
}).then(res => {
setToken(res.access_token)
this.$store.commit('user/SET_TOKEN',res.access_token)
this.$router.push("/")
})
}
})
}
}
</script>

@ -0,0 +1,10 @@
import request from "@/utils/request";
import store from '@/store';
export function ossLogin(data){
return request({
isLoading:false,
method:'post',
url:'/api/admin/auth/oss-login',
data
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 KiB

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -20,6 +20,7 @@ router.beforeEach(async(to, from, next) => {
// determine whether the user has logged in
const hasToken = getToken()
if (hasToken) {
if (to.path === '/login') {
// if is logged in, redirect to the home page

@ -1,6 +1,6 @@
module.exports = {
title: '同心读书会自助借阅系统',
title: '自助借阅系统',
/**
* @type {boolean} true | false

@ -17,6 +17,8 @@ const getDefaultState = () => {
token: getToken(),
name: '',
avatar: '',
userId:'',
username:'',
roles: []
}
}
@ -33,6 +35,12 @@ const mutations = {
SET_NAME: (state, name) => {
state.name = name
},
SET_USERNAME:(state,username) => {
state.username = username
},
SET_USERID:(state,id) => {
state.userId = id
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
@ -84,11 +92,13 @@ const actions = {
const {
roles,
name,
id,
username,
avatar
} = response
commit('SET_USERNAME',username)
commit('SET_USERID',id)
commit('SET_ROLES', roles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)

@ -1,6 +1,6 @@
import Cookies from 'js-cookie'
const TokenKey = 'sqhj_book_token'
const TokenKey = 'hjjc_book_web_token'
export function getToken() {
return Cookies.get(TokenKey)

@ -43,7 +43,9 @@
del,
show
} from "@/api/bookRecord/recordIndex";
import {
getInfo
} from '../../api/user.js'
export default {
data() {
@ -52,6 +54,7 @@
page: 1,
page_size: 20,
keyword: '',
user_name: ''
},
total: 0,
list: [],
@ -117,6 +120,7 @@
}
},
methods: {
doSearch() {
this.select.page = 1;
this.load();
@ -127,9 +131,23 @@
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
var that = this;
let type = parseInt(this.$route.path.split("_")[1]);
if (type == 1) {
await getInfo().then(res => {
this.select.user_name = res.name;
const resData = index(this.select)
this.total = resData.total
this.list = resData.data
})
} else {
const resData = await index(this.select)
this.total = resData.total
this.list = resData.data
}
},
deleteitem(row) {
del({
@ -142,9 +160,9 @@
back(row) {
save({
id: row.id,
status:1,
user_id:row.user?.id,
return_time:this.$moment().format("YYYY-MM-DD HH:mm:ss")
status: 1,
user_id: row.user?.id,
return_time: this.$moment().format("YYYY-MM-DD HH:mm:ss")
}).then(res => {
this.load();
this.$Message.success("归还成功");

@ -8,7 +8,7 @@
<div class="xy-table-item-label">入库数量
</div>
<div class="xy-table-item-content">
<el-input-number v-model="detail.booknum" :min="1" :max="99"></el-input-number>
<el-input-number v-model="detail.booknum" :min="1" :max="1"></el-input-number>
</div>
</div>
</template>
@ -24,17 +24,70 @@
</div>
</template>
<template v-slot:bookshelf>
<div class="xy-table-item">
<div class="xy-table-item-label">书架
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请输入书架号" type="text" v-model="detail.bookshelf" style="width: 120px;">
</el-input>
</div>
</div>
</template>
<template v-slot:rows>
<div class="xy-table-item">
<div class="xy-table-item-label">
</div>
<div class="xy-table-item-content">
<el-input-number v-model="detail.rows" :min="1" :max="99"></el-input-number>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label">排序
</div>
<div class="xy-table-item-content">
<el-input-number v-model="detail.sort" :min="1" :max="999"></el-input-number>
</div>
</div>
</template>
<template v-slot:line>
<div class="xy-table-item">
<div class="xy-table-item-label">
</div>
<div class="xy-table-item-content">
<el-input-number v-model="detail.line" :min="1" :max="99"></el-input-number>
</div>
</div>
</template>
<template v-slot:borrow_status>
<div class="xy-table-item">
<div class="xy-table-item-label">状态
</div>
<div class="xy-table-item-content">
<el-select v-model="detail.borrow_status" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">备注
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写备注" type="textarea" rows="4" v-model="detail.remark"
style="width: 300px;" />
style="width: 220px;" />
</div>
</div>
</template>
</xy-dialog>
</div>
@ -54,6 +107,13 @@
isShow: false,
id: "",
options: [{
value: 0,
label: '在库'
}, {
value: 1,
label: '借出'
}],
bookid: "",
type: "add",
detail: {
@ -63,7 +123,12 @@
enter_date: "",
remark: "",
status: 0,
booknum: 1
booknum: 1,
bookshelf: "",
line: "",
rows: "",
borrow_status: 0,
sort:""
},
rules: {
enter_date: [{
@ -79,11 +144,11 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset()
}
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset()
}
}
},
@ -92,20 +157,31 @@
async getDetail() {
let res = await showDetail({
id: this.id
})
Object.assign(this.detail, res);
});
console.log(res)
this.detail.book_id = res.book_id;
this.detail.id = res.id;
this.detail.no = res.no;
this.detail.enter_date = res.enter_date;
this.detail.remark = res.remark;
this.detail.status = res.status;
this.detail.bookshelf = res.bookshelf;
this.detail.line = res.line;
this.detail.rows = res.rows;
this.detail.borrow_status = res.borrow_status;
this.detail.sort = res.sort;
},
editor() {
for (var i = 1; i <= this.detail.booknum;i++) {
saveDetail(this.detail).then(res => {
})
}
console.log("this.detail", this.detail)
saveDetail(this.detail).then(res => {
this.isShow = false
this.$Message.success("操作成功");
this.$emit('refresh')
})
},

@ -10,6 +10,13 @@
关键字
</span>
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
<span style="padding: 0 6px;word-break: keep-all;">
借阅状态
</span>
<el-select v-model="select.borrow_status" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
@ -22,9 +29,11 @@
<xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange" @delete="deleteitem" >
@pageIndexChange="pageChange" @delete="deleteitem" @editor="put">
</xy-table>
<putIn ref="putIn" @refresh="load()"></putIn>
</div>
</template>
@ -36,14 +45,31 @@
show
} from "@/api/bookStore/storeList";
import putIn from '@/views/bookStore/components/putIn'
export default {
components: {
putIn
},
data() {
return {
select: {
page: 1,
page_size: 20,
keyword: '',
borrow_status: "",
},
options: [{
value: '',
label: '所有'
},
{
value: 0,
label: '在库'
}, {
value: 1,
label: '借出'
}
],
total: 0,
list: [],
table: [{
@ -68,98 +94,125 @@
fixed: 'left',
customFn: (row) => {
return ( < div style = {
{
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
{
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}
} > < img src = {
row.barcode
}
} > < img src = {
row.barcode
} style='width:120px;height:90px'> < /img></div > )
style = 'width:120px;height:90px' > < /img></div > )
}
}, {
prop: 'book.author',
label: '作者',
align: 'center',
width: 140,
}, {
prop: 'book.bind_way',
label: '装订方式',
prop: 'addr',
label: '所在位置',
width: 180,
align: 'center'
}, {
prop: 'enter_date',
label: '入库日期',
width: 180,
align: 'center'
}, {
prop: 'borrow_status',
label: '借阅状态',
width: 120,
align: 'center',
formatter: (v1, v2, value) => {
return value == 1 ? "借出" : "在库";
align: 'left',
customFn: (row) => {
if (row.bookshelf && row.line && row.rows)
return ( < div > {
"书架:" + row.bookshelf
} < br / > {
"位于:第" + row.line + "列 "
} {
"第" + row.rows + "行"
} < /div> )
}
},
{
prop: 'book.author',
label: '作者',
align: 'left',
width: 140,
},
{
prop: 'book.bind_way',
label: '装订方式',
width: 180,
align: 'center'
},
{
prop: 'enter_date',
label: '入库日期',
width: 180,
align: 'center'
},
{
prop: 'borrow_status',
label: '借阅状态',
width: 120,
align: 'center',
formatter: (v1, v2, value) => {
return value == 1 ? "借出" : "在库";
}
},
{
prop: 'remark',
label: '备注',
minWidth: 280,
align: 'left'
},
{
prop: 'created_at',
label: '创建信息',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
}
},{
prop: 'remark',
label: '备注',
minWidth:280,
align: 'left'
},
],
}
},
methods: {
{
prop: 'created_at',
label: '创建信息',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
}
],
}
},
methods: {
put(row) {
this.$refs['putIn'].id = row.id;
doSearch() {
this.select.page = 1;
this.load();
},
doPrint(){
let baseUrl = process.env.VUE_APP_BASE_API+"/print";
window.open(baseUrl)
},
pageChange(e) {
this.select.page = e
this.load();
},
this.$refs['putIn'].isShow = true;
this.$refs['putIn'].type = 'editor'
},
doSearch() {
this.select.page = 1;
this.load();
},
doPrint() {
let baseUrl = process.env.VUE_APP_BASE_API + "/print";
window.open(baseUrl)
},
pageChange(e) {
this.select.page = e
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
},
deleteitem(row) {
del({
id: row.id
}).then(res => {
this.load();
this.$Message.success("操作成功");
})
}
},
mounted() {
this.load()
},
created() {}
}
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
},
deleteitem(row) {
del({
id: row.id
}).then(res => {
this.load();
this.$Message.success("操作成功");
})
}
},
mounted() {
this.load()
},
created() {}
}
</script>
<style lang="scss" scoped>
@ -171,4 +224,4 @@
margin-bottom: 6px;
}
}
</style>
</style>

@ -28,21 +28,24 @@
<!-- 滚动条要包裹的内容 -->
<div class="content_box_body_select">
<div class="content_box_body_select_box" v-for="(item,index) of listDepts" :key="index">
<div class="content_box_body_select_box_header">
<div class="content_box_body_select_box_header" style="cursor: pointer;" @click="tabdept(item)">
<div class="content_box_body_select_box_header_left">
<img src="../../assets/center/people.png" />
<span>{{item.name}}</span>
</div>
<div class="content_box_body_select_box_header_right">
<span style="margin-left: 10px;font-size: 18px;" v-show='item.show'>></span>
<span style="margin-left: 10px;font-size: 18px;transform: rotate(0deg); !important;" v-show='!item.show'>></span>
</div>
</div>
<div class="content_box_body_select_box_items">
<div class="content_box_body_select_box_item" @click="toSelectuser(uitem)"
v-for="(uitem,uindex) of item.user" :class="{'content_box_body_select_box_item_on':(uitem.on==true)}">
{{uitem.name}}
<el-collapse-transition>
<div class="content_box_body_select_box_items" v-show='item.show'>
<div class="content_box_body_select_box_item" @click="toSelectuser(uitem)"
v-for="(uitem,uindex) of item.user" :class="{'content_box_body_select_box_item_on':(uitem.on==true)}">
{{uitem.name}}
</div>
</div>
</div>
</el-collapse-transition>
</div>
</div>
@ -138,6 +141,16 @@
}
},
methods: {
tabdept(item){
for(var mod of this.listDepts){
mod.show=false;
}
item.show=!item.show;
this.$forceUpdate();
},
del(index) {
this.tableData.splice(index, 1);
this.$nextTick(function() {
@ -218,6 +231,9 @@
}
}
this.listDepts = res;
for(var mod of this.listDepts){
mod.show=false;
}
})
},
@ -282,7 +298,7 @@
}
</script>
<style lang="scss" >
<style lang="scss">
.content_box_body_table_footer {
margin: 42px auto;
@ -290,8 +306,8 @@
.content_box_body_table_footer_btn {
width: 180px;
height: 55px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
background: linear-gradient(0deg, #066c5b, #79c4b7);
box-shadow: 0px 1px 10px 0px rgba(0, 103, 86, 0.35);
border-radius: 10px;
font-size: 18px;
font-family: PingFang SC;
@ -306,18 +322,18 @@
}
.content_box_body_table .el-table th.el-table__cell {
.content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important;
font-family: PingFang SC !important;
font-weight: 400 !important;
color: #333333 !important;
background: #FAE6E4 !important;
background: #d6eade !important;
}
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
background: #e9f5f3;
width: 100vw;
height: 100vh;
position: relative;
@ -337,7 +353,7 @@
.content_box_header_back {
width: 123px;
height: 49px;
background: #FAE6E4;
background: #d6eade;
border-radius: 24px;
display: flex;
align-items: center;
@ -348,21 +364,21 @@
font-size: 20px;
font-family: PingFang SC;
font-weight: 300;
color: #AE2726;
color: #006756;
line-height: 49px;
margin-left: 13px;
}
}
.content_box_header_title {
background: linear-gradient(90deg, #FAE6E4, #FFFFFF);
background: linear-gradient(90deg, #d6eade, #FFFFFF);
width: 539px;
height: 70px;
line-height: 70px;
font-size: 36px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
color: #006756;
padding-left: 43px;
}
}
@ -383,7 +399,7 @@
.content_box_body_select {
margin-top: 29px;
background: rgba(250, 167, 1, 0.12);
background: #d6eade;
border-radius: 10px;
max-height: 60vh;
min-height: 60vh;
@ -401,7 +417,7 @@
font-size: 20px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
color: #006756;
.content_box_body_select_box_header_left {
display: flex;
@ -449,8 +465,8 @@
.content_box_body_select_box_item_on {
width: 100px;
height: 37px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
background: linear-gradient(0deg, #066c5b, #79c4b7);
box-shadow: 0px 1px 10px 0px rgba(0, 103, 86, 0.35);
border-radius: 19px;
font-family: PingFang SC;
font-weight: 400;
@ -480,7 +496,7 @@
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
color: #006756;
line-height: 16px;
width: 140px;
}
@ -503,10 +519,10 @@
display: flex;
.content_box_body_steps_item {
width: 257px;
height: 80px;
width: 240px;
height: 62px;
display: flex;
line-height: 80px;
line-height: 62px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
@ -514,7 +530,7 @@
margin-right: 25px;
justify-content: center;
align-items: center;
border-bottom: 1px solid #AE2726;
border-bottom: 1px solid #006756;
}
.content_box_body_steps_item_on {
@ -534,7 +550,7 @@
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
height: 50%;
background-size: cover;
position: fixed;
left: 0;
@ -544,8 +560,8 @@
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
width: 395px;
height: 145px;
background-size: cover;
position: fixed;
right: 0;

@ -1,15 +1,15 @@
<template>
<div class="content_box">
<div class="content_box_bottom_logo">
<img src="../../assets/center/index_logo.png" />
</div>
<!-- <div class="content_box_bottom_logo">-->
<!-- <img src="../../assets/center/index_logo.png" />-->
<!-- </div>-->
<div class="content_box_header">
<div class="content_box_bottom_name">
<img src="../../assets/center/index_name.png" />
</div>
<div class="content_box_header_text">
自助借阅系统
</div>
</div>
<div class="content_box_body">
@ -17,7 +17,7 @@
<img class="content_box_body_btn_img" src="../../assets/center/index_brrow.png" />
</div>
<div class="content_box_body_btn" @click="todo('/return')">
<img class="content_box_body_btn_img" src="../../assets/center/index_retrun.png" />
<img class="content_box_body_btn_img" src="../../assets/center/index_return.png" />
</div>
</div>
@ -47,7 +47,7 @@
<style lang="scss" scoped>
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
background: #e9f5f3;
width: 100vw;
height: 100vh;
position: relative;
@ -56,7 +56,7 @@
.content_box_bottom_logo {
position: absolute;
left: 156px;
top: 13.75px;
top:60px !important;
}
.content_box_header {
@ -85,13 +85,12 @@
z-index: 99;
justify-content: space-between;
margin-top: 10%;
padding: 0 5%;
padding: 0 15%;
.content_box_body_btn {
.content_box_body_btn_img {
width: 714*.8px;
height: 384*.8px;
width: 517*.8px;
height: 365*.8px;
}
}
}
@ -101,7 +100,7 @@
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
height: 50%;
background-size: cover;
position: fixed;
left: 0;
@ -111,8 +110,8 @@
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
width: 395px;
height: 145px;
background-size: cover;
position: fixed;
right: 0;

@ -141,19 +141,18 @@
</script>
<style lang="scss">
.content_box_body_table .el-table th.el-table__cell {
.content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important;
font-family: PingFang SC !important;
font-weight: 400 !important;
color: #333333 !important;
background: #FAE6E4 !important;
background: #d6eade !important;
}
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
background: #e9f5f3;
width: 100vw;
height: 100vh;
position: relative;
@ -173,7 +172,7 @@
.content_box_header_back {
width: 123px;
height: 49px;
background: #FAE6E4;
background: #d6eade;
border-radius: 24px;
display: flex;
align-items: center;
@ -184,21 +183,21 @@
font-size: 20px;
font-family: PingFang SC;
font-weight: 300;
color: #AE2726;
color: #066c5b;
line-height: 49px;
margin-left: 13px;
}
}
.content_box_header_title {
background: linear-gradient(90deg, #FAE6E4, #FFFFFF);
background: linear-gradient(90deg, #d6eade, #FFFFFF);
width: 539px;
height: 70px;
line-height: 70px;
font-size: 36px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
color: #066c5b;
padding-left: 43px;
}
}
@ -227,8 +226,8 @@
.content_box_body_table_footer_btn {
width: 180px;
height: 55px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
background: linear-gradient(0deg, #066c5b, #79c4b7);
box-shadow: 0px 1px 10px 0px rgba(0, 103, 86, 0.35);
border-radius: 10px;
font-size: 18px;
font-family: PingFang SC;
@ -252,7 +251,7 @@
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
color: #066c5b;
line-height: 16px;
width: 140px;
}
@ -287,7 +286,7 @@
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
height: 50%;
background-size: cover;
position: fixed;
left: 0;
@ -297,8 +296,8 @@
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
width: 395px;
height: 145px;
background-size: cover;
position: fixed;
right: 0;

@ -1,5 +1,5 @@
<template>
<div class="login-container">
<div class="login-container" v-if='showLogin'>
<vue-particles color="#ffffff" :particleOpacity="0.7" :particlesNumber="80" shapeType="circle" :particleSize="4"
linesColor="#ffffff" :linesWidth="1" :lineLinked="true" :lineOpacity="0.4" :linesDistance="150" :moveSpeed="3"
@ -64,6 +64,7 @@
}
return {
title: "",
showLogin:true,
loginForm: {
username: '',
password: ''

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/g-guangdian/app/b-bookmanage/book-manage-service/public/admin',
outputDir: './dist',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save