Browse Source

12.12

master
lichong 1 week ago
parent
commit
7a1e1ec1b1
  1. 3
      src/main/index.js
  2. 2
      src/renderer/index.html
  3. 4
      src/renderer/src/App.vue
  4. 16
      src/renderer/src/assets/css/base.css
  5. 69
      src/renderer/src/assets/json/file.json
  6. 22
      src/renderer/src/components/tablecomponent.vue
  7. 22
      src/renderer/src/components/treecomponent.vue
  8. 2
      src/renderer/src/main.js
  9. 190
      src/renderer/src/views/dangan.vue

3
src/main/index.js

@ -186,9 +186,6 @@ app.whenReady().then(() => {
let sourceFilePath = element.prePath;
destinationFilePath = Buffer.from(destinationFilePath, 'utf8').toString('utf8');
sourceFilePath = Buffer.from(sourceFilePath, 'utf8').toString('utf8');
// 读取文件大小
let fileSize = fs.statSync(sourceFilePath).size;
element.size = fileSize
try {
fs.copyFileSync(sourceFilePath, destinationFilePath);
successFileList.push(element)

2
src/renderer/index.html

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<title>档案管理</title>
<title>海丰县不可移动文物四有资料管理系统</title>
<!-- <link rel="icon" href="/icon/icon.jpg" /> -->
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy"

4
src/renderer/src/App.vue

@ -27,7 +27,7 @@ export default {
computed: {},
methods: {},
async mounted() {
let fiveDay = dayjs('2024-12-14T00:00:00').valueOf()
let fiveDay = dayjs('2024-12-18T00:00:00').valueOf()
if (!this.isVip) {
if (dayjs().valueOf() > fiveDay) {
this.isVip = false
@ -42,7 +42,7 @@ export default {
</script>
<style scoped>
.appClass {
width: calc(100vw - 10px);
width: calc(100vw - 27px);
height: calc(100vh - 40px);
position: relative;
}

16
src/renderer/src/assets/css/base.css

@ -4,20 +4,6 @@ body {
padding: 0;
}
.allClass.is-active .el-radio-button__inner {
background-color: #409eff !important;
border: 1px solid #409eff !important;
}
.normalClass.is-active .el-radio-button__inner {
background-color: #67c23a !important;
border: 1px solid #67c23a !important;
}
.unregisterClass.is-active .el-radio-button__inner {
background-color: #f56c6c !important;
border: 1px solid #f56c6c !important;
}
.el-form-item{
.el-form-item {
margin-bottom: 0 !important;
}

69
src/renderer/src/assets/json/file.json

@ -1,17 +1,4 @@
[
{
"label": "项目名",
"prop": "xiangmuName",
"type": "text",
"tableShow": true,
"export": true
},
{
"label": "卷名",
"prop": "juanName",
"type": "text",
"export": true
},
{
"label": "文件名",
"prop": "fileName",
@ -22,23 +9,7 @@
"export": true
},
{
"label": "文件",
"prop": "file",
"type": "file",
"tableShow": false,
"formShow": true,
"export": false
},
{
"label": "文件大小",
"prop": "size",
"type": "size",
"tableShow": true,
"formShow": false,
"export": false
},
{
"label": "文件类型",
"label": "类型",
"prop": "fileType",
"type": "select",
"tooltip": "如果不填写则默认使用上传文件的文件类型,如果填写请正确填写",
@ -88,6 +59,14 @@
"formShow": true,
"export": true
},
{
"label": "存储位置",
"prop": "path",
"type": "text",
"tableShow": true,
"formShow": false,
"export": true
},
{
"label": "状态",
"prop": "status",
@ -111,13 +90,35 @@
"export": true
},
{
"label": "存储位置",
"prop": "path",
"label": "项目名",
"prop": "xiangmuName",
"type": "text",
"tableShow": true,
"formShow": false,
"tableShow": false,
"export": true
},
{
"label": "卷名",
"prop": "juanName",
"type": "text",
"tableShow": false,
"export": true
},
{
"label": "文件",
"prop": "file",
"type": "file",
"tableShow": false,
"formShow": true,
"export": false
},
{
"label": "文件大小",
"prop": "size",
"type": "size",
"tableShow": false,
"formShow": false,
"export": false
},
{
"label": "备注",
"prop": "note",

22
src/renderer/src/components/tablecomponent.vue

@ -26,31 +26,31 @@
</template>
</vxe-column>
</template>
<vxe-column fixed="right" title="操作" width="200">
<vxe-column fixed="right" title="操作" width="260">
<template #default="{ row }">
<el-button type="primary" text @click="optClick(row, 'view')" size="small" style="padding: 5px;">
<!-- <el-icon>
<el-icon>
<View />
</el-icon> -->
</el-icon>
<span>预览</span>
</el-button>
<el-button type="primary" text @click="optClick(row, 'edit')" size="small" style="padding: 5px;">
<!-- <el-icon>
<el-icon>
<EditPen />
</el-icon> -->
</el-icon>
<span>修改</span>
</el-button>
<el-button :type="row.status === '正常' ? 'primary' : 'success'" text @click="optClick(row, 'unregister')"
size="small" style="padding: 5px;">
<!-- <el-icon>
size="small" style="padding: 5px;color:#ff0000">
<el-icon>
<Delete />
</el-icon> -->
</el-icon>
<span>{{ row.status === "正常" ? "注销" : "正常" }}</span>
</el-button>
<el-button type="primary" text @click="optClick(row, 'download')" size="small" style="padding: 5px;">
<!-- <el-icon>
<el-icon>
<Download />
</el-icon> -->
</el-icon>
<span>下载</span>
</el-button>
</template>
@ -121,7 +121,7 @@ export default {
</script>
<style scoped>
.tableClass {
height: calc(100vh - 152px);
height: calc(100vh - 220px);
text-align: center;
text-align-last: center;
}

22
src/renderer/src/components/treecomponent.vue

@ -1,22 +1,21 @@
<template>
<div class="treeClass bgColor">
<el-auto-resizer style="height: calc(100vh - 70px);">
<el-auto-resizer style="height: calc(100vh - 160px);">
<template #default="{ height, width }">
<el-tree-v2 :data="treeData" :props="treeProps" class="bgColor" @node-click="nodeClick" ref="treeRef"
:height="height" :expand-on-click-node="true">
<template #default="{ node }">
<div style="width: 100%;text-align-last:left;" :class="node.data.id === nodeClickId ? 'selectedNode' : ''">
<div style="width: 100%;text-align-last:left;">
<el-tooltip effect="dark" :content="node.label" placement="right" v-if="node.label.length > textLength">
<span>{{ node.label.slice(0, textLength) }}...</span>
</el-tooltip>
<span v-else>{{ node.label }}</span>
<!-- <span>{{ node.label }}</span> -->
<span style="position: absolute;right: 8px;" v-if="node.level === 1">
<el-button :type="node.data.id === nodeClickId ? 'success' : 'primary'" link
@click="e => editxiangmu(e, node)">
编辑
<span v-if="node.level === 1">
<el-button link style="color:#56abfa" @click="e => editxiangmu(e, node)">
修改
</el-button>
<el-button type="danger" link @click="e => delxiangmu(e, node)">
<el-button style="color:#ff0000" link @click="e => delxiangmu(e, node)">
删除
</el-button>
</span>
@ -100,7 +99,6 @@ export default {
}
},
async mounted() {
console.log(103, window.innerHeight);
window.onresize = () => {
let width = document.getElementsByClassName("treeClass")[0].clientWidth
this.textLength = Math.floor((width - 310) / 15) + 14
@ -112,7 +110,7 @@ export default {
</script>
<style scoped>
.treeClass {
height: calc(100vh - 70px);
height: calc(100vh - 137px);
margin-left: 8px;
text-align: center;
text-align-last: center;
@ -122,10 +120,4 @@ export default {
background-color: #ccc;
border-radius: 8px;
}
.selectedNode {
background-color: #409eff;
color: #fff;
border-radius: 8px;
}
</style>

2
src/renderer/src/main.js

@ -22,7 +22,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
}
app.use(ElementPlus, {
locale: zhCn,
size:"large"
size:"default"
})
app.use(screenShort, { enableWebRtc: false, level: 300001, hiddenScrollBar: true }).use(VxeUI).use(VxeUITable)
app.mount('#app')

190
src/renderer/src/views/dangan.vue

@ -1,11 +1,12 @@
<template>
<div class="rightClass">
<h1 style="text-align: center;font-weight: 500;">海丰县不可移动文物四有资料管理系统</h1>
<div style="margin: 0 0 8px 8px;">
<el-row :gutter="20">
<el-col>
<div style="width: calc(100vw - 400px);display: inline-block;margin-right: 12px;">
<el-input v-model="xiangmuObj.xianmguName" placeholder="请输入项目名" clearable>
<template #prepend>项目名</template>
<el-input v-model="xiangmuObj.xianmguName" placeholder="请输入" clearable>
<template #prepend>项目名</template>
</el-input>
</div>
<el-button type="primary" @click="clearAndSearchTree">
@ -49,7 +50,7 @@
<el-form-item label="状态:">
<el-radio-group v-model="wenjianObj.status" style="display: inline-block;">
<el-radio-button :label="statusItem.label" :value="statusItem.value"
v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" :class="`${statusItem.class}`">
v-for="(statusItem, statusIndex) in statusList" :key="statusIndex">
</el-radio-button>
</el-radio-group>
</el-form-item>
@ -59,7 +60,7 @@
</div>
<div style="margin-bottom: 8px;">
<el-row :gutter="20">
<el-col :span="4">
<el-col :span="3">
<!-- <el-button type="primary" plain @click="addFile" :disabled="_.get(treeNode, 'level') !== 3"> -->
<el-button type="primary" plain @click="addFile" :disabled="[1].includes(_.get(treeNode, 'level', 1))">
<el-icon>
@ -73,7 +74,7 @@
<template #prepend>文件名</template>
</el-input>
</el-col>
<el-col :span="9" style="position: relative;top:-3px;">
<el-col :span="10" style="position: relative;top:-3px;">
<el-button type="primary" @click="searchTable">
<el-icon>
<Search />
@ -86,6 +87,12 @@
</el-icon>
<span>重置</span>
</el-button>
<el-button @click="clearAll" type="danger">
<el-icon>
<Delete />
</el-icon>
<span>清空</span>
</el-button>
<div class="inputClass uploadClass">
<el-upload :show-file-list="false" v-model="fileOriData" :before-upload="beforeAvatarUpload"
:http-request="successSubmit" accept=".xls,.xlsx,.csv">
@ -93,7 +100,7 @@
<el-icon>
<Upload />
</el-icon>
<span>导入历史数据</span>
<span>导入数据</span>
</el-button>
</el-upload>
</div>
@ -170,7 +177,7 @@ export default {
wenjianObj: {
wenjianName: "",
fileType: "",
status: "",
status: "正常",
},
fileList: [
{
@ -214,19 +221,16 @@ export default {
{
label: "全部",
color: "#409eff",
class: "allClass",
value: "",
},
{
label: "正常",
color: "#67c23a",
class: "normalClass",
value: "正常"
},
{
label: "已注销",
color: "#f56c6c",
class: "unregisterClass",
value: "已注销"
},
],
@ -300,16 +304,15 @@ export default {
let workbook = XLSX.read(data, { type: 'binary' })
let sheetName = workbook.SheetNames[0]
let sheetData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
let xiangmuObj = _.groupBy(sheetData, "项目名")
let excludeList = ["123123", "test2222", "主卷"]
let xiangmuObj = _.groupBy(_.cloneDeep(sheetData), "项目名")
let xiangmuList = []
for (let key in xiangmuObj) {
if (key && !excludeList.includes(key)) {
if (key) {
xiangmuList.push(key)
}
}
let { pathList, treeList } = that.bulkAddXiangmu(xiangmuList)
let { tableList, successList } = that.bulkAddFile(treeList, sheetData)
let { tableList } = that.bulkAddFile(treeList, sheetData)
that.inputTreeList = _.cloneDeep(treeList)
that.inputTableList = _.cloneDeep(tableList)
that.inputPathList = _.cloneDeep(pathList)
@ -380,8 +383,8 @@ export default {
//
bulkAddFile(treeList, tableDataList) {
console.log(386, tableDataList);
let tableList = []
let successList = []
for (let i = 0; i < tableDataList.length; i++) {
let fileItem = tableDataList[i];
let juanNameLIst = _.split(fileItem["文件名"], "·")
@ -391,11 +394,12 @@ export default {
let chineseCharsOnly = pdfText.match(/[\u4e00-\u9fa5]+/g);
let juanName = chineseCharsOnly ? chineseCharsOnly.join('') : '';
let treeItem = _.find(treeList, o => o.path === `${fileItem["项目名"]}\\${fileItem["卷名"]}\\${juanName}`)
let treeItem1 = _.find(treeList, o => _.startsWith(o.path, `${fileItem["项目名"]}\\${fileItem["卷名"]}`) && juanName.includes(o.label))
let treeItem2 = _.find(treeList, o => _.startsWith(o.path, `${fileItem["项目名"]}}`) && juanName.includes(o.label))
let path = _.split(fileItem["储存位置"], "_")
let fileType = _.find(this.fileList, o => o.label === path[1].split(".")[1])
let prepath = _.split(fileItem["储存位置"], "uploadPath/")
if (treeItem) {
successList.push(i)
tableList.push({
treeId: treeItem.currentId,
pretreeId: treeItem.preId,
@ -407,8 +411,44 @@ export default {
uploadTime: fileItem["上传时间"],
status: fileItem["状态"],
size: "",
path: `D:\\test\\${fileItem["项目名"]}\\${fileItem["卷名"]}\\${juanName}\\${path[1]}`,
prePath: `D:\\uploadPath\\${prepath[1].replaceAll("/", "\\")}`,
path: `D: \\test\\${fileItem["项目名"]}\\${fileItem["卷名"]}\\${juanName}\\${path[1]}`,
prePath: `D: \\uploadPath\\${prepath[1].replaceAll("/", "\\")}`,
note: fileItem["备注"],
create_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
update_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
})
} else if (treeItem1) {
tableList.push({
treeId: treeItem1.currentId,
pretreeId: treeItem1.preId,
prepretreeId: treeItem1.prepreId,
xiangmuName: fileItem["项目名"],
juanName: `${fileItem["卷名"]}`,
fileName: path[1],
fileType: (fileType || {}).value,
uploadTime: fileItem["上传时间"],
status: fileItem["状态"],
size: "",
path: `D: \\test\\${fileItem["项目名"]}\\${fileItem["卷名"]}\\${path[1]}`,
prePath: `D: \\uploadPath\\${prepath[1].replaceAll("/", "\\")}`,
note: fileItem["备注"],
create_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
update_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
})
} else if (treeItem2) {
tableList.push({
treeId: treeItem2.currentId,
pretreeId: treeItem2.preId,
prepretreeId: treeItem2.prepreId,
xiangmuName: fileItem["项目名"],
juanName: `${fileItem["卷名"]}_${juanName}`,
fileName: path[1],
fileType: (fileType || {}).value,
uploadTime: fileItem["上传时间"],
status: fileItem["状态"],
size: "",
path: `D: \\test\\${fileItem["项目名"]}\\${path[1]}`,
prePath: `D: \\uploadPath\\${prepath[1].replaceAll("/", "\\")}`,
note: fileItem["备注"],
create_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
update_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
@ -416,7 +456,7 @@ export default {
}
}
}
return { tableList, successList }
return { tableList }
},
// inputData
async inputData(treeList, pathList, tableList) {
@ -483,7 +523,8 @@ export default {
check: false,
})
}
this.treeData = treeList
this.treeData = _.sortBy(treeList, "label")
await this.searchTable()
},
//()
@ -577,7 +618,7 @@ export default {
//()
async delxiangmu(node) {
ElMessageBox.confirm(
`是否删除(${node.label})项目?同时删除项目时将删除下面的文件夹及文件?`,
`是否删除(${node.label})项目?同时删除项目时将删除下面的文件夹及文件 ? `,
'danger',
{
confirmButtonText: '确认',
@ -629,7 +670,7 @@ export default {
"一级卷名": _.split(listItem.juanName, "_")[0],
"二级卷名": _.split(listItem.juanName, "_")[1],
"文件名": listItem.fileName,
"文件路径": `D:\\test\\${listItem.path.replace("D:\\test\\", "")}`,
"文件路径": `D: \\test\\${listItem.path.replace("D:\\test\\", "")}`,
"文件类型": _.find(this.fileList, { value: listItem.fileType }).label,
"文件大小": this.genSize(listItem.size),
"文件状态": listItem.status,
@ -663,18 +704,18 @@ export default {
}
let bytes = Number(num);
if (bytes >= 1024 ** 4) {
return `${(bytes / 1024 ** 4).toFixed(2)}TB`;
return `${(bytes / 1024 ** 4).toFixed(2)} TB`;
}
if (bytes >= 1024 ** 3) {
return `${(bytes / 1024 ** 3).toFixed(2)}GB`;
return `${(bytes / 1024 ** 3).toFixed(2)} GB`;
}
if (bytes >= 1024 ** 2) {
return `${(bytes / 1024 ** 2).toFixed(2)}MB`;
return `${(bytes / 1024 ** 2).toFixed(2)} MB`;
}
if (bytes >= 1024) {
return `${(bytes / 1024).toFixed(2)}KB`;
return `${(bytes / 1024).toFixed(2)} KB`;
}
return `${bytes}B`;
return `${bytes} B`;
},
//
async addFile() {
@ -687,13 +728,13 @@ export default {
let pathList = _.compact(_.split(this.treeNode.path, '\\'))
this.addFileForm = {
visible: true,
title: `文件路径:D:\\${_.get(this.treeNode, 'path')}`,
title: `文件路径:D: \\${_.get(this.treeNode, 'path')} `,
disabled: false,
type: "add",
formHeader: this.formHeader,
formData: {
xiangmuName: `${_.trim(pathList[0])}`,
juanName: `${_.trim(pathList[1])}`,
xiangmuName: `${_.trim(pathList[0])} `,
juanName: `${_.trim(pathList[1])} `,
fileName: "",
fileLimit: 10000,
file: [],
@ -713,6 +754,41 @@ export default {
this.treeNode = {}
await this.searchTable()
},
//
async clearAll() {
ElMessageBox.confirm(
'是否删除所有的护具,此操作不可逆,请谨慎操作!!!',
'警告',
{
confirmButtonText: '确认删除',
cancelButtonText: '取消',
type: 'error',
}
)
.then(async () => {
//
let db = await myDatabase.open();
//
let tableNames = db._storeNames
//
for (let index = 0; index < tableNames.length; index++) {
let tableName = tableNames[index];
await myDatabase[tableName].clear();
}
await this.searchTree()
ElMessage({
type: 'error',
message: '您已经删除数据库,数据全部清空了!!!',
})
})
.catch(() => {
ElMessage({
type: 'success',
message: '您取消删除数据库,数据仍然存在',
})
})
},
//
async viewFile(row) {
//
@ -722,7 +798,7 @@ export default {
async editFile(row) {
this.addFileForm = {
visible: true,
title: `编辑文件:D:\\test\\${row.xiangmuName}\\${_.join(_.split(row.juanName, "_"), "\\")}\\${row.fileName}`,
title: `编辑文件:D: \\test\\${row.xiangmuName} \\${_.join(_.split(row.juanName, "_"), "\\")} \\${row.fileName} `,
disabled: false,
type: "put",
formHeader: this.formHeader,
@ -740,8 +816,8 @@ export default {
name: row.fileName,
type: row.fileType,
size: row.size,
path: `D:\\test\\${row.xiangmuName}\\${_.join(_.split(row.juanName, "_"), "\\")}\\${row.fileName}`,
url: `D:\\test\\${row.xiangmuName}\\${_.join(_.split(row.juanName, "_"), "\\")}\\${row.fileName}`,
path: `D: \\test\\${row.xiangmuName} \\${_.join(_.split(row.juanName, "_"), "\\")} \\${row.fileName} `,
url: `D: \\test\\${row.xiangmuName} \\${_.join(_.split(row.juanName, "_"), "\\")} \\${row.fileName} `,
}
],
fileType: row.fileType,
@ -797,16 +873,16 @@ export default {
let firstId = v5(xianmguName, this.uuidNameSpace)
for (let i = 0; i < this.level2.length; i++) {
let level2Item = this.level2[i];
let level2Str = `${xianmguName}${level2Item}`
let level2Str = `${xianmguName}${level2Item} `
let level2uuid = v5(level2Str, this.uuidNameSpace)
for (let j = 0; j < this.level3[level2Item].length; j++) {
let level3Item = this.level3[level2Item][j];
let level3Str = `${xianmguName}${level2Item}${level3Item}`
let level3Str = `${xianmguName}${level2Item}${level3Item} `
let level3uuid = v5(level3Str, this.uuidNameSpace)
treeList.push({
label: level3Item,
currentId: level3uuid,
path: `${xianmguName}\\${level2Item}\\${level3Item}`,
path: `${xianmguName} \\${level2Item} \\${level3Item} `,
delete: false,
preId: level2uuid,
prepreId: firstId,
@ -814,12 +890,12 @@ export default {
create_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
update_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
})
pathList.push(`${xianmguName}\\${level2Item}\\${level3Item}`)
pathList.push(`${xianmguName} \\${level2Item} \\${level3Item} `)
}
treeList.push({
label: level2Item,
currentId: level2uuid,
path: `${xianmguName}\\${level2Item}`,
path: `${xianmguName} \\${level2Item} `,
delete: false,
preId: firstId,
prepreId: "",
@ -831,7 +907,7 @@ export default {
treeList.push({
label: xianmguName,
currentId: firstId,
path: `${xianmguName}`,
path: `${xianmguName} `,
delete: false,
preId: "",
prepreId: "",
@ -849,7 +925,7 @@ export default {
await this.searchTree()
} catch (error) {
ElMessage({
message: `${error}`,
message: `${error} `,
type: 'error',
})
}
@ -865,7 +941,7 @@ export default {
id: level3Item.id,
label: level3Item.label,
currentId: level3Item.currentId,
path: `${xianmguName}\\${level2Item.label}\\${level3Item.label}`,
path: `${xianmguName} \\${level2Item.label} \\${level3Item.label} `,
delete: false,
preId: level3Item.preId,
prepreId: level3Item.prepreId,
@ -879,7 +955,7 @@ export default {
id: level2Item.id,
label: level2Item.label,
currentId: level2Item.currentId,
path: `${xianmguName}\\${level2Item.label}`,
path: `${xianmguName} \\${level2Item.label} `,
delete: false,
preId: level2Item.preId,
prepreId: "",
@ -893,7 +969,7 @@ export default {
id: preNodeTemp.id,
label: xianmguName,
currentId: preNodeTemp.currentId,
path: `${xianmguName}`,
path: `${xianmguName} `,
delete: false,
preId: "",
prepreId: "",
@ -916,7 +992,7 @@ export default {
await this.searchTree()
} catch (error) {
ElMessage({
message: `${error}`,
message: `${error} `,
type: 'error',
})
}
@ -948,13 +1024,13 @@ export default {
pretreeId: this.treeNode.preId,
prepretreeId: this.treeNode.prepreId,
xiangmuName: filePathList[0],
juanName: `${filePathList[1]}${filePathList[2] ? "_" + filePathList[2] : ""}`,
juanName: `${filePathList[1]}${filePathList[2] ? "_" + filePathList[2] : ""} `,
fileName: fileItem.raw.name,
fileType: fileItem.raw.type,
uploadTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
status: "正常",
size: fileItem.raw.size,
path: `${this.treeNode.path}\\${fileItem.raw.name}`,
path: `${this.treeNode.path} \\${fileItem.raw.name} `,
prePath: fileItem.raw.path,
note: this.addFileForm.formData.note,
create_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
@ -978,7 +1054,7 @@ export default {
uploadTime: formData.uploadTime,
status: formData.status,
size: _.get(formData.file, [0, "raw", "size"], _.get(formData.file, [0, "size"], "")),
path: `${_.join(pathArr.splice(0, pathArr.length - 1), "\\")}\\${_.get(formData.file, [0, "raw", "name"], _.get(formData.file, [0, "name"], ""))}`,
path: `${_.join(pathArr.splice(0, pathArr.length - 1), "\\")} \\${_.get(formData.file, [0, "raw", "name"], _.get(formData.file, [0, "name"], ""))} `,
prePath: _.get(formData.file, [0, "raw", "path"], _.get(formData.file, [0, "path"], "")),
note: formData.note,
create_at: formData.create_at,
@ -998,7 +1074,7 @@ export default {
let resObj = JSON.parse(res)
if (resObj.errorList.length) {
ElMessage({
message: `文件夹${resObj.errorList.join(",")}创建失败`,
message: `文件夹${resObj.errorList.join(",")} 创建失败`,
type: 'error',
})
} else {
@ -1027,7 +1103,7 @@ export default {
id: level3Item.id,
label: level3Item.label,
currentId: level3Item.currentId,
path: `${resObj.errorList[0].oldPath}\\${level2Item}\\${level3Item}`,
path: `${resObj.errorList[0].oldPath} \\${level2Item} \\${level3Item} `,
delete: false,
preId: level3Item.preId,
prepreId: level3Item.prepreId,
@ -1041,7 +1117,7 @@ export default {
id: level2Item.id,
label: level2Item.label,
currentId: level2Item.currentId,
path: `${resObj.errorList[0].oldPath}\\${level2Item.label}`,
path: `${resObj.errorList[0].oldPath} \\${level2Item.label} `,
delete: false,
preId: level2Item.preId,
prepreId: "",
@ -1055,7 +1131,7 @@ export default {
id: preNodeTemp.id,
label: resObj.errorList[0].oldPath,
currentId: preNodeTemp.currentId,
path: `${resObj.errorList[0].oldPath}`,
path: `${resObj.errorList[0].oldPath} `,
delete: false,
preId: "",
prepreId: "",
@ -1073,7 +1149,7 @@ export default {
that.searchTree()
//
let collection = myDatabase.fileList
collection = collection.filter((equip) => _.startsWith(equip.path, `${preNodeTemp.label}\\`))
collection = collection.filter((equip) => _.startsWith(equip.path, `${preNodeTemp.label} \\`))
let fileList = await collection.toArray()
for (let index = 0; index < fileList.length; index++) {
let fileItem = fileList[index];
@ -1092,12 +1168,12 @@ export default {
let resObj = JSON.parse(res)
if (resObj.errorList.length) {
ElMessage({
message: `文件夹${resObj.errorList[0].name}删除失败`,
message: `文件夹${resObj.errorList[0].name} 删除失败`,
type: 'error',
})
} else {
ElMessage({
message: `文件夹${resObj.successList[0].name}删除成功`,
message: `文件夹${resObj.successList[0].name} 删除成功`,
type: 'success',
})
await myDatabase.treeList.bulkDelete(that.deleteXiangmuIdList)
@ -1125,7 +1201,7 @@ export default {
errorList.push(element.fileName)
}
ElMessage({
message: `${resObj.errorList[0].xiangmuName}项目下${resObj.errorList[0].juanName}卷下新增文件${_.join(errorList, ",")}失败`,
message: `${resObj.errorList[0].xiangmuName}项目下${resObj.errorList[0].juanName}卷下新增文件${_.join(errorList, ",")} 失败`,
type: 'error',
})
} else {
@ -1135,7 +1211,7 @@ export default {
successList.push(element.fileName)
}
ElMessage({
message: `${resObj.successList[0].xiangmuName}项目下${resObj.successList[0].juanName}卷下新增文件${_.join(successList, ",")}成功`,
message: `${resObj.successList[0].xiangmuName}项目下${resObj.successList[0].juanName}卷下新增文件${_.join(successList, ",")} 成功`,
type: 'success',
})
that.searchTable()
@ -1145,7 +1221,7 @@ export default {
window.electron.ipcRenderer.on('downloadFileResult', async (eve, result) => {
if (!result.success) {
ElMessage({
message: `文件下载失败${result.error}`,
message: `文件下载失败${result.error} `,
type: 'error',
});
return;

Loading…
Cancel
Save