Browse Source

siteList

pull/51/head
rainbro 2 weeks ago
parent
commit
1f6292b638
  1. 1
      src/assets/site/filter.svg
  2. 1
      src/assets/site/more.svg
  3. 1
      src/assets/site/up_icon.svg
  4. 14
      src/router/index.js
  5. 4
      src/store/index.js
  6. 333
      src/views/agent/siteList.vue
  7. 2
      vue.config.js

1
src/assets/site/filter.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_144_40235"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_144_40235)"><g><path d="M2,3L6.8,8.60593L6.8,12.8148L9.2,14L9.2,8.60593L14,3L2,3Z" fill="#BABDC2" fill-opacity="1"/><path d="M14.4336,2.493602Q14.343,2.416032,14.2311,2.374683Q14.1193,2.333333,14,2.333333L2,2.333333Q1.9343391,2.333333,1.86994,2.346143Q1.805541,2.358953,1.744878,2.38408Q1.684215,2.409208,1.62962,2.445687Q1.5750250000000001,2.482166,1.528596,2.528596Q1.4821659999999999,2.575025,1.445687,2.62962Q1.409208,2.684215,1.38408,2.744878Q1.358953,2.805541,1.346143,2.86994Q1.333333,2.9343391,1.333333,3Q1.333333,3.119266,1.374683,3.231134Q1.416032,3.343002,1.493602,3.433596L6.13333,8.852350000000001L6.13333,12.8148Q6.13333,12.90808,6.15893,12.99777Q6.18453,13.0875,6.23377,13.1667Q6.283,13.2459,6.35209,13.3086Q6.42118,13.3713,6.50481,13.4126L8.904810000000001,14.5978Q8.96368,14.6268,9.0271,14.6439Q9.09051,14.6609,9.156030000000001,14.6652Q9.22155,14.6695,9.28665,14.661Q9.351759999999999,14.6525,9.41394,14.6314Q9.476130000000001,14.6103,9.53301,14.5775Q9.5899,14.5447,9.639289999999999,14.5015Q9.68868,14.4582,9.72868,14.4061Q9.76868,14.3541,9.79775,14.2952Q9.86667,14.1556,9.86667,14L9.86667,8.852350000000001L14.5064,3.433596Q14.5491,3.38372,14.5813,3.326471Q14.6134,3.269222,14.6338,3.2068Q14.6541,3.144378,14.6619,3.0791823Q14.6697,3.0139861,14.6647,2.9485212Q14.6596,2.883056,14.6419,2.819839Q14.6241,2.756621,14.5944,2.698079Q14.5646,2.639538,14.5241,2.587923Q14.4835,2.536308,14.4336,2.493602ZM12.5515,3.666667L3.44848,3.666667L7.3064,8.17234Q7.38397,8.26293,7.42532,8.3748Q7.46667,8.48667,7.46667,8.60593L7.46667,12.4005L8.53333,12.92725L8.53333,8.60593Q8.53333,8.48667,8.57468,8.3748Q8.61603,8.26293,8.6936,8.17234L12.5515,3.666667Z" fill-rule="evenodd" fill="#BABDC2" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

1
src/assets/site/more.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_140_48358"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_140_48358)"><g transform="matrix(0,1,-1,0,12,-8)"><g><ellipse cx="11.5" cy="3.5" rx="1.5" ry="1.5" fill="#8A9099" fill-opacity="1"/></g><g><ellipse cx="16.5" cy="3.5" rx="1.5" ry="1.5" fill="#8A9099" fill-opacity="1"/></g><g><ellipse cx="21.5" cy="3.5" rx="1.5" ry="1.5" fill="#8A9099" fill-opacity="1"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 615 B

