|
@@ -18,8 +18,9 @@
|
|
<p class="hint" style="color: rgb(250, 80, 61)">提示:选择好后,点击旁白就会选中!</p>
|
|
<p class="hint" style="color: rgb(250, 80, 61)">提示:选择好后,点击旁白就会选中!</p>
|
|
|
|
|
|
<el-row type="flex">
|
|
<el-row type="flex">
|
|
- <el-col :span="9">
|
|
|
|
|
|
+ <el-col :span="14">
|
|
<el-cascader
|
|
<el-cascader
|
|
|
|
+ style="width:335px;"
|
|
:options="areaInfoTree"
|
|
:options="areaInfoTree"
|
|
:props="{ children: 'children', label: 'name' ,value:'id'}"
|
|
:props="{ children: 'children', label: 'name' ,value:'id'}"
|
|
@expand-change="handleChange"
|
|
@expand-change="handleChange"
|
|
@@ -65,15 +66,32 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- 直接删除此处就行 -->
|
|
|
|
+ <hr/>
|
|
|
|
+ <el-form-item label="">
|
|
|
|
+ <p>封装组件测试用的 </p>
|
|
|
|
+ <cascader
|
|
|
|
+ :options="areaInfoTree"
|
|
|
|
+ @expandChange="()=>{}"
|
|
|
|
+ @change="()=>{}"
|
|
|
|
+ :props="{ children: 'children', label: 'name' ,value:'id'}"
|
|
|
|
+ ></cascader>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
</el-form>
|
|
</el-form>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { mapActions } from "vuex";
|
|
import { mapActions } from "vuex";
|
|
|
|
+import Cascader from "../../components/Cascader/Cascader";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "AreaInfo",
|
|
name: "AreaInfo",
|
|
|
|
+ components: {
|
|
|
|
+ cascader: Cascader
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
isShowDialog: false,
|
|
isShowDialog: false,
|
|
@@ -82,7 +100,7 @@ export default {
|
|
cascaderPlaceholder: "请选择/不选择默认根级",
|
|
cascaderPlaceholder: "请选择/不选择默认根级",
|
|
formData: {
|
|
formData: {
|
|
parentId: "-1",
|
|
parentId: "-1",
|
|
- name: "",
|
|
|
|
|
|
+ name: ""
|
|
// orgId: "1"
|
|
// orgId: "1"
|
|
},
|
|
},
|
|
areaInfoTree: [], // tree 数据
|
|
areaInfoTree: [], // tree 数据
|
|
@@ -133,13 +151,14 @@ export default {
|
|
console.log(value);
|
|
console.log(value);
|
|
this.formData.parentId = value[value.length - 1];
|
|
this.formData.parentId = value[value.length - 1];
|
|
// 级联选择时 因组件限制 需拼接 名字字符串在级联选择器上显示
|
|
// 级联选择时 因组件限制 需拼接 名字字符串在级联选择器上显示
|
|
- this.findAreaName(value);
|
|
|
|
|
|
+ this.cascaderPlaceholder = this.findAreaName(value);
|
|
},
|
|
},
|
|
change(value) {
|
|
change(value) {
|
|
console.log("aa");
|
|
console.log("aa");
|
|
console.log(value);
|
|
console.log(value);
|
|
this.formData.parentId = value[value.length - 1];
|
|
this.formData.parentId = value[value.length - 1];
|
|
console.log("a==>>" + this.formData.parentId);
|
|
console.log("a==>>" + this.formData.parentId);
|
|
|
|
+ console.log(this.$children)
|
|
},
|
|
},
|
|
// 级联选择时 因组件限制 需拼接 名字字符串在级联选择器上显示
|
|
// 级联选择时 因组件限制 需拼接 名字字符串在级联选择器上显示
|
|
findAreaName(tree) {
|
|
findAreaName(tree) {
|