| | |
| | | <!-- |
| | | * @Date: 2024-05-16 22:40:01 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-19 19:26:43 |
| | | * @LastEditTime: 2024-05-19 19:52:38 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/document/index.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-aside width="200px"> |
| | | <el-container> |
| | | <el-main> |
| | | <el-tree default-expand-all ref="group" node-key="id" :data="treeData" :props="{ |
| | | <el-tree default-expand-all ref="tree" node-key="id" :data="treeData" :props="{ |
| | | label: 'name', |
| | | }" @node-click="nodeClick" highlight-current :current-node-key="selectNode.id"> |
| | | <template #default="{ node, data }"> |
| | |
| | | </el-aside> |
| | | <el-container> |
| | | <el-header> |
| | | <el-button type="">返回上一级</el-button> |
| | | <el-button type="" @click="back">返回上一级</el-button> |
| | | <el-dropdown style="margin-left: 8px;"> |
| | | <el-button type="primary"> |
| | | 新建<el-icon class="el-icon--right"><el-icon-arrow-down /></el-icon> |
| | |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | <el-button style="margin-left: 8px;" type="danger" plain |
| | | :disabled="selection.length == 0">删除</el-button> |
| | | <el-button-group style="margin-left: auto;"> |
| | | <el-button style="margin-left: 8px;" type="danger" plain :disabled="selection.length == 0" |
| | | @click="del(selection)">删除</el-button> |
| | | <!-- <el-button-group style="margin-left: auto;"> |
| | | <el-button :type="type === 'list' ? 'primary' : ''" @click="type = 'list'"> |
| | | <el-icon> |
| | | <el-icon-fold /> |
| | |
| | | <el-icon-grid /> |
| | | </el-icon> |
| | | </el-button> |
| | | </el-button-group> |
| | | <el-input v-model="params.searchKey" style="margin-left: 8px;max-width: 240px" |
| | | </el-button-group> --> |
| | | <el-input v-model="params.searchKey" style="margin-left: auto;max-width: 240px" |
| | | placeholder="请输入关键词" class="input-with-select"> |
| | | <template #append> |
| | | <el-button type="primary" class="header-search" @click="search"> |
| | |
| | | <scTable highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table" |
| | | :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe> |
| | | <el-table-column type="selection" width="50"></el-table-column> |
| | | <el-table-column label="文件名称" prop="name"></el-table-column> |
| | | <el-table-column label="文件名称" prop="name"> |
| | | <template #default="scope"> |
| | | <a v-if="scope.row.fileType === 1" @click="goCurrent(scope.row)" |
| | | style="color: var(--el-color-primary);cursor: pointer;">{{ scope.row.name }}</a> |
| | | <span v-else>{{ scope.row.name }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="文件路径" prop="allPathName"></el-table-column> |
| | | <el-table-column label="大小" prop="contentLength"></el-table-column> |
| | | <el-table-column label="文件类型" prop="suffix"></el-table-column> |
| | |
| | | <el-button-group> |
| | | <el-button text type="primary" size="small" |
| | | @click="table_edit(scope.row, scope.$index)">编辑</el-button> |
| | | <el-popconfirm title="确定删除吗?" @confirm="table_del([scope.row], '0')"> |
| | | <template #reference> |
| | | <el-button text type="primary" size="small">删除</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | <el-button text type="primary" size="small" |
| | | @click="del([scope, row])">删除</el-button> |
| | | </el-button-group> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | nodeClick(node) { |
| | | this.selectNode = node |
| | | }, |
| | | goCurrent(row) { |
| | | this.selectNode = { id: row.id } |
| | | console.log(row) |
| | | }, |
| | | back() { |
| | | console.log(this.$refs.tree.getCurrentNode()) |
| | | this.selectNode = { id: this.$refs.tree.getCurrentNode().parentId } |
| | | }, |
| | | search() { |
| | | this.$refs?.table.reload() |
| | | }, |
| | |
| | | this.form = { isNewFile: false } |
| | | }, |
| | | saveFolder() { |
| | | if (this.form.id) { |
| | | return this.$HTTP.put(`/api/blade-dnc/file/${this.form.id}/rename`, { fileType: this.form.fileType, newName: this.form.name, parentId: this.form.parentId }).then(res => { |
| | | this.search() |
| | | }) |
| | | } |
| | | let data = { |
| | | ...this.form, |
| | | parent: this.selectNode.id |
| | |
| | | move() { |
| | | this.$HTTP.post(`/api/blade-dnc/file/move`, { parentId: this.formFile.parentId, sourceIdList: this.selection.map(v => v.id) }) |
| | | }, |
| | | async del() { |
| | | table_edit(row) { |
| | | this.form = { |
| | | id: row.id, |
| | | name: row.name, |
| | | fileType: row.fileType, |
| | | parentId: row.parentId |
| | | } |
| | | this.visible = true |
| | | }, |
| | | async del(selection) { |
| | | let confirm = await this.$HTTP.post(`/api/blade-dnc/file/exists-file`).then(res => { |
| | | if (res.data) { |
| | | return res.data |