1
src/assets/site/up_icon.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g transform="matrix(1,0,0,-1,0,32)"><g><path d="M2.41612,21.500656L8,26.15389L13.5838,21.500686L13.5839,21.500656Q13.6715,21.427647,13.7787,21.388823Q13.886,21.35,14,21.35Q14.064,21.35,14.1268,21.36249Q14.1896,21.374979,14.2487,21.399478Q14.3079,21.423977999999998,14.3611,21.459545Q14.4143,21.495112,14.4596,21.540381Q14.5049,21.585649,14.5405,21.638879Q14.576,21.69211,14.6005,21.751256Q14.625,21.810402,14.6375,21.873191Q14.65,21.9359806,14.65,22Q14.65,22.14468,14.5886,22.275701Q14.5273,22.406721,14.4161,22.499343L8.41612,27.49934Q8.37265,27.53557,8.32357,27.56374Q8.27449,27.59191,8.22128,27.61118Q8.16807,27.63044,8.11233,27.64022Q8.05659,27.65,8,27.65Q7.94341,27.65,7.88767,27.64022Q7.83193,27.63044,7.77872,27.61118Q7.72551,27.59191,7.67643,27.56374Q7.62735,27.53557,7.58388,27.49934L1.58388,22.499344Q1.472734,22.406722,1.411367,22.275701Q1.35,22.14468,1.35,22Q1.35,21.9359806,1.36249,21.873191Q1.374979,21.810402,1.399478,21.751256Q1.423978,21.69211,1.4595449999999999,21.638879Q1.495112,21.585649,1.540381,21.540381Q1.585649,21.495112,1.638879,21.459545Q1.69211,21.423977999999998,1.751256,21.399478Q1.810402,21.374979,1.873191,21.36249Q1.9359806,21.35,2,21.35Q2.114044,21.35,2.221276,21.388824Q2.328509,21.427647,2.41612,21.500656Z" fill-rule="evenodd" fill="#1E2226" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

14
src/router/index.js

