add dispatch page for view file feature

This commit is contained in:
Eleven 2021-01-13 21:45:47 +08:00
parent 11abee020d
commit b07ce66b97
3 changed files with 51 additions and 18 deletions

View File

@ -36,6 +36,10 @@
<a-tooltip slot="lastOutGivingTime" slot-scope="text" placement="topLeft" :title="text">
<span>{{ text }}</span>
</a-tooltip>
<template slot="child-operation" slot-scope="text, record">
<a-button type="primary" @click="handleFile(record)">文件</a-button>
<a-button type="primary" @click="handleConsole(record)">控制台</a-button>
</template>
</a-table>
</a-table>
<!-- 添加关联项目 -->
@ -107,12 +111,23 @@
</a-form-model-item>
</a-form-model>
</a-modal>
<!-- 项目文件组件 -->
<a-drawer :title="drawerTitle" placement="right" width="85vw"
:visible="drawerFileVisible" @close="onFileClose">
<file v-if="drawerFileVisible" :nodeId="temp.nodeId" :projectId="temp.projectId" />
</a-drawer>
</div>
</template>
<script>
import File from '../node/node-layout/project/project-file';
// import Console from '../node/node-layout/project/project-console';
import { getDishPatchList, getReqId, editDispatch, getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
import { getNodeProjectList } from '../../api/node'
export default {
components: {
File,
// Console
},
data() {
return {
loading: false,
@ -134,6 +149,8 @@ export default {
],
linkDispatchVisible: false,
editDispatchVisible: false,
drawerTitle: '',
drawerFileVisible: false,
columns: [
{title: '分发 ID', dataIndex: 'id', width: 100, ellipsis: true, scopedSlots: {customRender: 'id'}},
{title: '分发名称', dataIndex: 'name', width: 150, ellipsis: true, scopedSlots: {customRender: 'name'}},
@ -146,7 +163,7 @@ export default {
{title: '项目状态', dataIndex: 'status', width: 150, ellipsis: true, scopedSlots: {customRender: 'status'}},
{title: '分发状态', dataIndex: 'statusMsg', width: 180},
{title: '最后分发时间', dataIndex: 'lastOutGivingTime', width: 180, ellipsis: true, scopedSlots: {customRender: 'lastOutGivingTime'}},
{title: '操作', dataIndex: 'operation', scopedSlots: {customRender: 'operation'}, width: 200, align: 'left'}
{title: '操作', dataIndex: 'child-operation', scopedSlots: {customRender: 'child-operation'}, width: 200, align: 'left'}
],
rules: {
id: [
@ -367,6 +384,22 @@ export default {
})
}
});
},
//
handleFile(record) {
this.temp = Object.assign(record);
this.drawerTitle = `文件管理(${this.temp.projectId})`
this.drawerFileVisible = true;
},
//
onFileClose() {
this.drawerFileVisible = false;
},
//
handleConsole(record) {
this.temp = Object.assign(record);
this.drawerTitle = `控制台(${this.temp.name})`;
this.drawerConsoleVisible = true;
}
}
}

View File

@ -44,11 +44,11 @@
import { getFileList, downloadProjectFile, deleteProjectFile, uploadProjectFile } from '../../../../api/node-project';
export default {
props: {
node: {
type: Object
nodeId: {
type: String
},
project: {
type: Object
projectId: {
type: String
}
},
data() {
@ -120,8 +120,8 @@ export default {
this.uploadFileList.forEach(file => {
const formData = new FormData();
formData.append('file', file);
formData.append('nodeId', this.node.id);
formData.append('id', this.project.id);
formData.append('nodeId', this.nodeId);
formData.append('id', this.projectId);
formData.append('levelName', this.tempNode.path);
//
uploadProjectFile(formData).then(res => {
@ -148,8 +148,8 @@ export default {
}
//
const params = {
nodeId: this.node.id,
id: this.project.id,
nodeId: this.nodeId,
id: this.projectId,
path: node.dataRef.path
}
this.fileList = [];
@ -194,8 +194,8 @@ export default {
}
//
const params = {
nodeId: this.node.id,
id: this.project.id,
nodeId: this.nodeId,
id: this.projectId,
path: this.tempNode.path
}
this.fileList = [];
@ -226,8 +226,8 @@ export default {
onOk: () => {
//
const params = {
nodeId: this.node.id,
id: this.project.id,
nodeId: this.nodeId,
id: this.projectId,
type: 'clear'
}
//
@ -251,8 +251,8 @@ export default {
});
//
const params = {
nodeId: this.node.id,
id: this.project.id,
nodeId: this.nodeId,
id: this.projectId,
levelName: record.levelName,
filename: record.filename
}
@ -277,8 +277,8 @@ export default {
onOk: () => {
//
const params = {
nodeId: this.node.id,
id: this.project.id,
nodeId: this.nodeId,
id: this.projectId,
levelName: record.levelName,
filename: record.filename
}

View File

@ -119,7 +119,7 @@
<!-- 项目文件组件 -->
<a-drawer :title="drawerTitle" placement="right" width="85vw"
:visible="drawerFileVisible" @close="onFileClose">
<file v-if="drawerFileVisible" :node="node" :project="temp" />
<file v-if="drawerFileVisible" :nodeId="node.id" :projectId="temp.id" />
</a-drawer>
<!-- 项目控制台组件 -->
<a-drawer :title="drawerTitle" placement="right" width="85vw"