From a071f308a7f1516a0ac950efc9635d1ef5ee0387 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Mon, 30 Jan 2023 18:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E6=8A=80=E9=A1=B9=E7=9B=AE=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_navbar.tmpl | 4 +- templates/base/head_navbar_fluid.tmpl | 4 +- templates/base/head_navbar_home.tmpl | 4 +- templates/base/head_navbar_pro.tmpl | 4 +- templates/tech/admin_view.tmpl | 5 + templates/tech/create.tmpl | 5 + templates/tech/repo_view.tmpl | 5 + templates/tech/tech_view.tmpl | 5 + web_src/vuepages/apis/modules/tech.js | 153 ++++ web_src/vuepages/pages/tech/adminview/index.vue | 211 +++++ .../pages/tech/adminview/vp-tech-adminview.js | 17 + web_src/vuepages/pages/tech/components/Filters.vue | 277 +++++++ .../pages/tech/components/PrjResultsItem.vue | 157 ++++ .../pages/tech/components/PrjResultsList.vue | 888 +++++++++++++++++++++ .../pages/tech/components/SciAndTechPrjItem.vue | 243 ++++++ .../pages/tech/components/SciAndTechPrjList.vue | 885 ++++++++++++++++++++ .../vuepages/pages/tech/components/SearchBar.vue | 179 +++++ .../vuepages/pages/tech/components/TopHeader.vue | 141 ++++ web_src/vuepages/pages/tech/components/TopMenu.vue | 99 +++ web_src/vuepages/pages/tech/create/index.vue | 470 +++++++++++ .../vuepages/pages/tech/create/vp-tech-create.js | 17 + web_src/vuepages/pages/tech/repoview/index.vue | 92 +++ .../pages/tech/repoview/vp-tech-repoview.js | 17 + web_src/vuepages/pages/tech/techview/index.vue | 93 +++ .../pages/tech/techview/vp-tech-techview.js | 17 + 25 files changed, 3988 insertions(+), 4 deletions(-) create mode 100644 templates/tech/admin_view.tmpl create mode 100644 templates/tech/create.tmpl create mode 100644 templates/tech/repo_view.tmpl create mode 100644 templates/tech/tech_view.tmpl create mode 100644 web_src/vuepages/apis/modules/tech.js create mode 100644 web_src/vuepages/pages/tech/adminview/index.vue create mode 100644 web_src/vuepages/pages/tech/adminview/vp-tech-adminview.js create mode 100644 web_src/vuepages/pages/tech/components/Filters.vue create mode 100644 web_src/vuepages/pages/tech/components/PrjResultsItem.vue create mode 100644 web_src/vuepages/pages/tech/components/PrjResultsList.vue create mode 100644 web_src/vuepages/pages/tech/components/SciAndTechPrjItem.vue create mode 100644 web_src/vuepages/pages/tech/components/SciAndTechPrjList.vue create mode 100644 web_src/vuepages/pages/tech/components/SearchBar.vue create mode 100644 web_src/vuepages/pages/tech/components/TopHeader.vue create mode 100644 web_src/vuepages/pages/tech/components/TopMenu.vue create mode 100644 web_src/vuepages/pages/tech/create/index.vue create mode 100644 web_src/vuepages/pages/tech/create/vp-tech-create.js create mode 100644 web_src/vuepages/pages/tech/repoview/index.vue create mode 100644 web_src/vuepages/pages/tech/repoview/vp-tech-repoview.js create mode 100644 web_src/vuepages/pages/tech/techview/index.vue create mode 100644 web_src/vuepages/pages/tech/techview/vp-tech-techview.js diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index de55e6452..c78ecd2c3 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -55,7 +55,8 @@ {{/* {{.i18n.Tr "explore.data_analysis"}} */}} {{.i18n.Tr "explore.data_analysis"}} {{end}} - {{.i18n.Tr "custom.head.openi.repo"}} + {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageHome}} @@ -97,6 +98,7 @@ {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageExplore}} diff --git a/templates/base/head_navbar_fluid.tmpl b/templates/base/head_navbar_fluid.tmpl index 8a4682e9d..326de481b 100644 --- a/templates/base/head_navbar_fluid.tmpl +++ b/templates/base/head_navbar_fluid.tmpl @@ -52,7 +52,8 @@ {{/* {{.i18n.Tr "explore.data_analysis"}} */}} {{.i18n.Tr "explore.data_analysis"}} {{end}} - {{.i18n.Tr "custom.head.openi.repo"}} + {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageHome}} @@ -92,6 +93,7 @@ {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageExplore}} diff --git a/templates/base/head_navbar_home.tmpl b/templates/base/head_navbar_home.tmpl index f6741b7c8..0a736529c 100644 --- a/templates/base/head_navbar_home.tmpl +++ b/templates/base/head_navbar_home.tmpl @@ -44,7 +44,8 @@ {{/* {{.i18n.Tr "explore.data_analysis"}} */}} {{.i18n.Tr "explore.data_analysis"}} {{end}} - {{.i18n.Tr "custom.head.openi.repo"}} + {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageHome}} @@ -85,6 +86,7 @@ {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageExplore}} diff --git a/templates/base/head_navbar_pro.tmpl b/templates/base/head_navbar_pro.tmpl index 9e1c1ebf7..60f92e5af 100644 --- a/templates/base/head_navbar_pro.tmpl +++ b/templates/base/head_navbar_pro.tmpl @@ -54,7 +54,8 @@ {{/* {{.i18n.Tr "explore.data_analysis"}} */}} {{.i18n.Tr "explore.data_analysis"}} {{end}} - {{.i18n.Tr "custom.head.openi.repo"}} + {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageHome}} @@ -95,6 +96,7 @@ {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} + 2030科技项目 {{else if .IsLandingPageExplore}} diff --git a/templates/tech/admin_view.tmpl b/templates/tech/admin_view.tmpl new file mode 100644 index 000000000..7c236ee3a --- /dev/null +++ b/templates/tech/admin_view.tmpl @@ -0,0 +1,5 @@ +{{template "base/head_home" .}} + +
+ +{{template "base/footer" .}} diff --git a/templates/tech/create.tmpl b/templates/tech/create.tmpl new file mode 100644 index 000000000..952d47a75 --- /dev/null +++ b/templates/tech/create.tmpl @@ -0,0 +1,5 @@ +{{template "base/head_home" .}} + +
+ +{{template "base/footer" .}} diff --git a/templates/tech/repo_view.tmpl b/templates/tech/repo_view.tmpl new file mode 100644 index 000000000..43e808318 --- /dev/null +++ b/templates/tech/repo_view.tmpl @@ -0,0 +1,5 @@ +{{template "base/head_home" .}} + +
+ +{{template "base/footer" .}} diff --git a/templates/tech/tech_view.tmpl b/templates/tech/tech_view.tmpl new file mode 100644 index 000000000..7694e9cfb --- /dev/null +++ b/templates/tech/tech_view.tmpl @@ -0,0 +1,5 @@ +{{template "base/head_home" .}} + +
+ +{{template "base/footer" .}} diff --git a/web_src/vuepages/apis/modules/tech.js b/web_src/vuepages/apis/modules/tech.js new file mode 100644 index 000000000..48dac70b2 --- /dev/null +++ b/web_src/vuepages/apis/modules/tech.js @@ -0,0 +1,153 @@ +/* 科技项目汇聚功能相关 */ +import service from '../service'; + +// 新建申请页面科技项目查询接口 no-项目编号,name-科技项目名称,institution-参与单位 +export const getTechs = (params) => { + return service({ + url: '/api/v1/tech', + method: 'get', + params: params, + }); +} + +// 新建启智项目申请页面提交 url-启智项目地址,no-项目立项编号,institution-贡献单位,多个单位用逗号分隔 +export const setOpenIApply = (data) => { + return service({ + url: '/api/v1/tech/openi', + method: 'post', + data: data, + }); +} + +// 新建启智项目申请页面提交 +// url-启智项目地址,uid-启智项目uid,repo_name-启智项目名称,topics-关键词,description-简介, +// no-项目立项编号,institution-贡献单位,多个单位用逗号分隔 +export const setNoOpenIApply = (data) => { + return service({ + url: '/api/v1/tech/no_openi', + method: 'post', + data: data, + }); +} + +// 新建非启智项目申请页面项目路径可选的用户和组织 +// 返回 [{id:用户ID,name:用户名字,rel_avatar_link:用户图像地址,short_name:用户短名称},...] +export const getCreateRepoUser = () => { + return service({ + url: '/api/v1/create_repo/user', + method: 'get', + params: {}, + }); +} + +// 项目过滤信息列表-筛选信息 type=0查询科技项目页, type=1查询启智项目页 +// 返回 {type_name:项目类型的名称, 字符串数组,institution_name:参与单位的名称,字符串数组,execute_year:执行年份,字符串数组, +// apply_year:申请年份,字符串数组,topic-关键词,字符串数组,project_name:科技项目名称,字符串数组} +export const getTechFilterInfo = (params) => { + return service({ + url: '/api/v1/tech/filter', + method: 'get', + params: { + type: params.type, + }, + }); +} + +// 按科技项目页查询功能 +// 输入 name-科技项目名称,模糊匹配,type_name-项目类型的名称,精确匹配,institution_name-参与单位的名称,精确匹配,execute_year-执行年份,精确匹配,apply_year-申请年份,精确匹配,page,pageSize,sort +// 返回 {"total":10,"data":[{}]} +// data: {id:科技项目id,project_name:科技项目名称,institution:承担单位,all_institution:参与单位,apply_year:申报年份,execute_period:执行周期,repo_numer:项目成果数,repo:[]项目信息数组} +export const getTechSearch = (params) => { + return service({ + url: '/api/v1/tech/search', + method: 'get', + params: params, + }); +} + +// 按启智项目页查询功能 +// 输入 name-项目名称,模糊匹配,tech_name-科技项目名称,精确匹配,institution_name-参与单位的名称,精确匹配,topic-关键词,精确匹配,page,pageSize,sort +// 返回 {"total":10,"data":[{}]} +// data: {id:项目id,owner_id:项目拥有者id,name:项目名称,alias:项目别名,topics:关键词 字符串数组,description:项目简介,updated_unix:最后更新时间,institution:贡献单位} +export const getTechOpenISearch = (params) => { + return service({ + url: '/api/v1/tech/repo_search', + method: 'get', + params: 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 getTechAdminList = (params) => { + return service({ + url: '/api/v1/tech/admin', + method: 'get', + params: params, + }); +} + +// 后台管理项目列表交互(显示或隐藏) +// 输入 type-show/hide,id:[1,2,3] +// 返回 { code:0, message:"" } +export const setTechAdminOperation = (data) => { + return service({ + url: `/api/v1/tech/admin/action/${data.type}`, + method: 'post', + data: data.id, + }); +} + +// 后台管理科技项目编号基本信息导入功能(科技项目管理员有权限) +// 输入 form file +export const setTechImportExcel = () => { + return service({ + url: `/api/v1/tech/basic`, + method: 'post', + data: {}, + }); +} + +// 增加科技项目管理员(管理员才有权限) +// 输入 name:['111', '222'] +// 返回 { code:0, message:"" } +export const setTechAdminAdd = (data) => { + return service({ + url: '/api/v1/tech/admin_add', + method: 'post', + data: data, + }); +} + +// 判断是否是科技项目管理员 +// 输入 name:['111', '222'] +export const getIsTechAdmin = () => { + return service({ + url: '/api/v1/tech/is_admin', + method: 'get', + params: {}, + }); +} + +// ========================================================= +// 搜索Topics q-topic +// 返回 {topics: [{id,repo_count,topic_name,created,updated}]} +export const getTopics = (params) => { + return service({ + url: '/api/v1/topics/search', + method: 'get', + params: params, + }); +} + +// 检测 repo name q:名称, owner:所属者 +export const getCheckRepoName = (params) => { + return service({ + url: '/repo/check_name', + method: 'get', + params: params, + }); +} diff --git a/web_src/vuepages/pages/tech/adminview/index.vue b/web_src/vuepages/pages/tech/adminview/index.vue new file mode 100644 index 000000000..8cd86ae7b --- /dev/null +++ b/web_src/vuepages/pages/tech/adminview/index.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/adminview/vp-tech-adminview.js b/web_src/vuepages/pages/tech/adminview/vp-tech-adminview.js new file mode 100644 index 000000000..48e542500 --- /dev/null +++ b/web_src/vuepages/pages/tech/adminview/vp-tech-adminview.js @@ -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'); diff --git a/web_src/vuepages/pages/tech/components/Filters.vue b/web_src/vuepages/pages/tech/components/Filters.vue new file mode 100644 index 000000000..f9eb010e9 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/Filters.vue @@ -0,0 +1,277 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/PrjResultsItem.vue b/web_src/vuepages/pages/tech/components/PrjResultsItem.vue new file mode 100644 index 000000000..3f507a723 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/PrjResultsItem.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/PrjResultsList.vue b/web_src/vuepages/pages/tech/components/PrjResultsList.vue new file mode 100644 index 000000000..8ec0fcc39 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/PrjResultsList.vue @@ -0,0 +1,888 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/SciAndTechPrjItem.vue b/web_src/vuepages/pages/tech/components/SciAndTechPrjItem.vue new file mode 100644 index 000000000..2e358baf2 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/SciAndTechPrjItem.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/SciAndTechPrjList.vue b/web_src/vuepages/pages/tech/components/SciAndTechPrjList.vue new file mode 100644 index 000000000..e2cb0c7e2 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/SciAndTechPrjList.vue @@ -0,0 +1,885 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/SearchBar.vue b/web_src/vuepages/pages/tech/components/SearchBar.vue new file mode 100644 index 000000000..07d84d8db --- /dev/null +++ b/web_src/vuepages/pages/tech/components/SearchBar.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/TopHeader.vue b/web_src/vuepages/pages/tech/components/TopHeader.vue new file mode 100644 index 000000000..1584af2c0 --- /dev/null +++ b/web_src/vuepages/pages/tech/components/TopHeader.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/components/TopMenu.vue b/web_src/vuepages/pages/tech/components/TopMenu.vue new file mode 100644 index 000000000..aafbe0bac --- /dev/null +++ b/web_src/vuepages/pages/tech/components/TopMenu.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/create/index.vue b/web_src/vuepages/pages/tech/create/index.vue new file mode 100644 index 000000000..089fc7f65 --- /dev/null +++ b/web_src/vuepages/pages/tech/create/index.vue @@ -0,0 +1,470 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/create/vp-tech-create.js b/web_src/vuepages/pages/tech/create/vp-tech-create.js new file mode 100644 index 000000000..48e542500 --- /dev/null +++ b/web_src/vuepages/pages/tech/create/vp-tech-create.js @@ -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'); diff --git a/web_src/vuepages/pages/tech/repoview/index.vue b/web_src/vuepages/pages/tech/repoview/index.vue new file mode 100644 index 000000000..7abc220bb --- /dev/null +++ b/web_src/vuepages/pages/tech/repoview/index.vue @@ -0,0 +1,92 @@ + + + + + + diff --git a/web_src/vuepages/pages/tech/repoview/vp-tech-repoview.js b/web_src/vuepages/pages/tech/repoview/vp-tech-repoview.js new file mode 100644 index 000000000..48e542500 --- /dev/null +++ b/web_src/vuepages/pages/tech/repoview/vp-tech-repoview.js @@ -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'); diff --git a/web_src/vuepages/pages/tech/techview/index.vue b/web_src/vuepages/pages/tech/techview/index.vue new file mode 100644 index 000000000..62e6fdf6e --- /dev/null +++ b/web_src/vuepages/pages/tech/techview/index.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/web_src/vuepages/pages/tech/techview/vp-tech-techview.js b/web_src/vuepages/pages/tech/techview/vp-tech-techview.js new file mode 100644 index 000000000..48e542500 --- /dev/null +++ b/web_src/vuepages/pages/tech/techview/vp-tech-techview.js @@ -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');