Browse Source

分类管理,设备,成果

master
ma 4 years ago
parent
commit
159ddff33e
  1. 95
      src/components/Development/DevelopmentDate.vue
  2. 2
      src/components/Development/DevelopmentSearch.vue
  3. 1
      src/components/Manage/ManageDate.vue
  4. 1
      src/components/Manage/ManageSearch.vue
  5. 124
      src/components/Transfer/TransferDate.vue
  6. 2
      src/components/Transfer/TransferSearch.vue
  7. 16
      src/config/api.js
  8. 54
      src/views/InnovativeAchievements/InnovativeAchievements.vue
  9. 54
      src/views/InnovativeEquipment/InnovativeEquipment.vue

95
src/components/Development/DevelopmentDate.vue

@ -6,6 +6,7 @@
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
@ -13,6 +14,11 @@
<span>{{ index + 1 }}</span>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" width="50" height="50">
</template>
<!-- 说明图片 -->
<template slot="introductionPicture" slot-scope="text, record">
<img :src="record.introductionPicture" class="img" />
@ -38,6 +44,7 @@
<script>
import DevelopmentEdit from "components/Development/DevelopmentEdit.vue";
import { selResDelete } from 'config/api';
const columns = [
{
@ -49,17 +56,23 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '名录',
title: '编号',
align: 'center',
dataIndex: 'identifier',
key: 'identifier',
},
{
title: '成果名称',
align: 'center',
dataIndex: 'directory',
key: 'directory',
dataIndex: 'name',
key: 'name',
},
{
title: '介绍图片',
title: '图片',
align: 'center',
dataIndex: 'introductionPicture',
key: 'introductionPicture',
scopedSlots: { customRender: 'introductionPicture' },
dataIndex: 'visitLocation',
key: 'visitLocation',
scopedSlots: { customRender: 'visitLocation' },
},
{
title: '编辑',
@ -70,29 +83,30 @@ const columns = [
},
];
const lists = [
{
id:'001',
directory:'传控科技',
introductionPicture:'assets/logo.png',
},
{
id:'002',
directory:'中绿环保',
introductionPicture:'assets/logo.png',
}
];
// const lists = [
// {
// id:'001',
// directory:'',
// introductionPicture:'assets/logo.png',
// },
// {
// id:'002',
// directory:'绿',
// introductionPicture:'assets/logo.png',
// }
// ];
export default {
name: "DevelopmentDate",
components: {
DevelopmentEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
return {
columns,
lists,
loading: false,
height: '',
editVisible: false,
@ -101,7 +115,15 @@ export default {
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150;
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
@ -109,24 +131,27 @@ export default {
this.editVisible = true;
},
closeModal(){
async closeModal(){
this.editVisible = false;
await this.$emit('selResSearch');
},
//
async onDelete(teamId) {
async onDelete(id) {
console.log(id);
try {
const params = { param: { teamId } };
// const res = await delTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.$message.success('');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// // TODO:
// } else {
// throw msg;
// }
const params = { param: { id } };
const res = await selResDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selResSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}

2
src/components/Development/DevelopmentSearch.vue

@ -4,7 +4,7 @@
<div>
<a-input
@change="handleChangeDirectory"
placeholder="名录"
placeholder="内容"
style="width: 150px"
v-model="directory"
/>

1
src/components/Manage/ManageDate.vue

@ -18,6 +18,7 @@
<template slot="model" slot-scope="text, record">
<span v-if=" record.model === 0">成果</span>
<span v-if=" record.model === 1">仪器</span>
<span v-if=" record.model === 2">实验室</span>
</template>
<template slot="edit" slot-scope="text, record">

1
src/components/Manage/ManageSearch.vue

@ -50,6 +50,7 @@ export default {
models: [
{ id:0, value:'成果' },
{ id:1, value:'仪器' },
{ id:2, value:'实验室' },
],
}
},

124
src/components/Transfer/TransferDate.vue

@ -6,6 +6,7 @@
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
@ -23,6 +24,11 @@
<a-button @click="openCategoryManage" size="small" type="primary">成果分类管理</a-button>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" width="50" height="50">
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
@ -30,7 +36,7 @@
</a-popconfirm>
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<!-- <div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div class="d-flex flex-nowrap justify-space-between">
<div>关键词{{ record.keyWord }}</div>
<div class="ml-3">转让形式{{ record.formOfTransfer }}</div>
@ -48,7 +54,7 @@
<div class="ml-3">软件著作权名称{{ record.patentStatus }}</div>
<div class="ml-3">成果关键性能指标简介{{ record.researchForm }}</div>
</div>
</div>
</div> -->
</a-table>
</div>
<a-empty v-else />
@ -60,6 +66,7 @@
<script>
import TransferEdit from "components/Transfer/TransferEdit.vue";
import { selInstrumentDelete } from 'config/api';
const columns = [
{
@ -71,37 +78,37 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '成果名称',
align: 'center',
dataIndex: 'achievementName',
key: 'achievementName',
},
{
title: '成果所处阶段',
title: '编号',
align: 'center',
dataIndex: 'achievementStage',
key: 'achievementStage',
dataIndex: 'identifier',
key: 'identifier',
},
{
title: '成果水平',
title: '仪器名称',
align: 'center',
dataIndex: 'achievementLevel',
key: 'achievementLevel',
dataIndex: 'name',
key: 'name',
},
{
title: '学科分类',
title: '仪器英文名称',
align: 'center',
dataIndex: 'subjectClassification',
key: 'subjectClassification',
scopedSlots: { customRender: 'subjectClassification' },
dataIndex: 'englishname',
key: 'englishname',
},
{
title: '成果分类管理',
title: '图片路径',
align: 'center',
dataIndex: 'achievementCategoryManage',
key: 'achievementCategoryManage',
scopedSlots: { customRender: 'achievementCategoryManage' },
dataIndex: 'visitLocation',
key: 'visitLocation',
scopedSlots: { customRender: 'visitLocation' },
},
// {
// title: '',
// align: 'center',
// dataIndex: 'achievementCategoryManage',
// key: 'achievementCategoryManage',
// scopedSlots: { customRender: 'achievementCategoryManage' },
// },
{
title: '编辑',
align: 'center',
@ -111,47 +118,18 @@ const columns = [
},
];
const lists = [
{
id:'001',
achievementName:'传控科技',
achievementStage: '初期',
achievementLevel:'中',
subjectClassification: '软硬件',
keyWord:'传控',
formOfTransfer:'转让形式',
scopeOfTransfer:'转让范围',
researchForm:'研究形式',
field:'软硬件',
intellectualProperty:'知识产权形式',
patentStatus: '专利状况',
},
{
id:'002',
achievementName:'中绿环保',
achievementStage: '中期',
achievementLevel:'高',
subjectClassification: '软硬件',
keyWord:'传控',
formOfTransfer:'转让形式',
scopeOfTransfer:'转让范围',
researchForm:'研究形式',
field:'软硬件',
intellectualProperty:'知识产权形式',
patentStatus: '专利状况',
}
];
export default {
name: "TransferDate",
components: {
TransferEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
return {
columns,
lists,
loading: false,
editingKey: '',
height: '',
@ -161,7 +139,15 @@ export default {
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150;
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
@ -169,8 +155,9 @@ export default {
this.editVisible = true;
},
closeModal(){
async closeModal(){
this.editVisible = false;
await this.$emit('selInstrumentSearch');
},
//
@ -186,19 +173,20 @@ export default {
},
//
async onDelete(teamId) {
async onDelete(id) {
try {
const params = { param: { teamId } };
// const res = await delTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.$message.success('');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// // TODO:
// } else {
// throw msg;
// }
const params = { param: { id } };
const res = await selInstrumentDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selInstrumentSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}

2
src/components/Transfer/TransferSearch.vue

@ -4,7 +4,7 @@
<div>
<a-input
@change="handleChangeAchievementName"
placeholder="成果名称"
placeholder="分类"
style="width: 150px"
v-model="achievementName"
/>

16
src/config/api.js

@ -15,7 +15,7 @@ const activity = `${greenvalley}/activity`; // 活动公告相关操作
const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相关操作
const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关操作
const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型、仪器、成果相关操作
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -95,9 +95,21 @@ export const deleteInstitute = params => axios.post(`${institute}/instituteDelet
// 创新部类型列表查询
export const selModelSearch = params => axios.post(`${achInstr}/selModel`, params);
// 创新部类型列表查询
// 创新部类型删除
export const selModelDelete = params => axios.post(`${achInstr}/deleteModel`, params);
// 创新部仪器列表查询
export const selInstrumentSearch = params => axios.post(`${achInstr}/selInstrument`, params);
// 创新部仪器删除
export const selInstrumentDelete = params => axios.post(`${achInstr}/deleteInstrument`, params);
// 创新部成果列表查询
export const selResSearch = params => axios.post(`${achInstr}/selRes`, params);
// 创新部成果删除
export const selResDelete = params => axios.post(`${achInstr}/deleteRes`, params);
// 查询所有的研发团队相关信息
export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);

54
src/views/InnovativeAchievements/InnovativeAchievements.vue

@ -1,19 +1,67 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<development-search />
<development-date />
<development-search @selResSearch="selResSearch" />
<development-date :lists="lists" :pagination="pagination" @selResSearch="selResSearch" />
</div>
</template>
<script>
import DevelopmentSearch from "components/Development/DevelopmentSearch.vue";
import DevelopmentDate from "components/Development/DevelopmentDate.vue";
import { selResSearch } from 'config/api';
export default {
name: "ResourceDevelopment",
components: {
DevelopmentSearch,
DevelopmentDate,
}
},
data(){
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.selResSearch();
},
methods: {
async selResSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.content) {
params.param.content = condition.content;
}
if (condition.modelIds) {
params.param.modelIds = condition.modelIds;
}
}
const res = await selResSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data.list;
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>

54
src/views/InnovativeEquipment/InnovativeEquipment.vue

@ -1,19 +1,67 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<transfer-search />
<transfer-date />
<transfer-search @selInstrumentSearch="selInstrumentSearch" />
<transfer-date :lists="lists" :pagination="pagination" @selInstrumentSearch="selInstrumentSearch" />
</div>
</template>
<script>
import TransferSearch from "components/Transfer/TransferSearch.vue";
import TransferDate from "components/Transfer/TransferDate.vue";
import { selInstrumentSearch } from 'config/api';
export default {
name: "TechnologyTransfer",
components: {
TransferSearch,
TransferDate,
}
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.selInstrumentSearch();
},
methods: {
async selInstrumentSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if (condition) {
if (condition.content) {
params.param.content = condition.content;
}
if (condition.modelIds) {
params.param.modelIds = condition.modelIds;
}
}
const res = await selInstrumentSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data.list;
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>

Loading…
Cancel
Save