From 54479ac35f0097089be008ed1a0eb86751e1bf75 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 05 六月 2024 22:53:36 +0800
Subject: [PATCH] 完善工位文件
---
src/views/dnc/station-file/Log.vue | 12 +-
src/views/dnc/station-file/index.vue | 14 +-
src/views/dnc/station-file/File.vue | 268 +++++++++++++++++++++++++++++++++++++++++++++++++++--
src/views/mdc/MYTree.vue | 6
4 files changed, 272 insertions(+), 28 deletions(-)
diff --git a/src/views/dnc/station-file/File.vue b/src/views/dnc/station-file/File.vue
index a114307..7782e77 100644
--- a/src/views/dnc/station-file/File.vue
+++ b/src/views/dnc/station-file/File.vue
@@ -1,34 +1,278 @@
<!--
* @Date: 2024-05-22 23:37:07
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-26 15:42:35
+ * @LastEditTime: 2024-06-05 22:52:06
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/station-file/File.vue
-->
<template>
<el-container>
<el-header>
- <el-button type="primary">褰掓。</el-button>
+ <el-button :disabled="selectionFile.length == 0 && selection.length == 0" type="primary"
+ @click="archive">褰掓。</el-button>
+ <el-tree-select v-model="storageSpaceId" :data="treeData" :props="{
+ label: 'name',
+ }" node-key="id" default-expand-all check-strictly style="width: 240px">
+ <template #prefix>
+ FTP鐩綍
+ </template>
+ </el-tree-select>
</el-header>
<el-main>
- <h2>绋嬪簭</h2>
- <el-table :data="tableData" style="width: 100%">
- <el-table-column label="鏂囦欢鍚嶇О" prop="" width=""></el-table-column>
- <el-table-column label="鐗堟湰" prop="" width=""></el-table-column>
- <el-table-column label="澶у皬" prop="" width=""></el-table-column>
+ <h2 style="background-color: var(--el-color-primary);color: #fff;padding: 4px 20px;">绋嬪簭</h2>
+ <el-table :data="tableData" style="width: 100%" @selection-change="onSelectionChange">
+ <el-table-column type="selection"></el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="filename" width=""></el-table-column>
+ <el-table-column label="鐗堟湰" prop="versionDesc" width=""></el-table-column>
+ <el-table-column label="澶у皬" prop="contentLength" width=""></el-table-column>
+ <el-table-column label="鏂囦欢绫诲瀷" prop="suffix" width=""></el-table-column>
+ <el-table-column label="鏂囦欢浣嶇疆" prop="fileLocation" width=""></el-table-column>
+ <el-table-column label="褰掓。鐘舵��" prop="whetherArchiveDesc" width=""></el-table-column>
+ <el-table-column label="鏇存柊浜�" prop="updateUserName" width=""></el-table-column>
+ <el-table-column label="鏇存柊鏃堕棿" prop="updateTime" width=""></el-table-column>
+ <el-table-column label="鎿嶄綔" prop="" width="">
+ <template #default="scope">
+ <el-button-group>
+ <el-button text type="primary" size="small"
+ @click="download(scope.row, scope.$index)">涓嬭浇</el-button>
+ <el-popconfirm width="220" title="纭畾灏嗛�夋嫨鐨勬暟鎹垹闄�" @confirm="table_del(scope.row)">
+ <template #reference>
+ <el-button text type="primary" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-popconfirm>
+ </el-button-group>
+ </template>
+ </el-table-column>
</el-table>
- <h2>鏂囦欢</h2>
- <el-table :data="tableData" style="width: 100%">
- <el-table-column label="鏂囦欢鍚嶇О" prop="" width=""></el-table-column>
- <el-table-column label="鐗堟湰" prop="" width=""></el-table-column>
- <el-table-column label="澶у皬" prop="" width=""></el-table-column>
+ <h2 style="margin-top: 10px;background-color: var(--el-color-primary);color: #fff;padding: 4px 20px;">鏂囦欢
+ </h2>
+ <el-table :data="tableDataFile" style="width: 100%" @selection-change="onSelectionChangeFile">
+ <el-table-column type="selection"></el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="filename" width=""></el-table-column>
+ <el-table-column label="鐗堟湰" prop="versionDesc" width=""></el-table-column>
+ <el-table-column label="澶у皬" prop="contentLength" width=""></el-table-column>
+ <el-table-column label="鏂囦欢绫诲瀷" prop="suffix" width=""></el-table-column>
+ <el-table-column label="鏂囦欢浣嶇疆" prop="fileLocation" width=""></el-table-column>
+ <el-table-column label="褰掓。鐘舵��" prop="whetherArchiveDesc" width=""></el-table-column>
+ <el-table-column label="鏇存柊浜�" prop="updateUserName" width=""></el-table-column>
+ <el-table-column label="鏇存柊鏃堕棿" prop="updateTime" width=""></el-table-column>
+ <el-table-column label="鎿嶄綔" prop="" width="">
+ <template #default="scope">
+ <el-button-group>
+ <el-button text type="primary" size="small"
+ @click="download(scope.row, scope.$index)">涓嬭浇</el-button>
+ <el-popconfirm width="220" title="纭畾灏嗛�夋嫨鐨勬暟鎹垹闄�" @confirm="table_del(scope.row)">
+ <template #reference>
+ <el-button text type="primary" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-popconfirm>
+ </el-button-group>
+ </template>
+ </el-table-column>
</el-table>
</el-main>
+ <scDialog v-model="visible">
+ <el-tabs v-model="activeName" type="card" class="demo-tabs">
+ <el-tab-pane label="褰掓。鐩綍" name="1">
+ <el-tree v-if="activeName === '1'" ref="group" node-key="id" :props="{
+ label: 'name',
+ hasChildren: 'id'
+ }" show-checkbox :load="loadNode" lazy></el-tree>
+ </el-tab-pane>
+ <el-tab-pane label="宸ヨ壓绠$悊" name="2">
+ <el-tree v-if="activeName === '2'" ref="group" node-key="id" :props="{
+ label: 'name',
+ hasChildren: 'id'
+ }" show-checkbox :load="loadNode1" lazy></el-tree>
+ </el-tab-pane>
+ </el-tabs>
+ <template #footer>
+ <div style="text-align: right;">
+ <el-button type="primary" @click="confirm">纭畾</el-button>
+ </div>
+ </template>
+
+ </scDialog>
</el-container>
</template>
<script>
export default {
+ props: {
+ treeChecked: {
+ type: Array,
+ }
+ },
+ watch: {
+ treeChecked(val) {
+ console.log(val[0])
+ if (val?.[0]) {
+ this.init(val?.[0])
+ } else {
+ this.treeData = []
+ }
+ },
+ storageSpaceId() {
+ this.getFilelist()
+ }
+ },
+ data() {
+ return {
+ treeData: [],
+ storageSpaceId: '',
+ tableData: [],
+ tableDataFile: [],
+ selection: [],
+ selectionFile: [],
+ visible: false,
+ activeName: '1'
+ }
+ },
+ methods: {
+ init(workstationId) {
+ this.$HTTP.get(`/api/blade-dnc/dnc-fixed-space/direct-loading-space-tree?workstationId=${workstationId}`).then(res => {
+ this.storageSpaceId = res.data[0].id
+ this.treeData = this.formatData(res.data)
+ })
+ },
+ formatData(data, current, flag) {
+ let newData = []
+ if (!current) {
+ newData = data.filter(item => item.parentId == 0).map(v => {
+ v.children = this.formatData(data, v, flag).sort((a, b) => {
+ return b.sort - a.sort
+ })
+ flag && (v.disabled = !v.isWorkstation)
+ return v
+ })
+ } else {
+ let res = data.filter(v => v.parentId == current.id)
+ res = res.map(item => {
+ item.children = this.formatData(data, item, flag).sort((a, b) => {
+ return b.sort - a.sort
+ })
+ flag && (item.disabled = !item.isWorkstation)
+ return item
+ })
+ return res
+ }
+ return newData
+ },
+ getFilelist() {
+ this.$HTTP.post(`/api/blade-dnc/transfer-directory/fileList`, {
+ storageSpaceId: this.storageSpaceId,
+ fileLocations: [2],
+ workstationId: this.treeChecked[0]
+ }).then(res => {
+ this.selection = []
+ this.tableData = res.data.filter(v => v.fileType == 1)
+ this.tableDataFile = res.data.filter(v => v.fileType == 2)
+ })
+ },
+ onSelectionChange(selection) {
+ this.selection = selection
+ },
+ onSelectionChangeFile(selection) {
+ this.selectionFile = selection
+ },
+ download() {
+ },
+ table_del(row) {
+ this.$HTTP.get(`/api/blade-dnc/transfer-directory/delete-file/${row.id}`).then(res => {
+ this.getFilelist()
+ })
+ },
+ loadNode(node, resolve) {
+ let id = node.level === 0 ? '' : node.data.id
+ this.$HTTP.get(`/api/blade-dnc/dnc-archive-directory/list?parentId=${id}`).then(res => {
+ resolve(res.data)
+ })
+ },
+ loadNode1(node, resolve) {
+ let id = node.level === 0 ? '' : node.data.id
+ this.$HTTP.get(`/api/blade-dnc/dnc-process-catalogue/lazy-art-list?parentId=${id}`).then(res => {
+ resolve(res.data)
+ })
+ },
+ archive() {
+ this.visible = true
+ },
+ async confirm() {
+ let archiveDirectoryIds = this.$refs.group.getCheckedNodes().map(v => v.id)
+ console.log('>>>>>>', archiveDirectoryIds)
+ if (archiveDirectoryIds.length === 0) {
+ return this.$message.warning(`璇烽�夋嫨鏂囦欢澶筦);
+ }
+ if (this.activeName === '1') {
+ this.$HTTP.post(`/api/blade-dnc/dnc-archive-directory-file/checkFile`, {
+ archiveDirectoryIds,
+ voList: [...this.selection, ...this.selectionFile].map(v => {
+ return {
+ contentMd5: v.contentMd5,
+ filename: v.filename,
+ objectKey: v.objectKey,
+ workstationId: v.workstationId
+ }
+ })
+ }).then(res => {
+ if (!res.data) {
+ this.$HTTP.post(`/api/blade-dnc/dnc-archive-directory-file/insert`, {
+ archiveDirectoryIds,
+ fileAddVOList: [...this.selection, ...this.selectionFile].map(v => {
+ return {
+ contentLength: v.contentLength,
+ contentMd5: v.contentMd5,
+ contentType: v.contentType,
+ fileOwnership: v.documentOwnerships || 1,
+ filename: v.filename,
+ link: v.link,
+ objectKey: v.objectKey,
+ originalFilename: v.originalFilename,
+ suffix: v.suffix,
+ workstationFileId: v.id,
+ workstationId: v.workstationId,
+ }
+ })
+ }).then(res => {
+ this.visible = false
+ this.$message.success(res.msg);
+ })
+ }
+ })
+ } else {
+ Promise.all(archiveDirectoryIds.map(v => {
+ return this.$HTTP.post(`/api/blade-dnc/dnc-art-file/duplicate-validation-file`, {
+ artBagId: v,
+ artFileAddVOList: [...this.selection, ...this.selectionFile].map(v => {
+ return {
+ contentMd5: v.contentMd5,
+ fileType: v.fileType,
+ filename: v.filename,
+ objectKey: v.objectKey,
+ }
+ })
+ })
+ })).then(arr => {
+ let artBagIds = []
+ arr.forEach((item, index) => {
+ if (!item.data) artBagIds.push(archiveDirectoryIds[index])
+ });
+ if (artBagIds.length === 0) {
+ return this.$message.warning(`閲嶅`);
+ }
+ this.$HTTP.post(`/api/blade-dnc/dnc-art-file/batch-insert`, {
+ artBagIds,
+ dncArtFileAddList: [...this.selection, ...this.selectionFile]
+ }).then(res => {
+ this.visible = false
+ this.$message.success(res.msg);
+ })
+ })
+ }
+
+ // /api/blade-dnc/dnc-archive-directory-file/checkFile
+ }
+ },
}
</script>
diff --git a/src/views/dnc/station-file/Log.vue b/src/views/dnc/station-file/Log.vue
index 9c36765..03df8ea 100644
--- a/src/views/dnc/station-file/Log.vue
+++ b/src/views/dnc/station-file/Log.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-05-22 23:18:15
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-26 16:04:41
+ * @LastEditTime: 2024-06-05 21:21:55
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/station-file/Log.vue
-->
<template>
@@ -26,9 +26,9 @@
<el-option v-for="item in options.typeId" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-header>
- <el-main >
- <scTable v-if="id" highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table" :params="params"
- :apiObj="apiObj" @selection-change="selectionChange" stripe>
+ <el-main>
+ <scTable v-if="id" highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table"
+ :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe>
<el-table-column label="鏂囦欢鍚嶇О" prop="fileName">
</el-table-column>
<el-table-column label="鐗堟湰" prop="version"></el-table-column>
@@ -71,7 +71,7 @@
current: data.current,
size: data.size
}
- return await this.$HTTP.post(`/api/blade-dnc/operation-file/page/${this.id}`, {}, { params,data:this.params }).then(res => {
+ return await this.$HTTP.post(`/api/blade-dnc/operation-file/page/${this.id}`, {}, { params, data: this.params }).then(res => {
return res
})
}
@@ -79,7 +79,7 @@
}
},
methods: {
- dataChange (data) {
+ dataChange(data) {
console.log(data)
}
}
diff --git a/src/views/dnc/station-file/index.vue b/src/views/dnc/station-file/index.vue
index 8f2757b..7e2c974 100644
--- a/src/views/dnc/station-file/index.vue
+++ b/src/views/dnc/station-file/index.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-05-20 21:43:10
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-26 16:02:09
+ * @LastEditTime: 2024-06-05 21:11:02
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/station-file/index.vue
-->
<template>
@@ -21,10 +21,10 @@
<el-main>
<el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="宸ヤ綅鏂囦欢" name="1">
- <File></File>
+ <File :treeChecked="treeChecked"></File>
</el-tab-pane>
<el-tab-pane label="鎿嶄綔鏃ュ織" name="2">
- <Log :id="id"/>
+ <Log :id="id" />
</el-tab-pane>
</el-tabs>
</el-main>
@@ -46,10 +46,10 @@
data() {
return {
id: '',
- activeName: '2',
+ activeName: '1',
treeChecked: {},
props: {
- disabled: function (data,node) {
+ disabled: function (data, node) {
return !data.ftpCatalogue
}
}
@@ -57,12 +57,12 @@
},
watch: {
treeChecked(val) {
- console.log(val,'>>>>>>')
+ console.log(val, '>>>>>>')
this.id = val?.[0]
}
},
methods: {
- query () {
+ query() {
}
}
diff --git a/src/views/mdc/MYTree.vue b/src/views/mdc/MYTree.vue
index 1713833..715cbe1 100644
--- a/src/views/mdc/MYTree.vue
+++ b/src/views/mdc/MYTree.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-18 19:53:35
* @LastEditors: Sneed
- * @LastEditTime: 2024-06-04 21:33:08
+ * @LastEditTime: 2024-06-05 21:46:20
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue
-->
<template>
@@ -139,8 +139,8 @@
</script>
<style lang="scss">
-.is-current .el-tree-node__content {
- background: var(--el-color-primary) !important;
+.is-current>.el-tree-node__content {
+ // background: var(--el-color-primary) !important;
}
a.disabled {
--
Gitblit v1.9.3