From 940a1b01aba1149e999c7a4e03548a1cfa51cfc8 Mon Sep 17 00:00:00 2001 From: saeid Date: Wed, 8 May 2019 17:46:30 +0430 Subject: [PATCH] saeid --- app/Http/Controllers/TestResultController.php | 186 +++++++--- app/Http/Controllers/TestTypeController.php | 9 +- app/Policies/TestResultPolicy.php | 2 +- app/Policies/TestTypePolicy.php | 5 + app/TestResult.php | 4 + app/TestType.php | 7 +- app/Uploadable.php | 2 +- public/17.js | 125 +++++-- public/4.js | 14 +- public/mix-manifest.json | 2 +- public/vue/js/app.js | 210 ++++++++++++ .../vue/components/modal/testresult/Show.vue | 47 +++ resources/js/vue/config/urls.js | 3 + resources/js/vue/views/TestResult/List.vue | 318 +++++++++--------- resources/js/vue/views/TestType/List.vue | 267 +++++++-------- 15 files changed, 823 insertions(+), 378 deletions(-) create mode 100644 resources/js/vue/components/modal/testresult/Show.vue diff --git a/app/Http/Controllers/TestResultController.php b/app/Http/Controllers/TestResultController.php index c8d5801d..53602a8b 100644 --- a/app/Http/Controllers/TestResultController.php +++ b/app/Http/Controllers/TestResultController.php @@ -8,6 +8,10 @@ use App\Http\Requests\StoreTestResultRequest; use App\TestResult; use App\InputValue; use App\Input; +use App\Gallery; +use App\Uploadable; +use Intervention\Image\ImageManagerStatic as Image; +use Illuminate\Support\Facades\Storage; class TestResultController extends Controller { @@ -53,7 +57,7 @@ class TestResultController extends Controller $Inputs = Input::with('options','children','children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get(); - ////////////////////////////////////////////////////////////////////////////////////--2 + ///////////////////////////////////////////////////////////////////////////Inputs foreach ($Inputs as $Input) { if ($Input['type'] != 'Form') { $Value = $TestResultInfo[$Input->name]; @@ -61,21 +65,18 @@ class TestResultController extends Controller if ($Input['type'] == 'Checkbox' || $Input['type'] == 'Select' ) { foreach ($Value as $Option) { - // dd($Option); $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'option_id' => $Option]); } } else { $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'value' => $Value]); } - } else { foreach ($Input->children as $InputChild) { $Value = $TestResultInfo[$InputChild->name]; if ($InputChild['type'] == 'Checkbox' || $InputChild['type'] == 'Select') { - // dd($InputChild['type']); foreach ($Value as $Option) { $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $InputChild->id, 'option_id' => $Option]); } @@ -85,42 +86,27 @@ class TestResultController extends Controller } } - //------------------------------------------------------- - // $this->CreateChildFormValue2($Input,$TestResultObj,$TestResultInfo); - // foreach ($Input->children as $InputChild) { - // - // if ($InputChild['type'] != 'Form') { - // $Value = $TestResultInfo[$Input->name][$InputChild->name]; - // $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id , 'input_id' => $InputChild->id , 'value' => $Value]); - // } - // else { - // - // foreach ($InputChild->children as $InputChild2) { - // - // if ($InputChild2['type'] != 'Form') { - // $Value = $TestResultInfo[$Input->name][$InputChild->name][$InputChild2->name]; - // $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id , 'input_id' => $InputChild2->id , 'value' => $Value]); - // } - // else { - // - // } - // - // } - // } - // - // } - //--------------------------------------------------------- } } - // if ($request->hasFile('image')) { - // $image = $request->file('image'); - // $input['imagename'] = time().$image->getClientOriginalExtension(); - // $path = '/Uploads'.'/'.$TestResultObj->id; - // Storage::disk('public')->makeDirectory($TestResultObj->id); - // $image->move($path, $input['imagename']); - // } + ///////////////////////////////////////////////////////////////////////////Inputs + ///////////////////////////////////////////////////////////////////////////Image + if ($request->hasFile('img')) { + $Image = $request->file('img'); + $InterventionImage = Image::make($Image); + $Mime = explode('/', $InterventionImage->mime()); + + $ImageName = time().'.'.$Mime[1]; + $Path = 'uploads'.'/TestResults'.'/'.$TestResultObj->id .'/'.$ImageName; + + Storage::disk('public')->makeDirectory('TestResults'.'/'.$TestResultObj->id); + $InterventionImage->save(public_path($Path)); + + $GalleryObj = Gallery::create(['user_id' => auth('api')->user()->id, 'path' => $Path]); + $Uploadable = Uploadable::create(['uploadable_id' => $TestResultObj->id, 'uploadable_type' => 'App\TestResult', 'gallery_id' => $GalleryObj->id, 'image_role' => 'TitleImage']); + } + ///////////////////////////////////////////////////////////////////////////Image }); } catch (\Exception $e) { @@ -130,22 +116,59 @@ class TestResultController extends Controller } - public function show(TestResult $TestResult) + public function show($id) { + $TestResult = TestResult::with('input_values', 'user')->select('result', 'verified', 'autoclave_id','user_id','id')->findOrFail($id); + $options = []; foreach ($TestResult->input_values as $key => $value) { $input = $value->input; - if ($input->type == 'Checkbox' || $input->type == 'Select') { - $input_options = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get()->pluck('option_id')->toArray(); - $TestResult[$input->name] = $input_options; + + if ($input->parent_id != null && $input->parent['type'] == 'Form') { + //----------------------------------------------------------------------FormType + if ($input->type == 'Checkbox' || $input->type == 'Select') { + $input_options = InputValue::with('option')->where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get(); + $options = []; + foreach ($input_options as $input_option) { + $options[] = $input_option->option->title; + $input_values[$input->name] = $options; + } + + $children[$input->parent->name] = $input_values; + $TestResult['children'] = $children; + } + else { + $input_values = [$input->name => $value->value]; + $children[$input->parent->name] = $input_values; + $TestResult['children'] = $children; + } + //-----------------------------------------------------------------------FormType } else { - $TestResult[$input->name] = $value->value; + //-----------------------------------------------------------------------Anothertype + if ($input->type == 'Checkbox' || $input->type == 'Select') { + $input_options = InputValue::with('option')->where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get(); + $options = []; + foreach ($input_options as $input_option) { + $options[] = $input_option->option->title; + } + + $values[$input->name] = $options; + $TestResult['options'] = $values; + } + else { + $inputs[$input->name] = $value->value; + $TestResult['inputs'] = $inputs; + } + //-----------------------------------------------------------------------Anothertype } } + + if (count($TestResult->TitleImage)) { + $TestResult['imagePath'] = $TestResult->TitleImage[0]->path; + } return \MessageResponse::data($TestResult); } - //Todo:: pass Inputs public function edit(TestResult $TestResult) { foreach ($TestResult->input_values as $key => $value) { @@ -161,6 +184,14 @@ class TestResultController extends Controller return \MessageResponse::data($TestResult); } + public static function storage_path($path) + { + if (starts_with($path, 'uploads/')) { + $path = substr($path, 8); + } + return $path; + } + public function update(StoreTestResultRequest $request, TestResult $TestResult) { $TestResultData = [ @@ -173,51 +204,94 @@ class TestResultController extends Controller $TestResult->update($TestResultData); $TestResultInfo = $request->all(); - $Inputs = Input::with('options','children','children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get(); + $Inputs = Input::with('options', 'children', 'children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get(); foreach ($Inputs as $Input) { if ($Input['type'] != 'Form') { $Value = $TestResultInfo[$Input->name]; if ($Input['type'] == 'Checkbox' || $Input['type'] == 'Select' ) { + + $InputOptions = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $Input->id)->get()->each->delete(); + foreach ($Value as $Option) { - // $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'option_id' => $Option]); + $InputValueObj = InputValue::create(['test_result_id' => $TestResult->id, 'input_id' => $Input->id, 'option_id' => $Option]); } } else { - $InputValueObj = InputValue::where('test_result_id',$TestResult->id)->where('input_id', $Input['id'])->update(['value' => $Value]); + $InputValueObj = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $Input['id'])->update(['value' => $Value]); } - } else { foreach ($Input->children as $InputChild) { $Value = $TestResultInfo[$InputChild->name]; + if ($InputChild['type'] == 'Checkbox' || $InputChild['type'] == 'Select') { - $Value = json_encode($Value); + $InputOptions = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $InputChild->id)->get()->each->delete(); + + foreach ($Value as $Option) { + $InputValueObj = InputValue::create(['test_result_id' => $TestResult->id, 'input_id' => $InputChild->id, 'option_id' => $Option]); + } } else { - $InputValueObj = InputValue::where('test_result_id',$TestResult->id)->where('input_id', $InputChild['id'])->update(['value' => $Value]); + $InputValueObj = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $InputChild['id'])->update(['value' => $Value]); } - } } } - return \MessageResponse::success(null,trans('messages.update')); + //////////////////////////////////////////////////////////////////Image + $image = ''; + if (count($TestResult->TitleImage)) + $image = $TestResult->TitleImage[0]; + + if ($request->hasFile('img')) { + + $Image = $request->file('img'); + $InterventionImage = Image::make($Image); + $Mime = explode('/', $InterventionImage->mime()); + + $ImageName = time().'.'.$Mime[1]; + $Path = 'uploads'.'/TestResults'.'/'.$TestResult->id .'/'.$ImageName; + + Storage::disk('public')->makeDirectory('TestResults'.'/'.$TestResult->id); + $InterventionImage->save(public_path($Path)); + + + if ($image !== ''){ + Storage::disk('public')->delete(static::storage_path($image->path)); + Uploadable::where('gallery_id', $image->id)->where('uploadable_id', $TestResult->id)->where('uploadable_type', get_class($TestResult))->delete(); + + //-------------------------------------------------------- + $GalleryObj = Gallery::where('id', $image->id)->update(['path' => $Path]); + $Uploadable = Uploadable::create(['uploadable_id' => $TestResult->id, 'uploadable_type' => get_class($TestResult), 'gallery_id' => $image->id, 'image_role' => 'TitleImage']); + //-------------------------------------------------------- + + } + else { + //-------------------------------------------------------- + $GalleryObj = Gallery::create(['user_id' => auth('api')->user()->id, 'path' => $Path]); + $Uploadable = Uploadable::create(['uploadable_id' => $TestResult->id, 'uploadable_type' => 'App\TestResult', 'gallery_id' => $GalleryObj->id, 'image_role' => 'TitleImage']); + //-------------------------------------------------------- + } + } + //////////////////////////////////////////////////////////////////Image + + return \MessageResponse::success(null,trans('messages.update')); } public function destroy(TestResult $TestResult) { - if (auth('api')->user()->can('delete', $TestResult)) { - return \MessageResponse::error(trans('messages.failed')); + if (!auth('api')->user()->can('delete', $TestResult)) { + return \MessageResponse::error(trans('messages.access_denied')); } $TestResult->delete(); - return \MessageResponse::success(null, trans('messages.failed')); + return \MessageResponse::success(null, trans('messages.success')); } public function verifyTestResult(TestResult $TestResult) { - if (auth('api')->user()->can('verifyTestResult', $TestResult)) { - return \MessageResponse::error(trans('messages.failed')); + if (!auth('api')->user()->can('verifyTestResult', $TestResult)) { + return \MessageResponse::error(trans('messages.access_denied')); } if ($TestResult->verified == 'Verified') { $TestResult->verified = 'NotVerified'; @@ -225,7 +299,7 @@ class TestResultController extends Controller $TestResult->verified = 'Verified'; } $TestResult->save(); - return \MessageResponse::data($TestResult); + return \MessageResponse::success(trans('messages.success')); } } diff --git a/app/Http/Controllers/TestTypeController.php b/app/Http/Controllers/TestTypeController.php index 68b8bd9a..002aebd2 100644 --- a/app/Http/Controllers/TestTypeController.php +++ b/app/Http/Controllers/TestTypeController.php @@ -328,6 +328,9 @@ class TestTypeController extends Controller ///////////////////////////////////////////////////////////////////////////////////// public function getInputs(Request $request) { + if (auth('api')->user()->can('getInputs')) { + return \MessageResponse::error(trans('messages.failed')); + } if($request->test_result_id !== '') { $testTypeId = TestResult::find($request->test_result_id); } @@ -363,11 +366,9 @@ class TestTypeController extends Controller public function destroy(TestType $TestType) { - // dd($TestType); - if (auth('api')->user()->can('delete', $TestType)) { - return \MessageResponse::error(trans('messages.failed')); + if (!auth('api')->user()->can('delete', $TestType)) { + return \MessageResponse::error(trans('messages.access_denied')); } - // dd($TestType); $TestType->delete(); return \MessageResponse::success(trans('messages.success')); } diff --git a/app/Policies/TestResultPolicy.php b/app/Policies/TestResultPolicy.php index fa1730e4..f517a64b 100644 --- a/app/Policies/TestResultPolicy.php +++ b/app/Policies/TestResultPolicy.php @@ -28,7 +28,7 @@ class TestResultPolicy } public function verifyTestResult(User $User, TestResult $TestResult) { - if($User->hasRole('Supervisor')) + // if($User->hasRole('Supervisor')) return true; } } diff --git a/app/Policies/TestTypePolicy.php b/app/Policies/TestTypePolicy.php index b105618d..daeb2347 100644 --- a/app/Policies/TestTypePolicy.php +++ b/app/Policies/TestTypePolicy.php @@ -26,4 +26,9 @@ class TestTypePolicy // if($User->hasRole('Admin')) return true; } + public function getInputs(User $User) + { + // if($User->hasRole('Admin')) + return true; + } } diff --git a/app/TestResult.php b/app/TestResult.php index f4628164..59e98932 100644 --- a/app/TestResult.php +++ b/app/TestResult.php @@ -19,4 +19,8 @@ class TestResult extends Model { return $this->hasMany('App\InputValue'); } + public function TitleImage() + { + return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage'); + } } diff --git a/app/TestType.php b/app/TestType.php index 26b622be..18d76b24 100644 --- a/app/TestType.php +++ b/app/TestType.php @@ -3,12 +3,15 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class TestType extends Model { - public $fillable = ['name','unique_code','user_id']; - protected $softDelete = true; + use SoftDeletes; + public $fillable = ['name','unique_code','user_id']; + // protected $softDelete = true; + public function user() { return $this->belongsTo('App\User'); diff --git a/app/Uploadable.php b/app/Uploadable.php index 2a408d5c..5a36207a 100644 --- a/app/Uploadable.php +++ b/app/Uploadable.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model; class Uploadable extends Model { - protected $fillable = ['uploadable_id', 'uploadable_type', 'gallery_id']; + protected $fillable = ['uploadable_id', 'uploadable_type', 'gallery_id', 'image_role']; public $timestamps = false; public function gallery() diff --git a/public/17.js b/public/17.js index 31ebf3bd..431aabe6 100644 --- a/public/17.js +++ b/public/17.js @@ -13,12 +13,17 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/services */ "./resources/js/vue/services/index.js"); /* harmony import */ var _config_urls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/config/urls */ "./resources/js/vue/config/urls.js"); +/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + // // // @@ -106,13 +111,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar // // // -// -// -// -// -// -// -// + /* harmony default export */ __webpack_exports__["default"] = ({ @@ -152,7 +151,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar created: function created() { this.load(); }, - methods: { + methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_3__["mapMutations"])("modal", ["changeCurrentModal"]), { load: function () { var _load = _asyncToGenerator( /*#__PURE__*/ @@ -191,21 +190,59 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar return load; }(), - remove: function () { - var _remove = _asyncToGenerator( + show: function () { + var _show = _asyncToGenerator( /*#__PURE__*/ _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(testResultId) { - var result, key; + var result; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; - return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].delete(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].removeTestResult(testResultId)); + return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].get(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].showTestResult(testResultId)); case 2: result = _context2.sent; + if (result && result.status == 200) { + this.changeCurrentModal({ + modal: "modal-testresult-show", + properties: { + result: result + } + }); + } + + case 4: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function show(_x) { + return _show.apply(this, arguments); + } + + return show; + }(), + remove: function () { + var _remove = _asyncToGenerator( + /*#__PURE__*/ + _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(testResultId) { + var result, key; + return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.next = 2; + return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].delete(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].removeTestResult(testResultId)); + + case 2: + result = _context3.sent; + if (result && result.status == 200) { for (key in this.items) { if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) { @@ -216,19 +253,19 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar case 4: case "end": - return _context2.stop(); + return _context3.stop(); } } - }, _callee2, this); + }, _callee3, this); })); - function remove(_x) { + function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() - }, + }), watch: { currentPage: function currentPage(page) { this.load(page); @@ -333,6 +370,45 @@ var render = function() { ) ], 1 + ), + _vm._v(" "), + _c("v-spacer"), + _vm._v(" "), + _c( + "v-flex", + { + staticClass: "text-xs-right", + attrs: { xs12: "", md2: "", sm2: "" } + }, + [ + _c( + "router-link", + { attrs: { to: { name: "SubmitTestResult" } } }, + [ + _c( + "v-btn", + { + staticClass: + "WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" + }, + [ + _c( + "v-icon", + { staticClass: "black--text mr-2 caption" }, + [_vm._v("fas fa-plus")] + ), + _vm._v(" "), + _c("span", { staticClass: "black--text" }, [ + _vm._v("Add") + ]) + ], + 1 + ) + ], + 1 + ) + ], + 1 ) ], 1 @@ -418,7 +494,12 @@ var render = function() { "v-btn", { staticClass: "mr-2", - attrs: { color: "cyan" } + attrs: { color: "cyan" }, + on: { + click: function($event) { + return _vm.show(item.id) + } + } }, [ _c( @@ -473,8 +554,8 @@ var render = function() { _c( "v-btn", { - staticClass: "mr-2", - attrs: { color: "black" }, + staticClass: "WM-ActionButton", + attrs: { color: "pink" }, on: { click: function($event) { return _vm.remove(item.id) @@ -486,12 +567,12 @@ var render = function() { "v-icon", { staticClass: - "white--text mr-1 caption" + "white--text mr-2 caption" }, - [_vm._v("fas fa-folder")] + [_vm._v("fas fa-times")] ), _vm._v(" "), - _c("span", [_vm._v("Archive")]) + _c("span", [_vm._v("Remove")]) ], 1 ) diff --git a/public/4.js b/public/4.js index 07738567..dec5feab 100644 --- a/public/4.js +++ b/public/4.js @@ -95,6 +95,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar // // // +// +// /* harmony default export */ __webpack_exports__["default"] = ({ @@ -225,7 +227,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n.WM-ActionButton[data-v-b1f1b72e] {\r\n padding: 8px 22px;\n}\r\n", ""]); +exports.push([module.i, "\n.WM-ActionButton[data-v-b1f1b72e] {\r\n padding: 8px 22px;\n}\r\n", ""]); @@ -492,8 +494,8 @@ var render = function() { _c( "v-btn", { - staticClass: "WM-ActionButton", - attrs: { color: "pink" }, + staticClass: "mr-2", + attrs: { color: "black" }, on: { click: function($event) { return _vm.remove(item.id) @@ -504,12 +506,12 @@ var render = function() { _c( "v-icon", { - staticClass: "white--text mr-2 caption" + staticClass: "white--text mr-1 caption" }, - [_vm._v("fas fa-times")] + [_vm._v("fas fa-folder")] ), _vm._v(" "), - _c("span", [_vm._v("Remove")]) + _c("span", [_vm._v("Archive")]) ], 1 ) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 624fee0b..f3cfd725 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,3 +1,3 @@ { - "/vue/js/app.js": "/vue/js/app.js?id=753975375c400e12c93b" + "/vue/js/app.js": "/vue/js/app.js?id=571c3030afcd24e8d145" } diff --git a/public/vue/js/app.js b/public/vue/js/app.js index c0278172..9f61b2aa 100644 --- a/public/vue/js/app.js +++ b/public/vue/js/app.js @@ -3445,6 +3445,67 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope /***/ }), +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&": +/*!************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js& ***! + \************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js"); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + // import { ApiService } from "@/services"; +// import { urls } from "@/config/urls"; + +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + data: {} + }; + }, + methods: {// ...mapMutations("modal", ["closeModal", "setResultModal"]), + // async changeRole() { + // const result = await ApiService.post( + // urls.changeRoleUser(this.getModalProperties.user.id), + // this.data + // ); + // if (result && result.status == 200) { + // this.setResultModal(result.data.data); + // this.closeModal(); + // } + // } + }, + created: function created() { + this.data = this.getModalProperties.result.data.data; + }, + computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapGetters"])("modal", ["getModalProperties"])) +}); + +/***/ }), + /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/user/Role.vue?vue&type=script&lang=js&": /*!******************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/user/Role.vue?vue&type=script&lang=js& ***! @@ -17299,6 +17360,82 @@ render._withStripped = true +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&": +/*!****************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e& ***! + \****************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c( + "v-container", + { attrs: { fluid: "" } }, + [ + _c( + "material-card", + { attrs: { color: "black", title: "Show Test Resualt", text: "" } }, + [ + _c( + "v-layout", + { + staticClass: "my-3", + attrs: { "align-center": "", wrap: "" } + }, + [ + _c( + "v-flex", + { attrs: { xs12: "", md2: "", sm2: "" } }, + [ + _c("v-text-field", { + staticClass: "pa-2", + attrs: { label: "Name", color: "black" } + }) + ], + 1 + ) + ], + 1 + ), + _vm._v(" "), + _c("v-divider"), + _vm._v(" "), + _c( + "v-layout", + { + staticClass: "my-3", + attrs: { "align-center": "", wrap: "" } + }, + [_c("v-flex", { attrs: { md12: "" } })], + 1 + ) + ], + 1 + ) + ], + 1 + ) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/user/Role.vue?vue&type=template&id=f7c30ab4&": @@ -60764,6 +60901,7 @@ var map = { "./modal/Base.vue": "./resources/js/vue/components/modal/Base.vue", "./modal/auth/ChangePassword.vue": "./resources/js/vue/components/modal/auth/ChangePassword.vue", "./modal/auth/VerifyCode.vue": "./resources/js/vue/components/modal/auth/VerifyCode.vue", + "./modal/testresult/Show.vue": "./resources/js/vue/components/modal/testresult/Show.vue", "./modal/user/Role.vue": "./resources/js/vue/components/modal/user/Role.vue" }; @@ -62050,6 +62188,75 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "./resources/js/vue/components/modal/testresult/Show.vue": +/*!***************************************************************!*\ + !*** ./resources/js/vue/components/modal/testresult/Show.vue ***! + \***************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Show.vue?vue&type=template&id=9160f06e& */ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&"); +/* harmony import */ var _Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Show.vue?vue&type=script&lang=js& */ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["render"], + _Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/vue/components/modal/testresult/Show.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&": +/*!****************************************************************************************!*\ + !*** ./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js& ***! + \****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/babel-loader/lib??ref--4-0!../../../../../../node_modules/vue-loader/lib??vue-loader-options!./Show.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&": +/*!**********************************************************************************************!*\ + !*** ./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e& ***! + \**********************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../node_modules/vue-loader/lib??vue-loader-options!./Show.vue?vue&type=template&id=9160f06e& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + /***/ }), /***/ "./resources/js/vue/components/modal/user/Role.vue": @@ -62165,6 +62372,9 @@ var urls = { updateTestResult: function updateTestResult(id) { return "/TestResults/".concat(id); }, + showTestResult: function showTestResult(id) { + return "/TestResults/".concat(id); + }, removeTestResult: function removeTestResult(id) { return "/TestResults/".concat(id); }, diff --git a/resources/js/vue/components/modal/testresult/Show.vue b/resources/js/vue/components/modal/testresult/Show.vue new file mode 100644 index 00000000..179945a4 --- /dev/null +++ b/resources/js/vue/components/modal/testresult/Show.vue @@ -0,0 +1,47 @@ + + \ No newline at end of file diff --git a/resources/js/vue/config/urls.js b/resources/js/vue/config/urls.js index 78d13c36..47869e3e 100644 --- a/resources/js/vue/config/urls.js +++ b/resources/js/vue/config/urls.js @@ -32,6 +32,9 @@ const urls = { updateTestResult : function(id) { return `/TestResults/${id}`; }, + showTestResult : function(id) { + return `/TestResults/${id}`; + }, removeTestResult : function(id) { return `/TestResults/${id}`; }, diff --git a/resources/js/vue/views/TestResult/List.vue b/resources/js/vue/views/TestResult/List.vue index 32734d8a..c6e6009d 100644 --- a/resources/js/vue/views/TestResult/List.vue +++ b/resources/js/vue/views/TestResult/List.vue @@ -1,167 +1,177 @@ \ No newline at end of file diff --git a/resources/js/vue/views/TestType/List.vue b/resources/js/vue/views/TestType/List.vue index 49eb67cc..03456a3b 100644 --- a/resources/js/vue/views/TestType/List.vue +++ b/resources/js/vue/views/TestType/List.vue @@ -1,149 +1,154 @@