Browse Source

收集库

master
xuhuajiao 2 years ago
parent
commit
75c02bdcb7
  1. 1
      src/assets/styles/archives-manage.scss
  2. 6
      src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
  3. 122
      src/views/collectReorganizi/collectionLibrary/file/index.vue
  4. 197
      src/views/collectReorganizi/collectionLibrary/file/tableJson.json
  5. 7
      src/views/collectReorganizi/collectionLibrary/index.vue
  6. 26
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  7. 38
      src/views/collectReorganizi/collectionLibrary/module/quickPaper/index.vue

1
src/assets/styles/archives-manage.scss

@ -711,6 +711,7 @@
.collect-header{ .collect-header{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 73px;
padding: 20px 10px 0 20px; padding: 20px 10px 0 20px;
border-top: 1px solid #EDEFF3; border-top: 1px solid #EDEFF3;
h4{ h4{

6
src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue

@ -97,9 +97,15 @@ export default {
}, },
watch: { watch: {
selectedCategory: function(newValue, oldValue) { selectedCategory: function(newValue, oldValue) {
this.selections = []
this.$refs.table.clearSelection()
}, },
tableDisplayFields(val) { tableDisplayFields(val) {
this.doLayout() this.doLayout()
},
activeIndex(newValue) {
this.selections = []
this.$refs.table.clearSelection()
} }
}, },
created() { created() {

122
src/views/collectReorganizi/collectionLibrary/file/index.vue

@ -8,16 +8,74 @@
direction="rtl" direction="rtl"
:size="selectedCategory.isType === 3 ? '80%' : selectedCategory.isType === 5 ? '90%' : '70%'" :size="selectedCategory.isType === 3 ? '80%' : selectedCategory.isType === 5 ? '90%' : '70%'"
> >
<CollectHeader :is-title-type="isTitleType" :selected-category="selectedCategory" />
<CollectHeader :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" />
<span class="closed-btn" @click="closeDrawer" /> <span class="closed-btn" @click="closeDrawer" />
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="fileData"
highlight-current-row
style="width: 100%;"
:row-class-name="tableRowClassName"
:row-key="rowKey"
@select-all="selectAll"
@selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
@select="handleCurrentChange"
>
<el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" align="center" />
<el-table-column prop="file_type" label="格式" min-width="60" align="center" />
<el-table-column prop="file_size" label="大小" min-width="85" align="center">
<template slot-scope="scope">
{{ (scope.row.file_size / 1024).toFixed(2) + 'kB' }}
</template>
</el-table-column>
<el-table-column prop="file_dpi" label="尺寸" min-width="85" align="center">
<template slot-scope="scope">
<div v-if="!scope.row.file_dpi"> - </div>
<div v-else> {{ scope.row.file_dpi }} </div>
</template>
</el-table-column>
<el-table-column prop="file_thumbnail" label="缩览图" min-width="60" align="center">
<template slot-scope="scope">
<div v-if="scope.row.file_type === 'jpg' || scope.row.file_type === 'jpeg' || scope.row.file_type === 'png' || scope.row.file_type === 'bmp'|| scope.row.file_type === 'gif'">
<img width="60px" height="32px" class="screenshot" :src="baseApi+ '/downloadFile' +scope.row.file_path" :onerror="defaultImg" @click="showCoverPreview(scope.row)">
</div>
<div v-else>
<svg-icon icon-class="fujian" class-name="svg-style" />
</div>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="110" align="center" />
</el-table>
<!--分页组件-->
<el-pagination
: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-drawer> </el-drawer>
</template> </template>
<script> <script>
import { header, form } from '@crud/crud'
import CollectHeader from '../module/collectHeader.vue' import CollectHeader from '../module/collectHeader.vue'
import tableData from './tableJson.json'
export default { export default {
name: 'File', name: 'File',
components: { CollectHeader }, components: { CollectHeader },
mixins: [
header(),
form({})
],
props: { props: {
selectedCategory: { selectedCategory: {
type: Object, type: Object,
@ -29,16 +87,72 @@ export default {
data() { data() {
return { return {
isTitleType: 6, isTitleType: 6,
fileDrawer: false
fileDrawer: false,
fileData: [],
getTableDisplayFieldsLoading: false, // table-loading
selections: [],
page: {
page: 1,
size: 10,
total: 0
}
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
} }
}, },
created() { created() {
this.fileData = tableData.data.returnlist
}, },
mounted() { mounted() {
}, },
methods: { methods: {
closeDrawer() { closeDrawer() {
this.fileDrawer = false this.fileDrawer = false
},
handleSelect(key, keyPath) {
console.log(key, keyPath)
},
rowKey(row) {
return row.id
},
// table
tableRowClassName({ row, rowIndex }) {
let color = ''
this.selections.forEach(item => {
if (item.id === row.id) {
color = 'rowStyle'
}
})
return color
},
// table -
selectAll(val) {
this.selections = val
},
// table -
tableDoubleClick(row) {
console.log('tableDoubleClick', row)
// this.arcId = row.id
console.log(this.selectedCategory.isType)
},
// table - row
clickRowHandler(row) {
console.log('clickRowHandler', row)
this.selections = this.crud.selections
},
//
handleCurrentChange(selection, row) {
console.log('触发单选', row)
this.selections = selection
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
},
handleCurrentPage(val) {
this.page.page = val
} }
} }
} }
@ -48,4 +162,8 @@ export default {
::v-deep .el-drawer__body{ ::v-deep .el-drawer__body{
padding-top: 56px; padding-top: 56px;
} }
.svg-style{
width: 60px;
height: 32px;
}
</style> </style>

197
src/views/collectReorganizi/collectionLibrary/file/tableJson.json

@ -0,0 +1,197 @@
{
"code": 200,
"message": "操作成功",
"data": {
"queryShow": [
{
"id": "B364CE97D2AB807CE91EB2",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_name",
"fieldCnName": "原文名称",
"isDefaultValue": "",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 255,
"isColumnType": 3,
"isSequence": 1,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "3549E5DB7212DCFABFD5BD",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_size",
"fieldCnName": "原文大小",
"isDefaultValue": "",
"isDataType": 2,
"isDataTypeDetails": "int",
"isColumnLength": 11,
"isColumnType": 3,
"isSequence": 2,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "CCC09BD40D3E53A97FEBEB",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_type",
"fieldCnName": "原文类型",
"isDefaultValue": "",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 50,
"isColumnType": 3,
"isSequence": 3,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "426777CBDB63BDC09157BA",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_path",
"fieldCnName": "原文路径",
"isDefaultValue": "",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 255,
"isColumnType": 3,
"isSequence": 4,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "ECCE0B935CA897CBC0DBF2",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "sequence",
"fieldCnName": "原文序号",
"isDefaultValue": "",
"isDataType": 2,
"isDataTypeDetails": "int",
"isColumnLength": 11,
"isColumnType": 3,
"isSequence": 5,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "F1CAA516797C775110FC02",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "archive_id",
"fieldCnName": "档案id",
"isDefaultValue": "",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 50,
"isColumnType": 3,
"isSequence": 6,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "6F0941F24D2758470E8478",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_dpi",
"fieldCnName": "分辨率",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 100,
"isColumnType": 3,
"isSequence": 7,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "FC38D5417DADFB1F077FC1",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "file_thumbnail",
"fieldCnName": "缩略图",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 255,
"isColumnType": 3,
"isSequence": 8,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
},
{
"id": "0DDBD51BC51844050364D8",
"categoryId": "DA92B36D1AE9BC95FC6B26",
"fieldName": "create_time",
"fieldCnName": "创建时间",
"isDataType": 1,
"isDataTypeDetails": "varchar",
"isColumnLength": 255,
"isColumnType": 3,
"isSequence": 9,
"isType": 3,
"isSystem": true,
"isInput": true,
"createBy": "admin",
"updatedBy": "admin",
"createTime": 1661222927000,
"updateTime": 1661222927000
}
],
"returnlist": [
{
"file_path": "/0/0ED1F5CF0EBAC01B914132/4619D58B908B0031C42C36/699CD61A5E0320DB77600E/DA92B36D1AE9BC95FC6B26/1e61676a-73cd-40a4-8014-4c38db4dca2e.pdf",
"create_time": "2022-9-6 15:33:12",
"file_name": "阿里前端开发规范.pdf",
"file_type": "pdf",
"id": "3A611D8AD8E516F1D4776A",
"archive_id": "547371155E0D8A4DF9BB13",
"file_size": 402460
},
{
"file_path": "/0/0ED1F5CF0EBAC01B914132/4619D58B908B0031C42C36/699CD61A5E0320DB77600E/DA92B36D1AE9BC95FC6B26/1e61676a-73cd-40a4-8014-4c38db4dca2e.pdf",
"create_time": "2022-9-6 15:33:12",
"file_name": "阿里前端开发规范.pdf",
"file_type": "pdf",
"id": "3A611D8AD8E516F1D4776B",
"archive_id": "547371155E0D8A4DF9BB13",
"file_size": 402460
}
]
},
"timestamp": 1690439465603
}

7
src/views/collectReorganizi/collectionLibrary/index.vue

@ -268,6 +268,10 @@ export default {
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
} }
[data-theme=dark] .arc-tree-01{
height: 370px;
}
.arc-tree-02{ .arc-tree-02{
height: calc(100vh - 720px); height: calc(100vh - 720px);
overflow: hidden; overflow: hidden;
@ -280,4 +284,7 @@ export default {
[data-theme=light] .elect-cont-right { [data-theme=light] .elect-cont-right {
padding: 20px 0 !important; padding: 20px 0 !important;
} }
[data-theme=dark] .elect-cont-right {
margin-top: 0 !important;
}
</style> </style>

26
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -56,7 +56,7 @@
<el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.isType !== 5" class="collect-submenu-group submenu-tree"> <el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.isType !== 5" class="collect-submenu-group submenu-tree">
<template slot="title">组卷</template> <template slot="title">组卷</template>
<el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item> <el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
<el-menu-item index="2-13">手工组卷</el-menu-item>
<el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu index="3"> <el-submenu index="3">
@ -68,7 +68,7 @@
<el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item> <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
<el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-2" @click="handlePrint">打印</el-menu-item> <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-2" @click="handlePrint">打印</el-menu-item>
<el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-3" @click="handleFourTest">四性检测</el-menu-item> <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-3" @click="handleFourTest">四性检测</el-menu-item>
<el-menu-item v-if="isTitleType === 6" index="3-4">下载</el-menu-item>
<el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
<el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" class="collect-submenu-group submenu-tree"> <el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.isType === 3 || selectedCategory.isType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" class="collect-submenu-group submenu-tree">
<template slot="title">电子文件目录</template> <template slot="title">电子文件目录</template>
@ -413,6 +413,7 @@ export default {
}, },
// //
fileUpload(uploadType) { fileUpload(uploadType) {
if (this.isTitleType !== 6) {
if (this.selections.length === 0) { if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!') this.$message('您还未勾选需要操作的条目,请先确认!')
return false return false
@ -421,6 +422,8 @@ export default {
this.$message('编辑操作只可勾选唯一目标条目,请先确认!') this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
return false return false
} }
}
if (uploadType === 0) { if (uploadType === 0) {
this.$refs.uploadOriginalRef.uploadTitle = '普通上传' this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
} else if (uploadType === 1) { } else if (uploadType === 1) {
@ -512,6 +515,10 @@ export default {
}, },
// 退 // 退
handleReturn() { handleReturn() {
if (this.selections.length > 1 || this.selections.length === 0) {
this.$message('该操作只可勾选唯一目标条目,请先确认!')
return false
}
this.returnVisible = true this.returnVisible = true
}, },
handleReturnConfirm() { handleReturnConfirm() {
@ -561,6 +568,21 @@ export default {
// //
handleQuickPaper() { handleQuickPaper() {
this.$refs.quickPaperRef.quickVisible = true this.$refs.quickPaperRef.quickVisible = true
},
//
handlePaper() {
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
}
this.handleForm('add')
},
//
handleOriginalDownload() {
if (this.selections.length > 1 || this.selections.length === 0) {
this.$message('下载操作只可勾选唯一目标条目,请先确认!')
return false
}
} }
} }
} }

38
src/views/collectReorganizi/collectionLibrary/module/quickPaper/index.vue

@ -9,9 +9,12 @@
v-model="form.date" v-model="form.date"
type="month" type="month"
placeholder="选择年月" placeholder="选择年月"
value-format="yyyy-MM"
style="width: 360px;" style="width: 360px;"
@change="changeDate"
/> />
</el-form-item> </el-form-item>
<div v-if="form.date !== ''" class="tip-result">总共为您找到<span>{{ searchNumber }}</span>条数据</div>
</el-form> </el-form>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -34,6 +37,7 @@ export default {
form: { form: {
date: '' date: ''
}, },
searchNumber: 2,
rules: { rules: {
date: [ date: [
{ required: true, message: '请选择年月', trigger: 'change' } { required: true, message: '请选择年月', trigger: 'change' }
@ -48,11 +52,45 @@ export default {
}, },
methods: { methods: {
handleComfireQuick() { handleComfireQuick() {
this.$refs.form.validate((valid) => {
if (valid) {
if (!this.searchNumber) {
this.$message({
message: '当前年月没有数据!',
type: 'warning'
})
return false
}
this.quickVisible = false this.quickVisible = false
this.$nextTick(() => {
this.$parent.handleForm('add')
})
} else {
console.log('error submit!!')
return false
}
})
},
changeDate(val) {
if (!val) {
this.$nextTick(() => {
this.form.date = ''
})
}
} }
} }
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.tip-result{
margin-left: 12px;
font-size: 12px;
color: #0C0E1E;
span{
padding: 0 6px;
font-weight: bold;
color: #ED4A41;
}
}
</style> </style>
Loading…
Cancel
Save