提交 cc30eaa0 authored 作者: 王天霸's avatar 王天霸

no message

上级 a03ee4cd
差异被折叠。
差异被折叠。
...@@ -140,12 +140,6 @@ export const constantRoutes = [ ...@@ -140,12 +140,6 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/index'], resolve), component: (resolve) => require(['@/views/index'], resolve),
name: '首页', name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
},
{
path: 'demo',
component: (resolve) => require(['@/views/system/goods/add/goodsinfomationdemo'], resolve),
name: 'demo',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
} }
] ]
}, },
......
<template>
<div class="goods-info">
<el-cascader ref="area" :options="options" v-model.trim="producing_area_id" :props="areaProps" placeholder="请选择"
style="width:420px;" collapse-tags size="mini" @change="handleChange('area')"></el-cascader>
</div>
</template>
<script>
import options from '@/assets/options.js'
export default {
name: 'goods',
data() {
return {
producing_area_id:['110000'],
options:options,
areaProps: {
multiple:true,
checkStrictly: false ,
expandTrigger: 'hover',
emitPath: true,
// lazy: true,
// lazyLoad: this.areaLazyLoad,
// value: "id",
// label: "name",
// leaf: "leaf"
},
}
},
watch: {
},
created() {
},
mounted() {
},
methods: {
handleChange(value){
let checkedNodeList =this.$refs[value].getCheckedNodes();
checkedNodeList = checkedNodeList.filter(item =>!(item.parent && item.parent.checked));//
this[value]= checkedNodeList
debugger
},
areaLazyLoad(node, resolve) {
this.getArea(node, resolve);
},
// 商品产地
getArea(node, resolve) {
const level = node.level
let date = {}
if (level === 0) {
date = { pid: 0 }
}else {
date = { pid: node.value }
}
getAreaList(date).then(res => {
let result = {}
result = res.data
if (level === 0) {
result.forEach(item => {
item.value = item.id;
item.label = item.name
item.children=[]
item.leaf = 0
})
}
if (level === 1) {
result.forEach(item => {
item.value = item.id;
item.label = item.name
item.children=[]
//这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
item.leaf = 0
})
}
if (level === 2) {
result.forEach(item => {
item.value = item.id;
item.label = item.name
//这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
item.leaf = 1
})
}
resolve(result)
})
},
} // methods end
}
</script>
<style scoped>
ul {
padding: 0;
}
.goods-info {
padding: 20px 0;
background-color: #fff;
/*margin-top: 18px;*/
}
.type-text-span {
display: inline-block;
width: 420px;
/*margin: 0 20px 0;*/
}
.edit-type-span {
display: inline-block;
cursor: pointer;
margin: 0 20px;
}
/*更多设置*/
.more-settings-p {
display: inline-block;
margin: 20px 0;
padding: 0 0 0 66px;
font-size: 14px;
font-weight: 400;
cursor: pointer;
color: #1890ff;
}
.more-settings-p:hover {
display: inline-block;
color: #647dff;
}
/* 一般提示性文字 */
.tip-span {
color: #909399;
font-size: 12px;
}
/deep/.el-form-item {
margin-bottom: 20px;
}
.list-complete-item {
display: inline-block;
}
.imgSty {
margin: 0 10px;
}
.iconcur {
cursor: pointer;
}
/*/deep/.el-cascader-menu {*/
/* height:600px;*/
/*}*/
/deep/ .el-cascader-menu{
max-width: 250px !important;
min-width: 250px !important;
}
/deep/ .el-cascader-menu__wrap{
width:auto !important;
max-width: 250px !important;
min-width: 250px !important;
}
.opendow /deep/ .el-dialog{
width:800px;
}
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论