|
@@ -49,7 +49,7 @@
|
|
|
</template>
|
|
|
</hc-new-card>
|
|
|
</hc-page-split>
|
|
|
- <!-- 移动 -->
|
|
|
+ <!-- 跨目录移动 -->
|
|
|
<hc-new-dialog v-model="movesModal" :loading="movesModalLoading" is-table title="跨目录移动" widths="80vw" @close="movesModalClose" @save="movesModalSave">
|
|
|
<div class="hc-moves-transfer-box">
|
|
|
<div class="hc-moves-transfer-panel">
|
|
@@ -59,36 +59,39 @@
|
|
|
选择需要迁移的文件
|
|
|
</el-checkbox>
|
|
|
</div>
|
|
|
- <div class="panel-header-extra">{{ checkedMoves.length }}/{{ tableCheckedKeys.length }}</div>
|
|
|
+ <div class="panel-header-extra">{{ checkedMoves.length }}/{{ fileDatasList.length }}</div>
|
|
|
</div>
|
|
|
<div class="panel-body">
|
|
|
- <el-scrollbar>
|
|
|
+ <el-scrollbar v-loading="fileDatasListLoading">
|
|
|
<el-checkbox-group v-model="checkedMoves" @change="handleCheckedMovesChange">
|
|
|
- <div v-for="item in tableCheckedKeys" :key="item.id" class="hc-file-checkbox">
|
|
|
- <el-checkbox :value="item.id" class="space size-xl">{{ item.name }}</el-checkbox>
|
|
|
+ <!-- 为文件名容器添加自定义class以便设置样式 -->
|
|
|
+ <div v-for="item in fileDatasList" :key="item.id" class="file-item">
|
|
|
+ <el-checkbox :label="item">
|
|
|
+ <span class="file-name">{{ item.fileName }}</span>
|
|
|
+ </el-checkbox>
|
|
|
</div>
|
|
|
</el-checkbox-group>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="hc-moves-transfer-buttons">
|
|
|
- <!-- <el-button hc-btn _icon size="small"
|
|
|
- :type="tableCheckedKeys.length <= 0 || checkedMoves.length <= 0 ? '' : 'primary'"
|
|
|
- :disabled="tableCheckedKeys.length <= 0 || checkedMoves.length <= 0">
|
|
|
- <HcIcon name="arrow-right"/>
|
|
|
- </el-button> -->
|
|
|
<HcIcon name="arrow-right-double" style="font-size: 22px;" type="primary" />
|
|
|
</div>
|
|
|
<div class="hc-moves-transfer-panel">
|
|
|
<div class="panel-header">选择移动目录</div>
|
|
|
- <div class="panel-body">
|
|
|
+ <div v-loading="treePanelLoading" class="panel-body">
|
|
|
<el-scrollbar>
|
|
|
- <HcTree :contract-id="contractId" :is-show-menu="false" :project-id="projectId" id-prefix="hc-tree-moves-" is-radio @noderadio="nodeRadio" />
|
|
|
+ <HcTree
|
|
|
+ :contract-id="contractId" :is-show-menu="false" :project-id="projectId"
|
|
|
+ :show-radio-fun="showRadioFun" id-prefix="hc-tree-moves-" is-radio
|
|
|
+ @radio-change="radioChange" @node-loading="panelTreeLoading"
|
|
|
+ />
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</hc-new-dialog>
|
|
|
+
|
|
|
<!-- 编辑 -->
|
|
|
<hc-new-dialog v-model="editModal" :loading="editLoading" is-table title="编辑" widths="60vw" @close="editModalClose" @save="editModalSave">
|
|
|
<HcTable
|
|
@@ -122,6 +125,7 @@ import HcTree from '~src/components/tree/hc-tree.vue'
|
|
|
import { deepClone, getArrValue } from 'js-fast-way'
|
|
|
import MenuItem from './MenuItem.vue' // 导入递归组件
|
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
|
+import { rowsToId } from '~uti/tools'
|
|
|
const useAppState = useAppStore()
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
@@ -222,12 +226,33 @@ const tableCheckedKeys = ref([])
|
|
|
const tableSelection = (rows) => {
|
|
|
tableCheckedKeys.value = rows
|
|
|
}
|
|
|
-//移动
|
|
|
|
|
|
//跨目录移动
|
|
|
+const treePanelLoading = ref(false)
|
|
|
+const panelTreeLoading = () => {
|
|
|
+ treePanelLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
const movesModal = ref(false)
|
|
|
-const movesClick = () => {
|
|
|
+const movesClick = async () => {
|
|
|
movesModal.value = true
|
|
|
+ checkedMoves.value = []
|
|
|
+ movesCheckAll.value = false
|
|
|
+ treePanelLoading.value = true
|
|
|
+ fileDatasListLoading.value = true
|
|
|
+ const { error, code, data } = await scanApi.getScanFile({
|
|
|
+ ...searchForm.value,
|
|
|
+ size: 5000,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ folderId: folderId.value,
|
|
|
+ })
|
|
|
+ fileDatasListLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ fileDatasList.value = getArrValue(data['records'])
|
|
|
+ } else {
|
|
|
+ fileDatasList.value = []
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//选择需要迁移的文件
|
|
@@ -235,44 +260,68 @@ const movesCheckAll = ref(false)
|
|
|
const isIndeterminate = ref(true)
|
|
|
const checkedMoves = ref([])
|
|
|
|
|
|
+//左侧待迁移文件
|
|
|
+const fileDatasList = ref([])
|
|
|
+const fileDatasListLoading = ref(false)
|
|
|
//全选
|
|
|
const handleCheckAllChange = (val) => {
|
|
|
- const checked = tableCheckedKeys.value
|
|
|
- const keys = rowsToIdNumArr(checked)
|
|
|
- checkedMoves.value = val ? keys : []
|
|
|
+ console.log(val, 'val')
|
|
|
+ const checked = fileDatasList.value
|
|
|
+ checkedMoves.value = val ? checked : []
|
|
|
isIndeterminate.value = false
|
|
|
}
|
|
|
|
|
|
//勾选
|
|
|
const handleCheckedMovesChange = (value) => {
|
|
|
-
|
|
|
- const keys = tableCheckedKeys.value
|
|
|
+ const keys = fileDatasList.value
|
|
|
const checkedCount = value.length
|
|
|
movesCheckAll.value = checkedCount === keys.length
|
|
|
isIndeterminate.value = checkedCount > 0 && checkedCount < keys.length
|
|
|
}
|
|
|
|
|
|
+//右侧radio
|
|
|
+let radioNodeId = ''
|
|
|
+const radioChange = (id) => {
|
|
|
+ //console.log(id)
|
|
|
+ radioNodeId = id
|
|
|
+}
|
|
|
+
|
|
|
+//只显示储存节点的单选
|
|
|
+const showRadioFun = (data) => {
|
|
|
+ if (data.isStorageNode == 1) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//保存
|
|
|
const movesModalLoading = ref(false)
|
|
|
-const chnodeId = ref('')
|
|
|
const movesModalSave = async () => {
|
|
|
+ const keys = rowsToId(checkedMoves.value)
|
|
|
+ let ids = keys
|
|
|
+ if (checkedMoves.value.length < 1) {
|
|
|
+ window.$message?.warning('请勾选需要迁移的文件')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (radioNodeId == '') {
|
|
|
+ window.$message?.warning('请选择要移动到的节点')
|
|
|
+ return
|
|
|
+ }
|
|
|
movesModalLoading.value = true
|
|
|
- console.log(checkedMoves.value, 'checkedMoves.value')
|
|
|
- let ids = checkedMoves.value.join(',')
|
|
|
-
|
|
|
- const { error, code, data, msg } = await tuningApi.moveArchive({
|
|
|
+ const { error, code, data } = await scanApi.moveScanFile({
|
|
|
ids: ids,
|
|
|
- nodeId: chnodeId.value,
|
|
|
+ nodeId: radioNodeId,
|
|
|
})
|
|
|
movesModalLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
- console.log(msg, 'msg')
|
|
|
- window.$message?.success(msg)
|
|
|
+ window.$message?.success('保存成功')
|
|
|
+ movesModal.value = false
|
|
|
getTableData()
|
|
|
} else {
|
|
|
- window.$message?.warning(msg)
|
|
|
+ window.$message?.error('保存失败')
|
|
|
}
|
|
|
- movesModal.value = false
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//关闭
|
|
@@ -280,6 +329,7 @@ const movesModalClose = () => {
|
|
|
movesModal.value = false
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//开始扫描
|
|
|
const scanLoading = ref(false)
|
|
|
const scanClick = async () => {
|
|
@@ -390,7 +440,7 @@ const delClick = async (_, resolve) => {
|
|
|
}
|
|
|
.panel-body {
|
|
|
position: relative;
|
|
|
- padding: 16px;
|
|
|
+ padding: 15px;
|
|
|
height: calc(100% - 48px);
|
|
|
|
|
|
.hc-file-checkbox {
|
|
@@ -408,4 +458,21 @@ const delClick = async (_, resolve) => {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
-
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* 解决文件名过长问题的样式 */
|
|
|
+.file-item {
|
|
|
+ margin-bottom: 10px; /* 增加项目之间的间距 */
|
|
|
+ margin-top: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.file-name {
|
|
|
+ white-space: normal; /* 允许换行 */
|
|
|
+ word-wrap: break-word; /* 长单词换行 */
|
|
|
+ word-break: break-all; /* 强制换行 */
|
|
|
+ display: inline-block;
|
|
|
+
|
|
|
+ vertical-align: middle;
|
|
|
+ line-height: 1.5; /* 调整行高,使多行文本更易读 */
|
|
|
+}
|
|
|
+</style>
|