From 467f1f72c02c94d3ec7cd22a2c5d7f78b1d70fa8 Mon Sep 17 00:00:00 2001
From: liudan <18634735655@163.com>
Date: Sat, 3 Feb 2024 16:23:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/api.config.js | 4 +
src/api/store.js | 37 ++++++
src/config/router.config.js | 15 +++
src/core/lazy_lib/components_use.js | 4 +-
src/views/dataCenter/originData.vue | 193 ++++++++++++++++++++++++++++
src/views/store/index.vue | 64 ++++++++-
6 files changed, 312 insertions(+), 5 deletions(-)
create mode 100644 src/views/dataCenter/originData.vue
diff --git a/src/api/api.config.js b/src/api/api.config.js
index a0ea1ae..c16d4cd 100644
--- a/src/api/api.config.js
+++ b/src/api/api.config.js
@@ -29,6 +29,10 @@ export default {
default: 'store.module/default',
detail: 'store.module/detail',
edit: 'store.module/edit',
+ dataList:'store/platformList',
+ getStorePlatform:'store/getStorePlatform',
+ setStorePlatform:'store/auth',
+ getGoodsList:'/goods/index',
},
// 商家后台api权限
diff --git a/src/api/store.js b/src/api/store.js
index 25d3dc7..1c8aa17 100644
--- a/src/api/store.js
+++ b/src/api/store.js
@@ -84,3 +84,40 @@ export function move (data) {
data: data
})
}
+
+/**
+ * 获取数据授权
+ * @param {*} data
+ */
+export function getDataList (data) {
+ return axios({
+ url: api.store.module.dataList,
+ method: 'post',
+ data: data
+ })
+}
+/**
+ * 获取数据授权平台列表
+ * @param {*} data
+ */
+export function getStorePlatform (params) {
+ return axios({
+ url: api.store.module.getStorePlatform,
+ method: 'get',
+
+ })
+}
+export function setStorePlatform (data) {
+ return axios({
+ url: api.store.module.setStorePlatform,
+ method: 'post',
+ data: data
+ })
+}
+export function getGoodsList (params) {
+ return axios({
+ url: api.store.module.getGoodsList,
+ method: 'get',
+ params
+ })
+}
diff --git a/src/config/router.config.js b/src/config/router.config.js
index 1cbfc99..7107257 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -50,6 +50,21 @@ export const asyncRouterMap = [
}
]
},
+ {
+ name: 'dataCenter',
+ path: 'dataCenter',
+ redirect: '/dataCenter/originData',
+ component: PageView,
+ meta: { title: '数据中心', keepAlive: true, icon: Icon['menu'], permission: ['access'] },
+ children: [
+ {
+ path: '/dataCenter/originData',
+ component: () => import(/* webpackChunkName: "menu" */ '@/views/dataCenter/originData'),
+ meta: { title: '原始数据', keepAlive: true, permission: ['access'] }
+ },
+
+ ]
+ },
{
name: 'Setting',
diff --git a/src/core/lazy_lib/components_use.js b/src/core/lazy_lib/components_use.js
index 126f63d..b1c70d9 100644
--- a/src/core/lazy_lib/components_use.js
+++ b/src/core/lazy_lib/components_use.js
@@ -47,7 +47,8 @@ import {
Skeleton,
Popconfirm,
message,
- notification
+ notification,
+ pagination
} from 'ant-design-vue'
import Tree from '@/components/tree'
@@ -91,6 +92,7 @@ Vue.use(Progress)
Vue.use(Skeleton)
Vue.use(Popconfirm)
Vue.use(notification)
+Vue.use(pagination)
Vue.use(Tree)
diff --git a/src/views/dataCenter/originData.vue b/src/views/dataCenter/originData.vue
new file mode 100644
index 0000000..efb1371
--- /dev/null
+++ b/src/views/dataCenter/originData.vue
@@ -0,0 +1,193 @@
+
+
+
+
+
+ {{ getLable(item) }}
+ Name
+
+
+ 编辑
+ 删除
+
+
+
+
+
+ {{ props.value }}条/页
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/store/index.vue b/src/views/store/index.vue
index 38758af..ff4dfdb 100644
--- a/src/views/store/index.vue
+++ b/src/views/store/index.vue
@@ -14,6 +14,7 @@
:pageSize="15"
>
+ 数据授权
进入商城
删除
功能模块
@@ -21,6 +22,22 @@
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
@@ -63,7 +80,7 @@ export default {
{
title: '操作',
dataIndex: 'action',
- width: '200px',
+ width: '300px',
scopedSlots: { customRender: 'action' }
}
],
@@ -73,13 +90,17 @@ export default {
.then(response => {
return response.data.list
})
- }
+ },
+ open:false,
+ checkedList:[],
+ checkList:[],
+ storeId:null,
}
},
created () {
+ this.getDataList()
},
methods: {
-
/**
* 进入商城
*/
@@ -140,7 +161,42 @@ export default {
*/
handleRefresh () {
this.$refs.table.refresh()
- }
+ },
+ getDataList(){
+ return Api.getDataList().then(result => {
+
+ let obj = result.data;
+ Object.keys(obj).forEach(item=>{
+ this.checkList.push({id:item,name:obj[item]})
+ })
+ })
+ },
+ getPlatFormItem(item){
+ this.storeId = item.store_id
+ return Api.getStorePlatform({store_id:item.store_id}).then(result => {
+
+ this.checkedList = result.data.map(item=>{
+ return item.channel
+ })
+ this.open = true
+ })
+ },
+ onChange(checkedValues) {
+ console.log('checked = ', checkedValues);
+ this.checkedList = checkedValues
+ },
+
+ handleOk(){
+ let params = {
+ store_id:this.storeId,
+ platformList:this.checkedList
+ }
+ return Api.setStorePlatform(params).then(result => {
+ this.$message.success(result.message)
+ this.open = false;
+ this.handleRefresh()
+ })
+ },
}
}