Browse Source

修复部分bug

master
rose 4 years ago
parent
commit
bf7e641f46
  1. 12
      src/App.vue
  2. 1
      src/components/BtnCom/BtnCon.vue
  3. 227
      src/components/Contact/ContactDate.vue
  4. 49
      src/components/Contact/ContactUsSearch.vue
  5. 31
      src/components/Policy/PolicyDate.vue
  6. 24
      src/components/innovativeService/innovativeServiceDate.vue
  7. 21
      src/components/innovativeService/innovativeServiceEdit.vue
  8. 8
      src/config/api.js
  9. 7
      src/router/index.js
  10. 69
      src/views/ContactUs/ContactUs.vue

12
src/App.vue

@ -8,7 +8,7 @@
<template>
<a-config-provider :locale="zh_CN">
<div class="d-flex flex-row flex-nowrap" id="app">
<!-- <btn-con /> -->
<btn-con />
<router-view class="flex-1 bg pa-3"></router-view>
</div>
</a-config-provider>
@ -17,11 +17,11 @@
<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
// import BtnCon from 'components/BtnCom/BtnCon.vue';
import BtnCon from 'components/BtnCom/BtnCon.vue';
export default {
name: 'App',
// components: { BtnCon },
components: { BtnCon },
data() {
return { zh_CN };
},
@ -40,9 +40,9 @@ export default {
created() {
//
// const userId = '1218763410024566784';
// const params = { userId };
// this.getUserId(params);
const userId = '1218763410024566784';
const params = { userId };
this.getUserId(params);
const that = this;
window.plugin = window.TallPlugin.init();

1
src/components/BtnCom/BtnCon.vue

@ -21,6 +21,7 @@
<!-- <div @click="jump('/talent-recruitment')" class="btn">人才招聘</div> -->
<div @click="jump('/cooperative-partner')" class="btn">合作伙伴</div>
<!-- <div @click="jump('/about-us-derivative-enterprise')" class="btn">衍生企业</div> -->
<div @click="jump('/contact-us-derivative-enterprise')" class="btn">联系我们</div>
<!-- <div class="font-bold-24">创新研究院</div> -->
<!-- <div @click="jump('/cooperation-intention')" class="btn">合作意向</div> -->

227
src/components/Contact/ContactDate.vue

@ -0,0 +1,227 @@
<template>
<div class="main flex-1">
<div>是否显示了</div>
<a-spin :spinning="showEdit">
<div style="width:100%" v-if="lists && lists.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:loading="loading"
:pagination="pagination"
:row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
@expand="getDetail"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" height="50" width="50" />
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm
@confirm="() => onDelete(record.id)"
title="确定要删除这一条?"
v-if="lists.length"
>
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
</a-table>
</div>
<a-empty v-else />
<!-- <div>{{ editItem }}</div> -->
<!-- 编辑 -->
<transfer-edit
:editItem="editItem"
:editVisible="editVisible"
:typeLists="typeLists"
@closeModal="closeModal"
@selInstrumentSearch="selInstrumentSearch"
/>
</a-spin>
</div>
</template>
<script>
import TransferEdit from 'components/Transfer/TransferEdit.vue';
import { selInstrumentDelete, selInstrumentMes } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '现居住地',
align: 'center',
dataIndex: 'residence',
key: 'residence',
},
{
title: '出生年月',
align: 'center',
dataIndex: 'birth',
key: 'birth',
},
{
title: '户口所在地',
align: 'center',
dataIndex: 'account',
key: 'account',
},
{
title: '教育经历',
align: 'center',
dataIndex: 'eduExperience',
key: 'eduExperience',
scopedSlots: { customRender: 'eduExperienchukz' },
},
{
title: '电子邮件',
align: 'center',
dataIndex: 'email',
key: 'email',
scopedSlots: { customRender: 'email' },
},
{
title: '工作经历',
align: 'center',
dataIndex: 'workExperience',
key: 'workExperience',
scopedSlots: { customRender: 'workExperience' },
},
{
title: '求职意向',
align: 'center',
dataIndex: 'jobIntension',
key: 'jobIntension',
scopedSlots: { customRender: 'jobIntension' },
},
];
export default {
name: 'TransferDate',
components: {
TransferEdit,
},
props: {
lists: { type: Array, default: () => [] },
pagination: { type: Object, default: () => {} },
typeLists: { type: Array, default: () => [] },
},
data() {
return {
columns,
loading: false,
height: '',
editVisible: false,
imgVisible: false,
spinning: false,
editItem: null, //
showEdit: false,
};
},
mounted() {
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
async showEditModal(record) {
console.log(record)
this.showEdit = true;
await this.getDetail(true, record);
this.showEdit = false;
this.editVisible = true;
this.editItem = record;
console.log('==============>showEditModal结束')
},
closeModal() {
this.editVisible = false;
},
async selInstrumentSearch() {
await this.$emit('selInstrumentSearch');
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('selInstrumentSearch', condition);
},
//
async getDetail(expanded, record) {
if (!expanded) return;
try {
this.spinning = true;
const params = { param: { id: record.id } };
const res = await selInstrumentMes(params);
const { data, msg, code } = res.data;
this.spinning = false;
if (code === 200) {
const item = this.lists.find(item => item.id === record.id);
item.info = data;
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '查询失败');
}
},
//
async onDelete(id) {
try {
const params = { param: { id } };
const res = await selInstrumentDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selInstrumentSearch');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
},
};
</script>
<style lang="stylus" scoped>
.main .img {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

49
src/components/Contact/ContactUsSearch.vue

@ -0,0 +1,49 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 中文名称 -->
<div>
<a-input placeholder="设备名称" style="width: 150px" v-model="content" />
<a-checkbox-group @change="onChange" class="ml-3">
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists.list">{{ item.name }}</a-checkbox>
</a-checkbox-group>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1">121231233</div>
</div>
</template>
<script>
export default {
name: 'ContactUsSearch',
props: { typeLists: { type: Array, default: () => [] } },
data() {
return {
content: '',
modelIds: [],
};
},
methods: {
onChange(checkedValues) {
this.modelIds = checkedValues;
},
async handleTableChange() {
const { content, modelIds } = this;
//
const condition = {
content,
modelIds,
};
await this.$emit('selInstrumentSearch', condition);
},
},
};
</script>
<style scoped lang="stylus"></style>

31
src/components/Policy/PolicyDate.vue

@ -46,6 +46,9 @@
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
<div class="d-flex flex-column" slot="expandedRowRender" slot-scope="record" style="margin: 0">
@ -70,13 +73,13 @@
<a-empty v-else />
<!-- 编辑 -->
<policy-edit :editItem="editItem" :editVisible="editVisible" @closeModal="closeModal" @getSelectTeam="getSelectTeam" />
<policy-edit :edit-item="editItem" :edit-visible="editVisible" @closeModal="closeModal" @getSelectTeam="getSelectTeam" />
</div>
</template>
<script>
import PolicyEdit from 'components/Policy/PolicyEdit.vue';
import { upPolicy } from 'config/api';
import { upPolicy,deletePolicy } from 'config/api';
const columns = [
{
@ -133,11 +136,9 @@ const columns = [
export default {
name: 'PolicyDate',
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
components: {
PolicyEdit,
},
components: {PolicyEdit,},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
return {
columns,
@ -169,6 +170,24 @@ export default {
},
methods: {
async onDelete(id) {
try {
const params = { param: { id } };
const res = await deletePolicy(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
await this.$emit('getSelectTeam');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
//
onSelectChange(selectedRowKeys) {
console.log('selectedRowKeys changed: ', selectedRowKeys);

24
src/components/innovativeService/innovativeServiceDate.vue

@ -20,11 +20,11 @@
<img :src="record.picUrl" height="50" width="50" />
</template>
<template slot="serviceType" slot-scope="text, record">
<!-- <template slot="serviceType" slot-scope="text, record">
<span v-if="record.serviceType === 1">创新平台</span>
<span v-if="record.serviceType === 2">孵化平台</span>
<span v-if="record.serviceType === 3">产业平台</span>
</template>
</template> -->
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
@ -88,13 +88,13 @@ const columns = [
key: 'picUrl',
scopedSlots: { customRender: 'picUrl' },
},
{
title: '服务类型',
align: 'center',
dataIndex: 'serviceType',
key: 'serviceType',
scopedSlots: { customRender: 'serviceType' },
},
// {
// title: '',
// align: 'center',
// dataIndex: 'serviceType',
// key: 'serviceType',
// scopedSlots: { customRender: 'serviceType' },
// },
{
title: '服务排序',
align: 'center',
@ -112,10 +112,8 @@ const columns = [
];
export default {
name: 'innovativeServiceDate',
components: {
RDMemberEdit,
},
name: 'InnovativeServiceDate',
components: {RDMemberEdit,},
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },

21
src/components/innovativeService/innovativeServiceEdit.vue

@ -1,6 +1,7 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal
:mask-closable="false"
@cancel="$emit('closeModal')"
@ -49,6 +50,13 @@
:wrapper-col="formItemLayout.wrapperCol"
label="图片"
>
<div v-if="editData.picUrl" class="d-flex align-end">
<img :src="editData.picUrl" style="height:100px;" alt="">
<div>
<a-icon @click="deleteFileList" class="ml-5" type="close-circle" />
</div>
</div>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@ -136,9 +144,22 @@ export default {
watch: {
editData(val) {
console.log(val);
this.serviceName = val.name
this.intro = val.intro
this.orders = val.orders
this.fileList.push(val.picUrl)
},
},
methods: {
// fileList
deleteFileList(){
console.log("进入事件")
this.fileList = []
this.editData.picUrl = ''
},
//
handleChange(info) {
// this.fileList = fileList;

8
src/config/api.js

@ -24,6 +24,8 @@ const business = `${greenvalley}/business`; // 交流社区相关操作
const academy = `${greenvalley}/academy`; // 创业学院相关操作
const releaseTheList = `${greenvalley}/releaseTheList`; // 创业学院相关操作
const tutorRelated = `${greenvalley}/tutorRelated`; // 导师相关操作
const personApply = `${greenvalley}/PersonApply`; // 加入我们相关操作
export const upload = `${greenvalley}/file/upload`;
// websocket基础地址
@ -92,6 +94,9 @@ export const upPolicy = params => axios.post(`${policy}/policy/upPolicy`, params
// 增加/修改一条政策
export const addPolicy = params => axios.post(`${policy}/policy/addPolicy`, params);
// 删除一条政策
export const deletePolicy = params => axios.post(`${policy}/policy/deletePolicy`, params);
// 发帖查询
export const selCommentH = params => axios.post(`${comment}/selCommentH`, params);
@ -325,3 +330,6 @@ export const upTutorH = params => axios.post(`${tutorRelated}/upTutorH`, params)
// 删除导师类型
export const delTutorH = params => axios.post(`${tutorRelated}/delTutorH`, params);
// 后台查询修改
export const contactUsSearch = params => axios.post(`${personApply}/SearchJoinUs`, params);

7
src/router/index.js

@ -164,6 +164,13 @@ const routes = [
path: '/industrial-services',
name: 'IndustrialServices',
component: () => import(/* webpackChunkName: "industrial-services" */ 'views/IndustrialServices/IndustrialServices.vue'),
},
// 联系我们
{
path: '/contact-us-derivative-enterprise',
name: 'ContactUs',
component: () =>
import(/* webpackChunkName: "ContactUs" */ 'views/ContactUs/ContactUs.vue'),
},
// 衍生企业
{

69
src/views/ContactUs/ContactUs.vue

@ -0,0 +1,69 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<contact-us-search :type-lists="typeLists" @contactUsSearch="contactUsSearch" />
<contact-us-date :lists="lists" :pagination="pagination" @contactUsSearch="contactUsSearch" />
</div>
</template>
<script>
import ContactUsSearch from 'components/Contact/ContactUsSearch.vue';
import ContactUsDate from 'components/Contact/ContactDate.vue';
import { contactUsSearch } from 'config/api';
import { mapActions } from 'vuex';
export default {
name: 'Contact',
components: {
ContactUsSearch,
ContactUsDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
typeLists: [],
};
},
async created() {
await this.contactUsSearch();
},
methods: {
...mapActions(['getSelModelSearch']),
/**
* 后台查询修改
*
*/
async contactUsSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
const res = await contactUsSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data.list;
console.log("========>是否获取到数据")
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