shaun-sheep %!s(int64=4) %!d(string=hai) anos
pai
achega
90f730b2e3

+ 108 - 0
src/lib/GraphView.js

@@ -0,0 +1,108 @@
+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;
+        // 0 :line 1:area
+        _this._type = 0;
+        // 线条颜色
+        _this._strokecolor = "";
+        // 背景颜色
+        _this._bgcolor = "";
+        //线条类型
+        _this._lineType = "";
+        //线条粗细
+        _this._lineWidth = 1;
+        return _this;
+    }
+    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;
+            console.log(1243);
+            this.update();
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GraphView.prototype, "lineWidth", {
+        get: function () {
+            return this._lineWidth;
+        },
+        set: function (v) {
+            this._lineWidth = v;
+            console.log(1243);
+            this.update();
+        },
+        enumerable: true,
+        configurable: true
+    });
+    GraphView.prototype.onDraw = function (canvas) {
+        canvas.clearRect(0, 0, this.width, this.height);
+        canvas.pen.lineWidth = this.lineWidth;
+        if (this.lineType == 'dashed') {
+            canvas.pen.lineDash = [10, 10];
+        }
+        if (this.lineType == 'dotted') {
+            canvas.pen.lineDash = [this.lineWidth, this.lineWidth];
+        }
+        canvas.pen.color = new SColor(this.strokecolor);
+        canvas.brush.color = new SColor(this.bgcolor);
+        if (this.type == 0) {
+            canvas.drawLine(80, 57, 120, 57);
+        }
+        else if (this.type == 1) {
+            canvas.drawRect(50, 28, 100, 57);
+        }
+    };
+    return GraphView;
+}(SCanvasView));
+export { GraphView };

+ 78 - 0
src/lib/GraphView.ts

@@ -0,0 +1,78 @@
+import { SCanvasView, SColor, SPainter } from "@saga-web/draw/lib"
+
+export class GraphView extends SCanvasView {
+    // 0 :line 1:area
+    _type: number = 0;
+    get type(): number {
+        return this._type
+    }
+    set type(v: number) {
+        this._type = v;
+        this.update()
+    }
+
+    // 线条颜色
+    private _strokecolor: string = "";
+    get strokecolor(): string {
+        return this._strokecolor
+    }
+    set strokecolor(v: string) {
+        this._strokecolor = v;
+        this.update()
+    }
+
+    // 背景颜色
+    private _bgcolor: string = "";
+    get bgcolor(): string {
+        return this._bgcolor
+    }
+    set bgcolor(v: string) {
+        this._bgcolor = v;
+        this.update()
+    }
+    //线条类型
+    private _lineType: string = "";
+    get lineType(): string {
+        return this._lineType
+    }
+    set lineType(v: string) {
+        this._lineType = v;
+        console.log(1243)
+        this.update()
+    }
+
+    //线条粗细
+
+    private _lineWidth: number = 1;
+    get lineWidth(): number {
+        return this._lineWidth
+    }
+    set lineWidth(v: number) {
+        this._lineWidth = v;
+        console.log(1243)
+        this.update()
+    }
+
+    constructor(id: string) {
+        super(id)
+    }
+
+    onDraw(canvas: SPainter): void {
+        canvas.clearRect(0, 0, this.width, this.height)
+        canvas.pen.lineWidth = this.lineWidth;
+        if (this.lineType == 'dashed') {
+            canvas.pen.lineDash = [10, 10]
+        }
+        if (this.lineType == 'dotted') {
+            canvas.pen.lineDash = [this.lineWidth, this.lineWidth]
+        }
+        canvas.pen.color = new SColor(this.strokecolor);
+        canvas.brush.color = new SColor(this.bgcolor);
+        if (this.type == 0) {
+            canvas.drawLine(80, 57, 120, 57);
+        } else if (this.type == 1) {
+
+            canvas.drawRect(50, 28, 100, 57);
+        }
+    }
+}

+ 81 - 176
src/main.js

@@ -1,184 +1,89 @@
-var __awaiter =
-    (this && this.__awaiter) ||
-    function(thisArg, _arguments, P, generator) {
-        function adopt(value) {
-            return value instanceof P
-                ? value
-                : new P(function(resolve) {
-                      resolve(value)
-                  })
-        }
-        return new (P || (P = Promise))(function(resolve, reject) {
-            function fulfilled(value) {
-                try {
-                    step(generator.next(value))
-                } catch (e) {
-                    reject(e)
-                }
-            }
-            function rejected(value) {
-                try {
-                    step(generator['throw'](value))
-                } catch (e) {
-                    reject(e)
-                }
-            }
-            function step(result) {
-                result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+        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;
             }
-            step((generator = generator.apply(thisArg, _arguments || [])).next())
-        })
+            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 };
     }
