瀏覽代碼

Merge branch 'master' into 'test'

# Conflicts:
#   public/index.html
侯利飞 3 年之前
父節點
當前提交
1402359ed7

+ 4 - 2
public/index.html

@@ -25,8 +25,10 @@
   <div id="app"></div>
   <!-- built files will be auto injected -->
   <script type="text/javascript">
-    window.staticHost = 'http://10.230.26.15:8000/spfm';
-    // window.staticHost = 'http://192.168.0.156:9600/';
+    window.staticHost = 'http://10.230.26.15:8000/spfm'; // 正式
+    // window.staticHost = 'http://10.149.85.90:8000/spfm'; // 测试
+    // window.staticHost = 'http://192.168.0.103:9600/';
+    // window.staticHost = 'http://192.168.2.142:9600/';
   </script>
 </body>
 

+ 349 - 0
src/pages/main/performance/common/export.js

@@ -0,0 +1,349 @@
+// import { createCellPos } from './translateNumToLetter'
+const Excel = require("exceljs");
+import FileSaver from "file-saver";
+export var exportExcel = function (luckysheet, value) {
+    // 参数为luckysheet.getluckysheetfile()获取的对象
+    // 1.创建工作簿,可以为工作簿添加属性
+    const workbook = new Excel.Workbook();
+    // 2.创建表格,第二个参数可以配置创建什么样的工作表
+    if (Object.prototype.toString.call(luckysheet) === "[object Object]") {
+        luckysheet = [luckysheet];
+    }
+    luckysheet.forEach(function (table) {
+        if (table.data.length === 0) return true;
+        // ws.getCell('B2').fill = fills.
+        const worksheet = workbook.addWorksheet(table.name);
+        const merge = (table.config && table.config.merge) || {};
+        const borderInfo = (table.config && table.config.borderInfo) || {};
+        // 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值
+        setStyleAndValue(table.data, worksheet);
+        setMerge(merge, worksheet);
+        setBorder(borderInfo, worksheet);
+        return true;
+    });
+
+    // return
+    // 4.写入 buffer
+    const buffer = workbook.xlsx.writeBuffer().then((data) => {
+        // console.log('data', data)
+        const blob = new Blob([data], {
+            type: "application/vnd.ms-excel;charset=utf-8",
+        });
+        console.log("导出成功!");
+        FileSaver.saveAs(blob, `${value}.xlsx`);
+    });
+    return buffer;
+};
+
+var setMerge = function (luckyMerge = {}, worksheet) {
+    const mergearr = Object.values(luckyMerge);
+    mergearr.forEach(function (elem) {
+        // elem格式:{r: 0, c: 0, rs: 1, cs: 2}
+        // 按开始行,开始列,结束行,结束列合并(相当于 K10:M12)
+        worksheet.mergeCells(
+            elem.r + 1,
+            elem.c + 1,
+            elem.r + elem.rs,
+            elem.c + elem.cs
+        );
+    });
+};
+
+var setBorder = function (luckyBorderInfo, worksheet) {
+    if (!Array.isArray(luckyBorderInfo)) return;
+    // console.log('luckyBorderInfo', luckyBorderInfo)
+    luckyBorderInfo.forEach(function (elem) {
+        // 现在只兼容到borderType 为range的情况
+        // console.log('ele', elem)
+        if (elem.rangeType === "range") {
+            let border = borderConvert(elem.borderType, elem.style, elem.color);
+            let rang = elem.range[0];
+            // console.log('range', rang)
+            let row = rang.row;
+            let column = rang.column;
+            for (let i = row[0] + 1; i < row[1] + 2; i++) {
+                for (let y = column[0] + 1; y < column[1] + 2; y++) {
+                    worksheet.getCell(i, y).border = border;
+                }
+            }
+        }
+        if (elem.rangeType === "cell") {
+            // col_index: 2
+            // row_index: 1
+            // b: {
+            //   color: '#d0d4e3'
+            //   style: 1
+            // }
+            const { col_index, row_index } = elem.value;
+            const borderData = Object.assign({}, elem.value);
+            delete borderData.col_index;
+            delete borderData.row_index;
+            let border = addborderToCell(borderData, row_index, col_index);
+            // console.log('bordre', border, borderData)
+            worksheet.getCell(row_index + 1, col_index + 1).border = border;
+        }
+        // console.log(rang.column_focus + 1, rang.row_focus + 1)
+        // worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border
+    });
+};
+var setStyleAndValue = function (cellArr, worksheet) {
+    if (!Array.isArray(cellArr)) return;
+    cellArr.forEach(function (row, rowid) {
+        row.every(function (cell, columnid) {
+            if (!cell) return true;
+            let fill = fillConvert(cell.bg);
+
+            let font = fontConvert(
+                cell.ff,
+                cell.fc,
+                cell.bl,
+                cell.it,
+                cell.fs,
+                cell.cl,
+                cell.ul
+            );
+            let alignment = alignmentConvert(
+                cell.vt,
+                cell.ht,
+                cell.tb,
+                cell.tr
+            );
+            let value = "";
+
+            if (cell.f) {
+                value = { formula: cell.f, result: cell.v };
+            } else if (!cell.v && cell.ct && cell.ct.s) {
+                // xls转为xlsx之后,内部存在不同的格式,都会进到富文本里,即值不存在与cell.v,而是存在于cell.ct.s之后
+                // value = cell.ct.s[0].v
+                cell.ct.s.forEach((arr) => {
+                    value += arr.v;
+                });
+            } else {
+                value = cell.v;
+            }
+            //  style 填入到_value中可以实现填充色
+            let letter = createCellPos(columnid);
+            let target = worksheet.getCell(letter + (rowid + 1));
+            // console.log('1233', letter + (rowid + 1))
+            // eslint-disable-next-line no-unused-vars
+            for (const key in fill) {
+                target.fill = fill;
+                break;
+            }
+            target.font = font;
+            target.alignment = alignment;
+            target.value = value;
+
+            return true;
+        });
+    });
+};
+
+var fillConvert = function (bg) {
+    if (!bg) {
+        return {};
+    }
+    // const bgc = bg.replace('#', '')
+    let fill = {
+        type: "pattern",
+        pattern: "solid",
+        fgColor: { argb: bg.replace("#", "") },
+    };
+    return fill;
+};
+
+var fontConvert = function (
+    ff = 0,
+    fc = "#000000",
+    bl = 0,
+    it = 0,
+    fs = 10,
+    cl = 0,
+    ul = 0
+) {
+    // luckysheet:ff(样式), fc(颜色), bl(粗体), it(斜体), fs(大小), cl(删除线), ul(下划线)
+    const luckyToExcel = {
+        0: "微软雅黑",
+        1: "宋体(Song)",
+        2: "黑体(ST Heiti)",
+        3: "楷体(ST Kaiti)",
+        4: "仿宋(ST FangSong)",
+        5: "新宋体(ST Song)",
+        6: "华文新魏",
+        7: "华文行楷",
+        8: "华文隶书",
+        9: "Arial",
+        10: "Times New Roman ",
+        11: "Tahoma ",
+        12: "Verdana",
+        num2bl: function (num) {
+            return num === 0 ? false : true;
+        },
+    };
+    // 出现Bug,导入的时候ff为luckyToExcel的val
+
+    let font = {
+        name: typeof ff === "number" ? luckyToExcel[ff] : ff,
+        family: 1,
+        size: fs,
+        color: { argb: fc.replace("#", "") },
+        bold: luckyToExcel.num2bl(bl),
+        italic: luckyToExcel.num2bl(it),
+        underline: luckyToExcel.num2bl(ul),
+        strike: luckyToExcel.num2bl(cl),
+    };
+
+    return font;
+};
+
+var alignmentConvert = function (
+    vt = "default",
+    ht = "default",
+    tb = "default",
+    tr = "default"
+) {
+    // luckysheet:vt(垂直), ht(水平), tb(换行), tr(旋转)
+    const luckyToExcel = {
+        vertical: {
+            0: "middle",
+            1: "top",
+            2: "bottom",
+            default: "top",
+        },
+        horizontal: {
+            0: "center",
+            1: "left",
+            2: "right",
+            default: "left",
+        },
+        wrapText: {
+            0: false,
+            1: false,
+            2: true,
+            default: false,
+        },
+        textRotation: {
+            0: 0,
+            1: 45,
+            2: -45,
+            3: "vertical",
+            4: 90,
+            5: -90,
+            default: 0,
+        },
+    };
+
+    let alignment = {
+        vertical: luckyToExcel.vertical[vt],
+        horizontal: luckyToExcel.horizontal[ht],
+        wrapText: luckyToExcel.wrapText[tb],
+        textRotation: luckyToExcel.textRotation[tr],
+    };
+    return alignment;
+};
+
+var borderConvert = function (borderType, style = 1, color = "#000") {
+    // 对应luckysheet的config中borderinfo的的参数
+    if (!borderType) {
+        return {};
+    }
+    const luckyToExcel = {
+        type: {
+            "border-all": "all",
+            "border-top": "top",
+            "border-right": "right",
+            "border-bottom": "bottom",
+            "border-left": "left",
+        },
+        style: {
+            0: "none",
+            1: "thin",
+            2: "hair",
+            3: "dotted",
+            4: "dashDot", // 'Dashed',
+            5: "dashDot",
+            6: "dashDotDot",
+            7: "double",
+            8: "medium",
+            9: "mediumDashed",
+            10: "mediumDashDot",
+            11: "mediumDashDotDot",
+            12: "slantDashDot",
+            13: "thick",
+        },
+    };
+    let template = {
+        style: luckyToExcel.style[style],
+        color: { argb: color.replace("#", "") },
+    };
+    let border = {};
+    if (luckyToExcel.type[borderType] === "all") {
+        border["top"] = template;
+        border["right"] = template;
+        border["bottom"] = template;
+        border["left"] = template;
+    } else {
+        border[luckyToExcel.type[borderType]] = template;
+    }
+    // console.log('border', border)
+    return border;
+};
+
+function addborderToCell(borders) {
+    let border = {};
+    const luckyExcel = {
+        type: {
+            l: "left",
+            r: "right",
+            b: "bottom",
+            t: "top",
+        },
+        style: {
+            0: "none",
+            1: "thin",
+            2: "hair",
+            3: "dotted",
+            4: "dashDot", // 'Dashed',
+            5: "dashDot",
+            6: "dashDotDot",
+            7: "double",
+            8: "medium",
+            9: "mediumDashed",
+            10: "mediumDashDot",
+            11: "mediumDashDotDot",
+            12: "slantDashDot",
+            13: "thick",
+        },
+    };
+    // console.log('borders', borders)
+    for (const bor in borders) {
+        // console.log(bor)
+        if (borders[bor].color.indexOf("rgb") === -1) {
+            border[luckyExcel.type[bor]] = {
+                style: luckyExcel.style[borders[bor].style],
+                color: { argb: borders[bor].color.replace("#", "") },
+            };
+        } else {
+            border[luckyExcel.type[bor]] = {
+                style: luckyExcel.style[borders[bor].style],
+                color: { argb: borders[bor].color },
+            };
+        }
+    }
+
+    return border;
+}
+
+function createCellPos(n) {
+    let ordA = "A".charCodeAt(0);
+
+    let ordZ = "Z".charCodeAt(0);
+    let len = ordZ - ordA + 1;
+    let s = "";
+    while (n >= 0) {
+        s = String.fromCharCode((n % len) + ordA) + s;
+
+        n = Math.floor(n / len) - 1;
+    }
+    return s;
+}

