|
@@ -1,67 +1,82 @@
|
|
|
<!--
|
|
|
* @Author: ql
|
|
|
* @Date: 2022-01-11 14:46:04
|
|
|
- * @LastEditTime: 2022-01-11 19:50:10
|
|
|
+ * @LastEditTime: 2022-01-14 15:18:59
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @FilePath: \adm-frontend\src\components\cadDrawingManage\index.vue
|
|
|
-->
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">
|
|
|
- <div class="grid-content bg-purple" >
|
|
|
- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
|
|
+ <div class="contentContainer">
|
|
|
+ <el-row class="h100">
|
|
|
+ <el-col :span="4" class="h100">
|
|
|
+ <div class="grid-content bg-purple bg h100" style="overflow-y: scroll">
|
|
|
+ <Tree
|
|
|
+ :data="options"
|
|
|
+ @change="selectFloorHandle"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="20" style="padding-left: 24px">
|
|
|
- <div class="grid-content bg-purple-light tab-right" style="background: #fff; padding: 0 16px 16px">
|
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="土建精装" name="first"></el-tab-pane>
|
|
|
- <el-tab-pane label="空调专业" name="second"></el-tab-pane>
|
|
|
- <el-tab-pane label="消防专业" name="third"></el-tab-pane>
|
|
|
- <el-tab-pane label="给排水专业" name="fourth"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <el-col :span="20" style="padding-left: 24px" class="h100">
|
|
|
+ <div class="grid-content bg-purple-light tab-right bg h100" style="padding: 0 16px 16px">
|
|
|
+ <div class="tab_warp">
|
|
|
+ <Tabs type="first-nav" :data="MENU_MAP" v-model="currentTab" />
|
|
|
+ </div>
|
|
|
<div>
|
|
|
- <div style="display: flex; justify-content: space-between">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
- :on-change="handleChange"
|
|
|
- :file-list="fileList">
|
|
|
- <el-button size="small" type="primary">上传.dwg CAD文件</el-button>
|
|
|
-
|
|
|
- </el-upload>
|
|
|
- <el-button type="primary" icon="el-icon-download">批量导出</el-button>
|
|
|
+ <div style="display: flex; justify-content: space-between;margin-top: 24px">
|
|
|
+ <h3>图纸文件列表</h3>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <Button type="primary" :disabled='true' icon="el-icon-download">批量导出</Button>
|
|
|
+ <el-upload
|
|
|
+ class="upload"
|
|
|
+ ref="upload"
|
|
|
+ :multiple="true"
|
|
|
+ action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
+ :file-list="fileList"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-change='fileChange'
|
|
|
+ :on-progress='progressHandle'
|
|
|
+ :auto-upload="false">
|
|
|
+ <Button slot="trigger" type="primary" icon="el-icon-download">上传.dwg CAD文件</Button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
- <el-divider></el-divider>
|
|
|
- <div>
|
|
|
+ <div class="tableView1">
|
|
|
<el-table
|
|
|
- :data="tableData"
|
|
|
- style="width: 100%">
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="tableList"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ v-loading="tableLoading"
|
|
|
+ style="width: 100%"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
<el-table-column
|
|
|
type="selection"
|
|
|
width="55">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
- label="文件名"
|
|
|
- width="180">
|
|
|
+ label="文件名称"
|
|
|
+ prop="fileName"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
+ <el-table-column
|
|
|
label="最新上传时间"
|
|
|
- width="180">
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">{{ scope.row.modifiedTime }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
- label="上传人">
|
|
|
+ prop="creator"
|
|
|
+ label="上传人"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ fixed="right"
|
|
|
label="操作"
|
|
|
- width="100">
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
|
|
|
- <el-button type="text" size="small">编辑</el-button>
|
|
|
+ <el-button @click="delHandle(scope.row)" type="text" size="small">删除</el-button>
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-button type="text" size="small" disabled>导出</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -74,71 +89,141 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Tree, Tabs, Button } from 'meri-design'
|
|
|
+import { MENU_MAP } from '@/data/cadConst'
|
|
|
+import BuildController from "@/controller/old-adm/buildController"
|
|
|
+import cadDrawingController from '@/controller/cadDarwingController'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ Tree,
|
|
|
+ Tabs,
|
|
|
+ Button,
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ currentTab(nv, ov) {
|
|
|
+ console.log({nv, ov})
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- data: [{
|
|
|
- label: '一级 1',
|
|
|
- children: [{
|
|
|
- label: '二级 1-1',
|
|
|
- children: [{
|
|
|
- label: '三级 1-1-1'
|
|
|
- }]
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '一级 2',
|
|
|
- children: [{
|
|
|
- label: '二级 2-1',
|
|
|
- children: [{
|
|
|
- label: '三级 2-1-1'
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '二级 2-2',
|
|
|
- children: [{
|
|
|
- label: '三级 2-2-1'
|
|
|
- }]
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '一级 3',
|
|
|
- children: [{
|
|
|
- label: '二级 3-1',
|
|
|
- children: [{
|
|
|
- label: '三级 3-1-1'
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '二级 3-2',
|
|
|
- children: [{
|
|
|
- label: '三级 3-2-1'
|
|
|
- }]
|
|
|
- }]
|
|
|
- }],
|
|
|
- tableData: [{
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }]
|
|
|
+ currentTab: 'id1',
|
|
|
+ MENU_MAP,
|
|
|
+ options: [],
|
|
|
+ tableList: [], //文件列表数据
|
|
|
+ tableLoading: false,
|
|
|
+ fileList: [], //已选择文件
|
|
|
+ // 基础表格表头列表
|
|
|
+ headList: [
|
|
|
+ {
|
|
|
+ title: "文件名称", // 列的名称
|
|
|
+ key: "state", // 列的标识
|
|
|
+ show: true // 是否显示该列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "最新上传时间",
|
|
|
+ key: "name",
|
|
|
+ show: true,
|
|
|
+ width: 300
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "上传人",
|
|
|
+ key: "job",
|
|
|
+ show: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 获取楼层信息
|
|
|
+ async getCascader() {
|
|
|
+ let param = {
|
|
|
+ cascade: [{ name: "floor", orders: "floorSequenceID desc", filters: `id != '${this.floorId}'` }],
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ };
|
|
|
+
|
|
|
+ this.options = await BuildController.buildDataFormat(param);
|
|
|
+
|
|
|
+ },
|
|
|
+ // 选择楼层
|
|
|
+ selectFloorHandle(id) {
|
|
|
+ console.log({id})
|
|
|
+ },
|
|
|
+ // 获取文件列表数据
|
|
|
+ async getFileList () {
|
|
|
+ this.tableLoading = true
|
|
|
+ this.tableList = await cadDrawingController.queryFileList();
|
|
|
+ this.tableLoading = false
|
|
|
+ console.log({res})
|
|
|
+ },
|
|
|
+ fileChange(file, fileList) {
|
|
|
+ console.log({file, fileList})
|
|
|
+ },
|
|
|
+ progressHandle(e, file, fileList) {
|
|
|
+ console.log({file, fileList})
|
|
|
+ },
|
|
|
+ delHandle(row) {
|
|
|
+ this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async() => {
|
|
|
+ this.tableLoading = true
|
|
|
+ await cadDrawingController.delFile(row);
|
|
|
+ this.tableLoading = false;
|
|
|
+ this.getFileList();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getCascader()
|
|
|
+ this.getFileList()
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang='less'>
|
|
|
.tab-right{
|
|
|
- & /deep/ .el-tabs__nav-wrap::after {
|
|
|
- height: 1px;
|
|
|
+ & /deep/ .el-divider--horizontal {
|
|
|
+ height: 0.5px;
|
|
|
+ }
|
|
|
+ & /deep/ .upload {
|
|
|
+ display: inline-block;
|
|
|
+ margin-left: 16px;
|
|
|
}
|
|
|
}
|
|
|
+ .bg {
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+ .h100 {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .tableView1 {
|
|
|
+ margin-top: 16px;
|
|
|
+ height: 290px
|
|
|
+ }
|
|
|
+ .tab_warp {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ border-bottom: 1px solid #eff0f1;
|
|
|
+ box-sizing: border-box;
|
|
|
+ & /deep/ .p-tabs-nav-wrap {
|
|
|
+ box-sizing: content-box;
|
|
|
+ margin-bottom: -1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</style>
|