Browse Source

科技项目

2023
chenshihai 2 years ago
parent
commit
adf8500563
4 changed files with 54 additions and 19 deletions
  1. +21
    -3
      web_src/vuepages/pages/tech/components/Filters.vue
  2. +2
    -2
      web_src/vuepages/pages/tech/components/SearchBar.vue
  3. +30
    -14
      web_src/vuepages/pages/tech/create/index.vue
  4. +1
    -0
      web_src/vuepages/pages/tech/repoview/index.vue

+ 21
- 3
web_src/vuepages/pages/tech/components/Filters.vue View File

@@ -23,8 +23,13 @@
</span> </span>
</div> </div>
<div class="filter-title">{{ secondData.title }}</div> <div class="filter-title">{{ secondData.title }}</div>
<div class="filter-search">
<el-input placeholder="搜索" prefix-icon="el-icon-search" v-model="searchKeyword" clearable
@input="searchFilterItem">
</el-input>
</div>
<div class="filter-item-c"> <div class="filter-item-c">
<div class="filter-item" v-for="(_item, _index) in secondData.data" @click="changeFilter(secondData, _item)"
<div class="filter-item" v-for="(_item, _index) in secondData.showData" @click="changeFilter(secondData, _item)"
:style="conds[secondData.key] == _item ? { backgroundColor: secondData.focusBgColor, color: secondData.focusColor } : { backgroundColor: secondData.bgColor, color: secondData.color }"> :style="conds[secondData.key] == _item ? { backgroundColor: secondData.focusBgColor, color: secondData.focusColor } : { backgroundColor: secondData.bgColor, color: secondData.color }">
{{ _item }} {{ _item }}
</div> </div>
@@ -105,7 +110,7 @@ export default {
focusColor: 'rgb(255, 255, 255)', focusColor: 'rgb(255, 255, 255)',
data: [], data: [],
showData: [], showData: [],
showMaxLen: 10,
showMaxLen: 8,
}, { }, {
title: '成果贡献单位', title: '成果贡献单位',
key: 'institution_name', key: 'institution_name',
@@ -130,11 +135,14 @@ export default {
mainData: [], mainData: [],
showSecond: false, showSecond: false,
secondData: {}, secondData: {},
searchKeyword: '',
}; };
}, },
methods: { methods: {
goMore(item) { goMore(item) {
this.secondData = item; this.secondData = item;
this.searchKeyword = '';
this.secondData.showData = item.data;
this.showSecond = true; this.showSecond = true;
}, },
goBack() { goBack() {
@@ -145,7 +153,13 @@ export default {
this.$emit('changeCondition', { this.$emit('changeCondition', {
[item.key]: value [item.key]: value
}); });
}
},
searchFilterItem() {
const keyword = this.searchKeyword.trim().toLocaleLowerCase();
this.secondData.showData = this.secondData.data.filter(item => {
return item.toString().toLocaleLowerCase().indexOf(keyword) >= 0;
});
},
}, },
watch: { watch: {
condition: { condition: {
@@ -253,6 +267,10 @@ export default {
margin: 14px 0; margin: 14px 0;
} }


.filter-search {
margin: 5px 10px 10px 0;
}

.filter-item-c { .filter-item-c {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;


+ 2
- 2
web_src/vuepages/pages/tech/components/SearchBar.vue View File

@@ -7,7 +7,7 @@
</div> </div>
<div class="search-btn" @click="search">{{ $t('repos.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>
<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>
@@ -90,7 +90,7 @@ export default {
this.sortList = this.techSortList; this.sortList = this.techSortList;
this.serchPlaceHolder = '搜索科技项目名称'; this.serchPlaceHolder = '搜索科技项目名称';
} else if (this.type == 1) { } else if (this.type == 1) {
this.serchPlaceHolder = '搜索项目名称/简介/标签';
this.serchPlaceHolder = '搜索项目';
this.sortList = this.repoSortList; this.sortList = this.repoSortList;
} }
}, },


+ 30
- 14
web_src/vuepages/pages/tech/create/index.vue View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<TopHeader :menu="-1"></TopHeader>
<TopHeader :menu="''"></TopHeader>
<div class="ui container"> <div class="ui container">
<div class="title">您申请的项目将在2030科技项目页面展示</div> <div class="title">您申请的项目将在2030科技项目页面展示</div>
<div class="form-c" v-show="!selectTechPrj"> <div class="form-c" v-show="!selectTechPrj">
@@ -56,22 +56,22 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-row">
<div class="row-label">关键词</div>
<div class="form-row" :class="form.topic_err ? 'form-row-err' : ''">
<div class="row-label required">关键词</div>
<div class="row-content"> <div class="row-content">
<el-select style="width:100%" size="medium" v-model="form.topics" multiple filterable remote <el-select style="width:100%" size="medium" v-model="form.topics" multiple filterable remote
allow-create default-first-option placeholder="请选择标签" :remote-method="searchTopics" allow-create default-first-option placeholder="请选择标签" :remote-method="searchTopics"
:loading="form.topicLoading">
:loading="form.topicLoading" class="can-err">
<el-option v-for="item in topicsList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in topicsList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="form-row">
<div class="row-label baseline">项目简介</div>
<div class="form-row" :class="form.descr_err ? 'form-row-err' : ''">
<div class="row-label required baseline">项目简介</div>
<div class="row-content"> <div class="row-content">
<el-input size="medium" type="textarea" :rows="3" placeholder="请输入项目简介(长度不超过255)" :maxLength="255"
v-model="form.description"></el-input>
<el-input size="medium" type="textarea" :rows="4" placeholder="请输入项目简介(长度不超过255)" :maxlength="255"
show-word-limit v-model="form.description" class="can-err"></el-input>
</div> </div>
</div> </div>
</div> </div>
@@ -168,8 +168,11 @@ export default {
name_err: false, name_err: false,
repo_url: '', repo_url: '',
topics: [], topics: [],
topic_err: false,
topicLoading: false, topicLoading: false,

description: '', description: '',
descr_err: false,


tech_search_sel: '0', tech_search_sel: '0',
tech_search_keyword: '', tech_search_keyword: '',
@@ -206,8 +209,10 @@ export default {
this.form.repo_url = ''; this.form.repo_url = '';
this.form.name_err = false; this.form.name_err = false;
this.form.topics = []; this.form.topics = [];
this.form.topic_err = false;
this.form.topicLoading = false; this.form.topicLoading = false;
this.form.description = ''; this.form.description = '';
this.form.descr_err = false;
this.form.tech_search_sel = '0'; this.form.tech_search_sel = '0';
this.form.tech_search_keyword = ''; this.form.tech_search_keyword = '';
this.form.tech_obj = null; this.form.tech_obj = null;
@@ -239,6 +244,14 @@ export default {
this.form.name_err = !res; this.form.name_err = !res;
return res; return res;
}, },
checkTopic() {
this.form.topic_err = this.form.topics.length == 0;
return !this.form.topic_err;
},
checkDescr() {
this.form.descr_err = !this.form.description;
return !this.form.descr_err;
},
checkTech() { checkTech() {
this.form.tech_err = !this.form.tech_obj; this.form.tech_err = !this.form.tech_obj;
return !this.form.tech_err; return !this.form.tech_err;
@@ -385,13 +398,15 @@ export default {
const r3 = this.checkinstitution(); const r3 = this.checkinstitution();
const r4 = this.checkRepoAlias(); const r4 = this.checkRepoAlias();
const r5 = this.checkRepoName(); const r5 = this.checkRepoName();
if (r1 && r2 && r3 && r4 && r5) {
const r6 = this.checkTopic();
const r7 = this.checkDescr();
if (r1 && r2 && r3 && r4 && r5 && r6 && r7) {
subData.url = this.form.url; subData.url = this.form.url;
subData.uid = this.form.uid; subData.uid = this.form.uid;
subData.repo_alias = this.form.repo_alias;
subData.alias = this.form.repo_alias;
subData.repo_name = this.form.repo_name; subData.repo_name = this.form.repo_name;
subData.topics = [...this.form.topics];
subData.description = this.form.description;
// subData.topics = [...this.form.topics];
subData.description = this.form.description.trim();
subData.no = this.form.tech_obj.no; subData.no = this.form.tech_obj.no;
subData.institution = this.form.institution.join(','); subData.institution = this.form.institution.join(',');
} else { } else {
@@ -409,7 +424,7 @@ export default {
}); });
setTimeout(() => { setTimeout(() => {
window.location.href = '/tech/tech_view'; window.location.href = '/tech/tech_view';
}, 2000);
}, 1000);
} else { } else {
this.submitLoading = false; this.submitLoading = false;
this.$message({ this.$message({
@@ -544,7 +559,8 @@ export default {
color: #9f3a38; color: #9f3a38;
} }


/deep/ .can-err .el-input__inner {
/deep/ .can-err .el-input__inner,
/deep/ .can-err .el-textarea__inner {
color: #9f3a38; color: #9f3a38;
background: #fff6f6; background: #fff6f6;
border-color: #e0b4b4; border-color: #e0b4b4;


+ 1
- 0
web_src/vuepages/pages/tech/repoview/index.vue View File

@@ -94,6 +94,7 @@ export default {
.result-c { .result-c {
margin-left: 10px; margin-left: 10px;
flex: 3; flex: 3;
width: 0;
} }
</style> </style>



Loading…
Cancel
Save