-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'
-import store from './store'
-Vue.config.productionTip = false
-import design from 'ant-design-vue'
-import 'ant-design-vue/dist/antd.css'
-Vue.use(design)
-import ElementUI from 'element-ui'
-import 'element-ui/lib/theme-chalk/index.css'
-Vue.use(ElementUI)
-import VueQuillEditor from 'vue-quill-editor'
-import 'quill/dist/quill.core.css'
-import 'quill/dist/quill.snow.css'
-import 'quill/dist/quill.bubble.css'
-Vue.use(VueQuillEditor)
-import WdEditor from '@/components/Editor'
-Vue.use(WdEditor)
-import Rotation from '@/components/Rotation'
-Vue.use(Rotation)
-import PicLarge from '@/components/PicLarge'
-Vue.use(PicLarge)
-import Legend from '@/components/Legend'
-Vue.use(Legend)
-import cookies from 'vue-cookie'
-Vue.use(cookies)
-import moment from 'moment'
-Vue.prototype.$moment = moment
-moment.locale('zh-cn')
-
+};
+import Vue from 'vue';
+import App from './App.vue';
+import router from './router';
+import store from './store';
+Vue.config.productionTip = false;
+import design from 'ant-design-vue';
+import 'ant-design-vue/dist/antd.css';
+Vue.use(design);
+import ElementUI from 'element-ui';
+import 'element-ui/lib/theme-chalk/index.css';
+Vue.use(ElementUI);
+import VueQuillEditor from 'vue-quill-editor';
+import 'quill/dist/quill.core.css';
+import 'quill/dist/quill.snow.css';
+import 'quill/dist/quill.bubble.css';
+Vue.use(VueQuillEditor);
+import WdEditor from '@/components/Editor';
+Vue.use(WdEditor);
+import Rotation from '@/components/Rotation';
+Vue.use(Rotation);
+import PicLarge from '@/components/PicLarge';
+Vue.use(PicLarge);
+import Legend from '@/components/Legend';
+Vue.use(Legend);
+import cookies from 'vue-cookie';
+Vue.use(cookies);
 //////////模拟传入参数
-var username = 'aiyu6'
+var username = 'aiyu6';
 /////////////////
 // 在跳入路由之前要请求获取权限信息
-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(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*/];
+        }
+    });
+}); });
 new Vue({
     router: router,
     store: store,
-    render: function(h) {
-        return h(App)
-    },
-}).$mount('#app')
+    render: function (h) { return h(App); },
+}).$mount('#app');

+ 116 - 30
src/views/legendLibrary/addForm.vue

@@ -12,12 +12,12 @@
                 <div class='title'>单位</div>
                 <div class='type'>图例类型</div>
                 <el-input v-model='ruleForm.Unit' style='width:200px;height:32px;'></el-input>
-                <el-select v-model='ruleForm.Type' placeholder='请选择' style='width:200px;height:32px;margin-left:46px'>
+                <el-select v-model='ruleForm.Type' placeholder='请选择' style='width:200px;height:32px;margin-left:46px' @change='initGraph'>
                     <el-option v-for='item in options' :key='item.value' :label='item.label' :value='item.value'></el-option>
                 </el-select>
             </div>
-            <div class='input-right' v-if='ruleForm.Type=="Zone" || ruleForm.Type=="Icon" || ruleForm.Type =="Line"'>
-                <div v-if=' ruleForm.Type=="Icon" ' class='input-right'>
+            <div class='input-right' ref='graph' v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Icon" || ruleForm.Type =="Line"'>
+                <!-- <div v-if=' ruleForm.Type=="Icon" ' class='input-right'>
                     <img :src='`/serve/Picture/query/${ruleForm.Url}`' alt />
                 </div>
                 <div
@@ -29,7 +29,15 @@
                     v-else
                     class='model1'
                     :style='`border-width:${ruleForm.LineWidth}px;border-style:${ruleForm.LineDash}; border-color:${ruleForm.Color};`'
+<<<<<<< HEAD
                 ></div>
