<template>
    <Collapse v-model="colpanel">
        <Panel name="1">
          内容属性
          <p slot="content">
            <i-form :model = "taskItems">
                <Form-item>
                  <Checkbox v-model="taskItems.customTitle.isShow">自定义标题</Checkbox>
                  <div class="property-item" v-if="taskItems.customTitle.isShow">
                    <label>标题名称</label>
                    <div class="property-item-content">
                      <i-input v-model = "taskItems.customTitle.title"></i-input>
                    </div>
                  </div>
                </Form-item>
                <Form-item label="单行显示表格数" :label-width = "120">
                  <InputNumber :max="10" :min="1" :step="1" v-model = "taskItems.showCol"></InputNumber>
                </Form-item>
                <Form-item>
                  <Checkbox v-model="taskItems.menu.hideDropdown">隐藏下拉菜单</Checkbox> 
                </Form-item>
                <Form-item>
                  <Checkbox v-model="taskItems.menu.hideSearch">隐藏搜索栏</Checkbox> 
                </Form-item>
                <Form-item>
                  <Checkbox v-model="taskItems.menu.hideCreateBtn">隐藏创建按钮</Checkbox> 
                </Form-item>
                       
            </i-form>
          </p>
        </Panel>
    </Collapse>
</template>
<script>
import { mapMutations } from "vuex";
export default {
  props: ["itemId"],
  data: () => ({
    colpanel: "1"
  }),
  computed: {
    taskItems() {
      let id = this.itemId,
        taskItems = this.$store.getters.getTaskPro(id);
      if (!taskItems || taskItems.length == 0) {
        this.initTaskProById(id);
      }
      let taskPro = this.$store.getters.getNodeProp(id);
      if (!taskPro || taskPro.length == 0) {
        let newTaskPro = this.$store.getters.getTaskPro(id).taskPro;
        this.setNodeProp({ id: id, taskPro: newTaskPro });
      }
      return this.$store.getters.getNodeProp(id).taskPro;
    }
  },
  methods: {
    ...mapMutations(["initTaskProById", "setNodeProp"]),
    setAdminAuto() {
      console.log("设置管理权限.");
    }
  }
};
</script>