+ 10 - 1
src/pages/main/performance/components/dialog.vue

@@ -1,5 +1,6 @@
 <template>
   <el-dialog
+    :modal="modal"
     :title="title"
     :visible.sync="visible"
     :fullscreen="fullscreen"
@@ -7,6 +8,7 @@
     :before-close="handleCancel"
     :modal-append-to-body="false"
     :width="width"
+    :destroy-on-close="destroy"
   >
     <!-- 表格主体部分 -->
     <slot></slot>
@@ -45,9 +47,16 @@ export default {
       type: Boolean,
       default: false,
     },
+    modal: {
+      type: Boolean,
+      default: true,
+    },
+    destroy: {
+      type: Boolean,
+      default: false
+    }
   },
   mounted() {
-    console.log("我被初始化了");
   },
   methods: {
     //   确定的回调

+ 435 - 28
src/pages/main/performance/components/sheet.vue

@@ -2,73 +2,480 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-13 16:15:11
+ * @LastEditTime : 2021-12-26 19:33:50
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
 <template>
     <div class="sheet-container">
         <div class="flex-justify-align-end margin-bottom-20">
-            <el-upload
-                class="margin-right-10"
-                action
-                :on-change="handleChange"
-                :show-file-list="false"
+            <el-button
+                type="primary"
+                @click="handleVisible"
+                v-if="['template'].includes(attribute)"
+                >权限设置</el-button
             >
-                <el-button type="primary">上传</el-button>
-            </el-upload>
-            <el-button type="primary">保存</el-button>
-            <el-button type="primary">导出</el-button>
-            <el-button type="primary">返回</el-button>
-            <el-button type="primary">全屏显示</el-button>
+            <el-button type="primary" @click="handleDownload">导出</el-button>
+            <el-button type="primary" @click="handleFullscreen()"
+                >全屏显示</el-button
+            >
+            <template v-if="['edit'].includes(type)">
+                <el-upload
+                    v-if="!id"
+                    class="margin-right-10 margin-left-10"
+                    action
+                    :on-change="handleChange"
+                    :show-file-list="false"
+                >
+                    <el-button type="primary">上传</el-button>
+                </el-upload>
+                <el-button
+                    type="primary"
+                    @click="handleSave"
+                    :disabled="handleForbid()"
+                    ><span>{{ id ? "提交" : "新增" }}</span
+                    ><span>{{
+                        handleForbid() ? `(请先设置权限)` : ""
+                    }}</span></el-button
+                >
+            </template>
         </div>
         <div id="luckysheet" class="sheet-container-block"></div>
+        <simple-dialog
+            title="权限设置"
+            :visible="visible"
+            :modal="false"
+            width="700px"
+            @confirm="handleAuth"
+            @cancel="handleVisible"
+        >
+            <el-form ref="form" :model="form" label-width="100px">
+                <el-form-item
+                    label="可编辑列"
+                    prop="array"
+                    :rules="{
+                        required: true,
+                        message: '可编辑列不能为空',
+                        trigger: 'change',
+                    }"
+                    ><el-select
+                        v-model="form.array"
+                        placeholder="可编辑列"
+                        multiple
+                    >
+                        <el-option
+                            v-for="(value, index) in 10"
+                            :key="index"
+                            :label="index"
+                            :value="index"
+                        >
+                        </el-option> </el-select
+                ></el-form-item>
+                <el-form-item
+                    label="权限规则"
+                    prop="type"
+                    :rules="{
+                        required: true,
+                        message: '权限规则不能为空',
+                        trigger: 'change',
+                    }"
+                >
+                    <el-select v-model="form.type">
+                        <el-option
+                            v-for="item in type_options"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value"
+                        ></el-option> </el-select
+                ></el-form-item>
+                <el-form-item
+                    label="负责人"
+                    prop="charge"
+                    :rules="{
+                        required: true,
+                        message: '负责人不能为空',
+                        trigger: 'blur',
+                    }"
+                >
+                    <div
+                        class="flex-justify-start"
+                        v-for="(item, index) in form.charge"
+                        :key="index"
+                    >
+                        <el-select
+                            v-model="item.key"
+                            class="margin-bottom-20 margin-right-10 flex-1"
+                            placeholder="请选择指定列/行"
+                            multiple
+                        >
+                            <el-option
+                                v-for="(value, index) in 10"
+                                :key="index"
+                                :label="index"
+                                :value="index"
+                            >
+                            </el-option>
+                        </el-select>
+                        <el-select
+                            class="margin-bottom-20"
+                            placeholder="请选择负责人"
+                            v-model="item.value"
+                            filterable
+                        >
+                            <el-option
+                                v-for="({ label, value }, index) in charge_list"
+                                :key="index"
+                                :label="label"
+                                :value="value"
+                            ></el-option>
+                        </el-select>
+                    </div>
+
+                    <div>
+                        <el-button @click.prevent="handleCharge('add')"
+                            >添加</el-button
+                        >
+                        <el-button
+                            v-if="form.charge.length - 1"
+                            @click.prevent="handleCharge('delete')"
+                            >删除</el-button
+                        >
+                    </div>
+                </el-form-item>
+            </el-form>
+            <template v-if="!id" v-slot:footer><div></div></template>
+        </simple-dialog>
     </div>
 </template>
 
 <script>
 import luckyexcel from "luckyexcel";
