From 47b35b28a266926f7dc76da401f0cc6ddc8d8fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AD=A6=E5=9D=A4?= <1107410514@qq.com> Date: Wed, 9 Oct 2019 21:57:13 +0800 Subject: [PATCH] kun 19/10/9/21:58 --- package-lock.json | 4 +- src/components/HeaderNav.vue | 47 ++++- src/http.js | 16 +- src/views/InformationQuery.vue | 151 +++++--------- src/views/Login.vue | 24 ++- src/views/home/ApplyFor.vue | 151 ++++++++------ src/views/home/HomePage.vue | 176 +++------------- src/views/home/NewsDetails.vue | 50 ++++- src/views/home/NewsList.vue | 18 +- src/views/personal/Apply.vue | 164 +++++++++++---- src/views/personal/Collection.vue | 22 ++ src/views/personal/Declare.vue | 33 ++- src/views/personal/PersonalZte.vue | 2 +- src/views/project/Application.vue | 10 + src/views/project/Project.vue | 25 ++- src/views/project/Schedule.vue | 325 +++++++++++++++++++---------- static/img/default.jpg | Bin 0 -> 45020 bytes static/img/dsh.png | Bin 0 -> 8305 bytes vue.config.js | 2 +- 19 files changed, 703 insertions(+), 517 deletions(-) create mode 100644 static/img/default.jpg create mode 100644 static/img/dsh.png diff --git a/package-lock.json b/package-lock.json index a060b45..f845568 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6401,8 +6401,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -6873,7 +6872,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index 3c78093..1fe08a0 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -13,8 +13,10 @@
政府购买社会组织服务项目管理
个人中心
- 登录 | - 注册 + 登录 |  + 注册 + {{name}} +  | 退出
@@ -30,18 +32,34 @@ export default { home: require('../../static/img/home.png'), home1: require('../../static/img/home1.png') }, - styleNum: 0 + styleNum: 0, + enter: true, + name: '' } }, computed: {}, watch: {}, - methods: {}, + methods: { + judge () { + if (sessionStorage.token) { + this.name = sessionStorage.name + this.enter = false + } + }, + quit () { + sessionStorage.clear() + this.enter = true + } + }, created () { let sub = this.styleNum sub = this.$props.index_num this.styleNum = sub + this.judge() }, - mounted () { } + mounted () { + + } } @@ -62,9 +80,9 @@ export default { display: flex; justify-content: center; - img{ + img { // width: 100%; - height:100%; + height: 100%; } } @@ -89,6 +107,21 @@ export default { color: #333333; text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); cursor: pointer; + + &:last-child { + width: 120px; + display: flex; + align-items: center; + + .three { + text-align: right; + display: inline-block; + width: 58px; + overflow: hidden; + text-overflow: ellipsis; + word-break: keep-all; + } + } } .style { diff --git a/src/http.js b/src/http.js index edf16bb..2a0c2e8 100644 --- a/src/http.js +++ b/src/http.js @@ -40,10 +40,22 @@ router.beforeEach((to, from, next) => { if (sessionStorage.token) { // 获取当前的token是否存在 console.log('token存在') - next() + if (to.name !== 'application') { + next() + } else { + if ( + sessionStorage.party_id !== 'null') { + next() + } else { + alert('请先成为党组织!') + next({ + path: '/', // 将跳转的路由path作为参数,登录成功后跳转到该路由 + query: { redirect: to.fullPath } + }) + } + } } else { alert('请先登录!') - console.log('token不存在') next({ path: '/login', // 将跳转的路由path作为参数,登录成功后跳转到该路由 query: { redirect: to.fullPath } diff --git a/src/views/InformationQuery.vue b/src/views/InformationQuery.vue index 31fbafd..4a7407f 100644 --- a/src/views/InformationQuery.vue +++ b/src/views/InformationQuery.vue @@ -76,11 +76,8 @@ {{info.society_type}} {{info.legal_person}} {{info.reg_time}} - - {{info.status}} - {{info.status}} - {{info.status}} + 正常 + 异常 @@ -123,7 +117,7 @@ export default { data() { return { index_num: 1, - text: ["全部", "异常名单", "信用良好名录"], + text: ["全部", "黑名单", "信用良好名录"], sub: 0, imgUrl: { xa: require("../../static/img/xa.png") @@ -156,64 +150,7 @@ export default { searchRecord(str) { this.getSearch(str) }, - /** 筛选函数 */ - // scree() { - // if (this.screeOut.society_type == "类型") { - // this.screeOut.society_type = '' - // } else { - // this.record.push({ category: '类型', nameOf: this.screeOut.society_type }) - // } - // if (this.screeOut.reg_time == "登记时间") { - // this.screeOut.reg_time = '' - // } else { - // this.record.push({ category: '登记时间', nameOf: this.screeOut.reg_time }) - // } - - // if (this.screeOut.reg_time == "年检年份") { - // this.screeOut.reg_time = '' - // } else { - // this.record.push({ category: '年检年份', nameOf: this.screeOut.reg_time }) - // } - - // if (this.screeOut.status == "年检情况") { - // this.screeOut.status = '' - // } else { - // this.record.push({ category: '年检情况', nameOf: this.screeOut.status }) - // } - - // /** - // let hash = {}; - // this.record = this.record.reduce((preVal, curVal) => { - // hash[curVal.nameOf] ? '' : hash[curVal.nameOf] = true && preVal.push(curVal); - // return preVal - // }, []) - // */ - - // console.log(this.record) - - // this.record = this.$tool.arrayHeavy(this.record, 'nameOf') - - // let gData = this.$tool.multiFilter(this.bgData, this.screeOut) - // if (gData != undefined && gData != '') { - // this.searchValue = gData - // } else { - // this.$message('您搜索的内容暂无~') - // } - - // if (this.screeOut.society_type == "") { - // this.screeOut.society_type = '类型' - // } - // if (this.screeOut.reg_time == "") { - // this.screeOut.reg_time = '登记时间' - // } - // if (this.screeOut.reg_time == "") { - // this.screeOut.reg_time = '年检年份' - // } - // if (this.screeOut.status == "") { - // this.screeOut.status = '年检情况' - // } - // }, /** 搜索函数 */ getSearch(str) { this.searchValue = []; @@ -233,40 +170,21 @@ export default { } else { this.$message('您搜索的内容暂无~') } - /* - this.sData.forEach((item, index) => { - if ( - item.organization.indexOf(this.searchVal) > -1 || - item.credit.indexOf(this.searchVal) > -1 || - item.type.indexOf(this.searchVal) > -1 || - item.representative.indexOf(this.searchVal) > -1 || - item.date.indexOf(this.searchVal) > -1 - ) { - this.searchValue.push(item); - } - }); - */ }, /** 名单切换 */ btn(index) { let s = this.sub; s = index; this.sub = s; - let t0 = this.arr0 - let t1 = this.arr1 - let t2 = this.bgData switch (this.sub) { case 0: - this.conversion = t2; + this.getData; break; - case 1: - this.conversion = t0; + case 1: this.getDataZ; break; case 2: - this.conversion = t1; - break; - default: + this.getDataO; break; } }, @@ -283,20 +201,46 @@ export default { } _this.bgData = res.data.data.data.info _this.conversion = _this.bgData - _this.bgData.forEach((item, index) => { - - switch (item.status) { - case '异常': - _this.arr0.push(item); - break; - case '正常': - _this.arr1.push(item); - break; - default: - break; - } - + }) + // eslint-disable-next-line handle-callback-err + .catch(err => { + console.log(err) }) + }, + getDataZ() { + let _this = this + this.$http({ + method: 'post', + url: 'v1/society/society', + data: { + status: 0 + } + }).then(res => { + if (res.data.data.code !== 200) { + alert('数据请求失败!') + } + _this.bgData = res.data.data.data.info + _this.conversion = _this.bgData + }) + // eslint-disable-next-line handle-callback-err + .catch(err => { + console.log(err) + }) + }, + getDataO() { + let _this = this + this.$http({ + method: 'post', + url: 'v1/society/society', + data: { + status: 1 + } + }).then(res => { + if (res.data.data.code !== 200) { + return; + } + _this.bgData = res.data.data.data.info + _this.conversion = _this.bgData }) // eslint-disable-next-line handle-callback-err .catch(err => { @@ -308,7 +252,6 @@ export default { this.getData() }, mounted() { - this.getData(); } }; diff --git a/src/views/Login.vue b/src/views/Login.vue index 17b64d2..7991543 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -1,5 +1,7 @@