@@ -65,31 +69,31 @@
v-for="(item,index) in sData"
:key="index"
:class="index % 2 == 0 ? 'bgcbz' : 'bgcz'"
+ class="tr"
>
-
{{item.id}} |
{{item.organization}} |
{{item.credit}} |
{{item.type}} |
{{item.representative}} |
{{item.date_year + '-' + item.date_time}} |
-
正常 |
-
异常 |
+
{{item.zt}} |
+
{{item.zt}} |
- | {{item.id}} |
{{item.organization}} |
{{item.credit}} |
{{item.type}} |
{{item.representative}} |
{{item.date_year + '-' + item.date_time}} |
- 正常 |
- 异常 |
+ {{item.zt}} |
+ {{item.zt}} |
@@ -120,11 +124,12 @@ export default {
},
searchVal: "",
searchValue: [],
+ record: [],
screeOut: {
- type: '',
- date_time: '',
- date_year: '',
- zt: '',
+ type: '类型',
+ date_time: '登记时间',
+ date_year: '年检年份',
+ zt: '年检情况'
},
sData: [
{
@@ -135,7 +140,7 @@ export default {
representative: "王五",
date_time: "09-18",
date_year: '2019',
- zt: 0
+ zt: '正常'
},
{
id: 2,
@@ -145,7 +150,7 @@ export default {
representative: "李四",
date_time: "09-19",
date_year: '2017',
- zt: 1
+ zt: '正常'
},
{
id: 4,
@@ -155,7 +160,7 @@ export default {
representative: "李四",
date_time: "09-19",
date_year: '2019',
- zt: 1
+ zt: '异常'
},
{
id: 5,
@@ -165,7 +170,7 @@ export default {
representative: "李四",
date_time: "09-18",
date_year: '2017',
- zt: 1
+ zt: '异常'
},
{
id: 6,
@@ -175,7 +180,7 @@ export default {
representative: "李四",
date_time: "09-19",
date_year: '2019',
- zt: 1
+ zt: '正常'
},
{
id: 3,
@@ -185,32 +190,94 @@ export default {
representative: "张三",
date_time: "09-18",
date_year: "2017",
- zt: 0
+ zt: '异常'
}
]
};
},
computed: {},
- watch: {},
+ watch: {
+ record(newVal, oldVal) { }
+ },
methods: {
+ /** 删除单条数据 */
+ del(index) {
+ let delArr = this.record.splice(index, 1)
+ },
+ /** 调用搜索函数 */
+ searchRecord(str) {
+ this.getSearch(str)
+ },
/** 筛选函数 */
scree() {
+ if (this.screeOut.type == "类型") {
+ this.screeOut.type = ''
+ } else {
+ this.record.push({ category: '类型', nameOf: this.screeOut.type })
+ }
+
+ if (this.screeOut.date_time == "登记时间") {
+ this.screeOut.date_time = ''
+ } else {
+ this.record.push({ category: '登记时间', nameOf: this.screeOut.date_time })
+ }
+
+ if (this.screeOut.date_year == "年检年份") {
+ this.screeOut.date_year = ''
+ } else {
+ this.record.push({ category: '年检年份', nameOf: this.screeOut.date_year })
+ }
+
+ if (this.screeOut.zt == "年检情况") {
+ this.screeOut.zt = ''
+ } else {
+ this.record.push({ category: '年检情况', nameOf: this.screeOut.zt })
+ }
+
+ /**
+ let hash = {};
+ this.record = this.record.reduce((preVal, curVal) => {
+ hash[curVal.nameOf] ? '' : hash[curVal.nameOf] = true && preVal.push(curVal);
+ return preVal
+ }, [])
+ */
+
+ this.record = this.$tool.arrayHeavy(this.record, 'nameOf')
+
let gData = this.$tool.multiFilter(this.sData, this.screeOut)
if (gData != undefined && gData != '') {
this.searchValue = gData
} else {
this.$message('您搜索的内容暂无~')
}
+
+ if (this.screeOut.type == "") {
+ this.screeOut.type = '类型'
+ }
+ if (this.screeOut.date_time == "") {
+ this.screeOut.date_time = '登记时间'
+ }
+ if (this.screeOut.date_year == "") {
+ this.screeOut.date_year = '年检年份'
+ }
+ if (this.screeOut.zt == "") {
+ this.screeOut.zt = '年检情况'
+ }
},
/** 搜索函数 */
- getSearch() {
+ getSearch(str) {
this.searchValue = [];
- if (this.searchVal === "") {
+
+ if (this.searchVal === "" && str !== "" && str !== undefined && str !== null && str !== 'null') {
+ this.searchVal = str
+ } else if (this.searchVal === "") {
this.$message.warning("请输入搜索内容");
return;
}
let searchData = this.$tool.setSearch(this.sData, this.searchVal)
+ // console.log(searchData);
+
if (searchData != undefined && searchData != '') {
this.searchValue = searchData
@@ -218,18 +285,19 @@ 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);
- // }
- // });
+ /*
+ 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) {
@@ -264,9 +332,32 @@ export default {
.box-table {
width: 100%;
+ margin-top: -25px;
table {
- width: 100%;
+ width: 1130px;
+ counter-reset: items 0; /* 0 可以省略 */
+ counter-increment: counter-name integer;
+ box-sizing: border-box;
+
+ .tr {
+ counter-increment: items 1; /* 1 同样可以省略 */
+ &:before {
+ content: counter(items);
+ font-family: "MicrosoftYaHei";
+ font-size: 16px;
+ font-weight: normal;
+ font-stretch: normal;
+ letter-spacing: 0px;
+ color: #595959;
+ width: 86px;
+ height: 40px;
+ display: inline-block;
+ text-align: center;
+ line-height: 40px;
+ box-sizing: border-box;
+ }
+ }
th {
line-height: 40px;
@@ -279,6 +370,7 @@ export default {
letter-spacing: 0px;
color: #666666;
background-color: #f6fafd;
+ box-sizing: border-box;
&:nth-of-type(1) {
width: 86px;
@@ -286,26 +378,29 @@ export default {
&:nth-of-type(2) {
width: 160px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
}
&:nth-of-type(3) {
width: 240px;
+ border-left: 1px solid #dcebf6;
+
}
&:nth-of-type(4) {
width: 160px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
}
&:nth-of-type(5) {
width: 160px;
+ border-left: 1px solid #dcebf6;
+
}
&:nth-of-type(6) {
- width: 180px;
+ width: 160px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
}
&:nth-of-type(7) {
- width: 144px;
+ width: 140px;
+ border-left: 1px solid #dcebf6;
+
}
}
@@ -325,35 +420,38 @@ export default {
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
+ box-sizing: border-box;
color: #595959;
&:nth-of-type(1) {
- width: 86px;
- }
- &:nth-of-type(2) {
width: 160px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
+ }
+ &:nth-of-type(2) {
+ width: 240px;
+ border-left: 1px solid #dcebf6;
}
&:nth-of-type(3) {
- width: 240px;
+ width: 160px;
+ border-left: 1px solid #dcebf6;
}
&:nth-of-type(4) {
width: 160px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
}
&:nth-of-type(5) {
width: 160px;
+ border-left: 1px solid #dcebf6;
}
&:nth-of-type(6) {
- width: 180px;
+ width: 140px;
border-left: 1px solid #dcebf6;
- border-right: 1px solid #dcebf6;
}
+ /*
&:nth-of-type(7) {
width: 144px;
}
+ */
}
}
@@ -424,6 +522,7 @@ export default {
font-stretch: normal;
letter-spacing: 0px;
color: #666666;
+ margin-bottom: 25px;
.iconfont {
margin-left: 10px;
diff --git a/src/views/Registered.vue b/src/views/Registered.vue
index 06f9bfc..bc9172d 100644
--- a/src/views/Registered.vue
+++ b/src/views/Registered.vue
@@ -1,26 +1,24 @@
-
+
@@ -188,9 +164,42 @@ export default {
},
computed: {},
watch: {},
- methods: {},
- created () {},
- mounted () {}
+ methods: {
+
+ registered () {
+ let _this = this
+ if (this.fieldsName.organization_name === undefined) {
+ alert('组织名称不可为空')
+ } else if (this.fieldsName.password === undefined) {
+ alert('密码不可为空')
+ } else if (this.fieldsName.confirm_password === undefined) {
+ alert('请输入确认密码')
+ } else {
+ console.log(_this.fieldsName, 111)
+
+ this.$http({
+ method: 'post',
+ url: 'v1/login/reg',
+ data: {
+ FieldsName: _this.fieldsName
+ }
+ })
+ .then(res => {
+ if (res.data.code === 200) {
+ _this.$Message.success('注册成功!')
+ } else {
+ _this.$Message.error('注册失败!')
+ }
+ })
+ // eslint-disable-next-line handle-callback-err
+ .catch(err => {
+ console.log(err, 555)
+ })
+ }
+ }
+ },
+ created () { },
+ mounted () { }
}
diff --git a/src/views/home/HomePage.vue b/src/views/home/HomePage.vue
index 86a7981..7996cf7 100644
--- a/src/views/home/HomePage.vue
+++ b/src/views/home/HomePage.vue
@@ -1,5 +1,5 @@
-
+
@@ -8,18 +8,12 @@
-
-
![]()
-
加强基础设施建设,完善城市功能,扩大城市容量
-
-
-
![]()
-
加强基础设施建设,完善城市功能,扩大城市容量
-
-
-
![]()
-
加强基础设施建设,完善城市功能,扩大城市容量
-
+
+
+
![]()
+
{{banner.title}}
+
+
@@ -37,11 +31,11 @@
-
更多>>
+
更多>>
@@ -103,9 +97,9 @@
更多>>
@@ -120,9 +114,9 @@
更多>>
@@ -149,10 +143,10 @@
党建矩阵
-
-
-
![]()
-
中国政府网站
+
+
+
![]()
+
{{links.name}}
![]()
{
+ if (res.data.code === 200) {
+ _this.bgData = res.data.data
+ } else {
+ _this.$Message.error('请求数据有问题!')
+ }
+ })
+ // eslint-disable-next-line handle-callback-err
+ .catch(err => {
+ console.log(err)
+ })
}
/*
initialSwiper() {
@@ -358,7 +346,9 @@ export default {
}
*/
},
- created() { },
+ created() {
+ this.getData()
+ },
mounted() {
this.initSwiper();
/*this.initialSwiper();*/
diff --git a/static/js/http.js b/static/js/http.js
deleted file mode 100644
index f25b7f3..0000000
--- a/static/js/http.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import axios from 'axios'
-import router from '../../src/router'
-
-// axios 配置
-axios.defaults.timeout = 7200
-axios.defaults.baseURL = ''
-
-// test使用的
-window.localStorage['token'] = JSON.stringify('shenxuekundetoken')
-
-// http request 拦截器
-axios.interceptors.request.use(
- config => {
- if (localStorage.token) {
- // 判断token是否存在
- config.headers.Authorization = localStorage.token // 将token设置成请求头
- }
- return config
- },
- err => {
- return Promise.reject(err)
- }
-)
-
-// http response 拦截器
-axios.interceptors.response.use(
- response => {
- if (response.data.errno === 999) {
- router.replace('/')
- console.log('token过期')
- }
- return response
- },
- error => {
- return Promise.reject(error)
- }
-)
-export default axios
diff --git a/static/js/tool.js b/static/js/tool.js
index 2b631bc..cc503a2 100644
--- a/static/js/tool.js
+++ b/static/js/tool.js
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-expressions */
// 使用递归遍历所有属性判断是否 在对象里面匹配到值 借鉴js对象深拷贝的方式
function loopObj (searkey, obj) {
let bool = false
@@ -52,6 +53,21 @@ let tool = {
return !!~filters[key].indexOf(item[key])
})
})
+ },
+
+ /**
+ * 数组对象去重
+ * @param {*} arr 目标数组
+ * @param {*} reference 去重参数
+ */
+ arrayHeavy: function unique (arr, reference) {
+ let map = new Map()
+ arr.forEach((item, index) => {
+ if (!map.has(item[reference])) {
+ map.set(item[reference], item)
+ }
+ })
+ return [...map.values()]
}
}
diff --git a/vue.config.js b/vue.config.js
index 354c1c6..d63911b 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -5,14 +5,14 @@ module.exports = {
indexPath: 'index.html',
devServer: {
- open: false,
+ open: true,
host: 'localhost',
port: '8080',
https: false,
hotOnly: false,
proxy: {
'/url/': {
- target: '',
+ target: 'http://chaoyang.yulongcode.com/api/',
ws: false,
changeOrigin: true,
pathRewrite: {
@@ -28,7 +28,7 @@ module.exports = {
hints: 'warning',
maxEntrypointSize: 500000000,
maxAssetSize: 300000000,
- assetFilter: function(assetFilename) {
+ assetFilter: function (assetFilename) {
return assetFilename.endsWith('.js')
}
}