1
0
Fork 0
master
panliang 2023-09-21 17:21:28 +08:00
parent 73664e4e37
commit 8b2d5cb584
36 changed files with 400 additions and 40 deletions

View File

@ -3,8 +3,38 @@
namespace App\Admin\Controllers;
use Slowlyo\OwlAdmin\Controllers\AuthController as AdminAuthController;
use Slowlyo\OwlAdmin\Admin;
class AuthController extends AdminAuthController
{
public function currentUser()
{
$userInfo = Admin::user()->only(['name', 'avatar', 'id']);
$menus = amisMake()
->DropdownButton()
->hideCaret()
->trigger('hover')
->label($userInfo['name'])
->align('right')
->btnClassName('navbar-user')
->menuClassName('min-w-0 px-2')
->set('icon', $userInfo['avatar'])
->buttons([
amisMake()
->VanillaAction()
->iconClassName('pr-2')
->icon('fa fa-user-gear')
->label(__('admin.user_setting'))
->onClick('window.location.hash = "#/user_setting"'),
amisMake()
->VanillaAction()
->iconClassName('pr-2')
->label(__('admin.logout'))
->icon('fa-solid fa-right-from-bracket')
->onClick('window.$owl.logout()'),
]);
return $this->response()->success(array_merge($userInfo, compact('menus')));
}
}

View File

@ -44,7 +44,7 @@ class CategoryController extends AdminController
->autoFillHeight(true)
->footerToolbar([])
->headerToolbar([
$this->createButton(true),
$this->createButton(true, 'lg'),
amis('reload')->align('right'),
])
->filter($this->baseFilter()->actions()->body([
@ -58,7 +58,7 @@ class CategoryController extends AdminController
amisMake()->TableColumn()->name('name')->label(__('category.name')),
// amisMake()->TableColumn()->name('content')->label(__('category.content')),
amisMake()->TextareaControl()->static()->name('content')->label(__('category.content')),
$this->rowActions(true),
$this->rowActions(true, 'lg'),
]);
return $this->baseList($crud);
@ -70,7 +70,8 @@ class CategoryController extends AdminController
amisMake()->HiddenControl()->name('parent_id')->value($this->getParentId()),
amisMake()->TextControl()->name('key')->label(__('category.key'))->required(true),
amisMake()->TextControl()->name('name')->label(__('category.name'))->required(true),
amisMake()->TextareaControl()->name('content')->label(__('category.content')),
Components::make()->fuEditorControl()->name('content')->label(__('category.content')),
// amisMake()->TextareaControl()->name('content')->label(__('category.content')),
]);
}

View File

