Преглед на файлове

文件共享看板修改-提交

lxh преди 1 година
родител
ревизия
40d4ea8a80

+ 267 - 253
src/views/vent/performance/comment/NormalTable.vue

@@ -13,282 +13,296 @@
 </template>
 
 <script lang="ts" name="system-user" setup>
-  //ts语法
-  import { ref, provide, reactive, toRaw, defineExpose } from 'vue';
-  import { BasicTable, TableAction } from '/@/components/Table';
-  import { useModal } from '/@/components/Modal';
-  import DeviceModal from './DeviceModal.vue';
-  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
-  import { useListPage } from '/@/hooks/system/useListPage';
+//ts语法
+import { ref, provide, reactive, toRaw, defineExpose, } from 'vue';
+import { BasicTable, TableAction } from '/@/components/Table';
+import { useModal } from '/@/components/Modal';
+import DeviceModal from './DeviceModal.vue';
+import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
+import { useListPage } from '/@/hooks/system/useListPage';
 
-  const props = defineProps({
-    //查询参数
-    searchParam: {
-      type: String,
-      default: '',
-    },
-    //菜单树传递参数
-    nodeParam: {
-      type: Object,
-      default: () => {
-        return {};
-      },
-    },
-    columnsType: {
-      type: String,
-      // required: true,
-    },
-    columns: {
-      type: Array,
-      // required: true,
-      default: () => [],
+const props = defineProps({
+  //各矿参数
+  selfParam: {
+    type: Object,
+    default: () => {
+      return {}
+    }
+  },
+  //查询参数
+  searchParam: {
+    type: String,
+    default: '',
+  },
+  //菜单树传递参数
+  nodeParam: {
+    type: Object,
+    default: () => {
+      return {};
     },
+  },
+  columnsType: {
+    type: String,
+    // required: true,
+  },
+  columns: {
+    type: Array,
+    // required: true,
+    default: () => [],
+  },
 
-    list: {
-      type: Function,
-      required: true,
-    },
-    //下载文件接口
-    downLoad: {
-      type: Function,
-      required: true,
-    },
+  list: {
+    type: Function,
+    required: true,
+  },
+  //下载文件接口
+  downLoad: {
+    type: Function,
+    required: true,
+  },
 
-    deleteById: {
-      type: Function,
-      required: true,
-    },
-    pointList: {
-      type: Function,
-      // required: true,
-    },
-    designScope: {
-      type: String,
-    },
-    title: {
-      type: String,
-    },
-  });
-  let fileType = ref(''); //文件类型
-  let editID = ref(0); //文件ID
+  deleteById: {
+    type: Function,
+    required: true,
+  },
+  pointList: {
+    type: Function,
+    // required: true,
+  },
+  designScope: {
+    type: String,
+  },
+  title: {
+    type: String,
+  },
+});
+let fileType = ref(''); //文件类型
+let editID = ref(0); //文件ID
 
-  const isUpdate = ref(false);
-  const record = reactive({});
+const isUpdate = ref(false);
+const record = reactive({});
 
-  provide('formData', record);
-  const [registerModal, { openModal, closeModal }] = useModal();
+provide('formData', record);
+const [registerModal, { openModal, closeModal }] = useModal();
 
-  const columnList = getTableHeaderColumns(props.columnsType);
-  console.log('aaa', columnList);
+const columnList = getTableHeaderColumns(props.columnsType);
+console.log('aaa', columnList);
 
-  // 列表页面公共参数、方法
-  const { tableContext, doRequest } = useListPage({
-    designScope: props.designScope,
-    tableProps: {
-      title: props.title,
-      api: props.list,
-      columns: props.columns.length > 0 ? (props.columns as any[]) : columnList,
-      // size: 'small',
-      bordered: false,
-      // formConfig: {
-      //   // labelWidth: 100,
-      //   labelAlign: 'left',
-      //   labelCol: {
-      //     xs: 24,
-      //     sm: 24,
-      //     md: 24,
-      //     lg: 9,
-      //     xl: 7,
-      //     xxl: 5,
-      //   },
-      //   schemas: props.searchFormSchema as any[],
-      // },
-      striped: true,
-      showIndexColumn: true, //是否显示序列号
-      actionColumn: {
-        width: 280,
-      },
-      useSearchForm: false, //不使用查询条件
-      // pagination: false, //不使用分页组件
-      beforeFetch: (params) => {
-        params.parentId = props.nodeParam.id ? props.nodeParam.id : '';
-        params.selectFlag = props.nodeParam.id ? false : true;
-        params.likeFileName = props.searchParam ? props.searchParam : '';
-        // return Object.assign({ column: '111', order: 'd11' }, params);
-        // return Object.assign({ parentId: '', selectFlag: true, likeFileName: '' }, params);
-      },
+// 列表页面公共参数、方法
+const { tableContext, doRequest } = useListPage({
+  designScope: props.designScope,
+  tableProps: {
+    title: props.title,
+    api: props.list,
+    columns: props.columns.length > 0 ? (props.columns as any[]) : columnList,
+    // size: 'small',
+    bordered: false,
+    // formConfig: {
+    //   // labelWidth: 100,
+    //   labelAlign: 'left',
+    //   labelCol: {
+    //     xs: 24,
+    //     sm: 24,
+    //     md: 24,
+    //     lg: 9,
+    //     xl: 7,
+    //     xxl: 5,
+    //   },
+    //   schemas: props.searchFormSchema as any[],
+    // },
+    striped: true,
+    showIndexColumn: true, //是否显示序列号
+    actionColumn: {
+      width: 280,
     },
-  });
+    useSearchForm: false, //不使用查询条件
+    // pagination: false, //不使用分页组件
+    beforeFetch: (params) => {
+      params.parentId = props.nodeParam.id ? props.nodeParam.id : '';
+      params.selectFlag = props.nodeParam.id ? false : true;
+      params.likeFileName = props.searchParam ? props.searchParam : '';
+      params.bpmStatus = props.selfParam.bpmStatus ? props.selfParam.bpmStatus : ''
+      params.sysOrgCode = props.selfParam.sysOrgCode ? props.selfParam.sysOrgCode : ''
+      // return Object.assign({ column: '111', order: 'd11' }, params);
+      // return Object.assign({ parentId: '', selectFlag: true, likeFileName: '' }, params);
+    },
+  },
+});
 
-  //注册table数据
-  const [registerTable, { reload }, { selectedRowKeys }] = tableContext;
-  /**
-   * 编辑事件
-   */
-  function handleEdit(data) {
-    isUpdate.value = true;
-    Object.assign(record, toRaw(data));
-    console.log(record, '编辑');
-    let index = record.fileSuffix.indexOf('.');
-    fileType.value = record.fileSuffix.substring(index + 1);
-    editID.value = record.id;
-    console.log(fileType, '文件格式');
-    console.log(editID.value, '编辑文件ID');
-    openModal(true, {
-      record,
-    });
-  }
+//注册table数据
+const [registerTable, { reload }, { selectedRowKeys }] = tableContext;
+/**
+ * 编辑事件
+ */
+function handleEdit(data) {
+  isUpdate.value = true;
+  Object.assign(record, toRaw(data));
+  console.log(record, '编辑');
+  let index = record.fileSuffix.indexOf('.');
+  fileType.value = record.fileSuffix.substring(index + 1);
+  editID.value = record.id;
+  console.log(fileType, '文件格式');
+  console.log(editID.value, '编辑文件ID');
+  openModal(true, {
+    record,
+  });
+}
 
-  /**
-   * 删除事件
-   */
-  async function handleDelete(record) {
-    await props.deleteById({ id: record.id }, reload);
-  }
+/**
+ * 删除事件
+ */
+async function handleDelete(record) {
+  await props.deleteById({ id: record.id }, reload);
+}
 
-  //下载文件
-  function handleDownLoad(record) {
-    console.log(record, '下载');
-    props.downLoad({ id: record.id }).then((res) => {
-      console.log('11111');
-      console.log(res, '文件下载成功');
-      let filename = `${record.fileName}`;
-      downFilePublic(res, filename);
-    });
-  }
-  // 下载公用方法
-  function downFilePublic(content, fileName) {
-    const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
-    // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
-    // IE10以上支持blob但是依然不支持download
-    if ('download' in document.createElement('a')) {
-      // 支持a标签download的浏览器
-      const link = document.createElement('a'); // 创建a标签
-      link.download = fileName; // a标签添加属性
-      link.style.display = 'none';
-      link.href = URL.createObjectURL(blob);
-      document.body.appendChild(link);
-      link.click(); // 执行下载
-      URL.revokeObjectURL(link.href); // 释放url
-      document.body.removeChild(link); // 释放标签
-    } else {
-      // 其他浏览器
-      navigator.msSaveBlob(blob, fileName);
-    }
+//下载文件
+function handleDownLoad(record) {
+  console.log(record, '下载');
+  props.downLoad({ id: record.id }).then((res) => {
+    console.log('11111');
+    console.log(res, '文件下载成功');
+    let filename = `${record.fileName}`;
+    downFilePublic(res, filename);
+  });
+}
+// 下载公用方法
+function downFilePublic(content, fileName) {
+  const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
+  // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+  // IE10以上支持blob但是依然不支持download
+  if ('download' in document.createElement('a')) {
+    // 支持a标签download的浏览器
+    const link = document.createElement('a'); // 创建a标签
+    link.download = fileName; // a标签添加属性
+    link.style.display = 'none';
+    link.href = URL.createObjectURL(blob);
+    document.body.appendChild(link);
+    link.click(); // 执行下载
+    URL.revokeObjectURL(link.href); // 释放url
+    document.body.removeChild(link); // 释放标签
+  } else {
+    // 其他浏览器
+    navigator.msSaveBlob(blob, fileName);
   }
+}
 
-  /**
-   * 操作列定义
-   * @param record
-   */
-  function getActions(record) {
-    return [
-      {
-        label: '详情',
-        onClick: handleEdit.bind(null, record),
-      },
-      {
-        label: '编辑',
-        onClick: handleEdit.bind(null, record),
-      },
-      {
-        label: '删除',
-        popConfirm: {
-          title: '是否确认删除',
-          confirm: handleDelete.bind(null, record),
-        },
-      },
-      {
-        label: '下载',
-        onClick: handleDownLoad.bind(null, record),
+/**
+ * 操作列定义
+ * @param record
+ */
+function getActions(record) {
+  return [
+    {
+      label: '详情',
+      onClick: handleEdit.bind(null, record),
+    },
+    {
+      label: '编辑',
+      onClick: handleEdit.bind(null, record),
+    },
+    {
+      label: '删除',
+      popConfirm: {
+        title: '是否确认删除',
+        confirm: handleDelete.bind(null, record),
       },
-      // {
-      //   label: '审批',
-      //   onClick: handleEdit.bind(null, record),
-      // },
-      // {
-      //   label: '查看',
-      //   onClick: handleDetail.bind(null, record),
-      // },
-    ];
-  }
-  /**
-   * 下拉操作栏
-   */
-  function getDropDownAction(record) {
-    return [
-      // {
-      //   label: '删除',
-      //   popConfirm: {
-      //     title: '是否确认删除',
-      //     confirm: handleDelete.bind(null, record),
-      //   },
-      // },
-      // {
-      //   label: '查看',
-      //   onClick: handleDetail.bind(null, record),
-      // },
-    ];
-  }
-  defineExpose({
-    doRequest,
-  });
+    },
+    {
+      label: '下载',
+      onClick: handleDownLoad.bind(null, record),
+    },
+    // {
+    //   label: '审批',
+    //   onClick: handleEdit.bind(null, record),
+    // },
+    // {
+    //   label: '查看',
+    //   onClick: handleDetail.bind(null, record),
+    // },
+  ];
+}
+/**
+ * 下拉操作栏
+ */
+function getDropDownAction(record) {
+  return [
+    // {
+    //   label: '删除',
+    //   popConfirm: {
+    //     title: '是否确认删除',
+    //     confirm: handleDelete.bind(null, record),
+    //   },
+    // },
+    // {
+    //   label: '查看',
+    //   onClick: handleDetail.bind(null, record),
+    // },
+  ];
+}
+
+
+defineExpose({
+  doRequest,
+});
 </script>
 
 <style scoped lang="less">
-  // @ventSpace: zxm;
+// @ventSpace: zxm;
 
-  // @vent-table-no-hover: rgba(43, 135, 255, 0.1);
+// @vent-table-no-hover: rgba(43, 135, 255, 0.1);
 
-  // @vent-table-hover: rgba(53, 147, 255, 0.2);
-  // :deep(.zxm-table-row) {
-  //   td {
-  //     background-color: @vent-table-hover !important;
-  //   }
-  // }
-  // :deep(.jeecg-basic-table-row__striped) {
-  //   td {
-  //     background-color: @vent-table-no-hover !important;
-  //   }
-  // }
+// @vent-table-hover: rgba(53, 147, 255, 0.2);
+// :deep(.zxm-table-row) {
+//   td {
+//     background-color: @vent-table-hover !important;
+//   }
+// }
+// :deep(.jeecg-basic-table-row__striped) {
+//   td {
+//     background-color: @vent-table-no-hover !important;
+//   }
+// }
 
-  // ::v-deep .zxm-table-title {
-  //   display: none;
-  // }
-  // ::v-deep .zxm-table-thead > tr > th {
-  //   border-top: 0px !important;
-  //   border-left: 0px !important;
-  //   border-right: 0px !important;
-  //   border-bottom: 1px solid #268bc1 !important;
-  //   color: #3beff9 !important;
-  // }
-  // ::v-deep .zxm-table-tbody > tr > td {
-  //   border: none;
-  // }
+// ::v-deep .zxm-table-title {
+//   display: none;
+// }
+// ::v-deep .zxm-table-thead > tr > th {
+//   border-top: 0px !important;
+//   border-left: 0px !important;
+//   border-right: 0px !important;
+//   border-bottom: 1px solid #268bc1 !important;
+//   color: #3beff9 !important;
+// }
+// ::v-deep .zxm-table-tbody > tr > td {
+//   border: none;
+// }
 
-  // ::v-deep .zxm-table-thead {
-  //   background: linear-gradient(to bottom, transparent, rgba(53, 147, 255, 0.5)) !important;
-  // }
+// ::v-deep .zxm-table-thead {
+//   background: linear-gradient(to bottom, transparent, rgba(53, 147, 255, 0.5)) !important;
+// }
 
-  @ventSpace: zxm;
+@ventSpace: zxm;
 
-  @vent-table-no-hover: #00bfff10;
-  :deep(.@{ventSpace}-table-cell-row-hover) {
-    background: #264d8833 !important;
-  }
-  :deep(.@{ventSpace}-table-row-selected) {
-    background: #268bc522 !important;
-  }
+@vent-table-no-hover: #00bfff10;
 
-  :deep(.@{ventSpace}-table-tbody > tr > td) {
-    background-color: #0dc3ff05;
-  }
-  :deep(.jeecg-basic-table-row__striped) {
-    td {
-      background-color: @vent-table-no-hover !important;
-    }
-  }
-   ::v-deep .zxm-table-title {
-    display: none;
+:deep(.@{ventSpace}-table-cell-row-hover) {
+  background: #264d8833 !important;
+}
+
+:deep(.@{ventSpace}-table-row-selected) {
+  background: #268bc522 !important;
+}
+
+:deep(.@{ventSpace}-table-tbody > tr > td) {
+  background-color: #0dc3ff05;
+}
+
+:deep(.jeecg-basic-table-row__striped) {
+  td {
+    background-color: @vent-table-no-hover !important;
   }
-</style>
+}
+
+::v-deep .zxm-table-title {
+  display: none;
+}</style>

+ 0 - 99
src/views/vent/performance/fileDetail/commen/list.ts

@@ -1,99 +0,0 @@
-export const list = [
-  {
-    id: 1,
-    isFolder: true,
-    title: '全部',
-    pid: null,
-    fileNameArr: ['全部'],
-    children: [
-      {
-        id: 7,
-        pid: 1,
-        isFolder: false,
-        fileNameArr: ['审批流文件', '文件共享中心'],
-        title: '审批流文件',
-      },
-      {
-        id: 8,
-        pid: 1,
-        isFolder: true,
-        fileNameArr: ['审批流文件', '文件共享中心'],
-        title: '文件共享中心',
-        children: [
-          {
-            id: 9,
-            pid: 8,
-            isFolder: false,
-            fileNameArr: ['台账类文件', '法律法规文件', '基础资料', '检验报告', '其他'],
-            title: '台账类文件',
-          },
-          {
-            id: 10,
-            pid: 8,
-            isFolder: false,
-            fileNameArr: ['台账类文件', '法律法规文件', '基础资料', '检验报告', '其他'],
-            title: '法律法规文件',
-          },
-          {
-            id: 11,
-            pid: 8,
-            isFolder: false,
-            fileNameArr: ['台账类文件', '法律法规文件', '基础资料', '检验报告', '其他'],
-            title: '基础资料',
-          },
-          {
-            id: 12,
-            pid: 8,
-            isFolder: false,
-            fileNameArr: ['台账类文件', '法律法规文件', '基础资料', '检验报告', '其他'],
-            title: '检验报告',
-          },
-          {
-            id: 13,
-            pid: 8,
-            isFolder: false,
-            fileNameArr: ['台账类文件', '法律法规文件', '基础资料', '检验报告', '其他'],
-            title: '其他',
-          },
-        ],
-      },
-    ],
-  },
-  // {
-  //   id: 2,
-  //   isFolder: true,
-  //   title: 'dist',
-  //   pid: null,
-  //   fileNameArr: ['src', 'dist', 'package.json', 'README.md'],
-  //   children: [
-  //     {
-  //       id: 5,
-  //       pid: 2,
-  //       isFolder: false,
-  //       fileNameArr: ['index.html', 'index.js'],
-  //       title: 'index.html',
-  //     },
-  //     {
-  //       id: 6,
-  //       pid: 2,
-  //       isFolder: false,
-  //       fileNameArr: ['index.html', 'index.js'],
-  //       title: 'index.js',
-  //     },
-  //   ],
-  // },
-  // {
-  //   id: 3,
-  //   pid: null,
-  //   title: 'package.json',
-  //   fileNameArr: ['src', 'dist', 'package.json', 'README.md'],
-  //   isFolder: false,
-  // },
-  // {
-  //   id: 4,
-  //   pid: null,
-  //   title: 'README.md',
-  //   fileNameArr: ['src', 'dist', 'package.json', 'README.md'],
-  //   isFolder: false,
-  // },
-];

+ 3 - 51
src/views/vent/performance/fileDetail/fileDetail.api.ts

@@ -9,13 +9,7 @@ enum Api {
   uploadApi = '/ventanaly-sharefile/fileServer/upload',
   downLoad = '/ventanaly-sharefile/fileServer/download',
   deleteById = '/ventanaly-sharefile/fileServer/delete?id=',
-  // save = '/safety/ventanalyMonitorParams/add',
-  // edit = '/safety/ventanalyMonitorParams/edit',
-  // selectDevice = '/jeecg-system/sys/dict/DeviceKind/query',
-  // deleteBatch = '/sys/user/deleteBatch',
-  // importExcel = '/sys/user/importExcel',
-  // exportXls = '/sys/user/exportXls',
-  // queryDevice = '/sys/dict/DeviceKind/query',
+  
 }
 
 /**
@@ -24,21 +18,7 @@ enum Api {
  */
 export const getTree = (params) => defHttp.post({ url: Api.getTree, params });
 
-// /**
-//  * 导出api
-//  * @param params
-//  */
-// export const getExportUrl = Api.exportXls;
-// /**
-//  * 导入api
-//  */
-// export const getImportUrl = Api.importExcel;
 
-// /**
-//  * 列表接口
-//  * @param params
-//  */
-// export const queryDeviceList = (params) => defHttp.get({ url: Api.queryDevice, params });
 
 /**
  * 创建文件夹接口
@@ -68,11 +48,7 @@ export const delMenu = (params) => defHttp.delete({ url: Api.delMenu + params.id
  */
 export const downLoad = (params) => defHttp.post({ url: Api.downLoad, params, responseType: 'blob' });
 
-// /**
-//  * 设备类型查询接口
-//  * @param params
-//  */
-// export const selectDevice = (params) => defHttp.get({ url: Api.selectDevice, params });
+
 
 /**
  * 删除文件/文件夹
@@ -82,28 +58,4 @@ export const deleteById = (params, handleSuccess) => {
     handleSuccess();
   });
 };
-// /**
-//  * 批量删除用户
-//  * @param params
-//  */
-// export const batchDeleteById = (params, handleSuccess) => {
-//   Modal.confirm({
-//     title: '确认删除',
-//     content: '是否删除选中数据',
-//     okText: '确认',
-//     cancelText: '取消',
-//     onOk: () => {
-//       return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
-//         handleSuccess();
-//       });
-//     },
-//   });
-// };
-// /**
-//  * 保存或者更新用户
-//  * @param params
-//  */
-// export const saveOrUpdate = (params, isUpdate) => {
-//   const url = isUpdate ? Api.edit : Api.save;
-//   return isUpdate ? defHttp.put({ url: url, params }) : defHttp.post({ url: url, params });
-// };
+

+ 0 - 56
src/views/vent/performance/fileDetail/fileDetail.data.ts

@@ -1,5 +1,4 @@
 import { BasicColumn } from '/@/components/Table';
-import { FormSchema } from '/@/components/Table';
 
 export const columns: BasicColumn[] = [
   {
@@ -49,59 +48,4 @@ export const columns: BasicColumn[] = [
   },
 ];
 
-export const formSchema: FormSchema[] = [
-  {
-    label: '',
-    field: 'id',
-    component: 'Input',
-    show: false,
-  },
-
-  // {
-  //   label: '点表类型',
-  //   field: 'devicetype',
-  //   component: 'ApiSelect',
-  //   componentProps: ({ formModel, formActionType }) => {
-  //     // debugger;
-  //     return {
-  //       // options: provincesOptions,
-  //       componentProps: {},
-  //       api: (params) => defHttp.get({ url: `/sys/dict/getDictItems/${formModel.devicekind + 'kind'}` }, params),
-  //       resultField: 'result',
-  //       labelField: 'title',
-  //       valueField: 'value',
-  //     };
-  //   },
-  // },
-  {
-    label: '文件名称',
-    field: 'fileName',
-    component: 'Input',
-  },
 
-  {
-    label: '文件类型',
-    field: 'type',
-    component: 'JDictSelectTag',
-    componentProps: {
-      dictCode: 'valuetype',
-      placeholder: '请选择文件类型',
-      stringToNumber: true,
-    },
-  },
-  {
-    label: '文件格式',
-    field: 'fileSuffix',
-    component: 'JDictSelectTag',
-    componentProps: {
-      dictCode: 'valuetype',
-      placeholder: '请选择文件来源',
-      stringToNumber: true,
-    },
-  },
-  {
-    label: '文件路径',
-    field: 'fileServerPath',
-    component: 'Input',
-  },
-];

+ 15 - 3
src/views/vent/performance/fileDetail/index.vue

@@ -30,7 +30,7 @@
         </div>
         <div class="list">
           <!-- <div class="bd-t"></div> -->
-          <NormalTable v-if="alive" :searchParam="fileName" :nodeParam="nodeParam" :columns="columns" :list="getTree"
+          <NormalTable v-if="alive" :selfParam="selfParam" :searchParam="fileName" :nodeParam="nodeParam" :columns="columns" :list="getTree"
             :deleteById="deleteById" :downLoad="downLoad" designScope="file-detail" title="文件详情" />
           <!-- <div class="bd-b"></div> -->
         </div>
@@ -59,17 +59,24 @@
   </div>
 </template>
 <script lang="ts" setup name="system-user">
+import { useRouter } from 'vue-router';
 import { useMessage } from '/@/hooks/web/useMessage';
 import fileSystem from './commen/fileSystem.vue';
 import icon from './commen/Icon/index.vue';
 import { SvgIcon } from '/@/components/Icon';
 import treeIcon from './commen/Icon/treeIcon.vue';
-import { ref, onMounted, reactive, nextTick } from 'vue';
+import { ref, onMounted, reactive, nextTick,watch } from 'vue';
 import NormalTable from '../comment/NormalTable.vue';
 import { columns } from './fileDetail.data';
 import { getTree, createFile, editMenu, delMenu, uploadApi, downLoad, deleteById } from './fileDetail.api';
 import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
 
+let selfParam=reactive({//各矿参数
+  sysOrgCode:'',
+  bpmStatus:null,
+  flag:false
+})
+let router = useRouter(); //路由
 const { createMessage } = useMessage();
 let fileName = ref('');
 let fileList = reactive<any[]>([]); //上传文件列表
@@ -236,7 +243,12 @@ let handleRemove = (file) => {
   newFileList.splice(index, 1);
   fileList = newFileList;
 };
-
+watch(()=>router.currentRoute.value,(val)=>{
+  console.log('各矿传参',val)
+  selfParam.bpmStatus=val.query.bpmStatus
+  selfParam.sysOrgCode=val.query.sysOrgCode
+  selfParam.flag=val.query.flag
+},{immediate:true})
 onMounted(() => {
   getTreeList();
 });

+ 32 - 11
src/views/vent/performance/fileIndex/index.vue

@@ -5,10 +5,10 @@
         :key="index" @click="getDetails(index)">
         <div class="card-t">{{ item.sysOrgName }}</div>
         <div class="card-b">
-          <div class="box" v-for="(items, ind) in item.tab" :key="ind" >
-            <div class="img" > <img :src="items.src" alt="" /> </div>
+          <div class="box" v-for="(items, ind) in item.tab" :key="ind" @click="getToggle(ind,item)">
+            <div class="img"> <img :src="items.src" alt="" /> </div>
             <div class="text">{{ items.text }}</div>
-            <div class="num" >{{ items.num }}</div>
+            <div class="num">{{ items.num }}</div>
           </div>
         </div>
       </div>
@@ -23,8 +23,12 @@ import rightImg from '../../../../assets/images/files/homes/sp.svg';
 import { list } from './fileIndex.api';
 let router = useRouter(); //路由
 let active = ref(); //当前选中项
-// let toggleItem = ref(); //当前选中子项
 let titleList = reactive<any[]>([]);
+let homeParam = reactive({
+  sysOrgCode: '',
+  bpmStatus: null,
+  flag:''
+})
 //获取首页数据
 let getPageList = async () => {
   let data = await list();
@@ -33,6 +37,8 @@ let getPageList = async () => {
     let datas = data.map((el) => {
       return {
         sysOrgName: el.sysOrgName,
+        sysOrgCode: el.sysOrgCode,
+        flag:el.flag,
         tab: [
           { src: leftImg, text: '文档总数', num: el.tolalNum },
           { src: rightImg, text: '待审批数', num: el.approveNum },
@@ -46,15 +52,26 @@ let getPageList = async () => {
 
 //切换选项
 let getDetails = (index) => {
-  console.log('详情跳转');
   active.value = index;
-  router.push('/fileManager/fileDetail');
 };
 // //切换左右选项
-// let getToggle = (ind) => {
-//   console.log(ind);
-//   toggleItem.value = ind;
-// };
+let getToggle = (ind,item) => {
+  console.log(ind,'审批状态索引');
+  console.log(item,'item')
+  homeParam.sysOrgCode = item.sysOrgCode
+  homeParam.flag=item.flag
+  if(ind){
+    homeParam.bpmStatus=2
+  }else {
+    homeParam.bpmStatus=homeParam.flag ?  '' : 'All'
+  }
+ 
+  console.log(homeParam,'home0000000000')
+   router.push({
+    path:'/fileManager/fileDetail',
+    query:{sysOrgCode:homeParam.sysOrgCode,bpmStatus:homeParam.bpmStatus,flag:homeParam.flag}
+  });
+};
 onMounted(() => {
   getPageList();
 });
@@ -121,6 +138,7 @@ onMounted(() => {
             width: 72px;
             height: 78px;
             background: url(../../../../assets/images/files/homes/file1.png) no-repeat center;
+
             img {
               position: absolute;
               left: 50%;
@@ -128,11 +146,13 @@ onMounted(() => {
               transform: translate(-50%, -75%);
             }
           }
+
           &:last-child .img {
             position: relative;
             width: 72px;
             height: 78px;
             background: url(../../../../assets/images/files/homes/sp.png) no-repeat center;
+
             img {
               position: absolute;
               left: 50%;
@@ -141,7 +161,7 @@ onMounted(() => {
             }
           }
 
-      
+
           .text {
             margin: 5px 0px;
             font-family: '思源黑体', 'Microsoft Yahei';
@@ -160,6 +180,7 @@ onMounted(() => {
             align-items: center;
             background: url(../../../../assets/images/files/homes/file2.png) no-repeat center;
           }
+
           &:last-child .num {
             width: 120px;
             height: 30px;