+import { exportExcel } from "../common/export";
+import simpleDialog from "./dialog.vue";
 export default {
+    components: {
+        simpleDialog,
+    },
+    props: {
+        type: {
+            type: String,
+            default: "view", // view 查看 edit 编辑
+        },
+        attribute: {
+            type: String,
+            default: "template", // template 模板 order 工单 file 文件
+        },
+        id: {
+            default: null,
+        },
+    },
     data() {
-        return {};
+        return {
+            form: {
+                charge: [{ value: "" }],
+            },
+            visible: false,
+            row_list: [],
+            column_list: [],
+            charge_list: [],
+            type_options: [
+                {
+                    value: 1,
+                    label: "按行",
+                },
+                {
+                    value: 2,
+                    label: "按列",
+                },
+            ],
+        };
     },
     methods: {
         handleInit() {
-            this.handleCreate();
+            if (this.id) {
+                this.handleQuery();
+            } else {
+                this.handleCreate();
+            }
         },
-        async handleCreate(file) {
+        handleAllow({ row, column }) {
+            return (
+                this.row_list.includes(row) && this.column_list.includes(column)
+            );
+        },
+        async handleQuery() {
+            let url = "";
+            let key = "";
+            switch (this.attribute) {
+                case "template":
+                    url = "/market/CMKFileTemplate/QueryCMKFileTemplateById";
+                    key = "templateId";
+                    break;
+                case "order":
+                    url = "/market/CMKIssued/CMKQueryIssuedById";
+                    key = "id";
+                    break;
+                case "file":
+                    url = "/market/CMKIssued/CMKIssuedProcessByUser";
+                    key = "id";
+                    break;
+            }
+            const {
+                data: { templateContent, templateName, list },
+            } = await this.$http({
+                url,
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    [key]: this.id,
+                },
+            });
+            if (list && list.length) {
+                const [{ type, allowEditingColumns }] = list;
+                this.form = {
+                    ...this.form,
+                    type: JSON.parse(type),
+                    array: allowEditingColumns.split(","),
+                    charge: list.map(
+                        ({ principalId, principalName, rowNum }) => ({
+                            value: `${principalId},${principalName}`,
+                            key: rowNum.split(","),
+                        })
+                    ),
+                };
+            }
+            this.handleCreate({
+                json: JSON.parse(templateContent),
+                name: templateName,
+                type: "json",
+            });
+        },
+        handleForbid() {
+            const object = {};
+            const { array, type, charge } = this.form;
+            charge.map(({ key, value }) => {
+                if (key && value) {
+                    object[key] = value;
+                }
+            });
+            return !(Object.keys(object).length && array.length && type);
+        },
+        async handleCreate({ file, json, type, name } = {}) {
             let that = this;
             const options = {
                 container: "luckysheet",
                 lang: "zh",
                 showsheetbar: false,
                 hook: {
+                    cellEditBefore: function ([
+                        { row_focus: row, column_focus: column },
+                    ]) {
+                        if (!that.handleAllow({ row, column })) {
+                            that.$message.error("您没有编辑权限");
+                        }
+                    },
                     cellUpdateBefore: function (row, column) {
-                        console.log(row, column);
-                        that.$message.error("您没有编辑权限");
-                        return false;
+                        if (!that.handleAllow({ row, column })) {
+                            return false;
+                        }
+                    },
+                    cellRenderAfter: function (cell, position) {
+                        const { r: row, c: column } = position;
+                        if (!that.handleAllow({ row, column })) {
+                            if (cell) {
+                                cell.bg = "#d5d5d5";
+                            }
+                        }
                     },
                 },
             };
-            if (file) {
-                await new Promise((resolve) => {
-                    luckyexcel.transformExcelToLucky(file, (export_json) => {
-                        options.data = export_json.sheets;
-                        options.title = export_json.info.name;
-                        options.userInfo = export_json.info.name.creator;
-                        resolve();
-                    });
-                });
+            switch (type) {
+                case "file":
+                    if (file) {
+                        await new Promise((resolve) => {
+                            luckyexcel.transformExcelToLucky(
+                                file,
+                                (export_json) => {
+                                    options.data = [
+                                        ...export_json.sheets.map(
+                                            (element) => ({
+                                                ...element,
+                                                zoomRatio: 0.75,
+                                            })
+                                        ),
+                                    ];
+                                    options.title = export_json.info.name;
+                                    resolve();
+                                }
+                            );
+                        });
+                    }
+                    break;
+                case "json":
+                    if (json) {
+                        options.data = [
+                            {
+                                ...json,
+                                zoomRatio: 0.75,
+                            },
+                        ];
+                        options.title = name;
+                    }
+                    break;
             }
 
             window.luckysheet.create(options);
         },
         async handleChange(response) {
-            this.handleCreate(response.raw);
+            this.handleCreate({ file: response.raw, type: "file" });
+        },
+        handleDownload() {
+            exportExcel(
+                window.luckysheet.getAllSheets(),
+                window.luckysheet.getWorkbookName()
+            );
+        },
+        async handleAddAuth({ id }) {
+            const object = {};
+            const { array, charge, type } = this.form;
+            charge.map(({ key, value }) => {
+                if (key && value) {
+                    object[key] = value;
+                }
+            });
+            await this.$http({
+                url: this.id
+                    ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
+                    : "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityAdd",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    allowEditingColumns: array.join(","),
+                    auth: JSON.stringify(object),
+                    templateId: id,
+                    type,
+                },
+            });
+            this.$message.success("操作成功");
+        },
+        async handleSave() {
+            let edit_url = "";
+            switch (this.attribute) {
+                case "template":
+                    edit_url = "";
+                    break;
+                case "order":
+                    edit_url = "";
+                    break;
+                case "file":
+                    edit_url = "/market/CMKIssued/CMKIssuedSubmit";
+                    break;
+            }
+            const sheet_name = window.luckysheet.getSheet().name;
+            const data = window.luckysheet.getSheet(sheet_name);
+            const workbook_name = window.luckysheet.getWorkbookName();
+            const {
+                data: { body },
+            } = await this.$http({
+                url: this.id
+                    ? edit_url // 编辑
+                    : "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    id: this.id,
+                    templateContent: JSON.stringify(data),
+                    templateName: workbook_name,
+                },
+            });
+            // 新增时添加权限
+            if (!this.id) {
+                this.handleAddAuth({ id: body });
+            }
+            this.$emit("save");
+        },
+        handleAuth() {
+            this.$refs["form"].validate((valid) => {
+                if (valid) {
+                    if (this.handleForbid()) {
+                        this.$message.error("请选择负责人编辑权限");
+                        return false;
+                    }
+                    this.handleVisible();
+                    if (this.id) {
+                        this.handleAddAuth({ id: this.id });
+                    } else {
+                        this.$message.success("设置成功");
+                    }
+                }
+            });
+        },
+        handleCharge(type) {
+            switch (type) {
+                case "add":
+                    this.form.charge.push({
+                        value: "",
+                    });
+                    break;
+                case "delete":
+                    this.form.charge.pop();
+                    break;
+            }
+        },
+        handleVisible() {
+            this.visible = !this.visible;
+        },
+        handleFullscreen() {
+            const element = document.body;
+            const is_fullscreen =
+                document.fullScreen ||
+                document.mozFullScreen ||
+                document.webkitIsFullScreen;
+            if (!is_fullscreen) {
+                //进入全屏,多重短路表达式
+                (element.requestFullscreen && element.requestFullscreen()) ||
+                    (element.mozRequestFullScreen &&
+                        element.mozRequestFullScreen()) ||
+                    (element.webkitRequestFullscreen &&
+                        element.webkitRequestFullscreen()) ||
+                    (element.msRequestFullscreen &&
+                        element.msRequestFullscreen());
+            } else {
+                //退出全屏,三目运算符
+                document.exitFullscreen
+                    ? document.exitFullscreen()
+                    : document.mozCancelFullScreen
+                    ? document.mozCancelFullScreen()
+                    : document.webkitExitFullscreen
+                    ? document.webkitExitFullscreen()
+                    : "";
+            }
+        },
+        handleChargeList() {
+            this.$http({
+                url: "/market/techcentergj/queryLeaderList",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {},
+            }).then((response) => {
+                this.charge_list = response.data.map((element) => ({
+                    label: `${element.ou} ${element.secLeaderName}`,
+                    value: `${element.secLeaderLogin},${element.secLeaderName}`,
+                }));
+            });
         },
     },
     mounted() {
         this.handleInit();
+        this.handleChargeList();
     },
 };
 </script>

