|
|
|
@ -1,124 +1,116 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-card v-if="showBack" shadow="hover" class="mgb20"> |
|
|
|
|
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header> |
|
|
|
|
</el-card> |
|
|
|
|
</el-col> |
|
|
|
|
<el-card v-if="showBack" shadow="hover" class="mgb20"> |
|
|
|
|
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<div> |
|
|
|
|
<div class="flex-center mgb20"> |
|
|
|
|
<p class="hr_tag"></p> |
|
|
|
|
<span>筛选</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-form label-width="80px"> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="创建人"> |
|
|
|
|
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" |
|
|
|
|
@change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label" |
|
|
|
|
:value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="状态"> |
|
|
|
|
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label" |
|
|
|
|
:value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="权限"> |
|
|
|
|
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in permissionsList" |
|
|
|
|
:key="item.value" |
|
|
|
|
:label="item.label" |
|
|
|
|
:value="item.value" |
|
|
|
|
></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="6"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</el-col> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<div> |
|
|
|
|
<div class="flex-center mgb20"> |
|
|
|
|
<p class="hr_tag"></p> |
|
|
|
|
<span>筛选</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-form label-width="80px"> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="创建人"> |
|
|
|
|
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" |
|
|
|
|
@change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label" |
|
|
|
|
:value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="状态"> |
|
|
|
|
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label" |
|
|
|
|
:value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="4"> |
|
|
|
|
<el-form-item label="权限"> |
|
|
|
|
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in permissionsList" |
|
|
|
|
:key="item.value" |
|
|
|
|
:label="item.label" |
|
|
|
|
:value="item.value" |
|
|
|
|
></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="6"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<div class="flex-between mgb20"> |
|
|
|
|
<div class="flex-center"> |
|
|
|
|
<p class="hr_tag"></p> |
|
|
|
|
<span>项目列表</span> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" round @click="add" class="mag">新增项目</el-button> |
|
|
|
|
<el-button type="primary" round @click="delAllData">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="projectId" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if='queryData.founder == 1' prop="schoolName" label="学校名字" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="founder" label="创建人" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ founderKeys[scope.row.founder] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="权限" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="status" label="状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ stateKeys[scope.row.state] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)"> |
|
|
|
|
编辑 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row.projectId)"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.ztOpen" |
|
|
|
|
:active-text="scope.row.ztOpen ? '关闭' : '启用'" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 10px" |
|
|
|
|
@change="switchOff(scope.row)" |
|
|
|
|
></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<div class="flex-between mgb20"> |
|
|
|
|
<div class="flex-center"> |
|
|
|
|
<p class="hr_tag"></p> |
|
|
|
|
<span>项目列表</span> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" round @click="add" class="mag">新增项目</el-button> |
|
|
|
|
<el-button type="primary" round @click="delAllData">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="projectId" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if='queryData.founder == 1' prop="schoolName" label="学校名字" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="founder" label="创建人" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ founderKeys[scope.row.founder] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="权限" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="status" label="状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ stateKeys[scope.row.state] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)"> |
|
|
|
|
编辑 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row.projectId)"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.ztOpen" |
|
|
|
|
:active-text="scope.row.ztOpen ? '关闭' : '启用'" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 10px" |
|
|
|
|
@change="switchOff(scope.row)" |
|
|
|
|
></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<!--复制对话框--> |
|
|
|
|
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false"> |
|
|
|
|