+=======
+                >
+                </div>-->
+                <!-- <div ref='graph' style='width:100%;height:100%'> -->
+                <canvas id='canvas' :width='canvasWidth' :height='canvasHeight'></canvas>
+                <!-- </div> -->
+>>>>>>> 93c38f4666a4f0fcb5e8263afa5d1de70a34789c
             </div>
         </div>
         <div v-if='ruleForm.Type=="Zone" || ruleForm.Type=="Line"' class='form3'>
@@ -40,8 +48,14 @@
                 <span class='form3-span5'>边框粗细</span>
             </div>
             <div class='form3-bottom'>
-                <el-color-picker v-if='ruleForm.Type=="Zone"' v-model='ruleForm.FillColor' show-alpha style='margin:0 172px 0 10px'></el-color-picker>
-                <el-color-picker v-model='ruleForm.Color' show-alpha style='margin:0 90px 0 10px'></el-color-picker>
+                <el-color-picker
+                    v-if='ruleForm.Type=="Zone"'
+                    v-model='ruleForm.FillColor'
+                    style='margin:0 172px 0 10px'
+                    @change='changBgColor'
+                    :color-format='"hex"'
+                ></el-color-picker>
+                <el-color-picker v-model='ruleForm.Color' style='margin:0 90px 0 10px' @change='changLineColor'></el-color-picker>
 
                 <el-select
                     v-model='ruleForm.LineDash'
@@ -49,14 +63,19 @@
                     size='small'
                     style='width:160px;margin-right:24px'
                     ref='select1'
-                    @change='changeSelection1'
+                    @change='changeLineType'
                 >
                     <el-option v-for='item in borderLineOption' :key='item.id' :label='item.src' :value='item.id'>
                         <img :src='item.src' alt />
                     </el-option>
                 </el-select>
+<<<<<<< HEAD
                 <el-select v-model='ruleForm.LineWidth' placeholder='请选择' size='small' style='width:160px;' ref='select' @change='changeSelection'>
                     <el-option v-for='item in linepxOption' :key='item.id' :label='item.src' :value='item.id' slot>
+=======
+                <el-select v-model='ruleForm.LineWidth' placeholder='请选择' size='small' style='width:160px;' ref='select' @change='changeLineWidth'>
+                    <el-option v-for='item in linepxOption' :key='item.id' :label='item.src' :value='item.id'>
+>>>>>>> 93c38f4666a4f0fcb5e8263afa5d1de70a34789c
                         <img :src='item.src' alt />
                     </el-option>
                 </el-select>
@@ -99,6 +118,9 @@
 
 <script>
 import { createLegend, updateLegend, uploadImg } from '@/api/legendLibrary.js'
+import { FloorView } from '@/lib/FloorView'
+import { FloorScene } from '@/lib/FloorScene'
+import { GraphView } from '@/lib/GraphView'
 export default {
     data() {
         return {
@@ -155,7 +177,11 @@ export default {
             // this.ruleForm.Url 图标的key,/serve/Picture/query/${this.ruleForm.Url}
             value: '',
             linepxObject: {},
-            borderLineOptionObject: {}
+            borderLineOptionObject: {},
+            canvasWidth: 200,
+            canvasHeight: 114,
+            view: null,
+            scene: null
         }
     },
     props: ['ruleForm'],
@@ -170,28 +196,9 @@ export default {
                 if (res.Result == 'success') {
                     this.$set(this.ruleForm, 'Url', res.EntityList[0])
                     this.$message.success('图标上传成功!')
-                    this.fileList = []
                 }
             })
         },
-        changeSelection(val) {
-            console.log(val)
-            this.ruleForm.LineWidth = val
-            this.linepxObject = val && this.linepxOption.find(item => item.id == val)
-            this.$refs.select.$el.children[0].children[0].setAttribute(
-                'style',
-                'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
-            )
-        },
-        changeSelection1(val) {
-            console.log(val)
-            this.ruleForm.LineDash = val
-            this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
-            this.$refs.select1.$el.children[0].children[0].setAttribute(
-                'style',
-                'background:url(' + this.borderLineOptionObject.src + ')  center center no-repeat;color:transparent;'
-            )
-        },
         create() {
             //新增
             let postParams = {
@@ -201,6 +208,7 @@ export default {
                 if (res.Result == 'success') {
                     this.$message.success('添加图例成功!')
                     this.$emit('addSuccess')
+                    this.fileList = []
                 }
             })
         },
