1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036 |
- <!-- 设备管理 -->
- <template>
- <TableView class="product"
- @body-height-change="bodyHeightChange">
- <template slot="header">
- <BaseHeaderLayout>
- <template slot="left">
- <!-- 上传按钮 -->
- <span v-if="permissionIf('cloudDisk.dataManager.manage')">
- <ws-button v-if="!treeNode.name"
- class="buttonClass"
- type="primary"
- @click="uploadError">{{ $t('system.fileManagement.button.upload') }}</ws-button>
- <ws-upload v-else
- oss-key="dataManagement"
- table-name="common_appendix"
- :comp-id="compId"
- :remark-word="word"
- :appendix-ids="appendixIds"
- @onChange="uploadSuccess"
- @uploadSuccess="uploadSuccessInfo"
- ref="upload"
- style="display: inline-flex;padding:0; marginRight:10px">
- </ws-upload>
- </span>
- <!-- 批量下载按钮 -->
- <ws-button class="buttonClass"
- :disabled="disabled"
- v-if="permissionIf('cloudDisk.dataManager.download')"
- @click="batchDown('')">{{ $t('button.download') }}</ws-button>
- <!-- 删除按钮 -->
- <ws-button class="buttonClass"
- :disabled="disabled"
- style="margin-left: 0 !important;"
- v-if="permissionIf('cloudDisk.dataManager.manage')"
- @click="batchDelete">{{ $t('button.delete') }}</ws-button>
- </template>
- <template slot="right">
- <ws-dropdown trigger="click"
- class="dropdown"
- style="margin-right:10px;"
- @command="filterFileTypeList">
- <span class="el-dropdown-link">
- {{ filterFileType||getLanguage }}
- <i class="iconfont iconxiajiantou"
- style="font-size:12px"></i>
- </span>
- <ws-dropdown-menu slot="dropdown"
- style="max-width:200px;overflow-x: auto">
- <ws-dropdown-item v-for="(item,index) in fileTypeList"
- :key="index"
- :command="item"
- style="word-break: break-all;white-space: nowrap;">
- {{ $t(item) }}
- </ws-dropdown-item>
- </ws-dropdown-menu>
- </ws-dropdown>
- <!-- 过滤 -->
- <!-- <ws-button type="text"
- @click="dialogFormVisible = true">
- <i class="iconfont iconfilter" />
- <span>{{ $t('zs.common.sizer') }}</span>
- </ws-button>
- <span class="filter-total">{{ $t('zs.common.thereAre')
- }}{{ tableData.total ? tableData.total : 0
- }}{{ $t('cg.queryresults') }}</span> -->
- <BaseHeaderFilter :total="tableData.total"
- @click="dialogFormVisible = true" />
- <BaseInputSearch v-model="page.fileName"
- :placeholder="$t('dataManage.screeningTips')"
- @search="handleFilter('title')" />
- </template>
- </BaseHeaderLayout>
- </template>
- <template slot="body">
- <div class="data-manage">
- <ws-row style="height:calc(100% - 40px)">
- <ws-col :span="5">
- <div class="ShipEquipmentTreeBody">
- <div class="ShipEquipmentTreeTitle">
- <span>{{ $t('dataManage.dataFolder') }}</span>
- <yh-operaction class="fr"
- :lable="treeTitleLable"
- @skip="skipTreeTitle" />
- </div>
- <div style="width: 100%;height: calc(100vh - 161px);overflow: auto">
- <div class="treeClass">
- <ws-tree class="filter-tree"
- v-if="TreeData && TreeData.length > 0"
- :data="TreeData"
- :props="defaultProps"
- :highlight-current="true"
- node-key="id"
- :default-expanded-keys="defaultExpandedKeys"
- @node-click="clickNode">
- <div class="custom-tree-node"
- slot-scope="{ node, data }">
- <span>
- <el-tooltip class="item"
- effect="dark"
- :content="node.label"
- :disabled="node.label.length<10"
- placement="top">
- <span v-if="!data.addFlag && !data.editFlag"
- class="tree-label">{{ node.label }}</span>
- </el-tooltip>
- <ws-input v-if="data.addFlag"
- v-model="data.name"
- size="small"
- maxlength="100"
- @keyup.enter.native="$event.target.blur"
- @blur="saveFloder(data)" />
- <ws-input v-if="data.editFlag"
- v-model="data.name"
- size="small"
- maxlength="100"
- :clearable="false"
- @keyup.enter.native="$event.target.blur"
- @blur="renameFloder(data)" />
- </span>
- <div @click.stop="clickOperation">
- <operaction-new v-if="!data.addFlag && !data.editFlag"
- class="fr"
- :lable="treeLable"
- :data="data"
- :node="node"
- @skip="skipTree" />
- </div>
- <!-- <i class="iconfont iconsavey"
- v-if="data.addFlag"
- @click="saveFloder(data)"
- style="margin: 0 5px;font-size: 14px;margin-top: 4px;" />
- <i class="iconfont iconsavey"
- v-if="data.editFlag"
- @click="renameFloder(data)"
- style="margin: 0 5px;font-size: 14px;margin-top: 4px;" /> -->
- <!-- <span v-if="data.addFlag"
- @click="cancelFloder(node, data)"><i class="el-icon-close"
- style="font-size: 15px;margin-top: 5px;"></i></span>
- <span v-if="data.editFlag"
- @click="cancelFloder(node, data)"><i class="el-icon-close"
- style="font-size: 15px;margin-top: 5px;"></i></span> -->
- </div>
- </ws-tree>
- </div>
- </div>
- </div>
- </ws-col>
- <ws-col :span="19">
- <div class="main-list"
- style="padding-right: 0px">
- <ws-normal-table :data="tableData.records"
- @cell-click="showDialog"
- @selection-change="handleSelectionChange"
- @sort-change="sortChange"
- highlight-current-row
- style="width: 100%;"
- :height="tableViewBodyHeight - 67">
- <ws-table-column type="selection"
- width="30"></ws-table-column>
- <ws-table-column type="index"
- width="50"
- align="center"
- :label="$t('common.num')">
- <template slot-scope="scope">{{ scope.$index + 1 }}</template>
- </ws-table-column>
- <ws-table-column width="80"
- :label="$t('dataManage.table.thumbnail')">
- <template slot-scope="scope">
- <winsea-picture-view v-if="isImage(scope.row.fileInfoType ? scope.row.fileInfoType.replace('文件', '').replace('.', ''): '')"
- class="mypicture"
- :pic-small-list="$store.getters.baseInfo.fileUrl + scope.row.filePath"
- :pic-list="$store.getters.baseInfo.fileUrl + scope.row.filePath"
- :hover-view="true"
- :width="40"
- :height="40" />
- <i v-else
- class="iconfont"
- :class="getIconClass(scope.row.fileInfoType ? scope.row.fileInfoType.replace('文件', '').replace('.', ''): '')"></i>
- </template>
- </ws-table-column>
- <ws-table-column prop="fileName"
- sortable="custom"
- min-width="200"
- show-overflow-tooltip
- :label="$t('dataManage.table.fileName')">
- <template slot-scope="scope">
- <span v-if="!scope.row.renameFlag"
- @click="preview(scope.row)">{{
- scope.row.fileName +
- (scope.row.fileInfoType
- ? scope.row.fileInfoType.replace('文件', '')
- : '')
- }}</span>
- <span v-else
- style="display: flex">
- <ws-input v-model="scope.row.fileNameClone" />
- <i class="iconfont iconsavey"
- @click="saveName(scope.row)"
- style="margin: 0 5px;font-size: 14px;margin-top: 4px;" />
- <span @click="scope.row.renameFlag = false"><i class="el-icon-close"
- style="font-size: 15px;margin-top: 7px;"></i></span>
- </span>
- </template>
- </ws-table-column>
- <ws-table-column prop="createDate"
- sortable="custom"
- width="180"
- :label="$t('dataManage.uploadTime')">
- <template slot-scope="scope">{{
- scope.row.createDate
- }}</template>
- </ws-table-column>
- <ws-table-column prop="fileInfoType"
- width="120"
- :label="$t('dataManage.table.type')">
- <template slot-scope="scope">{{
- scope.row.fileInfoType
- ? scope.row.fileInfoType
- .replace('文件', '')
- .replace('.', '')
- : ''
- }}</template>
- </ws-table-column>
- <ws-table-column prop="fileSize"
- sortable="custom"
- width="100"
- align="right"
- :label="$t('dataManage.table.size')">
- <template slot-scope="scope">{{
- scope.row.fileSize
- }}</template>
- </ws-table-column>
- <ws-table-column prop="statusFlag"
- :label="$t('common.operate')"
- align="center"
- width="80">
- <template slot-scope="scope">
- <operaction-new :lable="lable"
- :status-flag="scope.row.statusFlag"
- :data="scope"
- @skip="skipPage" />
- </template>
- </ws-table-column>
- </ws-normal-table>
- <pagination v-if="tableData.total > 0"
- :total="tableData.total"
- :page.sync="page.currentPage"
- :limit.sync="page.pageSize"
- @pagination="getList" />
- </div>
- </ws-col>
- </ws-row>
- <!-- 过滤dialog -->
- <div class="nav-search">
- <div class="searchTwo">
- <ws-dialog :title="$t('button.filtration')"
- :visible.sync="dialogFormVisible"
- width="341px"
- :modal="false"
- style="top: -40px;"
- class="dialog"
- :close-on-click-modal="false">
- <ws-form ref="spclearsplistqueryForm"
- :model="page"
- label-width="80px"
- label-position="left">
- <!-- 上传时间 -->
- <div class="selectTitle">
- <span>{{ $t('dataManage.uploadTime') }}</span>
- </div>
- <!-- <ws-form-item :label=""> -->
- <ws-date-picker v-model="uploadDate"
- :placeholder="$t('common.selected')"
- type="daterange"
- :range-separator="$t('common.to')"
- :start-placeholder="$t('common.startDate')"
- :end-placeholder="$t('common.endDate')"
- value-format="yyyy-MM-dd"></ws-date-picker>
- <!-- </ws-form-item> -->
- </ws-form>
- <div slot="footer"
- class="dialog-footer">
- <ws-button @click="clearfiltQuery">{{
- $t('button.reset')
- }}</ws-button>
- <ws-button type="primary"
- @click="handleFilter">{{
- $t('button.filtration')
- }}</ws-button>
- </div>
- </ws-dialog>
- </div>
- </div>
- <!-- 移动文件 -->
- <WinseaContentModal v-model='dialogSortVisible'
- :title="$t('dataManage.moveFile')">
- <ws-tree class="filter-tree"
- v-if="TreeData && TreeData.length > 0"
- :data="TreeData"
- :props="defaultProps"
- :highlight-current="true"
- @node-click="clickFileNode" />
- <template slot="footer"
- class="dialog-footer">
- <ws-button @click="dialogSortVisible = false">{{
- $t('button.cancel')
- }}</ws-button>
- <ws-button type="primary"
- @click="moveFloder">{{
- $t('button.confirm')
- }}</ws-button>
- </template>
- </WinseaContentModal>
- <!-- </ws-dialog> -->
- </div>
- </template>
- <!-- pdf在线预览 -->
- <BaseDialog width="70%"
- :title="pdfFileName"
- :visible.sync="isShowPdf"
- :appendToBody="true">
- <pdf :loadUrl="pdfUrl"
- v-if="isShowPdf"></pdf>
- </BaseDialog>
- </TableView>
- </template>
- <script>
- import { zipDown } from '../../utils/batchDown'
- import Pagination from '@/components/Pagination'
- import WsUpload from '@/components/WsUpload/index'
- import yhOperaction from '@/components/WinseaCom/operaction.vue'
- import operactionNew from '@/components/WinseaCom/operaction-new.vue'
- import { getHp } from '@/utils/getHasPermission'
- import { map, cloneDeep } from 'lodash'
- import TableView from '@/layout/TableView'
- import TableViewMix from '@/layout/mixin/TableViewMix'
- import {
- findTreeList,
- findFileUnderFolder,
- removeAll,
- addInfo,
- findFileType,
- fileRename,
- changeInfo,
- addFile,
- moveFile,
- removeInfo
- } from '@/model/dataManageMent'
- import pdf from '@/components/pdf/pdf'
- import { getFileList } from '@/model/upload'
- import { EventBus } from 'base-core-lib'
- export default {
- mixins: [TableViewMix],
- components: {
- Pagination,
- WsUpload,
- yhOperaction,
- operactionNew,
- TableView,
- pdf
- },
- data () {
- return {
- pdfFileName: '',//pdf
- isShowPdf: false,
- pdfUrl: '',
- filterFileType: '',
- defaultExpandedKeys: [],
- dialogSortVisible: false,
- treeNodeId: '',
- treeNode: {},
- // listLoading: false,
- compId: localStorage.getItem('ws-pf_compId'),
- word: false,
- // 附件
- appendixIds: '',
- historyAppendixIds: '',
- disabled: true,
- defaultProps: {
- children: 'children',
- label: 'name'
- },
- tableData: {
- total: 0
- },
- fileTypeList: [],
- moveFolderObj: {},
- page: {
- folderId: '',
- fileName: '',
- fileInfoType: '',
- updateTimeStart: '',
- updateTimeEnd: '',
- orderColunm: '',
- order: '',
- currentPage: 1,
- pageSize: 10
- },
- uploadDate: [],
- selectedIds: '',
- selectedAppendixIds: '',
- // vesselList: [],
- activeName: '1',
- // 过滤显示设置Dialog
- dialogFormVisible: false,
- // 左侧树
- TreeData: [],
- parentId: '',
- uploadUrl: '', //config.getUploadPath('systemOperation', localStorage.getItem('ws-pf_compId'))
- filePath: ''
- }
- },
- created () {
- // this.vesselList = JSON.parse(localStorage.getItem('ws-pf_vessels'))
- this.getSystemFolderList()
- this.getFileTypeList()
- },
- computed: {
- getLanguage () {
- return this.$t('gg.allTypeName')
- },
- lable () {
- return [
- {
- lab: this.$t('button.download'),
- click: 'download',
- hp: getHp('cloudDisk.dataManager.download')
- },
- {
- lab: this.$t('button.delete'),
- click: 'delete',
- hp: getHp('cloudDisk.dataManager.manage')
- },
- {
- lab: this.$t('button.move'),
- click: 'move',
- hp: getHp('cloudDisk.dataManager.manage')
- },
- {
- lab: this.$t('button.rename'),
- click: 'rename',
- hp: getHp('cloudDisk.dataManager.manage')
- }
- ]
- },
- treeLable () {
- return [
- {
- lab: this.$t('button.newFolder'),
- click: 'newFolder',
- hp: getHp('cloudDisk.dataManager.manage')
- },
- {
- lab: this.$t('button.rename'),
- click: 'rename',
- hp: getHp('cloudDisk.dataManager.manage')
- },
- {
- lab: this.$t('button.delete'),
- click: 'delete',
- hp: getHp('cloudDisk.dataManager.manage')
- }
- ]
- },
- treeTitleLable () {
- return [
- {
- lab: this.$t('button.newFolder'),
- click: 'newFolder',
- hp: getHp('cloudDisk.dataManager.manage')
- }
- ]
- },
- },
- methods: {
- preview () { },
- showDialog (row) {
- if (row.fileInfoType === '.pdf文件') {
- getFileList({
- appendixIds: row.appendixId,
- }).toPromise().then(res => {
- let path = res[0] ? res[0].appendixPath : ''
- let filePath = this.$store.getters.baseInfo.fileUrl + '/' + path
- this.pdfUrl = filePath
- this.pdfFileName = row.fileName
- this.isShowPdf = true
- })
- }
- },
- // 文件类型数据
- async getFileTypeList () {
- await findFileType({ compId: localStorage.getItem('ws-pf_compId') }).toPromise().then(
- res => {
- this.fileTypeList = res
- .filter(item => (item != ''))
- this.fileTypeList.unshift('gg.allTypeName')
- }
- )
- this.getList()
- },
- //文件类型筛选
- filterFileTypeList (selFileType) {
- if (selFileType === 'gg.allTypeName') {
- this.filterFileType = ''
- this.page.fileInfoType = ''
- } else {
- this.filterFileType = this.$t(selFileType)
- this.page.fileInfoType = selFileType
- }
- this.getList()
- },
- isImage (type) {
- const imageType = ['png', 'jpg', 'jpeg', 'gif', 'PNG', 'JPG', 'JPEG', 'GIF']
- return imageType.includes(type)
- },
- getIconClass (type) {
- const iconClass = {
- docx: 'iconword',
- doc: 'iconword',
- zip: 'iconrary',
- xlsx: 'iconexcely',
- xls: 'iconexcely',
- ppt: 'iconppty',
- pptx: 'iconppty',
- pdf: 'iconpdf3',
- txt: 'icontxt1',
- rar: 'iconyasuo'
- }
- // font-size: 35px;
- return iconClass[type] + ' otherClass otherClass__' + type || 'iconemly'
- },
- uploadError () {
- EventBus.$emit('error', this.$t('dataManage.message.message1'))
- },
- // 文件重命名
- async saveName (row) {
- const file = this.tableData.records.find(item => item.fileId === row.fileId)
- if (file.fileNameClone === file.fileName) {
- row.fileNameClone = row.fileNameClone.substr(0, 50)
- }
- if (row.fileNameClone && row.fileNameClone.length > 50) {
- EventBus.$emit('error', '文件名称不能超过50个字,请重新编辑')
- } else {
- // this.elLoading()
- // this.listLoading = true
- const data = {
- fileId: row.fileId,
- fileName: row.fileNameClone
- }
- await fileRename(data).toPromise().then(res => {
- EventBus.$emit('success', this.$t('message.message1'))
- row.renameFlag = false
- this.getList()
- // this.elLoading('end')
- })
- }
- },
- async saveFloder (data) {
- if (data.name.length > 0) {
- await addInfo({ name: data.name, parentFolderId: this.parentId }).toPromise().then(
- res => {
- this.$set(data, 'id', res)
- this.$set(data, 'addFlag', false)
- EventBus.$emit('success', this.$t('message.message1'))
- this.page.folderId = res
- // this.getList()
- this.getSystemFolderList(this.parentId) // 陈小龙提1020979号bug说保存后不能影响其他展开的节点
- }
- )
- } else {
- this.cancelFloder()
- // EventBus.$emit('error', this.$t('workNotification.startPlaceholder'))
- }
- },
- // 重命名
- async renameFloder (data) {
- if (data.name.length > 0 && data.name !== data.oldName) {
- await changeInfo({
- name: data.name,
- folderId: data.folderId,
- parentFolderId: data.parentFolderId
- }).toPromise().then(res => {
- EventBus.$emit('success', this.$t('message.message1'))
- data.editFlag = false
- this.getSystemFolderList(data.parentFolderId) // 陈小龙提1020979号bug说保存后不能影响其他展开的节点
- })
- } else {
- this.cancelFloder()
- }
- },
- cancelFloder (node, data) {
- this.getSystemFolderList()
- },
- // 新建文件夹
- skipTreeTitle () {
- this.TreeData.push({
- children: [],
- name: '',
- addFlag: true
- })
- this.parentId = ''
- },
- // 文件夹操作
- async skipTree (val) {
- const { msg, data, node } = val
- if (msg === 'newFolder') {
- data.children.push({
- children: [],
- name: '',
- addFlag: true
- })
- this.parentId = data.id
- this.defaultExpandedKeys = [data.id]
- } else if (msg === 'rename') {
- data.editFlag = true
- this.parentId = data.id
- } else if (msg === 'delete') {
- let message =
- data.children.length === 0
- ? this.$t('showMessage.delate')
- : this.$t('dataManage.message.message4')
- this.$confirm(message, this.$t('showMessage.hint'), {
- confirmButtonText: this.$t('button.confirm'),
- cancelButtonText: this.$t('button.cancel'),
- type: 'warning'
- })
- .then(() => {
- removeInfo({ folderId: data.id }).toPromise()
- .then(response => {
- const parent = node.parent
- const children = parent.data.children || parent.data
- const index = children.findIndex(d => d.id === data.id)
- children.splice(index, 1)
- EventBus.$emit('success', this.$t('showMessage.successfullyDelete'))
- })
- .catch(() => {
- EventBus.$emit('error', this.$t('showMessage.deleteFailed'))
- })
- })
- .catch(() => {
- EventBus.$emit('info', this.$t('showMessage.cancelledDelete'))
- })
- }
- },
- clickOperation () {
- // console.log('mmm')
- },
- async skipPage (val) {
- if (val.msg === 'delete') {
- this.$confirm(
- this.$t('dataManage.message.message3'),
- this.$t('showMessage.hint'),
- {
- confirmButtonText: this.$t('button.confirm'),
- cancelButtonText: this.$t('button.cancel'),
- type: 'warning'
- }
- )
- .then(() => {
- removeAll([{ fileId: val.data.row.fileId }]).toPromise()
- .then(response => {
- this.getList()
- EventBus.$emit('success', this.$t('showMessage.successfullyDelete'))
- })
- .catch(() => {
- EventBus.$emit('error', this.$t('showMessage.deleteFailed'))
- })
- })
- .catch(() => {
- EventBus.$emit('info', this.$t('showMessage.cancelledDelete'))
- })
- } else if (val.msg === 'move') {
- this.moveFolderObj.fileId = val.data.row.fileId
- this.dialogSortVisible = true
- } else if (val.msg === 'rename') {
- this.$set(this.tableData.records[val.data.$index], 'renameFlag', true)
- } else if (val.msg === 'download') {
- this.batchDown(val.data.row.appendixId)
- // getFileList({ appendixIds: val.data.row.appendixId}).then((res) => {
- // window.open(res.data[0].appendixPath)
- // })
- }
- },
- // 批量下载
- batchDown (val) {
- zipDown({
- appendixIds: val.length !== 0 ? val : this.selectedAppendixIds,
- baseUrl: this.$store.getters.baseInfo.fileUrl
- })
- },
- // 文件夹一览查询
- async getSystemFolderList (defaultId = '') {
- // this.elLoading()
- // this.listLoading = true
- await findTreeList({ compId: localStorage.getItem('ws-pf_compId') }).toPromise().then(
- response => {
- this.TreeData = response
- this.getTreeChildren(this.TreeData)
- this.treeNode = {}
- if (defaultId) {
- this.defaultExpandedKeys = [defaultId]
- }
- this.getList()
- }
- )
- },
- getTreeChildren (child) {
- for (var i in child) {
- this.$set(child[i], 'oldName', child[i].name)
- if (child[i].children) {
- this.getTreeChildren(child[i].children)
- }
- }
- },
- uploadSuccessInfo (item) {
- this.filePath = item.appendixPath
- },
- // 文件上传
- uploadSuccess () {
- this.$refs.upload
- .handleSaveBill()
- .then(async response => {
- await addFile({
- appendixIds: response.split(','),
- folderId: this.treeNodeId,
- compId: localStorage.getItem('ws-pf_compId'),
- filePath: this.filePath
- }).toPromise()
- .catch(res => {
- EventBus.$emit('error', (JSON.parse(res) || {}).message)
- this.$refs.upload.clearFiles()
- })
- this.getList()
- this.$refs.upload.clearFiles()
- })
- .catch(res => {
- EventBus.$emit('error', (JSON.parse(res) || {}).message)
- this.$refs.upload.clearFiles()
- })
- },
- // table多选
- handleSelectionChange (val) {
- this.disabled = !(val.length > 0)
- this.selectedIds = []
- for (let i of val) {
- this.selectedIds.push({
- fileId: i.fileId
- })
- }
- this.selectedAppendixIds = map(val, 'appendixId').join(',')
- },
- // sortChange 排序
- sortChange (val) {
- this.page.order = val.order
- this.page.orderColunm = val.prop
- this.getList()
- },
- async batchDelete () {
- this.$confirm(
- this.$t('dataManage.message.message2'),
- this.$t('showMessage.hint'),
- {
- confirmButtonText: this.$t('button.confirm'),
- cancelButtonText: this.$t('button.cancel'),
- type: 'warning'
- }
- )
- .then(() => {
- removeAll(this.selectedIds).toPromise().then(res => {
- EventBus.$emit('success', this.$t('showMessage.successfullyDelete'))
- this.page.currentPage = 1
- this.getList()
- EventBus.$emit('success', this.$t('showMessage.successfullyDelete'))
- .catch(() => {
- EventBus.$emit('error', this.$t('showMessage.deleteFailed'))
- })
- })
- })
- .catch(() => {
- EventBus.$emit('info', this.$t('showMessage.cancelledDelete'))
- })
- },
- // 点击树节点
- clickNode (obj, node) {
- if (obj.addFlag || obj.editFlag) {
- return
- }
- this.treeNodeId = obj.id
- this.treeNode = obj
- this.page.folderId = obj.id
- this.page.currentPage = 1
- this.getList()
- },
- // 移动
- clickFileNode (obj, node) {
- this.moveFolderObj.folderId = obj.folderId
- },
- // 移动文件-确定
- async moveFloder () {
- await moveFile(this.moveFolderObj).toPromise()
- .then(res => {
- this.getFileTypeList()
- this.getList()
- this.dialogSortVisible = false
- EventBus.$emit('success', this.$t('message.message1'))
- })
- .catch(res => {
- EventBus.$emit('error', res.message)
- })
- },
- // 模板文件列表
- async getList () {
- if (!this.listLoading) {
- // this.elLoading()
- // this.listLoading = true
- }
- await findFileUnderFolder(this.page).toPromise().then(res => {
- let tableObj = res
- for (const i in res.records) {
- tableObj.records[i].renameFlag = false
- tableObj.records[i].fileNameClone = cloneDeep(
- res.records[i].fileName
- )
- }
- console.log(tableObj, 33339)
- this.tableData = tableObj
- // this.listLoading = false
- // this.elLoading('end')
- })
- },
- resetSearch () {
- this.page.fileName = ''
- this.getList()
- },
- // 过滤
- handleFilter () {
- // 2020.05.25【资料管理】过滤条件,根据文档类型搜索,点击过滤按钮,弹出框不消失
- this.page.updateTimeStart = ''
- this.page.updateTimeEnd = ''
- if (this.uploadDate && this.uploadDate.length > 0) {
- this.page.updateTimeStart = this.uploadDate[0]
- this.page.updateTimeEnd = this.uploadDate[1]
- }
- this.getList()
- this.dialogFormVisible = false
- },
- // 过滤重置/过滤关闭X
- clearfiltQuery () {
- // this.page.fileInfoType = ''
- this.page.updateTimeStart = ''
- this.page.updateTimeEnd = ''
- this.page.updateTimeEnd = ''
- this.uploadDate = []
- this.dialogFormVisible = false
- this.getList()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .otherClass {
- font-size: 34px;
- &__doc,
- &__docx {
- color: rgb(108, 203, 255);
- }
- &__zip {
- color: rgb(74, 141, 255);
- }
- // zip
- &__xlsx,
- &__xls {
- color: rgb(0, 192, 144);
- }
- &__ppt,
- &__pptx {
- color: rgb(255, 120, 97);
- }
- &__pdf {
- color: rgb(255, 72, 103);
- }
- &__txt {
- // color: rgb(108, 203, 255);
- font-size: 25px;
- }
- &__rar {
- color: rgb(226, 215, 66);
- }
- }
- .mypicture {
- ::v-deep ul {
- padding-inline-start: 0px;
- margin-block-start: 0px;
- margin-block-end: 0px;
- }
- }
- .content {
- float: right;
- line-height: 47px;
- width: 92%;
- }
- .data-manage {
- height: calc(100vh - 60px);
- .tree-label {
- margin-right: 10px;
- }
- .custom-tree-node {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 14px;
- .el-input--small /deep/ .el-input__inner {
- height: 26px !important;
- line-height: 26px !important;
- }
- .tree-label {
- display: inline-block;
- white-space: nowrap;
- max-width: 160px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .el-tree-small .el-tree-node__label {
- font-size: 14px;
- }
- .topBtn {
- margin-bottom: 5px;
- text-align: left;
- }
- .selectBtn {
- float: left;
- text-align: left;
- }
- .selectInput {
- float: right;
- width: 225px;
- margin-left: 15px;
- }
- .searchIcon {
- font-size: 32px;
- position: absolute;
- top: 0;
- right: 0;
- }
- .filter-total {
- font-size: 14px;
- float: right;
- margin-top: 10px;
- margin-left: 10px;
- }
- /deep/ .myDialogDiv .el-dialog {
- position: fixed;
- top: 0px;
- right: 15%;
- overflow: auto;
- margin: 0;
- width: 25em !important;
- }
- /deep/ .el-dialog .el-dialog__footer {
- height: 50px;
- line-height: 50px;
- padding: 0 20px 0 0;
- }
- /deep/ .el-table-column--selection .cell {
- padding-left: 10px;
- padding-right: 10px;
- }
- .el-row {
- .el-col:last-child {
- .el-form-item {
- border-bottom: 0px;
- border-right: 0px;
- .el-form-item__label {
- border-bottom: 0;
- }
- }
- }
- }
- .ShipEquipmentTreeBody {
- background-color: white;
- border: 1px #cccccc solid;
- width: 100%;
- height: calc(100vh - 120px);
- overflow: auto;
- }
- .ShipEquipmentTreeTitle {
- padding: 10px;
- background-color: white;
- border-bottom: 1px #cccccc solid;
- font-weight: bold;
- font-size: 16px;
- }
- .treeClass {
- padding: 10px;
- /*overflow-y: scroll;*/
- /*overflow-x: scroll;*/
- width: max-content;
- min-width: 100%;
- }
- /deep/ .el-upload-list--picture-card {
- display: none;
- }
- }
- .dropdown {
- line-height: 30px;
- float: right;
- }
- /deep/ .searchTwo .yhElDialog {
- right: 17vh;
- position: absolute;
- top: 19px !important;
- margin: 0;
- }
- .buttonClass {
- margin-right: 10px;
- }
- .product {
- /deep/ .el-upload-list__item {
- display: none;
- }
- }
- </style>
|