diff --git a/manager/src/api/promotion.js b/manager/src/api/promotion.js index 4fd81dfd..517a9ed8 100644 --- a/manager/src/api/promotion.js +++ b/manager/src/api/promotion.js @@ -1,174 +1,197 @@ // 统一请求路径前缀在libs/axios.js中修改 -import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios'; - - +import { + getRequest, + postRequest, + putRequest, + deleteRequest +} from "@/libs/axios"; // 获取限时抢购申请列表 -export const getPromotionSeckill = (params) => { +export const getPromotionSeckill = params => { + return getRequest(`/promotion/seckill/apply`, params); +}; - return getRequest(`/promotion/seckill/apply`, params) -} +// 是否推荐直播间 +export const whetherStar = params => { + return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`); +}; + +// 获取店铺直播间列表 +export const getLiveList = params => { + return getRequest("/broadcast/studio", params); +}; + +// 获取直播间详情 +export const getLiveInfo = studioId => { + return getRequest(`/broadcast/studio/studioInfo/${studioId}`); +}; // 获取当前进行中的促销活动商品 -export const getPromotionGoods = (promotionId,params) => { - return getRequest(`/promotion/${promotionId}/goods`, params) -} +export const getPromotionGoods = (promotionId, params) => { + return getRequest(`/promotion/${promotionId}/goods`, params); +}; // 获取当前进行中的促销活动 -export const getAllPromotion = (params) => { - return getRequest('/promotion/current', params) -} +export const getAllPromotion = params => { + return getRequest("/promotion/current", params); +}; // 获取拼团数据 -export const getPintuanList = (params) => { - return getRequest('/promotion/pintuan', params) -} +export const getPintuanList = params => { + return getRequest("/promotion/pintuan", params); +}; // 获取拼团详情 -export const getPintuanDetail = (id) => { - return getRequest(`/promotion/pintuan/${id}`) -} +export const getPintuanDetail = id => { + return getRequest(`/promotion/pintuan/${id}`); +}; // 获取拼团商品数据 -export const getPintuanGoodsList = (params) => { - return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params) -} +export const getPintuanGoodsList = params => { + return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`, params); +}; // 关闭拼团活动 -export const closePintuan = (pintuanId) => { - return putRequest(`/promotion/pintuan/close/${pintuanId}`) -} +export const closePintuan = pintuanId => { + return putRequest(`/promotion/pintuan/close/${pintuanId}`); +}; // 保存平台优惠券 -export const savePlatformCoupon = (params) => { - return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) -} +export const savePlatformCoupon = params => { + return postRequest("/promotion/coupon", params, { + "Content-type": "application/json" + }); +}; // 修改平台优惠券 -export const editPlatformCoupon = (params) => { - return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) -} +export const editPlatformCoupon = params => { + return putRequest("/promotion/coupon", params, { + "Content-type": "application/json" + }); +}; // 获取平台优惠券 -export const getPlatformCouponList = (params) => { - return getRequest('/promotion/coupon', params) -} +export const getPlatformCouponList = params => { + return getRequest("/promotion/coupon", params); +}; // 作废优惠券 -export const deletePlatformCoupon = (ids) => { - return deleteRequest(`/promotion/coupon/${ids}`) -} +export const deletePlatformCoupon = ids => { + return deleteRequest(`/promotion/coupon/${ids}`); +}; // 更新优惠券状态 -export const updatePlatformCouponStatus = ( params) => { - return putRequest(`/promotion/coupon/status`, params) -} +export const updatePlatformCouponStatus = params => { + return putRequest(`/promotion/coupon/status`, params); +}; // 获取单个优惠券 -export const getPlatformCoupon = (id) => { - return getRequest(`/promotion/coupon/${id}`) -} - +export const getPlatformCoupon = id => { + return getRequest(`/promotion/coupon/${id}`); +}; // 获取优惠券领取详情 -export const getMemberReceiveCouponList = (id) => { - return getRequest(`/promotion/coupon/member/${id}`) -} +export const getMemberReceiveCouponList = id => { + return getRequest(`/promotion/coupon/member/${id}`); +}; // 作废会员优惠券 -export const deleteMemberReceiveCoupon = (id) => { - return putRequest(`/promotion/coupon/member/cancellation/${id}`) -} +export const deleteMemberReceiveCoupon = id => { + return putRequest(`/promotion/coupon/member/cancellation/${id}`); +}; // 获取限时抢购数据 -export const getSeckillList = (params) => { - return getRequest('/promotion/seckill', params) -} +export const getSeckillList = params => { + return getRequest("/promotion/seckill", params); +}; // 获取限时抢购审核列表 -export const seckillGoodsList = (params) => { - return getRequest('/promotion/seckill/apply', params) -} +export const seckillGoodsList = params => { + return getRequest("/promotion/seckill/apply", params); +}; // 获取限时抢购详情数据 export const seckillDetail = (id, params) => { - return getRequest(`/promotion/seckill/${id}`, params) -} + return getRequest(`/promotion/seckill/${id}`, params); +}; // 删除限时抢购 -export const delSeckill = (id) => { - return deleteRequest(`/promotion/seckill/${id}`) -} +export const delSeckill = id => { + return deleteRequest(`/promotion/seckill/${id}`); +}; // 保存限时抢购 -export const saveSeckill = (params) => { - return postRequest('/promotion/seckill', params) -} +export const saveSeckill = params => { + return postRequest("/promotion/seckill", params); +}; // 修改限时抢购 -export const updateSeckill = (params) => { - return putRequest('/promotion/seckill', params) -} +export const updateSeckill = params => { + return putRequest("/promotion/seckill", params); +}; // 关闭限时抢购 -export const closeSeckill = (id) => { - return putRequest(`/promotion/seckill/close/${id}`) -} +export const closeSeckill = id => { + return putRequest(`/promotion/seckill/close/${id}`); +}; // 审核限时抢购 -export const auditApplySeckill = (params) => { - return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params) -} +export const auditApplySeckill = params => { + return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params); +}; // 满优惠列表 -export const getFullDiscountList = (params) => { - return getRequest(`/promotion/fullDiscount`,params) -} +export const getFullDiscountList = params => { + return getRequest(`/promotion/fullDiscount`, params); +}; // 满优惠列表 -export const getFullDiscountById = (id) => { - return getRequest(`/promotion/fullDiscount/${id}`) -} +export const getFullDiscountById = id => { + return getRequest(`/promotion/fullDiscount/${id}`); +}; // 积分商品列表 -export const getPointsGoodsList = (params) => { - return getRequest(`/promotion/pointsGoods`,params) -} +export const getPointsGoodsList = params => { + return getRequest(`/promotion/pointsGoods`, params); +}; // 积分商品详情 -export const getPointsGoodsById = (id) => { - return getRequest(`/promotion/pointsGoods/${id}`) -} +export const getPointsGoodsById = id => { + return getRequest(`/promotion/pointsGoods/${id}`); +}; // 添加积分商品 -export const addPointsGoods = (params) => { - return postRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) -} +export const addPointsGoods = params => { + return postRequest(`/promotion/pointsGoods`, params, { + "Content-type": "application/json" + }); +}; // 修改积分商品 -export const updatePointsGoods = (params) => { - return putRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) -} +export const updatePointsGoods = params => { + return putRequest(`/promotion/pointsGoods`, params, { + "Content-type": "application/json" + }); +}; // 修改积分商品状态 export const editPointsGoodsStatus = (id, params) => { - return putRequest(`/promotion/pointsGoods/${id}`,params) -} + return putRequest(`/promotion/pointsGoods/${id}`, params); +}; // 删除积分商品 -export const deletePointsGoodsStatus = (id) => { - return deleteRequest(`/promotion/pointsGoods/${id}`) -} - +export const deletePointsGoodsStatus = id => { + return deleteRequest(`/promotion/pointsGoods/${id}`); +}; // 积分商品分类列表 -export const getPointsGoodsCategoryList = (params) => { - return getRequest(`/promotion/pointsGoodsCategory`,params) -} +export const getPointsGoodsCategoryList = params => { + return getRequest(`/promotion/pointsGoodsCategory`, params); +}; // 积分商品分类详情 -export const getPointsGoodsCategoryById = (id) => { - return getRequest(`/promotion/pointsGoodsCategory/${id}`) -} +export const getPointsGoodsCategoryById = id => { + return getRequest(`/promotion/pointsGoodsCategory/${id}`); +}; // 添加积分商品分类 -export const addPointsGoodsCategory = (params) => { - return postRequest(`/promotion/pointsGoodsCategory`, params) -} +export const addPointsGoodsCategory = params => { + return postRequest(`/promotion/pointsGoodsCategory`, params); +}; // 更新积分商品分类 -export const updatePointsGoodsCategory = (params) => { - return putRequest(`/promotion/pointsGoodsCategory`, params) -} +export const updatePointsGoodsCategory = params => { + return putRequest(`/promotion/pointsGoodsCategory`, params); +}; // 删除积分商品分类 -export const deletePointsGoodsCategoryById = (id) => { - return deleteRequest(`/promotion/pointsGoodsCategory/${id}`) -} +export const deletePointsGoodsCategoryById = id => { + return deleteRequest(`/promotion/pointsGoodsCategory/${id}`); +}; diff --git a/manager/src/router/router.js b/manager/src/router/router.js index d62f3de8..e9e84d06 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -296,6 +296,12 @@ export const otherRouter = { title: "短信签名", name: "add-sms-sign", component: () => import("@/views/sys/message/smsSign.vue") + }, + { + path: "liveDetail", + title: "查看直播", + name: "liveDetail", + component: () => import("@/views/live/liveDetail.vue") } ] }; diff --git a/manager/src/utils/filters.js b/manager/src/utils/filters.js index d581cc7d..71c092db 100644 --- a/manager/src/utils/filters.js +++ b/manager/src/utils/filters.js @@ -18,6 +18,72 @@ export function unitPrice(val, unit, location) { + +let timer, flag; +/** + * 节流原理:在一定时间内,只能触发一次 + * + * @param {Function} func 要执行的回调函数 + * @param {Number} wait 延时的时间 + * @param {Boolean} immediate 是否立即执行 + * @return null + */ + export function throttle(func, wait = 500, immediate = true) { + if (immediate) { + if (!flag) { + flag = true; + // 如果是立即执行,则在wait毫秒内开始时执行 + typeof func === 'function' && func(); + timer = setTimeout(() => { + flag = false; + }, wait); + } + } else { + if (!flag) { + flag = true + // 如果是非立即执行,则在wait毫秒内的结束处执行 + timer = setTimeout(() => { + flag = false + typeof func === 'function' && func(); + }, wait); + } + + } +}; + + + + + +let timeout = null; + +/** + * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数 + * + * @param {Function} func 要执行的回调函数 + * @param {Number} wait 延时的时间 + * @param {Boolean} immediate 是否立即执行 + * @return null + */ + export function debounce(func, wait = 500, immediate = false) { + // 清除定时器 + if (timeout !== null) clearTimeout(timeout); + // 立即执行,此类情况一般用不到 + if (immediate) { + var callNow = !timeout; + timeout = setTimeout(function() { + timeout = null; + }, wait); + if (callNow) typeof func === 'function' && func(); + } else { + // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法 + timeout = setTimeout(function() { + typeof func === 'function' && func(); + }, wait); + } +} + + /** * 货币格式化 * @param price @@ -172,4 +238,4 @@ export function formatLinkType (item) { break; } return url; -} \ No newline at end of file +} diff --git a/manager/src/views/distribution/distributionSetting.vue b/manager/src/views/distribution/distributionSetting.vue index 096c33ac..8a6e48cb 100644 --- a/manager/src/views/distribution/distributionSetting.vue +++ b/manager/src/views/distribution/distributionSetting.vue @@ -10,67 +10,77 @@ 关闭 + + + + + + diff --git a/manager/src/views/live/live.vue b/manager/src/views/live/live.vue new file mode 100644 index 00000000..25614680 --- /dev/null +++ b/manager/src/views/live/live.vue @@ -0,0 +1,249 @@ + + + + + diff --git a/manager/src/views/live/liveDetail.vue b/manager/src/views/live/liveDetail.vue new file mode 100644 index 00000000..e7880dfc --- /dev/null +++ b/manager/src/views/live/liveDetail.vue @@ -0,0 +1,300 @@ + + + + + diff --git a/manager/src/views/order/order/orderList.vue b/manager/src/views/order/order/orderList.vue index a64378e9..144cbb69 100644 --- a/manager/src/views/order/order/orderList.vue +++ b/manager/src/views/order/order/orderList.vue @@ -1,48 +1,109 @@ diff --git a/manager/src/views/statistics/traffic.vue b/manager/src/views/statistics/traffic.vue index 6f571a97..f5fbe08d 100644 --- a/manager/src/views/statistics/traffic.vue +++ b/manager/src/views/statistics/traffic.vue @@ -66,7 +66,8 @@ export default { uvs: 0, // 访客数 pvs: 0, // 浏览量 - dateList: [ // 选择项 + dateList: [ + // 选择项 { title: "今天", selected: false, @@ -90,7 +91,8 @@ export default { ], orderChart: "", // 初始化图表 - params: { // 请求参数 + params: { + // 请求参数 searchType: "LAST_SEVEN", year: "", month: "", @@ -117,6 +119,8 @@ export default { watch: { params: { handler(val) { + this.uvs = 0; + this.pvs = 0; this.init(); }, deep: true, diff --git a/node_modules/_downloadjs@1.4.7@downloadjs/LICENSE.md b/node_modules/_downloadjs@1.4.7@downloadjs/LICENSE.md new file mode 100644 index 00000000..19b80ba4 --- /dev/null +++ b/node_modules/_downloadjs@1.4.7@downloadjs/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 dandavis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/_downloadjs@1.4.7@downloadjs/README.md b/node_modules/_downloadjs@1.4.7@downloadjs/README.md new file mode 100644 index 00000000..67eb6c6a --- /dev/null +++ b/node_modules/_downloadjs@1.4.7@downloadjs/README.md @@ -0,0 +1,123 @@ +# download +======== + +## Summary +--------- +The download() function is used to trigger a file download from JavaScript. + +It specifies the contents and name of a new file placed in the browser's download directory. The input can be a URL, String, Blob, or Typed Array of data, or via a dataURL representing the file's data as base64 or url-encoded string. No matter the input format, download() saves a file using the specified file name and mime information in the same manner as a server using a Content-Disposition HTTP header. + +## Getting and Using +--------- + +### Via NPM/Bower +`npm install downloadjs`
+`bower install downloadjs` + +`require("downloadjs")(data, strFileName, strMimeType);` + +### Simple global `download` function via ` diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/LICENSE b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/LICENSE new file mode 100755 index 00000000..25f291d4 --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Pooya Parsa + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/README.md b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/README.md new file mode 100755 index 00000000..78c8350f --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/README.md @@ -0,0 +1,321 @@ +# JSON to Excel for VUE 2 + +Download your JSON data as an Excel file directly from the browser. This component is based on the solution proposed on [this thread](https://stackoverflow.com/questions/17142427/javascript-to-export-html-table-to-excel) + +### Important! Extra prompt in Microsoft Excel + +**The method implemented in this component uses HTML tables to draw the .xls files, Microsoft Excel no longer recognize HTML as native content so a warning message will be displayed before opening the file. The content will be rendered perfectly but the message can't be avoided.** + +## Getting started + +Get the package: + +```bash +npm install vue-json-excel +``` + +Register JsonExcel in your vue app entry point: + +```js +import Vue from "vue"; +import JsonExcel from "vue-json-excel"; + +Vue.component("downloadExcel", JsonExcel); +``` + +In your template + +```html + + Download Data + + +``` + +## Props List + +| Name | Type | Description | Default | +| :--------------------------- | :----------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | +| data | Array | Data to be exported. | +| fields | Object | Fields inside the JSON Object that you want to export. If none provided, all properties in the JSON will be exported. | +| export-fields (exportFields) | Object | Used to fix the problem with other components that use the variable fields, like vee-validate. exportFields works exactly like fields | +| type | string | Mime type [xls, csv] | xls | +| name | string | File name to export. | data.xls | +| header | string/Array | Title(s) for the data. Can be a string (one title) or an array of strings (multiple titles). | +| title(deprecated) | string/Array | same as header, title is maintained for retro-compatibility purposes but its use is not recommended due to the conflict with the HTML5 title attribute. | +| footer | string/Array | Footer(s) for the data. Can be a string (one footer) or an array of strings (multiple footers). | +| default-value (defaultValue) | string | Use as fallback when the row has no field values. | '' | +| worksheet | string | Name of the worksheet tab. | 'Sheet1' | +| fetch | Function | Callback to fetch data before download, if it's set it runs immediately after mouse pressed and before download process.
IMPORTANT: only works if no data prop is defined. | +| before-generate | Function | Callback to call a method right before the generate / fetch data, eg:show loading progress | +| before-finish | Function | Callback to call a method right before the download box pops out, eg:hide loading progress | +| stringifyLongNum | Boolean | stringify long number and decimal(solve the problem of loss of digital accuracy), default: false | +| escapeCsv | Boolean | This escapes CSV values in order to fix some excel problems with number fields. But this will wrap every csv data with **="** and **"**, to avoid that you have to set this prop to false. default: True | + +## Example + +```js +import Vue from "vue"; +import JsonExcel from "vue-json-excel"; + +Vue.component("downloadExcel", JsonExcel); + +const app = new Vue({ + el: "#app", + data: { + json_fields: { + "Complete name": "name", + City: "city", + Telephone: "phone.mobile", + "Telephone 2": { + field: "phone.landline", + callback: (value) => { + return `Landline Phone - ${value}`; + }, + }, + }, + json_data: [ + { + name: "Tony Peña", + city: "New York", + country: "United States", + birthdate: "1978-03-15", + phone: { + mobile: "1-541-754-3010", + landline: "(541) 754-3010", + }, + }, + { + name: "Thessaloniki", + city: "Athens", + country: "Greece", + birthdate: "1987-11-23", + phone: { + mobile: "+1 855 275 5071", + landline: "(2741) 2621-244", + }, + }, + ], + json_meta: [ + [ + { + key: "charset", + value: "utf-8", + }, + ], + ], + }, +}); +``` + +In your HTML call it like + +```html + + Download Excel (you can customize this with html code!) + +``` + +REQUIRED + +- json_data: Contains the data you want to export. +- json_fields: You can select what fields to export. Specify nested data and assign labels to the fields. The key is the label, the value is the JSON field. This will export the field data 'as is'. If you need to customize the the exported data you can define a callback function. Thanks to @gucastiliao. + +```js +let json_fields = { + // regular field (exported data 'as is') + fieldLabel: attributeName, // nested attribute supported + // callback function for data formatting + anotherFieldLabel: { + field: anotherAttributeName, // nested attribute supported + callback: (value) => { + return `formatted value ${value}`; + }, + }, +}; +``` + +json_fields is a object that represents which columns will be exported. If no object is provided, the component will be use the first object in your data array to extract the keys as columns names. Json field example: + +``` +:export-fields="{ + 'Human friendly name': '_name_field_from_json', + 'user's last name': '_last_name_text' +}" +``` + +## Export CSV + +To export JSON as a CSV file, just add the prop `type` with a value of "csv": + +```html + + Download CSV (you can customize this with html code!) + +``` + +## Multi-line values will appear in a single cell + +A single text value in the data that contains newline characters will appear as a single cell in Excel. This avoids the undesired behavior of multi-line values getting split into multiple cells that must be merged before using data filters and pivot tables. + +For example: + +```html + + +``` + +![Example of Excel showing multi-line cell](example-multi-line.png) + +## Fetch Data on Demand + +In case you need to fetch data from the server, you could use the fetch prop that allows you to define a callback function that is executed when your user click the download button. This function has to return a JSON value containing the data to export. A basic use case is: + +```js + + + + +``` + +## Using callbacks + +when using callback functions in the fields description, you have three option to retrieve data: + +- **field: 'path.to.nested.property'** you can retrieve a specific value using the nested property notation. + +```js + json_fields: { + 'Complete name': 'name', + 'City': 'city', + 'Telephone': 'phone.mobile', + 'Telephone 2' : { + field: 'phone.landline', + callback: (value) => { + return `Landline Phone - ${value}`; + } + }, + }, +``` + +- **field: 'define.nested.object'** you can retrieve a nested object too. + +```js + json_fields: {s + 'Complete name': 'name', + 'City': 'city', + 'Telephone': 'phone.mobile', + 'Telephone 2' : { + field: 'phone', + callback: (value) => { + return `Landline Phone - ${value.landline}`; + } + }, + }, +``` + +- Or **get the whole row** if field is undefined. + +```js + json_fields: { + 'Complete name': 'name', + 'City': 'city', + 'Telephone': 'phone.mobile', + 'Telephone 2' : { + callback: (value) => { + return `Landline Phone - ${value.phone.landline}`; + } + }, + }, +``` + +## License + +MIT + +#### Status + +This project is in an early stage of development. Any contribution is welcome :D diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.cjs.js b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.cjs.js new file mode 100755 index 00000000..48b0d55c --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.cjs.js @@ -0,0 +1,654 @@ +'use strict'; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var download = createCommonjsModule(function (module, exports) { +//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage +// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime +// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs +// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. +// v4 adds AMD/UMD, commonJS, and plain browser support +// v4.1 adds url download capability via solo URL argument (same domain/CORS only) +// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors +// https://github.com/rndme/download + +(function (root, factory) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } +}(commonjsGlobal, function () { + + return function download(data, strFileName, strMimeType) { + + var self = window, // this script is only for browsers anyway... + defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads + mimeType = strMimeType || defaultMime, + payload = data, + url = !strFileName && !strMimeType && payload, + anchor = document.createElement("a"), + toString = function(a){return String(a);}, + myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), + fileName = strFileName || "download", + blob, + reader; + myBlob= myBlob.call ? myBlob.bind(self) : Blob ; + + if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback + payload=[payload, mimeType]; + mimeType=payload[0]; + payload=payload[1]; + } + + + if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument + fileName = url.split("/").pop().split("?")[0]; + anchor.href = url; // assign href prop to temp anchor + if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path: + var ajax=new XMLHttpRequest(); + ajax.open( "GET", url, true); + ajax.responseType = 'blob'; + ajax.onload= function(e){ + download(e.target.response, fileName, defaultMime); + }; + setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return: + return ajax; + } // end if valid url? + } // end if url? + + + //go ahead and download dataURLs right away + if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){ + + if(payload.length > (1024*1024*1.999) && myBlob !== toString ){ + payload=dataUrlToBlob(payload); + mimeType=payload.type || defaultMime; + }else { + return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: + navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : + saver(payload) ; // everyone else can save dataURLs un-processed + } + + }else {//not data url, is it a string with special needs? + if(/([\x80-\xff])/.test(payload)){ + var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length; + for(i;i null, + }, + // this prop is used to fix the problem with other components that use the + // variable fields, like vee-validate. exportFields works exactly like fields + exportFields: { + type: Object, + default: () => null, + }, + // Use as fallback when the row has no field values + defaultValue: { + type: String, + required: false, + default: "", + }, + // Title(s) for the data, could be a string or an array of strings (multiple titles) + header: { + default: null, + }, + // Footer(s) for the data, could be a string or an array of strings (multiple footers) + footer: { + default: null, + }, + // filename to export + name: { + type: String, + default: "data.xls", + }, + fetch: { + type: Function, + }, + meta: { + type: Array, + default: () => [], + }, + worksheet: { + type: String, + default: "Sheet1", + }, + //event before generate was called + beforeGenerate: { + type: Function, + }, + //event before download pops up + beforeFinish: { + type: Function, + }, + // Determine if CSV Data should be escaped + escapeCsv: { + type: Boolean, + default: true, + }, + // long number stringify + stringifyLongNum: { + type: Boolean, + default: false, + }, + }, + computed: { + // unique identifier + idName() { + var now = new Date().getTime(); + return "export_" + now; + }, + + downloadFields() { + if (this.fields) return this.fields; + + if (this.exportFields) return this.exportFields; + }, + }, + methods: { + async generate() { + if (typeof this.beforeGenerate === "function") { + await this.beforeGenerate(); + } + let data = this.data; + if (typeof this.fetch === "function" || !data) data = await this.fetch(); + + if (!data || !data.length) { + return; + } + + let json = this.getProcessedJson(data, this.downloadFields); + if (this.type === "html") { + // this is mainly for testing + return this.export( + this.jsonToXLS(json), + this.name.replace(".xls", ".html"), + "text/html" + ); + } else if (this.type === "csv") { + return this.export( + this.jsonToCSV(json), + this.name.replace(".xls", ".csv"), + "application/csv" + ); + } + return this.export( + this.jsonToXLS(json), + this.name, + "application/vnd.ms-excel" + ); + }, + /* + Use downloadjs to generate the download link + */ + export: async function (data, filename, mime) { + let blob = this.base64ToBlob(data, mime); + if (typeof this.beforeFinish === "function") await this.beforeFinish(); + download(blob, filename, mime); + }, + /* + jsonToXLS + --------------- + Transform json data into an xml document with MS Excel format, sadly + it shows a prompt when it opens, that is a default behavior for + Microsoft office and cannot be avoided. It's recommended to use CSV format instead. + */ + jsonToXLS(data) { + let xlsTemp = + ' ${table}
'; + let xlsData = ""; + const colspan = Object.keys(data[0]).length; + let _self = this; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + xlsData += this.parseExtraData( + header, + '${data}' + ); + } + + //Fields + xlsData += ""; + for (let key in data[0]) { + xlsData += "" + key + ""; + } + xlsData += ""; + xlsData += ""; + + //Data + xlsData += ""; + data.map(function (item, index) { + xlsData += ""; + for (let key in item) { + xlsData += + "" + + _self.preprocessLongNum( + _self.valueReformattedForMultilines(item[key]) + ) + + ""; + } + xlsData += ""; + }); + xlsData += ""; + + //Footer + if (this.footer != null) { + xlsData += ""; + xlsData += this.parseExtraData( + this.footer, + '${data}' + ); + xlsData += ""; + } + + return xlsTemp + .replace("${table}", xlsData) + .replace("${worksheet}", this.worksheet); + }, + /* + jsonToCSV + --------------- + Transform json data into an CSV file. + */ + jsonToCSV(data) { + let _self = this; + var csvData = []; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + csvData.push(this.parseExtraData(header, "${data}\r\n")); + } + + //Fields + for (let key in data[0]) { + csvData.push(key); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + //Data + data.map(function (item) { + for (let key in item) { + let escapedCSV = item[key] + ""; + // Escaped CSV data to string to avoid problems with numbers or other types of values + // this is controlled by the prop escapeCsv + if (_self.escapeCsv) { + escapedCSV = '="' + escapedCSV + '"'; // cast Numbers to string + if (escapedCSV.match(/[,"\n]/)) { + escapedCSV = '"' + escapedCSV.replace(/\"/g, '""') + '"'; + } + } + csvData.push(escapedCSV); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + }); + //Footer + if (this.footer != null) { + csvData.push(this.parseExtraData(this.footer, "${data}\r\n")); + } + return csvData.join(""); + }, + /* + getProcessedJson + --------------- + Get only the data to export, if no fields are set return all the data + */ + getProcessedJson(data, header) { + let keys = this.getKeys(data, header); + let newData = []; + let _self = this; + data.map(function (item, index) { + let newItem = {}; + for (let label in keys) { + let property = keys[label]; + newItem[label] = _self.getValue(property, item); + } + newData.push(newItem); + }); + + return newData; + }, + getKeys(data, header) { + if (header) { + return header; + } + + let keys = {}; + for (let key in data[0]) { + keys[key] = key; + } + return keys; + }, + /* + parseExtraData + --------------- + Parse title and footer attribute to the csv format + */ + parseExtraData(extraData, format) { + let parseData = ""; + if (Array.isArray(extraData)) { + for (var i = 0; i < extraData.length; i++) { + if (extraData[i]) + parseData += format.replace("${data}", extraData[i]); + } + } else { + parseData += format.replace("${data}", extraData); + } + return parseData; + }, + + getValue(key, item) { + const field = typeof key !== "object" ? key : key.field; + let indexes = typeof field !== "string" ? [] : field.split("."); + let value = this.defaultValue; + + if (!field) value = item; + else if (indexes.length > 1) + value = this.getValueFromNestedItem(item, indexes); + else value = this.parseValue(item[field]); + + if (key.hasOwnProperty("callback")) + value = this.getValueFromCallback(value, key.callback); + + return value; + }, + + /* + convert values with newline \n characters into
+ */ + valueReformattedForMultilines(value) { + if (typeof value == "string") return value.replace(/\n/gi, "
"); + else return value; + }, + preprocessLongNum(value) { + if (this.stringifyLongNum) { + if (String(value).startsWith("0x")) { + return value; + } + if (!isNaN(value) && value != "") { + if (value > 99999999999 || value < 0.0000000000001) { + return '="' + value + '"'; + } + } + } + return value; + }, + getValueFromNestedItem(item, indexes) { + let nestedItem = item; + for (let index of indexes) { + if (nestedItem) nestedItem = nestedItem[index]; + } + return this.parseValue(nestedItem); + }, + + getValueFromCallback(item, callback) { + if (typeof callback !== "function") return this.defaultValue; + const value = callback(item); + return this.parseValue(value); + }, + parseValue(value) { + return value || value === 0 || typeof value === "boolean" + ? value + : this.defaultValue; + }, + base64ToBlob(data, mime) { + let base64 = window.btoa(window.unescape(encodeURIComponent(data))); + let bstr = atob(base64); + let n = bstr.length; + let u8arr = new Uint8ClampedArray(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); + }, + }, // end methods +}; + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier +/* server only */ +, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; +} + +var normalizeComponent_1 = normalizeComponent; + +/* script */ +const __vue_script__ = script; + +/* template */ +var __vue_render__ = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { attrs: { id: _vm.idName }, on: { click: _vm.generate } }, + [_vm._t("default", [_vm._v(" Download " + _vm._s(_vm.name) + " ")])], + 2 + ) +}; +var __vue_staticRenderFns__ = []; +__vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = undefined; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject */ + + /* style inject SSR */ + + + + var JsonExcel = normalizeComponent_1( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + undefined, + undefined + ); + +module.exports = JsonExcel; diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.esm.js b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.esm.js new file mode 100755 index 00000000..2d9535d4 --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.esm.js @@ -0,0 +1,652 @@ +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var download = createCommonjsModule(function (module, exports) { +//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage +// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime +// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs +// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. +// v4 adds AMD/UMD, commonJS, and plain browser support +// v4.1 adds url download capability via solo URL argument (same domain/CORS only) +// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors +// https://github.com/rndme/download + +(function (root, factory) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } +}(commonjsGlobal, function () { + + return function download(data, strFileName, strMimeType) { + + var self = window, // this script is only for browsers anyway... + defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads + mimeType = strMimeType || defaultMime, + payload = data, + url = !strFileName && !strMimeType && payload, + anchor = document.createElement("a"), + toString = function(a){return String(a);}, + myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), + fileName = strFileName || "download", + blob, + reader; + myBlob= myBlob.call ? myBlob.bind(self) : Blob ; + + if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback + payload=[payload, mimeType]; + mimeType=payload[0]; + payload=payload[1]; + } + + + if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument + fileName = url.split("/").pop().split("?")[0]; + anchor.href = url; // assign href prop to temp anchor + if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path: + var ajax=new XMLHttpRequest(); + ajax.open( "GET", url, true); + ajax.responseType = 'blob'; + ajax.onload= function(e){ + download(e.target.response, fileName, defaultMime); + }; + setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return: + return ajax; + } // end if valid url? + } // end if url? + + + //go ahead and download dataURLs right away + if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){ + + if(payload.length > (1024*1024*1.999) && myBlob !== toString ){ + payload=dataUrlToBlob(payload); + mimeType=payload.type || defaultMime; + }else { + return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: + navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : + saver(payload) ; // everyone else can save dataURLs un-processed + } + + }else {//not data url, is it a string with special needs? + if(/([\x80-\xff])/.test(payload)){ + var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length; + for(i;i null, + }, + // this prop is used to fix the problem with other components that use the + // variable fields, like vee-validate. exportFields works exactly like fields + exportFields: { + type: Object, + default: () => null, + }, + // Use as fallback when the row has no field values + defaultValue: { + type: String, + required: false, + default: "", + }, + // Title(s) for the data, could be a string or an array of strings (multiple titles) + header: { + default: null, + }, + // Footer(s) for the data, could be a string or an array of strings (multiple footers) + footer: { + default: null, + }, + // filename to export + name: { + type: String, + default: "data.xls", + }, + fetch: { + type: Function, + }, + meta: { + type: Array, + default: () => [], + }, + worksheet: { + type: String, + default: "Sheet1", + }, + //event before generate was called + beforeGenerate: { + type: Function, + }, + //event before download pops up + beforeFinish: { + type: Function, + }, + // Determine if CSV Data should be escaped + escapeCsv: { + type: Boolean, + default: true, + }, + // long number stringify + stringifyLongNum: { + type: Boolean, + default: false, + }, + }, + computed: { + // unique identifier + idName() { + var now = new Date().getTime(); + return "export_" + now; + }, + + downloadFields() { + if (this.fields) return this.fields; + + if (this.exportFields) return this.exportFields; + }, + }, + methods: { + async generate() { + if (typeof this.beforeGenerate === "function") { + await this.beforeGenerate(); + } + let data = this.data; + if (typeof this.fetch === "function" || !data) data = await this.fetch(); + + if (!data || !data.length) { + return; + } + + let json = this.getProcessedJson(data, this.downloadFields); + if (this.type === "html") { + // this is mainly for testing + return this.export( + this.jsonToXLS(json), + this.name.replace(".xls", ".html"), + "text/html" + ); + } else if (this.type === "csv") { + return this.export( + this.jsonToCSV(json), + this.name.replace(".xls", ".csv"), + "application/csv" + ); + } + return this.export( + this.jsonToXLS(json), + this.name, + "application/vnd.ms-excel" + ); + }, + /* + Use downloadjs to generate the download link + */ + export: async function (data, filename, mime) { + let blob = this.base64ToBlob(data, mime); + if (typeof this.beforeFinish === "function") await this.beforeFinish(); + download(blob, filename, mime); + }, + /* + jsonToXLS + --------------- + Transform json data into an xml document with MS Excel format, sadly + it shows a prompt when it opens, that is a default behavior for + Microsoft office and cannot be avoided. It's recommended to use CSV format instead. + */ + jsonToXLS(data) { + let xlsTemp = + ' ${table}
'; + let xlsData = ""; + const colspan = Object.keys(data[0]).length; + let _self = this; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + xlsData += this.parseExtraData( + header, + '${data}' + ); + } + + //Fields + xlsData += ""; + for (let key in data[0]) { + xlsData += "" + key + ""; + } + xlsData += ""; + xlsData += ""; + + //Data + xlsData += ""; + data.map(function (item, index) { + xlsData += ""; + for (let key in item) { + xlsData += + "" + + _self.preprocessLongNum( + _self.valueReformattedForMultilines(item[key]) + ) + + ""; + } + xlsData += ""; + }); + xlsData += ""; + + //Footer + if (this.footer != null) { + xlsData += ""; + xlsData += this.parseExtraData( + this.footer, + '${data}' + ); + xlsData += ""; + } + + return xlsTemp + .replace("${table}", xlsData) + .replace("${worksheet}", this.worksheet); + }, + /* + jsonToCSV + --------------- + Transform json data into an CSV file. + */ + jsonToCSV(data) { + let _self = this; + var csvData = []; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + csvData.push(this.parseExtraData(header, "${data}\r\n")); + } + + //Fields + for (let key in data[0]) { + csvData.push(key); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + //Data + data.map(function (item) { + for (let key in item) { + let escapedCSV = item[key] + ""; + // Escaped CSV data to string to avoid problems with numbers or other types of values + // this is controlled by the prop escapeCsv + if (_self.escapeCsv) { + escapedCSV = '="' + escapedCSV + '"'; // cast Numbers to string + if (escapedCSV.match(/[,"\n]/)) { + escapedCSV = '"' + escapedCSV.replace(/\"/g, '""') + '"'; + } + } + csvData.push(escapedCSV); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + }); + //Footer + if (this.footer != null) { + csvData.push(this.parseExtraData(this.footer, "${data}\r\n")); + } + return csvData.join(""); + }, + /* + getProcessedJson + --------------- + Get only the data to export, if no fields are set return all the data + */ + getProcessedJson(data, header) { + let keys = this.getKeys(data, header); + let newData = []; + let _self = this; + data.map(function (item, index) { + let newItem = {}; + for (let label in keys) { + let property = keys[label]; + newItem[label] = _self.getValue(property, item); + } + newData.push(newItem); + }); + + return newData; + }, + getKeys(data, header) { + if (header) { + return header; + } + + let keys = {}; + for (let key in data[0]) { + keys[key] = key; + } + return keys; + }, + /* + parseExtraData + --------------- + Parse title and footer attribute to the csv format + */ + parseExtraData(extraData, format) { + let parseData = ""; + if (Array.isArray(extraData)) { + for (var i = 0; i < extraData.length; i++) { + if (extraData[i]) + parseData += format.replace("${data}", extraData[i]); + } + } else { + parseData += format.replace("${data}", extraData); + } + return parseData; + }, + + getValue(key, item) { + const field = typeof key !== "object" ? key : key.field; + let indexes = typeof field !== "string" ? [] : field.split("."); + let value = this.defaultValue; + + if (!field) value = item; + else if (indexes.length > 1) + value = this.getValueFromNestedItem(item, indexes); + else value = this.parseValue(item[field]); + + if (key.hasOwnProperty("callback")) + value = this.getValueFromCallback(value, key.callback); + + return value; + }, + + /* + convert values with newline \n characters into
+ */ + valueReformattedForMultilines(value) { + if (typeof value == "string") return value.replace(/\n/gi, "
"); + else return value; + }, + preprocessLongNum(value) { + if (this.stringifyLongNum) { + if (String(value).startsWith("0x")) { + return value; + } + if (!isNaN(value) && value != "") { + if (value > 99999999999 || value < 0.0000000000001) { + return '="' + value + '"'; + } + } + } + return value; + }, + getValueFromNestedItem(item, indexes) { + let nestedItem = item; + for (let index of indexes) { + if (nestedItem) nestedItem = nestedItem[index]; + } + return this.parseValue(nestedItem); + }, + + getValueFromCallback(item, callback) { + if (typeof callback !== "function") return this.defaultValue; + const value = callback(item); + return this.parseValue(value); + }, + parseValue(value) { + return value || value === 0 || typeof value === "boolean" + ? value + : this.defaultValue; + }, + base64ToBlob(data, mime) { + let base64 = window.btoa(window.unescape(encodeURIComponent(data))); + let bstr = atob(base64); + let n = bstr.length; + let u8arr = new Uint8ClampedArray(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); + }, + }, // end methods +}; + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier +/* server only */ +, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; +} + +var normalizeComponent_1 = normalizeComponent; + +/* script */ +const __vue_script__ = script; + +/* template */ +var __vue_render__ = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { attrs: { id: _vm.idName }, on: { click: _vm.generate } }, + [_vm._t("default", [_vm._v(" Download " + _vm._s(_vm.name) + " ")])], + 2 + ) +}; +var __vue_staticRenderFns__ = []; +__vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = undefined; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject */ + + /* style inject SSR */ + + + + var JsonExcel = normalizeComponent_1( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + undefined, + undefined + ); + +export default JsonExcel; diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.umd.js b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.umd.js new file mode 100755 index 00000000..bd2c0dc0 --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/dist/vue-json-excel.umd.js @@ -0,0 +1,660 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.JsonExcel = factory()); +}(this, (function () { 'use strict'; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var download = createCommonjsModule(function (module, exports) { + //download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage + // v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime + // v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs + // v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. + // v4 adds AMD/UMD, commonJS, and plain browser support + // v4.1 adds url download capability via solo URL argument (same domain/CORS only) + // v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors + // https://github.com/rndme/download + + (function (root, factory) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } + }(commonjsGlobal, function () { + + return function download(data, strFileName, strMimeType) { + + var self = window, // this script is only for browsers anyway... + defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads + mimeType = strMimeType || defaultMime, + payload = data, + url = !strFileName && !strMimeType && payload, + anchor = document.createElement("a"), + toString = function(a){return String(a);}, + myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), + fileName = strFileName || "download", + blob, + reader; + myBlob= myBlob.call ? myBlob.bind(self) : Blob ; + + if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback + payload=[payload, mimeType]; + mimeType=payload[0]; + payload=payload[1]; + } + + + if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument + fileName = url.split("/").pop().split("?")[0]; + anchor.href = url; // assign href prop to temp anchor + if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path: + var ajax=new XMLHttpRequest(); + ajax.open( "GET", url, true); + ajax.responseType = 'blob'; + ajax.onload= function(e){ + download(e.target.response, fileName, defaultMime); + }; + setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return: + return ajax; + } // end if valid url? + } // end if url? + + + //go ahead and download dataURLs right away + if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){ + + if(payload.length > (1024*1024*1.999) && myBlob !== toString ){ + payload=dataUrlToBlob(payload); + mimeType=payload.type || defaultMime; + }else { + return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: + navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : + saver(payload) ; // everyone else can save dataURLs un-processed + } + + }else {//not data url, is it a string with special needs? + if(/([\x80-\xff])/.test(payload)){ + var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length; + for(i;i null, + }, + // this prop is used to fix the problem with other components that use the + // variable fields, like vee-validate. exportFields works exactly like fields + exportFields: { + type: Object, + default: () => null, + }, + // Use as fallback when the row has no field values + defaultValue: { + type: String, + required: false, + default: "", + }, + // Title(s) for the data, could be a string or an array of strings (multiple titles) + header: { + default: null, + }, + // Footer(s) for the data, could be a string or an array of strings (multiple footers) + footer: { + default: null, + }, + // filename to export + name: { + type: String, + default: "data.xls", + }, + fetch: { + type: Function, + }, + meta: { + type: Array, + default: () => [], + }, + worksheet: { + type: String, + default: "Sheet1", + }, + //event before generate was called + beforeGenerate: { + type: Function, + }, + //event before download pops up + beforeFinish: { + type: Function, + }, + // Determine if CSV Data should be escaped + escapeCsv: { + type: Boolean, + default: true, + }, + // long number stringify + stringifyLongNum: { + type: Boolean, + default: false, + }, + }, + computed: { + // unique identifier + idName() { + var now = new Date().getTime(); + return "export_" + now; + }, + + downloadFields() { + if (this.fields) return this.fields; + + if (this.exportFields) return this.exportFields; + }, + }, + methods: { + async generate() { + if (typeof this.beforeGenerate === "function") { + await this.beforeGenerate(); + } + let data = this.data; + if (typeof this.fetch === "function" || !data) data = await this.fetch(); + + if (!data || !data.length) { + return; + } + + let json = this.getProcessedJson(data, this.downloadFields); + if (this.type === "html") { + // this is mainly for testing + return this.export( + this.jsonToXLS(json), + this.name.replace(".xls", ".html"), + "text/html" + ); + } else if (this.type === "csv") { + return this.export( + this.jsonToCSV(json), + this.name.replace(".xls", ".csv"), + "application/csv" + ); + } + return this.export( + this.jsonToXLS(json), + this.name, + "application/vnd.ms-excel" + ); + }, + /* + Use downloadjs to generate the download link + */ + export: async function (data, filename, mime) { + let blob = this.base64ToBlob(data, mime); + if (typeof this.beforeFinish === "function") await this.beforeFinish(); + download(blob, filename, mime); + }, + /* + jsonToXLS + --------------- + Transform json data into an xml document with MS Excel format, sadly + it shows a prompt when it opens, that is a default behavior for + Microsoft office and cannot be avoided. It's recommended to use CSV format instead. + */ + jsonToXLS(data) { + let xlsTemp = + ' ${table}
'; + let xlsData = ""; + const colspan = Object.keys(data[0]).length; + let _self = this; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + xlsData += this.parseExtraData( + header, + '${data}' + ); + } + + //Fields + xlsData += ""; + for (let key in data[0]) { + xlsData += "" + key + ""; + } + xlsData += ""; + xlsData += ""; + + //Data + xlsData += ""; + data.map(function (item, index) { + xlsData += ""; + for (let key in item) { + xlsData += + "" + + _self.preprocessLongNum( + _self.valueReformattedForMultilines(item[key]) + ) + + ""; + } + xlsData += ""; + }); + xlsData += ""; + + //Footer + if (this.footer != null) { + xlsData += ""; + xlsData += this.parseExtraData( + this.footer, + '${data}' + ); + xlsData += ""; + } + + return xlsTemp + .replace("${table}", xlsData) + .replace("${worksheet}", this.worksheet); + }, + /* + jsonToCSV + --------------- + Transform json data into an CSV file. + */ + jsonToCSV(data) { + let _self = this; + var csvData = []; + + //Header + const header = this.header || this.$attrs.title; + if (header) { + csvData.push(this.parseExtraData(header, "${data}\r\n")); + } + + //Fields + for (let key in data[0]) { + csvData.push(key); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + //Data + data.map(function (item) { + for (let key in item) { + let escapedCSV = item[key] + ""; + // Escaped CSV data to string to avoid problems with numbers or other types of values + // this is controlled by the prop escapeCsv + if (_self.escapeCsv) { + escapedCSV = '="' + escapedCSV + '"'; // cast Numbers to string + if (escapedCSV.match(/[,"\n]/)) { + escapedCSV = '"' + escapedCSV.replace(/\"/g, '""') + '"'; + } + } + csvData.push(escapedCSV); + csvData.push(","); + } + csvData.pop(); + csvData.push("\r\n"); + }); + //Footer + if (this.footer != null) { + csvData.push(this.parseExtraData(this.footer, "${data}\r\n")); + } + return csvData.join(""); + }, + /* + getProcessedJson + --------------- + Get only the data to export, if no fields are set return all the data + */ + getProcessedJson(data, header) { + let keys = this.getKeys(data, header); + let newData = []; + let _self = this; + data.map(function (item, index) { + let newItem = {}; + for (let label in keys) { + let property = keys[label]; + newItem[label] = _self.getValue(property, item); + } + newData.push(newItem); + }); + + return newData; + }, + getKeys(data, header) { + if (header) { + return header; + } + + let keys = {}; + for (let key in data[0]) { + keys[key] = key; + } + return keys; + }, + /* + parseExtraData + --------------- + Parse title and footer attribute to the csv format + */ + parseExtraData(extraData, format) { + let parseData = ""; + if (Array.isArray(extraData)) { + for (var i = 0; i < extraData.length; i++) { + if (extraData[i]) + parseData += format.replace("${data}", extraData[i]); + } + } else { + parseData += format.replace("${data}", extraData); + } + return parseData; + }, + + getValue(key, item) { + const field = typeof key !== "object" ? key : key.field; + let indexes = typeof field !== "string" ? [] : field.split("."); + let value = this.defaultValue; + + if (!field) value = item; + else if (indexes.length > 1) + value = this.getValueFromNestedItem(item, indexes); + else value = this.parseValue(item[field]); + + if (key.hasOwnProperty("callback")) + value = this.getValueFromCallback(value, key.callback); + + return value; + }, + + /* + convert values with newline \n characters into
+ */ + valueReformattedForMultilines(value) { + if (typeof value == "string") return value.replace(/\n/gi, "
"); + else return value; + }, + preprocessLongNum(value) { + if (this.stringifyLongNum) { + if (String(value).startsWith("0x")) { + return value; + } + if (!isNaN(value) && value != "") { + if (value > 99999999999 || value < 0.0000000000001) { + return '="' + value + '"'; + } + } + } + return value; + }, + getValueFromNestedItem(item, indexes) { + let nestedItem = item; + for (let index of indexes) { + if (nestedItem) nestedItem = nestedItem[index]; + } + return this.parseValue(nestedItem); + }, + + getValueFromCallback(item, callback) { + if (typeof callback !== "function") return this.defaultValue; + const value = callback(item); + return this.parseValue(value); + }, + parseValue(value) { + return value || value === 0 || typeof value === "boolean" + ? value + : this.defaultValue; + }, + base64ToBlob(data, mime) { + let base64 = window.btoa(window.unescape(encodeURIComponent(data))); + let bstr = atob(base64); + let n = bstr.length; + let u8arr = new Uint8ClampedArray(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); + }, + }, // end methods + }; + + function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier + /* server only */ + , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; + } + + var normalizeComponent_1 = normalizeComponent; + + /* script */ + const __vue_script__ = script; + + /* template */ + var __vue_render__ = function() { + var _vm = this; + var _h = _vm.$createElement; + var _c = _vm._self._c || _h; + return _c( + "div", + { attrs: { id: _vm.idName }, on: { click: _vm.generate } }, + [_vm._t("default", [_vm._v(" Download " + _vm._s(_vm.name) + " ")])], + 2 + ) + }; + var __vue_staticRenderFns__ = []; + __vue_render__._withStripped = true; + + /* style */ + const __vue_inject_styles__ = undefined; + /* scoped */ + const __vue_scope_id__ = undefined; + /* module identifier */ + const __vue_module_identifier__ = undefined; + /* functional template */ + const __vue_is_functional_template__ = false; + /* style inject */ + + /* style inject SSR */ + + + + var JsonExcel = normalizeComponent_1( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + undefined, + undefined + ); + + return JsonExcel; + +}))); diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/example-multi-line.png b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/example-multi-line.png new file mode 100755 index 00000000..b6993ebf Binary files /dev/null and b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/example-multi-line.png differ diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/node_modules/downloadjs b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/node_modules/downloadjs new file mode 120000 index 00000000..218f229e --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/node_modules/downloadjs @@ -0,0 +1 @@ +../../_downloadjs@1.4.7@downloadjs \ No newline at end of file diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/package.json b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/package.json new file mode 100644 index 00000000..993c6288 --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/package.json @@ -0,0 +1,47 @@ +{ + "name": "vue-json-excel", + "version": "0.3.0", + "description": "Download your JSON as an excel or CSV file directly from the browser", + "main": "dist/vue-json-excel.umd.js", + "module": "dist/vue-json-excel.esm.js", + "scripts": { + "build:dist": "rollup -c ./rollup.config.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jecovier/vue-json-excel.git" + }, + "keywords": [ + "vue", + "vuejs", + "vue2", + "Excel", + "xls", + "csv", + "json", + "export", + "json excel", + "download", + "component" + ], + "author": "Jose Javier Espinoza", + "license": "MIT", + "bugs": { + "url": "https://github.com/jecovier/vue-json-excel/issues" + }, + "homepage": "https://github.com/jecovier/vue-json-excel#readme", + "dependencies": { + "downloadjs": "^1.4.7" + }, + "devDependencies": { + "rollup": "^1.7.4", + "rollup-plugin-commonjs": "^9.2.2", + "rollup-plugin-node-resolve": "^4.0.1", + "rollup-plugin-vue": "^4.7.2", + "vue-template-compiler": "^2.6.10" + }, + "__npminstall_done": "Thu Jun 03 2021 11:07:53 GMT+0800 (中国标准时间)", + "_from": "vue-json-excel@0.3.0", + "_resolved": "https://registry.nlark.com/vue-json-excel/download/vue-json-excel-0.3.0.tgz" +} \ No newline at end of file diff --git a/node_modules/_vue-json-excel@0.3.0@vue-json-excel/rollup.config.js b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/rollup.config.js new file mode 100755 index 00000000..b40914cc --- /dev/null +++ b/node_modules/_vue-json-excel@0.3.0@vue-json-excel/rollup.config.js @@ -0,0 +1,27 @@ +import vue from 'rollup-plugin-vue'; +import commonjs from 'rollup-plugin-commonjs'; +import resolve from 'rollup-plugin-node-resolve'; + +export default { + input: 'JsonExcel.vue', + output: [ + { + format: 'cjs', + file: 'dist/vue-json-excel.cjs.js' + }, + { + format: 'esm', + file: 'dist/vue-json-excel.esm.js' + }, + { + name: 'JsonExcel', + format: 'umd', + file: 'dist/vue-json-excel.umd.js' + } + ], + plugins: [ + vue(), + commonjs(), + resolve() + ] +} diff --git a/node_modules/downloadjs b/node_modules/downloadjs new file mode 120000 index 00000000..a65999f7 --- /dev/null +++ b/node_modules/downloadjs @@ -0,0 +1 @@ +_downloadjs@1.4.7@downloadjs \ No newline at end of file diff --git a/node_modules/vue-json-excel b/node_modules/vue-json-excel new file mode 120000 index 00000000..b29d3192 --- /dev/null +++ b/node_modules/vue-json-excel @@ -0,0 +1 @@ +_vue-json-excel@0.3.0@vue-json-excel \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..96d96bb7 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "vue-json-excel": "^0.3.0" + } +} diff --git a/seller/src/api/promotion.js b/seller/src/api/promotion.js index ebc8941c..d8a3657b 100644 --- a/seller/src/api/promotion.js +++ b/seller/src/api/promotion.js @@ -3,21 +3,49 @@ import { getRequest, postRequest, postRequestWithNoForm, putRequest, deleteReque // 获取店铺直播间列表 -export const getLivesList = (params) => { +export const getLiveList = (params) => { return getRequest('/broadcast/studio', params) } +// 添加直播间 +export const addLive = (params) => { + return postRequest('/broadcast/studio', params) +} + +// 获取直播间详情 +export const getLiveInfo = (studioId) => { + return getRequest(`/broadcast/studio/studioInfo/${studioId}`) +} + +// 修改直播间 +export const editLive = (params) => { + return putRequest('/broadcast/studio/edit', params) +} // 获取店铺直播商品 export const getLiveGoods = (params) => { return getRequest('/broadcast/commodity', params) } +// 店铺直播间删除商品 +export const delLiveGoods = (goodsId) => { + return deleteRequest(`/broadcast/commodity/${goodsId}`) +} + +// 直播间删除商品 +export const delRoomLiveGoods = (roomId,liveGoodsId) => { + return deleteRequest(`/broadcast/studio/deleteInRoom/${roomId}/${liveGoodsId}`) +} + // 添加店铺直播商品 -export const addLiveGoods = (params) => { +export const addLiveStoreGoods = (params) => { return postRequestWithNoForm('/broadcast/commodity', params) } +// 店铺直播间添加 +export const addLiveGoods = (params) => { + return putRequest(`/broadcast/studio/push/${params.roomId}/${params.liveGoodsId}`) +} // 获取拼团列表 export const getPintuanList = (params) => { diff --git a/seller/src/views/goods/goods-seller/goods.vue b/seller/src/views/goods/goods-seller/goods.vue index 69ffbb81..c6d6a59a 100644 --- a/seller/src/views/goods/goods-seller/goods.vue +++ b/seller/src/views/goods/goods-seller/goods.vue @@ -715,6 +715,9 @@ export default { }); }, }, + mounted () { + this.init(); + }, activated () { this.init(); }, diff --git a/seller/src/views/promotion/live/addLive.vue b/seller/src/views/promotion/live/addLive.vue index a345e731..cfa0c37e 100644 --- a/seller/src/views/promotion/live/addLive.vue +++ b/seller/src/views/promotion/live/addLive.vue @@ -1,8 +1,9 @@ diff --git a/seller/src/views/promotion/live/liveGoods.vue b/seller/src/views/promotion/live/liveGoods.vue index 62c7780f..0073af23 100644 --- a/seller/src/views/promotion/live/liveGoods.vue +++ b/seller/src/views/promotion/live/liveGoods.vue @@ -1,72 +1,102 @@ diff --git a/seller/src/views/promotion/seckill/seckill.vue b/seller/src/views/promotion/seckill/seckill.vue index 7b1ae4a7..06225112 100644 --- a/seller/src/views/promotion/seckill/seckill.vue +++ b/seller/src/views/promotion/seckill/seckill.vue @@ -2,29 +2,12 @@
-
+ - + - @@ -32,13 +15,7 @@ - + @@ -79,18 +56,8 @@ - +
@@ -191,8 +158,8 @@ export default { this.getDataList(); }, handleReset() { - this.searchForm = {} - this.selectDate = '' + this.searchForm = {}; + this.selectDate = ""; this.searchForm.pageNumber = 0; this.searchForm.pageSize = 10; this.getDataList(); @@ -232,9 +199,12 @@ export default { return hourArr; }, }, - activated () { + activated() { this.init(); - } + }, + mounted() { + this.init(); + }, };