pyt
2025-04-01 ac33a3fb2bfc4d4b11b958afe4d4b462d96fbb26
Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory
1 文件已重命名
1个文件已删除
6个文件已修改
3个文件已添加
354 ■■■■ 已修改文件
src/components/Card/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/components/ElMenu/MenuItem.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/components/ElMenu/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/approvalPlan/list.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataManagement/approvalPlan/list.vue 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataManagement/dispatching/list.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectList/addProject.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectList/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Card/index.vue
New file
@@ -0,0 +1,23 @@
<template>
    <div class="card">
        <slot></slot>
    </div>
</template>
<script>
export default {
}
</script>
<style lang="less" scoped>
.card {
    height: calc(100% - 110px);
    overflow-y: auto;
    padding: 30px 30px 59px 30px;
    box-shadow: 0px 10px 19px 0px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    border: 4px solid #FFFFFF;
    background: rgba(255, 255, 255, 0.8);
}
</style>
src/layouts/components/ElMenu/MenuItem.vue
@@ -1,20 +1,20 @@
<template>
  <!-- 判断当前页面是否显示,如果hide为true,则不渲染该菜单 -->
  <!-- <div v-if="!item.meta.hide && menus.includes(item.meta.privilege)"> -->
  <div v-if="!item.meta.hide">
  <div v-if="!(item.meta && item.meta.hide)">
    <!-- 根菜单 -->
    <MenuLink :to="resolvePath()" v-if="!item.children">
      <el-menu-item :index="resolvePath()">
        <i :class="item.meta.icon || ''"></i>
        <span slot="title">{{ item.meta.title }}</span>
        <i :class="(item.meta && item.meta.icon) || ''"></i>
        <span slot="title">{{ (item.meta && item.meta.title) || '' }}</span>
      </el-menu-item>
    </MenuLink>
    <!-- 可展开菜单 -->
    <el-submenu :index="resolvePath()" v-else>
      <template slot="title">
        <i :class="item.meta.icon"></i>
        <span slot="title">{{ item.meta.title }}</span>
        <i :class="(item.meta && item.meta.icon) || ''"></i>
        <span slot="title">{{ (item.meta && item.meta.title) || '' }}</span>
      </template>
      <!-- 这里递归去展示多级菜单 -->
      <menu-item v-for="(route, index) in item.children" :key="index" :item="route"
src/layouts/components/ElMenu/index.vue
@@ -28,9 +28,9 @@
    };
  },
  mounted() {
    // 获取所有定义的一级菜单和多级菜单
    this.routersList = routers.options.routes[0].children;
    // 过滤掉登录路由,只获取主布局下的路由
    this.routersList = routers.options.routes.find(route => route.path === '/').children;
  },
};
</script>
src/main.js
@@ -5,11 +5,13 @@
import router from "./router";
import store from './store'
import TableCustom from '@/components/TableSlot/index.vue'
import Card from '@/components/Card/index.vue'
import ShowDelConfirm from '@/components/showDelConfirm/index.vue'
Vue.config.productionTip = false;
Vue.use(ElementUI, { size: 'small' })
Vue.component('TableCustom', TableCustom)
Vue.component('Card', Card)
Vue.component('ShowDelConfirm', ShowDelConfirm)
Vue.prototype.msgsuccess = function (msg) {
src/router/index.js
@@ -25,11 +25,6 @@
const routes = [
    {
        path: "/",
        redirect: "login",
        component: Layouts,
        children: [
            {
                path: "/login",
                meta: {
                    title: "登录",
@@ -37,6 +32,14 @@
                    hide: true,
                },
                component: () => import("../views/login"),
    },
    {
        path: "/",
        component: Layouts,
        children: [
            {
                path: "",
                redirect: "/projectList/list"
            },
            {
                path: "/projectList",
@@ -50,9 +53,18 @@
                        name: "ProjectList",
                        meta: {
                            title: "项目组管理",
                            keepAlive: true,
                        },
                        component: () => import("../views/projectList"),
                    },
                    {
                        path: "addProject",
                        name: "AddProject",
                        meta: {
                            title: "新增项目组",
                            hide: true,
                            keepAlive: true,
                        },
                        component: () => import("../views/projectList/addProject"),
                    }
                ]
            },
@@ -69,7 +81,7 @@
                            title: "项目课题方案审批",
                            keepAlive: true,
                        },
                        component: () => import("../views/approvalPlan/list.vue"),
                        component: () => import("../views/dataManagement/approvalPlan/list.vue"),
                    },
                    {
                        path: "/dispatching",
@@ -77,11 +89,10 @@
                            title: "实验调度管理",
                            keepAlive: true,
                        },
                        component: () => import("../views/dispatching/list.vue"),
                        component: () => import("../views/dataManagement/dispatching/list.vue"),
                    },
                ],
            }
        ],
    },
];
@@ -97,21 +108,7 @@
    // 设置当前页签名称
    document.title = to.meta.title || '实验室流程';
    // 判断是否需要缓存
    if (to.meta.keepAlive) {
        store.commit('SET_KEEPALIVELIST', [...store.state.keepAliveList, to.name])
    }
    // 设置标签列表
    if (!to.meta.hide || !to.meta.oneself) {
        // 判断是否存在
        let isExist = store.state.tagList.some(item => item.path === to.path)
        if (!isExist) {
            store.commit('SET_TAGLIST', [...store.state.tagList, to])
        }
    }
    next()
    // 没有登录并且要去的页面不是登录页面,在强制跳转到登录
    // 登录验证
    // if (to.path === "/login") {
    //     localStorage.removeItem('userInfo')
    //     next()
