fixed
This commit is contained in:
193
digital_doctor/application/api/controller/Hdrregister.php
Normal file
193
digital_doctor/application/api/controller/Hdrregister.php
Normal file
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrregister extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '患者挂号列表(可重复挂号)';
|
||||
|
||||
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
*/
|
||||
function addHdrregister(){
|
||||
Tools::log_to_write_txt(['新增患者挂号列表(可重复挂号)'=>input()]);
|
||||
$api_desc = '新增患者挂号列表(可重复挂号)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$date = input('date');
|
||||
if(empty($date)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$doctor_name = input('doctor_name');
|
||||
if(empty($doctor_name)){
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$age = input('age');
|
||||
if(empty($age)){
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$gender = input('gender');
|
||||
if(empty($gender)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.5'));
|
||||
}
|
||||
|
||||
$qa_type = input('qa_type');
|
||||
$say_ticket = input('say_ticket');
|
||||
if(empty($say_ticket)){
|
||||
return json(Tools::set_fail('参数错误.7'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'date'=>$date?:'',
|
||||
'name'=>$name?:'',
|
||||
'doctor_name'=>$doctor_name?:'',
|
||||
'age'=>$age?:'',
|
||||
'gender'=>$gender?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'qa_type'=>$qa_type?:'',
|
||||
'say_ticket'=>$say_ticket?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrregister)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增患者挂号列表(可重复挂号)',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取患者挂号列表(可重复挂号)
|
||||
*
|
||||
* api/Hdrregister/getHdrregisterList
|
||||
*
|
||||
* 参数:
|
||||
* name 患者姓名(可重复挂号)
|
||||
* phone 手机号
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* create_time 创建时间
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrregisterList(){
|
||||
Tools::log_to_write_txt(['获取患者挂号列表(可重复挂号) 入参:'=>input()]);
|
||||
$api_desc = '获取患者挂号列表(可重复挂号)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$date = input('date');
|
||||
$name = input('name');
|
||||
$gender = input('gender');
|
||||
$phone = input('phone');
|
||||
$status = input('status');
|
||||
$qa_type = input('qa_type');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrregister);
|
||||
|
||||
if(input('name')){
|
||||
$model_obj->whereLike('name','%'.input('name').'%');
|
||||
}
|
||||
|
||||
if(input('phone')){
|
||||
$model_obj->whereLike('phone','%'.input('phone').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('date')){
|
||||
$model_obj->where('date',input('date'));
|
||||
}
|
||||
if(input('name')){
|
||||
$model_obj->where('name',input('name'));
|
||||
}
|
||||
if(input('gender')){
|
||||
$model_obj->where('gender',input('gender'));
|
||||
}
|
||||
if(input('status')){
|
||||
$model_obj->where('status',input('status'));
|
||||
}
|
||||
if(input('qa_type')){
|
||||
$model_obj->where('qa_type',input('qa_type'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
use wanghua\general_utility_tools_php\Mmodel;
|
||||
@@ -23,7 +24,7 @@ class Reporttt
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:疼痛科-数字人-生成听诊报告
|
||||
* desc:疼痛科-数字人-生成听诊报告(同时提交固定问答聊天记录)
|
||||
*
|
||||
* api/Reporttt/createReport
|
||||
*
|
||||
@@ -46,10 +47,10 @@ class Reporttt
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('对话票据ticket必须(用于隔离用户聊天历史记录),登陆时返回票据,每次诊断结束重新生成票据!'));
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username不存在'));
|
||||
@@ -113,7 +114,11 @@ class Reporttt
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
//设置聊天记录
|
||||
|
||||
//保存疼痛科聊天记录
|
||||
$this->setTtChatHistory($sub_content,$username,$ticket);
|
||||
|
||||
//chatGpt设置前置聊天上下文
|
||||
$chatobj->setBefore($sub_content);
|
||||
|
||||
//回答
|
||||
@@ -162,6 +167,28 @@ class Reporttt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtChatHistory($sub_content,$username,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'say_ticket'=>$ticket,
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_chathistory)->insertAll($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:查询报告详情
|
||||
|
||||
62
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
62
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Ttchathistory extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '疼痛科聊天历史';
|
||||
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtchathistoryList(){
|
||||
Tools::log_to_write_txt(['获取数智人固定问答聊天历史 入参:'=>input()]);
|
||||
$api_desc = '获取数智人固定问答聊天历史';
|
||||
try {
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_chathistory);
|
||||
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取数智人固定问答聊天历史.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,21 @@ use wanghua\general_utility_tools_php\wechat\UserAuth;
|
||||
*/
|
||||
class Userstt extends BaseHttpApi
|
||||
{
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function getSayTicket(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = md5(time());
|
||||
return Tools::set_ok('ok',['ticket'=>$ticket]);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* desc:疼痛科-根据id查询用户
|
||||
* api/Userstt/getUserById
|
||||
@@ -189,4 +204,64 @@ class Userstt extends BaseHttpApi
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function subFreeQuestionAnswerRecord(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
$content = input('content');
|
||||
if(empty($content)){
|
||||
return Tools::set_fail('content对话内容必须');
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('username必须');
|
||||
}
|
||||
|
||||
$this->setTtFreeChatHistory($content,$username,$ticket);
|
||||
|
||||
return Tools::set_ok();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科自由对话聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtFreeChatHistory($sub_content,$username,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'say_ticket'=>$ticket,
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_free_chathistory)->insertAll($data);
|
||||
}
|
||||
}
|
||||
@@ -101,20 +101,20 @@ class Usersty extends BaseHttpApi
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
*/
|
||||
function bindDevice(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//绑定设备
|
||||
$devidata = [
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
'type'=>input('type'),
|
||||
'login_time'=>Tools::get_now_date(),
|
||||
];
|
||||
Mmodel::existsUpdateInsert('fa_device',[
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
],$devidata);
|
||||
return Tools::set_ok('绑定成功');
|
||||
});
|
||||
}
|
||||
//function bindDevice(){
|
||||
// return Mmodel::catchJson(function (){
|
||||
// //绑定设备
|
||||
// $devidata = [
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// 'type'=>input('type'),
|
||||
// 'login_time'=>Tools::get_now_date(),
|
||||
// ];
|
||||
// Mmodel::existsUpdateInsert('fa_device',[
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// ],$devidata);
|
||||
// return Tools::set_ok('绑定成功');
|
||||
// });
|
||||
//}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class TychatLogic extends BaseLogic
|
||||
$clientid_arr = array_column($arr,'clientid');
|
||||
|
||||
//保存记录
|
||||
$this->saveHistory($username,$chat_msg,$type);
|
||||
$this->saveHistory($username,$chat_msg,$type,$ticket);
|
||||
|
||||
//向客户端发送消息
|
||||
$json = Tools::wss_json_ok($action, $chat_msg);
|
||||
@@ -86,7 +86,7 @@ class TychatLogic extends BaseLogic
|
||||
* desc:保存听译聊天记录
|
||||
*
|
||||
*/
|
||||
private function saveHistory($username,$chat_content,$type){
|
||||
private function saveHistory($username,$chat_content,$type,$ticket){
|
||||
$data = [
|
||||
'chat_msg'=>$chat_content,
|
||||
'username'=>$username,
|
||||
@@ -94,8 +94,24 @@ class TychatLogic extends BaseLogic
|
||||
];
|
||||
Db::table('fa_ty_chathistory')->insert($data);
|
||||
|
||||
//这里做健康小洞察
|
||||
//$this->getHealthInsight();
|
||||
//医生发起对话,问诊打开记录
|
||||
//$open_record = Db::table(TabConf::$fa_dgrdiagnosisopenrecord)
|
||||
// ->where('ticket',$ticket)
|
||||
// ->find();
|
||||
//
|
||||
//
|
||||
////问答记录
|
||||
//Db::table(TabConf::$fa_hdrqarecord)
|
||||
// ->data([
|
||||
// 'say_name'=>$open_record['doctor_name'], //说话人名称
|
||||
// 'say_phone'=>'aaaaa', //说话人电话
|
||||
// 'arm_name'=>'aaaaa', //对话目标名称
|
||||
// 'arm_phone'=>'aaaaa', //对话目标电话
|
||||
// 'msg'=>'aaaaa', //说话内容
|
||||
// 'say_ticket'=>$ticket, //对话凭据,医生打开对话框时生成,并向目标发送该凭据,对话时必须携带。生成规则:md5(say_phone+arm_phone)
|
||||
// 'qa_type'=>'aaaaa', //问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
// ])
|
||||
// ->insert();
|
||||
|
||||
return Tools::set_ok();
|
||||
}
|
||||
@@ -129,7 +145,7 @@ class TychatLogic extends BaseLogic
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function getHealthInsight2($clientid_arr,$chat_msg){
|
||||
private function getHealthInsight2($clientid_arr,$chat_msg){
|
||||
Tools::log_to_write_txt(['健康洞察,入参'=>['域名'=>request()->controller().'/'.request()->action()]]);
|
||||
$action = 'Tychat/getHealthInsight2';
|
||||
|
||||
@@ -161,4 +177,70 @@ class TychatLogic extends BaseLogic
|
||||
$json = Tools::wss_json_ok($action, 'ok',$answer_json_arr);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:医生打开诊断窗口记录,打开诊断窗口时调用该接口,发送对话数据给客户端,客户端拿本地登录的票据与该票据参数做相等匹配,
|
||||
* 相等表示同一个医生,否则提示切换医生登录账号
|
||||
*
|
||||
* 请求类型:wss
|
||||
* action: Tychat/openChatRoomWriteRecord
|
||||
* items:[
|
||||
* doctor_name //医生姓名
|
||||
doctor_phone //医生电话
|
||||
name //患者姓名
|
||||
phone //患者电话
|
||||
ticket //对话票据
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function openChatRoomWriteRecord($client_id,$data){
|
||||
return Mmodel::catchJson(function () use ($client_id,$data){
|
||||
Tools::log_to_write_txt(['打开诊断窗口记录,入参'=>$data]);
|
||||
$action = 'Tychat/openChatRoomWriteRecord';
|
||||
if(empty($data['items'])){
|
||||
$json = Tools::wss_json_fail($action, 'items参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_name'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_name参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_phone参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['name'])){
|
||||
$json = Tools::wss_json_fail($action, 'name 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'phone 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['ticket'])){
|
||||
$json = Tools::wss_json_fail($action, 'ticket 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
$data = [
|
||||
'doctor_name'=>$data['items']['doctor_name'],
|
||||
'doctor_phone'=>$data['items']['doctor_phone'],
|
||||
'name'=>$data['items']['name'],
|
||||
'phone'=>$data['items']['phone'],
|
||||
'say_ticket'=>$data['items']['ticket'],
|
||||
];
|
||||
Db::table(TabConf::$fa_dgropen_chat_room_record)
|
||||
->insert($data);
|
||||
|
||||
//查询绑定的设备
|
||||
$device = Db::table(TabConf::$fa_device)
|
||||
->where('say_ticket',$data['items']['ticket'])
|
||||
->find();
|
||||
|
||||
$client_id_arr = array_column($device,'clientid');
|
||||
|
||||
//向客户端发消息
|
||||
$json = Tools::wss_json($action,'诊断医生已打开诊断窗口');
|
||||
Gateway::sendToAll($json, $client_id_arr, [$client_id]);//不向自己发送
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class TyuserLogic extends BaseLogic
|
||||
'action'=>'Tyuser/bindRelation',
|
||||
'items'=>[
|
||||
'username'=>'13333322323',
|
||||
'say_ticket'=>'sadddddddddddddddddddddddddddd',
|
||||
'ticket'=>'sadddddddddddddddddddddddddddd',
|
||||
]
|
||||
]
|
||||
* author:wh
|
||||
|
||||
@@ -5,12 +5,36 @@ namespace app\common\model;
|
||||
class TabConf
|
||||
{
|
||||
|
||||
/**
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
*/
|
||||
static $__fa_hdrdevice = '__fa_hdrdevice';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账号信息
|
||||
*/
|
||||
static $__fa_hdrdoctor = '__fa_hdrdoctor';
|
||||
|
||||
|
||||
/**
|
||||
* 患者账号信息
|
||||
*/
|
||||
static $__fa_hdrusers = '__fa_hdrusers';
|
||||
|
||||
|
||||
/**
|
||||
* 智语医助-设备关联表
|
||||
*/
|
||||
static $__fa_healdevicerelation = '__fa_healdevicerelation';
|
||||
|
||||
|
||||
/**
|
||||
* 医生新消息
|
||||
*/
|
||||
static $__fa_message = '__fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员表
|
||||
*/
|
||||
@@ -77,6 +101,12 @@ class TabConf
|
||||
static $fa_device = 'fa_device';
|
||||
|
||||
|
||||
/**
|
||||
* 打开对话窗口记录(同时向患者端发送当前对话患者信息)
|
||||
*/
|
||||
static $fa_dgropen_chat_room_record = 'fa_dgropen_chat_room_record';
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱验证码表
|
||||
*/
|
||||
@@ -95,18 +125,6 @@ class TabConf
|
||||
static $fa_hdrdepartment = 'fa_hdrdepartment';
|
||||
|
||||
|
||||
/**
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
*/
|
||||
static $fa_hdrdevice = 'fa_hdrdevice';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账号信息
|
||||
*/
|
||||
static $fa_hdrdoctor = 'fa_hdrdoctor';
|
||||
|
||||
|
||||
/**
|
||||
* 人格测试结果
|
||||
*/
|
||||
@@ -137,24 +155,6 @@ class TabConf
|
||||
static $fa_hdrregister = 'fa_hdrregister';
|
||||
|
||||
|
||||
/**
|
||||
* 听译-用户基本信息
|
||||
*/
|
||||
static $fa_hdruserbaseinfo = 'fa_hdruserbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 患者账号信息
|
||||
*/
|
||||
static $fa_hdrusers = 'fa_hdrusers';
|
||||
|
||||
|
||||
/**
|
||||
* 医生新消息
|
||||
*/
|
||||
static $fa_message = 'fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 短信验证码表
|
||||
*/
|
||||
@@ -185,6 +185,12 @@ class TabConf
|
||||
static $fa_tt_followup = 'fa_tt_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 疼痛科自由对话聊天历史
|
||||
*/
|
||||
static $fa_tt_free_chathistory = 'fa_tt_free_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*/
|
||||
|
||||
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 科室问卷答案
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Hdrquestionnaireanswer extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Hdrquestionnaireanswer模型对象
|
||||
* @var \app\admin\model\Hdrquestionnaireanswer
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Hdrquestionnaireanswer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Hdrquestionnairequestion extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Hdrquestionnairequestion模型对象
|
||||
* @var \app\admin\model\Hdrquestionnairequestion
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Hdrquestionnairequestion;
|
||||
$this->view->assign("fitSexList", $this->model->getFitSexList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Hdrquestionnairequestion_id' => '问卷问题ID',
|
||||
'Answer' => '问卷答案',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '更新时间'
|
||||
];
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Hdrdepartment_id' => '所属科室',
|
||||
'Question' => '问卷问题',
|
||||
'Fit_sex' => '适合对象',
|
||||
'Fit_sex all' => '全部',
|
||||
'Fit_sex gg' => '男',
|
||||
'Fit_sex mm' => '女',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '更新时间'
|
||||
];
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Hdrquestionnaireanswer extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'hdrquestionnaireanswer';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Hdrquestionnairequestion extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'hdrquestionnairequestion';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'fit_sex_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getFitSexList()
|
||||
{
|
||||
return ['all' => __('Fit_sex all'), 'gg' => __('Fit_sex gg'), 'mm' => __('Fit_sex mm')];
|
||||
}
|
||||
|
||||
|
||||
public function getFitSexTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['fit_sex']) ? $data['fit_sex'] : '');
|
||||
$list = $this->getFitSexList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Hdrquestionnaireanswer extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Hdrquestionnairequestion extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrquestionnairequestion_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrquestionnairequestion_id" data-rule="required" min="0" data-source="hdrquestionnairequestion/index" class="form-control selectpage" name="row[hdrquestionnairequestion_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-answer" data-rule="required" class="form-control" name="row[answer]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,33 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrquestionnairequestion_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrquestionnairequestion_id" data-rule="required" min="0" data-source="hdrquestionnairequestion/index" class="form-control selectpage" name="row[hdrquestionnairequestion_id]" type="text" value="{$row.hdrquestionnairequestion_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-answer" data-rule="required" class="form-control" name="row[answer]" type="text" value="{$row.answer|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('hdrquestionnaireanswer/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('hdrquestionnaireanswer/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('hdrquestionnaireanswer/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('hdrquestionnaireanswer/edit')}"
|
||||
data-operate-del="{:$auth->check('hdrquestionnaireanswer/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrdepartment_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrdepartment_id" data-rule="required" min="0" data-source="hdrdepartment/index" class="form-control selectpage" name="row[hdrdepartment_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-question" data-rule="required" class="form-control" name="row[question]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Fit_sex')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-fit_sex" data-rule="required" class="form-control selectpicker" name="row[fit_sex]">
|
||||
{foreach name="fitSexList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="all"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,45 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrdepartment_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrdepartment_id" data-rule="required" min="0" data-source="hdrdepartment/index" class="form-control selectpage" name="row[hdrdepartment_id]" type="text" value="{$row.hdrdepartment_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-question" data-rule="required" class="form-control" name="row[question]" type="text" value="{$row.question|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Fit_sex')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-fit_sex" data-rule="required" class="form-control selectpicker" name="row[fit_sex]">
|
||||
{foreach name="fitSexList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.fit_sex"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('hdrquestionnairequestion/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('hdrquestionnairequestion/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('hdrquestionnairequestion/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('hdrquestionnairequestion/edit')}"
|
||||
data-operate-del="{:$auth->check('hdrquestionnairequestion/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'hdrquestionnaireanswer/index' + location.search,
|
||||
add_url: 'hdrquestionnaireanswer/add',
|
||||
edit_url: 'hdrquestionnaireanswer/edit',
|
||||
del_url: 'hdrquestionnaireanswer/del',
|
||||
multi_url: 'hdrquestionnaireanswer/multi',
|
||||
import_url: 'hdrquestionnaireanswer/import',
|
||||
table: 'hdrquestionnaireanswer',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'hdrquestionnairequestion_id', title: __('Hdrquestionnairequestion_id')},
|
||||
{field: 'answer', title: __('Answer'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -0,0 +1,55 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'hdrquestionnairequestion/index' + location.search,
|
||||
add_url: 'hdrquestionnairequestion/add',
|
||||
edit_url: 'hdrquestionnairequestion/edit',
|
||||
del_url: 'hdrquestionnairequestion/del',
|
||||
multi_url: 'hdrquestionnairequestion/multi',
|
||||
import_url: 'hdrquestionnairequestion/import',
|
||||
table: 'hdrquestionnairequestion',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'hdrdepartment_id', title: __('Hdrdepartment_id')},
|
||||
{field: 'question', title: __('Question'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'fit_sex', title: __('Fit_sex'), searchList: {"all":__('Fit_sex all'),"gg":__('Fit_sex gg'),"mm":__('Fit_sex mm')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Reference in New Issue
Block a user