From b5c8abcb56877deac8b65572f3c89d5f4f7b70aa Mon Sep 17 00:00:00 2001 From: walkor Date: Wed, 10 May 2023 11:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/admin/app/common/Layui.php | 49 +++++++++++++++++++++ src/plugin/admin/app/view/table/create.html | 2 +- src/plugin/admin/app/view/table/modify.html | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/plugin/admin/app/common/Layui.php b/src/plugin/admin/app/common/Layui.php index 2d650a0..3853d51 100644 --- a/src/plugin/admin/app/common/Layui.php +++ b/src/plugin/admin/app/common/Layui.php @@ -207,6 +207,55 @@ EOF; +EOF; + } + + /** + * 富文本 + * @param $options + * @return void + */ + public function richText($options) + { + [$label, $field, $value, $props, $verify_string, $required_string, $class] = $this->options($options); + + $placeholder_string = !empty($props['placeholder']) ? ' placeholder="'.$props['placeholder'].'"' : ''; + $disabled_string = !empty($props['disabled']) ? ' disabled' : ''; + $id = $field; + + $this->htmlContent .= << + $label +
+ +
+ + +EOF; + + $options_string = ''; + foreach ($props as $key => $item) { + if (is_array($item)) { + $item = json_encode($item, JSON_UNESCAPED_UNICODE); + $options_string .= "\n $key: $item,"; + } else { + $options_string .= "\n $key: \"$item\","; + } + } + $this->jsContent .= << diff --git a/src/plugin/admin/app/view/table/modify.html b/src/plugin/admin/app/view/table/modify.html index a546b45..df2409e 100644 --- a/src/plugin/admin/app/view/table/modify.html +++ b/src/plugin/admin/app/view/table/modify.html @@ -136,7 +136,7 @@