main.b8f1ff581d25527d4f03.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842
  1. webpackJsonp([4],[
  2. /* 0 */,
  3. /* 1 */,
  4. /* 2 */,
  5. /* 3 */,
  6. /* 4 */
  7. /***/ (function(module, exports) {
  8. throw new Error("Module parse failed: D:\\workarea\\normal\\crontab\\src\\libs\\api.js Unexpected token (4:1)\nYou may need an appropriate loader to handle this file type.\n| \r\n| export default {\r\n| \t...network,\r\n| \r\n| \t// api 接口\r");
  9. /***/ }),
  10. /* 5 */,
  11. /* 6 */
  12. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13. "use strict";
  14. var getURL = function (search, name) {
  15. var reg = new RegExp("[?&]" + name + "=([^&]*)(&|$)", "i");
  16. var r = search.match(reg);
  17. if (r != null) return unescape(r[1]);
  18. return null;
  19. };
  20. function setCookie(c_name, value, expiredays) {
  21. var exdate = new Date()
  22. exdate.setDate(exdate.getDate() + expiredays)
  23. document.cookie = c_name + "=" + escape(value) +
  24. ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
  25. }
  26. //取回cookie
  27. function getCookie(c_name) {
  28. if (document.cookie.length > 0) {
  29. var c_start = document.cookie.indexOf(c_name + "=");
  30. var c_end;
  31. if (c_start != -1) {
  32. c_start = c_start + c_name.length + 1
  33. c_end = document.cookie.indexOf(";", c_start)
  34. if (c_end == -1) c_end = document.cookie.length
  35. return unescape(document.cookie.substring(c_start, c_end))
  36. }
  37. }
  38. return ""
  39. }
  40. var getStorage = function (name) {
  41. if (window.localStorage) {
  42. return window.localStorage.getItem(name);
  43. } else {
  44. return getCookie(name);
  45. }
  46. }
  47. function delCookie(key) {
  48. var date = new Date();
  49. date.setTime(date.getTime() - 1);
  50. var delValue = getCookie(key);
  51. if (!!delValue) {
  52. document.cookie = key + '=' + delValue + ';expires=' + date.toGMTString();
  53. }
  54. }
  55. // String.prototype.
  56. const clearEmpty = function (Obj) {
  57. let newObject = {};
  58. for (const key in Obj) {
  59. if (Obj.hasOwnProperty(key)) {
  60. const element = Obj[key];
  61. if (typeof element === 'string') {
  62. if (element) {
  63. newObject[key] = element;
  64. }
  65. continue;
  66. }
  67. if (['boolean', 'number'].indexOf(typeof element) >= 0) {
  68. newObject[key] = element;
  69. continue;
  70. }
  71. if (element instanceof Object) {
  72. if (!isEmptyObject(element)) {
  73. let obj = clearEmpty(element);
  74. if (!isEmptyObject(obj)) {
  75. newObject[key] = clearEmpty(element);
  76. }
  77. continue;
  78. }
  79. }
  80. if (element instanceof Array) {
  81. if (element.length > 0) {
  82. newObject[key] = element;
  83. continue;
  84. }
  85. }
  86. }
  87. }
  88. return newObject;
  89. }
  90. /**
  91. *
  92. * @desc 随机生成颜色
  93. * @return {String}
  94. */
  95. function randomColor() {
  96. return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6);
  97. }
  98. /**
  99. *
  100. * @desc 生成指定范围随机数
  101. * @param {Number} min
  102. * @param {Number} max
  103. * @return {Number}
  104. */
  105. function randomNum(min, max) {
  106. return Math.floor(min + Math.random() * (max - min));
  107. }
  108. /**
  109. * @desc 格式化${startTime}距现在的已过时间
  110. * @param {Date} startTime
  111. * @return {String}
  112. */
  113. function formatPassTime(startTime) {
  114. var currentTime = Date.parse(new Date()),
  115. time = currentTime - startTime,
  116. day = parseInt(time / (1000 * 60 * 60 * 24)),
  117. hour = parseInt(time / (1000 * 60 * 60)),
  118. min = parseInt(time / (1000 * 60)),
  119. month = parseInt(day / 30),
  120. year = parseInt(month / 12);
  121. if (year) return year + "年前"
  122. if (month) return month + "个月前"
  123. if (day) return day + "天前"
  124. if (hour) return hour + "小时前"
  125. if (min) return min + "分钟前"
  126. else return '刚刚'
  127. }
  128. /**
  129. *
  130. * @desc 格式化现在距${endTime}的剩余时间
  131. * @param {Date} endTime
  132. * @return {String}
  133. */
  134. function formatRemainTime(endTime) {
  135. var startDate = new Date(); //开始时间
  136. var endDate = new Date(endTime); //结束时间
  137. var t = endDate.getTime() - startDate.getTime(); //时间差
  138. var d = 0,
  139. h = 0,
  140. m = 0,
  141. s = 0;
  142. if (t >= 0) {
  143. d = Math.floor(t / 1000 / 3600 / 24);
  144. h = Math.floor(t / 1000 / 60 / 60 % 24);
  145. m = Math.floor(t / 1000 / 60 % 60);
  146. s = Math.floor(t / 1000 % 60);
  147. }
  148. return d + "天 " + h + "小时 " + m + "分钟 " + s + "秒";
  149. }
  150. /**
  151. *
  152. * @desc 判断是否NaN
  153. * @param {Any} value
  154. * @return {Boolean}
  155. */
  156. function isNaN(value) {
  157. return value !== value;
  158. };
  159. /**
  160. *
  161. * @desc 判断两个数组是否相等
  162. * @param {Array} arr1
  163. * @param {Array} arr2
  164. * @return {Boolean}
  165. */
  166. function arrayEqual(arr1, arr2) {
  167. if (arr1 === arr2) return true;
  168. if (arr1.length != arr2.length) return false;
  169. for (var i = 0; i < arr1.length; ++i) {
  170. if (arr1[i] !== arr2[i]) return false;
  171. }
  172. return true;
  173. }
  174. /**
  175. *
  176. * @desc 获取浏览器类型和版本
  177. * @return {String}
  178. */
  179. function getExplore() {
  180. var sys = {},
  181. ua = navigator.userAgent.toLowerCase(),
  182. s;
  183. (s = ua.match(/rv:([\d.]+)\) like gecko/)) ? sys.ie = s[1]:
  184. (s = ua.match(/msie ([\d\.]+)/)) ? sys.ie = s[1] :
  185. (s = ua.match(/edge\/([\d\.]+)/)) ? sys.edge = s[1] :
  186. (s = ua.match(/firefox\/([\d\.]+)/)) ? sys.firefox = s[1] :
  187. (s = ua.match(/(?:opera|opr).([\d\.]+)/)) ? sys.opera = s[1] :
  188. (s = ua.match(/chrome\/([\d\.]+)/)) ? sys.chrome = s[1] :
  189. (s = ua.match(/version\/([\d\.]+).*safari/)) ? sys.safari = s[1] : 0;
  190. // 根据关系进行判断
  191. if (sys.ie) return ('IE: ' + sys.ie)
  192. if (sys.edge) return ('EDGE: ' + sys.edge)
  193. if (sys.firefox) return ('Firefox: ' + sys.firefox)
  194. if (sys.chrome) return ('Chrome: ' + sys.chrome)
  195. if (sys.opera) return ('Opera: ' + sys.opera)
  196. if (sys.safari) return ('Safari: ' + sys.safari)
  197. return 'Unkonwn'
  198. }
  199. /**
  200. * @desc 深拷贝,支持常见类型
  201. * @param {Any} values
  202. */
  203. function deepClone(values) {
  204. var copy;
  205. // Handle the 3 simple types, and null or undefined
  206. if (null == values || "object" != typeof values) return values;
  207. // Handle Date
  208. if (values instanceof Date) {
  209. copy = new Date();
  210. copy.setTime(values.getTime());
  211. return copy;
  212. }
  213. // Handle Array
  214. if (values instanceof Array) {
  215. copy = [];
  216. for (var i = 0, len = values.length; i < len; i++) {
  217. copy[i] = deepClone(values[i]);
  218. }
  219. return copy;
  220. }
  221. // Handle Object
  222. if (values instanceof Object) {
  223. copy = {};
  224. for (var attr in values) {
  225. if (values.hasOwnProperty(attr)) copy[attr] = deepClone(values[attr]);
  226. }
  227. return copy;
  228. }
  229. throw new Error("Unable to copy values! Its type isn't supported.");
  230. }
  231. /**
  232. *
  233. * @desc 判断`obj`是否为空
  234. * @param {Object} obj
  235. * @return {Boolean}
  236. */
  237. function isEmptyObject(obj) {
  238. if (!obj || typeof obj !== 'object' || Array.isArray(obj))
  239. return false
  240. return !Object.keys(obj).length
  241. }
  242. function selectObject(src, arr) {
  243. let newObj = {};
  244. arr.forEach((item) => {
  245. newObj[item] = src[item];
  246. });
  247. return newObj;
  248. }
  249. Date.prototype.Format = function (fmt) {
  250. var o = {
  251. "M+": this.getMonth() + 1, //月份
  252. "d+": this.getDate(), //日
  253. "h+": this.getHours(), //小时
  254. "m+": this.getMinutes(), //分
  255. "s+": this.getSeconds(), //秒
  256. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  257. "S": this.getMilliseconds() //毫秒
  258. };
  259. if (/(y+)/.test(fmt)) {
  260. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
  261. }
  262. for (var k in o) {
  263. console.log(o[k]);
  264. if (new RegExp("(" + k + ")").test(fmt)) {
  265. fmt = fmt.replace(RegExp.$1,
  266. (RegExp.$1.length == 1) ?
  267. (o[k]) :
  268. (("00" + o[k]).substr(("" + o[k]).length)))
  269. }
  270. }
  271. return fmt;
  272. }
  273. function timeFormat(millsecond) {
  274. // 前缀补0: 2018-08-07 08:01:03.345
  275. function paddingNum(num, n) {
  276. var len = num.toString().length
  277. while (len < n) {
  278. num = '0' + num
  279. len++
  280. }
  281. return num
  282. }
  283. var date = new Date(millsecond)
  284. var year = date.getFullYear()
  285. var month = paddingNum(date.getMonth() + 1, 2)
  286. var day = paddingNum(date.getDate(), 2)
  287. var hour = paddingNum(date.getHours(), 2)
  288. var minute = paddingNum(date.getMinutes(), 2)
  289. var second = paddingNum(date.getSeconds(), 2)
  290. var millsecond = paddingNum(date.getMilliseconds(), 3)
  291. return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second + "." + millsecond
  292. }
  293. /* harmony default export */ __webpack_exports__["a"] = ({
  294. getURL,
  295. setCookie,
  296. getCookie,
  297. delCookie,
  298. getStorage,
  299. clearEmpty,
  300. randomColor,
  301. formatPassTime,
  302. formatRemainTime,
  303. isNaN,
  304. arrayEqual,
  305. getExplore,
  306. deepClone,
  307. isEmptyObject,
  308. selectObject,
  309. timeFormat
  310. });
  311. /***/ }),
  312. /* 7 */,
  313. /* 8 */,
  314. /* 9 */
  315. /***/ (function(module, exports) {
  316. // removed by extract-text-webpack-plugin
  317. /***/ }),
  318. /* 10 */,
  319. /* 11 */
  320. /***/ (function(module, exports, __webpack_require__) {
  321. /* styles */
  322. __webpack_require__(19)
  323. __webpack_require__(20)
  324. var Component = __webpack_require__(16)(
  325. /* script */
  326. __webpack_require__(18),
  327. /* template */
  328. __webpack_require__(23),
  329. /* scopeId */
  330. "data-v-866dc8e0",
  331. /* cssModules */
  332. null
  333. )
  334. Component.options.__file = "D:\\workarea\\normal\\crontab\\src\\app.vue"
  335. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  336. if (Component.options.functional) {console.error("[vue-loader] app.vue: functional components are not supported with templates, they should use render functions.")}
  337. /* hot reload */
  338. if (false) {(function () {
  339. var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  340. hotAPI.install(require("vue"), false)
  341. if (!hotAPI.compatible) return
  342. module.hot.accept()
  343. if (!module.hot.data) {
  344. hotAPI.createRecord("data-v-866dc8e0", Component.options)
  345. } else {
  346. hotAPI.reload("data-v-866dc8e0", Component.options)
  347. }
  348. })()}
  349. module.exports = Component.exports
  350. /***/ }),
  351. /* 12 */
  352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  353. "use strict";
  354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(4);
  355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__api__);
  356. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(6);
  357. /* harmony default export */ __webpack_exports__["a"] = ({
  358. install(Vue) {
  359. Vue.mixin({
  360. data() {
  361. return {
  362. tableHeight: 300,
  363. mixinSelectItems: []
  364. }
  365. },
  366. mounted () {
  367. // 设置表格高度
  368. this.$nextTick(() => {
  369. // 加入分页得时候再用,控制 table 得高度
  370. if(this.$refs.table) {
  371. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 100;
  372. }
  373. })
  374. },
  375. methods: {
  376. handleSelectionChange(val) {
  377. this.mixinSelectItems = val;
  378. },
  379. getKeys(key) {
  380. return this.mixinSelectItems.length > 0 ? this.mixinSelectItems.map(function (item) {
  381. return item[key];
  382. }) : [];
  383. }
  384. },
  385. })
  386. Vue.prototype.$api = __WEBPACK_IMPORTED_MODULE_0__api__["default"];
  387. Vue.prototype.$tools = __WEBPACK_IMPORTED_MODULE_1__common__["a" /* default */];
  388. }
  389. });
  390. /***/ }),
  391. /* 13 */
  392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  393. "use strict";
  394. let util = {
  395. };
  396. util.title = function (title) {
  397. title = title ? title + ' - Home' : 'iView project';
  398. window.document.title = title;
  399. };
  400. /* harmony default export */ __webpack_exports__["a"] = (util);
  401. /***/ }),
  402. /* 14 */
  403. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  404. "use strict";
  405. const routers = [
  406. {
  407. path: '/index',
  408. meta: {
  409. title: ''
  410. },
  411. component: (resolve) => __webpack_require__.e/* require */(2).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(27)]; (resolve.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe),
  412. children: [{
  413. path: '/list',
  414. name: '任务列表',
  415. component: (resolve) => __webpack_require__.e/* require */(0).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(28)]; (resolve.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe)
  416. },{
  417. path: '/list2',
  418. name: '列表2',
  419. component: (resolve) => __webpack_require__.e/* require */(3).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(30)]; (resolve.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe),
  420. }],
  421. },
  422. {
  423. path: '/login',
  424. meta: {
  425. title: '登录'
  426. },
  427. component: (resolve) => __webpack_require__.e/* require */(1).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(29)]; (resolve.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe),
  428. },
  429. {
  430. path: '/',
  431. redirect: 'login'
  432. },
  433. ];
  434. /* harmony default export */ __webpack_exports__["a"] = (routers);
  435. /***/ }),
  436. /* 15 */
  437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  438. "use strict";
  439. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
  440. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(17);
  441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__libs_api__ = __webpack_require__(4);
  442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__libs_api___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__libs_api__);
  443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__job__ = __webpack_require__(25);
  444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__libs_common__ = __webpack_require__(6);
  445. __WEBPACK_IMPORTED_MODULE_0_vue__["default"].use(__WEBPACK_IMPORTED_MODULE_1_vuex__["a" /* default */]);
  446. const HANDLE_LOGIN = 'HANDLE_LOGIN';
  447. /* harmony default export */ __webpack_exports__["a"] = (new __WEBPACK_IMPORTED_MODULE_1_vuex__["a" /* default */].Store({
  448. state: {
  449. },
  450. actions: {
  451. async [HANDLE_LOGIN]({
  452. commit
  453. }, params = {}) {
  454. var res = await __WEBPACK_IMPORTED_MODULE_2__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_2__libs_api__["default"].login, params);
  455. commit(HANDLE_LOGIN, res);
  456. return res;
  457. }
  458. },
  459. mutations: {
  460. [HANDLE_LOGIN](state, { data }) {
  461. __WEBPACK_IMPORTED_MODULE_4__libs_common__["a" /* default */].setCookie('token', data.token, 10)
  462. }
  463. },
  464. modules: {
  465. job: __WEBPACK_IMPORTED_MODULE_3__job__["a" /* default */]
  466. }
  467. }));
  468. /***/ }),
  469. /* 16 */
  470. /***/ (function(module, exports) {
  471. // this module is a runtime utility for cleaner component module output and will
  472. // be included in the final webpack user bundle
  473. module.exports = function normalizeComponent (
  474. rawScriptExports,
  475. compiledTemplate,
  476. scopeId,
  477. cssModules
  478. ) {
  479. var esModule
  480. var scriptExports = rawScriptExports = rawScriptExports || {}
  481. // ES6 modules interop
  482. var type = typeof rawScriptExports.default
  483. if (type === 'object' || type === 'function') {
  484. esModule = rawScriptExports
  485. scriptExports = rawScriptExports.default
  486. }
  487. // Vue.extend constructor export interop
  488. var options = typeof scriptExports === 'function'
  489. ? scriptExports.options
  490. : scriptExports
  491. // render functions
  492. if (compiledTemplate) {
  493. options.render = compiledTemplate.render
  494. options.staticRenderFns = compiledTemplate.staticRenderFns
  495. }
  496. // scopedId
  497. if (scopeId) {
  498. options._scopeId = scopeId
  499. }
  500. // inject cssModules
  501. if (cssModules) {
  502. var computed = Object.create(options.computed || null)
  503. Object.keys(cssModules).forEach(function (key) {
  504. var module = cssModules[key]
  505. computed[key] = function () { return module }
  506. })
  507. options.computed = computed
  508. }
  509. return {
  510. esModule: esModule,
  511. exports: scriptExports,
  512. options: options
  513. }
  514. }
  515. /***/ }),
  516. /* 17 */
  517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  518. "use strict";
  519. /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Store */
  520. /* unused harmony export install */
  521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return mapState; });
  522. /* unused harmony export mapMutations */
  523. /* unused harmony export mapGetters */
  524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapActions; });
  525. /* unused harmony export createNamespacedHelpers */
  526. /**
  527. * vuex v3.1.1
  528. * (c) 2019 Evan You
  529. * @license MIT
  530. */
  531. function applyMixin (Vue) {
  532. var version = Number(Vue.version.split('.')[0]);
  533. if (version >= 2) {
  534. Vue.mixin({ beforeCreate: vuexInit });
  535. } else {
  536. // override init and inject vuex init procedure
  537. // for 1.x backwards compatibility.
  538. var _init = Vue.prototype._init;
  539. Vue.prototype._init = function (options) {
  540. if ( options === void 0 ) options = {};
  541. options.init = options.init
  542. ? [vuexInit].concat(options.init)
  543. : vuexInit;
  544. _init.call(this, options);
  545. };
  546. }
  547. /**
  548. * Vuex init hook, injected into each instances init hooks list.
  549. */
  550. function vuexInit () {
  551. var options = this.$options;
  552. // store injection
  553. if (options.store) {
  554. this.$store = typeof options.store === 'function'
  555. ? options.store()
  556. : options.store;
  557. } else if (options.parent && options.parent.$store) {
  558. this.$store = options.parent.$store;
  559. }
  560. }
  561. }
  562. var target = typeof window !== 'undefined'
  563. ? window
  564. : typeof global !== 'undefined'
  565. ? global
  566. : {};
  567. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  568. function devtoolPlugin (store) {
  569. if (!devtoolHook) { return }
  570. store._devtoolHook = devtoolHook;
  571. devtoolHook.emit('vuex:init', store);
  572. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  573. store.replaceState(targetState);
  574. });
  575. store.subscribe(function (mutation, state) {
  576. devtoolHook.emit('vuex:mutation', mutation, state);
  577. });
  578. }
  579. /**
  580. * Get the first item that pass the test
  581. * by second argument function
  582. *
  583. * @param {Array} list
  584. * @param {Function} f
  585. * @return {*}
  586. */
  587. /**
  588. * forEach for object
  589. */
  590. function forEachValue (obj, fn) {
  591. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  592. }
  593. function isObject (obj) {
  594. return obj !== null && typeof obj === 'object'
  595. }
  596. function isPromise (val) {
  597. return val && typeof val.then === 'function'
  598. }
  599. function assert (condition, msg) {
  600. if (!condition) { throw new Error(("[vuex] " + msg)) }
  601. }
  602. function partial (fn, arg) {
  603. return function () {
  604. return fn(arg)
  605. }
  606. }
  607. // Base data struct for store's module, package with some attribute and method
  608. var Module = function Module (rawModule, runtime) {
  609. this.runtime = runtime;
  610. // Store some children item
  611. this._children = Object.create(null);
  612. // Store the origin module object which passed by programmer
  613. this._rawModule = rawModule;
  614. var rawState = rawModule.state;
  615. // Store the origin module's state
  616. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  617. };
  618. var prototypeAccessors = { namespaced: { configurable: true } };
  619. prototypeAccessors.namespaced.get = function () {
  620. return !!this._rawModule.namespaced
  621. };
  622. Module.prototype.addChild = function addChild (key, module) {
  623. this._children[key] = module;
  624. };
  625. Module.prototype.removeChild = function removeChild (key) {
  626. delete this._children[key];
  627. };
  628. Module.prototype.getChild = function getChild (key) {
  629. return this._children[key]
  630. };
  631. Module.prototype.update = function update (rawModule) {
  632. this._rawModule.namespaced = rawModule.namespaced;
  633. if (rawModule.actions) {
  634. this._rawModule.actions = rawModule.actions;
  635. }
  636. if (rawModule.mutations) {
  637. this._rawModule.mutations = rawModule.mutations;
  638. }
  639. if (rawModule.getters) {
  640. this._rawModule.getters = rawModule.getters;
  641. }
  642. };
  643. Module.prototype.forEachChild = function forEachChild (fn) {
  644. forEachValue(this._children, fn);
  645. };
  646. Module.prototype.forEachGetter = function forEachGetter (fn) {
  647. if (this._rawModule.getters) {
  648. forEachValue(this._rawModule.getters, fn);
  649. }
  650. };
  651. Module.prototype.forEachAction = function forEachAction (fn) {
  652. if (this._rawModule.actions) {
  653. forEachValue(this._rawModule.actions, fn);
  654. }
  655. };
  656. Module.prototype.forEachMutation = function forEachMutation (fn) {
  657. if (this._rawModule.mutations) {
  658. forEachValue(this._rawModule.mutations, fn);
  659. }
  660. };
  661. Object.defineProperties( Module.prototype, prototypeAccessors );
  662. var ModuleCollection = function ModuleCollection (rawRootModule) {
  663. // register root module (Vuex.Store options)
  664. this.register([], rawRootModule, false);
  665. };
  666. ModuleCollection.prototype.get = function get (path) {
  667. return path.reduce(function (module, key) {
  668. return module.getChild(key)
  669. }, this.root)
  670. };
  671. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  672. var module = this.root;
  673. return path.reduce(function (namespace, key) {
  674. module = module.getChild(key);
  675. return namespace + (module.namespaced ? key + '/' : '')
  676. }, '')
  677. };
  678. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  679. update([], this.root, rawRootModule);
  680. };
  681. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  682. var this$1 = this;
  683. if ( runtime === void 0 ) runtime = true;
  684. if (false) {
  685. assertRawModule(path, rawModule);
  686. }
  687. var newModule = new Module(rawModule, runtime);
  688. if (path.length === 0) {
  689. this.root = newModule;
  690. } else {
  691. var parent = this.get(path.slice(0, -1));
  692. parent.addChild(path[path.length - 1], newModule);
  693. }
  694. // register nested modules
  695. if (rawModule.modules) {
  696. forEachValue(rawModule.modules, function (rawChildModule, key) {
  697. this$1.register(path.concat(key), rawChildModule, runtime);
  698. });
  699. }
  700. };
  701. ModuleCollection.prototype.unregister = function unregister (path) {
  702. var parent = this.get(path.slice(0, -1));
  703. var key = path[path.length - 1];
  704. if (!parent.getChild(key).runtime) { return }
  705. parent.removeChild(key);
  706. };
  707. function update (path, targetModule, newModule) {
  708. if (false) {
  709. assertRawModule(path, newModule);
  710. }
  711. // update target module
  712. targetModule.update(newModule);
  713. // update nested modules
  714. if (newModule.modules) {
  715. for (var key in newModule.modules) {
  716. if (!targetModule.getChild(key)) {
  717. if (false) {
  718. console.warn(
  719. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  720. 'manual reload is needed'
  721. );
  722. }
  723. return
  724. }
  725. update(
  726. path.concat(key),
  727. targetModule.getChild(key),
  728. newModule.modules[key]
  729. );
  730. }
  731. }
  732. }
  733. var functionAssert = {
  734. assert: function (value) { return typeof value === 'function'; },
  735. expected: 'function'
  736. };
  737. var objectAssert = {
  738. assert: function (value) { return typeof value === 'function' ||
  739. (typeof value === 'object' && typeof value.handler === 'function'); },
  740. expected: 'function or object with "handler" function'
  741. };
  742. var assertTypes = {
  743. getters: functionAssert,
  744. mutations: functionAssert,
  745. actions: objectAssert
  746. };
  747. function assertRawModule (path, rawModule) {
  748. Object.keys(assertTypes).forEach(function (key) {
  749. if (!rawModule[key]) { return }
  750. var assertOptions = assertTypes[key];
  751. forEachValue(rawModule[key], function (value, type) {
  752. assert(
  753. assertOptions.assert(value),
  754. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  755. );
  756. });
  757. });
  758. }
  759. function makeAssertionMessage (path, key, type, value, expected) {
  760. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  761. if (path.length > 0) {
  762. buf += " in module \"" + (path.join('.')) + "\"";
  763. }
  764. buf += " is " + (JSON.stringify(value)) + ".";
  765. return buf
  766. }
  767. var Vue; // bind on install
  768. var Store = function Store (options) {
  769. var this$1 = this;
  770. if ( options === void 0 ) options = {};
  771. // Auto install if it is not done yet and `window` has `Vue`.
  772. // To allow users to avoid auto-installation in some cases,
  773. // this code should be placed here. See #731
  774. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  775. install(window.Vue);
  776. }
  777. if (false) {
  778. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  779. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  780. assert(this instanceof Store, "store must be called with the new operator.");
  781. }
  782. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  783. var strict = options.strict; if ( strict === void 0 ) strict = false;
  784. // store internal state
  785. this._committing = false;
  786. this._actions = Object.create(null);
  787. this._actionSubscribers = [];
  788. this._mutations = Object.create(null);
  789. this._wrappedGetters = Object.create(null);
  790. this._modules = new ModuleCollection(options);
  791. this._modulesNamespaceMap = Object.create(null);
  792. this._subscribers = [];
  793. this._watcherVM = new Vue();
  794. // bind commit and dispatch to self
  795. var store = this;
  796. var ref = this;
  797. var dispatch = ref.dispatch;
  798. var commit = ref.commit;
  799. this.dispatch = function boundDispatch (type, payload) {
  800. return dispatch.call(store, type, payload)
  801. };
  802. this.commit = function boundCommit (type, payload, options) {
  803. return commit.call(store, type, payload, options)
  804. };
  805. // strict mode
  806. this.strict = strict;
  807. var state = this._modules.root.state;
  808. // init root module.
  809. // this also recursively registers all sub-modules
  810. // and collects all module getters inside this._wrappedGetters
  811. installModule(this, state, [], this._modules.root);
  812. // initialize the store vm, which is responsible for the reactivity
  813. // (also registers _wrappedGetters as computed properties)
  814. resetStoreVM(this, state);
  815. // apply plugins
  816. plugins.forEach(function (plugin) { return plugin(this$1); });
  817. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  818. if (useDevtools) {
  819. devtoolPlugin(this);
  820. }
  821. };
  822. var prototypeAccessors$1 = { state: { configurable: true } };
  823. prototypeAccessors$1.state.get = function () {
  824. return this._vm._data.$$state
  825. };
  826. prototypeAccessors$1.state.set = function (v) {
  827. if (false) {
  828. assert(false, "use store.replaceState() to explicit replace store state.");
  829. }
  830. };
  831. Store.prototype.commit = function commit (_type, _payload, _options) {
  832. var this$1 = this;
  833. // check object-style commit
  834. var ref = unifyObjectStyle(_type, _payload, _options);
  835. var type = ref.type;
  836. var payload = ref.payload;
  837. var options = ref.options;
  838. var mutation = { type: type, payload: payload };
  839. var entry = this._mutations[type];
  840. if (!entry) {
  841. if (false) {
  842. console.error(("[vuex] unknown mutation type: " + type));
  843. }
  844. return
  845. }
  846. this._withCommit(function () {
  847. entry.forEach(function commitIterator (handler) {
  848. handler(payload);
  849. });
  850. });
  851. this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
  852. if (
  853. false
  854. ) {
  855. console.warn(
  856. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  857. 'Use the filter functionality in the vue-devtools'
  858. );
  859. }
  860. };
  861. Store.prototype.dispatch = function dispatch (_type, _payload) {
  862. var this$1 = this;
  863. // check object-style dispatch
  864. var ref = unifyObjectStyle(_type, _payload);
  865. var type = ref.type;
  866. var payload = ref.payload;
  867. var action = { type: type, payload: payload };
  868. var entry = this._actions[type];
  869. if (!entry) {
  870. if (false) {
  871. console.error(("[vuex] unknown action type: " + type));
  872. }
  873. return
  874. }
  875. try {
  876. this._actionSubscribers
  877. .filter(function (sub) { return sub.before; })
  878. .forEach(function (sub) { return sub.before(action, this$1.state); });
  879. } catch (e) {
  880. if (false) {
  881. console.warn("[vuex] error in before action subscribers: ");
  882. console.error(e);
  883. }
  884. }
  885. var result = entry.length > 1
  886. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  887. : entry[0](payload);
  888. return result.then(function (res) {
  889. try {
  890. this$1._actionSubscribers
  891. .filter(function (sub) { return sub.after; })
  892. .forEach(function (sub) { return sub.after(action, this$1.state); });
  893. } catch (e) {
  894. if (false) {
  895. console.warn("[vuex] error in after action subscribers: ");
  896. console.error(e);
  897. }
  898. }
  899. return res
  900. })
  901. };
  902. Store.prototype.subscribe = function subscribe (fn) {
  903. return genericSubscribe(fn, this._subscribers)
  904. };
  905. Store.prototype.subscribeAction = function subscribeAction (fn) {
  906. var subs = typeof fn === 'function' ? { before: fn } : fn;
  907. return genericSubscribe(subs, this._actionSubscribers)
  908. };
  909. Store.prototype.watch = function watch (getter, cb, options) {
  910. var this$1 = this;
  911. if (false) {
  912. assert(typeof getter === 'function', "store.watch only accepts a function.");
  913. }
  914. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  915. };
  916. Store.prototype.replaceState = function replaceState (state) {
  917. var this$1 = this;
  918. this._withCommit(function () {
  919. this$1._vm._data.$$state = state;
  920. });
  921. };
  922. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  923. if ( options === void 0 ) options = {};
  924. if (typeof path === 'string') { path = [path]; }
  925. if (false) {
  926. assert(Array.isArray(path), "module path must be a string or an Array.");
  927. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  928. }
  929. this._modules.register(path, rawModule);
  930. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  931. // reset store to update getters...
  932. resetStoreVM(this, this.state);
  933. };
  934. Store.prototype.unregisterModule = function unregisterModule (path) {
  935. var this$1 = this;
  936. if (typeof path === 'string') { path = [path]; }
  937. if (false) {
  938. assert(Array.isArray(path), "module path must be a string or an Array.");
  939. }
  940. this._modules.unregister(path);
  941. this._withCommit(function () {
  942. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  943. Vue.delete(parentState, path[path.length - 1]);
  944. });
  945. resetStore(this);
  946. };
  947. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  948. this._modules.update(newOptions);
  949. resetStore(this, true);
  950. };
  951. Store.prototype._withCommit = function _withCommit (fn) {
  952. var committing = this._committing;
  953. this._committing = true;
  954. fn();
  955. this._committing = committing;
  956. };
  957. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  958. function genericSubscribe (fn, subs) {
  959. if (subs.indexOf(fn) < 0) {
  960. subs.push(fn);
  961. }
  962. return function () {
  963. var i = subs.indexOf(fn);
  964. if (i > -1) {
  965. subs.splice(i, 1);
  966. }
  967. }
  968. }
  969. function resetStore (store, hot) {
  970. store._actions = Object.create(null);
  971. store._mutations = Object.create(null);
  972. store._wrappedGetters = Object.create(null);
  973. store._modulesNamespaceMap = Object.create(null);
  974. var state = store.state;
  975. // init all modules
  976. installModule(store, state, [], store._modules.root, true);
  977. // reset vm
  978. resetStoreVM(store, state, hot);
  979. }
  980. function resetStoreVM (store, state, hot) {
  981. var oldVm = store._vm;
  982. // bind store public getters
  983. store.getters = {};
  984. var wrappedGetters = store._wrappedGetters;
  985. var computed = {};
  986. forEachValue(wrappedGetters, function (fn, key) {
  987. // use computed to leverage its lazy-caching mechanism
  988. // direct inline function use will lead to closure preserving oldVm.
  989. // using partial to return function with only arguments preserved in closure enviroment.
  990. computed[key] = partial(fn, store);
  991. Object.defineProperty(store.getters, key, {
  992. get: function () { return store._vm[key]; },
  993. enumerable: true // for local getters
  994. });
  995. });
  996. // use a Vue instance to store the state tree
  997. // suppress warnings just in case the user has added
  998. // some funky global mixins
  999. var silent = Vue.config.silent;
  1000. Vue.config.silent = true;
  1001. store._vm = new Vue({
  1002. data: {
  1003. $$state: state
  1004. },
  1005. computed: computed
  1006. });
  1007. Vue.config.silent = silent;
  1008. // enable strict mode for new vm
  1009. if (store.strict) {
  1010. enableStrictMode(store);
  1011. }
  1012. if (oldVm) {
  1013. if (hot) {
  1014. // dispatch changes in all subscribed watchers
  1015. // to force getter re-evaluation for hot reloading.
  1016. store._withCommit(function () {
  1017. oldVm._data.$$state = null;
  1018. });
  1019. }
  1020. Vue.nextTick(function () { return oldVm.$destroy(); });
  1021. }
  1022. }
  1023. function installModule (store, rootState, path, module, hot) {
  1024. var isRoot = !path.length;
  1025. var namespace = store._modules.getNamespace(path);
  1026. // register in namespace map
  1027. if (module.namespaced) {
  1028. store._modulesNamespaceMap[namespace] = module;
  1029. }
  1030. // set state
  1031. if (!isRoot && !hot) {
  1032. var parentState = getNestedState(rootState, path.slice(0, -1));
  1033. var moduleName = path[path.length - 1];
  1034. store._withCommit(function () {
  1035. Vue.set(parentState, moduleName, module.state);
  1036. });
  1037. }
  1038. var local = module.context = makeLocalContext(store, namespace, path);
  1039. module.forEachMutation(function (mutation, key) {
  1040. var namespacedType = namespace + key;
  1041. registerMutation(store, namespacedType, mutation, local);
  1042. });
  1043. module.forEachAction(function (action, key) {
  1044. var type = action.root ? key : namespace + key;
  1045. var handler = action.handler || action;
  1046. registerAction(store, type, handler, local);
  1047. });
  1048. module.forEachGetter(function (getter, key) {
  1049. var namespacedType = namespace + key;
  1050. registerGetter(store, namespacedType, getter, local);
  1051. });
  1052. module.forEachChild(function (child, key) {
  1053. installModule(store, rootState, path.concat(key), child, hot);
  1054. });
  1055. }
  1056. /**
  1057. * make localized dispatch, commit, getters and state
  1058. * if there is no namespace, just use root ones
  1059. */
  1060. function makeLocalContext (store, namespace, path) {
  1061. var noNamespace = namespace === '';
  1062. var local = {
  1063. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  1064. var args = unifyObjectStyle(_type, _payload, _options);
  1065. var payload = args.payload;
  1066. var options = args.options;
  1067. var type = args.type;
  1068. if (!options || !options.root) {
  1069. type = namespace + type;
  1070. if (false) {
  1071. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  1072. return
  1073. }
  1074. }
  1075. return store.dispatch(type, payload)
  1076. },
  1077. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  1078. var args = unifyObjectStyle(_type, _payload, _options);
  1079. var payload = args.payload;
  1080. var options = args.options;
  1081. var type = args.type;
  1082. if (!options || !options.root) {
  1083. type = namespace + type;
  1084. if (false) {
  1085. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  1086. return
  1087. }
  1088. }
  1089. store.commit(type, payload, options);
  1090. }
  1091. };
  1092. // getters and state object must be gotten lazily
  1093. // because they will be changed by vm update
  1094. Object.defineProperties(local, {
  1095. getters: {
  1096. get: noNamespace
  1097. ? function () { return store.getters; }
  1098. : function () { return makeLocalGetters(store, namespace); }
  1099. },
  1100. state: {
  1101. get: function () { return getNestedState(store.state, path); }
  1102. }
  1103. });
  1104. return local
  1105. }
  1106. function makeLocalGetters (store, namespace) {
  1107. var gettersProxy = {};
  1108. var splitPos = namespace.length;
  1109. Object.keys(store.getters).forEach(function (type) {
  1110. // skip if the target getter is not match this namespace
  1111. if (type.slice(0, splitPos) !== namespace) { return }
  1112. // extract local getter type
  1113. var localType = type.slice(splitPos);
  1114. // Add a port to the getters proxy.
  1115. // Define as getter property because
  1116. // we do not want to evaluate the getters in this time.
  1117. Object.defineProperty(gettersProxy, localType, {
  1118. get: function () { return store.getters[type]; },
  1119. enumerable: true
  1120. });
  1121. });
  1122. return gettersProxy
  1123. }
  1124. function registerMutation (store, type, handler, local) {
  1125. var entry = store._mutations[type] || (store._mutations[type] = []);
  1126. entry.push(function wrappedMutationHandler (payload) {
  1127. handler.call(store, local.state, payload);
  1128. });
  1129. }
  1130. function registerAction (store, type, handler, local) {
  1131. var entry = store._actions[type] || (store._actions[type] = []);
  1132. entry.push(function wrappedActionHandler (payload, cb) {
  1133. var res = handler.call(store, {
  1134. dispatch: local.dispatch,
  1135. commit: local.commit,
  1136. getters: local.getters,
  1137. state: local.state,
  1138. rootGetters: store.getters,
  1139. rootState: store.state
  1140. }, payload, cb);
  1141. if (!isPromise(res)) {
  1142. res = Promise.resolve(res);
  1143. }
  1144. if (store._devtoolHook) {
  1145. return res.catch(function (err) {
  1146. store._devtoolHook.emit('vuex:error', err);
  1147. throw err
  1148. })
  1149. } else {
  1150. return res
  1151. }
  1152. });
  1153. }
  1154. function registerGetter (store, type, rawGetter, local) {
  1155. if (store._wrappedGetters[type]) {
  1156. if (false) {
  1157. console.error(("[vuex] duplicate getter key: " + type));
  1158. }
  1159. return
  1160. }
  1161. store._wrappedGetters[type] = function wrappedGetter (store) {
  1162. return rawGetter(
  1163. local.state, // local state
  1164. local.getters, // local getters
  1165. store.state, // root state
  1166. store.getters // root getters
  1167. )
  1168. };
  1169. }
  1170. function enableStrictMode (store) {
  1171. store._vm.$watch(function () { return this._data.$$state }, function () {
  1172. if (false) {
  1173. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  1174. }
  1175. }, { deep: true, sync: true });
  1176. }
  1177. function getNestedState (state, path) {
  1178. return path.length
  1179. ? path.reduce(function (state, key) { return state[key]; }, state)
  1180. : state
  1181. }
  1182. function unifyObjectStyle (type, payload, options) {
  1183. if (isObject(type) && type.type) {
  1184. options = payload;
  1185. payload = type;
  1186. type = type.type;
  1187. }
  1188. if (false) {
  1189. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  1190. }
  1191. return { type: type, payload: payload, options: options }
  1192. }
  1193. function install (_Vue) {
  1194. if (Vue && _Vue === Vue) {
  1195. if (false) {
  1196. console.error(
  1197. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  1198. );
  1199. }
  1200. return
  1201. }
  1202. Vue = _Vue;
  1203. applyMixin(Vue);
  1204. }
  1205. /**
  1206. * Reduce the code which written in Vue.js for getting the state.
  1207. * @param {String} [namespace] - Module's namespace
  1208. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  1209. * @param {Object}
  1210. */
  1211. var mapState = normalizeNamespace(function (namespace, states) {
  1212. var res = {};
  1213. normalizeMap(states).forEach(function (ref) {
  1214. var key = ref.key;
  1215. var val = ref.val;
  1216. res[key] = function mappedState () {
  1217. var state = this.$store.state;
  1218. var getters = this.$store.getters;
  1219. if (namespace) {
  1220. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  1221. if (!module) {
  1222. return
  1223. }
  1224. state = module.context.state;
  1225. getters = module.context.getters;
  1226. }
  1227. return typeof val === 'function'
  1228. ? val.call(this, state, getters)
  1229. : state[val]
  1230. };
  1231. // mark vuex getter for devtools
  1232. res[key].vuex = true;
  1233. });
  1234. return res
  1235. });
  1236. /**
  1237. * Reduce the code which written in Vue.js for committing the mutation
  1238. * @param {String} [namespace] - Module's namespace
  1239. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  1240. * @return {Object}
  1241. */
  1242. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  1243. var res = {};
  1244. normalizeMap(mutations).forEach(function (ref) {
  1245. var key = ref.key;
  1246. var val = ref.val;
  1247. res[key] = function mappedMutation () {
  1248. var args = [], len = arguments.length;
  1249. while ( len-- ) args[ len ] = arguments[ len ];
  1250. // Get the commit method from store
  1251. var commit = this.$store.commit;
  1252. if (namespace) {
  1253. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  1254. if (!module) {
  1255. return
  1256. }
  1257. commit = module.context.commit;
  1258. }
  1259. return typeof val === 'function'
  1260. ? val.apply(this, [commit].concat(args))
  1261. : commit.apply(this.$store, [val].concat(args))
  1262. };
  1263. });
  1264. return res
  1265. });
  1266. /**
  1267. * Reduce the code which written in Vue.js for getting the getters
  1268. * @param {String} [namespace] - Module's namespace
  1269. * @param {Object|Array} getters
  1270. * @return {Object}
  1271. */
  1272. var mapGetters = normalizeNamespace(function (namespace, getters) {
  1273. var res = {};
  1274. normalizeMap(getters).forEach(function (ref) {
  1275. var key = ref.key;
  1276. var val = ref.val;
  1277. // The namespace has been mutated by normalizeNamespace
  1278. val = namespace + val;
  1279. res[key] = function mappedGetter () {
  1280. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  1281. return
  1282. }
  1283. if (false) {
  1284. console.error(("[vuex] unknown getter: " + val));
  1285. return
  1286. }
  1287. return this.$store.getters[val]
  1288. };
  1289. // mark vuex getter for devtools
  1290. res[key].vuex = true;
  1291. });
  1292. return res
  1293. });
  1294. /**
  1295. * Reduce the code which written in Vue.js for dispatch the action
  1296. * @param {String} [namespace] - Module's namespace
  1297. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  1298. * @return {Object}
  1299. */
  1300. var mapActions = normalizeNamespace(function (namespace, actions) {
  1301. var res = {};
  1302. normalizeMap(actions).forEach(function (ref) {
  1303. var key = ref.key;
  1304. var val = ref.val;
  1305. res[key] = function mappedAction () {
  1306. var args = [], len = arguments.length;
  1307. while ( len-- ) args[ len ] = arguments[ len ];
  1308. // get dispatch function from store
  1309. var dispatch = this.$store.dispatch;
  1310. if (namespace) {
  1311. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  1312. if (!module) {
  1313. return
  1314. }
  1315. dispatch = module.context.dispatch;
  1316. }
  1317. return typeof val === 'function'
  1318. ? val.apply(this, [dispatch].concat(args))
  1319. : dispatch.apply(this.$store, [val].concat(args))
  1320. };
  1321. });
  1322. return res
  1323. });
  1324. /**
  1325. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  1326. * @param {String} namespace
  1327. * @return {Object}
  1328. */
  1329. var createNamespacedHelpers = function (namespace) { return ({
  1330. mapState: mapState.bind(null, namespace),
  1331. mapGetters: mapGetters.bind(null, namespace),
  1332. mapMutations: mapMutations.bind(null, namespace),
  1333. mapActions: mapActions.bind(null, namespace)
  1334. }); };
  1335. /**
  1336. * Normalize the map
  1337. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  1338. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  1339. * @param {Array|Object} map
  1340. * @return {Object}
  1341. */
  1342. function normalizeMap (map) {
  1343. return Array.isArray(map)
  1344. ? map.map(function (key) { return ({ key: key, val: key }); })
  1345. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  1346. }
  1347. /**
  1348. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  1349. * @param {Function} fn
  1350. * @return {Function}
  1351. */
  1352. function normalizeNamespace (fn) {
  1353. return function (namespace, map) {
  1354. if (typeof namespace !== 'string') {
  1355. map = namespace;
  1356. namespace = '';
  1357. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  1358. namespace += '/';
  1359. }
  1360. return fn(namespace, map)
  1361. }
  1362. }
  1363. /**
  1364. * Search a special module from store by namespace. if module not exist, print error message.
  1365. * @param {Object} store
  1366. * @param {String} helper
  1367. * @param {String} namespace
  1368. * @return {Object}
  1369. */
  1370. function getModuleByNamespace (store, helper, namespace) {
  1371. var module = store._modulesNamespaceMap[namespace];
  1372. if (false) {
  1373. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  1374. }
  1375. return module
  1376. }
  1377. var index_esm = {
  1378. Store: Store,
  1379. install: install,
  1380. version: '3.1.1',
  1381. mapState: mapState,
  1382. mapMutations: mapMutations,
  1383. mapGetters: mapGetters,
  1384. mapActions: mapActions,
  1385. createNamespacedHelpers: createNamespacedHelpers
  1386. };
  1387. /* harmony default export */ __webpack_exports__["a"] = (index_esm);
  1388. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
  1389. /***/ }),
  1390. /* 18 */
  1391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1392. "use strict";
  1393. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1394. //
  1395. //
  1396. //
  1397. //
  1398. //
  1399. //
  1400. //
  1401. //
  1402. //
  1403. //
  1404. //
  1405. //
  1406. //
  1407. //
  1408. //
  1409. //
  1410. //
  1411. //
  1412. //
  1413. //
  1414. //
  1415. //
  1416. //
  1417. /* harmony default export */ __webpack_exports__["default"] = ({
  1418. data: function data() {
  1419. return {};
  1420. },
  1421. mounted: function mounted() {},
  1422. beforeDestroy: function beforeDestroy() {},
  1423. methods: {}
  1424. });
  1425. /***/ }),
  1426. /* 19 */
  1427. /***/ (function(module, exports) {
  1428. // removed by extract-text-webpack-plugin
  1429. /***/ }),
  1430. /* 20 */
  1431. /***/ (function(module, exports) {
  1432. // removed by extract-text-webpack-plugin
  1433. /***/ }),
  1434. /* 21 */,
  1435. /* 22 */,
  1436. /* 23 */
  1437. /***/ (function(module, exports, __webpack_require__) {
  1438. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  1439. return _c('div', {
  1440. attrs: {
  1441. "id": "app"
  1442. }
  1443. }, [_c('router-view')], 1)
  1444. },staticRenderFns: []}
  1445. module.exports.render._withStripped = true
  1446. if (false) {
  1447. module.hot.accept()
  1448. if (module.hot.data) {
  1449. require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-866dc8e0", module.exports)
  1450. }
  1451. }
  1452. /***/ }),
  1453. /* 24 */
  1454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1455. "use strict";
  1456. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
  1458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_iview__ = __webpack_require__(2);
  1459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_iview___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_iview__);
  1460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_router__ = __webpack_require__(3);
  1461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__router__ = __webpack_require__(14);
  1462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__libs_util__ = __webpack_require__(13);
  1463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_vue__ = __webpack_require__(11);
  1464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__app_vue__);
  1465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_iview_dist_styles_iview_css__ = __webpack_require__(9);
  1466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_iview_dist_styles_iview_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_iview_dist_styles_iview_css__);
  1467. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__libs_mixins__ = __webpack_require__(12);
  1468. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__store_store__ = __webpack_require__(15);
  1469. __WEBPACK_IMPORTED_MODULE_0_vue__["default"].use(__WEBPACK_IMPORTED_MODULE_2_vue_router__["a" /* default */]);
  1470. __WEBPACK_IMPORTED_MODULE_0_vue__["default"].use(__WEBPACK_IMPORTED_MODULE_1_iview___default.a);
  1471. __WEBPACK_IMPORTED_MODULE_0_vue__["default"].use(__WEBPACK_IMPORTED_MODULE_7__libs_mixins__["a" /* default */]);
  1472. // 路由配置
  1473. const RouterConfig = {
  1474. mode: 'history',
  1475. routes: __WEBPACK_IMPORTED_MODULE_3__router__["a" /* default */]
  1476. };
  1477. const router = new __WEBPACK_IMPORTED_MODULE_2_vue_router__["a" /* default */](RouterConfig);
  1478. router.beforeEach((to, from, next) => {
  1479. __WEBPACK_IMPORTED_MODULE_1_iview___default.a.LoadingBar.start();
  1480. __WEBPACK_IMPORTED_MODULE_4__libs_util__["a" /* default */].title(to.meta.title);
  1481. next();
  1482. });
  1483. router.afterEach((to, from, next) => {
  1484. __WEBPACK_IMPORTED_MODULE_1_iview___default.a.LoadingBar.finish();
  1485. window.scrollTo(0, 0);
  1486. });
  1487. const app = new __WEBPACK_IMPORTED_MODULE_0_vue__["default"]({
  1488. el: '#app',
  1489. router: router,
  1490. store: __WEBPACK_IMPORTED_MODULE_8__store_store__["a" /* default */],
  1491. render: h => h(__WEBPACK_IMPORTED_MODULE_5__app_vue___default.a)
  1492. });
  1493. window.$Message = app.$Message;
  1494. /***/ }),
  1495. /* 25 */
  1496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1497. "use strict";
  1498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__libs_api__ = __webpack_require__(4);
  1499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__libs_api___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__libs_api__);
  1500. const JOB_LIST = "JOB_LIST";
  1501. const ADD_JOB = "ADD_JOB";
  1502. const DEL_JOB = "DEL_JOB";
  1503. const KILL_JOB = "KILL_JOB";
  1504. const GET_LOG_LIST = "GET_LOG_LIST";
  1505. const GET_WORKER_LIST = "GET_WORKER_LIST";
  1506. /* harmony default export */ __webpack_exports__["a"] = ({
  1507. namespaced: true,
  1508. state: {
  1509. list: [],
  1510. workerList: []
  1511. },
  1512. actions: {
  1513. async [GET_WORKER_LIST]({
  1514. commit
  1515. }, params) {
  1516. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.workerlist, params);
  1517. commit(GET_WORKER_LIST, res);
  1518. },
  1519. async [GET_LOG_LIST]({
  1520. commit
  1521. }, params = {}) {
  1522. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.loglist, params);
  1523. return res;
  1524. },
  1525. async [JOB_LIST]({
  1526. commit
  1527. }, params = {}) {
  1528. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.joblist, params);
  1529. commit(JOB_LIST, res);
  1530. return res;
  1531. },
  1532. async [ADD_JOB]({
  1533. commit
  1534. }, params = {}) {
  1535. var type;
  1536. params.isEditJob ? type = 2 : type = 1;
  1537. delete params.isEditJob;
  1538. var job = JSON.stringify(params);
  1539. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.savejob, {job, type});
  1540. return res;
  1541. },
  1542. async [DEL_JOB]({
  1543. commit
  1544. }, params = {}) {
  1545. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.deljob, params);
  1546. return res;
  1547. },
  1548. async [KILL_JOB]({
  1549. commit
  1550. }, params = {}) {
  1551. var res = await __WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].post(__WEBPACK_IMPORTED_MODULE_0__libs_api__["default"].job.killjob, params);
  1552. return res;
  1553. }
  1554. },
  1555. mutations: {
  1556. [GET_WORKER_LIST](state, { data }) {
  1557. var d = [];
  1558. for(let i=0; i<data.length; i++) {
  1559. d.push({
  1560. ipNode: data[i]
  1561. })
  1562. }
  1563. state.workerList = d || [];
  1564. },
  1565. [JOB_LIST](state, {code, data, msg}) {
  1566. state.list = data || [];
  1567. },
  1568. }
  1569. });
  1570. /***/ })
  1571. ],[24]);