From 7bda94601c6babbf503f82feeb7ac21936c9f1bd Mon Sep 17 00:00:00 2001 From: saeid Date: Mon, 29 Apr 2019 13:20:56 +0430 Subject: [PATCH] list Test result --- public/16.js | 297 +++++++++++++++------ public/3.js | 11 +- public/mix-manifest.json | 2 +- public/vue/js/app.js | 1 + resources/js/vue/config/urls.js | 1 + resources/js/vue/views/TestResult/List.vue | 116 +++++--- resources/js/vue/views/TestType/List.vue | 8 +- 7 files changed, 317 insertions(+), 119 deletions(-) diff --git a/public/16.js b/public/16.js index 97c16d42..20ec1a14 100644 --- a/public/16.js +++ b/public/16.js @@ -9,6 +9,16 @@ "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); +/* 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"); + + +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); }); }; } + // // // @@ -97,11 +107,83 @@ __webpack_require__.r(__webpack_exports__); // // // -// -// -// -// -/* harmony default export */ __webpack_exports__["default"] = ({}); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + headers: [{ + sortable: false, + text: "AutoClaveId", + value: "name" + }, { + sortable: false, + text: "Hospital", + value: "Hospital" + }, { + sortable: false, + text: "User", + value: "Users" + }, { + sortable: false, + text: "Result", + value: "result" + }, { + sortable: false, + text: "Date", + value: "date" + }, { + sortable: false, + text: "Action", + value: "action", + align: "right" + }], + items: [], + currentPage: 1, + lastPage: 1 + }; + }, + created: function created() { + this.load(); + }, + methods: { + load: function () { + var _load = _asyncToGenerator( + /*#__PURE__*/ + _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() { + var result; + return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].get(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].listTestResult); + + case 2: + result = _context.sent; + + if (result && result.status == 200) { + this.items = result.data.data.data; + this.currentPage = result.data.data.current_page; + this.lastPage = result.data.data.last_page; + } + + case 4: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function load() { + return _load.apply(this, arguments); + } + + return load; + }() + } +}); /***/ }), @@ -216,81 +298,120 @@ var render = function() { [ _c( "v-flex", - { attrs: { xs1: "" } }, + { attrs: { md12: "" } }, [ - _c("v-card-title", [ - _c("div", [ - _c("div", [ - _vm._v("\n 222\n ") - ]), - _vm._v(" "), - _c("div", [ - _vm._v("\n Test\n ") - ]), - _vm._v(" "), - _c("div", {}, [ - _vm._v("\n 1\n ") - ]) + _c("v-data-table", { + attrs: { + headers: _vm.headers, + items: _vm.items, + "hide-actions": "" + }, + scopedSlots: _vm._u([ + { + key: "headerCell", + fn: function(ref) { + var header = ref.header + return [ + _c("span", { + staticClass: + "subheading font-weight-light text-white text--darken-3", + domProps: { textContent: _vm._s(header.text) } + }) + ] + } + }, + { + key: "items", + fn: function(ref) { + var item = ref.item + return [ + _c( + "td", + { staticClass: "headline font-weight-light" }, + [_vm._v(_vm._s(item.autoclave_id))] + ), + _vm._v(" "), + _c( + "td", + { staticClass: "title font-weight-light" }, + [ + _vm._v( + _vm._s(item.user.medical_center.name) + ) + ] + ), + _vm._v(" "), + _c( + "td", + { staticClass: "title font-weight-light" }, + [_vm._v(_vm._s(item.user.name))] + ), + _vm._v(" "), + _c( + "td", + { staticClass: "title font-weight-light" }, + [_vm._v(_vm._s(item.result))] + ), + _vm._v(" "), + _c( + "td", + { staticClass: "title font-weight-light" }, + [_vm._v(_vm._s(item.created_at))] + ), + _vm._v(" "), + _c( + "td", + { staticClass: "text-xs-right" }, + [ + _c( + "v-btn", + { + staticClass: "mr-2", + attrs: { color: "black" } + }, + [ + _c( + "v-icon", + { + staticClass: + "white--text mr-1 caption" + }, + [_vm._v("fas fa-folder")] + ), + _vm._v(" "), + _c("span", [_vm._v("Archive")]) + ], + 1 + ), + _vm._v(" "), + _c( + "v-btn", + { + staticClass: "mr-2", + attrs: { color: "cyan" } + }, + [ + _c( + "v-icon", + { + staticClass: + "white--text mr-1 caption" + }, + [_vm._v("fas fa-pen")] + ), + _vm._v(" "), + _c("span", [_vm._v("Edit")]) + ], + 1 + ) + ], + 1 + ) + ] + } + } ]) - ]) - ], - 1 - ), - _vm._v(" "), - _c( - "v-flex", - { attrs: { xs6: "" } }, - [ - _c("v-card-text", [ - _c("p", [ - _vm._v( - "\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\n " - ) - ]) - ]) - ], - 1 - ), - _vm._v(" "), - _c( - "v-flex", - { attrs: { xs4: "" } }, - [ - _c( - "v-card-text", - [ - _c( - "v-btn", - { staticClass: "mr-2", attrs: { color: "black" } }, - [ - _c( - "v-icon", - { staticClass: "white--text mr-1 caption" }, - [_vm._v("fas fa-folder")] - ), - _vm._v(" "), - _c("span", [_vm._v("Archive")]) - ], - 1 - ), - _vm._v(" "), - _c( - "v-btn", - { staticClass: "mr-2", attrs: { color: "cyan" } }, - [ - _c( - "v-icon", - { staticClass: "white--text mr-1 caption" }, - [_vm._v("fas fa-pen")] - ), - _vm._v(" "), - _c("span", [_vm._v("Edit")]) - ], - 1 - ) - ], - 1 - ) + }) ], 1 ) @@ -300,6 +421,26 @@ var render = function() { _vm._v(" "), _c("v-divider"), _vm._v(" "), + _vm.lastPage > 1 + ? _c( + "div", + { staticClass: "text-xs-center" }, + [ + _c("v-pagination", { + attrs: { length: _vm.lastPage, "total-visible": 6 }, + model: { + value: _vm.currentPage, + callback: function($$v) { + _vm.currentPage = $$v + }, + expression: "currentPage" + } + }) + ], + 1 + ) + : _vm._e(), + _vm._v(" "), _c( "v-layout", { diff --git a/public/3.js b/public/3.js index 67687a91..6f0c6d2b 100644 --- a/public/3.js +++ b/public/3.js @@ -148,11 +148,14 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar case 3: result = _context.sent; - this.items = result.data.data.data; - this.currentPage = result.data.data.current_page; - this.lastPage = result.data.data.last_page; - case 7: + if (result && result.status == 200) { + this.items = result.data.data.data; + this.currentPage = result.data.data.current_page; + this.lastPage = result.data.data.last_page; + } + + case 5: case "end": return _context.stop(); } diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 34a74e6a..7723742c 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,3 +1,3 @@ { - "/vue/js/app.js": "/vue/js/app.js?id=705b759be318dc6a6352" + "/vue/js/app.js": "/vue/js/app.js?id=1f02d7209c44ae957984" } diff --git a/public/vue/js/app.js b/public/vue/js/app.js index 28c80be1..85a69d0e 100644 --- a/public/vue/js/app.js +++ b/public/vue/js/app.js @@ -61844,6 +61844,7 @@ var urls = { logout: "/logout", storeMedicalCenter: "/MedicalCenters", storeTestResult: "/TestResults", + listTestResult: "/TestResults", listTestTypeName: "/TestTypes/ListNames", getInputs: "/GetInputs", listOpertor: "/Users", diff --git a/resources/js/vue/config/urls.js b/resources/js/vue/config/urls.js index aaf1459d..f63c506c 100644 --- a/resources/js/vue/config/urls.js +++ b/resources/js/vue/config/urls.js @@ -6,6 +6,7 @@ const urls = { logout : "/logout", storeMedicalCenter : "/MedicalCenters", storeTestResult : "/TestResults", + listTestResult : "/TestResults", listTestTypeName : "/TestTypes/ListNames", getInputs : `/GetInputs`, listOpertor : "/Users", diff --git a/resources/js/vue/views/TestResult/List.vue b/resources/js/vue/views/TestResult/List.vue index b9338dcc..ae37c668 100644 --- a/resources/js/vue/views/TestResult/List.vue +++ b/resources/js/vue/views/TestResult/List.vue @@ -40,42 +40,38 @@ - - -
-
- 222 -
-
- Test -
-
- 1 -
-
-
-
- - -

- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna -

-
-
- - - - fas fa-folder - Archive - - - fas fa-pen - Edit - - + + + + +
+
+ +
diff --git a/resources/js/vue/views/TestType/List.vue b/resources/js/vue/views/TestType/List.vue index 582d900d..49eb67cc 100644 --- a/resources/js/vue/views/TestType/List.vue +++ b/resources/js/vue/views/TestType/List.vue @@ -117,9 +117,11 @@ export default { methods: { async getData(page = 1) { const result = await ApiService.get(urls.listTestType(page)); - this.items = result.data.data.data; - this.currentPage = result.data.data.current_page; - this.lastPage = result.data.data.last_page; + if (result && result.status == 200) { + this.items = result.data.data.data; + this.currentPage = result.data.data.current_page; + this.lastPage = result.data.data.last_page; + } }, async remove(id) { const result = await ApiService.delete(urls.deleteTestType(id));