Browse Source

现场照片

zhulizhen 4 years ago
parent
commit
dbf6b9eccf

+ 1 - 1
src/components/floorMap/index.vue

@@ -29,7 +29,7 @@ export default {
             fmapID: '1000423_120', // 2020-6-18 磊哥发 1000423 大连高新万达
             canvasWidth: 1100,
             canvasHeight: 800,
-            loading: true,
+            loading: false,
             view: null,
             isQuerying: false // 限制重复查询
         }

+ 1 - 1
src/components/menuList.vue

@@ -125,7 +125,7 @@ export default {
             text-align: center;
             //background: url('../assets/images/topbar1.png') no-repeat;
             float: left;
-            width: 88px;
+            width: 80px;
             height: 48px;
             cursor: pointer;
             transition: all 0.2s;

+ 46 - 83
src/lib/GraphView.js

@@ -1,89 +1,54 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
 import { SCanvasView, SColor } from "@saga-web/draw/lib";
-var GraphView = /** @class */ (function (_super) {
-    __extends(GraphView, _super);
-    function GraphView(id) {
-        var _this = _super.call(this, id) || this;
+export class GraphView extends SCanvasView {
+    constructor(id) {
+        super(id);
         // 0 :line 1:area
-        _this._type = 0;
+        this._type = 0;
         // 线条颜色
-        _this._strokecolor = "";
+        this._strokecolor = "";
         // 背景颜色
-        _this._bgcolor = "";
+        this._bgcolor = "";
         //线条类型
-        _this._lineType = "";
+        this._lineType = "";
         //线条粗细
-        _this._lineWidth = 1;
-        return _this;
+        this._lineWidth = 1;
     }
-    Object.defineProperty(GraphView.prototype, "type", {
-        get: function () {
-            return this._type;
-        },
-        set: function (v) {
-            this._type = v;
-            this.update();
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(GraphView.prototype, "strokecolor", {
-        get: function () {
-            return this._strokecolor;
-        },
-        set: function (v) {
-            this._strokecolor = v;
-            this.update();
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(GraphView.prototype, "bgcolor", {
-        get: function () {
-            return this._bgcolor;
-        },
-        set: function (v) {
-            this._bgcolor = v;
-            this.update();
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(GraphView.prototype, "lineType", {
-        get: function () {
-            return this._lineType;
-        },
-        set: function (v) {
-            this._lineType = v;
-            this.update();
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(GraphView.prototype, "lineWidth", {
-        get: function () {
-            return this._lineWidth;
-        },
-        set: function (v) {
-            this._lineWidth = v;
-            this.update();
-        },
-        enumerable: true,
-        configurable: true
-    });
-    GraphView.prototype.onDraw = function (canvas) {
+    get type() {
+        return this._type;
+    }
+    set type(v) {
+        this._type = v;
+        this.update();
+    }
+    get strokecolor() {
+        return this._strokecolor;
+    }
+    set strokecolor(v) {
+        this._strokecolor = v;
+        this.update();
+    }
+    get bgcolor() {
+        return this._bgcolor;
+    }
+    set bgcolor(v) {
+        this._bgcolor = v;
+        this.update();
+    }
+    get lineType() {
+        return this._lineType;
+    }
+    set lineType(v) {
+        this._lineType = v;
+        this.update();
+    }
+    get lineWidth() {
+        return this._lineWidth;
+    }
+    set lineWidth(v) {
+        this._lineWidth = v;
+        this.update();
+    }
+    onDraw(canvas) {
         canvas.clearRect(0, 0, this.width, this.height);
         canvas.pen.lineWidth = this.lineWidth;
         if (this.lineType == 'dashed') {
@@ -100,7 +65,5 @@ var GraphView = /** @class */ (function (_super) {
         else if (this.type == 1) {
             canvas.drawRect(50, 28, 100, 57);
         }
-    };
-    return GraphView;
-}(SCanvasView));
-export { GraphView };
+    }
+}

+ 11 - 49
src/main.js

@@ -7,33 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
         step((generator = generator.apply(thisArg, _arguments || [])).next());
     });
 };
-var __generator = (this && this.__generator) || function (thisArg, body) {
-    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
-    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
-    function verb(n) { return function (v) { return step([n, v]); }; }
-    function step(op) {
-        if (f) throw new TypeError("Generator is already executing.");
-        while (_) try {
-            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
-            if (y = 0, t) op = [op[0] & 2, t.value];
-            switch (op[0]) {
-                case 0: case 1: t = op; break;
-                case 4: _.label++; return { value: op[1], done: false };
-                case 5: _.label++; y = op[1]; op = [0]; continue;
-                case 7: op = _.ops.pop(); _.trys.pop(); continue;
-                default:
-                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
-                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
-                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
-                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
-                    if (t[2]) _.ops.pop();
-                    _.trys.pop(); continue;
-            }
-            op = body.call(thisArg, _);
-        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
-        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
-    }
-};
 import Vue from 'vue';
 import App from './App.vue';
 import router from './router';
@@ -64,29 +37,18 @@ import Pui from 'meri-design';
 import 'meri-design/dist/index.css';
 Vue.use(Pui);
 //////////模拟传入参数
-var username = 'yangxiaoyong3';
+const username = 'yangxiaoyong3';
 /////////////////
 // 在跳入路由之前要请求获取权限信息
-router.beforeEach(function (to, from, next) { return __awaiter(void 0, void 0, void 0, function () {
-    return __generator(this, function (_a) {
-        switch (_a.label) {
-            case 0:
-                if (!!store.state.isrequestAuth) return [3 /*break*/, 3];
-                return [4 /*yield*/, store.dispatch('getUserInfo', username)];
-            case 1:
-                _a.sent();
-                return [4 /*yield*/, store.dispatch('getFloors')];
-            case 2:
-                _a.sent();
-                _a.label = 3;
-            case 3:
-                next();
-                return [2 /*return*/];
-        }
-    });
-}); });
+router.beforeEach((to, from, next) => __awaiter(void 0, void 0, void 0, function* () {
+    if (!store.state.isrequestAuth) {
+        yield store.dispatch('getUserInfo', username);
+        yield store.dispatch('getFloors');
+    }
+    next();
+}));
 new Vue({
-    router: router,
-    store: store,
-    render: function (h) { return h(App); },
+    router,
+    store,
+    render: (h) => h(App),
 }).$mount('#app');

+ 1 - 1
src/views/equipment/index.vue

@@ -118,7 +118,7 @@ export default {
         z-index: 3;
         min-width: 1300px;
         .eq-system {
-            padding: 12px 23px;
+            padding: 12px 20px;
             background: #fff;
             font-size: 16px;
             cursor: pointer;

+ 20 - 3
src/views/equipment/table/wbTable.vue

@@ -94,12 +94,14 @@
                 </el-table-column>
             </el-table-column>
             <el-table-column prop='brand' label='现场照片'>
-                <template slot-scope='{row}'>{{row.pics || '--'}}</template>
+                <template slot-scope='{row}'>
+                    <div style='cursor:pointer;color: #0091ff;' @click='clickPic(row.glsmsImage)'>{{row.glsmsImage?row.glsmsImage.length+'张':'--'}}</div>
+                </template>
             </el-table-column>
-            <el-table-column prop='reportdate' label='填报时间'>
+            <el-table-column prop='reportdate' label='填报时间' width='120'>
                 <template slot-scope='{row}'>{{row.reportdate?formatter(row.reportdate):'--'}}</template>
             </el-table-column>
-            <el-table-column prop='sjjssj' label='验收时间'>
+            <el-table-column prop='sjjssj' label='验收时间' width='120'>
                 <template slot-scope='{row}'>{{row.sjjssj?formatter(row.sjjssj): '--'}}</template>
             </el-table-column>
             <el-table-column prop='wonum' label='任务编号' show-overflow-tooltip resizable>
@@ -116,6 +118,7 @@
                 @next-click='pageChanged'
                 @current-change='pageChanged'
             ></el-pagination>
+            <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
         </div>
     </div>
 </template>
@@ -149,6 +152,7 @@ export default {
                     name: '否'
                 }
             ],
+            imgUrl: [],
             shjc: '',
             gzglid: '',
             matters: ''
@@ -209,6 +213,19 @@ export default {
                 console.log(this.tableData)
                 this.total = res.count
             })
+        },
+        clickPic(row) {
+            this.imgUrl = []
+            if (row) {
+                row.forEach(el => {
+                    let obj = {
+                        name: el.description,
+                        url: el.urlname
+                    }
+                    this.imgUrl.push(obj)
+                })
+            }
+            this.$refs.picLargeOpen.open(this.imgUrl)
         }
     },
     watch: {

+ 20 - 3
src/views/equipment/table/wxTable.vue

@@ -102,12 +102,14 @@
                 </el-table-column>
             </el-table-column>
             <el-table-column prop='brand' label='现场照片'>
-                <template slot-scope='{row}'>{{row.brand || '--'}}</template>
+                <template slot-scope='{row}'>
+                    <div style='cursor:pointer;color: #0091ff;' @click='clickPic(row.glsmsImage)'>{{row.glsmsImage?row.glsmsImage.length+'张':'--'}}</div>
+                </template>
             </el-table-column>
-            <el-table-column prop='reportdate' label='填报时间'>
+            <el-table-column prop='reportdate' label='填报时间' width='120'>
                 <template slot-scope='{row}'>{{row.reportdate?formatter(row.reportdate): '--'}}</template>
             </el-table-column>
-            <el-table-column prop='sjjssj' label='验收时间'>
+            <el-table-column prop='sjjssj' label='验收时间' width='120'>
                 <template slot-scope='{row}'>{{row.sjjssj?formatter(row.sjjssj): '--'}}</template>
             </el-table-column>
             <el-table-column prop='wonum' label='工单编号' show-overflow-tooltip resizable>
@@ -124,6 +126,7 @@
                 @next-click='pageChanged'
                 @current-change='pageChanged'
             ></el-pagination>
+            <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
         </div>
     </div>
 </template>
@@ -149,6 +152,7 @@ export default {
             wonum: '',
             formatter,
             number_format,
+            imgUrl: [],
             changeOption: [
                 {
                     id: '是',
@@ -217,6 +221,19 @@ export default {
                 this.tableData = res.data || []
                 this.total = res.count
             })
+        },
+        clickPic(row) {
+            this.imgUrl = []
+            if (row) {
+                row.forEach(el => {
+                    let obj = {
+                        name: el.description,
+                        url: el.urlname
+                    }
+                    this.imgUrl.push(obj)
+                })
+            }
+            this.$refs.picLargeOpen.open(this.imgUrl)
         }
     },
     watch: {

+ 18 - 5
tsconfig.json

@@ -1,13 +1,26 @@
 {
     "compilerOptions": {
-        "target": "es5",
+        "target": "es6",
         "module": "es2015",
         "moduleResolution": "node",
         "allowSyntheticDefaultImports": true,
         "experimentalDecorators": true,
-        "lib": ["dom", "es5", "es2015", "es2015.promise"],
+        "lib": [
+            "dom",
+            "es5",
+            "es2015",
+            "es2015.promise"
+        ],
         "strict": true
     },
-    "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],
-    "exclude": ["node_modules"]
-}
+    "include": [
+        "src/**/*.ts",
+        "src/**/*.tsx",
+        "src/**/*.vue",
+        "tests/**/*.ts",
+        "tests/**/*.tsx"
+    ],
+    "exclude": [
+        "node_modules"
+    ]
+}