Skip to content

Commit

Permalink
[Add]代码上传
Browse files Browse the repository at this point in the history
代码上传
  • Loading branch information
lizhigang authored and lizhigang committed May 5, 2017
1 parent c142d5a commit ad3c2d9
Show file tree
Hide file tree
Showing 321 changed files with 53,521 additions and 3 deletions.
Binary file removed .DS_Store
Binary file not shown.
33 changes: 33 additions & 0 deletions .env.example
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=
5 changes: 5 additions & 0 deletions .gitattributes
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
12 changes: 12 additions & 0 deletions .gitignore
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

![image](https://github.com/Clago/workflow/raw/master/screenshots/2.jpg)

![image](https://github.com/Clago/workflow/raw/master/screenshots/3.jpg)
## 使用
`cp .env.example .env`

![image](https://github.com/Clago/workflow/raw/master/screenshots/4.jpg)
`composer install`

![image](https://github.com/Clago/workflow/raw/master/screenshots/5.jpg)
导入数据库文件,文件地址:`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)
40 changes: 40 additions & 0 deletions app/Console/Kernel.php
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');
}
}
38 changes: 38 additions & 0 deletions app/Dept.php
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');
}
}
35 changes: 35 additions & 0 deletions app/Emp.php
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');
}
}
48 changes: 48 additions & 0 deletions app/Entry.php
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');
}
}
12 changes: 12 additions & 0 deletions app/EntryData.php
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'];
}
65 changes: 65 additions & 0 deletions app/Exceptions/Handler.php
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'));
}
}
28 changes: 28 additions & 0 deletions app/Flow.php
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');
}
}
14 changes: 14 additions & 0 deletions app/FlowType.php
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');
}
}
20 changes: 20 additions & 0 deletions app/Flowlink.php
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');
}
}
Loading

0 comments on commit ad3c2d9

Please sign in to comment.