diff --git a/app/admin/controller/game/Config.php b/app/admin/controller/game/Config.php new file mode 100644 index 0000000..357c1d7 --- /dev/null +++ b/app/admin/controller/game/Config.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/app/common/model/GameConfig.php b/app/common/model/GameConfig.php new file mode 100644 index 0000000..33a9e01 --- /dev/null +++ b/app/common/model/GameConfig.php @@ -0,0 +1,20 @@ + 'integer', + 'update_time' => 'integer', + ]; +} diff --git a/web/src/lang/backend/en/game/config.ts b/web/src/lang/backend/en/game/config.ts new file mode 100644 index 0000000..0041b04 --- /dev/null +++ b/web/src/lang/backend/en/game/config.ts @@ -0,0 +1,14 @@ +export default { + 'quick Search Fields': 'ID / Key / Remark', + id: 'ID', + config_key: 'Config key', + config_value: 'Value', + value_type: 'Value type', + 'value_type string': 'String', + 'value_type int': 'Integer', + 'value_type decimal': 'Decimal', + 'value_type json': 'JSON', + remark: 'Remark', + create_time: 'Created', + update_time: 'Updated', +} diff --git a/web/src/lang/backend/zh-cn/game/config.ts b/web/src/lang/backend/zh-cn/game/config.ts new file mode 100644 index 0000000..d025973 --- /dev/null +++ b/web/src/lang/backend/zh-cn/game/config.ts @@ -0,0 +1,14 @@ +export default { + 'quick Search Fields': 'ID/参数键/说明', + id: 'ID', + config_key: '参数键', + config_value: '参数值', + value_type: '值类型', + 'value_type string': '字符串', + 'value_type int': '整数', + 'value_type decimal': '小数', + 'value_type json': 'JSON', + remark: '说明', + create_time: '创建时间', + update_time: '更新时间', +} diff --git a/web/src/views/backend/game/config/index.vue b/web/src/views/backend/game/config/index.vue new file mode 100644 index 0000000..2604ef0 --- /dev/null +++ b/web/src/views/backend/game/config/index.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/web/src/views/backend/game/config/popupForm.vue b/web/src/views/backend/game/config/popupForm.vue new file mode 100644 index 0000000..31e2f95 --- /dev/null +++ b/web/src/views/backend/game/config/popupForm.vue @@ -0,0 +1,106 @@ + + + + +