@@ -903,7 +903,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
m.Get("/tech_view", tech.TechView) | m.Get("/tech_view", tech.TechView) | ||||
m.Get("/repo_view", tech.RepoView) | m.Get("/repo_view", tech.RepoView) | ||||
m.Get("/admin_view", tech.AdminView) | m.Get("/admin_view", tech.AdminView) | ||||
m.Get("/my_view", tech.AdminView) | |||||
m.Get("/my_view", tech.MyView) | |||||
}, reqSignIn) | }, reqSignIn) | ||||
@@ -0,0 +1,5 @@ | |||||
{{template "base/head_home" .}} | |||||
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-tech-myview.css?v={{MD5 AppVer}}" /> | |||||
<div id="__vue-root"></div> | |||||
<script src="{{StaticUrlPrefix}}/js/vp-tech-myview.js?v={{MD5 AppVer}}"></script> | |||||
{{template "base/footer" .}} |
@@ -79,6 +79,19 @@ export const getTechOpenISearch = (params) => { | |||||
}); | }); | ||||
} | } | ||||
// 我申请的项目列表 | |||||
// 输入 page,pageSize | |||||
// 返回 {"total":10,"data":[{}]} | |||||
// data: {id:记录的id,name:启智项目名称,owner_name:启智项目拥有者名称,tech_name:科技项目名称,tech_number:科技项目编号,institution:项目承担单位, | |||||
// execute_period:执行周期,contact:联系人,contact_phone:联系电话,contact_email:联系邮件,apply_user:申请账号,status:状态} | |||||
export const getTechMyList = (params) => { | |||||
return service({ | |||||
url: '/api/v1/tech/my', | |||||
method: 'get', | |||||
params: params, | |||||
}); | |||||
} | |||||
// 后台管理项目列表 | // 后台管理项目列表 | ||||
// 输入 page,pageSize | // 输入 page,pageSize | ||||
// 返回 {"total":10,"data":[{}]} | // 返回 {"total":10,"data":[{}]} | ||||
@@ -97,9 +110,11 @@ export const getTechAdminList = (params) => { | |||||
// 返回 { code:0, message:"" } | // 返回 { code:0, message:"" } | ||||
export const setTechAdminOperation = (data) => { | export const setTechAdminOperation = (data) => { | ||||
return service({ | return service({ | ||||
url: `/api/v1/tech/admin/action/${data.type}`, | |||||
url: `/api/v1/tech/admin/${data.type}`, | |||||
method: 'post', | method: 'post', | ||||
data: data.id, | |||||
data: { | |||||
id: data.id | |||||
}, | |||||
params: {}, | params: {}, | ||||
}); | }); | ||||
} | } | ||||
@@ -1,10 +1,11 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
<TopHeader :menu="'admin_view'"></TopHeader> | |||||
<div class="ui container"> | <div class="ui container"> | ||||
<div class="top-container"> | <div class="top-container"> | ||||
<el-checkbox class="check-toggle" v-model="allChecked" @change="allSelectChange">全选/全不选</el-checkbox> | <el-checkbox class="check-toggle" v-model="allChecked" @change="allSelectChange">全选/全不选</el-checkbox> | ||||
<el-button class="btn-agree">批量同意展示</el-button> | |||||
<el-button class="btn-cancel">批量取消展示</el-button> | |||||
<el-button class="btn-agree" @click="batchOperate(true)">批量同意展示</el-button> | |||||
<el-button class="btn-cancel" @click="batchOperate(false)">批量取消展示</el-button> | |||||
</div> | </div> | ||||
<div class="table-container"> | <div class="table-container"> | ||||
<div class="table-title">2030科技项目管理</div> | <div class="table-title">2030科技项目管理</div> | ||||
@@ -15,19 +16,93 @@ | |||||
<el-checkbox v-model="scope.row.checked" @change="rowSelectChange(scope.row)"></el-checkbox> | <el-checkbox v-model="scope.row.checked" @change="rowSelectChange(scope.row)"></el-checkbox> | ||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column prop="name" label="启智项目名称" align="center" header-align="center" fixed></el-table-column> | |||||
<el-table-column prop="tech_name" label="科技项目名称" align="center" header-align="center" | |||||
fixed></el-table-column> | |||||
<el-table-column prop="status" label="展示状态" align="center" header-align="center" fixed></el-table-column> | |||||
<el-table-column prop="tech_number" label="项目立项编号" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="institution" label="项目承担单位" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="execute_period" label="执行周期" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="contact" label="联系人" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="contact_phone" label="电话" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="apply_user" label="申请账号" align="center" header-align="center"></el-table-column> | |||||
<el-table-column prop="" label="操作" align="center" header-align="center" fixed="right"></el-table-column> | |||||
<el-table-column label="启智项目名称" align="center" header-align="center" fixed min-width="150"> | |||||
<template slot-scope="scope"> | |||||
<a target="_blank" :href="`/${scope.row.repo_owner_name}/${scope.row.repo_name}`">{{ | |||||
`${scope.row.repo_owner_name}/${scope.row.repo_name}` }}</a> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column prop="name" label="科技项目名称" align="center" header-align="center" fixed | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="status" label="展示状态" align="center" header-align="center" fixed> | |||||
<template slot-scope="scope"> | |||||
<span style="color:rgb(255, 37, 37)" | |||||
:style="scope.row.status == 1 ? { color: 'rgb(56, 158, 13)' } : ''">{{ | |||||
statusMap[scope.row.status] }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column prop="no" label="项目立项编号" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="institution" label="项目承担单位" align="center" header-align="center" | |||||
min-width="160"></el-table-column> | |||||
<el-table-column prop="province" label="所属省(省市)" align="center" header-align="center" | |||||
min-width="100"></el-table-column> | |||||
<el-table-column prop="category" label="单位性质" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="recommend" label="推荐单位" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="owner" label="项目负责人" align="center" header-align="center" | |||||
min-width="100"></el-table-column> | |||||
<el-table-column prop="phone" label="负责人电话" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="email" label="负责人邮箱" align="center" header-align="center" | |||||
min-width="150"></el-table-column> | |||||
<el-table-column prop="contact" label="项目联系人" align="center" header-align="center" | |||||
min-width="100"></el-table-column> | |||||
<el-table-column prop="contact_phone" label="联系人电话" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="contact_email" label="联系人邮箱" align="center" header-align="center" | |||||
min-width="150"></el-table-column> | |||||
<el-table-column prop="apply_year" label="申报年度" align="center" header-align="center" | |||||
min-width="80"></el-table-column> | |||||
<el-table-column prop="execute_month" label="执行周期(月)" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="execute_period" label="执行期限" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="type" label="项目类型" align="center" header-align="center" | |||||
min-width="100"></el-table-column> | |||||
<el-table-column prop="start_up" label="启动会时间" align="center" header-align="center" | |||||
min-width="100"></el-table-column> | |||||
<el-table-column prop="number_topic" label="课题数量" align="center" header-align="center" | |||||
min-width="80"></el-table-column> | |||||
<el-table-column prop="topic1" label="课题一级名称及承担单位" align="center" header-align="center" | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="topic2" label="课题二级名称及承担单位" align="center" header-align="center" | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="topic3" label="课题三级名称及承担单位" align="center" header-align="center" | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="topic4" label="课题四级名称及承担单位" align="center" header-align="center" | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="topic5" label="课题五级名称及承担单位" align="center" header-align="center" | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="all_institution" label="所有参与单位" align="center" header-align="center" | |||||
min-width="300"></el-table-column> | |||||
<el-table-column prop="contribution_institution" label="成果贡献单位" align="center" header-align="center" | |||||
min-width="300"></el-table-column> | |||||
<el-table-column prop="user_name" label="申请账号" align="center" header-align="center" width="120"> | |||||
<template slot-scope="scope"> | |||||
<a target="_blank" :href="`/${scope.row.user_name}`">{{ | |||||
`${scope.row.user_name}` }}</a> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column prop="" label="操作" align="center" header-align="center" fixed="right" width="100"> | |||||
<template slot-scope="scope"> | |||||
<span v-if="scope.row.status == 2" class="op-btn agree" @click="toggleStatus(scope.row)"> | |||||
<i class="el-icon-check"></i> | |||||
<span>同意展示</span> | |||||
</span> | |||||
<span v-if="scope.row.status == 1" class="op-btn cancel" @click="toggleStatus(scope.row)"> | |||||
<i class="el-icon-close"></i> | |||||
<span>取消展示</span> | |||||
</span> | |||||
</template> | |||||
</el-table-column> | |||||
</el-table> | </el-table> | ||||
</div> | </div> | ||||
<div class="op-tips"> | |||||
<i class="el-icon-info"></i> | |||||
提示:批量操作只会对【展示状态】为 “未展示” 或 “已展示” 的数据生效。 | |||||
</div> | |||||
<div class="center"> | <div class="center"> | ||||
<el-pagination ref="paginationRef" background @current-change="currentChange" @size-change="sizeChange" | <el-pagination ref="paginationRef" background @current-change="currentChange" @size-change="sizeChange" | ||||
:current-page.sync="page" :page-sizes="pageSizes" :page-size.sync="pageSize" | :current-page.sync="page" :page-sizes="pageSizes" :page-size.sync="pageSize" | ||||
@@ -40,6 +115,7 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import TopHeader from '../components/TopHeader.vue'; | |||||
import { getTechAdminList, setTechAdminOperation } from '~/apis/modules/tech'; | import { getTechAdminList, setTechAdminOperation } from '~/apis/modules/tech'; | ||||
export default { | export default { | ||||
@@ -53,9 +129,17 @@ export default { | |||||
pageSizes: [15, 30, 50, 100], | pageSizes: [15, 30, 50, 100], | ||||
pageSize: 50, | pageSize: 50, | ||||
total: 0, | total: 0, | ||||
statusMap: { | |||||
'1': '已展示', | |||||
'2': '未展示', | |||||
'3': '项目迁移中', | |||||
'4': '项目迁移失败', | |||||
'5': '项目不存在', | |||||
}, | |||||
}; | }; | ||||
}, | }, | ||||
components: {}, | |||||
components: { TopHeader }, | |||||
methods: { | methods: { | ||||
getData() { | getData() { | ||||
this.loading = true; | this.loading = true; | ||||
@@ -68,10 +152,10 @@ export default { | |||||
this.tableData = data.map((item, index) => { | this.tableData = data.map((item, index) => { | ||||
return { | return { | ||||
checked: false, | checked: false, | ||||
id: 'id' + Math.random(), | |||||
...item, | ...item, | ||||
} | } | ||||
}); | }); | ||||
this.allChecked = false; | |||||
this.total = total; | this.total = total; | ||||
}).catch(err => { | }).catch(err => { | ||||
this.loading = false; | this.loading = false; | ||||
@@ -102,29 +186,74 @@ export default { | |||||
this.pageSize = pageSize; | this.pageSize = pageSize; | ||||
this.getData(); | this.getData(); | ||||
}, | }, | ||||
toggleStatus(row) { | |||||
if (row.status != 1 && row.status != 2) return; | |||||
setTechAdminOperation({ | |||||
type: row.status == 1 ? 'hide' : 'show', | |||||
id: [row.id], | |||||
}).then(res => { | |||||
res = res.data; | |||||
if (res.Code == 0) { | |||||
this.$message({ | |||||
type: 'success', | |||||
message: this.$t('submittedSuccessfully'), | |||||
}); | |||||
row.status = row.status == 1 ? 2 : 1; | |||||
} else { | |||||
this.$message({ | |||||
type: 'error', | |||||
message: this.$t('submittedFailed'), | |||||
}); | |||||
} | |||||
}).catch(err => { | |||||
console.log(err); | |||||
this.$message({ | |||||
type: 'error', | |||||
message: this.$t('submittedFailed'), | |||||
}); | |||||
}); | |||||
}, | |||||
batchOperate(showOr) { | |||||
const selectedData = this.tableData.filter((item) => { | |||||
return item.checked && item.status == (showOr ? 2 : 1); | |||||
}); | |||||
if (!selectedData.length) { | |||||
this.$message({ | |||||
type: 'info', | |||||
message: '请选择符合条件的数据进行操作!', | |||||
}); | |||||
return; | |||||
} | |||||
setTechAdminOperation({ | |||||
type: showOr ? 'show' : 'hide', | |||||
id: selectedData.map(item => item.id), | |||||
}).then(res => { | |||||
res = res.data; | |||||
if (res.Code == 0) { | |||||
this.$message({ | |||||
type: 'success', | |||||
message: this.$t('submittedSuccessfully'), | |||||
}); | |||||
this.getData(); | |||||
} else { | |||||
this.$message({ | |||||
type: 'error', | |||||
message: this.$t('submittedFailed'), | |||||
}); | |||||
} | |||||
}).catch(err => { | |||||
console.log(err); | |||||
this.$message({ | |||||
type: 'error', | |||||
message: this.$t('submittedFailed'), | |||||
}); | |||||
}); | |||||
}, | |||||
}, | }, | ||||
beforeMount() { | beforeMount() { | ||||
this.getData(); | this.getData(); | ||||
}, | }, | ||||
mounted() { | |||||
this.tableData = new Array(15).fill(0).map((item, index) => { | |||||
return { | |||||
id: '记录的id-' + index, | |||||
name: '启智项目名称-' + index, | |||||
owner_name: '启智项目拥有者名称-' + index, | |||||
tech_name: '科技项目名称-' + index, | |||||
tech_number: '科技项目编号-' + index, | |||||
institution: '项目承担单位-' + index, | |||||
execute_period: '执行周期-' + index, | |||||
contact: '联系人-' + index, | |||||
contact_phone: '联系电话-' + index, | |||||
contact_email: '联系邮件-' + index, | |||||
apply_user: '申请账号-' + index, | |||||
status: '状态-' + index, | |||||
} | |||||
}); | |||||
this.total = this.tableData.length; | |||||
}, | |||||
mounted() { }, | |||||
beforeDestroy() { }, | beforeDestroy() { }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -133,7 +262,7 @@ export default { | |||||
.top-container { | .top-container { | ||||
display: flex; | display: flex; | ||||
align-items: center; | align-items: center; | ||||
margin: 15px 0; | |||||
margin: 30px 0 15px 0; | |||||
.check-toggle { | .check-toggle { | ||||
margin-right: 20px; | margin-right: 20px; | ||||
@@ -185,7 +314,6 @@ export default { | |||||
} | } | ||||
.table-wrap { | .table-wrap { | ||||
margin-bottom: 12px; | |||||
overflow-x: auto; | overflow-x: auto; | ||||
/deep/ .el-table__header { | /deep/ .el-table__header { | ||||
@@ -208,4 +336,26 @@ export default { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
.op-tips { | |||||
margin: 10px 0 10px 0; | |||||
color: #606266; | |||||
font-size: 12px; | |||||
i { | |||||
margin-right: 4px; | |||||
} | |||||
} | |||||
.op-btn { | |||||
cursor: pointer; | |||||
&.agree { | |||||
color: rgb(56, 158, 13); | |||||
} | |||||
&.cancel { | |||||
color: rgb(50, 145, 248); | |||||
} | |||||
} | |||||
</style> | </style> |
@@ -76,9 +76,7 @@ export default { | |||||
}, | }, | ||||
components: {}, | components: {}, | ||||
data() { | data() { | ||||
return { | |||||
}; | |||||
return {}; | |||||
}, | }, | ||||
methods: { | methods: { | ||||
calcFromNow(unix) { | calcFromNow(unix) { | ||||
@@ -5,11 +5,9 @@ | |||||
<div class="search-input-c"> | <div class="search-input-c"> | ||||
<input type="text" :placeholder="serchPlaceHolder" v-model="keyword" @keyup.enter="search"> | <input type="text" :placeholder="serchPlaceHolder" v-model="keyword" @keyup.enter="search"> | ||||
</div> | </div> | ||||
<div class="search-btn" @click="search">搜索</div> | |||||
<div class="search-btn" @click="search">{{ $t('repos.search') }}</div> | |||||
</div> | </div> | ||||
<el-button class="apply-btn" type="primary" icon="el-icon-plus" size="medium" @click="apply">申请展示项目</el-button> | <el-button class="apply-btn" type="primary" icon="el-icon-plus" size="medium" @click="apply">申请展示项目</el-button> | ||||
<el-button class="apply-btn" type="primary" icon="el-icon-s-management" size="medium" v-if="isTechAdmin" | |||||
@click="manage">管理展示项目</el-button> | |||||
<div class="openi-link-c"> | <div class="openi-link-c"> | ||||
<a class="openi-link" target="_blank" href="javascript:;">OpenI启智社区开源指南</a> | <a class="openi-link" target="_blank" href="javascript:;">OpenI启智社区开源指南</a> | ||||
</div> | </div> | ||||
@@ -23,7 +21,6 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getIsTechAdmin } from '~/apis/modules/tech'; | |||||
export default { | export default { | ||||
name: "SearchBar", | name: "SearchBar", | ||||
@@ -39,7 +36,7 @@ export default { | |||||
sortType: '', | sortType: '', | ||||
techSortList: [{ | techSortList: [{ | ||||
k: 'time', | k: 'time', | ||||
v: '最近更新', | |||||
v: this.$t('repos.recentlyUpdated'), | |||||
}, { | }, { | ||||
k: 'count', | k: 'count', | ||||
v: '项目成果数', | v: '项目成果数', | ||||
@@ -47,13 +44,13 @@ export default { | |||||
repoSortList: [ | repoSortList: [ | ||||
{ | { | ||||
k: 'mostpopular', | k: 'mostpopular', | ||||
v: '近期热门', | |||||
v: this.$t('repos.mostPopular'), | |||||
}, { | }, { | ||||
k: 'recentupdate', | k: 'recentupdate', | ||||
v: '最近更新', | |||||
v: this.$t('repos.recentlyUpdated'), | |||||
}, { | }, { | ||||
k: 'newest', | k: 'newest', | ||||
v: '最近创建', | |||||
v: this.$t('repos.newest'), | |||||
} | } | ||||
], | ], | ||||
sortList: [], | sortList: [], | ||||
@@ -96,14 +93,6 @@ export default { | |||||
this.serchPlaceHolder = '搜索项目名称/简介/标签'; | this.serchPlaceHolder = '搜索项目名称/简介/标签'; | ||||
this.sortList = this.repoSortList; | this.sortList = this.repoSortList; | ||||
} | } | ||||
getIsTechAdmin().then(res => { | |||||
res = res.data; | |||||
if (res.data && res.data.is_admin) { | |||||
this.isTechAdmin = true; | |||||
} | |||||
}).catch(err => { | |||||
console.log(err); | |||||
}); | |||||
}, | }, | ||||
mounted() { }, | mounted() { }, | ||||
}; | }; | ||||
@@ -24,7 +24,7 @@ import TopMenu from './TopMenu.vue'; | |||||
export default { | export default { | ||||
name: "TopHeader", | name: "TopHeader", | ||||
props: { | props: { | ||||
menu: { type: Number, default: -1 }, | |||||
menu: { type: String, default: '' }, | |||||
}, | }, | ||||
components: { | components: { | ||||
TopMenu | TopMenu | ||||
@@ -2,49 +2,72 @@ | |||||
<div class="container ui" style="padding:0 75px;"> | <div class="container ui" style="padding:0 75px;"> | ||||
<div class="menu"> | <div class="menu"> | ||||
<div class="menu-l"> | <div class="menu-l"> | ||||
<div class="menu-item" v-for="(item, index) in list" :key="index" :class="focusIndex == index ? 'focused' : ''" | |||||
@click="changeMenu(item, index)"> | |||||
<div class="menu-item" v-for="(item, index) in listL" :key="index" | |||||
:class="focusMenu == item.key ? 'focused' : ''" @click="changeMenu(item)"> | |||||
{{ item.title }} | |||||
</div> | |||||
</div> | |||||
<div class="menu-r"> | |||||
<div class="menu-item" v-for="(item, index) in listR" :key="index" | |||||
:class="focusMenu == item.key ? 'focused' : ''" @click="changeMenu(item)"> | |||||
{{ item.title }} | {{ item.title }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="menu-r"></div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getIsTechAdmin } from '~/apis/modules/tech'; | |||||
export default { | export default { | ||||
name: "TopMenu", | name: "TopMenu", | ||||
props: { | props: { | ||||
menu: { type: Number, default: -1 }, | |||||
menu: { type: String, default: '' }, | |||||
}, | }, | ||||
components: {}, | components: {}, | ||||
data() { | data() { | ||||
return { | return { | ||||
focusIndex: 0, | |||||
list: [{ | |||||
focusMenu: '', | |||||
listL: [{ | |||||
key: 'tech_view', | key: 'tech_view', | ||||
title: '按科技项目查看', | title: '按科技项目查看', | ||||
url: '/tech/tech_view', | url: '/tech/tech_view', | ||||
}, { | }, { | ||||
key: 'repo_view', | key: 'repo_view', | ||||
title: '按项目成果查看', | title: '按项目成果查看', | ||||
url: '/tech/repo_view', | url: '/tech/repo_view', | ||||
},/* { | |||||
key: '', | |||||
}], | |||||
listR: [{ | |||||
key: 'my_view', | |||||
title: '我申请的项目', | title: '我申请的项目', | ||||
url: '', | |||||
}*/], | |||||
url: '/tech/my_view', | |||||
},], | |||||
isTechAdmin: false, | |||||
}; | }; | ||||
}, | }, | ||||
methods: { | methods: { | ||||
changeMenu(item, index) { | changeMenu(item, index) { | ||||
this.focusIndex = index; | |||||
this.focusMenu = item.key; | |||||
window.location.href = item.url; | window.location.href = item.url; | ||||
} | } | ||||
}, | }, | ||||
beforeMount() { | beforeMount() { | ||||
this.focusIndex = this.menu; | |||||
this.focusMenu = this.menu; | |||||
getIsTechAdmin().then(res => { | |||||
res = res.data; | |||||
if (res.data && res.data.is_admin) { | |||||
this.isTechAdmin = true; | |||||
this.listR.push({ | |||||
key: 'admin_view', | |||||
title: '管理展示项目', | |||||
url: '/tech/admin_view', | |||||
}); | |||||
} | |||||
}).catch(err => { | |||||
console.log(err); | |||||
}); | |||||
}, | }, | ||||
mounted() { }, | mounted() { }, | ||||
}; | }; | ||||
@@ -113,10 +113,9 @@ | |||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="row-label">请输入科技项目</div> | <div class="row-label">请输入科技项目</div> | ||||
<div class="row-content"> | <div class="row-content"> | ||||
<el-input placeholder="请输入内容" size="medium" v-model="form.tech_search_keyword" | |||||
<el-input placeholder="请输入搜索内容" size="medium" v-model="form.tech_search_keyword" | |||||
@keyup.enter.native="searchTechList" class="input-with-select"> | @keyup.enter.native="searchTechList" class="input-with-select"> | ||||
<el-select v-model="form.tech_search_sel" style="width:142px" size="medium" slot="prepend" | |||||
placeholder="请选择"> | |||||
<el-select v-model="form.tech_search_sel" style="width:142px" size="medium" slot="prepend"> | |||||
<el-option label="项目立项编号" value="0"></el-option> | <el-option label="项目立项编号" value="0"></el-option> | ||||
<el-option label="参与单位" value="1"></el-option> | <el-option label="参与单位" value="1"></el-option> | ||||
<el-option label="项目名称" value="2"></el-option> | <el-option label="项目名称" value="2"></el-option> | ||||
@@ -136,7 +135,7 @@ | |||||
width="200"></el-table-column> | width="200"></el-table-column> | ||||
<el-table-column prop="all_institution" label="所有参与单位" align="center" | <el-table-column prop="all_institution" label="所有参与单位" align="center" | ||||
header-align="center"></el-table-column> | header-align="center"></el-table-column> | ||||
<el-table-column width="100" label="操作" align="center" header-align="center"> | |||||
<el-table-column width="100" :label="$t('operation')" align="center" header-align="center"> | |||||
<template slot-scope="scope"> | <template slot-scope="scope"> | ||||
<el-button type="primary" @click="selectedTechPrj(scope.row)">选择</el-button> | <el-button type="primary" @click="selectedTechPrj(scope.row)">选择</el-button> | ||||
</template> | </template> | ||||
@@ -406,7 +405,7 @@ export default { | |||||
if (res.data && res.data.code == 0) { | if (res.data && res.data.code == 0) { | ||||
this.$message({ | this.$message({ | ||||
type: 'success', | type: 'success', | ||||
message: '提交成功' | |||||
message: this.$t('submittedSuccessfully'), | |||||
}); | }); | ||||
setTimeout(() => { | setTimeout(() => { | ||||
window.location.href = '/tech/tech_view'; | window.location.href = '/tech/tech_view'; | ||||
@@ -422,7 +421,7 @@ export default { | |||||
this.submitLoading = false; | this.submitLoading = false; | ||||
this.$message({ | this.$message({ | ||||
type: 'error', | type: 'error', | ||||
message: '提交失败' | |||||
message: this.$t('submittedFailed'), | |||||
}); | }); | ||||
}); | }); | ||||
}, | }, | ||||
@@ -622,7 +621,5 @@ export default { | |||||
height: 24px; | height: 24px; | ||||
margin-right: 10px; | margin-right: 10px; | ||||
} | } | ||||
.owner-name {} | |||||
} | } | ||||
</style> | </style> |
@@ -0,0 +1,160 @@ | |||||
<template> | |||||
<div> | |||||
<TopHeader :menu="'my_view'"></TopHeader> | |||||
<div class="ui container"> | |||||
<div class="table-container"> | |||||
<div class="table-title">2030科技项目</div> | |||||
<div class="table-wrap"> | |||||
<el-table ref="tableRef" border :data="tableData" style="width:100%;" v-loading="loading" stripe row-key="id"> | |||||
<el-table-column label="序号" type="index" align="center" header-align="center" width="50" | |||||
fixed></el-table-column> | |||||
<el-table-column label="启智项目名称" align="center" header-align="center" fixed min-width="140"> | |||||
<template slot-scope="scope"> | |||||
<a target="_blank" :href="`/${scope.row.repo_owner_name}/${scope.row.repo_name}`">{{ | |||||
`${scope.row.repo_owner_name}/${scope.row.repo_name}` }}</a> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column prop="name" label="科技项目名称" align="center" header-align="center" fixed | |||||
min-width="200"></el-table-column> | |||||
<el-table-column prop="status" label="展示状态" align="center" header-align="center" fixed> | |||||
<template slot-scope="scope"> | |||||
<span style="color:rgb(255, 37, 37)" | |||||
:style="scope.row.status == 1 ? { color: 'rgb(56, 158, 13)' } : ''">{{ | |||||
statusMap[scope.row.status] }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column prop="no" label="项目立项编号" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="institution" label="项目承担单位" align="center" header-align="center" | |||||
min-width="120"></el-table-column> | |||||
<el-table-column prop="all_institution" label="所有参与单位" align="center" header-align="center" | |||||
min-width="280"></el-table-column> | |||||
<el-table-column prop="contribution_institution" label="成果贡献单位" align="center" header-align="center" | |||||
min-width="280"></el-table-column> | |||||
<el-table-column prop="contribution_institution" label="申请时间" align="center" header-align="center" | |||||
min-width="120"> | |||||
<template slot-scope="scope"> | |||||
<span>{{ dateFormat(scope.row.created_unix) }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
</el-table> | |||||
</div> | |||||
<div class="center"> | |||||
<el-pagination ref="paginationRef" background @current-change="currentChange" @size-change="sizeChange" | |||||
:current-page.sync="page" :page-sizes="pageSizes" :page-size.sync="pageSize" | |||||
layout="total, sizes, prev, pager, next, jumper" :total="total"> | |||||
</el-pagination> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import dayjs from 'dayjs'; | |||||
import TopHeader from '../components/TopHeader.vue'; | |||||
import { getTechMyList } from '~/apis/modules/tech'; | |||||
export default { | |||||
data() { | |||||
return { | |||||
loading: false, | |||||
tableData: [], | |||||
page: 1, | |||||
pageSizes: [15, 30, 50], | |||||
pageSize: 15, | |||||
total: 0, | |||||
statusMap: { | |||||
'1': '已展示', | |||||
'2': '未展示', | |||||
'3': '项目迁移中', | |||||
'4': '项目迁移失败', | |||||
'5': '项目不存在', | |||||
}, | |||||
}; | |||||
}, | |||||
components: { TopHeader }, | |||||
methods: { | |||||
getData() { | |||||
this.loading = true; | |||||
getTechMyList({ | |||||
page: this.page, | |||||
pageSize: this.pageSize, | |||||
}).then(res => { | |||||
this.loading = false; | |||||
const { total, data } = res.data; | |||||
this.tableData = data.map((item, index) => { | |||||
return { ...item, } | |||||
}); | |||||
this.total = total; | |||||
}).catch(err => { | |||||
this.loading = false; | |||||
console.log(err); | |||||
}); | |||||
}, | |||||
currentChange(page) { | |||||
this.page = page; | |||||
this.getData(); | |||||
}, | |||||
sizeChange(pageSize) { | |||||
this.pageSize = pageSize; | |||||
this.getData(); | |||||
}, | |||||
dateFormat(unix) { | |||||
return dayjs(unix * 1000).format('YYYY-MM-DD HH:mm'); | |||||
} | |||||
}, | |||||
beforeMount() { | |||||
this.getData(); | |||||
}, | |||||
mounted() { }, | |||||
beforeDestroy() { }, | |||||
}; | |||||
</script> | |||||
<style scoped lang="less"> | |||||
.table-container { | |||||
margin-top: 30px; | |||||
.table-title { | |||||
height: 43px; | |||||
font-size: 16px; | |||||
font-weight: 700; | |||||
padding: 15px; | |||||
color: rgb(16, 16, 16); | |||||
border-color: rgb(212, 212, 213); | |||||
border-width: 1px; | |||||
border-style: solid; | |||||
border-radius: 5px 5px 0px 0px; | |||||
background: rgb(240, 240, 240); | |||||
display: flex; | |||||
align-items: center; | |||||
} | |||||
.table-wrap { | |||||
overflow-x: auto; | |||||
margin-bottom: 20px; | |||||
/deep/ .el-table__header { | |||||
th { | |||||
background: rgb(249, 249, 249); | |||||
font-size: 12px; | |||||
color: rgb(136, 136, 136); | |||||
font-weight: normal; | |||||
} | |||||
} | |||||
/deep/ .el-table__body { | |||||
td { | |||||
font-size: 12px; | |||||
} | |||||
} | |||||
/deep/ .el-radio__label { | |||||
display: none; | |||||
} | |||||
} | |||||
} | |||||
</style> |
@@ -0,0 +1,17 @@ | |||||
import Vue from 'vue'; | |||||
import ElementUI from 'element-ui'; | |||||
import 'element-ui/lib/theme-chalk/index.css'; | |||||
import localeEn from 'element-ui/lib/locale/lang/en'; | |||||
import localeZh from 'element-ui/lib/locale/lang/zh-CN'; | |||||
import { i18n, lang } from '~/langs'; | |||||
import App from './index.vue'; | |||||
Vue.use(ElementUI, { | |||||
locale: lang === 'zh-CN' ? localeZh : localeEn, | |||||
size: 'small', | |||||
}); | |||||
new Vue({ | |||||
i18n, | |||||
render: (h) => h(App), | |||||
}).$mount('#__vue-root'); |
@@ -1,6 +1,6 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
<TopHeader :menu="1"></TopHeader> | |||||
<TopHeader :menu="'repo_view'"></TopHeader> | |||||
<div class="ui container"> | <div class="ui container"> | ||||
<SearchBar :type="1" :condition="condition" @changeCondition="changeCondition"></SearchBar> | <SearchBar :type="1" :condition="condition" @changeCondition="changeCondition"></SearchBar> | ||||
<div class="conent-c"> | <div class="conent-c"> | ||||
@@ -1,6 +1,6 @@ | |||||
<template> | <template> | ||||
<div> | <div> | ||||
<TopHeader :menu="0"></TopHeader> | |||||
<TopHeader :menu="'tech_view'"></TopHeader> | |||||
<div class="ui container"> | <div class="ui container"> | ||||
<SearchBar :type="0" :condition="condition" @changeCondition="changeCondition"></SearchBar> | <SearchBar :type="0" :condition="condition" @changeCondition="changeCondition"></SearchBar> | ||||
<div class="conent-c"> | <div class="conent-c"> | ||||