@ -35,19 +35,19 @@ class PatientRecordController extends AdminController
amis('reload')->align('right'),
])
->filter($this->baseFilter()->actions()->body([
amisMake()->SelectControl()->options($this->getPatientOptions())->searchable()->name('patient_id')->label(__('patient_record.patient_id'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getTypeOptions())->name('type_id')->label(__('patient_record.type_id'))->size('md')->clearable(),
amisMake()->DateRangeControl()->name('treat_range')->label(__('patient_record.treat_at'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getPatientOptions())->searchable()->name('patient_id')->label(__('patient-record.patient_id'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getTypeOptions())->name('type_id')->label(__('patient-record.type_id'))->size('md')->clearable(),
amisMake()->DateRangeControl()->name('treat_range')->label(__('patient-record.treat_at'))->size('md')->clearable(),
// amisMake()->Button()->label(__('admin.reset'))->actionType('clear-and-submit'),
amisMake()->Component()->setType('submit')->label(__('admin.search'))->level('primary'),
]))
->columns([
amisMake()->TableColumn()->name('id')->label(__('patient_record.id')),
amisMake()->TableColumn()->name('patient.name')->label(__('patient_record.patient_id')),
amisMake()->Mapping()->map($this->getTypeOptions()->pluck('label', 'value'))->name('type_id')->label(__('patient_record.type_id')),
amisMake()->TableColumn()->name('treat_at')->label(__('patient_record.treat_at')),
amisMake()->TableColumn()->name('next_treat_at')->label(__('patient_record.next_treat_at')),
amisMake()->TableColumn()->name('doctor.name')->label(__('patient_record.doctor_id')),
amisMake()->TableColumn()->name('id')->label(__('patient-record.id')),
amisMake()->TableColumn()->name('patient.name')->label(__('patient-record.patient_id')),
amisMake()->Mapping()->map($this->getTypeOptions()->pluck('label', 'value'))->name('type_id')->label(__('patient-record.type_id')),
amisMake()->TableColumn()->name('treat_at')->label(__('patient-record.treat_at')),
amisMake()->TableColumn()->name('next_treat_at')->label(__('patient-record.next_treat_at')),
amisMake()->TableColumn()->name('doctor.name')->label(__('patient-record.doctor_id')),
$this->rowActions(),
]);
@ -56,54 +56,54 @@ class PatientRecordController extends AdminController
public function form($isEdit, $patient_id = null): Form
{
$patient_element = amisMake()->SelectControl()->options($this->getPatientOptions())->searchable()->name('patient_id')->label(__('patient_record.patient_id'))->required();
$patient_element = amisMake()->SelectControl()->options($this->getPatientOptions())->searchable()->name('patient_id')->label(__('patient-record.patient_id'))->required();
if ($patient_id) {
$patient_element->value($patient_id)->static();
}
return $this->baseForm()->body([
$patient_element,
amisMake()->SelectControl()->options($this->getTypeOptions())->name('type_id')->label(__('patient_record.type_id'))->required()->onEvent([
amisMake()->SelectControl()->options($this->getTypeOptions())->name('type_id')->label(__('patient-record.type_id'))->required()->onEvent([
'change' => [
'actions' => [
['actionType' => 'reload', 'componentId' => 'patient_record_form_content_service', 'args' => ['select_type_id' => '${type_id}']]
]
]
]),
amisMake()->DateTimeControl()->name('treat_at')->label(__('patient_record.treat_at'))->value(now())->required(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('doctor_id')->label(__('patient_record.doctor_id'))->required(),
amisMake()->NumberControl()->name('origin_price')->label(__('patient_record.origin_price'))->required(),
amisMake()->NumberControl()->name('sell_price')->label(__('patient_record.sell_price'))->required(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient_record.order_status'))->default(OrderStatus::Success->value)->required(),
amisMake()->DateTimeControl()->name('treat_at')->label(__('patient-record.treat_at'))->value(now())->required(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('doctor_id')->label(__('patient-record.doctor_id'))->required(),
amisMake()->NumberControl()->name('origin_price')->label(__('patient-record.origin_price'))->required(),
amisMake()->NumberControl()->name('sell_price')->label(__('patient-record.sell_price'))->required(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient-record.order_status'))->default(OrderStatus::Success->value)->required(),
amisMake()->Service()
->className('cxd-Form-item')
->id('patient_record_form_content_service')
->api(amisMake()->BaseApi()->method('get')->url(admin_url('api/category/content?id=${select_type_id}')))
->initFetch(false)
->body(amisMake()->TextareaControl()->name('content')->label(__('patient_record.content'))),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient_record.next_treat_at')),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('notify_user_id')->label(__('patient_record.notify_user_id')),
amisMake()->DateTimeControl()->name('notify_at')->label(__('patient_record.notify_at')),
amisMake()->TextControl()->name('notify_remarks')->label(__('patient_record.notify_remarks')),
amisMake()->TextControl()->label(__('patient_record.creator_id'))->value($this->user()->name)->staitc(),
->body(amisMake()->TextareaControl()->name('content')->label(__('patient-record.content'))),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at')),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('notify_user_id')->label(__('patient-record.notify_user_id')),
amisMake()->DateTimeControl()->name('notify_at')->label(__('patient-record.notify_at')),
amisMake()->TextControl()->name('notify_remarks')->label(__('patient-record.notify_remarks')),
amisMake()->TextControl()->label(__('patient-record.creator_id'))->value($this->user()->name)->staitc(),
]);
}
public function detail()
{
return $this->baseDetail()->body([
amisMake()->TextControl()->name('patient_id')->label(__('patient_record.patient_id'))->static(),
amisMake()->TextControl()->name('type_id')->label(__('patient_record.type_id'))->static(),
amisMake()->DateTimeControl()->name('treat_at')->label(__('patient_record.treat_at'))->static(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->name('doctor_id')->label(__('patient_record.doctor_id'))->static(),
amisMake()->TextControl()->name('origin_price')->label(__('patient_record.origin_price'))->static(),
amisMake()->TextControl()->name('sell_price')->label(__('patient_record.sell_price'))->static(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient_record.order_status'))->static(),
amisMake()->TextareaControl()->name('content')->label(__('patient_record.content'))->static(),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient_record.next_treat_at'))->static(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->name('notify_user_id')->label(__('patient_record.notify_user_id'))->placeholder('')->static(),
amisMake()->DateTimeControl()->name('notify_at')->label(__('patient_record.notify_at'))->static(),
amisMake()->TextControl()->name('notify_remarks')->label(__('patient_record.notify_remarks'))->static(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->name('creator_id')->label(__('patient_record.creator_id'))->static(),
amisMake()->TextControl()->name('patient.name')->label(__('patient-record.patient_id'))->static(),
amisMake()->TextControl()->name('type.name')->label(__('patient-record.type_id'))->static(),
amisMake()->DateTimeControl()->name('treat_at')->label(__('patient-record.treat_at'))->static(),
amisMake()->TextControl()->name('doctor.name')->label(__('patient-record.doctor_id'))->static(),
amisMake()->TextControl()->name('origin_price')->label(__('patient-record.origin_price'))->static(),
amisMake()->TextControl()->name('sell_price')->label(__('patient-record.sell_price'))->static(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient-record.order_status'))->static(),
amisMake()->TextareaControl()->name('content')->label(__('patient-record.content'))->static(),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at'))->static(),
amisMake()->TextControl()->name('notify_user.name')->label(__('patient-record.notify_user_id'))->static(),
amisMake()->DateTimeControl()->name('notify_at')->label(__('patient-record.notify_at'))->static(),
amisMake()->TextControl()->name('notify_remarks')->label(__('patient-record.notify_remarks'))->static(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->name('creator_id')->label(__('patient-record.creator_id'))->static(),
amisMake()->DateTimeControl()->name('created_at')->label(__('patient.created_at'))->static(),
]);
}

View File

@ -11,7 +11,7 @@ class PatientRecordService extends BaseService
{
protected string $modelName = PatientRecord::class;
protected array $withRelationships = ['doctor', 'patient'];
protected array $withRelationships = ['doctor', 'patient', 'type', 'notifyUser'];
protected string $modelFilterName = PatientRecordFilter::class;
@ -40,4 +40,26 @@ class PatientRecordService extends BaseService
}
return $data;
}
public function validate($data, $id = null)
{
$createRules = [
'patient_id' => 'required',
'type_id' => 'required',
'treat_at' => 'required',
'doctor_id' => 'required',
'origin_price' => ['required', 'numeric'],
'sell_price' => ['required', 'numeric'],
'order_status' => 'required',
];
$updateRules = [
'origin_price' => 'numeric',
'sell_price' => 'numeric',
];
$validator = Validator::make($data, $id ? $updateRules : $createRules);
if ($validator->fails()) {
return $validator->errors()->first();
}
return true;
}
}

View File

@ -8,9 +8,9 @@ Route::group([
'prefix' => config('admin.route.prefix'),
'middleware' => config('admin.route.middleware'),
], function (Router $router) {
$router->resource('dashboard', \App\Admin\Controllers\HomeController::class);
$router->get('menus', [\App\Admin\Controllers\HomeController::class, 'menus']);
$router->get('current-user', [\App\Admin\Controllers\AuthController::class, 'currentUser']);
$router->get('login', [App\Admin\Controllers\AuthController::class, 'loginPage']);

View File

@ -23,6 +23,8 @@ class PatientRecord extends Model
'notify_at' => 'datetime',
'treat_at' => 'datetime',
'next_treat_at' => 'datetime',
'origin_price' => 'float',
'sell_price' => 'float',
];
public function patient()

View File

@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Slowlyo\OwlAdmin\Models\AdminUser;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
*/
class AdminUserFactory extends Factory
{
protected $model = AdminUser::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$name = $this->faker->name;
return [
'username' => $this->faker->username,
'name' => $this->faker->name,
'avatar' => 'https://ui-avatars.com/api/?name=' . $name,
'password' => '$2y$10$MXFSBvoV02d.nMg/5//5ru/os27JgSJhsePidDr/uiIw6UQ.MigP2',
];
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Slowlyo\OwlAdmin\Models\AdminUser;
use Database\Factories\AdminUserFactory;
class AdminUserSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
AdminUser::where('id', '!=', 1)->delete();
(new AdminUserFactory)->count(100)->create();
}
}

View File

@ -0,0 +1,218 @@
<?php
declare(strict_types=1);
return [
'accepted' => '您必须接受 :attribute。',
'accepted_if' => '当 :other 为 :value 时,必须接受 :attribute。',
'active_url' => ':Attribute 不是一个有效的网址。',
'after' => ':Attribute 必须要晚于 :date。',
'after_or_equal' => ':Attribute 必须要等于 :date 或更晚。',
'alpha' => ':Attribute 只能由字母组成。',
'alpha_dash' => ':Attribute 只能由字母、数字、短划线(-)和下划线(_)组成。',
'alpha_num' => ':Attribute 只能由字母和数字组成。',
'array' => ':Attribute 必须是一个数组。',
'ascii' => ':Attribute 必须仅包含单字节字母数字字符和符号。',
'before' => ':Attribute 必须要早于 :date。',
'before_or_equal' => ':Attribute 必须要等于 :date 或更早。',
'between' => [
'array' => ':Attribute 必须只有 :min - :max 个单元。',
'file' => ':Attribute 必须介于 :min - :max KB 之间。',
'numeric' => ':Attribute 必须介于 :min - :max 之间。',
'string' => ':Attribute 必须介于 :min - :max 个字符之间。',
],
'boolean' => ':Attribute 必须为布尔值。',
'can' => ':Attribute 字段包含未经授权的值。',
'confirmed' => ':Attribute 两次输入不一致。',
'current_password' => '密码错误。',
'date' => ':Attribute 不是一个有效的日期。',
'date_equals' => ':Attribute 必须要等于 :date。',
'date_format' => ':Attribute 的格式必须为 :format。',
'decimal' => ':Attribute 必须有 :decimal 位小数。',
'declined' => ':Attribute 必须是拒绝的。',
'declined_if' => '当 :other 为 :value 时字段 :attribute 必须是拒绝的。',
'different' => ':Attribute 和 :other 必须不同。',
'digits' => ':Attribute 必须是 :digits 位数字。',
'digits_between' => ':Attribute 必须是介于 :min 和 :max 位的数字。',
'dimensions' => ':Attribute 图片尺寸不正确。',
'distinct' => ':Attribute 已经存在。',
'doesnt_end_with' => ':Attribute 不能以以下之一结尾: :values。',
'doesnt_start_with' => ':Attribute 不能以下列之一开头: :values。',
'email' => ':Attribute 不是一个合法的邮箱。',
'ends_with' => ':Attribute 必须以 :values 为结尾。',
'enum' => ':Attribute 值不正确。',
'exists' => ':Attribute 不存在。',
'file' => ':Attribute 必须是文件。',
'filled' => ':Attribute 不能为空。',
'gt' => [
'array' => ':Attribute 必须多于 :value 个元素。',
'file' => ':Attribute 必须大于 :value KB。',
'numeric' => ':Attribute 必须大于 :value。',
'string' => ':Attribute 必须多于 :value 个字符。',
],
'gte' => [
'array' => ':Attribute 必须多于或等于 :value 个元素。',
'file' => ':Attribute 必须大于或等于 :value KB。',
'numeric' => ':Attribute 必须大于或等于 :value。',
'string' => ':Attribute 必须多于或等于 :value 个字符。',
],
'image' => ':Attribute 必须是图片。',
'in' => '已选的属性 :attribute 无效。',
'in_array' => ':Attribute 必须在 :other 中。',
'integer' => ':Attribute 必须是整数。',
'ip' => ':Attribute 必须是有效的 IP 地址。',
'ipv4' => ':Attribute 必须是有效的 IPv4 地址。',
'ipv6' => ':Attribute 必须是有效的 IPv6 地址。',
'json' => ':Attribute 必须是正确的 JSON 格式。',
'lowercase' => ':Attribute 必须小写。',
'lt' => [
'array' => ':Attribute 必须少于 :value 个元素。',
'file' => ':Attribute 必须小于 :value KB。',
'numeric' => ':Attribute 必须小于 :value。',
'string' => ':Attribute 必须少于 :value 个字符。',
],
'lte' => [
'array' => ':Attribute 必须少于或等于 :value 个元素。',
'file' => ':Attribute 必须小于或等于 :value KB。',
'numeric' => ':Attribute 必须小于或等于 :value。',
'string' => ':Attribute 必须少于或等于 :value 个字符。',
],
'mac_address' => ':Attribute 必须是一个有效的 MAC 地址。',
'max' => [
'array' => ':Attribute 最多只有 :max 个单元。',
'file' => ':Attribute 不能大于 :max KB。',
'numeric' => ':Attribute 不能大于 :max。',
'string' => ':Attribute 不能大于 :max 个字符。',
],
'max_digits' => ':Attribute 不能超过 :max 位数。',
'mimes' => ':Attribute 必须是一个 :values 类型的文件。',
'mimetypes' => ':Attribute 必须是一个 :values 类型的文件。',
'min' => [
'array' => ':Attribute 至少有 :min 个单元。',
'file' => ':Attribute 大小不能小于 :min KB。',
'numeric' => ':Attribute 必须大于等于 :min。',
'string' => ':Attribute 至少为 :min 个字符。',
],
'min_digits' => ':Attribute 必须至少有 :min 位数。',
'missing' => '必须缺少 :attribute 字段。',
'missing_if' => '当 :other 为 :value 时,必须缺少 :attribute 字段。',
'missing_unless' => '必须缺少 :attribute 字段,除非 :other 是 :value。',
'missing_with' => '存在 :values 时,必须缺少 :attribute 字段。',
'missing_with_all' => '存在 :values 时,必须缺少 :attribute 字段。',
'multiple_of' => ':Attribute 必须是 :value 中的多个值。',
'not_in' => '已选的属性 :attribute 非法。',
'not_regex' => ':Attribute 的格式错误。',
'numeric' => ':Attribute 必须是一个数字。',
'password' => [
'letters' => ':Attribute 必须至少包含一个字母。',
'mixed' => ':Attribute 必须至少包含一个大写字母和一个小写字母。',
'numbers' => ':Attribute 必须至少包含一个数字。',
'symbols' => ':Attribute 必须至少包含一个符号。',
'uncompromised' => '给定的 :attribute 出现在已经泄漏的密码中。请选择不同的 :attribute。',
],
'present' => ':Attribute 必须存在。',
'prohibited' => ':Attribute 字段被禁止。',
'prohibited_if' => '当 :other 为 :value 时,禁止 :attribute 字段。',
'prohibited_unless' => ':Attribute 字段被禁止,除非 :other 位于 :values 中。',
'prohibits' => ':Attribute 字段禁止出现 :other。',
'regex' => ':Attribute 格式不正确。',
'required' => ':Attribute 不能为空。',
'required_array_keys' => ':Attribute 至少包含指定的键::values.',
'required_if' => '当 :other 为 :value 时 :attribute 不能为空。',
'required_if_accepted' => '当 :other 存在时,:attribute 不能为空。',
'required_unless' => '当 :other 不为 :values 时 :attribute 不能为空。',
'required_with' => '当 :values 存在时 :attribute 不能为空。',
'required_with_all' => '当 :values 存在时 :attribute 不能为空。',
'required_without' => '当 :values 不存在时 :attribute 不能为空。',
'required_without_all' => '当 :values 都不存在时 :attribute 不能为空。',
'same' => ':Attribute 和 :other 必须相同。',
'size' => [
'array' => ':Attribute 必须为 :size 个单元。',
'file' => ':Attribute 大小必须为 :size KB。',
'numeric' => ':Attribute 大小必须为 :size。',
'string' => ':Attribute 必须是 :size 个字符。',
],
'starts_with' => ':Attribute 必须以 :values 为开头。',
'string' => ':Attribute 必须是一个字符串。',
'timezone' => ':Attribute 必须是一个合法的时区值。',
'ulid' => ':Attribute 必须是有效的 ULID。',
'unique' => ':Attribute 已经存在。',
'uploaded' => ':Attribute 上传失败。',
'uppercase' => ':Attribute 必须大写',
'url' => ':Attribute 格式不正确。',
'uuid' => ':Attribute 必须是有效的 UUID。',
'attributes' => [
'address' => '地址',
'age' => '年龄',
'amount' => '数额',
'area' => '区域',
'available' => '可用的',
'birthday' => '生日',
'body' => '身体',
'city' => '城市',
'content' => '内容',
'country' => '国家',
'created_at' => '创建于',
'creator' => '创建者',
'current_password' => '当前密码',
'date' => '日期',
'date_of_birth' => '出生日期',
'day' => '天',
'deleted_at' => '删除于',
'description' => '描述',
'district' => '地区',
'duration' => '期间',
'email' => '邮箱',
'excerpt' => '摘要',
'filter' => '过滤',
'first_name' => '名',
'gender' => '性别',
'group' => '组',
'hour' => '时',
'image' => '图像',
'last_name' => '姓',
'lesson' => '课程',
'line_address_1' => '线路地址 1',
'line_address_2' => '线路地址 2',
'message' => '信息',
'middle_name' => '中间名字',
'minute' => '分',
'mobile' => '手机',
'month' => '月',
'name' => '名称',
'national_code' => '国家代码',
'number' => '数字',
'password' => '密码',
'password_confirmation' => '确认密码',
'phone' => '电话',
'photo' => '照片',
'postal_code' => '邮政编码',
'price' => '价格',
'province' => '省',
'recaptcha_response_field' => '重复验证码响应字段',
'remember' => '记住',
'restored_at' => '恢复于',
'result_text_under_image' => '图像下的结果文本',
'role' => '角色',
'second' => '秒',
'sex' => '性别',
'short_text' => '短文本',
'size' => '大小',
'state' => '状态',
'street' => '街道',
'student' => '学生',
'subject' => '主题',
'teacher' => '教师',
'terms' => '条款',
'test_description' => '测试说明',
'test_locale' => '测试语言环境',
'test_name' => '测试名称',
'text' => '文本',
'time' => '时间',
'title' => '标题',
'updated_at' => '更新于',
'username' => '用户名',
'year' => '年',
],
'phone' => '不是一个有效的手机号',
];

View File

@ -0,0 +1,8 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /h5/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /h5/index.html [L]
</IfModule>

View File

@ -0,0 +1,2 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7032a432.js"></script><script defer="defer" src="/h5/static/js/index.731c9d79.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[225],{5313:function(t,i,n){var a=n(7661);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.id,a,""]]),a.locals&&(t.exports=a.locals);var e=n(5472).Z;e("49136db0",a,!0,{sourceMap:!1,shadowMode:!1})},4940:function(t,i,n){"use strict";n.r(i),n.d(i,{default:function(){return r}});var a,e={uSearch:n(8035).Z,uButton:n(7344).Z,uList:n(4307).Z,uSwipeAction:n(3309).Z,uListItem:n(8556).Z,uSwipeActionItem:n(8268).Z,uCell:n(7981).Z,uActionSheet:n(7030).Z},o=function(){var t=this,i=t.$createElement,n=t._self._c||i;return n("v-uni-view",{staticClass:"page"},[n("u-search",{attrs:{bgColor:"white",showAction:!1,margin:"10px 0",placeholder:"姓名/联系方式"},on:{search:function(i){arguments[0]=i=t.$handleEvent(i),t.loadData(!0)},change:function(i){arguments[0]=i=t.$handleEvent(i),t.changeSearch.apply(void 0,arguments)}},model:{value:t.search,callback:function(i){t.search=i},expression:"search"}}),n("v-uni-view",{staticClass:"add-button"},[n("u-button",{attrs:{type:"primary",icon:"plus",shape:"circle",size:"large"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.add.apply(void 0,arguments)}}})],1),n("u-list",{staticClass:"list",on:{scrolltolower:function(i){arguments[0]=i=t.$handleEvent(i),t.reachBottom.apply(void 0,arguments)}}},[n("u-swipe-action",t._l(t.list,(function(i,a){return n("u-list-item",{key:i.id},[n("u-swipe-action-item",{attrs:{options:t.swipeOption,name:a},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.swipeClick.apply(void 0,arguments)}}},[n("u-cell",{attrs:{title:i.name+(""!=i.age?"("+i.age+")":""),label:i.phone?i.phone:"暂无联系方式",clickable:!0,isLink:!1,url:"/pages/patient/detail?id="+i.id}})],1)],1)})),1)],1),n("u-action-sheet",{attrs:{actions:t.option.list,title:t.option.title,show:t.option.show,closeOnClickOverlay:!0},on:{close:function(i){arguments[0]=i=t.$handleEvent(i),t.closeOption.apply(void 0,arguments)},select:function(i){arguments[0]=i=t.$handleEvent(i),t.chooseOption.apply(void 0,arguments)}}})],1)},s=[],c=(n(423),n(101),n(6228),{data:function(){return{list:[],page:1,perPage:20,total:0,search:"",option:{id:"",show:!1,list:[{name:"详细",color:"#4cd964",action:"detail"},{name:"修改",color:"#007aff",action:"edit"},{name:"添加病历",color:"#f0ad4e",action:"record-add"},{name:"查看病历",color:"#4cd964",action:"record"},{name:"删除",color:"#dd524d",action:"delete"}],title:""},swipeOption:[{text:"删除",style:{backgroundColor:"#dd524d"}}]}},onShow:function(){this.loadData(!0)},onPullDownRefresh:function(){this.loadData(!0)},methods:{loadData:function(t){var i=this;t&&(this.list=[],this.page=1),uni.showLoading();var n={_action:"getData",page:this.page,perPage:this.perPage,keyword:this.search};this.$ajax.get("/admin-api/patient?",{params:n}).then((function(t){uni.stopPullDownRefresh(),0==t.status&&(i.list=i.list.concat(t.data.items),i.total=t.data.total)})).catch((function(t){uni.stopPullDownRefresh()}))},reachBottom:function(){this.list.length<this.total&&(this.page++,this.loadData())},changeSearch:function(t){t||this.loadData(!0)},add:function(){uni.navigateTo({url:"/pages/patient/form"})},openOption:function(t){var i=this.list[t];this.option.title=i.name,this.option.id=i.id,this.option.show=!0},closeOption:function(){this.option.show=!1},chooseOption:function(t){var i=this,n=this.option.id;return"detail"==t.action?uni.navigateTo({url:"/pages/patient/detail?id=".concat(n)}):"edit"==t.action?uni.navigateTo({url:"/pages/patient/form?id=".concat(n)}):"delete"==t.action?uni.showModal({title:"删除 "+this.option.title,content:"是否确定?",success:function(t){t.confirm&&i.delete(n)}}):"record-add"==t.action?uni.navigateTo({url:"/pages/record/form?patient=".concat(n)}):"record"==t.action?uni.navigateTo({url:"/pages/record/index?patient=".concat(n)}):void 0},swipeClick:function(t){var i=this,n=t.index,a=this.list[t.name];if(0==n)return uni.showModal({title:"删除 "+a.name,content:"是否确定?",success:function(t){t.confirm&&i.delete(a.id)}})},delete:function(t){var i=this;uni.showLoading(),this.$ajax.delete("/admin-api/patient/".concat(t)).then((function(t){0==t.status&&(uni.showToast({title:"删除成功",icon:"success"}),setTimeout((function(){i.loadData(!0)}),1e3))}))}}}),l=c,u=(n(5313),n(1503)),d=(0,u.Z)(l,o,s,!1,null,"1aac93f0",null,!1,e,a),r=d.exports},7661:function(t,i,n){"use strict";n.r(i);var a=n(2916),e=n.n(a),o=n(3282),s=n.n(o),c=s()(e());c.push([t.id,".list[data-v-1aac93f0]{background-color:#fff;padding-bottom:20px}.add-button[data-v-1aac93f0]{position:absolute;bottom:100px;right:50px;z-index:999}",""]),i["default"]=c}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB