| 12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1882667e"],{"067e":function(e,t,a){},a358:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a("b775"),o={openDir:"/api/v1/example/openLocalDir",uploadFile:"/api/v1/example/uploadFile",executeJS:"/api/v1/example/executeJS",setShortcut:"/api/v1/example/setShortcut",autoLaunchEnable:"/api/v1/example/autoLaunchEnable",autoLaunchDisable:"/api/v1/example/autoLaunchDisable",autoLaunchIsEnabled:"/api/v1/example/autoLaunchIsEnabled",openSoftware:"/api/v1/example/openSoftware",selectFileDir:"/api/v1/example/selectFileDir",messageShow:"/api/v1/example/messageShow",messageShowConfirm:"/api/v1/example/messageShowConfirm",dbOperation:"/api/v1/example/dbOperation",testElectronApi:"/api/v1/example/testElectronApi"};function i(e,t){return Object(n["b"])({url:o[e],method:"post",data:t})}},ab57:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app-demo-file"}},[e._m(0),a("div",{staticClass:"one-block-2"},[a("a-upload-dragger",{attrs:{name:"file",multiple:!0,action:e.action_url},on:{change:e.handleChange}},[a("p",{staticClass:"ant-upload-drag-icon"},[a("a-icon",{attrs:{type:"inbox"}})],1),a("p",{staticClass:"ant-upload-text"},[e._v(" Click or drag file to this area to upload ")]),a("p",{staticClass:"ant-upload-hint"},[e._v(" Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files ")])])],1),a("div",{staticClass:"one-block-2"},[0!==e.image_info.length?a("a-list",{attrs:{size:"small",bordered:"","data-source":e.image_info},scopedSlots:e._u([{key:"renderItem",fn:function(t){return a("a-list-item",{staticStyle:{"text-align":"left"}},[e._v(" "+e._s(t.id)+". "+e._s(t.imageUrlText)+": "),a("a",{attrs:{href:t.url,target:"_blank"}},[e._v(e._s(t.url))])])}}],null,!1,1145998633)}):e._e()],1),e._m(1),a("div",{staticClass:"one-block-2"},[a("a-space",[a("a-button",{on:{click:function(t){return e.messageShow("ipc")}}},[e._v("消息提示(ipc)")]),a("a-button",{on:{click:function(t){return e.messageShowConfirm("ipc")}}},[e._v("消息提示与确认(ipc)")]),a("a-button",{on:{click:function(t){return e.messageShow("http")}}},[e._v("消息提示(http)")]),a("a-button",{on:{click:function(t){return e.messageShowConfirm("http")}}},[e._v("消息提示与确认(http)")])],1)],1),e._m(2),a("div",{staticClass:"one-block-2"},[a("a-row",[a("a-col",{attrs:{span:12}},[a("a-input",{attrs:{value:e.dir_path,"addon-before":"保存目录"},model:{value:e.dir_path,callback:function(t){e.dir_path=t},expression:"dir_path"}})],1),a("a-col",{attrs:{span:12}},[a("a-button",{on:{click:e.selectDir}},[e._v(" 修改目录 ")])],1)],1)],1),e._m(3),a("div",{staticClass:"one-block-2"},[a("a-list",{attrs:{grid:{gutter:16,column:4},"data-source":e.file_list},scopedSlots:e._u([{key:"renderItem",fn:function(t){return a("a-list-item",{on:{click:function(a){return e.openDirectry(t.id)}}},[a("a-card",{attrs:{title:t.content}},[a("a-button",{attrs:{type:"link"}},[e._v(" 打开 ")])],1)],1)}}])})],1),a("div",{staticClass:"footer"})])},o=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"one-block-1"},[a("span",[e._v(" 1. 上传文件到sm图床 ")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"one-block-1"},[a("span",[e._v(" 2. 系统原生对话框 ")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"one-block-1"},[a("span",[e._v(" 3. 选择保存目录 ")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"one-block-1"},[a("span",[e._v(" 4. 打开文件夹 ")])])}],i=(a("b0c0"),a("a358")),s=[{content:"【下载】目录",id:"download"},{content:"【图片】目录",id:"picture"},{content:"【文档】目录",id:"doc"},{content:"【音乐】目录",id:"music"}],c={data:function(){return{file_list:s,action_url:"/api/v1/example/uploadFile",image_info:[],num:0,dir_path:"D:\\www\\xing\\electron-egg"}},methods:{openDirectry:function(e){var t={id:e};Object(i["a"])("openDir",t).then((function(e){if(0!==e.code)return!1})).catch((function(e){console.log("err:",e)}))},handleChange:function(e){var t=e.file.status;if("uploading"!==t&&console.log(e.file),"done"===t){var a=e.file.response;if(console.log("uploadRes:",a),"success"!==a.code)return this.$message.error("file upload failed ".concat(a.code," .")),!1;this.num++;var n=a.data;n.id=this.num,n.imageUrlText="image url",this.image_info.push(n),this.$message.success("".concat(e.file.name," file uploaded successfully."))}else"error"===t&&this.$message.error("".concat(e.file.name," file upload failed."))},selectDir:function(){var e=this;Object(i["a"])("selectFileDir",{}).then((function(t){if(0!==t.code)return!1;console.log("res.data.dir:",t.data.dir),e.dir_path=t.data.dir})).catch((function(t){e.$message.error("异常")}))},messageShow:function(e){var t=this;console.log("[messageShow] type:",e),"http"==e?Object(i["a"])("messageShow",{}).then((function(e){if(0!==e.code)return!1;console.log("res:",e)})).catch((function(e){t.$message.error(e+"异常")})):t.$ipcCallMain("example.messageShow","").then((function(e){t.$message.info(e)}))},messageShowConfirm:function(e){var t=this;console.log("[messageShowConfirm] type:",e),"http"==e?Object(i["a"])("messageShowConfirm",{}).then((function(e){if(0!==e.code)return!1;console.log("res:",e)})).catch((function(e){t.$message.error(e+"异常")})):t.$ipcCallMain("example.messageShowConfirm","").then((function(e){t.$message.info(e)}))}}},l=c,r=(a("b903"),a("2877")),u=Object(r["a"])(l,n,o,!1,null,"566bc58a",null);t["default"]=u.exports},b903:function(e,t,a){"use strict";a("067e")}}]);
- //# sourceMappingURL=chunk-1882667e.a92213d6.js.map
|