Browse Source

园区资讯

feature/20220929首页静态开发
王露 2 years ago
parent
commit
65e71fc9c2

+ 50
- 3
digital-park-web/digital-park/package-lock.json View File

@@ -25,7 +25,8 @@
"vue-router": "^3.1.6",
"vue-seamless-scroll": "^1.1.21",
"vuedraggable": "^2.24.0",
"vuex": "^3.1.3"
"vuex": "^3.1.3",
"vuex-persist": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.3.0",
@@ -5249,7 +5250,7 @@
},
"node_modules/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
},
"node_modules/crypto-random-string": {
@@ -17830,6 +17831,31 @@
"vue": "^2.0.0"
}
},
"node_modules/vuex-persist": {
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/vuex-persist/-/vuex-persist-3.1.3.tgz",
"integrity": "sha512-QWOpP4SxmJDC5Y1+0+Yl/F4n7z27syd1St/oP+IYCGe0X0GFio0Zan6kngZFufdIhJm+5dFGDo3VG5kdkCGeRQ==",
"dependencies": {
"deepmerge": "^4.2.2",
"flatted": "^3.0.5"
},
"peerDependencies": {
"vuex": ">=2.5"
}
},
"node_modules/vuex-persist/node_modules/deepmerge": {
"version": "4.2.2",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vuex-persist/node_modules/flatted": {
"version": "3.2.7",
"resolved": "https://registry.npmmirror.com/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
},
"node_modules/watchpack": {
"version": "1.6.1",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.1.tgz",
@@ -23175,7 +23201,7 @@
},
"crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
},
"crypto-random-string": {
@@ -33471,6 +33497,27 @@
"integrity": "sha1-8q1z4/tzaRaYs4yT9m5Y4meUcYA=",
"requires": {}
},
"vuex-persist": {
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/vuex-persist/-/vuex-persist-3.1.3.tgz",
"integrity": "sha512-QWOpP4SxmJDC5Y1+0+Yl/F4n7z27syd1St/oP+IYCGe0X0GFio0Zan6kngZFufdIhJm+5dFGDo3VG5kdkCGeRQ==",
"requires": {
"deepmerge": "^4.2.2",
"flatted": "^3.0.5"
},
"dependencies": {
"deepmerge": {
"version": "4.2.2",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
},
"flatted": {
"version": "3.2.7",
"resolved": "https://registry.npmmirror.com/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
}
}
},
"watchpack": {
"version": "1.6.1",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.6.1.tgz",

+ 2
- 1
digital-park-web/digital-park/package.json View File

@@ -26,7 +26,8 @@
"vue-router": "^3.1.6",
"vue-seamless-scroll": "^1.1.21",
"vuedraggable": "^2.24.0",
"vuex": "^3.1.3"
"vuex": "^3.1.3",
"vuex-persist": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.3.0",

+ 2
- 1
digital-park-web/digital-park/src/App.vue View File

@@ -15,7 +15,8 @@ export default {
return {};
},
created() {
this.$store.dispatch('getUserInfo');
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getAllPickListByEntity");
},
methods: {},
};

+ 3
- 0
digital-park-web/digital-park/src/api/company.js View File

@@ -9,6 +9,9 @@ export const getCompanyList = p => get("/areaCompany/getCompanyList", p);
// 获取企业详情
export const getCompanyById = p => get("/areaCompany/getCompanyById", p);

// 获取所属行业
export const getOwnerIntermediaryList = p => get("/areaCompany/getOwnerIntermediaryList", p);

// 获取园区资讯列表
export const getCompanyNewsList = p => get("/areaCompany/getCompanyNewsList", p);


+ 5
- 1
digital-park-web/digital-park/src/components/Pagination.vue View File