+ 13 - 4
src/pages/main/performance/components/table.vue

@@ -1,15 +1,16 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-06 19:51:14
+ * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2021-12-22 19:55:28
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
 -->
 <template>
     <el-table class="simple-table" :data="computed_list" v-loading="loading">
         <el-table-column
             v-for="(
-                { props, label, type, width, align, children }, index
+                { props, label, type, width, align, children, dictionary },
+                index
             ) in config"
             :key="index"
             :prop="props"
@@ -41,6 +42,9 @@
                         {{ scope.row[props] }}
                     </div>
                 </div>
+                <div v-else-if="type === 'dictionary'">
+                    {{ dictionary[scope.row[props]] }}
+                </div>
                 <div v-else>{{ scope.row[props] }}</div>
             </template>
             <template v-if="children">
@@ -85,7 +89,8 @@
                         <el-popconfirm
                             v-if="popconfirm"
                             :title="`确定要${label}吗?`"
-                            @confirm="handleClick(props, scope.row)"
+                            @confirm="handleClick(props,scope.row)"
+                            @cancel="handleCancel"
                         >
                             <el-button
                                 slot="reference"
@@ -148,8 +153,12 @@ export default {
             return visible;
         },
         handleClick(props, row) {
+            console.log('aaaaaaaaa')
             this.$emit(props, row);
         },