@ -6,14 +6,14 @@ import HomeView from '../views/HomeView.vue';
// import Franchise from '../views/Franchise.vue'
Vue.use(VueRouter)
const whiteSlideList = ['/', '/ui', '/siteList']; //侧边导航白名单
const whiteHeaderList = ['/', '/ui', '/register', '/configureServicePrices', '/siteList','/siteSetting/siteBaseSetting','/siteSetting/sitePersonalization'
const whiteSlideList = ['/', '/ui', '/agent/siteList']; //侧边导航白名单
const whiteHeaderList = ['/', '/ui', '/agent/siteList', '/register', '/configureServicePrices', '/siteList','/siteSetting/siteBaseSetting','/siteSetting/sitePersonalization'
,'/siteSetting/siteH5','/siteSetting/siteSem','/pageTemplete','/demo',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
]; //头部导航白名单
const whiteFooterList = ['/', '/ui', '/configureServicePrices',
const whiteFooterList = ['/', '/ui', '/agent/siteList', '/configureServicePrices',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
@ -53,6 +53,14 @@ const routes = [{
component: () => import( /* webpackChunkName: "ui" */ '../views/elementGroups.vue')
},
{
path: '/agent/siteList',
name: '站点列表',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/siteList.vue')
},
{
path: '/franchise',
name: '加盟',
component: () => import( /* webpackChunkName: "franchise" */ '../views/Franchise.vue')

4
src/store/index.js

@ -106,8 +106,8 @@ export default new Vuex.Store({
icon: 'orderList',
children: [{
index: '2-1',
title: '子级菜单2-1',
path: '/'
title: '站点列表',
path: '/agent/siteList'
},
{
index: '2-2',

333
src/views/agent/siteList.vue

@ -0,0 +1,333 @@
<template>
<div class="elementWrap">
<div>
<div class="pageheader">
<div class="pageheader-left">
<span class="pagetitle">站点列表</span>
<GuipButton type="ignore"><svg-icon :size="16" :path="require('@/assets/site/addIcon.svg')" :color="'#8A9099'" :hoverColor="'#006AFF'" />按钮</GuipButton>
<el-form>
<GuipSelect v-model="currentGroup" :options="siteGroups" defaultValue="选项1" placeholder="请选择分组" labelKey="name" valueKey="id" style="margin-bottom: 0px;" />
</el-form>
</div>
<GuipButton size="table" :href="addNewSiteUrl">新增站点</GuipButton>
</div>
<el-form>
<GuipTable
:tableData="filteredSites"
ref="multipleTable"
@selectChange="handleSelectionChange"
autoColumn="true"
:loading="tableLoading">
<el-table-column prop="short_name" label="站点简称">
<template slot-scope="scope">
<div class="flex cell_render">
<el-link :href="scope.row.domain" target="_blank" class="black">{{ scope.row.short_name }}</el-link>
<svg-icon :size="16" :path="require('@/assets/site/form_link.svg')" :color="'#8A9099'" :hoverColor="'#006AFF'" />
</div>
</template>
</el-table-column>
<el-table-column prop="regtime" label="注册时间"></el-table-column>
<el-table-column prop="group" label="站点分组">
<template #default="{ row,$index }">
<el-popover v-model="row.showPopover" :ref="`groupPopover-${row.uid}`"
placement="top"
trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover">
<div class="group_select">
<GuipSelect v-model="selected_group" :options="siteGroups" defaultValue="站点分组" labelKey="name" valueKey="id" placeholder="请选择分组" @change="addSiteGroup(row)" />
</div>
<template #reference>
<div class="flex cell_render" @click="showGroupSetting(row, $index)">
<span v-if="row.group">{{ row.group }}</span>
<span class="gray" v-else>未分组</span>
<svg-icon :size="16" :path="currentIcon" :color="'#8A9099'" :hoverColor="'#006AFF'" @click="toggleIcon" />
</div>
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="phone_services" label="手机服务">
<template slot="header">
<div class="flex cell_render" @click="visible = !visible">
<span>手机服务</span>
<img class="ml-4" src="@/assets/site/filter.svg" />
</div>
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<template slot-scope="scope">
<span v-if="scope.row.phone_services">{{ scope.row.phone_services }}</span>
<span class="gray" v-else></span>
</template>
</el-table-column>
<el-table-column prop="config_progress_status_desc" label="状态">
<template slot-scope="scope">
<div class="flex cell_render">
<span class="green" v-if="scope.row.config_progress_status == 5">{{ scope.row.config_progress_status_desc }}</span>
<div class="flex cell_render" v-else>
<span class="red">{{ scope.row.config_progress_status_desc }}</span>
<svg-icon :size="16" :path="require('@/assets/site/more.svg')" :color="'#8A9099'" :hoverColor="'#006AFF'" @click="toggleIcon" />
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<el-link type="primary" :href="serviceListUrl" target="_blank" class="mr-16">服务列表</el-link>
<el-link type="primary" :href="siteSettingUrl" target="_blank">站点设置</el-link>
</el-table-column>
</GuipTable>
</el-form>
</div>
<Footer></Footer>
</div>
</template>
<script>
import GuipTable from '@/components/GuipTable.vue';
import Footer from '@/components/Footer.vue';
// import GuipToolTip from '@/components/GuipToolTip.vue'
import SvgIcon from '@/components/SvgIcon.vue';
import GuipSelect from '@/components/GuipSelect.vue';
// import HoverButton from '@/components/HoverButton.vue'
import GuipButton from '@/components/GuipButton.vue';
// import GuipInput from '@/components/GuipInput.vue';
// import { mapState } from 'vuex'
// import store from '@/store';
export default {
name: 'siteList',
components: {
Footer,
GuipTable,
// GuipToolTip,
SvgIcon,
GuipSelect,
// HoverButton,
GuipButton,
// GuipInput,
},
data() {
return {
tableLoading: true,
siteList: [],
siteGroups: [],
gid: 0,
serviceListUrl: '/ui',
siteSettingUrl: '/ui',
addNewSiteUrl: '/ui',
popoverFlag:false,
value: '',
selected_group: '',
isUpIco: false,
currentIcon: require('@/assets/site/drop_icon.svg'),
visible: false,
currentGroup: '',
}
},
mounted() {
this.getSiteList()
this.getSiteGroups()
},
methods: {
init() {
this.gid = this.$route.query.gid
this.getSiteList()
//this.getSiteGroups()
},
getSiteList() {
this.tableLoading = true
const that = this
that.siteList = []
this.$http('POST', '/agentnew/ajax_get_site_list', {
gid: this.gid,
},{
headers:{
'Auth': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU'
}
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
that.siteList = response.data.sitelist
console.log(that.siteList,'---that.siteList');
})
}).catch(error => {
console.error(error, 'error')
})
},
getSiteGroups() {
const that = this
that.siteGroups = []
this.$http('POST', '/agentnew/ajax_get_site_groups', {
gid: this.gid,
},{
headers:{
'Auth': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU'
}
}).then(response => {
this.$nextTick(() => {
that.siteGroups = response.data
console.log(that.siteGroups,'---that.siteGroups');
})
}).catch(error => {
console.error(error, 'error')
})
},
//
showGroupSetting(row, index) {
//
this.selected_group = '';
if (row.group) {
this.selected_group = row.group;
}
//
this.popoverFlag = true;
this.siteList.forEach((item, i) => {
if (i !== index) {
item['showPopover'] = false;
}
});
//
row['showPopover'] = true;
//
this.toggleIcon();
},
//
addSiteGroup(row) {
this.$http('POST', '/agentnew/ajax_add_site_group_index', {
groupid: this.selected_group,
uid: row.uid,
},{
headers:{
'Auth': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU'
}
}).then(response => {
if (response.status) {
//
this.$message.success(response.info);
//
this.siteGroups.forEach((item) => {
if (item.id === this.selected_group) {
row['group'] = item.name;
}
});
row['groupid'] = this.selected_group; //
row['showPopover'] = false; //
this.$set(this.siteList, row)
this.currentIcon = require('@/assets/site/drop_icon.svg');
} else {
this.$message.error(response.info);
}
}).catch(error => {
console.error(error, 'error')
})
},
//
cancleGroupSetting(row) {
//
row['showPopover'] = false;
this.popoverFlag = false
// row[type + '_popover'] = false; //
this.currentIcon = require('@/assets/site/drop_icon.svg');
this.$Message.info('已取消编辑');
},
toggleIcon() {
this.isUpIco = !this.isUpIco; //
//
if (this.isUpIco) {
this.currentIcon = require('@/assets/site/up_icon.svg'); //
} else {
this.currentIcon = require('@/assets/site/drop_icon.svg'); //
}
},
//
handleSelectionChange(data) {
// data
//
console.log(data, '表格行信息');
},
},
computed: {
filteredSites() {
console.log(this.currentGroup, 'this.currentGroup');
let result = this.siteList;
if (this.currentGroup) {
result = result.filter(site => site.groupid == this.currentGroup);
}
console.log(result, 'result');
return result;
}
},
}
</script>
<style lang="scss" scoped>
.elementWrap {
padding: 32px 36px;
background: #fff;
}
.pageheader {
display: flex;
justify-content: space-between; /* 关键属性 */
align-items: center;
margin: 16px 0px 16px 0px;
}
.pageheader-left {
display: flex; /* 左侧按钮组也是flex布局 */
gap: 15px; /* 按钮间距 */
}
.pagetitle {
font-size: 18px;
font-weight: bold;
line-height: normal;
letter-spacing: 0.08em;
color: #1E2226;
margin-top:8px;
}
.mr-16 {
margin-right: 16px;
}
.ml-4 {
margin-left: 4px;
}
.red {
color: #FF4D4F;
}
.green {
color: #0DAF49;
}
.black {
color: #1E2226;
}
.gray {
color: #8C8C8C;
}
::v-deep .custom-popover {
position: fixed !important;
// max-height: 290px;
// overflow-y: auto;
margin-top: 0 !important;
margin-left: 0 !important;
transform: none !important;
}
</style>

2
vue.config.js

@ -9,7 +9,7 @@ module.exports = {
changeOrigin: true,
},
'/agentnew': {
target: 'http://adminnew.pengda.checkcopy.com/',
target: 'http://kuaile.checkcopy.com',
changeOrigin: true,
}
}

Loading…
Cancel
Save