@@ -123,19 +120,38 @@
    //     if (to.meta.hasOwnProperty('privilege') && !menus.includes(to.meta.privilege)) {
    //         return
    //     }
    // 设置标签列表
    // if (!to.meta.hide || !to.meta.oneself) {
    //     // 判断是否存在
    //     let isExist = store.state.tagList.some(item => item.path === to.path)
    //     if (!isExist) {
    //         store.commit('SET_TAGLIST', [...store.state.tagList, to])
    //     }
    // }
    //     // 判断是否需要缓存
    //     if (to.meta.keepAlive) {
    //         store.commit('SET_KEEPALIVELIST', [...store.state.keepAliveList, to.name])
    //     }
    //     next()
        if (!to.meta.hide || !to.meta.oneself) {
            let tagList = JSON.parse(localStorage.getItem('tagList') || '[]')
            // 判断是否存在
            let isExist = tagList.some(item => item.path === to.path)
            if (!isExist) {
                // 只保存必要的信息
                const tagInfo = {
                    path: to.path,
                    name: to.name,
                    meta: to.meta
                }
                tagList.push(tagInfo)
                localStorage.setItem('tagList', JSON.stringify(tagList))
                store.commit('SET_TAGLIST', tagList)
            }
        }
        // 判断是否需要缓存
        if (to.meta.keepAlive) {
            let keepAliveList = JSON.parse(localStorage.getItem('keepAliveList') || '[]')
            // 判断是否已经缓存
            let isExist = keepAliveList.includes(to.name)
            if (!isExist) {
                keepAliveList.push(to.name)
                localStorage.setItem('keepAliveList', JSON.stringify(keepAliveList))
                store.commit('SET_KEEPALIVELIST', keepAliveList)
            }
        }
        next()
    // }
});
src/store/index.js
@@ -5,8 +5,8 @@
const store = new Vuex.Store({
  state: {
    menus: localStorage.getItem('menuList') ? JSON.parse(localStorage.getItem('menuList')) : [],
    keepAliveList: [],//缓存页面
    tagList: [],//标签列表
    keepAliveList: localStorage.getItem('keepAliveList') ? JSON.parse(localStorage.getItem('keepAliveList')) : [],//缓存页面
    tagList: localStorage.getItem('tagList') ? JSON.parse(localStorage.getItem('tagList')) : [],//标签列表
    isFold: false,//是否折叠
  },
  mutations: {
@@ -15,9 +15,11 @@
    },
    SET_KEEPALIVELIST(state, data) {
      state.keepAliveList = data;
      localStorage.setItem('keepAliveList', JSON.stringify(data));
    },
    SET_TAGLIST(state, data) {
      state.tagList = data;
      localStorage.setItem('tagList', JSON.stringify(data));
    },
    SET_ISFOLD(state, data) {
      state.isFold = data;
src/views/approvalPlan/list.vue
File was deleted
src/views/dataManagement/approvalPlan/list.vue
New file
@@ -0,0 +1,152 @@
<template>
  <div class="list">
    <TableCustom :queryForm="form" :tableData="tableData" :total="total">
      <template #search>
        <el-form :model="form" label-width="140px" inline>
          <el-form-item label="项目课题方案名称:">
            <el-input v-model="form.planName" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="项目课题方案编号:">
            <el-input v-model="form.planCode" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="创建人:">
            <el-input v-model="form.creator" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="创建时间:">
            <el-date-picker
              v-model="form.createTime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="审批人:">
            <el-input v-model="form.approver" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="">
            <el-button type="default" @click="resetForm">重置</el-button>
            <el-button type="primary" @click="handleSearch">查询</el-button>
          </el-form-item>
        </el-form>
      </template>
      <template #setting>
        <div class="tableTitle">
          <div class="title">项目课题方案列表</div>
        </div>
      </template>
      <template #table>
          <el-table-column prop="planCode" label="项目课题方案编号"></el-table-column>
          <el-table-column prop="planName" label="项目课题方案名称"></el-table-column>
          <el-table-column prop="stage" label="项目阶段"></el-table-column>
          <el-table-column prop="creator" label="创建人"></el-table-column>
          <el-table-column prop="createTime" label="创建日期"></el-table-column>
          <el-table-column prop="status" label="审批状态">
            <template slot-scope="scope">
              <el-tag :type="getStatusType(scope.row.status)">
                {{ getStatusText(scope.row.status) }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="approver" label="审批人"></el-table-column>
          <el-table-column prop="approveTime" label="审批时间"></el-table-column>
          <el-table-column label="操作" width="150">
            <template slot-scope="scope">
              <el-button
                v-if="scope.row.status === 'pending'"
                type="text"
                @click="handleApprove(scope.row)"
              >审批</el-button>
              <el-button
                type="text"
                @click="handleDetail(scope.row)"
              >详情</el-button>
            </template>
          </el-table-column>
      </template>
    </TableCustom>
  </div>
</template>
<script>
export default {
  name: "ProjectList",
  data() {
    return {
      form: {
        planName: "",
        planCode: "",
        creator: "",
        createTime: [],
        approver: "",
        status: ""
      },
      tableData: [],
      total: 0
    };
  },
  methods: {
    resetForm() {
      this.form = {
        planName: "",
        planCode: "",
        creator: "",
        createTime: [],
        approver: "",
        status: ""
      };
    },
    handleSearch() {
      // 实现查询逻辑
      console.log('查询条件:', this.form);
    },
    getStatusType(status) {
      const statusMap = {
        pending: 'warning',
        rejected: 'danger',
        approved: 'success',
        archived: 'info'
      };
      return statusMap[status] || 'info';
    },
    getStatusText(status) {
      const statusMap = {
        pending: '待审批',
        rejected: '已驳回',
        approved: '已通过',
        archived: '已封存'
      };
      return statusMap[status] || '未知';
    },
    handleApprove(row) {
      // 实现审批逻辑
      console.log('审批数据:', row);
    },
    handleDetail(row) {
      // 实现查看详情逻辑
      console.log('查看详情:', row);
    }
  }
};
</script>
<style scoped lang="less">
.list {
  height: 100%;
}
.tableTitle {
  display: flex;
  padding-bottom: 20px;
  .title {
    background: #ffffff;
    border-radius: 8px 8px 0px 0px;
    border: 1px solid #049c9a;
    padding: 16px 29px;
    font-weight: bold;
    font-size: 18px;
    color: #049c9a;
    width: unset;
  }
}
</style>
src/views/dataManagement/dispatching/list.vue
src/views/projectList/addProject.vue
New file
@@ -0,0 +1,19 @@
<template>
    <Card>
        <template>
        </template>
    </Card>
</template>
<script>
export default {
    name: 'AddProject',
    data() {
        return {
        }
    }
}
</script>
<style></style>
src/views/projectList/index.vue
@@ -1,6 +1,7 @@
<template>
    <div class="list">
        <TableCustom :queryForm="queryForm" :total="total" @currentChange="handleCurrentChange" @sizeChange="handleSizeChange">
        <TableCustom :queryForm="queryForm" :total="total" @currentChange="handleCurrentChange"
            @sizeChange="handleSizeChange">
            <template #search>
                <el-form :model="form" label-width="140px" inline>
                    <el-form-item label="项目组名称:">
@@ -19,7 +20,8 @@
                </el-form>
            </template>
            <template #setting>
                <el-button class="el-icon-plus" style="margin-bottom: 20px;" type="primary"> 新增项目组</el-button>
                <el-button @click="handleAddProject" class="el-icon-plus" style="margin-bottom: 20px;" type="primary">
                    新增项目组</el-button>
            </template>
            <template #table>
                <el-table-column prop="name" label="项目组名称" />
@@ -44,7 +46,8 @@
            </template>
        </TableCustom>
        <ShowDelConfirm :show="showDelConfirm" @close="showDelConfirm = false" @confirm="handleDelConfirm" />
        <ShowDelConfirm :title="changeStatusTitle" :tip="changeStatusTip" :show="changeStatus" @close="changeStatus = false" @confirm="handleChangeStatus" />
        <ShowDelConfirm :title="changeStatusTitle" :tip="changeStatusTip" :show="changeStatus"
            @close="changeStatus = false" @confirm="handleChangeStatusConfirm" />
    </div>
</template>
@@ -69,25 +72,45 @@
        }
    },
    methods: {
        handleAddProject() {
            this.$router.push({
                path: '/projectList/addProject'
            })
        },
        handleDel(row) {
            this.showDelConfirm = true
            this.rowId = row.id
            this.showDelConfirm = true
        },
        handleDelConfirm() {
            this.showDelConfirm = false
            this.msgsuccess('删除成功')
            this.rowId = ''
            this.getList()
        },
        handleChangeStatus(row, status) {
            this.changeStatus = true
            this.rowId = row.id
            this.changeStatusTitle = status == 1 ? '确认要封存这个项目组吗?' : '确认要解封该项目组吗?'
            this.changeStatusTip = status == 1 ? '封存后项目组内人员看不到数据,审批人仍然可见数据。' : '解封后项目组内人员数据恢复。'
            this.changeStatus = true
        },
        handleChangeStatusConfirm() {
            this.changeStatus = false
            this.msgsuccess('操作成功')
            this.rowId = ''
            this.changeStatusTitle = ''
            this.changeStatusTip = ''
            this.getList()
        },
        handleCurrentChange(page) {
            this.queryForm.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.queryForm.pageSize = size
            this.getList()
        },
        getList() {
        }
    }
}