@@ -49,7 +49,11 @@ export default {
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
watch: {
currentPage(newVal) {
this.currentPageTemp = newVal;
},
},
//方法集合
methods: {
handleSizeChange(val) {

+ 17
- 4
digital-park-web/digital-park/src/store/actions.js View File

@@ -1,10 +1,23 @@
import { RECEIVE_PRESENT_USER } from "./mutation-types";
import { getSession } from "@api/common";
import { RECEIVE_PRESENT_USER, GET_ALL_TAB, GET_CLASSIFICATION_TYPE } from "./mutation-types";
import { getSession, getAllPickListByEntity, getClassificationType } from "@api/common";

export default {
// 异步获取用户信息
async getUserInfo({ commit }) {
const result = await getSession();
commit(RECEIVE_PRESENT_USER, result.data.data)
}
commit(RECEIVE_PRESENT_USER, result.data.data);
},

// 获取所有列表
async getAllPickListByEntity({ commit }) {
const result = await getAllPickListByEntity();
commit(GET_ALL_TAB, result.data.data);
},

// 获取三级分类类型
async getClassificationType({ commit }) {
const result = await getClassificationType();
console.log(result.data.data);
commit(GET_CLASSIFICATION_TYPE, result.data.data);
},
};

+ 6
- 0
digital-park-web/digital-park/src/store/index.js View File

@@ -4,6 +4,11 @@ import getters from "./getters";
import state from "./state";
import mutations from "./mutations";
import actions from "./actions";
import VuexPersistence from "vuex-persist";
const vuexLocal = new VuexPersistence({
storage: window.localStorage,
});

Vue.use(Vuex);
// export default new Vuex.Store({
// state,
@@ -16,4 +21,5 @@ export default new Vuex.Store({
mutations,
actions,
getters,
plugins: [vuexLocal.plugin],
});

+ 3
- 1
digital-park-web/digital-park/src/store/mutation-types.js View File

@@ -1,2 +1,4 @@
// 接收用户信息
export const RECEIVE_PRESENT_USER = 'receive_present_user'
export const RECEIVE_PRESENT_USER = "receive_present_user";
export const GET_ALL_TAB = "get_all_tab";
export const GET_CLASSIFICATION_TYPE = "get_classification_type";

+ 12
- 2
digital-park-web/digital-park/src/store/mutations.js View File

@@ -1,6 +1,16 @@
import { RECEIVE_PRESENT_USER } from "./mutation-types";
import {
RECEIVE_PRESENT_USER,
GET_ALL_TAB,
GET_CLASSIFICATION_TYPE,
} from "./mutation-types";
export default {
[RECEIVE_PRESENT_USER](state, payload) {
state.sessionInfo = payload;
}
},
[GET_ALL_TAB](state, data) {
state.tabList = data;
},
[GET_CLASSIFICATION_TYPE](state, data) {
state.classificationType = data;
},
};

+ 2
- 1
digital-park-web/digital-park/src/store/state.js View File

@@ -1,5 +1,6 @@
// 状态对象
export default {
sessionInfo: {},
test: 123,
tabList: null,
classificationType: null,
};

+ 3
- 1
digital-park-web/digital-park/src/views/park-enterprises/Detail.vue View File

@@ -9,7 +9,9 @@
<img src="" alt="" />
<span>
当前位置:
<span class="pointer">园区企业</span>
<span class="pointer" @click="$router.push('/company-list')">
园区企业
</span>
<span style="margin:0 4px;">></span>
<span class="current pointer">详情</span>
</span>

+ 47
- 29
digital-park-web/digital-park/src/views/park-enterprises/List.vue View File

@@ -9,9 +9,9 @@
<img src="@assets/image/company/icon_address.png" alt="地址" />
<span>
当前位置:
<span class="pointer">园区企业</span>
<span style="margin:0 4px;">></span>
<span class="current pointer">详情</span>
<span class="pointer" @click="$router.push('/company-list')">
园区企业
</span>
</span>
</div>
<div class="head_title">
@@ -36,7 +36,7 @@
:class="['pointer', item.activeScreen === index ? 'active' : '']"
@click="changeScreenItem(screenIndex, arrItem, index)"
>
{{ arrItem }}
{{ screenIndex === 0 ? arrItem : arrItem.text }}
</li>
</ul>
<!-- <div>
@@ -80,8 +80,9 @@ import Footer from "@components/Footer.vue";
import CompanyItem from "./components/CompanyItem.vue";
import Pagination from "@components/Pagination.vue";
import SearchInput from "@views/park-information/components/SearchInput.vue";
import { getCompanyList } from "@api/company";
import { getOwnerIntermediaryList, getCompanyList } from "@api/company";
import { handlePageNation } from "@mixin/pageNationMixin";
import { mapState } from "vuex";

export default {
//import引入的组件需要注入到对象中才能使用
@@ -93,31 +94,18 @@ export default {
screen: [
{
name: "所属行业",
value: [
"全部",
"信息技术",
"网络科技",
"电子科技",
"新能源科技",
"电子商务",
"贸易",
"商贸",
"企业管理",
"财务咨询",
"商务咨询",
"电子商务",
"贸易",
"商贸",
"企业管理",
"财务咨询",
"商务咨询",
],
value: ["全部"],
activeScreen: 0,
},
{
name: "认领状态",
value: ["全部", "已认领", "未认领"],
activeScreen: 1,
value: [
{
itemId: "",
text: "全部",
},
],
activeScreen: 0,
},
],
pageLoading: false,
@@ -131,14 +119,33 @@ export default {
},
total: 0,
dataList: [],
industryList: [],
};
},
//监听属性 类似于data概念
computed: {},
computed: {
...mapState(["tabList"]),
},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
// 获取所属行业
getOwnerIntermediaryList() {
getOwnerIntermediaryList()
.then(res => {
console.log(res.data);
if (res.data.status == 0) {
this.industryList = res.data.data;
this.screen[0].value = [...this.screen[0].value, ...this.industryList];
} else {
this.$message.error(`获取数据失败,请刷新重试!`);
}
})
.catch(err => {
this.$message.error(`获取数据失败,失败原因${err},请刷新重试!`);
});
},
getData() {
this.pageLoading = true;
getCompanyList(this.queryParams)
@@ -158,7 +165,13 @@ export default {
},
changeScreenItem(screenIndex, arrItem, index) {
this.screen[screenIndex].activeScreen = index;
this.queryParams.ownerIndustry = arrItem;
if (screenIndex === 0) {
this.queryParams.ownerIndustry = arrItem === "全部" ? "" : arrItem;
}
if (screenIndex === 1) {
this.queryParams.claimStateId = arrItem.itemId;
}
this.queryParams.page = 1;
this.getData();
},
//搜索
@@ -170,6 +183,11 @@ export default {
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {
this.getOwnerIntermediaryList();
this.screen[1].value = [
...this.screen[1].value,
...this.tabList.qiyeliebiao_renlingzhuangtai,
];
this.getData();
},
//生命周期 - 挂载完成(可以访问DOM元素)
@@ -253,7 +271,7 @@ export default {
margin-bottom: 5px;
margin-right: 10px;
}
s .active {
.active {
background-image: linear-gradient(135deg, #42a6fe 0%, #0070d2 100%);
@include font(16px, #fff);
}

+ 28
- 15
digital-park-web/digital-park/src/views/park-enterprises/components/CompanyItem.vue View File

@@ -8,7 +8,7 @@
<span
:class="[
'claim_state',
companyInfo.claimState.text === '已领' ? 'claimed' : 'not_claim',
companyInfo.claimState.text === '已领' ? 'claimed' : 'not_claim',
]"
>
{{ companyInfo.claimState.text }}
@@ -25,10 +25,17 @@
<span>行业:{{ companyInfo.ownerIndustry }}</span>
<span>地址:{{ companyInfo.businessAddress }}</span>
</div>
<div class="advantage_box">
<span v-for="item in companyInfo.enterpriseLabel.text" :key="item">{{ item }}</span>
<div class="advantage_box" v-if="enterpriseLabel.length > 0">
<span v-for="item in enterpriseLabel" :key="item">
{{ item }}
</span>
</div>
<div class="business">
<div
:class="[
'business',
!enterpriseLabel || enterpriseLabel.length === 0 ? 'two_rows' : 'one_rows',
]"
>
<template v-if="companyInfo.businessScope">
<span>主营业务:</span>
{{ companyInfo.businessScope }}
@@ -56,7 +63,11 @@ export default {
return {};
},
//监听属性 类似于data概念
computed: {},
computed: {
enterpriseLabel() {
return this.companyInfo?.enterpriseLabel?.text ?? [];
},
},
//监控data中的数据变化
watch: {},
//方法集合
@@ -74,13 +85,6 @@ export default {
created() {},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang="scss" scoped>
@@ -101,11 +105,11 @@ export default {
height: 180px;
padding-left: 30px;
@include border-box;
@include flex(column, space-between, flex-start, null);
@include flex(column, flex-start, flex-start, null);
overflow: hidden;
.title_box {
@include flex(row, flex-start, center, null);
margin-bottom: 8px;
margin-bottom: 15px;
.company_title {
@include font(18px, #334a5f);
font-weight: 600;
@@ -127,6 +131,7 @@ export default {
}
.company_info {
width: 100%;
margin-bottom: 10px;
@include font(16px, #637485);
@include text-ellipsis;
span {
@@ -140,6 +145,8 @@ export default {
}
}
.advantage_box {
margin-bottom: 15px;
margin-top: 10px;
span {
@include font(14px, #0086e7);
padding: 2px 8px;
@@ -150,14 +157,20 @@ export default {
}
.business {
width: 100%;
min-height: 20px;
@include font(16px, #637485);
@include text-ellipsis;
margin-top: 8px;
span {
@include font(16px, #334a5f);
font-weight: 600;
}
}
.one_rows {
@include text-ellipsis;
}
.two_rows {
@include text-ellipsis-multiple(2);
}
}
}
</style>

+ 33
- 7
digital-park-web/digital-park/src/views/park-information/Index.vue View File

@@ -9,9 +9,16 @@
<img src="@assets/image/company/icon_address.png" alt="地址" />
<span>
当前位置:
<span class="pointer">园区资讯问答</span>
<span style="margin:0 4px;">></span>
<span class="current pointer">详情</span>
<span
class="pointer"
@click="$router.push('/park-information/question-list')"
>
园区资讯问答
</span>
<template v-if="currentPage">
<span style="margin:0 4px;">></span>
<span class="current pointer">{{ currentPage }}</span>
</template>
</span>
</div>
<div class="head_title">
@@ -39,17 +46,36 @@ export default {
data() {
//这里存放数据
return {
input2: "",
currentPage: "",
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
watch: {
$route: {
handler(newVal) {
this.setCurrentPage(newVal);
},
},
deep: true,
},
//方法集合
methods: {},
methods: {
setCurrentPage(route) {
if (route.name === "QuestionDetail") {
this.currentPage = "详情";
} else if (route.name === "QuestionSearch") {
this.currentPage = "搜索页";
} else {
this.currentPage = "";
}
},
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
created() {
this.setCurrentPage(this.$route);
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
};

+ 22
- 25
digital-park-web/digital-park/src/views/park-information/List.vue View File

@@ -3,12 +3,12 @@
<div class="">
<div class="tab_box">
<span
:class="['pointer', activeTab === item.value ? 'active' : '']"
v-for="item in tabs"
:key="item.value"
@click="changeTab(item)"
v-for="(item, index) in tabs"
:class="['pointer', activeTab === index ? 'active' : '']"
:key="item.itemId"
@click="changeTab(index)"
>
{{ item.name }}
{{ item.text }}
</span>
</div>
<search-box @search-data="searchData"></search-box>
@@ -34,6 +34,8 @@ import QuestionList from "./components/QuestionList.vue";
import Pagination from "@components/Pagination.vue";
import { getCompanyNewsList } from "@api/company";
import { handlePageNation } from "@mixin/pageNationMixin";
import { mapState } from "vuex";

export default {
//import引入的组件需要注入到对象中才能使用
components: { SearchBox, QuestionList, Pagination },
@@ -41,39 +43,31 @@ export default {
data() {
//这里存放数据
return {
tabs: [
{
name: "园区公告",
value: 1,
},
{
name: "产业咨询",
value: 2,
},
{
name: "常见问答",
value: 3,
},
],
activeTab: 1,
tabs: [],
activeTab: 0,
pageLoading: false,
queryParams: {
page: 1,
pageSize: 10,
search: "",
type: "",
},
total: 0,
dataList: [],
};
},
//监听属性 类似于data概念
computed: {},
computed: {
...mapState(["tabList"]),
},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
changeTab(item) {
this.activeTab = item.value;
changeTab(index) {
this.activeTab = index;
this.queryParams.type = this.tabs[index].itemId;
this.getData();
},
getData() {
this.pageLoading = true;
@@ -98,12 +92,12 @@ export default {
this.queryParams.page = 1;
this.getData();
},
// // 分页
// 分页
// changePage(val) {
// this.queryParams.page = val;
// this.getData();
// },
// // 分页
// 分页
// changePageSize(val) {
// this.queryParams.pageSize = val;
// this.queryParams.page = 1;
@@ -112,7 +106,10 @@ export default {
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {
this.tabs = this.tabList.yuanquzixun_zixunleixing8;
this.queryParams.type = this.tabs[0].itemId;
this.getData();
console.log(this.tabList);
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},

+ 1
- 0
digital-park-web/digital-park/src/views/park-information/SearchList.vue View File

@@ -40,6 +40,7 @@ export default {
page: 1,
pageSize: 10,
search: "",
type: "",
},
total: 0,
dataList: [],

+ 3
- 1
digital-park-web/digital-park/src/views/park-information/components/SearchInput.vue View File

@@ -44,7 +44,9 @@ export default {
},
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
created() {
this.searchInput = this.$route.query.searchWord;
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
};

+ 1
- 3
digital-park-web/digital-park/vue.config.js View File

@@ -24,9 +24,7 @@ module.exports = {
proxy: {
"/domain": {
// target: "http://localhost:80",
// target: "http://192.168.18.236:18888/",
target: "http://192.168.18.138:18888",
// target: "http://localhost:80",
target: "http://192.168.18.236:18888/",
changeOrigin: true,
pathRewrite: {
"^/domain": "",

Loading…
Cancel
Save