cz 2 年之前
父節點
當前提交
5334c8642d

+ 199 - 0
src/components/webDiskData/treeList.vue

@@ -0,0 +1,199 @@
+<template>
+  <div class="treeList">
+    <div class="title commons-title">
+      {{ title }}
+    </div>
+    <div class="search">
+      <el-input v-model="search" placeholder="请输入搜索内容" clearable @clear="search = ''" @keyup.enter="searchChange"></el-input>
+      <el-button type="primary" plain @click="add({ id: '-1' })">
+        <el-icon :size="20">
+          <Plus />
+        </el-icon>
+      </el-button>
+    </div>
+    <el-tree
+      :data="data"
+      :props="{ children: 'netdiskList' }"
+      ref="tree"
+      node-key="id"
+      @node-click="treeChange"
+      default-expand-all
+      :expand-on-click-node="false"
+      :filter-node-method="filterNode">
+      <template #default="{ node, data }">
+        <div class="custom-tree-node">
+          <div style="flex: 1">{{ data.name }}</div>
+          <div style="float: right">
+            <el-icon :size="17" @click.stop="() => edit(node, data)">
+              <Edit />
+            </el-icon>
+            <el-icon :size="17" style="margin-left: 10px" @click.stop="() => add(data)">
+              <Plus />
+            </el-icon>
+            <el-icon :size="17" style="margin-left: 10px" @click.stop="() => del(data)">
+              <Delete />
+            </el-icon>
+          </div>
+        </div>
+      </template>
+    </el-tree>
+  </div>
+  <el-dialog :title="treeModalType == 'add' ? '添加目录' : '编辑目录'" v-model="treeModal" width="400" v-loading="loading">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
+    <template #footer>
+      <el-button @click="treeModal = false" size="large">取 消</el-button>
+      <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
+    </template>
+  </el-dialog>
+</template>
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byForm from "@/components/byForm/index";
+
+const props = defineProps({
+  title: {
+    type: String,
+    default: "目录",
+  },
+  submitType: {
+    type: String,
+    default: "1",
+  },
+  data: {
+    type: Array,
+    default: [],
+  },
+});
+onMounted(() => {});
+const search = ref("");
+const emit = defineEmits(["update:modelValue"]);
+const { proxy } = getCurrentInstance();
+const treeChange = (e) => {
+  if (proxy.type == "radio") {
+    emit("update:modelValue", e.id);
+    emit("change", e);
+  } else {
+    emit("change", e);
+  }
+};
+const filterNode = (value, data) => {
+  if (!value) return true;
+  return data.label.indexOf(value) !== -1;
+};
+const searchChange = () => {
+  proxy.$refs.tree.filter(search.value);
+};
+const submit = ref(null);
+let treeModal = ref(false);
+let submitLoading = ref(false);
+let treeModalType = ref("add");
+let formData = reactive({
+  data: {
+    type: 1,
+    parentFolderId: "-1",
+    name: "",
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+let rules = ref({
+  name: [{ required: true, message: "请输入目录名称", trigger: "blur" }],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "name",
+      label: "目录名称",
+      required: true,
+    },
+  ];
+});
+const add = (data) => {
+  treeModalType.value = "add";
+  formData.data = {
+    type: 1,
+    parentFolderId: data.id,
+    name: "",
+  };
+  submitLoading.value = false;
+  treeModal.value = true;
+};
+const edit = (node, data) => {
+  treeModalType.value = "edit";
+  formData.data = {
+    type: 1,
+    parentFolderId: data.parentFolderId,
+    name: data.name,
+    id: data.id,
+  };
+  submitLoading.value = false;
+  treeModal.value = true;
+};
+const del = (data) => {
+  ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    proxy.post("/netdisk/delete", [data.id]).then(() => {
+      ElMessage({
+        message: "删除成功",
+        type: "success",
+      });
+      getTreeList();
+    });
+  });
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    submitLoading.value = true;
+    proxy.post("/netdisk/" + treeModalType.value, formData.data).then(
+      () => {
+        ElMessage({
+          message: treeModalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        getTreeList();
+        treeModal.value = false;
+      },
+      (err) => {
+        console.log(err);
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+const getTreeList = () => {
+  emit("changeTreeList");
+};
+</script>
+
+<style lang="scss">
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+.treeList {
+  display: block;
+  height: 100%;
+  background: #fff;
+  padding: 20px;
+  .search {
+    margin-bottom: 20px;
+    .el-input {
+      width: calc(100% - 70px);
+      margin-right: 10px;
+      text-align: center;
+    }
+  }
+}
+</style>

+ 2 - 4
src/main.js

@@ -44,10 +44,7 @@ import {
   selectDictLabels
 } from '@/utils/ruoyi'
 
-import {
-  dictDataEcho
-}
-from '@/utils/util'
+import { dictDataEcho, moneyFormat } from '@/utils/util'
 
 // 分页组件
 import Pagination from '@/components/Pagination'
@@ -79,6 +76,7 @@ app.config.globalProperties.selectDictLabel = selectDictLabel
 app.config.globalProperties.selectDictLabels = selectDictLabels
 //字典回显
 app.config.globalProperties.dictDataEcho = dictDataEcho
+app.config.globalProperties.moneyFormat = moneyFormat
 
 
 

+ 33 - 6
src/utils/util.js

@@ -1,12 +1,39 @@
 //根据value值回显字典label值
 export function dictDataEcho(value, arr) {
   if (value && arr) {
-    value = value + ''
-    const current = arr.find(x => x.dictKey === value)
+    value = value + "";
+    const current = arr.find((x) => x.dictKey === value);
     if (current != undefined && current.dictValue) {
-      return current.dictValue
+      return current.dictValue;
     }
-    return ''
+    return "";
   }
-  return ''
-}
+  return "";
+}
+
+// 金额千分符
+export function moneyFormat(s, n) {
+  if (s) {
+    s = s + "";
+    let str = s.slice(0, 1);
+    if (str === "-") {
+      s = s.slice(1, s.length);
+    }
+    n = n > 0 && n <= 20 ? n : 2;
+    s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
+    var l = s.split(".")[0].split("").reverse(),
+      r = s.split(".")[1];
+    var t = "";
+    for (let i = 0; i < l.length; i++) {
+      t += l[i] + ((i + 1) % 3 == 0 && i + 1 != l.length ? "," : "");
+    }
+    let result = t.split("").reverse().join("") + "." + r;
+    if (str === "-") {
+      return "-" + result;
+    } else {
+      return result;
+    }
+  } else {
+    return "0.00";
+  }
+}

+ 2 - 3
src/views/finance/fundManage/account/index.vue

@@ -169,12 +169,11 @@ const getDict = () => {
     .then((res) => {
       if (res.rows && res.rows.length > 0) {
         accountCurrency.value = res.rows;
-      } else {
-        accountCurrency.value = [];
       }
     });
 };
-const getList = async () => {
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy.post("/accountManagement/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;

+ 390 - 0
src/views/finance/fundManage/flow/index.vue

@@ -0,0 +1,390 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :selectConfig="selectConfig"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '添加流水',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList">
+        <template #amount="{ item }">
+          <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
+            <span style="padding-right: 4px">{{ item.currency }}</span>
+            <span v-if="item.status === '20'">-</span>
+            <span>{{ moneyFormat(item.amount) }}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '添加账户' : '编辑账户'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #transactionTime>
+          <div>
+            <el-form-item prop="transactionTime">
+              <el-date-picker v-model="formData.data.transactionTime" type="datetime" placeholder="请选择交易时间" value-format="YYYY-MM-DD HH:mm:ss" />
+            </el-form-item>
+          </div>
+        </template>
+        <template #amount>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="6">
+                <el-form-item prop="status">
+                  <el-select v-model="formData.data.status" placeholder="请选择收支类型" style="width: 100%">
+                    <el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item prop="currency">
+                  <el-select v-model="formData.data.currency" placeholder="请选择币种" style="width: 100%">
+                    <el-option v-for="item in accountCurrency" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item prop="amount">
+                  <el-input-number v-model="formData.data.amount" placeholder="请输入金额" style="width: 100%" :precision="2" :controls="false" :min="0" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const accountCurrency = ref([]);
+const accountList = ref([]);
+const status = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    accountManagementId: "",
+    currency: "",
+    status: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "收支类型",
+      prop: "status",
+      data: status.value,
+    },
+    {
+      label: "资金账户",
+      prop: "accountManagementId",
+      data: accountList.value,
+    },
+    {
+      label: "币种",
+      prop: "currency",
+      data: accountCurrency.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "资金账户",
+        prop: "accountManagementName",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "交易时间",
+        prop: "transactionTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "交易金额",
+        slot: "amount",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "对方账户",
+        prop: "name",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "对方银行",
+        prop: "openingBank",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "对方账号",
+        prop: "accountOpening",
+        width: 240,
+      },
+    },
+    {
+      attrs: {
+        label: "摘要",
+        prop: "remarks",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy
+                  .post("/accountRunningWater/delete", {
+                    id: row.id,
+                  })
+                  .then(() => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "account_currency",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountCurrency.value = res.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+      }
+    });
+  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      accountList.value = res.rows.map((item) => {
+        return {
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    }
+  });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/accountRunningWater/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      label: "账户信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "选择账户",
+      data: accountList.value,
+    },
+    {
+      label: "交易信息",
+    },
+    {
+      type: "slot",
+      prop: "transactionTime",
+      slotName: "transactionTime",
+      label: "交易时间",
+    },
+    {
+      type: "slot",
+      prop: "amount",
+      slotName: "amount",
+      label: "交易金额",
+    },
+    {
+      label: "对方信息",
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "账户名称",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户银行",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "银行账号",
+      itemType: "text",
+    },
+    {
+      label: "其他信息",
+    },
+    {
+      type: "input",
+      prop: "remarks",
+      label: "摘要",
+      itemType: "textarea",
+    },
+  ];
+});
+const rules = ref({
+  accountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
+  transactionTime: [{ required: true, message: "请选择交易时间", trigger: "change" }],
+  status: [{ required: true, message: "请选择收支类型", trigger: "change" }],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+  amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  name: [{ required: true, message: "请输入账户名称", trigger: "blur" }],
+  openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
+  accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {},
+});
+const openModal = (val) => {
+  modalType.value = val;
+  formData.data = {};
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/accountRunningWater/" + modalType.value, formData.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+const update = (row) => {
+  modalType.value = "edit";
+  loadingDialog.value = true;
+  proxy.post("/accountRunningWater/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    loadingDialog.value = false;
+  });
+  dialogVisible.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 317 - 0
src/views/oa/companyDisk/webDiskData/index.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="user">
+    <div class="tree">
+      <treeList
+        title="网盘目录"
+        submitType="1"
+        :data="treeListData"
+        v-model="sourceList.pagination.productClassifyId"
+        @change="treeChange"
+        @changeTreeList="getTreeList">
+      </treeList>
+    </div>
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '上传文件',
+            action: () => openModal(),
+            disabled: false,
+          },
+        ]"
+        @get-list="getList">
+        <template #name="{ item }">
+          <div>
+            <a style="color: #409eff; cursor: pointer" @click="clickName(item)">{{ item.name }}</a>
+          </div>
+        </template>
+        <template #fileSize="{ item }">
+          <div>
+            <div v-if="item.type === 2">
+              {{ getSize(item) }}
+            </div>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog title="上传文件" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #productFile>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :on-preview="onPreviewFile">
+              <el-button>上传文件</el-button>
+            </el-upload>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import treeList from "@/components/webDiskData/treeList";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, ref } from "vue";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const treeListData = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    parentFolderId: "",
+    keyword: "",
+  },
+});
+const treeChange = (e) => {
+  sourceList.value.pagination.parentFolderId = e.id;
+  sourceList.value.pagination.pageNum = 1;
+  getList();
+};
+const getTreeList = () => {
+  proxy.get("/netdisk/tree", {}).then((res) => {
+    treeListData.value = res.data;
+  });
+};
+const loading = ref(false);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/netdisk/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    loading.value = false;
+  });
+};
+getTreeList();
+getList();
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "文件名称",
+        slot: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "类型",
+        prop: "type",
+        width: 120,
+      },
+      render(type) {
+        return type == 1 ? "文件夹" : type == 2 ? "文件" : "";
+      },
+    },
+    {
+      attrs: {
+        label: "大小",
+        slot: "fileSize",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "创建人",
+        prop: "createUserName",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "删除",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy.post("/netdisk/delete", [row.id]).then(() => {
+                  ElMessage({
+                    message: "删除成功",
+                    type: "success",
+                  });
+                  if (row.type === 1) {
+                    getTreeList();
+                  }
+                  getList();
+                });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const fileList = ref([]);
+const uploadData = ref({});
+const formData = reactive({
+  data: {
+    type: 2,
+  },
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "treeSelect",
+      prop: "parentFolderId",
+      label: "网盘目录",
+      data: treeListData.value,
+      propsTreeLabel: "name",
+      propsTreeChildren: "netdiskList",
+    },
+    {
+      type: "slot",
+      slotName: "productFile",
+      prop: "fileList",
+      label: "文件",
+    },
+  ];
+});
+let rules = ref({
+  parentFolderId: [{ required: true, message: "请选择网盘目录", trigger: "blur" }],
+});
+const openModal = () => {
+  formData.data = {
+    type: 2,
+  };
+  fileList.value = [];
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  return true;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    if (fileList.value && fileList.value.length > 0) {
+      formData.data.fileList = fileList.value.map((item) => {
+        return {
+          id: item.raw.id,
+          fileName: item.raw.fileName,
+          fileSize: item.raw.size,
+        };
+      });
+      loadingDialog.value = true;
+      proxy.post("/netdisk/add", formData.data).then(
+        () => {
+          ElMessage({
+            message: "上传成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          getList();
+        },
+        (err) => {
+          console.log(err);
+          loadingDialog.value = false;
+        }
+      );
+    } else {
+      return ElMessage("请上传文件");
+    }
+  });
+};
+const clickName = (item) => {
+  if (item.type === 2) {
+    proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((res) => {
+      window.open(res[item.id][0].fileUrl, "_blank");
+    });
+  } else {
+    sourceList.value.pagination.pageNum = 1;
+    sourceList.value.pagination.parentFolderId = item.id;
+    getList();
+  }
+};
+const getSize = (item) => {
+  let size = "";
+  if (1024 > item.fileSize) {
+    size = item.fileSize + "B";
+  } else if (1024 * 1024 > item.fileSize) {
+    size = parseFloat(Number(item.fileSize) / 1024).toFixed(2) + "KB";
+  } else if (1024 * 1024 * 1024 > item.fileSize) {
+    size = parseFloat(Number(item.fileSize) / 1024 / 1024).toFixed(2) + "MB";
+  } else if (1024 * 1024 * 1024 * 1024 > item.fileSize) {
+    size = parseFloat(Number(item.fileSize) / 1024 / 1024 / 1024).toFixed(2) + "GB";
+  }
+  return size;
+};
+</script>
+
+<style lang="scss" scoped>
+.user {
+  padding: 20px;
+  display: flex;
+  justify-content: space-between;
+  .tree {
+    width: 300px;
+  }
+  .content {
+    width: calc(100% - 320px);
+  }
+}
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+</style>