Browse Source

完善功能

master
lucky 4 years ago
parent
commit
df564fd0af
  1. 162
      package-lock.json
  2. 4
      src/components/BtnCom/BtnCon.vue
  3. 144
      src/components/EntityApply/EntityApplySearch.vue
  4. 281
      src/components/Innovative/InnovativeAdd.vue
  5. 220
      src/components/Innovative/InnovativeDate.vue
  6. 315
      src/components/Innovative/InnovativeEdit.vue
  7. 66
      src/components/Innovative/InnovativeSearch.vue
  8. 76
      src/config/api.js
  9. 6
      src/plugins/ant-design-vue.js
  10. 31
      src/router/index.js
  11. 86
      src/views/Challenge/Challenge.vue
  12. 278
      src/views/Challenge/components/ChallengeAdd.vue
  13. 225
      src/views/Challenge/components/ChallengeDate.vue
  14. 321
      src/views/Challenge/components/ChallengeEdit.vue
  15. 104
      src/views/Challenge/components/ChallengeSearch.vue
  16. 44
      src/views/Challenge/components/UnveSearch.vue
  17. 251
      src/views/Challenge/components/UnveilingDate.vue
  18. 6
      src/views/EntityApplication/VirtualApplication.vue
  19. 107
      src/views/IncubationProject/IncubationProject.vue
  20. 7
      src/views/InnovativeEquipment/InnovativeEquipment.vue
  21. 711
      src/views/Teacher/Teacher.vue
  22. 355
      src/views/TeacherType/TeacherType.vue

162
package-lock.json

