|
@@ -21,6 +21,7 @@ class Tree extends Field
|
|
|
],
|
|
|
'checkbox' => [
|
|
|
'keep_selected_style' => false,
|
|
|
+ 'three_state' => true,
|
|
|
],
|
|
|
'types' => [
|
|
|
'default' => [
|
|
@@ -69,6 +70,20 @@ class Tree extends Field
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置父级复选框是否禁止被单独选中.
|
|
|
+ *
|
|
|
+ * @param bool $value
|
|
|
+ *
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function treeState(bool $value = true)
|
|
|
+ {
|
|
|
+ $this->options['checkbox']['three_state'] = $value;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 过滤父节点.
|
|
|
*
|