fetch.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. import { $http } from "./config";
  2. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  3. export default {
  4. // 获取店铺列表
  5. getShopList(data) {
  6. return $http("/shop/list", data);
  7. },
  8. // 获取店铺详情
  9. getShopDetail(data) {
  10. return $http("/shop/detail", data);
  11. },
  12. // 新增周边商铺
  13. addAroundShop(data) {
  14. return $http("/shop/add/aroundShop", data);
  15. },
  16. // 获取店铺周边商铺列表
  17. getShopAroundList(data) {
  18. return $http("/shop/around/list", data);
  19. },
  20. // 根据省市区获取商店下拉列表
  21. getSelectByRegion(data) {
  22. return $http("/shop/getSelectByRegion", data);
  23. },
  24. // 商品列表-品牌搜索-模糊列表
  25. searchBrandSelect(data) {
  26. return $http("/product/list/brand/data", data);
  27. },
  28. // 商品列表-商品类型搜索-模糊列表
  29. searchSubfamilySelect(data) {
  30. return $http("/product/list/subfamily/data", data);
  31. },
  32. // 获取商品列表
  33. getProductList(data) {
  34. return $http("/product/list", data);
  35. },
  36. // 获取商品详情
  37. getProductDetail(data) {
  38. return $http("/product/detail", data);
  39. },
  40. // 添加生命线
  41. addLifeline(data) {
  42. return $http("/product/lifeline/add", data);
  43. },
  44. // 删除生命线
  45. deleteLifeline(data) {
  46. return $http("/product/lifeline/delete", data);
  47. },
  48. // 更新生命线
  49. updateLifeline(data) {
  50. return $http("/product/lifeline/update", data);
  51. },
  52. // 获取省
  53. getProvince() {
  54. return $http("/region/province");
  55. },
  56. // 获取市
  57. getCity(data) {
  58. return $http("/region/city", data);
  59. },
  60. // 获取区
  61. getDistrict(data) {
  62. return $http("/region/district", data);
  63. },
  64. // 根据省市区获取店铺下拉列表
  65. getShopByArea(data) {
  66. return $http("/shop/getSelectByRegion", data);
  67. },
  68. // 创建决策组与子决策/新增子决策
  69. addDecision(data) {
  70. return $http("/decision/add", data);
  71. },
  72. // 获取营销决策列表
  73. getDecisionList(data) {
  74. return $http("/decision/list", data);
  75. },
  76. // 获取子决策组详情
  77. getDecisionDetail(data) {
  78. return $http("/decision/detail", data);
  79. },
  80. // 周边业态分析
  81. aroundAnalyze(data) {
  82. return $http("/decision/detail/aroundAnalyze", data);
  83. },
  84. // 周边业态词云分析
  85. aroundWordCloudAnalyze(data) {
  86. return $http("/decision/detail/aroundWordCloudAnalyze", data);
  87. },
  88. // 运算
  89. doCalculation(data) {
  90. return new Promise((resolve, reject) => {
  91. setTimeout(() => {
  92. resolve($http("/decision/doCalculation", data));
  93. }, 8000);
  94. });
  95. },
  96. // 创建营销决策-明星商品-模糊搜索下拉
  97. getStarProductSelect(data) {
  98. return $http("/decision/starProductSelect", data);
  99. },
  100. // 创建营销决策-商品功能-模糊搜索下拉
  101. getFunctionSelect(data) {
  102. return $http("/decision/functionSelect", data);
  103. },
  104. // 创建营销决策-生命周期-商品分类模糊搜索下拉
  105. getCategorySelect(data) {
  106. return $http("/decision/categorySelect", data);
  107. },
  108. // 生成知识点
  109. generateWords(data) {
  110. return $http("/product/generate/words", data);
  111. },
  112. // 商品折线图数据
  113. getLineChartData(data) {
  114. return $http("/product/lineChart", data);
  115. },
  116. // 获取决策组详情
  117. getMainDecisionDetail(data) {
  118. return $http("/decision/detail/main", data);
  119. },
  120. // 创建商品组合决策-ALL-选择商品分类模糊下拉
  121. getCGFamilySelect(data) {
  122. return $http("/decision/product/familySelect", data);
  123. },
  124. // 创建商品组合决策-明星商品-产品列表
  125. getCGStarProductList(data) {
  126. return $http("/decision/product/starProduct/productList", data);
  127. },
  128. // 创建商品组合决策-商品功能-产品列表
  129. getCGFunctionList(data) {
  130. return $http("/decision/product/productFunction/productList", data);
  131. },
  132. //创建商品组合决策-生命周期-产品列表
  133. getCGLifeCycleList(data) {
  134. return $http("/decision/product/lifeCycle/productList", data);
  135. },
  136. //创建商品组合决策-商品功能/生命周期-选择IP下拉数据
  137. getCGIpSelect(data) {
  138. return $http("/decision/product/productFunction/ipSelect", data);
  139. },
  140. // 创建商品组合决策-商品功能/生命周期-选择生命周期事件数据
  141. getCGLifeline(data) {
  142. return $http("/decision/product/productFunction/lifeline", data);
  143. },
  144. // 创建商品组合决策
  145. createGroup(data) {
  146. return $http("/decision/product/createGroup", data);
  147. },
  148. // 商品组合分析
  149. CGDoCalc(data) {
  150. return new Promise((resolve, reject) => {
  151. setTimeout(() => {
  152. resolve($http("/decision/product/doCalculation", data));
  153. }, 10000);
  154. });
  155. },
  156. // 活动转化相关接口
  157. // 创建活动
  158. addActivity(data) {
  159. return $http("/activity/add", data);
  160. },
  161. // 获取活动详情
  162. getActivityDetail(data) {
  163. return $http("/activity/detail", data);
  164. },
  165. //获取活动列表
  166. getActivityList(data) {
  167. return $http("/activity/list", data);
  168. },
  169. // 下载数据分析
  170. downloadAnalysis(data) {
  171. return $http("/activity/downloadAnalysis", data);
  172. },
  173. // 获取活动决策列表
  174. getActivityDecsisionList(data) {
  175. return $http("/activity/decsisionList", data);
  176. },
  177. // 店铺列表筛选城市
  178. searchShopListCity(data) {
  179. return $http("/shop/list/search/city", data);
  180. },
  181. // 店铺列表筛选店铺名称
  182. searchShopListShopName(data) {
  183. return $http("/shop/list/search/shopName", data);
  184. },
  185. // 店铺列表筛选店铺类型
  186. searchShopListShopType(data) {
  187. return $http("/shop/list/search/shopType", data);
  188. },
  189. // 使用量列表
  190. getUsageList(data) {
  191. return $http("/product/usage/list", data);
  192. },
  193. // 添加使用量
  194. addUsage(data) {
  195. return $http("/product/usage/add", data);
  196. },
  197. // 删除使用量
  198. deleteUsage(data) {
  199. return $http("/product/usage/delete", data);
  200. },
  201. // 修改使用量
  202. updateUsage(data) {
  203. return $http("/product/usage/update", data);
  204. },
  205. // 添加生命周期-选择商品分类模糊下拉
  206. searchLifelineFamilySelect(data) {
  207. return $http("/product/lifeline/familySelect", data);
  208. },
  209. // 添加生命周期-选择商品商品功能模糊下拉
  210. searchLifelineFunctionSelect(data) {
  211. return $http("/product/lifeline/functionSelect", data);
  212. },
  213. // 获取生命线
  214. getThinkTankLifeline(data) {
  215. return $http("/product/lifeline/showLifeLine", data);
  216. },
  217. suc(res) {
  218. ElNotification({
  219. type: "success",
  220. message: res.data.msg,
  221. title: "Success!",
  222. });
  223. },
  224. err(res) {
  225. ElNotification({
  226. type: "error",
  227. message: res.data.msg,
  228. });
  229. console.log(res);
  230. },
  231. };