vue按需加载打包后的文件(其中之一)

(window.webpackJsonp = window.webpackJsonp || []).push(
  [
    ["AllSearch~Phone"],  // 模块名称
    {
      "1a26": function (e, t, a) { },
      "597a": function (e, t, a) {
        "use strict";
        var r = a("8f30"); a.n(r).a
      }, 
      "8f30": function (e, t, a) { },
      aa82: function (e, t, a) { 
        "use strict";
        a("b0c0"), 
        a("4ec9"),
        a("d3b7"),
        a("ac1f"),
        a("25f0"),
        a("3ca3"),
        a("1276"),
        a("ddb0");
        var r = a("71b2"),
        s = a("c1df"),
        n = a.n(s),
        o = new Map;
        o.set("callTime", "通话时间"),
        o.set("talkTime", "通话时长"),
        o.set("caller", "通话人"),
        o.set("callPhone", "通话号码"),
        o.set("answerMeFlag", "是否本人接听"),
        o.set("attention", "对应留言编号"),
        o.set("realAttentionFlag", "留言内容是否属实"),
        o.set("experienceMeFlag", "留言内容是否本人亲身经历"),
        o.set("remarks", "沟通情况简述");
        var l = { 
          components: { modal: r.a }, 
          props: { 
            telRecord: { type: Object, default: function () { } }, 
            prop_record: { type: Object, default: function () { } } 
          }, 
          data: function () { 
            return { 
              formLayout: "horizontal", 
              form: this.$form.createForm(this),
              cache_item: {}, 
              operationRecord: [], 
              savecallTime: n()().format("YYYY-MM-DD HH:mm:ss"), 
              saveLoading: !1, 
              word: 0, 
              phonemodel: !1 
            } 
          }, 
          watch: { 
            prop_record: { 
              handler: function () { 
                this.init() 
              }, 
              deep: !0 
            } 
          }, 
          mounted: function () { 
            this.init() 
          }, 
          methods: { 
            init: function () { 
              "phone" === this.$route.name ? (this.form.setFieldsValue({ 
                talkTime: this.prop_record.talkTime, 
                caller: this.prop_record.caller, 
                callPhone: this.prop_record.callPhone, 
                answerMeFlag: this.prop_record.answerMeFlag, 
                attention: this.prop_record.attention, 
                realAttentionFlag: this.prop_record.realAttentionFlag, 
                experienceMeFlag: this.prop_record.experienceMeFlag, 
                remarks: this.prop_record.remarks 
              }), 
                this.savecallTime = this.prop_record.callTime, 
                this.cache_item = Object.assign({}, this.prop_record), 
                this.word = this.prop_record.remarks.length
              ) : (this.phonemodel = !0, this.form.setFieldsValue({ 
                caller: this.prop_record.name, 
                callPhone: this.prop_record.phone, 
                attention: this.prop_record.eventCode, 
                callTime: n()(), 
                remarks: "" })) 
            }, 
            moment: n.a, 
            range: function (e, t) { 
              for (var a = [], r = e; r < t; r++)a.push(r); 
              return a 
            }, 
            disabledDate: function (e) { 
              return e && e > n()().endOf("day") 
            }, 
            disabledTime: function (e) { 
              var t = this, 
              a = this.$fun.formatTime("-", ":").split(" ")[1].split(":"), 
              r = 0, s = 0; 
              return e < n()().startOf("day") ? (r = 24, s = 60) : (r = a[0], s = a[1]), 
              { 
                disabledHours: function () { 
                  return t.range(r, 24) 
                }, 
                disabledMinutes: function () { 
                  return t.range(s, 60) 
                } 
              } 
            }, 
            closeTel: function () { 
              this.$emit("closeTel", !1) 
            }, 
            gotoPhone: function () { 
              var e = String(this.prop_record.phone); 
              this.telRecord.isVisible = !1, 
              this.$router.push({ 
                path: "/phone", 
                query: { menuCode: "60401", tel: e } 
              }) 
            }, 
            handleSubmit: function (e) { 
              var t = this; 
              e.preventDefault(), 
              this.form.validateFields((function (e, a) { 
                if (!e) 
                if (t.saveLoading = !0, a.callTime = t.savecallTime, "phone" === t.$route.name) { 
                  for (var r in a) a[r] !== t.cache_item[r] && t.operationRecord.push(o.get(r)); 
                  a.operationRecord = t.operationRecord.toString() || null, 
                  a.id = t.prop_record.id, 
                  t.$api.telrecord.postTelEdit(a)
                    .then((function (e) { 
                      e && (t.$message.success("电话记录保存成功"), t.closeTel()), 
                      t.saveLoading = !1 
                    })
                  ).catch((function () { 
                    t.saveLoading = !1, 
                    t.$message.error("电话记录保存失败") 
                  })
                  ) 
                } else a.eventId = t.prop_record.id, 
                t.$api.telrecord.postTelAdd(a)
                  .then((function (e) { 
                    e && (t.$message.success("电话记录保存成功"), t.closeTel()), 
                    t.saveLoading = !1 
                  })
                ).catch((function (e) { 
                  t.saveLoading = !1, 
                  t.$message.error("电话记录保存失败") 
                })
                ) 
              })) 
            }, 
            timeChange: function (e) { 
              this.savecallTime = null !== e ? e.format("YYYY-MM-DD HH:mm:ss") : e 
            }, 
            wordslong: function (e) { 
              this.word = e.target.value.length 
            } 
          } 
        }, 
        i = (a("ef77"), a("2877")), 
        c = Object(i.a)(l, (function () { 
          var e = this, 
          t = e.$createElement, 
          a = e._self._c || t; 
          return a("modal", { 
            attrs: { isVisible: e.telRecord.isVisible, title: e.telRecord.title, modalWidth: e.telRecord.modalWidth }, 
            on: { cancel: e.closeTel } 
          }, 
          [a("div", { 
            staticClass: "telcont" 
          }, 
          [a("vue-scroll", 
            [a("div", { staticClass: "telTit" }, 
              [
                a("span", { staticClass: "spanSty1" }, [e._v("名称")]), 
                a("span", { staticClass: "spanSty2" }, [e._v("内容")])
              ]), 
            a("div", { staticClass: "telBody" }, 
            [a("a-form", { attrs: { form: e.form }, on: { submit: e.handleSubmit } }, 
              [a("a-form-item", { attrs: { label: "通话时间", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 14, offset: 1 } } }, 
                [a("a-date-picker", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["callTime", { 
                  initialValue: e.moment(e.prop_record.callTime, "YYYY-MM-DD HH:mm:ss"), 
                  rules: [{ required: !0, message: "请选择通话时间" }] }], 
                  expression: "[\n                'callTime',\n                {\n                  initialValue: moment(\n                    prop_record.callTime,\n                    'YYYY-MM-DD HH:mm:ss'\n                  ),\n                  rules: [{ required: true, message: '请选择通话时间' }],\n                },\n              ]" }], 
                  attrs: { disabledDate: e.disabledDate, disabledTime: e.disabledTime, showTime: "", format: "YYYY-MM-DD HH:mm:ss" }, 
                  on: { change: e.timeChange, ok: e.timeChange } })
                ], 1
              ), 
              a("a-form-item", { attrs: { label: "通话时长(分钟)", colon: !1, "label-col": { span: 9 }, 
                "wrapper-col": { span: 14, offset: 1 } } }, 
                [a("a-input-number", { directives: [{ name: "decorator", rawName: "v-decorator", 
                value: ["talkTime", { rules: [{ required: !0, message: "请填写通话时长" }] }], 
                expression: "[\n                'talkTime',\n                { rules: [\n                  { required: true, message: '请填写通话时长' }\n                ] },\n              ]" }], 
                staticClass: "talk-time", 
                attrs: { min: .1, step: .1, max: 9999 } })],
                1
              ), 
            a("a-form-item", { attrs: { label: "通话人", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 14, offset: 1 } } }, 
              [a("a-input", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["caller", { rules: [{ required: !0, message: "请填写通话者姓名" }, { pattern: new RegExp("[\\u4E00-\\u9FFF]+$", "g"), message: "请填写正确的通话者姓名" }, { max: 11, message: "输入内容过长" }] }], expression: "[\n                'caller',\n                {\n                  rules: [\n                    { required: true, message: '请填写通话者姓名' },\n                    {\n                      pattern: new RegExp('[\\\\u4E00-\\\\u9FFF]+$', 'g'),\n                      message: '请填写正确的通话者姓名',\n                    },\n                    { max: 11, message: '输入内容过长' },\n                  ],\n                },\n              ]" }], attrs: { maxlength: 11 } })], 1
              ), 
            a("a-form-item", { attrs: { label: "通话号码", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 14, offset: 1 } } }, 
              [a("a-input", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["callPhone", { rules: [{ required: !0, message: "请填写通话号码" }, { pattern: new RegExp(/^(((\+\d{2}-)?0\d{2,3}-\d{7,8})|((\+\d{2}-)?(\d{2,3}-)?([1][3,4,5,7,8][0-9]\d{8})))$/), message: "手机号位数满足11位并以1开头;座机需满足XXX-XXXXXXXX的格式" }] }], expression: "[\n                'callPhone',\n                {\n                  rules: [\n                    { required: true, message: '请填写通话号码' },\n                    {\n                      pattern: new RegExp(\n                        /^(((\\+\\d{2}-)?0\\d{2,3}-\\d{7,8})|((\\+\\d{2}-)?(\\d{2,3}-)?([1][3,4,5,7,8][0-9]\\d{8})))$/\n                      ),\n                      message:\n                        '手机号位数满足11位并以1开头;座机需满足XXX-XXXXXXXX的格式',\n                    },\n                  ],\n                },\n              ]" }] })], 1
            ),
            a("a-form-item", { attrs: { label: "是否本人接听", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 6, offset: 1 } } }, 
              [a("a-select", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["answerMeFlag", { rules: [{ required: !0, message: "请选择是否本人接听" }] }], expression: "[\n                'answerMeFlag',\n                {\n                  rules: [{ required: true, message: '请选择是否本人接听' }],\n                },\n              ]" }], attrs: { placeholder: "请选择" } }, [a("a-select-option", { attrs: { value: "true" } }, [e._v(" 是 ")]),
              a("a-select-option", { attrs: { value: "false" } }, [e._v(" 否 ")])], 1)], 1
            ), 
            a("a-form-item", { attrs: { label: "对应留言编号", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 14, offset: 1 } } }, 
              [a  ("a-input", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["attention", { rules: [{ required: !1, message: "请填写对应留言编号" }] }], expression: "[\n                'attention',\n                {\n                  rules: [{ required: false, message: '请填写对应留言编号' }],\n                },\n              ]" }], attrs: { disabled: "true", maxLength: 50 } })], 1
            ), 
            a("a-form-item", { attrs: { label: "留言内容是否属实", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 6, offset: 1 } } }, 
              [a("a-select", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["realAttentionFlag", { rules: [{ required: !0, message: "请选择留言内容是否属实" }] }], expression: "[\n                'realAttentionFlag',\n                {\n                  rules: [\n                    { required: true, message: '请选择留言内容是否属实' },\n                  ],\n                },\n              ]" }], attrs: { placeholder: "请选择" } }, 
                [a("a-select-option", { attrs: { value: "true" } }, [e._v(" 是 ")]), a("a-select-option", { attrs: { value: "false" } }, [e._v(" 否 ")])], 1)], 1), a("a-form-item", { attrs: { label: "留言内容是否本人亲身经历", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 6, offset: 1 } } }, [a("a-select", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["experienceMeFlag", { rules: [{ required: !0, message: "请选择留言内容是否本人亲身经历" }] }], expression: "[\n                'experienceMeFlag',\n                {\n                  rules: [\n                    {\n                      required: true,\n                      message: '请选择留言内容是否本人亲身经历',\n                    },\n                  ],\n                },\n              ]" }], attrs: { placeholder: "请选择" } }, 
                [a("a-select-option", { attrs: { value: "true" } }, [e._v(" 是 ")]), 
                a("a-select-option", { attrs: { value: "false" } }, [e._v(" 否 ")])], 1)], 1
            ), 
            a("a-form-item", { attrs: { label: "沟通情况简述", colon: !1, "label-col": { span: 9 }, "wrapper-col": { span: 14, offset: 1 } } }, 
              [a("a-textarea", { directives: [{ name: "decorator", rawName: "v-decorator", value: ["remarks", { rules: [{ required: !0, message: "请填写沟通情况简述" }, { whitespace: !0, message: "请填写沟通情况简述" }] }], expression: "[\n                'remarks',\n                {\n                  rules: [\n                    { required: true, message: '请填写沟通情况简述' },\n                    { whitespace: true, message: '请填写沟通情况简述' },\n                  ],\n                },\n              ]" }], 
              staticStyle: { position: "relative", resize: "none" }, 
              attrs: { rows: 3, maxLength: 126, placeholder: "请填写沟通情况简述" }, 
              on: { change: function (t) { return e.wordslong(t) } } }), 
            a("p", { attrs: { id: "wordstotal" } }, [e._v(e._s(e.word) + "/126")])], 1)], 1)], 1)])], 
            1), 
            a("ul", { staticClass: "telfoot" }, 
              [a("li", { staticClass: "listy1" }, [e.phonemodel ? a("button", { staticClass: "buttonsty1", 
              on: { click: e.gotoPhone } }, 
              [e._v(" 查看已有记录 ")]) : e._e()]), 
              a("li", { staticClass: "listy2" }, 
                [a("a-button", { staticClass: "buttonsty2", attrs: { loading: e.saveLoading }, 
                on: { click: e.handleSubmit } }, [e._v("保存")])], 1), 
              a("li", { staticClass: "listy2" }, 
                [a("button", { staticClass: "buttonsty3", 
                on: { click: e.closeTel } }, [e._v("关闭")])])])]) 
              }
            ), [], !1, null, "1178284c", null); 
            t.a = c.exports }, 
      ef77: function (e, t, a) { "use strict"; 
        var r = a("1a26"); a.n(r).a
      }, 
      fd1f: function (e, t, a) { 
        "use strict"; 
        var r = { props: ["name"] }, 
        s = (a("597a"), a("2877")), 
        n = Object(s.a)(r, (function () { 
          var e = this.$createElement, 
          t = this._self._c || e; 
          return t("div", { staticClass: "CommTitle" }, 
            [
              t("div", { staticClass: "page-title" },
              [
                t("img", { staticClass: "img-header-zuos", attrs: { src: a("978d") } }), 
                t("span", [this._v(this._s(this.name))]), 
                t("img", { staticClass: "img-header-yous", attrs: { src: a("8616") } })
              ]), 
              this._t("default")
            ], 2) }), [], !1, null, "3a74f844", null); 
            t.a = n.exports }
    }]);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vue 打包输出公共 JS 加载文件可以通过配置 `webpack` 实现。 首先,在 `webpack.base.conf.js` 中添加 `CommonsChunkPlugin` 插件,将公共的代码提取到一个 `vendor` chunk 中: ```javascript const webpack = require('webpack') module.exports = { // ...其他配置 plugins: [ // 提取公共代码 new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', minChunks: function (module) { // 任何引用 node_modules 中的模块都被视为外部模块 return ( module.resource && /\.js$/.test(module.resource) && module.resource.indexOf( path.join(__dirname, '../node_modules') ) === 0 ) } }) ] } ``` 然后,在 `webpack.prod.conf.js` 中,使用 `HtmlWebpackPlugin` 插件将 `vendor` chunk 添加到生成的 HTML 文件中: ```javascript const HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { // ...其他配置 plugins: [ // 生成 HTML 文件,并注入静态资源 new HtmlWebpackPlugin({ filename: config.build.index, template: 'index.html', inject: true, chunksSortMode: 'dependency' }) ] } ``` 其中 `chunksSortMode` 选项指定 chunk 的排序方式,`'dependency'` 表示按依赖关系排序,这样可以确保 `vendor` chunk 在其他 chunk 之前加载。 最后,打包生成的静态资源文件中,将会有一个名为 `vendor.js` 的文件,它包含了所有来自 `node_modules` 目录下的第三方依赖库。在 HTML 文件中添加: ```html <script src="static/js/vendor.js"></script> ``` 即可加载这个公共的 JS 加载文件
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值