12 changed files with 1401 additions and 133 deletions
-
42src/assets/iconfonts/light/iconfont.css
-
2src/assets/iconfonts/light/iconfont.js
-
63src/assets/iconfonts/light/iconfont.json
-
BINsrc/assets/iconfonts/light/iconfont.ttf
-
BINsrc/assets/iconfonts/light/iconfont.woff
-
BINsrc/assets/iconfonts/light/iconfont.woff2
-
BINsrc/assets/images/screen/geo.png
-
297src/assets/styles/digitalScreen.scss
-
2src/assets/styles/sidebar.scss
-
571src/views/digitalScreen/index.vue
-
154src/views/digitalScreen/module/addBookDialog.vue
-
403src/views/digitalScreen/module/areaSetting.vue
2
src/assets/iconfonts/light/iconfont.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
After Width: 545 | Height: 285 | Size: 13 KiB |
@ -0,0 +1,297 @@ |
|||
.config-title{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
color: #0c0e1e; |
|||
height: 32px; |
|||
line-height: 32px; |
|||
margin-bottom: 16px; |
|||
overflow: hidden; |
|||
p{ |
|||
font-weight: bold; |
|||
width: 90px; |
|||
} |
|||
.title-readonly { |
|||
width: 600px; |
|||
height: 32px; |
|||
line-height: 32px; |
|||
padding: 0 15px; |
|||
border: 1px solid #dcdfe6; |
|||
border-radius: 4px; |
|||
background-color: #fff; |
|||
cursor: default; |
|||
white-space: nowrap; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
color: #606266; |
|||
font-size: 13px; |
|||
} |
|||
.double-click-btn{ |
|||
margin: 0 0 0 20px; |
|||
color: #f56c6c; |
|||
} |
|||
} |
|||
|
|||
.screen-content-title{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
border-left: 3px solid #0348F3; |
|||
line-height: 30px; |
|||
padding-left: 10px; |
|||
font-size: 14px; |
|||
h4{ |
|||
font-size: 18px; |
|||
color: #0c0e1e; |
|||
margin-right: 10px; |
|||
} |
|||
.el-tag{ |
|||
margin-right: 10px; |
|||
} |
|||
.el-tag--small{ |
|||
background-color: #e7faf0; |
|||
border-color: #d0f5e0; |
|||
color: #12C47A; |
|||
} |
|||
.el-tag--danger{ |
|||
background-color: #ffeded; |
|||
border-color: #f65163; |
|||
color: #f65163; |
|||
} |
|||
p{ |
|||
span{ |
|||
display: inline-block; |
|||
padding: 0 3px; |
|||
font-weight: bold; |
|||
color: #0348F3; |
|||
} |
|||
} |
|||
} |
|||
.screen-remarks{ |
|||
margin-top: 12px; |
|||
padding: 8px; |
|||
background-color: #EEF5FE; |
|||
font-size: 14px; |
|||
line-height: 22px; |
|||
border-radius: 4px; |
|||
} |
|||
.area-config{ |
|||
.config-item{ |
|||
padding: 15px 0; |
|||
} |
|||
.config-item-main{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: flex-start; |
|||
line-height: 32px; |
|||
.data-title{ |
|||
display: block; |
|||
width: 80px; |
|||
text-align: right; |
|||
margin-right: 20px; |
|||
} |
|||
|
|||
.el-radio-group{ |
|||
.el-radio{ |
|||
line-height: 32px; |
|||
} |
|||
} |
|||
} |
|||
.library-form{ |
|||
padding-left: 70px; |
|||
margin-top: 10px; |
|||
.el-input{ |
|||
width: 240px !important; |
|||
} |
|||
.config-remarks{ |
|||
margin-left: 100px; |
|||
} |
|||
.edit-readonly { |
|||
width: 240px !important; |
|||
} |
|||
} |
|||
.el-form{ |
|||
.el-input{ |
|||
width: 340px; |
|||
margin-right: 20px; |
|||
} |
|||
.edit-readonly{ |
|||
width: 340px; |
|||
} |
|||
::v-deep .el-form-item__content{ |
|||
height: 40px; |
|||
overflow: hidden; |
|||
} |
|||
} |
|||
|
|||
.edit-readonly { |
|||
display: inline-block; |
|||
height: 32px; |
|||
line-height: 32px; |
|||
padding: 0 15px; |
|||
border: 1px solid #dcdfe6; |
|||
border-radius: 4px; |
|||
background-color: #fff; |
|||
margin-right: 20px; |
|||
cursor: default; |
|||
color: #606266; |
|||
font-size: 13px; |
|||
&:hover { |
|||
border-color: #c0c4cc; |
|||
} |
|||
} |
|||
|
|||
.config-remarks{ |
|||
font-size: 12px; |
|||
line-height: 18px; |
|||
color: #9098a4; |
|||
margin-left: 200px; |
|||
} |
|||
.upload-item{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
p{ |
|||
width: 100px; |
|||
text-align: right; |
|||
font-size: 14px; |
|||
color: #606266; |
|||
padding: 0 12px 0 0; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
.avatar-uploader { |
|||
::v-deep .el-upload { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
&:hover { |
|||
border-color: #409EFF; |
|||
} |
|||
} |
|||
} |
|||
.avatar-uploader-icon { |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 100px; |
|||
height: 100px; |
|||
line-height: 100px; |
|||
text-align: center; |
|||
} |
|||
.avatar { |
|||
width: 100px; |
|||
height: 100px; |
|||
display: block; |
|||
} |
|||
|
|||
.book-list-upload{ |
|||
display: flex; |
|||
flex-wrap: nowrap; |
|||
gap: 10px; |
|||
overflow-x: auto; // 超出宽度时显示横向滚动条 |
|||
scrollbar-width: thin; |
|||
max-width: 1000px; |
|||
} |
|||
.book-swiper-wrapper { |
|||
position: relative; |
|||
// width: 100%; |
|||
max-width: 970px; |
|||
overflow: hidden; |
|||
} |
|||
.book-swiper { |
|||
width: 100%; |
|||
} |
|||
.book-list-item{ |
|||
position: relative; |
|||
width: 110px; |
|||
height: 160px; |
|||
flex-shrink: 0; // 禁止压缩,保持固定尺寸 |
|||
overflow: hidden; |
|||
border: 1px solid #fff; |
|||
border-radius: 4px; |
|||
transition: all 0.2s; |
|||
&:hover { |
|||
border-color: #0348F3; // hover时高亮边框 |
|||
box-shadow: 0 2px 8px rgba(3, 72, 243, 0.1); |
|||
} |
|||
img{ |
|||
display: block; |
|||
width: 100%; |
|||
height: 100%; |
|||
object-fit: cover; |
|||
} |
|||
.book-select, .book-delete { |
|||
position: absolute; |
|||
bottom: 3px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
cursor: default; |
|||
transition: all 0.2s; |
|||
z-index: 10; |
|||
.iconfont{ |
|||
font-size: 18px; |
|||
} |
|||
} |
|||
.book-select { |
|||
left: 3px; |
|||
.icon-wancheng { |
|||
display: none; |
|||
color: #0348F3; |
|||
} |
|||
.icon-weixuan { |
|||
color: #A6ADB6; |
|||
} |
|||
} |
|||
|
|||
.book-delete { |
|||
right: 3px; |
|||
.icon-shanchu { |
|||
font-size: 16px; |
|||
color: #ED4A41; |
|||
} |
|||
} |
|||
// 选中状态样式 |
|||
&:has(.icon-wancheng:not([style*="display: none"])) { |
|||
.icon-wancheng { |
|||
display: block; |
|||
} |
|||
.icon-weixuan { |
|||
display: none; |
|||
} |
|||
border-color: #0348F3; |
|||
} |
|||
} |
|||
.book-upload-btn{ |
|||
width: 160px; |
|||
height: 160px; |
|||
text-align: center; |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
margin: 0 0 0 10px; |
|||
.iconfont { |
|||
line-height: 160px; |
|||
font-size: 30px; |
|||
color: #8c939d; |
|||
} |
|||
} |
|||
.book-recommend{ |
|||
position: relative; |
|||
padding-bottom: 40px; |
|||
} |
|||
.batch-delete-btn{ |
|||
position: absolute; |
|||
bottom: 0; |
|||
left: 100px; |
|||
} |
|||
} |
|||
|
|||
// 输入框聚焦样式增强 |
|||
::v-deep .el-input__inner:focus { |
|||
border-color: #0348f3; |
|||
box-shadow: 0 0 0 2px rgba(3, 72, 243, 0.2); |
|||
} |
@ -0,0 +1,154 @@ |
|||
<template> |
|||
<el-dialog class="auto-dialog" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :before-close="handleClose" :visible.sync="addBookDialogVisible" title="新增图书推荐"> |
|||
<div class="setting-dialog"> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="90px"> |
|||
<div style="width: 696px;"> |
|||
<el-form-item label="题名" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<el-form-item label="著者" prop="author"> |
|||
<el-input v-model="form.author" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<el-form-item label="ISBN" prop="isbn"> |
|||
<el-input v-model="form.isbn" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<el-form-item label="分类号" prop="classNo"> |
|||
<el-input v-model="form.classNo" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<el-form-item label="出版年份" prop="publishYear"> |
|||
<el-input v-model="form.publishYear" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<div> |
|||
<el-form-item label="出版社" prop="publisher"> |
|||
<el-input v-model="form.publisher" placeholder="请输入" style="width: 586px;" /> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="简介" prop="remarks"> |
|||
<el-input v-model="form.remarks" type="textarea" row="4" placeholder="请输入" style="width: 586px;" /> |
|||
</el-form-item> |
|||
</div> |
|||
<UploadCover :label-name="labelName" :form="form" upload-type="book" @childCover="handleCover" /> |
|||
</div> |
|||
<div v-if="form.bookCover" class="preview-cover"> |
|||
<p>封面预览</p> |
|||
<img :src="bookCover" alt=""> |
|||
</div> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="handleClose">取消</el-button> |
|||
<el-button :loading="btnLoading" type="primary" @click="handleComfired">确认</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import UploadCover from '@/views/components/upload.vue' |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name: 'Book', |
|||
components: { UploadCover }, |
|||
data() { |
|||
return { |
|||
btnLoading: false, |
|||
addBookDialogVisible: false, |
|||
form: { id: null, title: null, author: null, isbn: null, classNo: null, publishYear: null, publisher: null, bookCover: null, bookRecNo: null, remarks: null }, |
|||
bookCover: null, |
|||
labelName: '图书封面', |
|||
rules: { |
|||
title: [ |
|||
{ required: true, message: '题名不可为空', trigger: 'blur' } |
|||
], |
|||
// author: [ |
|||
// { required: true, message: '著者不可为空', trigger: 'blur' } |
|||
// ], |
|||
isbn: [ |
|||
{ required: true, message: 'ISBN不可为空', trigger: 'blur' } |
|||
] |
|||
// classNo: [ |
|||
// { required: true, message: '分类号不可为空', trigger: 'blur' } |
|||
// ], |
|||
// publisher: [ |
|||
// { required: true, message: '出版社不可为空', trigger: 'blur' } |
|||
// ] |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'baseApi' |
|||
]) |
|||
}, |
|||
created() { |
|||
}, |
|||
methods: { |
|||
handleCover(value) { |
|||
console.log(value) |
|||
if (value) { |
|||
this.form.bookCover = value |
|||
this.bookCover = this.baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + value + '.jpg' |
|||
} else { |
|||
this.form.bookCover = null |
|||
this.bookCover = null |
|||
} |
|||
}, |
|||
handleClose() { |
|||
this.addBookDialogVisible = false |
|||
}, |
|||
handleComfired() { |
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
this.addBookDialogVisible = false |
|||
// const ids = [] |
|||
// this.selectBookData.forEach(val => { |
|||
// ids.push(val.id) |
|||
// }) |
|||
// const params = { |
|||
// 'gridId': this.selectGridVal.id, |
|||
// 'ids': ids |
|||
// } |
|||
// console.log('params', params) |
|||
// FetchManualShelving(params).then(() => { |
|||
// this.$message({ message: '批量上架成功', type: 'success', offset: 8 }) |
|||
// this.handleCloseDialog() |
|||
// }).catch(err => { |
|||
// console.log(err) |
|||
// this.addBookDialogVisible = false |
|||
// }) |
|||
} else { |
|||
console.log('error submit!!') |
|||
return false |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.auto-dialog{ |
|||
::v-deep .el-dialog{ |
|||
width: initial; |
|||
} |
|||
} |
|||
.el-form{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
} |
|||
.preview-cover{ |
|||
flex: 1; |
|||
padding-left: 10px; |
|||
p{ |
|||
font-weight: bold; |
|||
color: #0c0e1e; |
|||
margin: -14px 0 10px 0; |
|||
} |
|||
img{ |
|||
display: block; |
|||
height: 180px; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,403 @@ |
|||
<template> |
|||
<div> |
|||
<div class="config-item"> |
|||
<div class="config-item-main"> |
|||
<span class="data-title">地图DataV</span> |
|||
<el-form ref="areaForm" class="areaForm" :model="areaForm" size="small" label-width="100px"> |
|||
<el-form-item label="GeoJSON" prop="geoJSON"> |
|||
<span |
|||
v-if="!editStatus.areaForm.geoJSON" |
|||
class="edit-readonly" |
|||
@dblclick="handleDblClick('areaForm', 'geoJSON')" |
|||
> |
|||
{{ areaForm.geoJSON || '' }} |
|||
</span> |
|||
<el-input |
|||
v-else |
|||
ref="areaFormgeoJSON" |
|||
v-model="areaForm.geoJSON" |
|||
type="textarea" |
|||
rows="5" |
|||
@blur="handleBlur('areaForm', 'geoJSON')" |
|||
@keyup.enter="handleBlur('areaForm', 'geoJSON')" |
|||
/> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<div class="config-remarks">双击输入框可进行编辑。数据将用于“区域屏”,显示区域地图。<i class="iconfont icon-zhuyi-lan" @click="geoJsonVisible=true" /></div> |
|||
</div> |
|||
<div class="config-item"> |
|||
<div class="config-item-main"> |
|||
<span class="data-title">总分馆管理</span> |
|||
<div class="upload-item" style="align-items: flex-start;"> |
|||
<p>总分馆列表</p> |
|||
<el-card class="box-card" style="padding: 20px;"> |
|||
<el-table |
|||
:data="tableData" |
|||
style="width: 100%" |
|||
max-height="360" |
|||
> |
|||
<el-table-column type="selection" align="center" width="55" /> |
|||
<el-table-column prop="name" label="名称" width="150" /> |
|||
<el-table-column prop="libCode" label="馆代码" width="100" /> |
|||
<el-table-column prop="province" label="坐标" width="200" /> |
|||
<el-table-column prop="number" label="宣传图片" width="80" /> |
|||
<el-table-column fixed="right" label="操作" width="100"> |
|||
<template> |
|||
<!-- slot-scope="scope" --> |
|||
<el-button style="padding: 5px 6px !important;"><i class="iconfont icon-bianji" />编辑</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
style="margin: 34px 0 10px 0 !important;" |
|||
:current-page="page.page" |
|||
:total="page.total" |
|||
:page-size="page.size" |
|||
:pager-count="5" |
|||
layout="total, prev, pager, next, sizes" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentPage" |
|||
/> |
|||
</el-card> |
|||
<!-- @click="toDelete(crud.selections)" --> |
|||
<div style="display: flex; flex-direction: column; justify-content: flex-start; margin-left: 15px;"> |
|||
<el-button size="mini" @click="libDialogVisible=true"> |
|||
<i class="iconfont icon-xinzeng" /> |
|||
新增 |
|||
</el-button> |
|||
<el-button size="mini" style="margin-left: 0; margin-top: 14px;"> |
|||
<i class="iconfont icon-shanchu" /> |
|||
删除 |
|||
</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-dialog class="geoJson-dialog" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :before-close="handleClose" :visible.sync="geoJsonVisible" title="地图GeoJSON获取方法"> |
|||
<div class="setting-dialog geo-remarks"> |
|||
<p>1.开发网址: |
|||
<a |
|||
:href="link" |
|||
target="_blank" |
|||
rel="noopener noreferrer" |
|||
class="external-link" |
|||
> |
|||
{{ link }} |
|||
</a> |
|||
<i class="iconfont" :class="copied ? 'icon-fuzhichenggong1' : 'icon-fuzhi'" @click="copyLink" /> |
|||
</p> |
|||
<p style="padding: 15px 0;">2.在地图上找到并选择正确的区域(区域最小单位是:区/县)</p> |
|||
<div style="display: flex; justify-content: space-between;"> |
|||
<p>3.在右侧工具栏中找到:<br> |
|||
“其他类型(GeoJSON、SVG)”<br> |
|||
点击下方的“GeoJSON”后面的按钮<br> |
|||
复制代码,粘贴到此处即可。</p> |
|||
<img src="@/assets/images/screen/geo.png" alt=""> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<el-dialog class="auto-dialog" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :before-close="handleClose" :visible.sync="libDialogVisible" title="新增分管"> |
|||
<div class="setting-dialog"> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="90px"> |
|||
<div style="width: 696px;"> |
|||
<div> |
|||
<el-form-item label="名称" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入" style="width: 586px;" /> |
|||
</el-form-item> |
|||
</div> |
|||
<el-form-item label="类型" prop="type"> |
|||
<el-radio-group v-model="form.type" aria-hidden="false"> |
|||
<el-radio :label="1">总馆</el-radio> |
|||
<el-radio :label="2">分馆</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="馆代码" prop="libCode" style="margin-left: 30px; margin-right: 0 !important;"> |
|||
<el-input v-model="form.libCode" placeholder="请输入" /> |
|||
</el-form-item> |
|||
<div> |
|||
<el-form-item label="面积" prop="areaNum"> |
|||
<el-input v-model="form.areaNum" placeholder="请输入" style="width: 586px;"> |
|||
<template slot="append">平方米</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="地址" prop="place"> |
|||
<el-input v-model="form.place" placeholder="请输入" style="width: 586px;" /> |
|||
</el-form-item> |
|||
</div> |
|||
<div class="location-item"> |
|||
<el-form-item label="坐标" prop="location"> |
|||
<el-input v-model="form.location.x" placeholder="请输入"> |
|||
<template slot="prepend">X</template> |
|||
</el-input> |
|||
<el-input v-model="form.location.y" placeholder="请输入"> |
|||
<template slot="prepend">Y</template> |
|||
</el-input> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="简介" prop="remarks"> |
|||
<el-input v-model="form.remarks" type="textarea" rows="4" placeholder="请输入" style="width: 586px;" /> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="宣传图片" prop="remarks" /> |
|||
<!--<div class="upload-container"> |
|||
<i v-if="fileList.length === 0" class="iconfont icon-tianjiawenjian upload-icon" /> |
|||
<div v-for="item in fileList" :key="item.name" class="file-list"> |
|||
<i class="iconfont icon-xiaowenjian" /> |
|||
{{ item.name }} |
|||
<i class="el-icon-close" @click="deleteFile(item)" /> |
|||
</div> |
|||
<div class="upload-input"> |
|||
<input ref="fileInput" type="file" multiple @change="changeAiFile"> |
|||
<div class="upload-zip"><i class="iconfont icon-shangchuan2" />点击上传</div> |
|||
</div> |
|||
</div> --> |
|||
</div> |
|||
</div> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="handleClose">取消</el-button> |
|||
<el-button :loading="btnLoading" type="primary" @click="handleComfired">确认</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name: 'AreaSetting', |
|||
components: { }, |
|||
data() { |
|||
return { |
|||
areaForm: { |
|||
geoJSON: null |
|||
}, |
|||
editStatus: { |
|||
areaForm: { |
|||
geoJSON: false |
|||
} |
|||
}, |
|||
originalValues: { |
|||
areaForm: {} |
|||
}, |
|||
geoJsonVisible: false, |
|||
link: 'https://datav.aliyun.com/portal/school/atlas/area_selector', |
|||
copied: false, |
|||
tableData: [{ |
|||
name: '总管', |
|||
libCode: 'lib001', |
|||
province: '114.133561,30.641408', |
|||
number: '3' |
|||
}, { |
|||
name: '分管1', |
|||
libCode: 'lib001', |
|||
province: '114.133561,30.641408', |
|||
number: '3' |
|||
}], |
|||
page: { |
|||
page: 1, |
|||
size: 10, |
|||
total: 0 |
|||
}, |
|||
libDialogVisible: false, |
|||
form: { |
|||
title: '', |
|||
type: 1, |
|||
libCode: '', |
|||
areaNum: '', |
|||
place: '', |
|||
location: { x: '', y: '' }, |
|||
remarks: '' |
|||
}, |
|||
rules: { |
|||
title: [ |
|||
{ required: true, message: '名称不可为空', trigger: 'blur' } |
|||
], |
|||
type: [ |
|||
{ required: true, message: '请选择类型', trigger: 'change' } |
|||
], |
|||
libCode: [ |
|||
{ required: true, message: '馆代码不可为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'baseApi' |
|||
]) |
|||
}, |
|||
created() { |
|||
}, |
|||
methods: { |
|||
// 双击进入编辑模式 |
|||
handleDblClick(formName, field) { |
|||
// 记录原始值(用于恢复) |
|||
this.originalValues[formName][field] = this[formName][field] |
|||
// 开启编辑状态 |
|||
this.editStatus[formName][field] = true |
|||
// 聚焦输入框 |
|||
this.$nextTick(() => { |
|||
const input = this.$refs[`${formName}${field}`] |
|||
if (input) input.focus() |
|||
}) |
|||
}, |
|||
// 失焦/回车保存编辑 |
|||
handleBlur(formName, field) { |
|||
// 关闭编辑状态 |
|||
this.editStatus[formName][field] = false |
|||
// 对比新值与原始值,有变化则执行保存逻辑 |
|||
if (this[formName][field] !== this.originalValues[formName][field]) { |
|||
this.saveEdit(formName, field) |
|||
} |
|||
}, |
|||
|
|||
// 保存编辑 |
|||
saveEdit(formName, field) { |
|||
const value = this[formName][field] |
|||
console.log(`保存${formName}.${field}:`, value) |
|||
if (!value) { |
|||
this.$message.warning(`${this.getFieldLabel(formName, field)}不能为空`) |
|||
this[formName][field] = this.originalValues[formName][field] |
|||
return |
|||
} |
|||
this.$message.success(`${this.getFieldLabel(formName, field)}更新成功`) |
|||
}, |
|||
handleClose() { |
|||
this.geoJsonVisible = false |
|||
this.libDialogVisible = false |
|||
}, |
|||
copyLink() { |
|||
// 复制链接到剪贴板 |
|||
navigator.clipboard.writeText(this.link) |
|||
.then(() => { |
|||
this.copied = true |
|||
// 2秒后恢复复制图标 |
|||
setTimeout(() => { |
|||
this.copied = false |
|||
}, 2000) |
|||
}) |
|||
.catch(err => { |
|||
console.error('无法复制内容: ', err) |
|||
// 兼容不支持clipboard API的浏览器 |
|||
this.fallbackCopyText() |
|||
}) |
|||
}, |
|||
// 浏览器不支持Clipboard API时的备用方法 |
|||
fallbackCopyText() { |
|||
const textArea = document.createElement('textarea') |
|||
textArea.value = this.link |
|||
textArea.style.position = 'fixed' |
|||
document.body.appendChild(textArea) |
|||
textArea.focus() |
|||
textArea.select() |
|||
|
|||
try { |
|||
const successful = document.execCommand('copy') |
|||
this.copied = successful |
|||
if (successful) { |
|||
setTimeout(() => { |
|||
this.copied = false |
|||
}, 2000) |
|||
} |
|||
} catch (err) { |
|||
console.error('复制失败: ', err) |
|||
} |
|||
|
|||
document.body.removeChild(textArea) |
|||
}, |
|||
handleSizeChange(size) { |
|||
this.page.size = size |
|||
this.page.page = 1 |
|||
}, |
|||
handleCurrentPage(val) { |
|||
this.page.page = val |
|||
}, |
|||
handleComfired() { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "~@/assets/styles/digitalScreen.scss"; |
|||
.edit-readonly{ |
|||
width: 800px !important; |
|||
height: 110px !important; |
|||
line-height: 20px !important; |
|||
overflow: hidden; |
|||
overflow-y: scroll; |
|||
} |
|||
.areaForm{ |
|||
::v-deep .el-form-item__content { |
|||
width: 800px !important; |
|||
height: 110px !important; |
|||
} |
|||
} |
|||
|
|||
.icon-zhuyi-lan{ |
|||
font-size: 20px; |
|||
color: #0348f3; |
|||
} |
|||
.geoJson-dialog{ |
|||
::v-deep .el-dialog{ |
|||
width: 850px; |
|||
.el-dialog__body{ |
|||
padding: 10px 0 20px 0; |
|||
} |
|||
} |
|||
|
|||
} |
|||
.geo-remarks{ |
|||
font-size: 14px; |
|||
line-height: 30px; |
|||
.external-link { |
|||
color: #0348f3; /* Vue的默认主题色 */ |
|||
text-decoration: none; |
|||
} |
|||
.external-link:hover { |
|||
text-decoration: underline; |
|||
} |
|||
.iconfont{ |
|||
cursor: pointer; |
|||
margin-left: 6px; |
|||
font-size: 18px; |
|||
} |
|||
.icon-fuzhichenggong1{ |
|||
font-size: 20px; |
|||
} |
|||
} |
|||
::v-deep .el-table tr .el-table__cell{ |
|||
padding: 8px 0 !important; |
|||
} |
|||
.location-item{ |
|||
::v-deep .el-form-item{ |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
margin-right: 0 !important; |
|||
.el-form-item__label{ |
|||
|
|||
} |
|||
.el-form-item__content{ |
|||
width: 586px !important; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
.el-input:first-child{ |
|||
margin-right: 20px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue