From 0287a74361f4e809f03edfe9dbab8a127593aadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Sat, 4 Mar 2023 10:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E8=A8=80=E6=B7=BB=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/system/lang/LangTypeServices.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crmeb/app/services/system/lang/LangTypeServices.php b/crmeb/app/services/system/lang/LangTypeServices.php index a1d65bc7a..ae2cea728 100644 --- a/crmeb/app/services/system/lang/LangTypeServices.php +++ b/crmeb/app/services/system/lang/LangTypeServices.php @@ -46,11 +46,12 @@ class LangTypeServices extends BaseServices if ($id) $info = $this->dao->get($id); $field = []; $field[] = Form::input('language_name', '语言名称', $info['language_name'] ?? '')->required('请填写语言名称'); - $field[] = Form::input('file_name', '语言标识', $info['file_name'] ?? '')->required('请填写语言标识')->appendRule('suffix', [ - 'type' => 'div', - 'class' => 'tips-info', - 'domProps' => ['innerHTML' => '请选择或输入浏览器标识'] - ]); + $langCountryList = app()->make(LangCountryServices::class)->selectList([])->toArray(); + $options = []; + foreach ($langCountryList as $item) { + $options[] = ['value' => $item['code'], 'label' => $item['name']]; + } + $field[] = Form::select('file_name', '语言标识', $info['file_name'] ?? '')->setOptions(Form::setOptions($options)); $field[] = Form::radio('is_default', '是否默认', $info['is_default'] ?? 0)->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]]); $field[] = Form::radio('status', '状态', $info['status'] ?? 1)->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]]); return create_form($id ? '修改语言类型' : '新增语言类型', $field, Url::buildUrl('/setting/lang_type/save/' . $id), 'POST');