fix
This commit is contained in:
148
src/component/Account/account.vue
Normal file
148
src/component/Account/account.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div class="account_page">
|
||||
<div class="account_page_titleImg">
|
||||
<img src="https://code-create.com.hk/wp-content/uploads/2022/12/about_banner-1.jpg" alt="">
|
||||
</div>
|
||||
<div class="account_page_content_box">
|
||||
<div class="account_page_content">
|
||||
<div class="account_page_content_left">
|
||||
<div class="content_left_item">
|
||||
<div>个人中心</div>
|
||||
</div>
|
||||
<!-- {{ router.path }} -->
|
||||
<router-link class="content_left_item" v-for="item in rootSubmenuKeys" :class="{active: $route.path == item.route}" :to="item.route">
|
||||
<i class="fi" :class="item.icon"></i>
|
||||
<div>
|
||||
{{item.name}}
|
||||
</div>
|
||||
</router-link>
|
||||
<!-- <div class="content_left_item" v-for="item in rootSubmenuKeys" :class="{active: $route.path == item.route}">
|
||||
<i class="fi" :class="item.icon"></i>
|
||||
<router-link :to="item.route">
|
||||
{{item.name}}
|
||||
</router-link>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="account_page_content_right">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
let accountHomeData = reactive({
|
||||
rootSubmenuKeys:[
|
||||
{
|
||||
name:'首页',
|
||||
route:'/home/account/accountHome',
|
||||
icon:'fi-rr-house-chimney'
|
||||
},{
|
||||
name:'我的信息',
|
||||
route:'/home/account/accountEdit',
|
||||
icon:'fi-rr-user'
|
||||
},{
|
||||
name:'消息中心',
|
||||
route:'/home/account/accountMessage',
|
||||
icon:'fi-rr-envelope'
|
||||
},{
|
||||
name:'粉丝&关注',
|
||||
route:'/home/account/accountFollowFans',
|
||||
icon:'fi-rr-envelope'
|
||||
},
|
||||
]
|
||||
})
|
||||
const router = useRouter()
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let handleClick = (event:any) => {
|
||||
// state.selectedKeys = [Number(event.key)]
|
||||
// state.nowPageName = event.item.name
|
||||
router.push({path:event.item.route})
|
||||
}
|
||||
return{
|
||||
...toRefs(accountHomeData),
|
||||
router,
|
||||
handleClick,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_page{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
.account_page_titleImg{
|
||||
img{
|
||||
width: 100%;
|
||||
height: 30rem;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
.account_page_content_box{
|
||||
padding: 5rem 10rem;
|
||||
.account_page_content{
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
.account_page_content_left{
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
background: #fafafa;
|
||||
border-right: 1px solid #e9eaec;
|
||||
}
|
||||
.account_page_content_right{
|
||||
width: 80%;
|
||||
}
|
||||
.content_left_item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 10rem;
|
||||
color: #232323;
|
||||
div{
|
||||
width: 15rem;
|
||||
color: #232323;
|
||||
text-align-last: justify;
|
||||
font-size: 3rem;
|
||||
}
|
||||
i{
|
||||
color: #cfcfcf;
|
||||
font-size: 2.5rem;
|
||||
display: flex;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
&.active{
|
||||
color: #fff;
|
||||
background: #39215b;
|
||||
div{
|
||||
color: #fff;
|
||||
font-weight: 900;
|
||||
}
|
||||
i{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
203
src/component/Account/accountEdit.vue
Normal file
203
src/component/Account/accountEdit.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="accountEdit_page">
|
||||
<div class="accountEdit_page_head">
|
||||
<div class="upload_item">
|
||||
<div class="upload_file_item">
|
||||
<a-upload
|
||||
:action="uploadUrl + '/api/element/upload'"
|
||||
:capture="null"
|
||||
list-type="picture-card"
|
||||
:before-upload="beforeUpload"
|
||||
:headers="{Authorization:token}"
|
||||
v-model:file-list="fileList"
|
||||
:customRequest="function(){}"
|
||||
:maxCount="1"
|
||||
accept=".jpg,.png,.jpeg,.bmp"
|
||||
@change="fileUploadChange"
|
||||
>
|
||||
<div
|
||||
class="upload_tip_block"
|
||||
>
|
||||
<i class="fi fi-br-upload"></i>
|
||||
<!-- <img class="upload_img_icon" src="@/assets/images/homePage/add_file.png"> -->
|
||||
</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
</div>
|
||||
<img src="../../assets/images/homePage/alipay.svg" alt="">
|
||||
</div>
|
||||
<div class="accountEdit_page_body">
|
||||
<div class="accountEdit_page_body_item">
|
||||
<div class="accountEdit_page_body_item_name">昵称:</div>
|
||||
<div class="accountEdit_page_body_item_inut">
|
||||
<input type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="accountEdit_page_body_item">
|
||||
<div class="accountEdit_page_body_item_name">用户名:</div>
|
||||
<div class="accountEdit_page_body_item_inut">
|
||||
<textarea style="max-height: 200px; min-height: 90px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accountEdit_page_body_item">
|
||||
<div class="accountEdit_page_body_item_name">我的签名:</div>
|
||||
<div class="accountEdit_page_body_item_inut">
|
||||
<input type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="accountEdit_page_body_item">
|
||||
<div class="started_btn">
|
||||
Submit
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Cropper ref="Cropper" @handleCropperSuccess="handleCropperSuccess" @closeCropper="deletUploadFile()" :cropperFileData="cropperFileData" :isRound="true"></Cropper>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import Cropper from '@/component/HomePage/Cropper.vue'
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
Cropper,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
let accountHomeData = reactive({
|
||||
cropperFileData:{name:'',uid:''}, //裁剪的原始文件数据
|
||||
uploadUrl:'',
|
||||
token:'',
|
||||
fileList:[]
|
||||
})
|
||||
let Cropper = ref()
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let handleCropperSuccess = (event:any)=>{
|
||||
let {file, fileData} =event
|
||||
console.log(file,fileData);
|
||||
Cropper.value.closeCropper()
|
||||
}
|
||||
let beforeUpload=(file:any,fileList:any)=>{
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp';
|
||||
if (!isJpgOrPng) {
|
||||
message.info(useI18n().t('PrintboardUpload.jsContent1'));
|
||||
}
|
||||
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt2M) {
|
||||
message.info(useI18n().t('PrintboardUpload.jsContent2'));
|
||||
}
|
||||
if(isJpgOrPng && isLt2M){
|
||||
// }else{
|
||||
// return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE;
|
||||
}
|
||||
|
||||
}
|
||||
let fileUploadChange = (data:any)=>{
|
||||
let file = data.file
|
||||
// file.id = res.data.id?res.data.id:""
|
||||
var reader = new FileReader();
|
||||
reader.onload = (e:any) => {
|
||||
let data_new;
|
||||
if (typeof e.target.result === 'object') {
|
||||
// 把Array Buffer转化为blob 如果是base64不需要
|
||||
data_new = window.URL.createObjectURL(new Blob([e.target.result]));
|
||||
} else {
|
||||
data_new = e.target.result;
|
||||
}
|
||||
Cropper.value.getOptionImg(data_new)
|
||||
|
||||
|
||||
};
|
||||
// 转化为base64
|
||||
// reader.readAsDataURL(file)
|
||||
// 转化为blob
|
||||
reader.readAsArrayBuffer(file.originFileObj);
|
||||
Cropper.value.changeShowModal(true)
|
||||
}
|
||||
let deletUploadFile = () => {
|
||||
accountHomeData.fileList = []
|
||||
// let index = -1
|
||||
// this.fileList.forEach((ele:any,index1:any) => {
|
||||
// if(this.cropperFileData.uid === ele.uid){
|
||||
// index = index1
|
||||
// }
|
||||
// });
|
||||
// if(index > -1){
|
||||
// this.fileList.splice(index, 1)
|
||||
// }
|
||||
}
|
||||
return{
|
||||
...toRefs(accountHomeData),
|
||||
Cropper,
|
||||
handleCropperSuccess,
|
||||
beforeUpload,
|
||||
fileUploadChange,
|
||||
deletUploadFile,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.accountEdit_page{
|
||||
padding: 8rem 5rem;
|
||||
.accountEdit_page_head{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20rem;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
img{
|
||||
width: 20rem;
|
||||
height: 20rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.accountEdit_page_head_upload{
|
||||
width: auto;
|
||||
}
|
||||
.upload_item{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
margin-bottom: 5rem;
|
||||
}
|
||||
.accountEdit_page_body{
|
||||
.accountEdit_page_body_item{
|
||||
display: flex;
|
||||
margin-bottom: 5rem;
|
||||
width: 100%;
|
||||
.started_btn{
|
||||
text-align: center;
|
||||
}
|
||||
input,textarea{
|
||||
padding-left: 2rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dcdfe6;
|
||||
width: 100%;
|
||||
}
|
||||
.accountEdit_page_body_item_name{
|
||||
color: #606266;
|
||||
width: 14rem;
|
||||
text-align: right;
|
||||
}
|
||||
.accountEdit_page_body_item_inut{
|
||||
margin-left: 2rem;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.accountEdit_page_body_item:last-child{
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
84
src/component/Account/accountFollowFans.vue
Normal file
84
src/component/Account/accountFollowFans.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="account_message">
|
||||
<div class="account_message_title modal_title_text">
|
||||
<div class="">
|
||||
消息中心
|
||||
</div>
|
||||
<div class="account_message_title_setting">设置</div>
|
||||
</div>
|
||||
<a-tabs class="account_message_body" v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="系统消息">Content of Tab Pane 1</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="私信" force-render>Content of Tab Pane 2</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="评论">Content of Tab Pane 3</a-tab-pane>
|
||||
<a-tab-pane key="4" tab="点赞">Content of Tab Pane 3</a-tab-pane>
|
||||
<a-tab-pane key="5" tab="客服">Content of Tab Pane 3</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountMessage = reactive({
|
||||
activeKey: ref('1'),
|
||||
})
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let setUserData = ()=>{
|
||||
router.push({path:'/home/account/accountEdit'})
|
||||
}
|
||||
return{
|
||||
...toRefs(accountMessage),
|
||||
setUserData,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_message{
|
||||
width: 100%;
|
||||
.account_message_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
.account_message_title_setting{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.account_message_body{
|
||||
padding: 0rem 5rem;
|
||||
:deep(.ant-tabs-nav){
|
||||
.ant-tabs-nav-wrap{
|
||||
.ant-tabs-tab-active{
|
||||
.ant-tabs-tab-btn{
|
||||
color: #39215b;
|
||||
font-weight: 900;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-tabs-tab:hover{
|
||||
color: #39215b;
|
||||
}
|
||||
.ant-tabs-ink-bar{
|
||||
background: #39215b;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
213
src/component/Account/accountHome.vue
Normal file
213
src/component/Account/accountHome.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<div class="account_home">
|
||||
<div class="account_home_content">
|
||||
<div class="content_item content_item_user">
|
||||
<div class="content_item_user_left">
|
||||
<div class="content_item_user_left_detail">
|
||||
<img src="../../assets/images/homePage/alipay.svg" alt="">
|
||||
</div>
|
||||
<div class="content_item_user_left_detail">
|
||||
<div class="modal_title_text">
|
||||
<div>用户名</div>
|
||||
<div class="modal_title_text_intro">个性签名</div>
|
||||
<div class="modal_title_text_assistant">Credits: 2222</div>
|
||||
</div>
|
||||
<div class="content_item_user_left_detail_bottom">
|
||||
<div>
|
||||
<span>关注:</span>22
|
||||
</div>
|
||||
<div>
|
||||
<span>粉丝:</span>22
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_item_user_right">
|
||||
<div @click="setUserData">修改资料</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_item content_item_task">
|
||||
<div class="content_item_title">
|
||||
<i>icon</i>
|
||||
<div>每日奖励</div>
|
||||
</div>
|
||||
<div class="content_item_task_max">
|
||||
<div class="content_item_task_item">
|
||||
<div class="content_item_task_item_state">
|
||||
<div class="state_credits">20 Credits</div>
|
||||
<i class="fi fi-br-check"></i>
|
||||
</div>
|
||||
<div class="content_item_task_item_title">
|
||||
每日点赞
|
||||
</div>
|
||||
<div class="content_item_task_item_award">
|
||||
已完成 0 / 10
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_item_task_item active">
|
||||
<div class="content_item_task_item_state">
|
||||
<div class="state_credits">20 Credits</div>
|
||||
<i class="fi fi-br-check"></i>
|
||||
</div>
|
||||
<div class="content_item_task_item_title">
|
||||
每日发布作品
|
||||
</div>
|
||||
<div class="content_item_task_item_award">
|
||||
20 Credits 到手
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountHomeData = reactive({
|
||||
})
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let setUserData = ()=>{
|
||||
router.push({path:'/home/account/accountEdit'})
|
||||
}
|
||||
return{
|
||||
...toRefs(accountHomeData),
|
||||
setUserData,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_home{
|
||||
width: 100%;
|
||||
.account_home_content{
|
||||
.content_item{
|
||||
padding: 8rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
.content_item_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
i{
|
||||
margin-right: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content_item:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.content_item_user{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.content_item_user_left{
|
||||
display: flex;
|
||||
.content_item_user_left_detail{
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 10rem;
|
||||
height: 10rem
|
||||
}
|
||||
.content_item_user_left_detail_bottom{
|
||||
display: flex;
|
||||
font-size: 1.8rem;
|
||||
>div{
|
||||
font-weight: 900;
|
||||
width: 10rem;
|
||||
span{
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,.45);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.content_item_user_left_detail:last-child{
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
.content_item_user_right{
|
||||
border: 1px solid #e9eaec;
|
||||
color: #6f767f;
|
||||
font-size: 1.8rem;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
padding: 0 1rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
.content_item_task{
|
||||
.content_item_task_max{
|
||||
display: flex;
|
||||
margin-top: 4rem;
|
||||
}
|
||||
.content_item_task_item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 25%;
|
||||
.content_item_task_item_state{
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
background: linear-gradient(135deg, #cdacfc 50%, #a46ef0 50%) 00px 0;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.state_credits{
|
||||
font-size: 1.6rem;
|
||||
font-weight: 900;
|
||||
color: #fff;
|
||||
}
|
||||
i{
|
||||
font-size: 3rem;
|
||||
font-weight: 900;
|
||||
display: none;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.content_item_task_item_title{
|
||||
margin: 2rem 0 ;
|
||||
}
|
||||
.content_item_task_item_award{
|
||||
font-size: 1.8rem;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 0 1rem;
|
||||
color: #99a2aa;
|
||||
}
|
||||
&.active{
|
||||
.content_item_task_item_state{
|
||||
background: linear-gradient(135deg, #4ddda8 50%, #3bcd98 50%) 00px 0;
|
||||
.state_credits{
|
||||
display: none;
|
||||
}
|
||||
i{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
.content_item_task_item_award{
|
||||
background: #8a95a8;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
107
src/component/Account/accountMessage.vue
Normal file
107
src/component/Account/accountMessage.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<div class="account_message">
|
||||
<div class="account_message_title modal_title_text">
|
||||
<div class="">
|
||||
消息中心
|
||||
</div>
|
||||
<div class="account_message_title_setting">设置</div>
|
||||
</div>
|
||||
<a-tabs class="account_message_body" v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="系统消息">
|
||||
<system ref="system"></system>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="私信" force-render>
|
||||
<privateChat ref="privateChat"></privateChat>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="评论">Content of Tab Pane 3</a-tab-pane>
|
||||
<a-tab-pane key="4" tab="点赞">Content of Tab Pane 3</a-tab-pane>
|
||||
<a-tab-pane key="6" tab="新增粉丝">
|
||||
<newFollow ref="newFollow"></newFollow>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="5" tab="客服">Content of Tab Pane 3</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import system from '@/component/Account/message/system.vue'
|
||||
import privateChat from '@/component/Account/message/privateChat.vue'
|
||||
import newFollow from '@/component/Account/message/newFollow.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
system,
|
||||
privateChat,
|
||||
newFollow,
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountMessage = reactive({
|
||||
activeKey: ref('1'),
|
||||
})
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let setUserData = ()=>{
|
||||
router.push({path:'/home/account/accountEdit'})
|
||||
}
|
||||
return{
|
||||
...toRefs(accountMessage),
|
||||
setUserData,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_message{
|
||||
width: 100%;
|
||||
.account_message_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
.account_message_title_setting{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.account_message_body{
|
||||
padding: 0rem 5rem;
|
||||
:deep(.ant-tabs-nav){
|
||||
.ant-tabs-nav-wrap{
|
||||
.ant-tabs-tab-btn{
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
.ant-tabs-tab-btn:active{
|
||||
color: #39215b;
|
||||
}
|
||||
.ant-tabs-tab-active{
|
||||
.ant-tabs-tab-btn{
|
||||
color: #39215b;
|
||||
font-weight: 900;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-tabs-tab:hover{
|
||||
color: #39215b;
|
||||
}
|
||||
.ant-tabs-ink-bar{
|
||||
background: #39215b;
|
||||
}
|
||||
}
|
||||
:deep(.ant-tabs-content){
|
||||
min-height: 80rem;
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
104
src/component/Account/message/newFollow.vue
Normal file
104
src/component/Account/message/newFollow.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div class="account_systemMessage">
|
||||
<div class="account_systemMessage_title modal_title_text">
|
||||
系统消息
|
||||
</div>
|
||||
<div class="account_systemMessage_item modal_title_text">
|
||||
<div class="account_systemMessage_item_title">
|
||||
<div>Open Call for International Young Fashion Talent</div>
|
||||
<div class="modal_title_text_intro">31 Aug 2024</div>
|
||||
</div>
|
||||
<div class="modal_title_text_intro">
|
||||
10 selected young fashion talent will be mentored by the AiDA development team to learn and explore the possibilities of AiDA. Each selected young fashion talent will create a 4-outfit collection themed “Culture” with AiDA. They will receive full technical support and subsidies for the associated production fee. Selected International/ Mainland young talent will also be able to attend the Culture X AI Internation Fashion Show in Hong Kong that is scheduled on 11 March 2025.
|
||||
<span class="account_systemMessage_item_link">网页链接</span>
|
||||
</div>
|
||||
</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountMessage = reactive({
|
||||
activeKey: ref('1'),
|
||||
})
|
||||
// let ws = new WebSocket('ws://127.0.0.1:3000')
|
||||
// console.log(ws);
|
||||
|
||||
// ws.onopen = ()=>{
|
||||
// console.log(222);
|
||||
// let data = {
|
||||
// cmd:4,
|
||||
// data:{
|
||||
// msg:'222'
|
||||
// }
|
||||
// }
|
||||
// ws.send(JSON.stringify(data))
|
||||
// // ws.onmessage = (data)=>{
|
||||
// // console.log(data);
|
||||
// // }
|
||||
// }
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
|
||||
onMounted (()=>{
|
||||
})
|
||||
return{
|
||||
...toRefs(accountMessage),
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_systemMessage{
|
||||
width: 100%;
|
||||
.account_systemMessage_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
.account_systemMessage_title_setting{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.account_systemMessage_item{
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
padding: 5rem 5rem;
|
||||
.account_systemMessage_item_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem;
|
||||
.modal_title_text_intro{
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
.account_systemMessage_item_link{
|
||||
color: #39215b;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
438
src/component/Account/message/privateChat.vue
Normal file
438
src/component/Account/message/privateChat.vue
Normal file
@@ -0,0 +1,438 @@
|
||||
<template>
|
||||
<div class="account_privateChatMessage">
|
||||
<div class="account_privateChatMessage_title modal_title_text">
|
||||
私信
|
||||
</div>
|
||||
<div class="account_privateChatMessage_content">
|
||||
<div class="content_left">
|
||||
<div class="content_left_item" v-for="item,index in privateChatList" :class="{active:item.active}" @click.stop="openPrivateChat(item,index)">
|
||||
<div class="content_left_item_btn" @click.stop="deletePrivateChat(item,index)">
|
||||
<i class="fi fi-rr-cross-small"></i>
|
||||
</div>
|
||||
<!-- <img :src="item.img" alt=""> -->
|
||||
<img src="../../../assets/images/homePage/alipay.svg" alt="">
|
||||
<div class="modal_title_text">
|
||||
<div class="modal_title_text_assistant" :title="item.title">{{item.title}}</div>
|
||||
<div class="modal_title_text_intro" :title="item.intro">{{item.intro}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_right" v-if="currentPrivateChat >= 0">
|
||||
<div class="content_right_top">
|
||||
<div class="modal_title_text">
|
||||
<div class="">{{ privateChat[currentPrivateChat]?.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_right_record">
|
||||
<div class="content_right_record_item" v-for="item in privateChat[currentPrivateChat]?.messageList">
|
||||
<div v-if="item.type == 'time'" class="content_right_record_item_time">
|
||||
{{ item.data }}
|
||||
</div>
|
||||
<div v-else class="content_right_record_item_content" :class="{active:item.type == 'user'}">
|
||||
<div class="content_right_record_item_HeadImg">
|
||||
<img src="../../../assets/images/homePage/alipay.svg" alt="">
|
||||
</div>
|
||||
<div class="content_right_record_item_text">
|
||||
{{ item.data }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_right_send">
|
||||
<div class="content_right_operation">
|
||||
<div>icon</div>
|
||||
<div>icon</div>
|
||||
<div>icon</div>
|
||||
</div>
|
||||
<div class="content_right_input">
|
||||
<textarea ref="textarea" v-if="privateChat[currentPrivateChat]?.title" v-model="privateChat[currentPrivateChat].temporary"></textarea>
|
||||
</div>
|
||||
<div class="content_right_btn modal_title_text">
|
||||
<div class="content_right_btn_astrict modal_title_text_intro">
|
||||
<span :style="{color:privateChat[currentPrivateChat]?.temporary.length>500?'red':''}">
|
||||
{{privateChat[currentPrivateChat]?.temporary.length}}
|
||||
</span>
|
||||
/500</div>
|
||||
<div class="content_right_btn_send started_btn" @click="sendCli">发送</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mark_loading" v-show="loadingShow">
|
||||
<a-spin size="large" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_right content_right_null" v-else>
|
||||
您还未选中或者发起聊天,快去跟好友聊一聊吧
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountPrivateChat:any = reactive({
|
||||
activeKey: ref('1'),
|
||||
privateChatList:[
|
||||
{
|
||||
title:'AI Fashion Designer1',
|
||||
intro:'333',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
active:false,
|
||||
id:1,
|
||||
},
|
||||
{
|
||||
title:'AI Fashion Designer2',
|
||||
intro:'222',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
active:false,
|
||||
id:2,
|
||||
},
|
||||
{
|
||||
title:'AI Fashion Designer3',
|
||||
intro:'111',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
active:false,
|
||||
id:3,
|
||||
}
|
||||
],
|
||||
currentPrivateChat:-1,
|
||||
privateChat:{
|
||||
1:{
|
||||
title:'ABC',
|
||||
temporary:'',
|
||||
messageList:[
|
||||
{
|
||||
type:'time',
|
||||
data:'2022-12-12 12:12:12'
|
||||
},{
|
||||
type:'opposite',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'time',
|
||||
data:'2022-12-22 12:12:12'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},{
|
||||
type:'user',
|
||||
img:'../../../assets/images/homePage/alipay.svg',
|
||||
data:'hello,'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
let loadingShow = ref(false)
|
||||
let textarea = ref()
|
||||
// let ws = new WebSocket('ws://127.0.0.1:3000')
|
||||
// console.log(ws);
|
||||
|
||||
// ws.onopen = ()=>{
|
||||
// console.log(222);
|
||||
// let data = {
|
||||
// cmd:4,
|
||||
// data:{
|
||||
// msg:'222'
|
||||
// }
|
||||
// }
|
||||
// ws.send(JSON.stringify(data))
|
||||
// // ws.onmessage = (data)=>{
|
||||
// // console.log(data);
|
||||
// // }
|
||||
// }
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
let openPrivateChat = (data:any,index:number)=>{
|
||||
accountPrivateChat.privateChatList.forEach((item:any)=>{
|
||||
item.active = false
|
||||
})
|
||||
// accountPrivateChat.privateChat
|
||||
accountPrivateChat.currentPrivateChat = data.id
|
||||
data.active = true
|
||||
getPrivateChat(data)
|
||||
}
|
||||
let deletePrivateChat = (data:any,index:number)=>{
|
||||
if(data.active){
|
||||
accountPrivateChat.privateChatList[0].active = true
|
||||
getPrivateChat(data)
|
||||
accountPrivateChat.currentPrivateChat = accountPrivateChat.privateChatList[0].id
|
||||
}
|
||||
accountPrivateChat.privateChatList.splice(index,1)
|
||||
}
|
||||
let getPrivateChat = async (data:any)=>{
|
||||
if(!accountPrivateChat.privateChat[data.id]){
|
||||
loadingShow.value = true
|
||||
await new Promise((resolve:any, reject:any) => {
|
||||
setTimeout(()=>{
|
||||
accountPrivateChat.privateChat[data.id] = JSON.parse(JSON.stringify(accountPrivateChat.privateChat[1]))
|
||||
loadingShow.value = false
|
||||
resolve('')
|
||||
},1000)
|
||||
})
|
||||
// Https.axiosGet(Https.httpUrls.accountBindEmail,{}).then((res:any)=>{
|
||||
// console.log(res);
|
||||
// })
|
||||
}
|
||||
nextTick(()=>{
|
||||
if(textarea.value){
|
||||
textarea.value.focus()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
let sendCli = ()=>{
|
||||
if(accountPrivateChat.privateChat[accountPrivateChat.currentPrivateChat]?.temporary.length>500){
|
||||
return message.info('输入的内容超过最大限制')
|
||||
}
|
||||
}
|
||||
onMounted (()=>{
|
||||
|
||||
})
|
||||
return{
|
||||
...toRefs(accountPrivateChat),
|
||||
loadingShow,
|
||||
textarea,
|
||||
openPrivateChat,
|
||||
deletePrivateChat,
|
||||
sendCli,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_privateChatMessage{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.account_privateChatMessage_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
.account_privateChatMessage_title_setting{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.account_privateChatMessage_content{
|
||||
flex: 1;
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
.content_left{
|
||||
width: 20%;
|
||||
border-right: 1px solid #e9eaec;
|
||||
height: 100%;
|
||||
.content_left_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 2rem;
|
||||
padding-left: 0;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
&.active{
|
||||
background: #e4e5e6;
|
||||
}
|
||||
|
||||
img{
|
||||
width: 6rem;
|
||||
height: 6rem;
|
||||
border-radius: 50%;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
.modal_title_text{
|
||||
width: calc(100% - 6rem - 2rem - 4rem);
|
||||
margin-bottom: 0;
|
||||
div{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
.content_left_item_btn{
|
||||
transform: translateX(-100%);
|
||||
transition: all .3s;
|
||||
i{
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
font-size: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content_left_item:hover{
|
||||
background: #e4e5e6;
|
||||
.content_left_item_btn{
|
||||
transform: translateX(0%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.content_right{
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #f4f5f7;
|
||||
position: relative;
|
||||
.mark_loading{
|
||||
position: absolute;
|
||||
}
|
||||
&.content_right_null{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 3rem;
|
||||
color: #bec9d2;
|
||||
font-weight: 900;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.content_right_top{
|
||||
.modal_title_text{
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
padding: 1.5rem 0
|
||||
}
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
}
|
||||
.content_right_record{
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
max-height: 38.5rem;
|
||||
&.content_right_record::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.content_right_record_item{
|
||||
display: flex;
|
||||
margin: 2rem 0;
|
||||
padding: 0 2rem;
|
||||
.content_right_record_item_time{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.content_right_record_item_content{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: flex-start;
|
||||
.content_right_record_item_HeadImg{
|
||||
img{
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
border-radius: 50%;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
}
|
||||
.content_right_record_item_text{
|
||||
background: #fff;
|
||||
padding: 1rem;
|
||||
transform: translateY(1rem);
|
||||
border-radius: 0 2rem 2rem 2rem;
|
||||
}
|
||||
&.active{
|
||||
flex-direction: row-reverse;
|
||||
.content_right_record_item_HeadImg{
|
||||
margin-left: 2rem;
|
||||
margin-right: 0rem;
|
||||
}
|
||||
.content_right_record_item_text{
|
||||
border-radius: 2rem 0rem 2rem 2rem;
|
||||
background: #39215b;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.content_right_send{
|
||||
border-top: 1px solid #e9eaec;
|
||||
height: 20rem;
|
||||
width: 100%;
|
||||
padding: 1rem 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.content_right_operation{
|
||||
height: 4rem;
|
||||
display: flex;
|
||||
div{
|
||||
margin-right: 1rem;
|
||||
}
|
||||
div:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.content_right_input{
|
||||
flex: 1;
|
||||
textarea{
|
||||
width: 100%;
|
||||
border: none;
|
||||
max-height: 100%;
|
||||
min-height: 100%;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
.content_right_btn{
|
||||
display: flex;
|
||||
margin: 0;
|
||||
margin-left: auto;
|
||||
margin-top: 1rem;
|
||||
.content_right_btn_astrict{
|
||||
margin-right: 2rem;
|
||||
}
|
||||
.content_right_btn_send{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
104
src/component/Account/message/system.vue
Normal file
104
src/component/Account/message/system.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div class="account_systemMessage">
|
||||
<div class="account_systemMessage_title modal_title_text">
|
||||
系统消息
|
||||
</div>
|
||||
<div class="account_systemMessage_item modal_title_text">
|
||||
<div class="account_systemMessage_item_title">
|
||||
<div>Open Call for International Young Fashion Talent</div>
|
||||
<div class="modal_title_text_intro">31 Aug 2024</div>
|
||||
</div>
|
||||
<div class="modal_title_text_intro">
|
||||
10 selected young fashion talent will be mentored by the AiDA development team to learn and explore the possibilities of AiDA. Each selected young fashion talent will create a 4-outfit collection themed “Culture” with AiDA. They will receive full technical support and subsidies for the associated production fee. Selected International/ Mainland young talent will also be able to attend the Culture X AI Internation Fashion Show in Hong Kong that is scheduled on 11 March 2025.
|
||||
<span class="account_systemMessage_item_link">网页链接</span>
|
||||
</div>
|
||||
</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { useStore } from "vuex";
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
export default defineComponent({
|
||||
components:{
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const store = useStore();
|
||||
let accountMessage = reactive({
|
||||
activeKey: ref('1'),
|
||||
})
|
||||
// let ws = new WebSocket('ws://127.0.0.1:3000')
|
||||
// console.log(ws);
|
||||
|
||||
// ws.onopen = ()=>{
|
||||
// console.log(222);
|
||||
// let data = {
|
||||
// cmd:4,
|
||||
// data:{
|
||||
// msg:'222'
|
||||
// }
|
||||
// }
|
||||
// ws.send(JSON.stringify(data))
|
||||
// // ws.onmessage = (data)=>{
|
||||
// // console.log(data);
|
||||
// // }
|
||||
// }
|
||||
// provide('exhibitionList',exhibitionList)
|
||||
|
||||
onMounted (()=>{
|
||||
})
|
||||
return{
|
||||
...toRefs(accountMessage),
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.account_systemMessage{
|
||||
width: 100%;
|
||||
.account_systemMessage_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rem 5rem;
|
||||
border-bottom: 1px solid #e9eaec;
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
.account_systemMessage_title_setting{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.account_systemMessage_item{
|
||||
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
|
||||
border: 1px solid #e9eaec;
|
||||
border-radius: 5px;
|
||||
padding: 5rem 5rem;
|
||||
.account_systemMessage_item_title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem;
|
||||
.modal_title_text_intro{
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
.account_systemMessage_item_link{
|
||||
color: #39215b;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,8 +4,9 @@
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<span>Start Date:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:placeholder="[
|
||||
@@ -22,8 +23,8 @@
|
||||
</a-range-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>End Time:</span>
|
||||
<a-time-range-picker class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
|
||||
<span>Start Time:</span>
|
||||
<a-time-range-picker style="width:280px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -177,24 +178,6 @@ export default defineComponent({
|
||||
];
|
||||
});
|
||||
|
||||
let state:any = ref([
|
||||
{
|
||||
name:'all',
|
||||
value:'',
|
||||
},
|
||||
{
|
||||
name:'unprocessed',
|
||||
value:0,
|
||||
},
|
||||
{
|
||||
name:'pending',
|
||||
value:1,
|
||||
},
|
||||
{
|
||||
name:'rejected',
|
||||
value:2,
|
||||
},
|
||||
])
|
||||
let dataList: any = ref([]);
|
||||
let status: any = ref(0);
|
||||
return {
|
||||
@@ -204,7 +187,6 @@ export default defineComponent({
|
||||
dataList,
|
||||
renameData,
|
||||
status,
|
||||
state,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
<template>
|
||||
<div class="adminEcharts admin_page">
|
||||
<div class="admin_table_search">
|
||||
</div>
|
||||
<div class="allUser_table_content">
|
||||
<div class="allUser_table_content_item">
|
||||
<div>123123123</div>
|
||||
<!-- <div class="allUser_table_content_item_canvas" id="echarts1"></div> -->
|
||||
</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, onMounted } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
|
||||
import * as echarts from "echarts/core";
|
||||
import {
|
||||
TitleComponent,
|
||||
ToolboxComponent,
|
||||
TooltipComponent,
|
||||
GridComponent,
|
||||
LegendComponent,
|
||||
} from "echarts/components";
|
||||
import { LineChart } from "echarts/charts";
|
||||
import { UniversalTransition } from "echarts/features";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
setup() {
|
||||
let rangePickerValue: any = ref([]);
|
||||
let rangeTimeValue: any = ref([]);
|
||||
let renameData: any = ref({}); //修改名字选中的数据
|
||||
|
||||
onMounted(() => {
|
||||
echarts.use([
|
||||
TitleComponent,
|
||||
ToolboxComponent,
|
||||
TooltipComponent,
|
||||
GridComponent,
|
||||
LegendComponent,
|
||||
LineChart,
|
||||
CanvasRenderer,
|
||||
UniversalTransition,
|
||||
]);
|
||||
|
||||
var chartDom = document.getElementById("echarts1");
|
||||
console.log(chartDom);
|
||||
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option = {
|
||||
title: {
|
||||
text: "",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
label: {
|
||||
backgroundColor: "#6a7985",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
data: [
|
||||
"新增用户数量",
|
||||
"活跃用户数量",
|
||||
"参加活动用户数量",
|
||||
"Search Engine",
|
||||
],
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
saveAsImage: {},
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "4%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "新增用户数量",
|
||||
type: "line",
|
||||
stack: "Total",
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
data: [120, 132, 101, 134, 90, 230, 210],
|
||||
},
|
||||
{
|
||||
name: "活跃用户数量",
|
||||
type: "line",
|
||||
stack: "Total",
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
data: [220, 182, 191, 234, 290, 330, 310],
|
||||
},
|
||||
{
|
||||
name: "参加活动用户数量",
|
||||
type: "line",
|
||||
stack: "Total",
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
data: [150, 232, 201, 154, 190, 330, 410],
|
||||
},
|
||||
{
|
||||
name: "Search Engine",
|
||||
type: "line",
|
||||
stack: "Total",
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
},
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
data: [820, 932, 901, 934, 1290, 1330, 1320],
|
||||
},
|
||||
],
|
||||
};
|
||||
// option && myChart.setOption(option);
|
||||
});
|
||||
return {};
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.adminEcharts {
|
||||
.allUser_table_content{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-content: space-between;
|
||||
.allUser_table_content_item{
|
||||
width: 49%;
|
||||
height: 49%;
|
||||
.allUser_table_content_item_canvas{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,159 +1,510 @@
|
||||
<template>
|
||||
<div class="admin_page">
|
||||
<div class="admin_table_search">
|
||||
</div>
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
<div class="admin_state_item">
|
||||
<span>Create Time:</span>
|
||||
<a-range-picker
|
||||
style="width: 250px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
<!-- <div class="admin_state_item">
|
||||
<span>Type:</span>
|
||||
<a-select v-model:value="userType" size="large" style="width:250px" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
|
||||
</div> -->
|
||||
<div class="admin_state_item">
|
||||
<span>Country:</span>
|
||||
<a-select
|
||||
v-model:value="country"
|
||||
:allowClear="true"
|
||||
show-search
|
||||
style="width: 250px"
|
||||
:filter-option="filterOption"
|
||||
placeholder="Select Item..."
|
||||
max-tag-count="responsive"
|
||||
:options="allCountry"
|
||||
></a-select>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>Email:</span>
|
||||
<input
|
||||
v-model="email"
|
||||
placeholder="Please enter email"
|
||||
@keydown.enter="gettrialList"
|
||||
type="text"
|
||||
style="width: 250px"
|
||||
/>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>User Name:</span>
|
||||
<a-select
|
||||
v-model:value="ids"
|
||||
mode="multiple"
|
||||
style="width: 250px"
|
||||
:filter-option="filterOption"
|
||||
placeholder="Select Item..."
|
||||
max-tag-count="responsive"
|
||||
:options="allUserList"
|
||||
@keydown.enter="gettrialList"
|
||||
></a-select>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>User Type:</span>
|
||||
<a-select
|
||||
v-model:value="systemUser"
|
||||
size="large"
|
||||
style="width: 250px"
|
||||
optionFilterProp="label"
|
||||
:options="state"
|
||||
placeholder="Please select"
|
||||
allowClear
|
||||
show-search
|
||||
></a-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">
|
||||
Search
|
||||
</div>
|
||||
<div class="admin_search_item" @click="addhHistoryList">
|
||||
Add
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div
|
||||
class="admin_state_list_item"
|
||||
@click="lastGeTrialList('year')"
|
||||
>
|
||||
Last year
|
||||
</div>
|
||||
<div
|
||||
class="admin_state_list_item"
|
||||
@click="lastGeTrialList('month')"
|
||||
>
|
||||
Last month
|
||||
</div>
|
||||
<div
|
||||
class="admin_state_list_item"
|
||||
@click="lastGeTrialList('week')"
|
||||
>
|
||||
Last week
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="historyTable">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="dataList"
|
||||
:scroll="{ y: historyTableHeight}"
|
||||
@change="changePage"
|
||||
@resizeColumn="handleResizeColumn"
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
current: currentPage,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showQuickJumper: true,
|
||||
bordered: false,
|
||||
}"
|
||||
>
|
||||
<!-- <template
|
||||
#bodyCell="{ column, text, record, index }"
|
||||
>
|
||||
|
||||
</template> -->
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="admin_table_content" ref="historyTable">
|
||||
<a-table
|
||||
@resizeColumn="handleResizeColumn"
|
||||
:loading="tableLoading"
|
||||
:columns="columns"
|
||||
:data-source="dataList"
|
||||
:scroll="{ y: historyTableHeight }"
|
||||
@change="changePage"
|
||||
:showSorterTooltip='false'
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
current: currentPage,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showQuickJumper: true,
|
||||
bordered: false,
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, text, record, index }">
|
||||
<div class="operate_list" v-if="column?.Operations">
|
||||
<div
|
||||
class="operate_item"
|
||||
@click="setAagree(record)"
|
||||
>
|
||||
Edit
|
||||
</div>
|
||||
<!-- <div
|
||||
class="operate_item"
|
||||
@click="deleteGroup(record, index)"
|
||||
>
|
||||
Delete
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<allUserPoerationsVue ref="allUserPoerationsVue" @searchHistoryList="searchHistoryList"></allUserPoerationsVue>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed } from "vue";
|
||||
import {
|
||||
defineComponent,
|
||||
ref,
|
||||
createVNode,
|
||||
computed,
|
||||
reactive,
|
||||
toRefs,
|
||||
onMounted,
|
||||
} from "vue";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import { Https } from "@/tool/https";
|
||||
import type { TableColumnsType } from 'ant-design-vue';
|
||||
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import allUserPoerationsVue from "./allUserPoerations.vue";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
components: {allUserPoerationsVue,},
|
||||
setup() {
|
||||
let filter: any = reactive({
|
||||
dataList: [],
|
||||
tableLoading: false,
|
||||
allUserList: [],
|
||||
allCountry:[]
|
||||
});
|
||||
let filterData: any = reactive({
|
||||
rangePickerValue: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
country: "",
|
||||
email: "",
|
||||
userType: "",
|
||||
ids: [],
|
||||
occupation: "",
|
||||
systemUser: "",
|
||||
order: "", //'Ascending 升序 Descending 降序'
|
||||
orderBy:'',
|
||||
userName: "",
|
||||
});
|
||||
let state: any = ref([
|
||||
{
|
||||
label: "all",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "visitor",
|
||||
value: "1",
|
||||
},
|
||||
{
|
||||
label: "trial",
|
||||
value: "2",
|
||||
},
|
||||
{
|
||||
label: "official",
|
||||
value: "3",
|
||||
},
|
||||
{
|
||||
label: "userInEvent",
|
||||
value: "4",
|
||||
},
|
||||
]);
|
||||
let renameData: any = ref({}); //修改名字选中的数据
|
||||
const columns: any = ref<TableColumnsType>([
|
||||
const columns: any = computed(() => {
|
||||
return [
|
||||
{
|
||||
title: 'Email',
|
||||
title: "User Id",
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 50,
|
||||
|
||||
dataIndex: "email",
|
||||
key: "email",
|
||||
},
|
||||
{
|
||||
title: 'User Id',
|
||||
align: "center",
|
||||
width: 50,
|
||||
|
||||
dataIndex: "id",
|
||||
key: "id",
|
||||
},
|
||||
{
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 50,
|
||||
|
||||
dataIndex: "userName",
|
||||
key: "userName",
|
||||
},
|
||||
{
|
||||
title: 'Given Name',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 50,
|
||||
|
||||
dataIndex: "givenName",
|
||||
key: "givenName",
|
||||
width:100,
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: 'Create Time',
|
||||
title: "Email",
|
||||
align: "center",
|
||||
width: 50,
|
||||
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
dataIndex: "userEmail",
|
||||
key: "userEmail",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: 'Title',
|
||||
{
|
||||
title: "User Name",
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 50,
|
||||
//
|
||||
dataIndex: "title",
|
||||
key: "title",
|
||||
dataIndex: "userName",
|
||||
key: "userName",
|
||||
width:150,
|
||||
ellipsis:true
|
||||
// customRender: (record: any) => {
|
||||
// let time = formatTime(
|
||||
// record.text / 1000,
|
||||
// "YYYY-MM-DD hh:mm:ss"
|
||||
// );
|
||||
// return time;
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: 'Country',
|
||||
{
|
||||
title: "language",
|
||||
align: "center",
|
||||
dataIndex: "language",
|
||||
key: "language",
|
||||
width:100,
|
||||
ellipsis:true,
|
||||
},
|
||||
{
|
||||
title: "Valid Start Time",
|
||||
align: "center",
|
||||
dataIndex: "validstartTime",
|
||||
key: "validstartTime",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: "Valid End Time",
|
||||
align: "center",
|
||||
dataIndex: "validendTime",
|
||||
key: "validendTime",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: "Country",
|
||||
align: "center",
|
||||
width: 50,
|
||||
ellipsis: true,
|
||||
dataIndex: "country",
|
||||
key: "country",
|
||||
width:100,
|
||||
},
|
||||
|
||||
]
|
||||
);
|
||||
let dataList: any = ref([]);
|
||||
let userInfo: any = {};
|
||||
{
|
||||
title: "Create Date",
|
||||
align: "center",
|
||||
dataIndex: "createDate",
|
||||
key: "createDate",
|
||||
width:200,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Is Beginner",
|
||||
align: "center",
|
||||
dataIndex: "isBeginner",
|
||||
key: "isBeginner",
|
||||
width:80,
|
||||
ellipsis:true,
|
||||
customRender: (record: any) => {
|
||||
let str;
|
||||
if (record.value == 1) {
|
||||
str = "Yes";
|
||||
} else {
|
||||
str = "No";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Machine Room Ip',
|
||||
align: "center",
|
||||
dataIndex: "browserIdentifiers",
|
||||
key: "browserIdentifiers",
|
||||
width:200,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Credits",
|
||||
align: "center",
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "credits",
|
||||
key: "credits",
|
||||
width:100,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: 'User Type',
|
||||
align: "center",
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "systemUser",
|
||||
key: "systemUser",
|
||||
width:100,
|
||||
customRender: (record: any) => {
|
||||
let str;
|
||||
if (record.value == 0) {
|
||||
str = "visitor";
|
||||
} else if (record.value == 1) {
|
||||
str = "yearly";
|
||||
} else if (record.value == 2) {
|
||||
str = "monthly";
|
||||
} else if (record.value == 3) {
|
||||
str = "trial";
|
||||
} else if (record.value == 4) {
|
||||
str = "userInEvent";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Operations",
|
||||
key: "operation",
|
||||
width:120,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
// slots:{customRender:'action'}
|
||||
Operations: true,
|
||||
},
|
||||
];
|
||||
});
|
||||
//改变页码
|
||||
let changePage = (e: any, filters, sorter) => {
|
||||
filterData.currentPage = e.current;
|
||||
filterData.pageSize = e.pageSize;
|
||||
if(sorter.order){
|
||||
if(sorter.columnKey == 'id'){
|
||||
filterData.orderBy = 'id'
|
||||
}else if(sorter.columnKey == "createDate"){
|
||||
filterData.orderBy = 'time'
|
||||
}else if(sorter.columnKey == "credits"){
|
||||
filterData.orderBy = 'credits'
|
||||
}
|
||||
}
|
||||
filterData.order = sorter.order == "descend" ? "Descending" : "Ascending";
|
||||
|
||||
gettrialList();
|
||||
};
|
||||
|
||||
//查询列表
|
||||
let searchHistoryList = () => {
|
||||
filterData.currentPage = 1;
|
||||
gettrialList();
|
||||
};
|
||||
let clearHistoryList = () => {
|
||||
filterData.rangePickerValue = [],
|
||||
filterData.currentPage = 1,
|
||||
filterData.pageSize = 10,
|
||||
filterData.total = 0,
|
||||
filterData.country = "",
|
||||
filterData.email = "",
|
||||
filterData.userType = "",
|
||||
filterData.ids = [],
|
||||
filterData.occupation = "",
|
||||
filterData.order = "", //'Ascending 升序 Descending 降序'
|
||||
filterData.orderBy = "", //'Ascending 升序 Descending 降序'
|
||||
filterData.systemUser = "",
|
||||
filterData.userName = "";
|
||||
};
|
||||
let setHistoryListData = () => {
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0] + " " + "00:00:00"
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1] + " " + "00:00:00"
|
||||
: "";
|
||||
let data = {
|
||||
endTime: endDate,
|
||||
startTime: startDate,
|
||||
size: filterData.pageSize,
|
||||
page: filterData.currentPage,
|
||||
systemUser: filterData.systemUser,
|
||||
country: filterData.country,
|
||||
email: filterData.email,
|
||||
userType: filterData.userType,
|
||||
ids: filterData.ids,
|
||||
occupation: filterData.occupation,
|
||||
order: filterData.order,
|
||||
orderBy: filterData.orderBy,
|
||||
userName: filterData.userName,
|
||||
};
|
||||
return data;
|
||||
};
|
||||
//获取列表
|
||||
let gettrialList = () => {
|
||||
filter.tableLoading = true;
|
||||
let data = setHistoryListData();
|
||||
Https.axiosPost(Https.httpUrls.getUserInfo, data).then(
|
||||
(rv: any) => {
|
||||
if (rv) {
|
||||
// this.dataList = rv
|
||||
filter.dataList = rv.records;
|
||||
filterData.total = rv.total;
|
||||
filter.tableLoading = false;
|
||||
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
let lastGeTrialList = (str: string) => {
|
||||
clearHistoryList();
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp;
|
||||
if (str == "year") {
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - 360 * 24 * 60 * 60;
|
||||
} else if (str == "month") {
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - 30 * 24 * 60 * 60;
|
||||
} else if (str == "week") {
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - 7 * 24 * 60 * 60;
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(
|
||||
thirtyDaysAgoTimestamp,
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
gettrialList();
|
||||
};
|
||||
let filterOption = (input: any, option: any) => {
|
||||
// 使用 option.label 进行搜索
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
let addhHistoryList = () => {
|
||||
allUserPoerationsVue.value.init('Add','')
|
||||
};
|
||||
let allUserPoerationsVue = ref()
|
||||
let setAagree = (data:any) =>{
|
||||
allUserPoerationsVue.value.init('Edit',data)
|
||||
}
|
||||
onMounted(() => {
|
||||
let allUserList: any = sessionStorage.getItem("allUserList");
|
||||
if (allUserList) {
|
||||
filter.allUserList = JSON.parse(allUserList);
|
||||
}
|
||||
let allCountry: any = sessionStorage.getItem("allCountry");
|
||||
if (allCountry) {
|
||||
filter.allCountry = JSON.parse(allCountry);
|
||||
}
|
||||
gettrialList();
|
||||
});
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
state,
|
||||
columns,
|
||||
dataList,
|
||||
renameData,
|
||||
userInfo,
|
||||
handleResizeColumn: (w:any, col:any) => {
|
||||
col.width = w;
|
||||
},
|
||||
changePage,
|
||||
searchHistoryList,
|
||||
addhHistoryList,
|
||||
lastGeTrialList,
|
||||
gettrialList,
|
||||
filterOption,
|
||||
allUserPoerationsVue,
|
||||
setAagree,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
historyTableHeight: 0,
|
||||
newCollectionName: "",
|
||||
renameVisivle: false, //修改名字弹窗
|
||||
collectionName: "", //选中的名字
|
||||
searchCollectionName: "",
|
||||
handleResizeColumn: (w: any, col: any) => {
|
||||
col.width = w;
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let historyTable: any = this.$refs.historyTable;
|
||||
this.historyTableHeight = historyTable.clientHeight - 200;
|
||||
this.gettrialList();
|
||||
let userInfo:any = getCookie("userInfo")
|
||||
this.userInfo = JSON.parse(userInfo);
|
||||
},
|
||||
methods: {
|
||||
//改变页码
|
||||
changePage(e: any) {
|
||||
this.currentPage = e.current;
|
||||
this.pageSize = e.pageSize;
|
||||
// this.gettrialList();
|
||||
},
|
||||
//查询列表
|
||||
searchHistoryList() {
|
||||
this.currentPage = 1;
|
||||
this.gettrialList();
|
||||
},
|
||||
|
||||
//获取列表
|
||||
gettrialList() {
|
||||
Https.axiosGet(Https.httpUrls.inquiryGetTrial).then((rv)=>{
|
||||
this.dataList = rv
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.admin_page .admin_table_search .admin_state {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
302
src/component/Administrator/allUserPoerations.vue
Normal file
302
src/component/Administrator/allUserPoerations.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<a-modal
|
||||
class="allUserPoeration_modal generalModel"
|
||||
v-model:visible="operationsModal"
|
||||
:footer="null"
|
||||
width="50%"
|
||||
:maskClosable="false"
|
||||
:centered="true"
|
||||
:closable="false"
|
||||
:mask="false"
|
||||
wrapClassName="#app"
|
||||
:keyboard="false"
|
||||
>
|
||||
<div class="generalModel_btn">
|
||||
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
|
||||
<i class="fi fi-rr-cross-small"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal_title_text">
|
||||
<div>{{ title }} User</div>
|
||||
</div>
|
||||
<div class="allUserPoeration_center admin_page">
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">User Name:</span>
|
||||
<input
|
||||
:readonly="title != 'Add'"
|
||||
:class="{active:title != 'Add'}"
|
||||
v-model="userName"
|
||||
placeholder="Please enter user name"
|
||||
type="text"
|
||||
style="width: 250px"
|
||||
/>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">User Email:</span>
|
||||
<input
|
||||
:readonly="title != 'Add'"
|
||||
:class="{active:title != 'Add'}"
|
||||
v-model="userEmail"
|
||||
placeholder="Please enter email"
|
||||
type="text"
|
||||
style="width: 250px"
|
||||
/>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">Create Time:</span>
|
||||
<a-date-picker :disabled="title != 'Add'" style="width: 250px" valueFormat="YYYY-MM-DDTHH:mm:ss" class="range_picker" show-time placeholder="Create Time" v-model:value="validStartTime">
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">End Time:</span>
|
||||
<a-date-picker style="width: 250px" valueFormat="YYYY-MM-DDTHH:mm:ss" class="range_picker" show-time placeholder="End Time" v-model:value="validEndTime">
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">User Type:</span>
|
||||
<a-select
|
||||
v-model:value="systemUser"
|
||||
size="large"
|
||||
style="width: 250px"
|
||||
optionFilterProp="label"
|
||||
:options="state"
|
||||
placeholder="Please select"
|
||||
allowClear
|
||||
show-search
|
||||
></a-select>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">Credits:</span>
|
||||
<input
|
||||
v-model="credits"
|
||||
placeholder="Please enter credits"
|
||||
type="text"
|
||||
style="width: 250px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span style="width: 100px;">Country:</span>
|
||||
<input
|
||||
:readonly="title != 'Add'"
|
||||
:class="{active:title != 'Add'}"
|
||||
v-model="country"
|
||||
placeholder="Please enter country"
|
||||
type="text"
|
||||
style="width: 250px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="allUserPoeration_btn admin_page">
|
||||
<div class="admin_search_item" @click="cancelDsign">
|
||||
Close
|
||||
</div>
|
||||
<div class="admin_search_item" @click="setOk">
|
||||
OK
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<div class="mark_loading" v-show="loadingShow">
|
||||
<a-spin size="large" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { defineComponent, ref, reactive, watch, onMounted, nextTick, toRefs } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { setCookie, getCookie } from "@/tool/cookie";
|
||||
import { Modal, message } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import allOrder from "@/component/Pay/allOrder.vue";
|
||||
import creditsDetail from "@/component/Pay/creditsDetail.vue";
|
||||
import { exportSele,JSRectUpdata,JSchangeType,JScanvasMouseDown,JSSetRemoveImage,JScreateCheck,JSSetTexture } from "@/tool/canvasDrawing";
|
||||
import { useI18n } from "vue-i18n";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
creditsDetail,
|
||||
allOrder,
|
||||
},
|
||||
emits: ['searchHistoryList'],
|
||||
setup(props,{emit}) {
|
||||
let operations = reactive({
|
||||
operationsModal:false,
|
||||
operationsEdit:false,
|
||||
loadingShow:false,
|
||||
title:''
|
||||
})
|
||||
let operationsData = reactive({
|
||||
accountId:-1,
|
||||
userName:'',
|
||||
userEmail:'',
|
||||
validStartTime:'',
|
||||
validEndTime:'',
|
||||
systemUser:'',
|
||||
credits:'',
|
||||
country:'',
|
||||
})
|
||||
let state = ref([
|
||||
{
|
||||
label:'visitor',
|
||||
value:'0',
|
||||
},
|
||||
{
|
||||
label:'yearly',
|
||||
value:'1',
|
||||
},
|
||||
{
|
||||
label:'monthly',
|
||||
value:'2',
|
||||
},
|
||||
{
|
||||
label:'trial',
|
||||
value:'3',
|
||||
},
|
||||
]);
|
||||
let init = (funStr,data)=>{
|
||||
operations.operationsModal = true
|
||||
operations.operationsEdit = true
|
||||
operations.title = funStr
|
||||
if(funStr == 'Add') operations.operationsEdit = false
|
||||
if(funStr == 'Edit'){
|
||||
let startTime = data.validStartTime?formatTime(data.validStartTime / 1000,"YYYY-MM-DDThh:mm:ss"):''
|
||||
let endTime = data.validEndTime?formatTime(data.validEndTime / 1000,"YYYY-MM-DDThh:mm:ss"):''
|
||||
operationsData.accountId=data.id
|
||||
operationsData.userName=data.userName
|
||||
operationsData.userEmail=data.userEmail
|
||||
// operationsData.validStartTime='2024-08-05T00:00:06'
|
||||
// operationsData.validEndTime='2024-08-05T00:00:06'
|
||||
operationsData.validStartTime=startTime
|
||||
operationsData.validEndTime=endTime
|
||||
operationsData.systemUser=String(data.systemUser)
|
||||
operationsData.credits=data.credits
|
||||
operationsData.country=data.country
|
||||
// operationsData.accountId = data.accountId
|
||||
// operationsData.userName = data.userName
|
||||
// operationsData.userEmail = data.userEmail
|
||||
// operationsData.validStartTime = formatTime(data.validStartTime)
|
||||
// operationsData.validEndTime = formatTime(data.validEndTime)
|
||||
}
|
||||
|
||||
}
|
||||
let setTime = (time) =>{
|
||||
const date = new Date(time);
|
||||
const timestamp = date.getTime(); // 转换为秒数
|
||||
return timestamp
|
||||
}
|
||||
let setAddData = ()=>{
|
||||
setTime(operationsData.validStartTime)
|
||||
return {
|
||||
"country": operationsData.country,
|
||||
"credits": operationsData.credits,
|
||||
"systemUser": operationsData.systemUser,
|
||||
"userEmail": operationsData.userEmail,
|
||||
"userName": operationsData.userName,
|
||||
"validEndTime": setTime(operationsData.validEndTime),
|
||||
"validStartTime": setTime(operationsData.validStartTime)
|
||||
}
|
||||
}
|
||||
let setEditData = ()=>{
|
||||
return {
|
||||
"accountId": operationsData.accountId,
|
||||
"credits": operationsData.credits,
|
||||
"systemUser": operationsData.systemUser,
|
||||
"validEndTime": setTime(operationsData.validEndTime),
|
||||
}
|
||||
}
|
||||
let cancelDsign = ()=>{
|
||||
operationsData.accountId=-1
|
||||
operationsData.userName=''
|
||||
operationsData.userEmail=''
|
||||
operationsData.validStartTime=''
|
||||
operationsData.validEndTime=''
|
||||
operationsData.systemUser=''
|
||||
operationsData.credits=''
|
||||
operationsData.country=''
|
||||
operations.operationsModal = false
|
||||
}
|
||||
let setOk = ()=>{
|
||||
let data
|
||||
if(operations.title == 'Add'){
|
||||
data = setAddData()
|
||||
Https.axiosPost(Https.httpUrls.adminAddUser, data).then(
|
||||
(rv) => {
|
||||
if (rv) {
|
||||
cancelDsign()
|
||||
emit('searchHistoryList')
|
||||
}
|
||||
}
|
||||
);
|
||||
}else{
|
||||
data = setEditData()
|
||||
Https.axiosPost(Https.httpUrls.modifyUser,{},{params:data}).then(
|
||||
(rv) => {
|
||||
if (rv) {
|
||||
cancelDsign()
|
||||
emit('searchHistoryList')
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
return {
|
||||
...toRefs(operations),
|
||||
...toRefs(operationsData),
|
||||
state,
|
||||
cancelDsign,
|
||||
init,
|
||||
setOk,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less">
|
||||
.allUserPoeration_modal{
|
||||
.ant-modal-body{
|
||||
height: auto;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
|
||||
.allUserPoeration_modal {
|
||||
.closeIcon {
|
||||
z-index: 2;
|
||||
}
|
||||
.allUserPoeration_btn{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: auto;
|
||||
justify-content: flex-end;
|
||||
padding: 1rem 0;
|
||||
.admin_search_item{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.allUserPoeration_center{
|
||||
height: 85%;
|
||||
overflow-y: auto
|
||||
}
|
||||
}
|
||||
</style>
|
||||
228
src/component/Administrator/recentActiveChart.vue
Normal file
228
src/component/Administrator/recentActiveChart.vue
Normal file
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div class="recentActiveChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>User:</span>
|
||||
<a-select
|
||||
v-model:value="userIdList"
|
||||
mode="multiple"
|
||||
style="width: 280px"
|
||||
:filter-option="filterOption"
|
||||
placeholder="Select Item..."
|
||||
max-tag-count="responsive"
|
||||
:options="dataList"
|
||||
></a-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import * as echarts from 'echarts/core';
|
||||
import { TooltipComponent, LegendComponent } from 'echarts/components';
|
||||
import { PieChart } from 'echarts/charts';
|
||||
import { LabelLayout } from 'echarts/features';
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:[],
|
||||
})
|
||||
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
userIdList:[]
|
||||
})
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
gettrialList();
|
||||
}
|
||||
let getUserIDName = ()=>{
|
||||
let allUserList:any = sessionStorage.getItem('allUserList');
|
||||
if(allUserList){
|
||||
filter.dataList = JSON.parse(allUserList)
|
||||
}
|
||||
// Https.axiosGet(Https.httpUrls.getAllUserId,).then((rv: any) => {
|
||||
// if (rv) {
|
||||
// let username = sessionStorage.getItem('allUserList');
|
||||
// sessionStorage.setItem('allUserList',rv);
|
||||
// filter.dataList = rv
|
||||
// }
|
||||
// })
|
||||
}
|
||||
//获取列表
|
||||
let gettrialList = async () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
userIdList:filterData.userIdList.join(','),
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.getActiveUserFunc,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
let data:any = []
|
||||
rv.names.forEach((item:any,index:number) => {
|
||||
let obj = {
|
||||
name : item,
|
||||
value:rv.values[index],
|
||||
}
|
||||
data.push(obj)
|
||||
});
|
||||
setEcharts(data)
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
let myChart:any
|
||||
let setEcharts = (data:any) =>{
|
||||
if (myChart) {
|
||||
myChart.setOption({
|
||||
series: [{
|
||||
data: data
|
||||
}]
|
||||
});
|
||||
}else{
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
PieChart,
|
||||
CanvasRenderer,
|
||||
LabelLayout
|
||||
]);
|
||||
var chartDom = pageChartDom.value;
|
||||
myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
|
||||
itemStyle: {
|
||||
borderRadius: 10
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
stillShowZeroSum:true,
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
let pageChartDom:any = ref()
|
||||
let filterOption = (input:any, option:any)=>{
|
||||
// 使用 option.label 进行搜索
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
}
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
getUserIDName()
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
lastGeTrialList,
|
||||
filterOption,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
303
src/component/Administrator/recentActiveUser.vue
Normal file
303
src/component/Administrator/recentActiveUser.vue
Normal file
@@ -0,0 +1,303 @@
|
||||
<template>
|
||||
<div class="recentActiveChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="historyTable">
|
||||
<a-table
|
||||
@resizeColumn="handleResizeColumn"
|
||||
:loading="tableLoading"
|
||||
:columns="columns"
|
||||
:data-source="dataList"
|
||||
:scroll="{ y: historyTableHeight }"
|
||||
@change="changePage"
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
current: currentPage,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showQuickJumper: true,
|
||||
bordered: false,
|
||||
}"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import { Https } from "@/tool/https";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:[],
|
||||
tableLoading:false,
|
||||
})
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
})
|
||||
let renameData: any = ref({}); //修改名字选中的数据
|
||||
const columns: any = computed(() => {
|
||||
return [
|
||||
{
|
||||
title: "User Id",
|
||||
align: "center",
|
||||
dataIndex: "id",
|
||||
key: "id",
|
||||
width:100,
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Email",
|
||||
align: "center",
|
||||
dataIndex: "userEmail",
|
||||
key: "userEmail",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: "User Name",
|
||||
align: "center",
|
||||
dataIndex: "userName",
|
||||
key: "userName",
|
||||
width:150,
|
||||
ellipsis:true
|
||||
// customRender: (record: any) => {
|
||||
// let time = formatTime(
|
||||
// record.text / 1000,
|
||||
// "YYYY-MM-DD hh:mm:ss"
|
||||
// );
|
||||
// return time;
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: "language",
|
||||
align: "center",
|
||||
dataIndex: "language",
|
||||
key: "language",
|
||||
width:100,
|
||||
ellipsis:true,
|
||||
},
|
||||
{
|
||||
title: "Valid Start Time",
|
||||
align: "center",
|
||||
dataIndex: "validstartTime",
|
||||
key: "validstartTime",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: "Valid End Time",
|
||||
align: "center",
|
||||
dataIndex: "validendTime",
|
||||
key: "validendTime",
|
||||
width:200,
|
||||
ellipsis:true
|
||||
},
|
||||
{
|
||||
title: "Country",
|
||||
align: "center",
|
||||
dataIndex: "country",
|
||||
key: "country",
|
||||
width:100,
|
||||
},
|
||||
{
|
||||
title: "Create Date",
|
||||
align: "center",
|
||||
dataIndex: "createDate",
|
||||
key: "createDate",
|
||||
width:200,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Is Beginner",
|
||||
align: "center",
|
||||
dataIndex: "isBeginner",
|
||||
key: "isBeginner",
|
||||
width:80,
|
||||
ellipsis:true,
|
||||
customRender: (record: any) => {
|
||||
let str;
|
||||
if (record.value == 1) {
|
||||
str = "Yes";
|
||||
} else {
|
||||
str = "No";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Machine Room Ip',
|
||||
align: "center",
|
||||
dataIndex: "browserIdentifiers",
|
||||
key: "browserIdentifiers",
|
||||
width:200,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Credits",
|
||||
align: "center",
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "credits",
|
||||
key: "credits",
|
||||
width:100,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: 'User Type',
|
||||
align: "center",
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "systemUser",
|
||||
key: "systemUser",
|
||||
width:100,
|
||||
customRender: (record: any) => {
|
||||
let str;
|
||||
if (record.value == 0) {
|
||||
str = "visitor";
|
||||
} else if (record.value == 1) {
|
||||
str = "yearly";
|
||||
} else if (record.value == 2) {
|
||||
str = "monthly";
|
||||
} else if (record.value == 3) {
|
||||
str = "trial";
|
||||
} else if (record.value == 4) {
|
||||
str = "userInEvent";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
});
|
||||
//改变页码
|
||||
let changePage = (e: any) => {
|
||||
filterData.currentPage = e.current;
|
||||
filterData.pageSize = e.pageSize;
|
||||
// gettrialList();
|
||||
}
|
||||
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
filterData.currentPage = 1;
|
||||
gettrialList();
|
||||
}
|
||||
|
||||
//获取列表
|
||||
let gettrialList = () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
size:filterData.pageSize,
|
||||
page:filterData.currentPage,
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.recentActiveUser,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
// this.dataList = rv
|
||||
filter.dataList = rv.records
|
||||
console.log(rv);
|
||||
filterData.total = rv.total
|
||||
filter.tableLoading = false
|
||||
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
columns,
|
||||
renameData,
|
||||
changePage,
|
||||
searchHistoryList,
|
||||
lastGeTrialList,
|
||||
gettrialList,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
historyTableHeight: 0,
|
||||
handleResizeColumn: (w:any, col:any) => {
|
||||
col.width = w;
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let historyTable: any = this.$refs.historyTable;
|
||||
this.historyTableHeight = historyTable.clientHeight - 200;
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
196
src/component/Administrator/recentActiveUserChart.vue
Normal file
196
src/component/Administrator/recentActiveUserChart.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<div class="recentActiveChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import * as echarts from 'echarts/core';
|
||||
import { TooltipComponent, LegendComponent } from 'echarts/components';
|
||||
import { PieChart } from 'echarts/charts';
|
||||
import { LabelLayout } from 'echarts/features';
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:{},
|
||||
})
|
||||
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
})
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
gettrialList();
|
||||
}
|
||||
//获取列表
|
||||
let gettrialList = async () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.recentActiveUserChart,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
let data:any = []
|
||||
rv.names.forEach((item:any,index:number) => {
|
||||
let obj = {
|
||||
name : item,
|
||||
value:rv.values[index],
|
||||
}
|
||||
data.push(obj)
|
||||
});
|
||||
filter.dataList = data
|
||||
setEcharts(data)
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
let myChart:any
|
||||
let setEcharts = (data:any) =>{
|
||||
if (myChart) {
|
||||
myChart.setOption({
|
||||
series: [{
|
||||
data: data
|
||||
}]
|
||||
});
|
||||
}else{
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
PieChart,
|
||||
CanvasRenderer,
|
||||
LabelLayout
|
||||
]);
|
||||
var chartDom = pageChartDom.value;
|
||||
myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
|
||||
itemStyle: {
|
||||
borderRadius: 10
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
stillShowZeroSum:true,
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
let pageChartDom:any = ref()
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
lastGeTrialList,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
321
src/component/Administrator/recentNewUser.vue
Normal file
321
src/component/Administrator/recentNewUser.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<div class="recentNewUser admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>Type:</span>
|
||||
<a-select v-model:value="userType" size="large" style="width:280px" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="historyTable">
|
||||
<a-table
|
||||
@resizeColumn="handleResizeColumn"
|
||||
:loading="tableLoading"
|
||||
:columns="columns"
|
||||
:data-source="dataList"
|
||||
:scroll="{ y: historyTableHeight }"
|
||||
@change="changePage"
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
current: currentPage,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showQuickJumper: true,
|
||||
bordered: false,
|
||||
}"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import { Https } from "@/tool/https";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:[],
|
||||
tableLoading:false,
|
||||
})
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
userType:'',
|
||||
})
|
||||
let state:any = ref([
|
||||
{
|
||||
label:'all',
|
||||
value:'',
|
||||
},
|
||||
{
|
||||
label:'visitor',
|
||||
value:'0',
|
||||
},
|
||||
{
|
||||
label:'yearly',
|
||||
value:'1',
|
||||
},
|
||||
{
|
||||
label:'monthly',
|
||||
value:'2',
|
||||
},
|
||||
{
|
||||
label:'trial',
|
||||
value:'3',
|
||||
},
|
||||
])
|
||||
let renameData: any = ref({}); //修改名字选中的数据
|
||||
const columns: any = computed(() => {
|
||||
return [
|
||||
{
|
||||
title: 'User Id',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "id",
|
||||
key: "id",
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
title: 'Email',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "userEmail",
|
||||
key: "userEmail",
|
||||
},
|
||||
{
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
ellipsis: 200,
|
||||
dataIndex: "userName",
|
||||
key: "userName",
|
||||
// customRender: (record: any) => {
|
||||
// let time = formatTime(
|
||||
// record.text / 1000,
|
||||
// "YYYY-MM-DD hh:mm:ss"
|
||||
// );
|
||||
// return time;
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: 'language',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "language",
|
||||
key: "language",
|
||||
},
|
||||
{
|
||||
title: 'Valid Start Time',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "validstartTime",
|
||||
key: "validstartTime",
|
||||
},
|
||||
{
|
||||
title: 'Valid End Time',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "validendTime",
|
||||
key: "validendTime",
|
||||
},
|
||||
{
|
||||
title: 'Country',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "country",
|
||||
key: "country",
|
||||
},
|
||||
{
|
||||
title: 'Create Date',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "createDate",
|
||||
key: "createDate",
|
||||
},
|
||||
{
|
||||
title: 'Is Beginner',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "isBeginner",
|
||||
key: "isBeginner",
|
||||
customRender: (record: any) => {
|
||||
let str
|
||||
if(record.value == 1){
|
||||
str ='Yes'
|
||||
}else{
|
||||
str ='No'
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Machine Room Ip',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
dataIndex: "browserIdentifiers",
|
||||
key: "browserIdentifiers",
|
||||
},
|
||||
{
|
||||
title: 'Credits',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "credits",
|
||||
key: "credits",
|
||||
},
|
||||
{
|
||||
title: 'User Type',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
// width: 150,
|
||||
// minWidth: 100,
|
||||
// maxWidth: 200,
|
||||
// resizable: true,
|
||||
dataIndex: "systemUser",
|
||||
key: "systemUser",
|
||||
customRender: (record: any) => {
|
||||
let str
|
||||
if(record.value == 0){
|
||||
str ='visitor'
|
||||
}else if(record.value == 1){
|
||||
str ='yearly'
|
||||
}else if(record.value == 2){
|
||||
str ='monthly'
|
||||
}else if(record.value == 3){
|
||||
str ='trial'
|
||||
}else if(record.value == 4){
|
||||
str ='userInEvent'
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
});
|
||||
//改变页码
|
||||
let changePage = (e: any) => {
|
||||
filterData.currentPage = e.current;
|
||||
filterData.pageSize = e.pageSize;
|
||||
// gettrialList();
|
||||
}
|
||||
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
filterData.currentPage = 1;
|
||||
gettrialList();
|
||||
}
|
||||
|
||||
//获取列表
|
||||
let gettrialList = () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
size:filterData.pageSize,
|
||||
page:filterData.currentPage,
|
||||
userType:filterData.userType,
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.recentNewUser,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
// this.dataList = rv
|
||||
filter.dataList = rv.records
|
||||
filterData.total = rv.total
|
||||
filter.tableLoading = false
|
||||
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
state,
|
||||
columns,
|
||||
renameData,
|
||||
changePage,
|
||||
searchHistoryList,
|
||||
lastGeTrialList,
|
||||
gettrialList,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
historyTableHeight: 0,
|
||||
handleResizeColumn: (w:any, col:any) => {
|
||||
col.width = w;
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let historyTable: any = this.$refs.historyTable;
|
||||
this.historyTableHeight = historyTable.clientHeight - 200;
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
224
src/component/Administrator/recentNewUserChart.vue
Normal file
224
src/component/Administrator/recentNewUserChart.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div class="recentNewUserChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
<div class="admin_state_item">
|
||||
<span>Type:</span>
|
||||
<a-select v-model:value="userType" size="large" style="width:280px" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import * as echarts from 'echarts/core';
|
||||
import { TooltipComponent, LegendComponent } from 'echarts/components';
|
||||
import { PieChart } from 'echarts/charts';
|
||||
import { LabelLayout } from 'echarts/features';
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:{},
|
||||
})
|
||||
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
userType:''
|
||||
})
|
||||
let state:any = ref([
|
||||
{
|
||||
label:'all',
|
||||
value:'',
|
||||
},
|
||||
{
|
||||
label:'visitor',
|
||||
value:'0',
|
||||
},
|
||||
{
|
||||
label:'yearly',
|
||||
value:'1',
|
||||
},
|
||||
{
|
||||
label:'monthly',
|
||||
value:'2',
|
||||
},
|
||||
{
|
||||
label:'trial',
|
||||
value:'3',
|
||||
},
|
||||
])
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
gettrialList();
|
||||
}
|
||||
//获取列表
|
||||
let gettrialList = async () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
userType:filterData.userType
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.recentNewUserChart,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
let data:any = []
|
||||
rv.names.forEach((item:any,index:number) => {
|
||||
let obj = {
|
||||
name : item,
|
||||
value:rv.values[index],
|
||||
}
|
||||
data.push(obj)
|
||||
});
|
||||
filter.dataList = data
|
||||
setEcharts(data)
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
let myChart:any
|
||||
let setEcharts = (data:any) =>{
|
||||
if (myChart) {
|
||||
myChart.setOption({
|
||||
series: [{
|
||||
data: data
|
||||
}]
|
||||
});
|
||||
}else{
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
PieChart,
|
||||
CanvasRenderer,
|
||||
LabelLayout
|
||||
]);
|
||||
var chartDom = pageChartDom.value;
|
||||
myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
|
||||
itemStyle: {
|
||||
borderRadius: 10
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
stillShowZeroSum:true,
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
let pageChartDom:any = ref()
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
state,
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
lastGeTrialList,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
242
src/component/Administrator/trialAllUser.vue
Normal file
242
src/component/Administrator/trialAllUser.vue
Normal file
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<div class="admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
|
||||
<div class="admin_state_item">
|
||||
<span>State Time:</span>
|
||||
<a-range-picker
|
||||
style="width:280px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:allowClear="false"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="historyTable">
|
||||
<a-table
|
||||
@resizeColumn="handleResizeColumn"
|
||||
:loading="tableLoading"
|
||||
:columns="columns"
|
||||
:data-source="dataList"
|
||||
:scroll="{ y: historyTableHeight }"
|
||||
@change="changePage"
|
||||
:showSorterTooltip='false'
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
current: currentPage,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showQuickJumper: true,
|
||||
bordered: false,
|
||||
}"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounted } from "vue";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import { Https } from "@/tool/https";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup() {
|
||||
let filter:any = reactive({
|
||||
dataList:[],
|
||||
tableLoading:false,
|
||||
})
|
||||
let filterData:any = reactive({
|
||||
rangePickerValue:[],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
order: "", //'Ascending 升序 Descending 降序'
|
||||
orderBy:'',
|
||||
})
|
||||
|
||||
let renameData: any = ref({}); //修改名字选中的数据
|
||||
const columns: any = computed(() => {
|
||||
return [
|
||||
|
||||
{
|
||||
title: 'User Id',
|
||||
align: "center",
|
||||
width: 100,
|
||||
fixed: "left",
|
||||
sorter: true,
|
||||
dataIndex: "id",
|
||||
key: "id",
|
||||
},
|
||||
{
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 150,
|
||||
dataIndex: "userName",
|
||||
key: "userName",
|
||||
},
|
||||
{
|
||||
title: 'Email',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 200,
|
||||
dataIndex: "email",
|
||||
key: "email",
|
||||
},
|
||||
{
|
||||
title: 'Given Name',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
dataIndex: "givenName",
|
||||
key: "givenName",
|
||||
},
|
||||
{
|
||||
title: 'Create Date',
|
||||
align: "center",
|
||||
width: 200,
|
||||
ellipsis:true,
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: 'Title',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
//
|
||||
dataIndex: "title",
|
||||
key: "title",
|
||||
},
|
||||
{
|
||||
title: 'Country',
|
||||
align: "center",
|
||||
width: 100,
|
||||
ellipsis: true,
|
||||
dataIndex: "country",
|
||||
key: "country",
|
||||
},
|
||||
|
||||
];
|
||||
});
|
||||
//改变页码
|
||||
let changePage = (e: any, filters, sorter) => {
|
||||
filterData.currentPage = e.current;
|
||||
filterData.pageSize = e.pageSize;
|
||||
if(sorter.order){
|
||||
if(sorter.columnKey == 'id'){
|
||||
filterData.orderBy = 'id'
|
||||
}else if(sorter.columnKey == "createDate"){
|
||||
filterData.orderBy = 'time'
|
||||
}
|
||||
}
|
||||
filterData.order = sorter.order == "descend" ? "Descending" : "Ascending";
|
||||
gettrialList();
|
||||
}
|
||||
|
||||
//查询列表
|
||||
let searchHistoryList = ()=> {
|
||||
filterData.currentPage = 1;
|
||||
gettrialList();
|
||||
}
|
||||
|
||||
//获取列表
|
||||
let gettrialList = () =>{
|
||||
filter.tableLoading = true
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
size:filterData.pageSize,
|
||||
page:filterData.currentPage,
|
||||
order: filterData.order,
|
||||
orderBy: filterData.orderBy,
|
||||
}
|
||||
Https.axiosPost(Https.httpUrls.inquiryGetTrial,data).then((rv: any) => {
|
||||
if (rv) {
|
||||
// this.dataList = rv
|
||||
filter.dataList = rv.records
|
||||
filterData.total = rv.total
|
||||
filter.tableLoading = false
|
||||
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
})
|
||||
}
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue[0] = formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD')
|
||||
filterData.rangePickerValue[1] = formatTime(currentTimestamp,'YYYY-MM-DD')
|
||||
gettrialList();
|
||||
}
|
||||
onMounted(()=>{
|
||||
lastGeTrialList('month')
|
||||
})
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
columns,
|
||||
renameData,
|
||||
changePage,
|
||||
searchHistoryList,
|
||||
lastGeTrialList,
|
||||
gettrialList,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
historyTableHeight: 0,
|
||||
handleResizeColumn: (w:any, col:any) => {
|
||||
col.width = w;
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let historyTable: any = this.$refs.historyTable;
|
||||
this.historyTableHeight = historyTable.clientHeight - 200;
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -140,7 +140,7 @@ export default defineComponent({
|
||||
key: "surname",
|
||||
},
|
||||
{
|
||||
title: 'Name',
|
||||
title: 'User Name',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
|
||||
@@ -293,3 +293,8 @@ export default defineComponent({
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.admin_page .admin_table_content .operate_list{
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
149
src/component/Administrator/trialUserConversionRateChart.vue
Normal file
149
src/component/Administrator/trialUserConversionRateChart.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="recentNewUserChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {
|
||||
defineComponent,
|
||||
ref,
|
||||
createVNode,
|
||||
computed,
|
||||
reactive,
|
||||
toRefs,
|
||||
onMounted,
|
||||
} from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import * as echarts from "echarts/core";
|
||||
import { TooltipComponent, LegendComponent } from "echarts/components";
|
||||
import { PieChart } from "echarts/charts";
|
||||
import { LabelLayout } from "echarts/features";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
setup() {
|
||||
let filter: any = reactive({
|
||||
dataList: {},
|
||||
});
|
||||
|
||||
let filterData: any = reactive({
|
||||
rangePickerValue: [],
|
||||
});
|
||||
|
||||
//查询列表
|
||||
let searchHistoryList = () => {
|
||||
gettrialList();
|
||||
};
|
||||
//获取列表
|
||||
let gettrialList = async () => {
|
||||
Https.axiosGet(Https.httpUrls.conversionRate).then((rv: any) => {
|
||||
if (rv) {
|
||||
let entries:any = Object.entries(rv);
|
||||
let data: any = [];
|
||||
for (let [key, value] of entries) {
|
||||
if(key != 'conversionRate'){
|
||||
let obj = {
|
||||
name: key,
|
||||
value: value
|
||||
}
|
||||
data.push(obj);
|
||||
}
|
||||
}
|
||||
filter.dataList = data;
|
||||
setEcharts(data);
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
});
|
||||
};
|
||||
let myChart: any;
|
||||
let setEcharts = (data: any) => {
|
||||
if (myChart) {
|
||||
myChart.setOption({
|
||||
series: [
|
||||
{
|
||||
data: data,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
PieChart,
|
||||
CanvasRenderer,
|
||||
LabelLayout,
|
||||
]);
|
||||
var chartDom = pageChartDom.value;
|
||||
myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name:'Rate',
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
|
||||
itemStyle: {
|
||||
borderRadius: 10
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
};
|
||||
|
||||
let pageChartDom: any = ref();
|
||||
onMounted(() => {
|
||||
gettrialList();
|
||||
});
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
152
src/component/Administrator/trialUserCountry.vue
Normal file
152
src/component/Administrator/trialUserCountry.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="recentNewUserChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {
|
||||
defineComponent,
|
||||
ref,
|
||||
createVNode,
|
||||
computed,
|
||||
reactive,
|
||||
toRefs,
|
||||
onMounted,
|
||||
} from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { formatTime } from "@/tool/util";
|
||||
import * as echarts from "echarts/core";
|
||||
import { TooltipComponent, LegendComponent } from "echarts/components";
|
||||
import { PieChart } from "echarts/charts";
|
||||
import { LabelLayout } from "echarts/features";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
setup() {
|
||||
let filter: any = reactive({
|
||||
dataList: {},
|
||||
});
|
||||
|
||||
let filterData: any = reactive({
|
||||
rangePickerValue: [],
|
||||
userType: "",
|
||||
});
|
||||
let state: any = ref([
|
||||
{
|
||||
label: "all",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "visitor",
|
||||
value: "visitor",
|
||||
},
|
||||
{
|
||||
label: "trial",
|
||||
value: "trial",
|
||||
},
|
||||
{
|
||||
label: "official",
|
||||
value: "official",
|
||||
},
|
||||
]);
|
||||
//查询列表
|
||||
let searchHistoryList = () => {
|
||||
gettrialList();
|
||||
};
|
||||
//获取列表
|
||||
let gettrialList = async () => {
|
||||
Https.axiosGet(Https.httpUrls.trialUserCountry).then((rv: any) => {
|
||||
if (rv) {
|
||||
let data: any = [];
|
||||
rv.names.forEach((item: any, index: number) => {
|
||||
let obj = {
|
||||
name: item,
|
||||
value: rv.values[index],
|
||||
};
|
||||
data.push(obj);
|
||||
});
|
||||
filter.dataList = data;
|
||||
setEcharts(data);
|
||||
// this.workspaceItem.position = this.singleTypeList[0].label
|
||||
}
|
||||
});
|
||||
};
|
||||
let myChart: any;
|
||||
let setEcharts = (data: any) => {
|
||||
if (myChart) {
|
||||
myChart.setOption({
|
||||
series: [
|
||||
{
|
||||
data: data,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
PieChart,
|
||||
CanvasRenderer,
|
||||
LabelLayout,
|
||||
]);
|
||||
var chartDom = pageChartDom.value;
|
||||
myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "pie",
|
||||
radius: "55%",
|
||||
center: ["40%", "50%"],
|
||||
data: data,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: "rgba(0, 0, 0, 0.5)",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
};
|
||||
|
||||
let pageChartDom: any = ref();
|
||||
onMounted(() => {
|
||||
gettrialList();
|
||||
});
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
state,
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
@@ -29,8 +29,9 @@
|
||||
:outputSize="option.size"
|
||||
:outputType="option.outputType"
|
||||
:auto-crop="option.autoCrop"
|
||||
:fixedBox="isRound"
|
||||
:auto-crop-width="option.autoCropWidth"
|
||||
:auto-crop-height="option.autoCropHeight"
|
||||
:auto-crop-height="option.autoCropWidth"
|
||||
:center-box="option.centerBox"
|
||||
:can-move="option.canMove" :can-move-box="option.canMoveBox"
|
||||
@real-time="realTime"
|
||||
@@ -51,8 +52,8 @@
|
||||
</div>
|
||||
<div class="cut_picture_review_block">
|
||||
<div class="cut_picture_review_item">
|
||||
<div class="cut_picture_review_content" :style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden'}">
|
||||
<div :style="previews.div" >
|
||||
<div class="cut_picture_review_content" :class="{active:isRound}" :style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden'}">
|
||||
<div :style="previews.div">
|
||||
<img class="previews_image" :style="previews.img" :src="previews.url">
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,17 +77,14 @@ import { VueCropper } from "vue-cropper";
|
||||
// import { openGuide,driverObj__ } from "@/tool/guide";
|
||||
import {base64toFile} from '@/tool/util'
|
||||
export default defineComponent({
|
||||
props:['cropperFileData','isUpload'],
|
||||
props:['cropperFileData','isUpload','isRound'],
|
||||
components:{
|
||||
VueCropper,
|
||||
},
|
||||
setup(){
|
||||
let driver__:any = inject('driver__')
|
||||
return {
|
||||
driver__
|
||||
}
|
||||
|
||||
},
|
||||
data(){
|
||||
data(prop){
|
||||
return {
|
||||
cutPicuterModal:false,
|
||||
option: {
|
||||
@@ -97,16 +95,19 @@ export default defineComponent({
|
||||
outputType: 'png',
|
||||
autoCrop: true,
|
||||
// 只有自动截图开启 宽度高度才生效
|
||||
autoCropWidth: 360,
|
||||
autoCropHeight: 360,
|
||||
autoCropWidth: prop.isRound?100:360,
|
||||
autoCropHeight: prop.isRound?100:360,
|
||||
max: 99999,
|
||||
centerBox:true,
|
||||
canMove:true,
|
||||
canMoveBox:true,
|
||||
fixedBox:false,
|
||||
},
|
||||
previews:{},
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
methods:{
|
||||
|
||||
rotateLeft() {
|
||||
@@ -350,6 +351,10 @@ export default defineComponent({
|
||||
background: rgba(91,94,105,0.8);
|
||||
box-shadow: 0 calc(0.2rem*1.2) calc(0.5rem*1.2) 0 rgba(216,213,239,0.3);
|
||||
border-radius: calc(1rem*1.2);
|
||||
&.active{
|
||||
border-radius: 50%;
|
||||
overflow: hidden
|
||||
}
|
||||
}
|
||||
|
||||
.cut_picture_review_block_sec{
|
||||
|
||||
@@ -335,7 +335,7 @@ export default defineComponent({
|
||||
},
|
||||
workspaceCom(newVal,oldVal){
|
||||
this.workspace = newVal
|
||||
this.upload.gender = newVal?.sexEnum?.name
|
||||
this.upload.gender = newVal?.sexEnum?.value
|
||||
},
|
||||
scene:{
|
||||
handler(newVal,oldVal){
|
||||
@@ -785,7 +785,7 @@ export default defineComponent({
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less">
|
||||
<style lang="less" scoped>
|
||||
.generate {
|
||||
flex: 1;
|
||||
// height: 30rem;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user