|
@@ -37,6 +37,7 @@
|
|
<script>
|
|
<script>
|
|
import { Input } from 'element-ui'
|
|
import { Input } from 'element-ui'
|
|
import SelectorCard from '@/components/selector/SelectorCard.vue'
|
|
import SelectorCard from '@/components/selector/SelectorCard.vue'
|
|
|
|
+import { cateListMapExp } from '@/assets/js/selector.js'
|
|
import { debounce, getRandomString } from '@/utils/'
|
|
import { debounce, getRandomString } from '@/utils/'
|
|
export default {
|
|
export default {
|
|
name: 'buyerclass-selector-card',
|
|
name: 'buyerclass-selector-card',
|
|
@@ -57,27 +58,7 @@ export default {
|
|
searchContent: '',
|
|
searchContent: '',
|
|
loading: false,
|
|
loading: false,
|
|
// 原始数据
|
|
// 原始数据
|
|
- cateListMapExp: {
|
|
|
|
- '#': ['全部行业'],
|
|
|
|
- C: ['财政', '传媒', '城管', '采矿业', '出版广电'],
|
|
|
|
- D: ['档案', '党委办', '电信行业'],
|
|
|
|
- F: ['法院', '发改'],
|
|
|
|
- G: ['工信', '公安', '国资委', '公共资源交易'],
|
|
|
|
- H: ['海关'],
|
|
|
|
- J: ['教育', '军队', '交通', '纪委', '金融业', '建筑业', '检察院', '机关事务'],
|
|
|
|
- K: ['科技'],
|
|
|
|
- M: ['民政', '民宗'],
|
|
|
|
- N: ['农业', '能源化工', '农林牧渔'],
|
|
|
|
- P: ['批发零售'],
|
|
|
|
- Q: ['气象'],
|
|
|
|
- R: ['人行', '人社', '人大'],
|
|
|
|
- S: ['税务', '水利', '市政', '审计', '商务', '司法', '社会团体', '市场监管', '生态环境'],
|
|
|
|
- T: ['统计', '统战', '体育'],
|
|
|
|
- W: ['文旅', '卫健委'],
|
|
|
|
- X: ['学校', '宣传', '信息技术'],
|
|
|
|
- Y: ['医疗', '银保监', '运输物流', '应急管理'],
|
|
|
|
- Z: ['组织', '政协', '住建', '证监', '政府办', '制造业', '政务中心', '住宿餐饮', '自然资源']
|
|
|
|
- },
|
|
|
|
|
|
+ cateListMapExp,
|
|
// 页面中循环的数据
|
|
// 页面中循环的数据
|
|
cateListMap: {},
|
|
cateListMap: {},
|
|
cateExp: {
|
|
cateExp: {
|
|
@@ -91,6 +72,10 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ initCate (newVal, oldVal) {
|
|
|
|
+ // console.log(...arguments)
|
|
|
|
+ this.setCateState(newVal)
|
|
|
|
+ },
|
|
searchContent: debounce(function (newVal, oldVal) {
|
|
searchContent: debounce(function (newVal, oldVal) {
|
|
const search = newVal
|
|
const search = newVal
|
|
const index = this.getIndexWithString(search)
|
|
const index = this.getIndexWithString(search)
|
|
@@ -100,15 +85,11 @@ export default {
|
|
this.$refs.selectList.scrollTop = wrapper.querySelector(`[data-index=${index}]`).offsetTop
|
|
this.$refs.selectList.scrollTop = wrapper.querySelector(`[data-index=${index}]`).offsetTop
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }, 300),
|
|
|
|
- initCate (newVal, oldVal) {
|
|
|
|
- if (Array.isArray(newVal)) {
|
|
|
|
- this.setCateState(newVal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }, 300)
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
this.initCateMap()
|
|
this.initCateMap()
|
|
|
|
+ this.setCateState(this.initCate)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
changeLoadingState (s) {
|
|
changeLoadingState (s) {
|
|
@@ -178,12 +159,12 @@ export default {
|
|
// 找不到false,就说明全部被选中
|
|
// 找不到false,就说明全部被选中
|
|
allSelected: allSelectedArr.indexOf(false) === -1,
|
|
allSelected: allSelectedArr.indexOf(false) === -1,
|
|
// 找不到true,就说明没有一个被选中
|
|
// 找不到true,就说明没有一个被选中
|
|
- allNotSelected: allSelectedArr.indexOf(true) === -1,
|
|
|
|
|
|
+ allNotSelected: allSelectedArr.indexOf(true) === -1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 初始化页面选中状态
|
|
* 初始化页面选中状态
|
|
- * @param {undefinde|Array} data 要恢复的数据
|
|
|
|
|
|
+ * @param { Array | undefined } data 要恢复的数据
|
|
*/
|
|
*/
|
|
setCateState (data) {
|
|
setCateState (data) {
|
|
// 设置全部按钮
|
|
// 设置全部按钮
|
|
@@ -245,7 +226,7 @@ export default {
|
|
this.$emit('onCancel')
|
|
this.$emit('onCancel')
|
|
},
|
|
},
|
|
onConfirm () {
|
|
onConfirm () {
|
|
- var selected = this.getSelected()
|
|
|
|
|
|
+ const selected = this.getSelected()
|
|
this.$emit('onConfirm', selected)
|
|
this.$emit('onConfirm', selected)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -263,6 +244,5 @@ export default {
|
|
margin: 0 16px;
|
|
margin: 0 16px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|