-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
代码上传
- Loading branch information
lizhigang
authored and
lizhigang
committed
May 5, 2017
1 parent
c142d5a
commit ad3c2d9
Showing
321 changed files
with
53,521 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
APP_NAME=PHP工作流 | ||
APP_ENV=local | ||
APP_KEY=base64:QLdoVELWRtf46/bqu7g3Afkl7LJobRaQ/oyruzOIvNw= | ||
APP_DEBUG=true | ||
APP_LOG_LEVEL=debug | ||
APP_URL=http://localhost | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=workflow | ||
DB_USERNAME=root | ||
DB_PASSWORD=root | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
SESSION_DRIVER=file | ||
QUEUE_DRIVER=sync | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_DRIVER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage | ||
/vendor | ||
/.idea | ||
/.vagrant | ||
Homestead.json | ||
Homestead.yaml | ||
.env | ||
/public/uploads | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,15 @@ | |
|
||
 | ||
|
||
 | ||
## 使用 | ||
`cp .env.example .env` | ||
|
||
 | ||
`composer install` | ||
|
||
 | ||
导入数据库文件,文件地址:`database/sql/workflow_data.sql` | ||
|
||
初始账号: | ||
`[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] 密码统一为:123456` | ||
|
||
## 感谢 | ||
[流程设计前端](https://github.com/payonesmile/flowdesign) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire') | ||
// ->hourly(); | ||
} | ||
|
||
/** | ||
* Register the Closure based commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
require base_path('routes/console.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Dept extends Model | ||
{ | ||
protected $table="dept"; | ||
|
||
protected $fillable=['dept_name','manager_id','pid','director_id','mannager','rank']; | ||
|
||
// 递归处理部门 | ||
public static function recursion($depts,$html='├──',$pid=0,$level=0){ | ||
|
||
|
||
$data=[]; | ||
foreach($depts as $k=>$v){ | ||
if($v['pid']==$pid){ | ||
$v['html']=str_repeat($html, $level); | ||
$v['level']=$level+1; | ||
$data[]=$v; | ||
unset($depts[$k]); | ||
$data=array_merge($data,self::recursion($depts,$html,$v['id'],$level+1)); | ||
} | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
public function director(){ | ||
return $this->belongsTo('App\Emp','director_id'); | ||
} | ||
|
||
public function manager(){ | ||
return $this->belongsTo('App\Emp','manager_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Notifications\Notifiable; | ||
use Illuminate\Foundation\Auth\User as Authenticatable; | ||
|
||
class Emp extends Authenticatable | ||
{ | ||
use Notifiable; | ||
|
||
protected $table="emp"; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'name', 'email', 'password','workno','dept_id','leave' | ||
]; | ||
|
||
/** | ||
* The attributes that should be hidden for arrays. | ||
* | ||
* @var array | ||
*/ | ||
protected $hidden = [ | ||
'password', 'remember_token', | ||
]; | ||
|
||
public function dept(){ | ||
return $this->belongsTo('App\Dept','dept_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Entry extends Model | ||
{ | ||
protected $table="entry"; | ||
|
||
protected $fillable=['title','flow_id','emp_id','status','process_id','circle','enter_process_id','child','pid','enter_proc_id']; | ||
|
||
public function flow(){ | ||
return $this->belongsTo("App\Flow","flow_id"); | ||
} | ||
|
||
public function emp(){ | ||
return $this->belongsTo("App\Emp","emp_id"); | ||
} | ||
|
||
public function procs(){ | ||
return $this->hasMany("App\Proc","entry_id"); | ||
} | ||
|
||
public function process(){ | ||
return $this->belongsTo("App\Process","process_id"); | ||
} | ||
|
||
public function entry_data(){ | ||
return $this->hasMany("App\EntryData","entry_id"); | ||
} | ||
|
||
public function parent_entry(){ | ||
return $this->belongsTo('App\Entry','pid'); | ||
} | ||
|
||
public function children(){ | ||
return $this->hasMany('App\Entry','pid'); | ||
} | ||
|
||
public function enter_process(){ | ||
return $this->belongsTo('App\Process','enter_process_id'); | ||
} | ||
|
||
public function child_process(){ | ||
return $this->belongsTo('App\Process','child'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class EntryData extends Model | ||
{ | ||
protected $table="entry_data"; | ||
|
||
protected $fillable=['entry_id','flow_id','field_name','field_value']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Auth\AuthenticationException; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that should not be reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
\Illuminate\Auth\AuthenticationException::class, | ||
\Illuminate\Auth\Access\AuthorizationException::class, | ||
\Symfony\Component\HttpKernel\Exception\HttpException::class, | ||
\Illuminate\Database\Eloquent\ModelNotFoundException::class, | ||
\Illuminate\Session\TokenMismatchException::class, | ||
\Illuminate\Validation\ValidationException::class, | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
* | ||
* @param \Exception $exception | ||
* @return void | ||
*/ | ||
public function report(Exception $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Exception $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function render($request, Exception $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
|
||
/** | ||
* Convert an authentication exception into an unauthenticated response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Illuminate\Auth\AuthenticationException $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
protected function unauthenticated($request, AuthenticationException $exception) | ||
{ | ||
if ($request->expectsJson()) { | ||
return response()->json(['error' => 'Unauthenticated.'], 401); | ||
} | ||
|
||
return redirect()->guest(route('login')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Flow extends Model | ||
{ | ||
protected $table="flow"; | ||
|
||
protected $fillable=['flow_no','flow_name','template_id','flowchart','jsplumb','is_publish','is_show']; | ||
|
||
public function process(){ | ||
return $this->hasMany('App\Process','flow_id'); | ||
} | ||
|
||
public function process_var(){ | ||
return $this->hasMany('App\ProcessVar','flow_id'); | ||
} | ||
|
||
public function template(){ | ||
return $this->belongsTo('App\Template','template_id'); | ||
} | ||
|
||
public function flow_type(){ | ||
return $this->belongsTo('App\FlowType','type_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class FlowType extends Model | ||
{ | ||
protected $table="flow_type"; | ||
|
||
public function flow(){ | ||
return $this->hasMany('App\Flow','type_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Flowlink extends Model | ||
{ | ||
protected $table="flowlink"; | ||
|
||
protected $fillable=['flow_id','type','process_id','next_process_id','status','auditor','expression','sort']; | ||
|
||
public function process(){ | ||
return $this->belongsTo('App\Process','process_id'); | ||
} | ||
|
||
public function next_process(){ | ||
return $this->belongsTo('App\Process','next_process_id'); | ||
} | ||
} |
Oops, something went wrong.