<template>
  <div>
    
    <el-form ref="editPram" :model="editPram" label-width="130px">
      <el-form-item
        label="分类名称"
        prop="name"
        :rules="[{ required:true,message:'请输入分类名称',trigger:['blur','change'] }]"
      >
        <el-input v-model="editPram.name"   placeholder="分类名称" />
      </el-form-item>
      <!-- <el-form-item label="URL">
        <el-input v-model="editPram.url" placeholder="URL" />
      </el-form-item> -->
      <el-form-item label="父级" >
        <el-cascader v-model="editPram.pid" :options="parentOptions" :props="categoryProps" style="width:100%" />
      </el-form-item>
      <!-- <el-form-item label="菜单图标" >
        <el-input placeholder="请选择菜单图标" v-model="editPram.extra">
          <el-button slot="append" icon="el-icon-circle-plus-outline" @click="addIcon"></el-button>
        </el-input>
      </el-form-item> -->
      <!-- <el-form-item label="分类图标(180*180)">
        <div class="upLoadPicBox" @click="modalPicTap('1')">
          <div v-if="editPram.extra" class="pictrue">
            <img :src="editPram.extra">
          </div>
          <div v-else class="upLoad">
            <i class="el-icon-camera cameraIconfont" />
          </div>
        </div>
      </el-form-item> -->
      <el-form-item label="排序">
        <el-input-number v-model="editPram.sort" :min="0"/>
      </el-form-item>
      <el-form-item label="状态">
        <el-switch v-model="editPram.status"  active-text="显示"
                   inactive-text="隐藏" :active-value="true" :inactive-value="false" />
      </el-form-item>
      <!-- <el-form-item label="扩展字段" >
        <el-input v-model="editPram.extra" type="textarea" placeholder="扩展字段" />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" :loading="loadingBtn" @click="handlerSubmit('editPram')">确定</el-button>
        <el-button @click="close">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<!--创建和编辑公用一个组件-->
<script> 
export default {
  // name: "edit"
  props: { },
  data() {
    return {
      loadingBtn: false,
      constants: [],
      editPram: {
        extra: null,
        name: null,
        pid: null,
        sort: 0,
        status: true,
        type: 1,
        url: null,
        id: 0
      },
      categoryProps: {
        value: 'id',
        label: 'name',
        children: 'child',
        expandTrigger: 'hover',
        checkStrictly: true,
        emitPath: false
      },
      parentOptions: []
    }
  },
  mounted() {
    // this.initEditData()
  },
  methods: {
    // 点击图标
    addIcon() {},
    // 点击商品图
    modalPicTap (tit, num, i) {
    },
    close() {
    },
    initEditData() {
    },
    addTreeListLabelForCasCard(arr, child) {
    },
    handlerSubmit(formName) {
    },
    handlerSaveOrUpdate(isSave) {
    }
  }
}
</script>

<style scoped>

</style>