@ -1808,16 +1808,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1594427999421&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
@ -1850,34 +1840,6 @@
"integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=",
"dev": true
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"css-loader": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/css-loader/download/css-loader-3.6.0.tgz?cache=0&sync_timestamp=1604507107408&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-loader%2Fdownload%2Fcss-loader-3.6.0.tgz",
@ -1931,13 +1893,6 @@
"universalify": "^0.1.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"icss-utils": {
"version": "4.1.1",
"resolved": "https://registry.npm.taobao.org/icss-utils/download/icss-utils-4.1.1.tgz?cache=0&sync_timestamp=1602527330977&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficss-utils%2Fdownload%2Ficss-utils-4.1.1.tgz",
@ -2052,16 +2007,6 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1603881757308&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz",
@ -2078,32 +2023,6 @@
"terser": "^4.6.12",
"webpack-sources": "^1.4.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.2.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
"integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
}
}
}
}
},
@ -12661,6 +12580,87 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.2.0",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.2.0.tgz",
"integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
"integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.1",
"resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995384030&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
"integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1618559697170&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
"integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1622293670728&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
"integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-quill-editor": {
"version": "3.0.6",
"resolved": "https://registry.npm.taobao.org/vue-quill-editor/download/vue-quill-editor-3.0.6.tgz",

4
src/components/BtnCom/BtnCon.vue

@ -22,6 +22,9 @@
<div @click="jump('/category-manage')" class="btn">分类管理</div>
<div @click="jump('/innovative-equipment')" class="btn">设备</div>
<div @click="jump('/innovative-achievements')" class="btn">成果</div>
<div @click="jump('/challenge')" class="btn">需求征集</div>
<div @click="jump('/teacher')" class="btn">人才信息</div>
<div @click="jump('/teacher-type')" class="btn">人才分类</div>
<div class="font-bold-24">孵化部</div>
<div @click="jump('/entity-application')" class="btn">入驻实体申请</div>
@ -29,6 +32,7 @@
<div @click="jump('/incubation-services')" class="btn">服务</div>
<div @click="jump('/hatching-demand-filling')" class="btn">需求填报</div>
<div @click="jump('/hatch-cooperative-partner')" class="btn">合作伙伴</div>
<div @click="jump('/incubation-project')" class="btn">产品展示</div>
<div class="font-bold-24">产业部</div>
<div @click="jump('/industrial-services')" class="btn">服务</div>

144
src/components/EntityApply/EntityApplySearch.vue

@ -5,10 +5,22 @@
<a-input class="mr-3" placeholder="职务" style="width: 150px" v-model="position" />
<a-input class="mr-3" placeholder="联系电话" style="width: 150px" v-model="phone" />
<a-input class="mr-3" placeholder="企业/团队" style="width: 150px" v-model="company" />
<a-select @change="handleChangeSelect('dealStatus', $event)" allow-clear class="ml-3" placeholder="处理状态" style="width: 150px">
<a-select-option :key="dealStatus.id" :value="dealStatus.id" v-for="dealStatus in dealStatuss">{{
<a-select
@change="handleChangeSelect('dealStatus', $event)"
allow-clear
class="ml-3"
placeholder="处理状态"
style="width: 150px"
>
<a-select-option
:key="dealStatus.id"
:value="dealStatus.id"
v-for="dealStatus in dealStatuss"
>
{{
dealStatus.value
}}</a-select-option>
}}
</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" icon="search" type="primary">搜索</a-button>
@ -17,18 +29,76 @@
<!-- <a-button @click="showModal" class="editable-add-btn mb-3" type="primary">增加</a-button> -->
<!-- 添加 -->
<a-button @click="exportVisible = true" class="mx-2" type="primary">下载报表</a-button>
<entity-apply-add :visible="visible" @closeModal="closeModal" @getData="getData" />
<!-- 导出报表 -->
<a-modal
:confirm-loading="confirmLoading"
:visible="exportVisible"
@cancel="handleCancel"
@ok="handleOk"
title="导出报表"
>
<a-form :form="form">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="时间"
required
>
<a-date-picker
:open="yearShowOne"
@openChange="openChangeOne"
@panelChange="panelChangeOne"
format="YYYY"
mode="year"
placeholder="请选择年份"
v-model="platform.time"
/>
</a-form-item>
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="季度"
required
>
<a-select @select="onSelectQuarter" placeholder="请选择季度">
<a-select-option
:key="quarter.id"
:value="quarter.id"
v-for="quarter in quarters"
>{{ quarter.value }}</a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { handleExport } from 'config/api';
import EntityApplyAdd from 'components/EntityApply/EntityApplyAdd.vue';
import { mapState } from 'vuex';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
export default {
name: 'EntityApplySearch',
components: {EntityApplyAdd,},
components: { EntityApplyAdd },
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
formItemLayout,
formTailLayout,
visible: false,
name: '',
position: '',
@ -38,10 +108,23 @@ export default {
{ id: 1, value: '审核未通过' },
{ id: 2, value: '审核通过' },
],
exportVisible: false,
confirmLoading: false,
platform: {
time: null, //
quarter: '', //
},
yearShowOne: false,
quarters: [
{ id: 1, value: '第一季度' },
{ id: 2, value: '第二季度' },
{ id: 3, value: '第三季度' },
{ id: 4, value: '第四季度' },
],
};
},
computed: mapState(['placeType']),
methods: {
getData() {
this.$emit('entityApplicationSearch');
},
@ -76,9 +159,58 @@ export default {
};
await this.$emit('entityApplicationSearch', condition);
},
showModal() {
this.exportVisible = true;
},
handleCancel(e) {
console.log('Clicked cancel button');
this.exportVisible = false;
},
//
openChangeOne(status) {
//status
if (status) {
this.yearShowOne = true;
}
},
//
panelChangeOne(value) {
this.platform.time = this.$moment(value).format('YYYY');
this.yearShowOne = false;
},
//
onSelectQuarter(value) {
this.platform.quarter = value;
},
//
async handleOk() {
try {
this.confirmLoading = true;
const { placeType, platform } = this;
const { time, quarter } = platform;
const params = { param: { placeType, time, quarter } };
const res = await handleExport(params);
const { data, msg, code } = res.data;
if (code === 200) {
window.location.href = data;
this.$message.success('导出成功');
this.exportVisible = false;
} else {
this.$message.error(msg || '导出失败');
}
this.confirmLoading = false;
} catch (error) {
console.log('error: ', error);
this.confirmLoading = false;
}
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus"></style>

281
src/components/Innovative/InnovativeAdd.vue

@ -0,0 +1,281 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:maskClosable="false"
@cancel="$emit('closeModal')"
destroyOnClose
footer
title="添加产品"
v-model="visible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
required
>
<a-auto-complete
@search="handleSearchTasks"
@select="onSelect"
placeholder="公司名称"
v-model="companyname"
>
<template slot="dataSource">
<a-select-option
:key="task.id"
:value="`${task.id}`"
v-for="task in dataSource"
>{{ task.company }}</a-select-option>
</template>
</a-auto-complete>
</a-form-item>
<!-- 产品名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品名称"
>
<a-input
placeholder="产品名称"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '产品名称不能为空' },
{ whitespace: true, message: '产品名称不能为空' },
{ max: 140, massage: '产品名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 产品编号 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品编号"
>
<a-input
placeholder="产品编号"
v-decorator="[
'identifier'
]"
/>
</a-form-item>
<!-- 产品图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品图片"
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
list-type="picture"
name="files"
v-decorator="[
'pic',
{
rules: [
{ required: true, message: '产品图片不能为空' },
],
},
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 产品类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品类型"
>
<a-checkbox-group
v-decorator="[
'modelIds',
{
rules: [
{ required: true, message: '产品类型不能为空' },
],
},
]"
>
<a-checkbox
:key="item.id"
:value="item.id"
v-for="item in typeLists.list"
>{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 产品简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品简介"
>
<a-textarea
placeholder="产品简介"
v-decorator="['synopsis',{
rules: [
{ required: true, message: '产品简介不能为空' },
],
},]"
/>
</a-form-item>
<!-- 产品详情 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品详情"
required
>
<quill-editor :max-size="maxSize" :placeholder="placeholder" @changeInput="changeInput" />
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { upload, addProduct, queryInfo } from 'config/api';
import { mapActions } from 'vuex';
import QuillEditor from 'components/QuillEditor/QuillEditor.vue';
import debounce from 'lodash/debounce';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'InnovativeAdd',
props: { visible: { type: Boolean, default: false }, typeLists: { type: Object, default: () => {} } },
components: { QuillEditor },
data() {
this.handleSearchTasks = debounce(this.handleSearchTasks, 800);
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'transfer-add' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
types: [],
maxSize: 2048,
details: '',
placeholder: '请输入...',
dataSource: [],
companyname: '', //
};
},
async created() {
const params = {
param: {
pageNum: 1,
pageSize: 10,
model: 2,
},
};
this.types = await this.getSelModelSearch(params);
},
methods: {
...mapActions(['getSelModelSearch']),
//
async handleSearchTasks() {
try {
const params = { param: { company: this.companyname } };
const res = await queryInfo(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.dataSource = data;
} else {
this.$message.error(msg);
}
} catch (error) {
console.log(error);
}
},
onSelect(value) {
const item = this.dataSource.find(item => item.id === +value);
this.companyname = item.company;
},
//
handleChange(info) {
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
changeInput(value) {
this.details = value;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const { fileList, details, companyname } = this;
if (!companyname) {
this.$message.error('请输入公司名称');
return;
}
if (!details) {
this.$message.error('请输入产品详情');
return;
}
const params = { param: values };
params.param.pic = fileList[0];
params.param.companyname = companyname;
params.param.details = details;
const res = await addProduct(params);
const { data, msg, code } = res.data;
//
if (code === 200) {
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {
throw msg;
}
this.$emit('closeModal');
} catch (error) {
this.$emit('closeModal');
this.$message.error(error || '添加产品失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

220
src/components/Innovative/InnovativeDate.vue

@ -0,0 +1,220 @@
<template>
<div class="main flex-1">
<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>
<div
class="d-flex flex-nowrap justify-space-between"
slot="expandedRowRender"
slot-scope="record"
style="margin: 0"
>
<div>
<a-spin :spinning="spinning" tip="详情加载中...">
产品详情
<span v-dompurify-html="record.content" v-if="record.content"></span>
<span v-else>暂无内容</span>
</a-spin>
</div>
</div>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<innovative-edit
:editItem="editItem"
:editVisible="editVisible"
:typeLists="typeLists"
@closeModal="closeModal"
@handleSelProject="handleSelProject"
/>
</a-spin>
</div>
</template>
<script>
import InnovativeEdit from './InnovativeEdit.vue';
import { deleteProduct, selProductMesH } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '编号',
align: 'center',
dataIndex: 'identifier',
key: 'identifier',
},
{
title: '产品名称',
align: 'center',
dataIndex: 'name',
key: 'name',
},
{
title: '产品简介',
align: 'center',
dataIndex: 'synopsis',
key: 'synopsis',
},
{
title: '图片路径',
align: 'center',
dataIndex: 'visitLocation',
key: 'visitLocation',
scopedSlots: { customRender: 'visitLocation' },
},
{
title: '编辑',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'InnovativeDate',
components: { InnovativeEdit },
props: {
lists: { type: Array, default: () => [] },
pagination: { type: Object, default: () => {} },
typeLists: { type: Object, default: () => {} },
},
data() {
return {
columns,
loading: false,
height: '',
editVisible: 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) {
this.showEdit = true;
const res = await this.getDetail(true, record);
this.editItem = res;
this.showEdit = false;
this.editVisible = true;
},
closeModal() {
this.editVisible = false;
},
async handleSelProject() {
await this.$emit('handleSelProject');
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('handleSelProject', condition);
},
//
async getDetail(expanded, record) {
if (!expanded) return;
try {
this.spinning = true;
const params = { param: { id: record.id } };
const res = await selProductMesH(params);
const { data, msg, code } = res.data;
this.spinning = false;
if (code === 200) {
const item = this.lists.find(item => item.id === record.id);
item.content = data.details;
return data;
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '查询失败');
}
},
//
async onDelete(id) {
try {
const params = { param: { id } };
const res = await deleteProduct(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('handleSelProject');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
},
};
</script>
<style lang="stylus" scoped>
.main .img {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

315
src/components/Innovative/InnovativeEdit.vue

@ -0,0 +1,315 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal
:maskClosable="false"
@cancel="$emit('closeModal')"
destroyOnClose
footer
title="修改产品"
v-model="editVisible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
required
>
<a-auto-complete
@search="handleSearchTasks"
@select="onSelect"
placeholder="公司名称"
v-model="companyname"
>
<template slot="dataSource">
<a-select-option
:key="task.id"
:value="`${task.id}`"
v-for="task in dataSource"
>{{ task.company }}</a-select-option>
</template>
</a-auto-complete>
</a-form-item>
<!-- 产品名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品名称"
>
<a-input
placeholder="产品名称"
v-decorator="[
'name',
{
initialValue: editItem ? editItem.name : '',
},
]"
/>
</a-form-item>
<!-- 产品编号 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品编号"
>
<a-input
placeholder="产品编号"
v-decorator="[
'identifier', { initialValue: editItem ? editItem.identifier : '' }
]"
/>
</a-form-item>
<!-- 产品图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品图片"
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
list-type="picture"
name="files"
v-decorator="[
'pic',
]"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 产品类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品类型"
>
<a-checkbox-group
v-decorator="[
'modelIds',
{
initialValue: oldTypes ? oldTypes : [],
},
]"
>
<a-checkbox
:key="item.id"
:value="item.id"
v-for="item in typeLists.list"
>{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 产品简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品简介"
>
<a-textarea
placeholder="产品简介"
v-decorator="['synopsis',{
initialValue: editItem ? editItem.synopsis : '',
},]"
/>
</a-form-item>
<!-- 产品详情 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="产品详情"
required
>
<quill-editor
:max-size="maxSize"
:placeholder="placeholder"
:value="details"
@changeInput="changeInput"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { upload, updateProduct } from 'config/api';
import { mapActions } from 'vuex';
import QuillEditor from 'components/QuillEditor/QuillEditor.vue';
import debounce from 'lodash/debounce';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'InnovativeEdit',
props: {
editVisible: { type: Boolean, default: false },
typeLists: { type: Object, default: () => {} },
editItem: { type: Object, default: () => {} },
},
components: { QuillEditor },
data() {
this.handleSearchTasks = debounce(this.handleSearchTasks, 800);
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'innovative-edit' }),
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
types: [],
maxSize: 2048,
details: '',
placeholder: '请输入...',
dataSource: [],
companyid: '', // id
companyname: '', //
};
},
watch: {
editItem(val) {
if (val) {
if (val.companyid) {
this.companyid = val.companyid;
}
if (val.companyname) {
this.companyname = val.companyname;
}
if (val.details) {
this.details = val.details;
}
}
},
},
computed: {
oldTypes() {
const { typeLists, editItem } = this;
let arr = [];
if (editItem && typeLists && typeLists.list && typeLists.list.length) {
for (let i = 0; i < typeLists.list.length; i++) {
const item = typeLists.list[i];
const a = editItem.names.findIndex(a => a === item.name);
const index = arr.findIndex(c => c === a);
if (a !== -1 && index === -1) {
arr.push(item.id);
}
}
}
return arr;
},
},
async created() {
const params = {
param: {
pageNum: 1,
pageSize: 10,
model: 2,
},
};
this.types = await this.getSelModelSearch(params);
},
methods: {
...mapActions(['getSelModelSearch']),
//
async handleSearchTasks() {
try {
const params = { param: { company: this.companyname } };
const res = await queryInfo(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.dataSource = data;
} else {
this.$message.error(msg);
}
} catch (error) {
console.log(error);
}
},
onSelect(value) {
const item = this.dataSource.find(item => item.id === +value);
this.companyid = item.id;
this.companyname = item.company;
},
//
handleChange(info) {
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
//
changeInput(value) {
this.details = value;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const { fileList, details, companyid, companyname, editItem } = this;
if (!companyname) {
this.$message.error('请输入公司名称');
return;
}
if (!details) {
this.$message.error('请输入产品详情');
return;
}
const params = { param: values };
params.param.id = editItem.id;
params.param.companyid = companyid;
params.param.companyname = companyname || editItem.companyname;
params.param.details = details || editItem.details;
params.param.pic = fileList[0] || editItem.visitLocation;
const res = await updateProduct(params);
const { data, msg, code } = res.data;
//
if (code === 200) {
this.$message.success('修改成功');
this.$emit('handleSelProject');
} else {
this.$message.error('修改失败');
throw msg;
}
this.$emit('closeModal');
} catch (error) {
this.$emit('closeModal');
this.$message.error(error || '修改失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

66
src/components/Innovative/InnovativeSearch.vue

@ -0,0 +1,66 @@
<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"></div>
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<!-- 添加 -->
<innovative-add
:typeLists="typeLists"
:visible="visible"
@closeModal="closeModal"
@handleTableChange="handleTableChange"
/>
</div>
</template>
<script>
import InnovativeAdd from './InnovativeAdd.vue';
export default {
name: 'TransferSearch',
components: { InnovativeAdd },
props: { typeLists: { type: Object, default: () => {} } },
data() {
return {
visible: false,
content: '',
modelIds: [],
};
},
methods: {
showModal() {
this.visible = true;
},
closeModal() {
this.visible = false;
},
onChange(checkedValues) {
this.modelIds = checkedValues;
},
async handleTableChange() {
const { content, modelIds } = this;
//
const condition = {
content,
modelIds,
};
await this.$emit('handleSelProject', condition);
},
},
};
</script>
<style scoped lang="stylus"></style>

76
src/config/api.js

@ -22,6 +22,9 @@ const comment = `${greenvalley}/comment`; // 交流社区相关操作
const place = `${greenvalley}/place`; // 孵化部入驻实体申请相关操作
const business = `${greenvalley}/business`; // 交流社区相关操作
const personApply = `${greenvalley}/PersonApply`; // 加入我们相关操作
const product = `${greenvalley}/product`; // 产品相关操作
const releaseTheList = `${greenvalley}/releaseTheList`; // 发榜和揭榜功能相关操作
const tutorRelated = `${greenvalley}/tutorRelated`; // 人才信息相关操作
export const upload = `${greenvalley}/file/upload`;
@ -202,6 +205,9 @@ export const updatePlace = params => axios.post(`${place}/update`, params);
// 入驻企业申请(管理员用)
export const handleApplyBackend = params => axios.post(`${place}/applyBackend`, params);
// 导出报表
export const handleExport = params => axios.post(`${place}/export`, params);
// 查询所有的研发团队相关信息
export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);
@ -256,14 +262,80 @@ export const getAreaBranch = params => axios.post(`${policy}/policy/area`, param
// 加入我们的相关接口
export const contactUs = params => axios.post(`${personApply}/joinUs`, params);
// 查询企业简介信息(根据名字模糊搜索)
export const queryInfo = params => axios.post(`${place}/queryInfo`, params);
// 查询 产品列表
export const selProduct = params => axios.post(`${product}/selProduct`, params);
// 查询 产品详情
export const selProductMesH = params => axios.post(`${product}/selProductMesH`, params);
// 新增 产品
export const addProduct = params => axios.post(`${product}/addProduct`, params);
// 修改 产品
export const updateProduct = params => axios.post(`${product}/updateProduct`, params);
// 删除 产品
export const deleteProduct = params => axios.post(`${product}/deleteProduct`, params);
// 后台查询修改
export const contactUsSearch = params => axios.post(`${personApply}/SearchJoinUs`, params);
// 后台查询删除
export const deleteJoinUs = params => axios.post(`${personApply}/DeleteJoinUs`, params);
// 后台申请修改状态
export const joinUsStatus = params => axios.post(`${personApply}/JoinUsStatus`, params);
export const joinUsStatus = params => axios.post(`${personApply}/JoinUsStatus`, params);
// 创新挑战查看发榜列表
export const selTelease = params => axios.post(`${releaseTheList}/selTelease`, params);
// 创新挑战查看某个榜的揭榜列表
export const selfulUnveilingList = params => axios.post(`${releaseTheList}/selfulUnveilingList`, params);
// 创新挑战修改
export const updateTelease = params => axios.post(`${releaseTheList}/updateTelease`, params);
// 创新挑战增加
export const addTelease = params => axios.post(`${releaseTheList}/addTelease`, params);
// 创新挑战发榜类型查询
export const findTypeList = params => axios.post(`${releaseTheList}/findTypeList`, params);
// 创新挑战发榜类型查询
export const selTeleaseById = params => axios.post(`${releaseTheList}/selTeleaseById`, params);
// 创新挑战发榜审核
export const upPublished = params => axios.post(`${releaseTheList}/upPublishedSuccessfully`, params);
// 创新挑战揭榜列表
export const selfulUnveiling = params => axios.post(`${releaseTheList}/selfulUnveilingList`, params);
// 创新挑战修改揭榜审核状态
export const upUnveiling = params => axios.post(`${releaseTheList}/upSuccessfulUnveiling`, params);
// 增加人才
export const addTeacher = params => axios.post(`${tutorRelated}/addTeacher`, params);
// 删除人才
export const delTeacher = params => axios.post(`${tutorRelated}/delTeacher`, params);
// 修改人才
export const upTeacher = params => axios.post(`${tutorRelated}/upTeacher`, params);
// 查询人才
export const getFindTeachH = params => axios.post(`${tutorRelated}/findTeachH`, params);
// 查询人才类型
export const getSelTutorH = params => axios.post(`${tutorRelated}/selTutorH`, params);
// 增加人才类型
export const addTutor = params => axios.post(`${tutorRelated}/addTutor`, params);
// 修改人才类型
export const upTutorH = params => axios.post(`${tutorRelated}/upTutorH`, params);
// 删除人才类型
export const delTutorH = params => axios.post(`${tutorRelated}/delTutorH`, params);

6
src/plugins/ant-design-vue.js

@ -24,9 +24,10 @@ import {
Spin,
Tooltip,
Popover,
inputNumber,
InputNumber,
Avatar,
Steps,
AutoComplete,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -52,9 +53,10 @@ Vue.use(Checkbox);
Vue.use(Spin);
Vue.use(Tooltip);
Vue.use(Popover);
Vue.use(inputNumber);
Vue.use(InputNumber);
Vue.use(Avatar);
Vue.use(Steps);
Vue.use(AutoComplete);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

31
src/router/index.js

@ -35,7 +35,7 @@ const routes = [
name: 'BannerManage',
component: () => import(/* webpackChunkName: "banner-manage" */ 'views/BannerManage/BannerManage.vue'),
},
// 轮播图管理
// 轮播图管理
{
path: '/banner-manage-m',
name: 'BannerManageM',
@ -87,10 +87,9 @@ const routes = [
{
path: '/contact-us-derivative-enterprise',
name: 'ContactUs',
component: () =>
import(/* webpackChunkName: "ContactUs" */ 'views/ContactUs/ContactUs.vue'),
component: () => import(/* webpackChunkName: "ContactUs" */ 'views/ContactUs/ContactUs.vue'),
},
// 衍生企业
// 衍生企业
{
path: '/about-us-derivative-enterprise',
name: 'AboutUsDerivativeEnterprise',
@ -140,6 +139,24 @@ const routes = [
name: 'InnovativeAchievements',
component: () => import(/* webpackChunkName: "innovative-achievements" */ 'views/InnovativeAchievements/InnovativeAchievements.vue'),
},
// 创新挑战
{
path: '/challenge',
name: 'Challenge',
component: () => import(/* webpackChunkName: "challenge" */ 'views/Challenge/Challenge.vue'),
},
// 导师管理
{
path: '/teacher',
name: 'Teacher',
component: () => import(/* webpackChunkName: "industry-demand-report" */ 'views/Teacher/Teacher.vue'),
},
// 导师类型
{
path: '/teacher-type',
name: 'TeacherType',
component: () => import(/* webpackChunkName: "industry-demand-report" */ 'views/TeacherType/TeacherType.vue'),
},
// -------孵化部
// 入驻实体申请
{
@ -171,6 +188,12 @@ const routes = [
name: 'HatchCooperativePartner',
component: () => import(/* webpackChunkName: "hatch-cooperative-partner" */ 'views/CooperativePartner/HatchCooperativePartner.vue'),
},
// 产品展示
{
path: '/incubation-project',
name: 'IncubationProject',
component: () => import(/* webpackChunkName: "incubation-project" */ 'views/IncubationProject/IncubationProject.vue'),
},
// -------产业部
// 服务
{

86
src/views/Challenge/Challenge.vue

@ -0,0 +1,86 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<challenge-search @getListData="getListData" />
<challenge-date :lists="lists" :pagination="pagination" @getListData="getListData" />
</div>
</template>
<script>
import ChallengeSearch from './components/ChallengeSearch.vue';
import ChallengeDate from './components/ChallengeDate.vue';
import { selTelease } from 'config/api';
export default {
name: 'Challenge',
components: {
ChallengeSearch,
ChallengeDate,
},
data() {
return {
str: '需求征集界面',
lists: {},
pagination: { current: 1, pageSize: 10 },
pageNum: 1,
pageSize: 10,
paramData: {
title: '',
companyName: '',
startTime: '',
endTime: '',
servics: '',
billboardStatus: '',
},
};
},
created() {
this.getListData();
},
methods: {
//
async getListData(condition) {
try {
if (condition && condition.current) {
this.pageNum = condition.current;
this.pageSize = condition.pageSize;
} else if (condition && !condition.current) {
let { paramData } = this;
console.log(paramData);
paramData = { ...condition };
this.paramData = paramData;
}
const params = {
param: {
address: '',
billboardStatus: this.paramData.billboardStatus,
companyName: this.paramData.companyName,
startTime: this.paramData.startTime,
endTime: this.paramData.endTime,
servics: this.paramData.servics,
title: this.paramData.title,
pageNum: this.pageNum,
pageSize: this.pageSize,
},
};
const res = await selTelease(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
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>

278
src/views/Challenge/components/ChallengeAdd.vue

@ -0,0 +1,278 @@
<template>
<div>
<a-button @click="showModal" type="primary">增加</a-button>
<a-modal
destroy-on-close
:confirm-loading="confirmLoading"
:title="title"
:visible="visible"
@cancel="handleCancel"
@ok="handleOk"
width="50%"
>
<a-form :form="form">
<!-- 需求名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求名称">
<a-input placeholder="请输入需求名称..." v-model.trim="platform.needName" />
</a-form-item>
<!-- 公司名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="公司名称">
<a-input placeholder="请输入公司名称..." v-model.trim="platform.companyName" />
</a-form-item>
<!-- 技术领域 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="技术领域">
<a-input placeholder="请输入技术领域..." v-model.trim="platform.technicalField" />
</a-form-item>
<!-- 需求截止时间 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="截止时间">
<a-date-picker @change="changeNeedTime" style="width: 100%" />
</a-form-item>
<!-- 需求类别 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求类别">
<a-checkbox-group @change="onChange" class="line-height-30">
<a-checkbox style="width: 100%" v-for="(item, index) in typeList" :key="index" :value="item.id">{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 需求内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求内容">
<quill-editor
:options="editorOption"
@blur="onEditorBlur($event)"
@change="onEditorChange($event)"
@focus="onEditorFocus($event)"
class="editor-box"
ref="myQuillEditor"
v-model="needContent"
></quill-editor>
<a-upload
accept="image/png, image/jpeg"
name="files"
:multiple="false"
style="display: none"
:action="action"
@change="fileChange"
>
<a-button id="upload-img"> <a-icon type="upload" /></a-button>
</a-upload>
</a-form-item>
<!-- 现有基础 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础">
<a-textarea
placeholder="(已经开展的工作、所处阶段、投入资金和人力、仪器 设备、生产条件等)"
style="min-height: 100px"
v-model.trim="platform.basics"
/>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { quillEditor } from 'vue-quill-editor'; //
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import { upload, addTelease, findTypeList } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], //线线
['blockquote', 'code-block'], //
[{ header: 1 }, { header: 2 }], // 12
[{ list: 'ordered' }, { list: 'bullet' }], //
[{ script: 'sub' }, { script: 'super' }], //
[{ indent: '-1' }, { indent: '+1' }], //
[{ direction: 'rtl' }], //
// [{ size: ['small', false, 'large', 'huge'] }], //
// [{ header: [1, 2, 3, 4, 5, 6, false] }], //
[{ color: [] }, { background: [] }], //
// [{ font: [] }], //
[{ align: [] }], //
['clean'], //
['image', 'video'], //
];
export default {
name: 'Enroll',
components: { quillEditor },
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
visible: false,
title: '发榜',
action: upload,
formItemLayout,
formTailLayout,
confirmLoading: false,
needContent: ``,
editorOption: {
placeholder: '在这里输入...',
modules: {
toolbar: {
container: toolbarOptions, //
handlers: {
image: function(value) {
if (value) {
// alert('');
document.getElementById('upload-img').click();
} else {
this.quill.format('image', false);
}
},
video: function(value) {
if (value) {
alert('自定义视频');
} else {
this.quill.format('image', false);
}
},
},
},
},
},
platform: {
needName: '',
technicalField: '',
basics: '',
companyName: '',
type: [],
buildTime: '',
},
hideMessage: null,
typeList: [],
};
},
computed: mapState('user', ['anyringToken']),
created() {
this.findType();
},
methods: {
//
changeNeedTime(date, dateString) {
this.platform.buildTime = this.$moment(date).format('YYYY-MM-DD HH:mm:ss');
// console.log(this.$moment(date).unix(), dateString);
},
onEditorReady(editor) {
//
},
onEditorBlur() {}, //
onEditorFocus() {}, //
onEditorChange() {
//
// console.log(this.content);
},
onChange(e) {
console.log(e);
this.platform.type = e;
},
//
fileChange(info) {
console.log(info);
if (info.file.status === 'uploading') {
if (!this.hideMessage) {
this.hideMessage = this.$message.loading('上传中...');
}
}
// this.fileList = info.fileList;
if (info.file.status === 'done') {
this.files = [];
const img = `<img src=${info.file.response.data[0].visitUrl} >`;
this.needContent += img;
setTimeout(this.hideMessage, 0);
this.$message.success('上传成功');
}
},
//
showModal() {
this.visible = true;
},
//
handleCancel(e) {
this.visible = false;
},
//
handleOk() {
this.subMitAdd();
},
//
async subMitAdd() {
this.confirmLoading = true;
try {
const params = {
param: {
address: '123',
title: this.platform.needName,
content: this.needContent,
servics: this.platform.technicalField,
companyName: this.platform.companyName,
deadline: this.platform.buildTime,
existingBasis: this.platform.basics,
models: this.platform.type,
},
};
const res = await addTelease(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('添加成功');
this.visible = false;
this.confirmLoading = false;
for (let key in this.platform) {
this.platform[key] = '';
}
} else {
throw msg;
this.confirmLoading = false;
}
} catch (error) {
this.$message.error(error);
this.confirmLoading = false;
}
},
//
async findType() {
try {
const res = await findTypeList();
const { code, msg, data } = res.data;
if (code === 200) {
this.typeList = data;
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
.ql-editor {
min-height: 600px;
max-height: 800px;
}
.editor-box >>> .ql-editor {
min-height: 150px;
}
</style>

225
src/views/Challenge/components/ChallengeDate.vue

@ -0,0 +1,225 @@
<template>
<div class="main flex-1">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists.list"
:loading="loading"
:row-key="record => record.id"
:pagination="pagination"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<template slot="content" slot-scope="text, record">
<div v-dompurify-html="record.content"></div>
</template>
<template slot="bid" slot-scope="text, record">
<span style="cursor: pointer; color: #2db7f5" @click="showList(record)">查看揭榜列表</span>
</template>
<template slot="billboardStatus" slot-scope="text, record">
<a-tag v-if="record.billboardStatus === 0" color="#108ee9"> 待审核 </a-tag>
<a-tag v-else-if="record.billboardStatus === 1" color="#87d068"> 审核通过 </a-tag>
<a-tag v-else-if="record.billboardStatus === 2" color="#2db7f5"> 完成 </a-tag>
<a-tag v-else-if="record.billboardStatus === 3" color="#ccc"> 发榜取消 </a-tag>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-tag color="blue" class="ml-3" style="cursor: pointer" @click="changeStatus(record.bid)"> 审核 </a-tag>
</template>
</a-table>
</div>
<a-empty v-else />
<a-modal title="发榜审核" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel" destroy-on-close>
<a-select style="width: 240px" @change="handleChange">
<a-select-option v-for="(item, index) in statusList" :value="index" :key="index">
{{ item }}
</a-select-option>
</a-select>
</a-modal>
<!-- 编辑 -->
<challenge-edit :edit-visible="editVisible" :edit-data="editData" @getData="getData" :contents="contents" @closeModal="closeModal" />
<!-- 揭榜列表 -->
<unveiling-date :unvu-visible="unvuVisible" :obj-data="objData" @getData="getData" @closeModal1="closeModal1" />
</div>
</template>
<script>
import ChallengeEdit from './ChallengeEdit.vue';
import UnveilingDate from './UnveilingDate.vue';
import { academyDelete, upPublished } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '标题',
align: 'center',
dataIndex: 'title',
key: 'title',
},
{
title: '公司名称',
align: 'center',
dataIndex: 'companyName',
key: 'companyName',
},
// {
// title: '',
// align: 'center',
// dataIndex: 'companyName',
// key: 'companyName',
// },
{
title: '需求内容',
align: 'center',
dataIndex: 'content',
key: 'content',
scopedSlots: { customRender: 'content' },
},
{
title: '截止时间',
align: 'center',
dataIndex: 'deadline',
key: 'deadline',
// scopedSlots: { customRender: 'picUrl' },
},
{
title: '所属领域',
align: 'center',
dataIndex: 'servics',
key: 'servics',
scopedSlots: { customRender: 'servics' },
},
{
title: '揭榜列表',
align: 'center',
dataIndex: 'bid',
key: 'bid',
scopedSlots: { customRender: 'bid' },
},
{
title: '审核状态',
align: 'center',
dataIndex: 'billboardStatus',
key: 'billboardStatus',
scopedSlots: { customRender: 'billboardStatus' },
},
{
title: '编辑',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'CollegeDate',
components: { ChallengeEdit, UnveilingDate },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() {
return {
columns,
visible: false,
loading: false,
confirmLoading: false,
editingKey: '',
height: '',
editVisible: false,
editData: null,
contents: '',
statusList: ['待审核', '审核通过', '完成', '发榜取消'],
recordId: '',
recordStatus: '',
objData: null,
unvuVisible: 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 handleOk() {
try {
this.confirmLoading = true;
const params = {
param: {
id: this.recordId,
billboardStatus: this.recordStatus,
},
};
const res = await upPublished(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('getListData');
this.visible = false;
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
this.confirmLoading = false;
},
handleCancel() {
this.visible = false;
},
handleChange(e) {
this.recordStatus = e;
},
showEditModal(data) {
this.editData = data;
this.editVisible = true;
},
closeModal(data) {
this.editVisible = data;
},
closeModal1(data) {
this.unvuVisible = data;
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getListData', condition);
},
getData() {
this.$emit('getListData');
},
changeStatus(id) {
this.recordId = id;
this.visible = true;
},
showList(data) {
this.objData = data;
this.unvuVisible = true;
},
},
};
</script>
<style scoped lang="stylus"></style>

321
src/views/Challenge/components/ChallengeEdit.vue

@ -0,0 +1,321 @@
<template>
<div>
<a-modal :confirm-loading="confirmLoading" :title="title" :visible="editVisible" @cancel="handleCancel" @ok="handleOk" width="50%">
<a-spin v-if="platform.id === ''" />
<a-form :form="form" v-else>
<!-- 需求名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求名称">
<a-input placeholder="请输入需求名称..." v-model.trim="platform.title" />
</a-form-item>
<!-- 公司名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="公司名称">
<a-input placeholder="请输入公司名称..." v-model.trim="platform.companyName" />
</a-form-item>
<!-- 技术领域 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="技术领域">
<a-input placeholder="请输入技术领域..." v-model.trim="platform.servics" />
</a-form-item>
<!-- 需求截止时间 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="截止时间">
<a-date-picker :default-value="$moment(platform.deadline, dateFormat)" @change="changeNeedTime" style="width: 100%" />
</a-form-item>
<!-- 需求类别 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求类别">
<a-checkbox-group :default-value="platform.models" @change="onChange" class="line-height-30">
<a-checkbox style="width: 100%" v-for="(item, index) in typeList" :key="index" :value="item.id">{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 需求内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="需求内容">
<quill-editor
:options="editorOption"
@blur="onEditorBlur($event)"
@change="onEditorChange($event)"
@focus="onEditorFocus($event)"
class="editor-box"
ref="myQuillEditor"
v-model="platform.content"
></quill-editor>
<a-upload
accept="image/png, image/jpeg"
name="files"
:multiple="false"
style="display: none"
:action="action"
@change="fileChange"
>
<a-button id="upload-img"> <a-icon type="upload" /></a-button>
</a-upload>
</a-form-item>
<!-- 现有基础 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础">
<a-textarea
placeholder="(已经开展的工作、所处阶段、投入资金和人力、仪器 设备、生产条件等)"
style="min-height: 100px"
v-model.trim="platform.existingBasis"
/>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { quillEditor } from 'vue-quill-editor'; //
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import { upload, updateTelease, findTypeList, selTeleaseById } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], //线线
['blockquote', 'code-block'], //
[{ header: 1 }, { header: 2 }], // 12
[{ list: 'ordered' }, { list: 'bullet' }], //
[{ script: 'sub' }, { script: 'super' }], //
[{ indent: '-1' }, { indent: '+1' }], //
[{ direction: 'rtl' }], //
// [{ size: ['small', false, 'large', 'huge'] }], //
// [{ header: [1, 2, 3, 4, 5, 6, false] }], //
[{ color: [] }, { background: [] }], //
// [{ font: [] }], //
[{ align: [] }], //
['clean'], //
['image', 'video'], //
];
export default {
name: 'ChallengeEdit',
components: { quillEditor },
props: {
editVisible: {
type: Boolean,
default: false,
},
editData: {
type: Object,
default: () => {},
},
},
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
title: '发榜',
action: upload,
formItemLayout,
formTailLayout,
confirmLoading: false,
needContent: ``,
editorOption: {
placeholder: '在这里输入...',
modules: {
toolbar: {
container: toolbarOptions, //
handlers: {
image: function(value) {
if (value) {
// alert('');
document.getElementById('upload-img').click();
} else {
this.quill.format('image', false);
}
},
video: function(value) {
if (value) {
alert('自定义视频');
} else {
this.quill.format('image', false);
}
},
},
},
},
},
dateFormat: 'YYYY-MM-DD',
platform: {
id: '',
title: '',
companyName: '',
content: '',
servics: '',
deadline: '',
existingBasis: '',
models: [],
},
hideMessage: null,
typeList: [],
};
},
computed: mapState('user', ['anyringToken']),
watch: {
editVisible(val) {
if (val) {
this.confirmLoading = true;
this.getDetail(this.editData.bid);
}
},
},
created() {
this.findType();
},
methods: {
//
changeNeedTime(date, dateString) {
this.platform.buildTime = this.$moment(date).format('YYYY-MM-DD HH:mm:ss');
// console.log(this.$moment(date).unix(), dateString);
},
async getDetail(id) {
try {
const params = { param: { id } };
const res = await selTeleaseById(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.platform.id = data.bid;
this.platform.title = data.title;
this.platform.content = data.content;
this.platform.companyName = data.companyName;
this.platform.servics = data.servics;
this.platform.deadline = data.deadline;
this.platform.existingBasis = data.existingBasis;
this.platform.models = this.getModelId(data.list);
console.log(this.platform.models);
this.confirmLoading = false;
} else {
console.log(msg);
this.confirmLoading = false;
}
} catch (error) {
console.log(error);
this.confirmLoading = false;
}
},
getModelId(list) {
console.log(list);
this.platform.models = [];
let idList = [];
for (var i = 0; i < list.length; i++) {
idList.push(list[i].moid);
}
return idList;
},
onEditorReady(editor) {
//
},
onEditorBlur() {}, //
onEditorFocus() {}, //
onEditorChange() {
//
// console.log(this.content);
},
onChange(e) {
console.log(e);
this.platform.models = e;
},
//
fileChange(info) {
console.log(info);
if (info.file.status === 'uploading') {
if (!this.hideMessage) {
this.hideMessage = this.$message.loading('上传中...');
}
}
// this.fileList = info.fileList;
if (info.file.status === 'done') {
this.files = [];
const img = `<img src=${info.file.response.data[0].visitUrl} >`;
this.needContent += img;
setTimeout(this.hideMessage, 0);
this.$message.success('上传成功');
}
},
//
handleCancel(e) {
for (let key in this.platform) {
this.platform[key] = '';
}
this.$emit('closeModal', false);
},
//
handleOk() {
this.subMitAdd();
},
//
async subMitAdd() {
this.confirmLoading = true;
try {
const params = {
param: {
id: this.platform.id,
title: this.platform.title,
content: this.platform.content,
servics: this.platform.servics,
deadline: this.platform.deadline,
existingBasis: this.platform.existingBasis,
models: this.platform.models,
},
};
const res = await updateTelease(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.$emit('getData');
this.handleCancel();
this.confirmLoading = false;
for (let key in this.platform) {
this.platform[key] = '';
}
} else {
throw msg;
this.confirmLoading = false;
}
} catch (error) {
this.$message.error(error);
this.confirmLoading = false;
}
},
//
async findType() {
try {
const res = await findTypeList();
const { code, msg, data } = res.data;
if (code === 200) {
this.typeList = data;
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
.ql-editor {
min-height: 600px;
max-height: 800px;
}
.editor-box >>> .ql-editor {
min-height: 150px;
}
</style>

104
src/views/Challenge/components/ChallengeSearch.vue

@ -0,0 +1,104 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<a-input allow-clear placeholder="标题" style="width: 150px" v-model="title" />
<a-input
allow-clear
class="ml-3 mb-3"
placeholder="公司名称"
style="width: 150px"
v-model="companyName"
/>
<span class="ml-3">截止时间:</span>
<a-range-picker @change="onChange" allow-clear class="ml-3 mb-3" />
<br />
<a-input allow-clear placeholder="所属领域" style="width: 150px" v-model="servics" />
<span class="ml-3">审核状态:</span>
<a-select
@change="handleChangeSelect"
allow-clear
class="ml-3"
placeholder="状态"
style="width: 150px"
>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<!-- <a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button> -->
<!-- 添加 -->
<challenge-add :visible="visible" @handleTableChange="handleTableChange" />
</div>
</template>
<script>
import ChallengeAdd from './ChallengeAdd.vue';
import { queryMold } from 'config/api';
export default {
name: 'CollegeSearch',
components: { ChallengeAdd },
data() {
return {
visible: false,
title: '',
statusList: ['待审核', '审核通过', '完成', '发榜取消'],
companyName: '',
startTime: '',
endTime: '',
servics: '',
billboardStatus: '',
};
},
created() {
this.getQueryMold();
},
methods: {
onChange(e) {
console.log(this.$moment(e[0]._d).format('YYYY-MM-DD HH:mm:ss'));
console.log(this.$moment(e[1]._d).format('YYYY-MM-DD HH:mm:ss'));
this.startTime = this.$moment(e[0]._d).format('YYYY-MM-DD HH:mm:ss');
this.endTime = this.$moment(e[1]._d).format('YYYY-MM-DD HH:mm:ss');
},
showModal() {
this.visible = true;
},
closeModal() {
this.visible = false;
},
handleChangeSelect(e) {
// console.log(e);
this.billboardStatus = e;
},
async handleTableChange() {
const { title, companyName, startTime, endTime, servics, billboardStatus } = this;
//
const condition = { title, companyName, startTime, endTime, servics, billboardStatus };
await this.$emit('getListData', condition);
},
async getQueryMold() {
try {
const res = await queryMold();
const { code, msg, data } = res.data;
if (code === 200) {
this.bannersList = data;
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus"></style>

44
src/views/Challenge/components/UnveSearch.vue

@ -0,0 +1,44 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<a-input placeholder="揭榜人" style="width: 150px" v-model="accepterName" allow-clear />
<span class="ml-3"> 揭榜状态:</span>
<a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
</div>
</template>
<script>
export default {
name: 'UnveSearch',
data() {
return {
visible: false,
title: '',
statusList: ['待审核', '成功', '未成功'],
orderStatus: '',
accepterName: '',
};
},
methods: {
handleChangeSelect(e) {
this.orderStatus = e;
},
handleTableChange() {
const { orderStatus, accepterName } = this;
//
const condition = { orderStatus, accepterName };
this.$emit('getData', condition);
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus"></style>

251
src/views/Challenge/components/UnveilingDate.vue

@ -0,0 +1,251 @@
<template>
<div>
<a-modal
:footer="false"
:confirm-loading="confirmLoading"
:title="title"
:visible="unvuVisible"
@cancel="handleCancel"
@ok="handleOk"
width="80%"
>
<unve-search @getData="getData" />
<a-table
:columns="columns"
:data-source="dataList"
:loading="loading"
:row-key="record => record.id"
:pagination="pagination"
@change="handleTableChange"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<template slot="orderStatus" slot-scope="text, record">
<div style="width: 120px; text-align: center; margin: auto" v-if="!record.editable">
<span v-if="record.orderStatus === 0">待审核</span>
<span v-else-if="record.orderStatus === 1">成功</span>
<span v-else-if="record.orderStatus === 2">未成功</span>
</div>
<div v-else>
<a-select style="width: 120px" @change="changeRecord">
<a-select-option v-for="(item, index) in statusList" :key="index" :value="index">
{{ item }}
</a-select-option>
</a-select>
</div>
</template>
<template slot="edit" slot-scope="text, record, index">
<a-icon v-if="!record.editable" @click="changeStatus(record, index)" class="pointer" theme="twoTone" type="edit" />
<span v-else>
<a @click="saveStatus(index)">保存</a>
<a class="ml-3" @click="changeStatus(record.id, index)">取消</a>
</span>
</template>
</a-table>
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import UnveSearch from './UnveSearch.vue';
import { selfulUnveiling, upUnveiling } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '揭榜人',
align: 'center',
dataIndex: 'accepterName',
key: 'accepterName',
},
{
title: '揭榜单位',
align: 'center',
dataIndex: 'unit',
key: 'unit',
},
{
title: '手机号',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '时间',
align: 'center',
dataIndex: 'times',
key: 'times',
},
{
title: '方案简述',
align: 'center',
dataIndex: 'planIntro',
key: 'planIntro',
},
{
title: '揭榜状态',
align: 'center',
dataIndex: 'orderStatus',
key: 'orderStatus',
scopedSlots: { customRender: 'orderStatus' },
},
{
title: '操作',
align: 'center',
dataIndex: 'edit',
key: 'edit',
width: '15%',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'UnveilingDate',
components: { UnveSearch },
props: {
unvuVisible: {
type: Boolean,
default: false,
},
objData: {
type: Object,
default: () => {},
},
},
data() {
return {
title: '发榜',
confirmLoading: false,
loading: false,
columns: columns,
pagination: { current: 1, pageSize: 10 },
billboardId: '',
orderStatus: '',
accepterName: '',
pageNum: 1,
pageSize: 10,
dataList: [],
statusList: ['待审核', '成功', '未成功'],
status: '',
id: '',
};
},
watch: {
objData(val) {
if (val.bid) {
this.getData();
}
},
},
methods: {
handleCancel() {
this.$emit('closeModal1', false);
},
handleOk() {
this.$emit('closeModal1', false);
},
async getData(condition) {
try {
if (condition && condition.current) {
this.pageNum = condition.current;
this.pageSize = condition.pageSize;
} else if (condition) {
this.orderStatus = condition.orderStatus;
this.accepterName = condition.accepterName;
this.pageNum = 1;
this.pageSize = 10;
}
const params = {
param: {
accepterName: this.accepterName,
billboardId: this.objData.bid,
orderStatus: this.orderStatus,
pageNum: this.pageNum,
pageSize: this.pageSize,
},
};
const res = await selfulUnveiling(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.dataList = data.list;
for (let i = 0; i < this.dataList.length; i++) {
this.dataList.editable = true;
}
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.getData();
},
changeStatus(data, index) {
const newDataList = [...this.dataList];
newDataList[index].editable = !newDataList[index].editable;
this.dataList = newDataList;
this.status = data.orderStatus;
this.id = data.id;
},
changeRecord(e) {
this.status = e;
},
async saveStatus(index) {
try {
const params = {
param: {
id: this.id,
orderStatus: this.status,
},
};
const res = await upUnveiling(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('修改成功');
const newDataList = [...this.dataList];
newDataList[index].editable = !newDataList[index].editable;
this.dataList = newDataList;
this.getData();
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
.ql-editor {
min-height: 600px;
max-height: 800px;
}
.editor-box >>> .ql-editor {
min-height: 150px;
}
</style>

6
src/views/EntityApplication/VirtualApplication.vue

@ -1,7 +1,11 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<entity-apply-search @entityApplicationSearch="entityApplicationSearch" />
<entity-apply-date :lists="lists" :pagination="pagination" @entityApplicationSearch="entityApplicationSearch" />
<entity-apply-date
:lists="lists"
:pagination="pagination"
@entityApplicationSearch="entityApplicationSearch"
/>
</div>
</template>

107
src/views/IncubationProject/IncubationProject.vue

@ -0,0 +1,107 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<innovative-search :type-lists="typeLists" @handleSelProject="handleSelProject" />
<innovative-date
:lists="lists"
:pagination="pagination"
:type-lists="typeLists"
@handleSelProject="handleSelProject"
/>
</div>
</template>
<script>
import InnovativeSearch from 'components/Innovative/InnovativeSearch.vue';
import InnovativeDate from 'components/Innovative/InnovativeDate.vue';
import { selProduct } from 'config/api';
import { mapActions } from 'vuex';
export default {
name: 'InnovativeProject',
components: {
InnovativeSearch,
InnovativeDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
typeLists: {},
};
},
async created() {
await this.selModelSearch();
await this.handleSelProject();
},
methods: {
...mapActions(['getSelModelSearch']),
/**
* 获取分类管理列表
* @param { Number } model 类型 0成果 1仪器 2实验室 3产品
* @param { String } name 分类名称
*/
async selModelSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
model: 3,
},
};
console.log('获取产品分类');
if (condition) {
if (condition.name) {
params.param.name = condition.name;
}
}
const res = await this.getSelModelSearch(params);
this.typeLists = res;
} catch (error) {
console.log('error: ', error);
}
},
/**
* 获取仪器
* @param { Array } modelIds 类型 0成果 1仪器 2实验室
* @param { String } name 分类名称
*/
async handleSelProject(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 selProduct(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>

7
src/views/InnovativeEquipment/InnovativeEquipment.vue

@ -1,7 +1,12 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<transfer-search :type-lists="typeLists" @selInstrumentSearch="selInstrumentSearch" />
<transfer-date :lists="lists" :pagination="pagination" :type-lists="typeLists" @selInstrumentSearch="selInstrumentSearch" />
<transfer-date
:lists="lists"
:pagination="pagination"
:type-lists="typeLists"
@selInstrumentSearch="selInstrumentSearch"
/>
</div>
</template>

711
src/views/Teacher/Teacher.vue

@ -0,0 +1,711 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<!-- 搜索 -->
<div class="d-flex flex-wrap pb-3">
<div>
<span class="mr-4">人才姓名:</span>
<a-input placeholder="人才姓名" style="width: 150px" v-model="teacherName" />
<span class="ml-4 mr-4">人才分类:</span>
<a-select
@change="typeChange($event, 0)"
mode="multiple"
placeholder="人才分类"
style="width: 400px"
>
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in typeList"
>{{ item.categoryName }}</a-select-option>
</a-select>
<a-button @click="selModelSearch" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button
@click="visible = true"
class="editable-add-btn"
style="margin-top: 1px"
type="primary"
>增加</a-button>
</div>
<!-- 添加表单 -->
<a-modal
:mask-closable="false"
@ok="addTeacherData"
destroy-on-close
title="添加人才"
v-model="visible"
width="700px"
>
<a-form :form="form">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
>
<a-input placeholder="所在公司名称" v-model="addData.company" />
</a-form-item>
<!-- 职务/职称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="职务/职称"
>
<a-input placeholder="职务/职称" v-model="addData.duties" />
</a-form-item>
<!-- 人才姓名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才姓名"
>
<a-input placeholder="人才姓名" v-model="addData.name" />
</a-form-item>
<!-- 人才性别 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才性别"
>
<a-radio-group :default-value="0" @change="changeAddSex">
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<!-- 人才照片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才照片"
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange($event, 1)"
list-type="picture"
name="files"
>
<a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 人才简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才简介"
>
<a-textarea placeholder="人才简介" style="height: 100px" v-model="addData.intro" />
</a-form-item>
<!-- 服务案例 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="服务案例"
>
<a-textarea placeholder="服务案例" style="height: 100px" v-model="addData.serviceCase" />
</a-form-item>
<!-- 人才分类 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才分类"
>
<a-select
@change="typeChange($event, 1)"
mode="multiple"
placeholder="人才分类"
style="width: 100%"
>
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in typeList"
>{{ item.categoryName }}</a-select-option>
</a-select>
</a-form-item>
<!-- 人才聘书 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才聘书"
>
<a-upload
:action="upload"
:before-upload="beforeUpload1"
@change="handleChange($event, 2)"
list-type="picture"
name="files"
>
<a-button v-show="fileList1.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
<!-- 人才简历 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才简历"
>
<a-upload
:action="upload"
:before-upload="beforeUpload2"
@change="handleChange($event, 3)"
list-type="picture"
name="files"
>
<a-button v-show="fileList2.length - 0 === 0">
<a-icon type="upload" />选择图片
</a-button>
</a-upload>
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<div class="main flex-1">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists.list"
:pagination="pagination"
:row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<template slot="sex" slot-scope="text, record">
<span v-if="record.sex === 0"></span>
<span v-else></span>
</template>
<template slot="teacherPhoto" slot-scope="text, record">
<img :src="record.teacherPhoto" style="width: 100%" v-if="record.teacherPhoto" />
</template>
<template slot="resume" slot-scope="text, record">
<img :src="record.resume" style="width: 100%" v-if="record.resume" />
</template>
<template slot="offer" slot-scope="text, record">
<img :src="record.offer" style="width: 100%" v-if="record.offer" />
</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.list.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>
<!-- 修改表单 -->
<a-modal
:mask-closable="false"
@ok="editTeacherData"
destroy-on-close
title="修改"
v-model="visible1"
width="700px"
>
<a-form :form="form">
<!-- 公司名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="公司名称"
>
<a-input placeholder="所在公司名称" v-model="editData.company" />
</a-form-item>
<!-- 职务/职称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="职务/职称"
>
<a-input placeholder="职务/职称" v-model="editData.duties" />
</a-form-item>
<!-- 人才姓名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才姓名"
>
<a-input placeholder="人才姓名" v-model="editData.name" />
</a-form-item>
<!-- 人才性别 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才性别"
>
<a-radio-group :default-value="editData.sex" @change="changeAddSex">
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<!-- 人才照片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才照片"
>
<a-upload :action="upload" @change="handleChange($event, 4)" name="files">
<a-button v-if="!editData.teacherPhoto">
<a-icon type="upload" />选择图片
</a-button>
<img
:src="editData.teacherPhoto"
style="width: 100%; cursor: pointer"
title="重新选择"
v-else
/>
<div slot="listType"></div>
</a-upload>
</a-form-item>
<!-- 人才简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才简介"
>
<a-textarea placeholder="人才简介" style="height: 100px" v-model="editData.intro" />
</a-form-item>
<!-- 服务案例 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="服务案例"
>
<a-textarea placeholder="服务案例" style="height: 100px" v-model="editData.serviceCase" />
</a-form-item>
<!-- 人才分类 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才分类"
>
<a-select
:default-value="editData.categoryList"
@change="typeChange($event, 2)"
mode="multiple"
placeholder="人才分类"
style="width: 100%"
>
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in typeList"
>{{ item.categoryName }}</a-select-option>
</a-select>
</a-form-item>
<!-- 人才聘书 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才聘书"
>
<a-upload :action="upload" @change="handleChange($event, 5)" name="files">
<a-button v-if="!editData.offer">
<a-icon type="upload" />选择图片
</a-button>
<img :src="editData.offer" style="width: 100%; cursor: pointer" title="重新选择" v-else />
<div slot="listType"></div>
</a-upload>
</a-form-item>
<!-- 人才简历 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="人才简历"
>
<a-upload :action="upload" @change="handleChange($event, 6)" name="files">
<a-button v-if="!editData.resume">
<a-icon type="upload" />选择图片
</a-button>
<img :src="editData.resume" style="width: 100%; cursor: pointer" title="重新选择" v-else />
<div slot="listType"></div>
</a-upload>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { upload, getFindTeachH, getSelTutorH, delTeacher, addTeacher, upTeacher } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '所在单位',
align: 'center',
dataIndex: 'company',
key: 'company',
},
{
title: '职务',
align: 'center',
dataIndex: 'duties',
key: 'duties',
},
{
title: '姓名',
align: 'center',
dataIndex: 'name',
key: 'name',
},
{
title: '性别',
align: 'center',
dataIndex: 'sex',
key: 'sex',
scopedSlots: { customRender: 'sex' },
},
{
title: '照片',
align: 'center',
dataIndex: 'teacherPhoto',
key: 'teacherPhoto',
scopedSlots: { customRender: 'teacherPhoto' },
},
{
title: '简介',
align: 'center',
dataIndex: 'intro',
key: 'intro',
},
{
title: '教师聘书',
align: 'center',
dataIndex: 'offer',
key: 'offer',
scopedSlots: { customRender: 'offer' },
},
{
title: '教师简历',
align: 'center',
dataIndex: 'resume',
key: 'resume',
scopedSlots: { customRender: 'resume' },
},
{
title: '编辑',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'Teacher',
data() {
return {
upload,
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
this.fileList = [];
}
return isJpgOrPng;
},
beforeUpload1: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
this.fileList1 = [];
}
return isJpgOrPng;
},
beforeUpload2: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
this.fileList2 = [];
}
return isJpgOrPng;
},
columns,
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'teacher-add' }),
height: '',
lists: {},
pagination: { current: 1, pageSize: 10, total: 0 },
typeList: [], //
teacherType: [], //
addType: [], //
addData: {
company: '', // /
duties: '', // /
intro: '', // (id)
name: '', //
serviceCase: '', //
sex: 0, //
},
teacherName: '',
pageNum: 1,
visible: false, //
visible1: false, //
fileList: [], //
fileList1: [], //
fileList2: [], //
editData: {
id: '', // id
company: '', // /
duties: '', // /
intro: '', // (id)
name: '', //
serviceCase: '', //
sex: 0, //
teacherPhoto: '', //
teacherPhotoId: '', // id
offer: '', // ()
offerId: '', // id
resume: '', // ()
resumeId: '', // id
categoryList: [],
},
};
},
created() {
this.getTeaClass();
this.selModelSearch();
},
mounted() {
let th = 150;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
/**
* 获取人才列表
*/
async selModelSearch() {
try {
const { teacherName, pageNum, teacherType } = this;
const params = {
param: {
teacherName,
pageNum,
pageSize: 10,
teacherType,
},
};
const res = await getFindTeachH(params);
const { code, data, msg } = res.data;
if (code === 200) {
this.lists = data;
this.pagination.total = parseInt(data.total);
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg;
}
} catch (error) {
throw error;
}
},
/**
* 查询人才类型
*/
async getTeaClass() {
try {
const params = { param: { categoryName: '', recStatus: 0 } };
const res = await getSelTutorH(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.typeList = data;
} else {
throw msg;
}
} catch (error) {
throw error;
}
},
/**
* 改变人才分类
*/
typeChange(e, num) {
if (num === 0) {
this.teacherType = e;
} else if (num === 1) {
this.addType = e;
} else if (num === 2) {
this.editData.categoryList = e;
}
},
/**
* 提交添加表单
*/
handleSubmit(e) {
console.log(e);
},
/**
* 表格改变分页
*/
handleTableChange(pagination) {
this.pageNum = pagination.current;
this.selModelSearch();
},
//
async onDelete(teacherId) {
try {
const params = { param: { teacherId } };
const res = await delTeacher(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.selModelSearch();
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
/**
* 添加时修改性别
*/
changeAddSex(e) {
this.addData.sex = e.target.value;
},
/**
* 增加人才的上传图片事件
*/
handleChange(info, num) {
if (info.file.status === 'done') {
if (num === 1) {
this.fileList.push(info.file.response.data[0].id);
} else if (num === 2) {
this.fileList1.push(info.file.response.data[0].id);
} else if (num === 3) {
this.fileList2.push(info.file.response.data[0].id);
} else if (num === 4) {
this.editData.teacherPhoto = info.file.response.data[0].visitUrl;
this.editData.teacherPhotoId = info.file.response.data[0].id;
} else if (num === 5) {
this.editData.offer = info.file.response.data[0].visitUrl;
this.editData.offerId = info.file.response.data[0].id;
} else if (num === 6) {
this.editData.resume = info.file.response.data[0].visitUrl;
this.editData.resumeId = info.file.response.data[0].id;
}
} else if (info.file.status === 'removed') {
if (num === 1) {
this.fileList = info.fileList;
} else if (num === 2) {
this.fileList1 = info.fileList;
} else if (num === 3) {
this.fileList2 = info.fileList;
}
}
},
/**
* 增加人才 事件
*/
async addTeacherData() {
try {
const { addData, addType, fileList, fileList1, fileList2 } = this;
const params = {
param: {
services: addType,
teacherPhoto: fileList[0],
offer: fileList1[0],
resume: fileList2[0],
...addData,
},
};
const res = await addTeacher(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('增加人才成功');
this.selModelSearch();
this.visible = false;
for (let key in this.addData) {
this.addData[key] = '';
}
this.addType = [];
this.fileList = [];
this.fileList1 = [];
this.fileList2 = [];
} else {
this.$message.error('增加人才失败');
}
} catch (error) {
this.$message.error('增加人才失败');
}
},
/**
* 显示修改modal
*/
showEditModal(data) {
let { editData } = this;
editData = { ...data };
this.editData = { ...editData };
this.visible1 = true;
},
/**
* 修改确定事件
*/
async editTeacherData() {
try {
const { editData } = this;
const params = {
param: {
...editData,
offer: editData.offerId,
resume: editData.resumeId,
teacherPhoto: editData.teacherPhotoId,
},
};
const res = await upTeacher(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.visible1 = false;
this.$message.success('修改成功');
this.selModelSearch();
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error('修改失败');
}
},
},
};
</script>

355
src/views/TeacherType/TeacherType.vue

@ -0,0 +1,355 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<!-- 搜索 -->
<div class="d-flex flex-wrap pb-3">
<div>
<span class="mr-4">分类名称:</span>
<a-input placeholder="分类名称" style="width: 150px" v-model="typeName" />
<span class="ml-4 mr-4">分类状态:</span>
<a-select
@change="typeChange($event, 0)"
allow-clear
placeholder="分类状态"
style="width: 200px"
>
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in typeList"
>{{ item.categoryName }}</a-select-option>
</a-select>
<a-button @click="getTeaClass" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button
@click="visible = true"
class="editable-add-btn"
style="margin-top: 1px"
type="primary"
>增加</a-button>
</div>
<!-- 添加表单 -->
<a-modal
:mask-closable="false"
@ok="addClass"
destroy-on-close
title="添加人才"
v-model="visible"
width="700px"
>
<a-form :form="form">
<!-- 分类名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="分类名称"
required
>
<a-input placeholder="分类名称" v-model="addType" />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<div class="main flex-1">
<div style="width: 100%" v-if="list && list.length > 0">
<a-table
:columns="columns"
:data-source="list"
:pagination="pagination"
:row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<template slot="recStatus" slot-scope="text, record">
<span style="width: 100%" v-if="record.recStatus === 0">正常</span>
<span style="width: 100%" v-else-if="record.recStatus === 1">禁用</span>
<span style="width: 100%" v-else-if="record.recStatus === 2">删除</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon
@click="showEditModel(record)"
class="mr-3 pointer"
theme="twoTone"
type="edit"
/>
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?">
<a-icon class="mr-3 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
</a-table>
</div>
<a-empty v-else />
</div>
<!-- 修改表单 -->
<a-modal
:mask-closable="false"
@ok="editChange"
destroy-on-close
title="修改"
v-model="visible1"
width="700px"
>
<a-form :form="form">
<!-- 分类名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="分类名称"
>
<a-input placeholder="分类名称" v-model="editData.categoryName" />
</a-form-item>
<!-- 分类状态 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="分类状态"
>
<a-select
:default-value="getDefault(editData.recStatus)"
@change="typeChange($event, 1)"
allow-clear
placeholder="分类状态"
style="width: 100%"
>
<a-select-option
:key="item.id"
:value="item.id"
v-for="item in typeList"
>{{ item.categoryName }}</a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { getSelTutorH, addTutor, upTutorH, delTutorH } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '分类名称',
align: 'center',
dataIndex: 'categoryName',
key: 'categoryName',
},
{
title: '分类状态',
align: 'center',
dataIndex: 'recStatus',
key: 'recStatus',
scopedSlots: { customRender: 'recStatus' },
},
{
title: '修改',
align: 'center',
dataIndex: 'edit',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'Teacher',
data() {
return {
columns,
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'teacher-add' }),
height: '',
list: [],
pagination: { current: 1, pageSize: 10, total: 0 },
typeList: [
{
id: 0,
categoryName: '正常',
},
{
id: 1,
categoryName: '禁用',
},
{
id: 2,
categoryName: '删除',
},
], //
teacherType: '', //
addType: '', //
typeName: '',
pageNum: 1,
visible: false, //
visible1: false, //
editData: {
categoryName: '',
recStatus: '',
id: '',
},
};
},
created() {
this.getTeaClass();
},
mounted() {
let th = 150;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
/**
* 查询人才类型
*/
async getTeaClass() {
try {
const params = {
param: {
categoryName: this.typeName,
recStatus: this.teacherType,
},
};
const res = await getSelTutorH(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.list = data;
} else {
throw msg;
}
} catch (error) {
throw error;
}
},
/**
* 改变人才分类
*/
typeChange(e, num) {
if (num === 0) {
this.teacherType = e;
} else if (num === 1) {
this.editData.recStatus = e;
}
},
/**
* 添加人才分类
*/
async addClass() {
try {
const { addType } = this;
if (addType === '') {
this.$message.error('请填写分类名称');
return;
}
const params = { param: { categoryName: addType } };
const res = await addTutor(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('分类添加成功');
this.visible = false;
this.getTeaClass();
} else {
this.$message.error('分类添加失败');
}
} catch (error) {
this.$message.error('分类添加失败');
}
},
/**
* 表格改变分页
*/
handleTableChange(pagination) {
// this.pageNum = pagination.current;
this.pagination.current = pagination.current;
},
/**
* 显示修改弹框,获取需要修改的数据
*/
showEditModel(data) {
this.editData = data;
this.visible1 = true;
},
/**
* 确认修改
*/
async editChange() {
try {
const { editData } = this;
if (!editData.categoryName && !editData.recStatus) {
this.$message.error('请填写完整信息');
return;
}
const params = { param: { ...editData } };
const res = await upTutorH(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.visible1 = false;
this.editData = {
categoryName: '',
recStatus: '',
id: '',
};
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error('修改失败');
}
},
/**
* 获取分类默认值
*/
getDefault(e) {
if (e !== '') {
const defaultObj = this.typeList.find(item => {
return item.id === e;
});
return defaultObj.categoryName;
} else {
return '';
}
},
//
async onDelete(id) {
try {
const params = { param: { id } };
const res = await delTutorH(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.getTeaClass();
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
},
};
</script>
Loading…
Cancel
Save