From 0b0c0ee04a4020d741123358b5d7db0ddaafb07c Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Wed, 15 Apr 2026 17:46:34 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B8=B8=E6=88=8F=E7=AE=A1=E7=90=86]=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/config/GameConfig.php | 64 +++++++++ web/src/lang/backend/en/config/gameConfig.ts | 3 + .../lang/backend/zh-cn/config/gameConfig.ts | 3 + .../views/backend/config/gameConfig/index.vue | 127 ++++++++++++++++++ .../backend/config/gameConfig/popupForm.vue | 107 +++++++++++++++ 5 files changed, 304 insertions(+) create mode 100644 app/admin/controller/config/GameConfig.php create mode 100644 web/src/lang/backend/en/config/gameConfig.ts create mode 100644 web/src/lang/backend/zh-cn/config/gameConfig.ts create mode 100644 web/src/views/backend/config/gameConfig/index.vue create mode 100644 web/src/views/backend/config/gameConfig/popupForm.vue diff --git a/app/admin/controller/config/GameConfig.php b/app/admin/controller/config/GameConfig.php new file mode 100644 index 0000000..8d34425 --- /dev/null +++ b/app/admin/controller/config/GameConfig.php @@ -0,0 +1,64 @@ + 'asc']; + + protected string|array $orderGuarantee = ['id' => 'asc']; + + protected bool $modelValidate = false; + + protected function initController(WebmanRequest $request): ?Response + { + $this->model = new \app\common\model\GameConfig(); + return null; + } + + /** + * 列表:排除独立表单维护的 36 字花字典 + */ + protected function _index(): Response + { + if ($this->request && $this->request->get('select')) { + return $this->select($this->request); + } + + list($where, $alias, $limit, $order) = $this->queryBuilder(); + $table = strtolower($this->model->getTable()); + $mainShort = $alias[$table] ?? ''; + if ($mainShort !== '') { + $where[] = [$mainShort . '.config_key', '<>', ZiHuaDictionaryLib::CONFIG_KEY]; + } + + $res = $this->model + ->field($this->indexField) + ->withJoin($this->withJoinTable, $this->withJoinType) + ->with($this->withJoinTable) + ->alias($alias) + ->where($where) + ->order($order) + ->paginate($limit); + + return $this->success('', [ + 'list' => $res->items(), + 'total' => $res->total(), + 'remark' => get_route_remark(), + ]); + } +} diff --git a/web/src/lang/backend/en/config/gameConfig.ts b/web/src/lang/backend/en/config/gameConfig.ts new file mode 100644 index 0000000..d595eae --- /dev/null +++ b/web/src/lang/backend/en/config/gameConfig.ts @@ -0,0 +1,3 @@ +import gameConfig from '../game/config' +export default gameConfig + diff --git a/web/src/lang/backend/zh-cn/config/gameConfig.ts b/web/src/lang/backend/zh-cn/config/gameConfig.ts new file mode 100644 index 0000000..d595eae --- /dev/null +++ b/web/src/lang/backend/zh-cn/config/gameConfig.ts @@ -0,0 +1,3 @@ +import gameConfig from '../game/config' +export default gameConfig + diff --git a/web/src/views/backend/config/gameConfig/index.vue b/web/src/views/backend/config/gameConfig/index.vue new file mode 100644 index 0000000..571bb7d --- /dev/null +++ b/web/src/views/backend/config/gameConfig/index.vue @@ -0,0 +1,127 @@ + + + + + + + diff --git a/web/src/views/backend/config/gameConfig/popupForm.vue b/web/src/views/backend/config/gameConfig/popupForm.vue new file mode 100644 index 0000000..5054971 --- /dev/null +++ b/web/src/views/backend/config/gameConfig/popupForm.vue @@ -0,0 +1,107 @@ + + + + + +