+        handleCancel(){
+            console.log('我被关闭了')
+        },
         handleModify() {
             this.$emit("modify", this.computed_list);
         },

File diff suppressed because it is too large
+ 647 - 400
src/pages/main/performance/department.vue


+ 1 - 1
src/pages/main/performance/index.vue

@@ -40,7 +40,7 @@ export default {
             name: "department",
             routes: [
                 {
-                    label: "部门绩效",
+                    label: "文件收集",
                     name: "department",
                 },
                 {

+ 145 - 136
src/pages/main/performance/issue.vue

@@ -10,10 +10,12 @@
                 :config="table_config"
                 :loading="table_loading"
                 :handle-row="table_handle_row"
-                @receiver="handleVisible('receiver')"
-                @detail="handleVisible('template')"
-                @delete="handleDelete"
-                @edit="handleVisible('template')"
+                @principalName="
+                    (params) => handleVisible('principalName', params)
+                "
+                @detail="(params) => handleVisible('detail', params)"
+                @withdraw="handleWithdraw"
+                @edit="(params) => handleVisible('edit', params)"
             ></simple-table>
             <simple-pagination
                 :page="page"
@@ -27,54 +29,69 @@
             @cancel="handleVisible('template')"
             @confirm="handleVisible('template')"
             :visible="template_visible"
-            ><div
-                class="flex-justify-align-end padding-right-20 padding-left-20"
-            >
-                <div>
-                    <el-button type="primary">导出</el-button>
-                    <el-button @click="handleVisible('template')" type="primary"
-                        >返回</el-button
-                    >
-                </div>
-            </div>
-            <analysis />
+        >
+            <!-- <div class="flex-justify-align-end padding-right-20 padding-left-20">
+        <div>
+          <el-button type="primary">导出</el-button>
+          <el-button @click="handleVisible('template')" type="primary"
+            >返回</el-button
+          >
+        </div>
+      </div> -->
+            <simpleSheet
+                v-if="template_visible && isCheck"
+                :id="edit_rows.id"
+                attribute="order"
+            />
+            <!-- 目前不支持 下发的编辑 -->
+            <!-- <simpleSheet
+                v-if="template_visible && !isCheck"
+                :id="edit_rows.id"
+                attribute="order"
+                type="edit"
+            /> -->
             <template v-slot:footer><div></div></template>
         </simple-dialog>
-        <simple-dialog
+        <!-- <simple-dialog
             title="回复详情"
-            @cancel="handleVisible('receiver')"
-            @confirm="handleVisible('receiver')"
+            width="700px"
+            @cancel="handleVisible('principalName')"
+            @confirm="handleVisible('principalName')"
             :visible="receiver_visible"
         >
             <simple-table
                 :list="receiver_table_list"
                 :config="receiver_table_config"
                 :loading="receiver_table_loading"
-                @receiver="handleVisible('receiver')"
+                @receiver="handleVisible('principalName')"
             ></simple-table>
-        </simple-dialog>
+        </simple-dialog> -->
     </div>
 </template>
 
 <script>
-import analysis from "./analysis.vue";
+// import analysis from "./analysis.vue";
 import simpleForm from "./components/form.vue";
 import simpleTable from "./components/table.vue";
 import simpleDialog from "./components/dialog.vue";
 import simplePagination from "./components/pagination.vue";
+import simpleSheet from "./components/sheet.vue";
 export default {
     components: {
-        analysis,
+        // analysis,
         simpleTable,
         simpleDialog,
         simpleForm,
         simplePagination,
+        simpleSheet,
     },
     data() {
         return {
             page: 1,
             rows: 10,
             total: 0,
+            edit_rows: {},
+            isCheck: false,
             template_visible: false,
             receiver_visible: false,
             table_loading: false,
@@ -83,22 +100,12 @@ export default {
             table_form: [
                 {
                     label: "模板名称",
-                    props: "template_name",
-                    type: "select",
-                    dictionary: [
-                        {
-                            label: "GS",
-                            value: "GS",
-                        },
-                        {
-                            label: "KPI",
-                            value: "KPI",
-                        },
-                    ],
+                    props: "templateName",
+                    type: "input",
                 },
                 {
                     label: "截止日期",
-                    props: "date",
+                    props: "endTime",
                     type: "date",
                 },
             ],
@@ -114,18 +121,14 @@ export default {
                 // },
                 {
                     label: "撤回",
-                    props: "delete",
+                    props: "withdraw",
                     popconfirm: true,
                 },
             ],
             table_config: [
                 {
-                    label: "绩效类型",
-                    props: "performance_type",
-                },
-                {
                     label: "模板名称",
-                    props: "template_name",
+                    props: "templateName",
                 },
                 {
                     label: "填报事由",
@@ -133,69 +136,25 @@ export default {
                 },
                 {
                     label: "填报注意事项",
-                    props: "note",
+                    props: "precautions",
                 },
                 {
                     label: "截止时间",
-                    props: "date",
+                    props: "endTime",
                     type: "date",
                 },
                 {
                     label: "接收人",
-                    props: "receiver",
+                    props: "principalName",
                     type: "click",
                 },
             ],
             receiver_table_list: [
                 {
-                    receiver: "刘洁",
-                    department: "科室1",
-                    date: "",
-                },
-                {
-                    receiver: "李方岩",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "吴磊",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "孙震",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "赵洪松",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "孙川",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "韦琳娜",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "吴磊",
-                    department: "科室2",
-                    date: "",
-                },
-                {
-                    receiver: "刘洁",
-                    department: "科室1",
-                    date: "",
-                },
-                {
-                    receiver: "刘洁",
-                    department: "科室1",
-                    date: "",
+                    receiver: "接收人",
+                    department: "科室",
+                    date: "回复时间",
+                    value: "2021.11.4 XXX 同意\n2021.11.4 XXX 同意",
                 },
             ],
             receiver_table_config: [
@@ -211,41 +170,91 @@ export default {
                     label: "回复时间",
                     props: "date",
                 },
+                {
+                    label: "审批记录",
+                    props: "value",
+                    type: "textarea",
+                },
             ],
         };
     },
     methods: {
-        async handleInit() {
-            this.table_loading = true;
-            const data = [];
-            let index = 0;
-            while (index < 1) {
-                data.push(
-                    ...JSON.parse(sessionStorage.getItem("global_data")).filter(
-                        (element) => element.issue_status
-                    )
-                );
-                index = index + 1;
-            }
-            this.total = index;
-            this.table_list = data;
-            this.table_loading = false;
+        async handleInit(data) {
+            this.$http({
+                url: "/market/CMKIssued/CMKIssuedList",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    ...data,
+                    endTime:
+                        data.endTime &&
+                        this.$formatDate(data.endTime, "YYYY-MM-DD"),
+                },
+            }).then(({ data: { data, count } }) => {
+                this.total = count;
+                this.table_list = data;
+            });
+            // this.table_loading = true;
+            // const data = [];
+            // let index = 0;
+            // while (index < 1) {
+            //     data.push(
+            //         ...JSON.parse(sessionStorage.getItem("global_data")).filter(
+            //             (element) => element.issue_status
+            //         )
+            //     );
+            //     index = index + 1;
+            // }
+            // this.total = index;
+            // this.table_list = data;
+            // this.table_loading = false;
         },
-        handleSearch({ template_name }) {
-            this.table_search = { template_name };
+        handleSearch(data) {
+            this.table_search = data;
             this.handleReset();
-            this.handleInit();
+            this.handleInit({ ...data, page: this.page, pageSize: this.rows });
         },
         handleChange(page) {
             this.page = page;
-            this.handleInit();
+            this.handleInit({
+                ...this.table_search,
+                page: this.page,
+                pageSize: this.rows,
+            });
         },
-        handleVisible(props) {
+        handleVisible(props, params) {
             switch (props) {
+                case "detail":
+                    if (params) {
+                        this.isCheck = true;
+                        this.edit_rows = params;
+                        this.template_visible = true;
+                    } else {
+                        this.isCheck = false;
+                        this.template_visible = false;
+                    }
+                    // this.template_visible = !this.template_visible;
+                    break;
+                case "edit":
+                    if (params) {
+                        this.isCheck = false;
+                        this.edit_rows = params;
+                        this.template_visible = true;
+                    } else {
+                        this.template_visible = false;
+                    }
+                    // this.template_visible = !this.template_visible;
+                    break;
                 case "template":
-                    this.template_visible = !this.template_visible;
+                    this.template_visible = false;
+                    // this.template_visible = !this.template_visible;
                     break;
-                case "receiver":
+                case "principalName":
+                    if (params) {
+                        console.log(params);
+                    }
                     this.receiver_visible = !this.receiver_visible;
                     break;
             }
@@ -253,33 +262,33 @@ export default {
         handleReset() {
             this.page = 1;
         },
-        handleDelete() {
-            const array = [
-                {
-                    ...JSON.parse(sessionStorage.global_data)[0],
-                    issue_status: 0,
+        handleWithdraw({ id }) {
+            this.$http({
+                url: "/market/CMKIssued/CMKDelIssuedById",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
                 },
-            ];
-            sessionStorage.setItem("global_data", JSON.stringify(array));
-            const process_array = JSON.parse(sessionStorage.global_process);
-            process_array.push({
-                link: "撤回工单",
-                creatperson: `ADMIN ${this.$formatDate(
-                    new Date(),
-                    "YYYY-MM-DD"
-                )}`,
-                explain: "",
+                data: { id },
+            }).then(({ data }) => {
+                console.log(data);
+                if (data.desc === "删除成功") {
+                    this.$message.success("撤回成功");
+                    this.handleInit({
+                        ...this.table_search,
+                        page: this.page,
+                        pageSize: this.rows,
+                    });
+                }
             });
-            sessionStorage.setItem(
-                "global_process",
-                JSON.stringify(process_array)
-            );
-            this.$message.success("撤回成功");
-            this.handleInit();
         },
     },
     mounted() {
-        this.handleInit();
+        this.handleInit({
+            ...this.table_search,
+            page: this.page,
+            pageSize: this.rows,
+        });
     },
 };
 </script>

+ 120 - 193
src/pages/main/performance/mould.vue

@@ -12,8 +12,8 @@
                 :config="table_config"
                 :loading="table_loading"
                 :handle-row="table_handle_row"
-                @issue="handleVisible('issue')"
-                @detail="handleVisible('template')"
+                @issue="(params) => handleVisible('issue', params)"
+                @detail="(params) => handleVisible('template', params)"
                 @delete="handleDelete"
             ></simple-table>
             <simple-pagination
@@ -23,129 +23,75 @@
             ></simple-pagination>
         </div>
         <simple-dialog
-            title="查看模板"
-            fullscreen
-            @cancel="handleVisible('template')"
-            @confirm="handleVisible('template')"
-            :visible="template_visible"
-        >
-            <div class="flex-justify-between padding-right-20 padding-left-20">
-                <div>
-                    <el-button type="primary" @click="handleVisible('power')"
-                        >权限设置</el-button
-                    ><el-button type="primary">导出</el-button>
-                </div>
-                <div>
-                    <el-button @click="handleVisible('template')" type="primary"
-                        >返回</el-button
-                    >
-                </div>
-            </div>
-            <analysis />
-            <template v-slot:footer><div></div></template>
-        </simple-dialog>
-        <simple-dialog
             title="下发"
             width="500px"
             @cancel="handleVisible('issue')"
             @confirm="handleIssue"
             :visible="issue_visible"
         >
-            <el-form label-width="100px" :model="form">
-                <el-form-item label="填报事由">
-                    <el-input v-model="form.reason"></el-input>
+            <el-form label-width="120px" :model="issue_form" ref="issue_ref">
+                <el-form-item
+                    label="填报事由"
+                    prop="reason"
+                    :rules="{
+                        required: true,
+                        message: '填报事由不能为空',
+                        trigger: 'blur',
+                    }"
+                >
+                    <el-input v-model="issue_form.reason"></el-input>
                 </el-form-item>
-                <el-form-item label="填报注意事项">
-                    <el-input v-model="form.note"></el-input>
+                <el-form-item
+                    label="填报注意事项"
+                    prop="precautions"
+                    :rules="{
+                        required: true,
+                        message: '填报注意事项不能为空',
+                        trigger: 'blur',
+                    }"
+                >
+                    <el-input v-model="issue_form.precautions"></el-input>
                 </el-form-item>
-                <el-form-item label="截止时间">
-                    <el-date-picker v-model="form.date" type="date">
+                <el-form-item
+                    label="截止时间"
+                    prop="endTime"
+                    :rules="{
+                        required: true,
+                        message: '截止时间不能为空',
+                        trigger: 'change',
+                    }"
+                >
+                    <el-date-picker v-model="issue_form.endTime" type="date">
                     </el-date-picker>
                 </el-form-item>
-                <el-form-item label="">
-                    <el-upload
-                        drag
-                        action="https://jsonplaceholder.typicode.com/posts/"
-                        multiple
-                    >
-                        <i class="el-icon-upload"></i>
-                        <div>上传附件</div>
-                    </el-upload>
-                </el-form-item>
             </el-form>
         </simple-dialog>
         <simple-dialog
             fullscreen
             title="新增模板"
             :visible="add_visible"
-            :reload="reload"
             width="1200px"
             @confirm="handleVisible('add')"
             @cancel="handleVisible('add')"
         >
-            <el-form inline :model="form" label-width="100px">
-                <el-form-item label="绩效类型">
-                    <el-select v-model="form.type">
-                        <el-option label="部门绩效" value="部门绩效"></el-option
-                        ><el-option
-                            label="员工绩效"
-                            value="员工绩效"
-                        ></el-option> </el-select
-                ></el-form-item>
-                <el-form-item label="绩效分类">
-                    <el-select v-model="form.class">
-                        <el-option label="GS" value="GS"></el-option
-                        ><el-option
-                            label="KPI"
-                            value="KPI"
-                        ></el-option> </el-select
-                ></el-form-item>
-                <el-form-item label="">
-                    <el-button type="primary" @click="handleVisible('power')"
-                        >权限设置</el-button
-                    >
-                </el-form-item>
-            </el-form>
-            <simple-sheet />
+            <el-form inline :model="form" label-width="100px"> </el-form>
+            <simple-sheet v-if="add_visible" @save="handleSave" type="edit" />
             <template v-slot:footer><div></div></template>
         </simple-dialog>
         <simple-dialog
-            title="权限设置"
-            :visible="power_visible"
-            :reload="reload"
-            width="700px"
-            @confirm="handleVisible('power')"
-            @cancel="handleVisible('power')"
+            title="查看模板"
+            fullscreen
+            @cancel="handleVisible('template')"
+            @confirm="handleVisible('template')"
+            :visible="template_visible"
         >
-            <el-form :model="form" label-width="100px">
-                <el-form-item label="可编辑列"
-                    ><el-input v-model="form.editrows"
-                /></el-form-item>
-                <el-form-item label="权限规则">
-                    <el-select v-model="form.rule">
-                        <el-option
-                            v-for="item in ruleoptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                        ></el-option> </el-select
-                ></el-form-item>
-                <el-form-item label="负责人">
-                    <div>
-                        <el-cascader-panel
-                            v-model="form.charge"
-                            :options="charge_options"
-                            clearable
-                            @change="handleCascader"
-                        ></el-cascader-panel></div
-                ></el-form-item>
-            </el-form>
+            <simple-sheet v-if="template_visible" :id="template_id" />
+            <template v-slot:footer><div></div></template>
         </simple-dialog>
     </div>
 </template>
 
 <script>
-import analysis from "./analysis.vue";
 import simpleForm from "./components/form.vue";
 import simpleSheet from "./components/sheet.vue";
 import simpleTable from "./components/table.vue";
@@ -153,7 +99,6 @@ import simpleDialog from "./components/dialog.vue";
 import simplePagination from "./components/pagination.vue";
 export default {
     components: {
-        analysis,
         simpleTable,
         simpleDialog,
         simpleForm,
@@ -166,48 +111,21 @@ export default {
             rows: 10,
             total: 0,
             form: {},
-            reload: 0,
-            ruleoptions: [
-                {
-                    value: "按行号",
-                    label: "按行号",
-                },
-                {
-                    value: "按科室分配",
-                    label: "按科室分配",
-                },
-                {
-                    value: "按负责人分配",
-                    label: "按负责人分配",
-                },
-                {
-                    value: "所有人员",
-                    label: "",
-                },
-            ],
-            charge_options: [
-                {
-                    label: "科室名称1",
-                    value: "科室名称1",
-                    children: [
-                        {
-                            label: "负责人",
-                            value: "负责人",
-                            children: [{ label: "尹强", value: "尹强" }],
-                        },
-                    ],
-                },
-            ],
             add_visible: false,
-            power_visible: false,
+            // template
             template_visible: false,
+            template_id: null,
+            // issue
             issue_visible: false,
+            issue_form: {},
+            issue_id: null,
+            // table
             table_loading: false,
             table_search: {},
             table_form: [
                 {
                     label: "模板名称",
-                    props: "template_name",
+                    props: "templateName",
                     type: "input",
                 },
             ],
@@ -236,27 +154,24 @@ export default {
             table_config: [
                 {
                     label: "模板名称",
-                    props: "template_name",
+                    props: "templateName",
                 },
                 {
                     label: "配置时间",
-                    props: "template_date",
+                    props: "updateTime",
                 },
                 {
-                    label: "配置工号",
-                    props: "template_number",
-                },
-                {
-                    label: "模板分类",
-                    props: "template_class",
+                    label: "配置人员",
+                    props: "createId",
                 },
                 {
                     label: "模板状态",
-                    props: "template_status",
-                },
-                {
-                    label: "模板类型",
-                    props: "template_type",
+                    props: "status",
+                    type: "dictionary",
+                    dictionary: {
+                        0: "在用",
+                        1: "停用",
+                    },
                 },
             ],
         };
@@ -264,82 +179,94 @@ export default {
     methods: {
         async handleInit() {
             this.table_loading = true;
-            const data = [];
-            let index = 0;
-            while (index < 1) {
-                data.push(...JSON.parse(sessionStorage.global_data));
-                index = index + 1;
-            }
-            this.total = index;
-            this.table_list = data;
-            this.table_loading = false;
+            this.$http({
+                url: "/market/CMKFileTemplate/CMKFileTemplateList",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    page: this.page,
+                    pageSize: this.rows,
+                    templateName: this.table_search.templateName,
+                },
+            }).then(({ data: { count, data } }) => {
+                this.total = count;
+                this.table_list = data;
+                this.table_loading = false;
+            });
         },
-        handleSearch({ template_name }) {
-            this.table_search = { template_name };
+        handleSearch({ templateName }) {
+            this.table_search = { templateName };
             this.handleReset();
             this.handleInit();
         },
         handleAdd() {},
-        // 级联选择
-        handleCascader(data) {
-            console.log(data, "data");
-        },
-        handlePower() {},
         handleChange(page) {
             this.page = page;
             this.handleInit();
         },
-        handleVisible(props) {
+        handleVisible(props, params) {
             switch (props) {
                 case "add":
                     this.add_visible = !this.add_visible;
                     break;
-                case "power":
-                    this.power_visible = !this.power_visible;
-                    break;
                 case "template":
                     this.template_visible = !this.template_visible;
+                    this.template_id = params?.id;
                     break;
                 case "issue":
                     this.issue_visible = !this.issue_visible;
+                    this.issue_id = params ? params.id : null;
                     break;
             }
         },
         handleReset() {
             this.page = 1;
         },
-        handleDelete() {
-            sessionStorage.setItem("global_data", JSON.stringify([]));
-            sessionStorage.setItem("global_process", JSON.stringify([]));
-            this.$message.success("删除成功");
-            this.handleInit();
+        handleDelete({ id }) {
+            this.$http({
+                url: "/market/CMKFileTemplate/delCMKFileTemplateById",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    templateId: id,
+                },
+            }).then(() => {
+                this.$message.success("删除成功");
+                this.handleInit();
+            });
         },
         handleIssue() {
-            const array = [
-                {
-                    ...JSON.parse(sessionStorage.global_data)[0],
-                    department_status: "待处理",
-                    issue_status: 1,
-                    performance_type: "GS",
-                    reason: this.form.reason,
-                    note: this.form.note,
-                    date: this.form.date,
-                    receiver: `刘洁,李方岩,吴磊,孙震,赵洪松,孙川,韦琳娜`,
-                },
-            ];
-            sessionStorage.setItem("global_data", JSON.stringify(array));
-            const process_array = JSON.parse(sessionStorage.global_process);
-            process_array.push({
-                link: "发起工单",
-                creatperson: `ADMIN ${this.$formatDate(new Date(), "YYYY-MM-DD")}`,
-                explain: "",
+            this.$refs["issue_ref"].validate((valid) => {
+                if (valid) {
+                    this.$http({
+                        url: "/market/CMKFileTemplate/issuedCMKFileTemplateById",
+                        method: "post",
+                        headers: {
+                            "Content-Type": "application/json",
+                        },
+                        data: {
+                            ...this.issue_form,
+                            endTime: this.$formatDate(
+                                this.issue_form.endTime,
+                                "YYYY-MM-DD"
+                            ),
+                            templateId: this.issue_id,
+                        },
+                    }).then(() => {
+                        this.handleVisible("issue");
+                        this.$message.success("下发成功");
+                        this.handleInit();
+                    });
+                }
             });
-            sessionStorage.setItem(
-                "global_process",
-                JSON.stringify(process_array)
-            );
-            this.$message.success("下发成功");
-            this.handleVisible("issue");
+        },
+        handleSave() {
+            this.handleVisible("add");
+            this.handleInit();
         },
     },
     mounted() {

+ 1 - 1
vue.config.js

@@ -94,7 +94,7 @@ module.exports = {
                 // target: 'http://192.168.2.149:9600',
                 // target: 'http://10.64.42.70:8088/',
                 // target: 'http://114.215.71.182:29600',
-                target: 'http://10.230.26.15:8000/spfm',
+                target: 'http://192.168.1.9:9600/spfm',
                 // target: 'http://127.0.0.1:9600/',
                 // target: 'http://192.168.0.156:9600/',
                 // target: 'http://192.168.2.170:9600/',