|
@@ -25,6 +25,7 @@
|
|
<el-button link type="success" @click.prevent="toMove(scope.row)" v-if="scope.row.type == 'table'">移动到</el-button>
|
|
<el-button link type="success" @click.prevent="toMove(scope.row)" v-if="scope.row.type == 'table'">移动到</el-button>
|
|
<el-button link type="warning" @click.prevent="toExport(scope.row)" v-if="scope.row.type == 'table'">导出</el-button>
|
|
<el-button link type="warning" @click.prevent="toExport(scope.row)" v-if="scope.row.type == 'table'">导出</el-button>
|
|
<el-button link type="warning" @click.prevent="toExportTs(scope.row)" v-if="scope.row.type == 'table'">导出ts</el-button>
|
|
<el-button link type="warning" @click.prevent="toExportTs(scope.row)" v-if="scope.row.type == 'table'">导出ts</el-button>
|
|
|
|
+ <el-button link type="success" @click.prevent="toCopy(scope.row)" v-if="scope.row.type == 'table'">复制到</el-button>
|
|
<el-button link type="danger" @click.prevent="toDel(scope.row)" v-if="scope.row.type == 'table'">删除</el-button>
|
|
<el-button link type="danger" @click.prevent="toDel(scope.row)" v-if="scope.row.type == 'table'">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -41,6 +42,23 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog v-model="copyDialog" title="文件夹" :before-close="handleClose">
|
|
|
|
+ <el-form ref="copyFormRef" label-width="120px" :size="formSize" status-icon>
|
|
|
|
+ <el-form-item label="项目" prop="project">
|
|
|
|
+ <el-select v-model="copyForm.project" @change="searchDir">
|
|
|
|
+ <el-option v-for="i in projectList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="文件夹" prop="dir">
|
|
|
|
+ <el-select v-model="copyForm.dir">
|
|
|
|
+ <el-option v-for="i in dirList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="submitCopy()"> 提交 </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</template>
|
|
</template>
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
// #region 引入
|
|
// #region 引入
|
|
@@ -118,6 +136,8 @@ const handleClose = () => {
|
|
ruleForm.value = { _id: '', dir: '', project: '', super: '', name: '', sort: '', remark: '' };
|
|
ruleForm.value = { _id: '', dir: '', project: '', super: '', name: '', sort: '', remark: '' };
|
|
search();
|
|
search();
|
|
dialog.value = false;
|
|
dialog.value = false;
|
|
|
|
+ copyDialog.value = false;
|
|
|
|
+ copyForm.value = {};
|
|
};
|
|
};
|
|
// #region 传到父组件方法
|
|
// #region 传到父组件方法
|
|
const emit = defineEmits(['toEdit', 'toEditDir', 'toAddDir', 'toAddTab']);
|
|
const emit = defineEmits(['toEdit', 'toEditDir', 'toAddDir', 'toAddTab']);
|
|
@@ -217,6 +237,36 @@ const toExportTs = async (row: { _id: string }) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+const copyDialog = ref(false);
|
|
|
|
+const copyForm: Ref<{ _id?: string; project?: string; dir?: string }> = ref({});
|
|
|
|
+const copyFormRef = ref<FormInstance>();
|
|
|
|
+interface baseType {
|
|
|
|
+ _id: string;
|
|
|
|
+ name: string;
|
|
|
|
+}
|
|
|
|
+const projectList: Ref<Array<baseType>> = ref([]);
|
|
|
|
+const dirList: Ref<Array<baseType>> = ref([]);
|
|
|
|
+const toCopy = async (row: { _id: string }) => {
|
|
|
|
+ // 查询项目
|
|
|
|
+ const projectResult: IQueryResult = await store.projectQuery();
|
|
|
|
+ if (projectResult.errcode == 0) {
|
|
|
|
+ projectList.value = projectResult.data as Array<baseType>;
|
|
|
|
+ }
|
|
|
|
+ copyForm.value._id = row._id;
|
|
|
|
+ copyDialog.value = true;
|
|
|
|
+};
|
|
|
|
+const searchDir = async (id: string) => {
|
|
|
|
+ // 查询项目下的文件夹
|
|
|
|
+ const dirResult: IQueryResult = await store.dirQuery({ project: id });
|
|
|
|
+ if (dirResult.errcode == 0) {
|
|
|
|
+ dirList.value = dirResult.data as Array<baseType>;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const submitCopy = async () => {
|
|
|
|
+ const res: IQueryResult = await store.copy(copyForm.value);
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.errcode == 0) handleClose();
|
|
|
|
+};
|
|
// #endregion
|
|
// #endregion
|
|
</script>
|
|
</script>
|
|
|
|
|