<template>
    <i-form>
        <Form-item label = "类型:">
            <treeselect :multiple = "pubObj.multiSelect" :options = "moduleList" v-model = "pubObj.type" placeholder = "请选择类型."/>
        </Form-item>
        <!-- <Form-item label = "上级分组:">
            <Cascader :data = "groupList" v-model = "pubObj.parents" change-on-select filterable :render-format = "formatObj"></Cascader>
        </Form-item> -->
        <Form-item label = "名称:" v-if="!pubObj.multiSelect">
            <i-input type="text"  v-model = "pubObj.label" clearable></i-input>
        </Form-item>
        <Form-item label = "图标:" v-if="!pubObj.multiSelect">
            <i-input type="text"  v-model = "pubObj.icon" clearable></i-input>
        </Form-item>
    </i-form>
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  data: () => ({}),
  props: ["pubObj", "groupList", "moduleList"],
  methods: {
    formatObj(labels) {
      return labels[labels.length - 1];
    }
  },
  components: {
    Treeselect
  }
};
</script>

<style lang="less">
</style>