@@ -213,11 +221,93 @@ export default {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
                     this.$emit('updateSuccess')
+                    this.fileList = []
                 }
             })
         },
         handleChange(file, fileList) {
             this.fileList = fileList.slice(-1)
+        },
+        clearGraphy(type) {
+            if (this.view) {
+                this.view.type = type
+                return
+            }
+            this.view = new GraphView('canvas')
+            this.view.type = type
+        },
+        initGraph() {
+            if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
+                this.clearGraphy(this.ruleForm.Type == 'Zone' ? 1 : 0)
+            }
+            // this.scene = new FloorScene()
+        },
+        // 背景颜色改变
+        changBgColor(val) {
+            if (this.view) {
+                this.view.bgcolor = val
+            }
+        },
+        // 线条颜色改变
+        changLineColor(val) {
+            if (this.view) {
+                this.view.strokecolor = val
+            }
+        },
+        //线条类型改变
+        changeLineType(val) {
+            console.log(val)
+            this.ruleForm.LineDash = val
+            this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
+            this.$refs.select1.$el.children[0].children[0].setAttribute(
+                'style',
+                'background:url(' + this.borderLineOptionObject.src + ')  center center no-repeat;color:transparent;'
+            )
+            if (this.view) {
+                this.view.lineType = val
+            }
+        },
+        //线条宽度
+        changeLineWidth(val) {
+            this.ruleForm.LineWidth = val
+            this.linepxObject = val && this.linepxOption.find(item => item.id == val)
+            this.$refs.select.$el.children[0].children[0].setAttribute(
+                'style',
+                'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
+            )
+            if (this.view) {
+                this.view.lineWidth = Number(val)
+            }
+        },
+        base64ToFile(dataurl, filename) {
+            let arr = dataurl.split(',')
+            let mime = arr[0].match(/:(.*?);/)[1]
+            if (!filename) {
+                filename = `${new Date().getTime()}.${mime.substr(mime.indexOf('/') + 1)}`
+            }
+            let bstr = atob(arr[1])
+            let n = bstr.length
+            let u8arr = new Uint8Array(n)
+            while (n--) {
+                u8arr[n] = bstr.charCodeAt(n)
+            }
+            return new File([u8arr], filename, { type: mime })
+        },
+        saveImg() {
+            if (this.view) {
+                let data = this.view.canvasView.toDataURL('image/png')
+                console.log(data)
+                var formData = new FormData()
+                formData.append('file', this.base64ToFile(data))
+                let postParams = formData
+                uploadImg({ postParams }).then(res => {
+                    if (res.Result == 'success') {
+                        this.$set(this.ruleForm, 'Url', res.EntityList[0])
+                        this.$message.success('图标上传成功!')
+                    }
+                })
+                // this.view.saveImage('1.png', 'png')
+            }
         }
     },
     mounted() {
@@ -274,10 +364,6 @@ export default {
                 width: 56px;
                 height: 40px;
             }
-            img {
-                width: 100%;
-                height: 100%;
-            }
         }
     }
     .form3 {

+ 13 - 10
src/views/legendLibrary/addLegend.vue

@@ -69,16 +69,19 @@ export default {
             this.cancal()
         },
         save() {
-            this.dialogVisible = false
-            if (this.title == '添加图例库') {
-                this.$refs.add.create()
-            }
-            if (this.title == '修改图例库') {
-                this.$refs.add.update()
-            }
-            if (!this.title) {
-                this.$refs.searchList.save()
-            }
+            this.$refs.add.saveImg()
+            console.log('go')
+            return
+            // this.dialogVisible = false
+            // if (this.title == '添加图例库') {
+            //     this.$refs.add.create()
+            // }
+            // if (this.title == '修改图例库') {
+            //     this.$refs.add.update()
+            // }
+            // if (!this.title) {
+            // this.$refs.searchList.save()
+            // }
         }
     }
 }

+ 4 - 4
src/views/legendLibrary/index.vue

@@ -101,7 +101,7 @@
                 <el-pagination
                     background
                     layout='prev, pager, next'
-                    :total='total/size'
+                    :total='total'
                     :page-size='size'
                     @prev-click='pageChanged'
                     @next-click='pageChanged'
@@ -152,8 +152,8 @@ export default {
             ],
             TypeId: '',
             typeIdSelect: [{ id: 'Zone', name: '铺位面' }],
-            size: 11,
-            total: 1,
+            size: 10,
+            total: 0,
             currentPage: 1,
             state: 1,
             position: [],
@@ -227,7 +227,7 @@ export default {
         },
         pageChanged(page, size) {
             this.currentPage = page
-            this.size = size
+            // this.size = size
             this.getTableList()
         },
         getTableList() {