3d添加印花 等

This commit is contained in:
X1627315083
2025-04-16 10:43:54 +08:00
parent fd2e47e783
commit c2288a30b2
51 changed files with 5588 additions and 359 deletions

View File

@@ -0,0 +1,276 @@
<template>
<div class="allUserPoerationModal" ref="allUserPoerationModal"></div>
<a-modal
class="allUserPoeration_modal generalModel"
v-model:visible="operationsModal"
:footer="null"
:get-container="() => $refs.allUserPoerationModal"
width="50%"
height="55rem"
:maskClosable="false"
:centered="true"
:closable="false"
:mask="true"
wrapClassName="#app"
:keyboard="false"
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="23" cy="23" r="23" fill="white" fill-opacity="0.3"/>
<rect x="32.5063" y="12" width="3" height="29" rx="1.5" transform="rotate(45 32.5063 12)" fill="white"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="white"/>
</svg>
</div>
</div>
<div class="modal_title_text">
<div>{{ title }} User</div>
</div>
<div class="allUserPoeration_center admin_page">
<div class="admin_state_item">
<span>User Name: <span>*</span></span>
<input
v-model="userName"
placeholder="Please enter user name"
type="text"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>User Email: <span>*</span></span>
<input
v-model="userEmail"
placeholder="Please enter email"
type="text"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>Password: <span>*</span></span>
<input
@focus="focus"
@blur="blur"
v-model="password"
placeholder="Please enter password"
type="password"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>Maximum Credits:</span>
<input
v-model="credits"
placeholder="Please enter credits"
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 { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { formatTime,isEmail } from "@/tool/util";
const md5 = require("md5");
export default defineComponent({
components: {
},
emits: ['searchHistoryList'],
setup(props,{emit}) {
let operations = reactive({
operationsModal:false,
operationsEdit:false,
loadingShow:false,
title:''
})
let operationsData = reactive({
accountId:-1,
userName:'',
userEmail:'',
password:'',
oldPassword:'',
credits:'',
})
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'){
operationsData.accountId=data.id
operationsData.userName=data.userName
operationsData.userEmail=data.userEmail
operationsData.password=data.userPassword
operationsData.oldPassword=data.userPassword
// operationsData.validStartTime='2024-08-05T00:00:06'
// operationsData.validEndTime='2024-08-05T00:00:06'
operationsData.credits=data.creditsUsageLimit
// operationsData.accountId = data.accountId
// operationsData.userName = data.userName
// operationsData.userEmail = data.userEmail
// operationsData.validStartTime = formatTime(data.validStartTime)
// operationsData.validEndTime = formatTime(data.validEndTime)
}
}
let focus = (event) =>{
if(operationsData.password == operationsData.oldPassword){
operationsData.password = ''
}
}
let blur = (event) =>{
console.log((operationsData.password == '' && operationsData.oldPassword))
if(operationsData.password == '' && operationsData.oldPassword){
operationsData.password = operationsData.oldPassword
}
}
let setAddData = ()=>{
return {
"creditsUsageLimit": operationsData.credits,
"userEmail": operationsData.userEmail,
"userPassword": md5(operationsData.password + 'abc'),
"userName": operationsData.userName,
}
}
let setEditData = ()=>{
return {
"id": operationsData.accountId,
"creditsUsageLimit": operationsData.credits,
"userName": operationsData.userName,
"userEmail": operationsData.userEmail,
"userPassword": (operationsData.password == operationsData.oldPassword)?'':md5(operationsData.password + 'abc'),
}
}
let cancelDsign = ()=>{
operationsData.accountId=-1
operationsData.userName=''
operationsData.userEmail=''
operationsData.password=''
operationsData.credits=''
operations.operationsModal = false
}
let setOk = ()=>{
let data
if(operations.title == 'Add'){
data = setAddData()
if (!isEmail(data.userEmail)) {
message.info("The email format is incorrect");
return;
}
if(!data.userName || !data.userEmail || !data.userPassword || !data.creditsUsageLimit)return message.warning('Please check the input box marked with *')
Https.axiosPost(Https.httpUrls.addOrUpdateSubAccount, data).then(
(rv) => {
if (rv) {
cancelDsign()
emit('searchHistoryList')
}
}
);
}else{
data = setEditData()
if (!isEmail(data.userEmail)) {
message.info("The email format is incorrect");
return;
}
if(!data.userName || !data.userEmail || !data.creditsUsageLimit)return message.warning('Please check the input box marked with *')
Https.axiosPost(Https.httpUrls.addOrUpdateSubAccount,data).then(
(rv) => {
if (rv) {
cancelDsign()
emit('searchHistoryList')
}
}
);
}
}
return {
...toRefs(operations),
...toRefs(operationsData),
state,
cancelDsign,
init,
focus,
blur,
setOk,
};
},
data() {
return {
};
},
mounted() {},
methods: {
},
});
</script>
<style lang="less" scoped>
:deep(.allUserPoeration_modal){
.ant-modal-body{
display: flex;
flex-direction: column;
}
}
</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{
flex: 1;
overflow-y: auto;
flex-direction: row;
flex-wrap: wrap;
}
}
</style>

View File

@@ -0,0 +1,500 @@
<template>
<div class="admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Create Time:</span>
<a-range-picker
style="width: 230px"
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>Country:</span>
<a-select
v-model:value="country"
:allowClear="true"
show-search
style="width: 230px"
: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: 230px"
/>
</div>
<div class="admin_state_item">
<span>User Name:</span>
<a-select
v-model:value="ids"
mode="multiple"
style="width: 230px"
: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: 230px"
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 class="admin_search_item" style="width: auto;padding: 0 2rem;" @click="downloadTemplate">
Download template
</div>
<div class="admin_search_item" style="width: auto;padding: 0 2rem;" @click="uploadTemplate">
Upload template
</div>
</div>
<div class="admin_state_list">
<div
class="admin_state_list_item"
@click="lastGeTrialList('year')"
>
Nearly a 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,
}"
>
<template #bodyCell="{ column, text, record, index }">
<div class="operate_list" v-if="column?.Operations">
<div
class="operate_item"
@click="setAagree(record)"
style="margin-right: 2rem;"
>
Edit
</div>
<div
class="operate_item"
@click="deleteAagree(record)"
>
Delete
</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,
reactive,
toRefs,
onMounted,
} from "vue";
import { formatTime } from "@/tool/util";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import allUserPoerationsVue from "./addAllUser.vue";
export default defineComponent({
components: {allUserPoerationsVue,},
setup() {
const store:any = useStore()
let filter: any = reactive({
dataList: [],
tableLoading: false,
allUserList: computed(()=>{
return store.state.adminPage.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:'0',
},
{
label:'yearly',
value:'1',
},
{
label:'monthly',
value:'2',
},
{
label:'trial',
value:'3',
},
{
label: "userInEvent",
value: "4",
},
]);
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: "Create Date",
align: "center",
dataIndex: "createDate",
key: "createDate",
width:200,
sorter: true,
},
{
title: "Credits",
align: "center",
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "creditsUsageLimit",
key: "credits",
width:100,
sorter: true,
},
{
title: "Operations",
key: "operation",
width:120,
align: "center",
fixed: "right",
// slots:{customRender:'action'}
Operations: true,
},
];
});
//改变页码
let changePage = (e: any, filters:any, sorter:any) => {
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] + " " + "23:59:59"
: "";
let data = {
endTime: endDate,
startTime: startDate,
size: filterData.pageSize,
page: filterData.currentPage,
systemUser: filterData.systemUser,
country: filterData.country,
email: filterData.email.trim(),
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.subAccountList, data).then(
(rv: any) => {
if (rv) {
console.log(rv)
// this.dataList = rv
filter.dataList = rv.content;
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)
}
const downloadTemplate = ()=>{
Https.axiosGet(Https.httpUrls.subAccountImportExcelDownload,{responseType: 'blob',env:{binary:true}}).then((rv:any)=>{
const link = document.createElement('a');
link.href = rv.url;
link.download = 'file.xlsx'; // 设置正确的文件扩展名
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// 释放 URL 对象
URL.revokeObjectURL(link.href);
})
}
const uploadTemplate = ()=>{
const fileInput = document.createElement('input');
fileInput.type = 'file';
fileInput.accept = '.xlsx'; // 只接受 .xlsx 文件
fileInput.onchange = (event:any) => {
const file = event.target.files[0]; // 获取选择的文件
if (file) {
console.log('Selected file:', file);
let param = new FormData();
param.append('file',file);
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
Https.axiosPost(Https.httpUrls.subAccountImport,param,config)
.then((rv:any)=>{
gettrialList();
})
}
};
fileInput.click();
}
const deleteAagree = (event:any)=>{
const value = {
deleteIdList:[event.id]
}
Https.axiosPost(Https.httpUrls.deleteSubAccount,value)
.then((rv:any)=>{
gettrialList();
})
}
onMounted(() => {
let allCountry: any = sessionStorage.getItem("allCountry");
if (allCountry) {
filter.allCountry = JSON.parse(allCountry);
}
gettrialList();
});
return {
...toRefs(filter),
...toRefs(filterData),
state,
columns,
renameData,
changePage,
searchHistoryList,
addhHistoryList,
lastGeTrialList,
gettrialList,
filterOption,
allUserPoerationsVue,
setAagree,
downloadTemplate,
uploadTemplate,
deleteAagree,
};
},
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>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
width: 75%;
flex-wrap: wrap;
align-content: flex-start;
}
.admin_page .admin_table_search .admin_search {
display: flex;
flex-wrap: wrap;
width: 25%;
}
</style>

View File

@@ -0,0 +1,275 @@
<template>
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Start Date:</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>Start Time:</span>
<a-time-range-picker style="width:250px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
</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>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
</div>
<div class="admin_table_content" ref="historyTable">
<a-table
@resizeColumn="handleResizeColumn"
: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 } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
export default defineComponent({
components: {
},
setup() {
const store:any = useStore()
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: 'Email',
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width:200,
fixed: "left",
},
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width:100,
},
{
title: 'User Name',
align: "center",
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width:100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: 'Frequency',
align: "center",
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width:100,
},
{
title: 'Create Time',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "createTime",
key: "createTime",
width:200,
},
{
title: 'Credits',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "credits",
key: "credits",
width:100,
},
];
});
let allUserList: any = computed(()=>{
return store.state.adminPage.allUserList
})
let ids = ref([])
let email = ref('')
let dataList: any = ref([]);
let status: any = ref(0);
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
return {
rangePickerValue,
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,
status,
filterOption,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
handleResizeColumn: (w:any, col:any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue[0]
? this.rangeTimeValue[0]
: '00:00:00';
let endTime: any = this.rangeTimeValue[1]
? this.rangeTimeValue[1]
: '23:59:59';
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0]+' '+startTime
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1]+' '+endTime
: "";
let ids = this.ids.join(',')
let data = {
endTime:endDate,
startTime:startDate,
ids:ids,
email:this.email.trim(),
}
Https.axiosGet(Https.httpUrls.getDesignStatistic,{params:data}).then((rv: any) => {
if (rv) {
this.dataList = rv
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
},
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>

View File

@@ -0,0 +1,242 @@
<template>
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Start Date:</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>Start Time:</span>
<a-time-range-picker style="width:250px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
</div>
<div class="admin_state_item">
<span>Generate Event:</span>
<a-select
v-model:value="changeEvent"
show-search
allowClear
style="width: 250px"
placeholder="Please select"
:options="allGenerateType"
@keydown.enter="gettrialList"
></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>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
</div>
<div class="admin_table_content" ref="historyTable">
<a-table
@resizeColumn="handleResizeColumn"
: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 } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
export default defineComponent({
components: {
},
setup() {
const store:any = useStore()
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const allGenerateType = computed(()=>{
return store.state.adminPage.allGenerateType
})
const columns: any = computed(() => {
return [
{
title: 'Email',
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width:200,
fixed: "left",
},
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "id",
key: "id",
width:100,
},
{
title: 'Current Credits',
align: "center",
ellipsis: true,
dataIndex: "currentCredits",
key: "currentCredits",
width:150,
},
{
title: 'Generate Event',
align: "center",
ellipsis: true,
dataIndex: "generateFunction",
key: "generateFunction",
width:150,
customRender: (record: any) => {
return record.text?record.text:'ALL'
},
},
{
title: 'Usage Count',
align: "center",
ellipsis: true,
dataIndex: "usageCount",
key: "usageCount",
width:150,
customRender: (record: any) => {
return record.text?record.text:'-'
},
},
{
title: 'Cconsumed Credits',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "consumedCredits",
key: "consumedCredits",
width:150,
customRender: (record: any) => {
return record.text?record.text:'-'
},
}
];
});
let email = ref('')
let dataList: any = ref([]);
let status: any = ref(0);
return {
rangePickerValue,
rangeTimeValue,
columns,
dataList,
email,
renameData,
status,
allGenerateType,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
changeEvent:'',
historyTableHeight: 0,
handleResizeColumn: (w:any, col:any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue[0]
? this.rangeTimeValue[0]
: '00:00:00';
let endTime: any = this.rangeTimeValue[1]
? this.rangeTimeValue[1]
: '23:59:59';
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0]+' '+startTime
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1]+' '+endTime
: "";
let data = {
endTime:endDate,
startTime:startDate,
id:null,
changeEvent:this.changeEvent,
size:this.pageSize,
page:this.currentPage,
email:this.email.trim(),
}
Https.axiosPost(Https.httpUrls.getGenerateFrequency,data).then((rv: any) => {
if (rv) {
console.log(rv)
this.dataList = rv.content
this.total = rv.total
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
},
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>

View File

@@ -271,7 +271,7 @@ export default defineComponent({
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
// this.gettrialList();
this.gettrialList();
},
//查询列表

View File

@@ -278,10 +278,11 @@ export default defineComponent({
});
</script>
<style lang="less" scoped>
.allUserPoeration_modal{
:deep(.allUserPoeration_modal){
.ant-modal-body{
height: auto;
display: flex;
flex-direction: column;
}
}
@@ -303,7 +304,7 @@ export default defineComponent({
}
}
.allUserPoeration_center{
height: 85%;
flex: 1;
overflow-y: auto;
flex-direction: row;
flex-wrap: wrap;

View File

@@ -0,0 +1,275 @@
<template>
<div class="allUserPoerationModal" ref="allUserPoerationModal"></div>
<a-modal
class="allUserPoeration_modal generalModel"
v-model:visible="operationsModal"
:footer="null"
:get-container="() => $refs.allUserPoerationModal"
width="50%"
:height="'77rem'"
:maskClosable="false"
:centered="true"
:closable="false"
:mask="true"
wrapClassName="#app"
:keyboard="false"
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="23" cy="23" r="23" fill="white" fill-opacity="0.3"/>
<rect x="32.5063" y="12" width="3" height="29" rx="1.5" transform="rotate(45 32.5063 12)" fill="white"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="white"/>
</svg>
</div>
</div>
<div class="modal_title_text">
<div>{{ title }} Coupon</div>
</div>
<div class="allUserPoeration_center admin_page">
<div class="admin_state_item">
<span>Cooperator: <span>*</span></span>
<input
v-model="cooperator"
placeholder="Please enter cooperator"
type="text"
style="width: 220px"
/>
</div>
<div class="admin_state_item" >
<span>percentOff(%): <span>*</span></span>
<input
:class="{active:title != 'Add'}"
v-model="percentOff"
placeholder="Please enter percentOff"
type="text"
style="width: 220px"
/>
</div>
<div class="admin_state_item" >
<span>Commission Rate: <span>*</span></span>
<input
:class="{active:title != 'Add'}"
v-model="commissionRate"
placeholder="Please enter commission rate"
type="text"
style="width: 220px"
/>
</div>
<div class="admin_state_item" >
<!-- <div class="admin_state_item" > -->
<span>End Time: <span>*</span></span>
<a-space direction="vertical" style="width:220px">
<a-date-picker v-model:value="rangePickerValue" :disabled="title != 'Add'" style="width:220px" />
</a-space>
</div>
<div class="admin_state_item" >
<span>Maximum: <span>*</span></span>
<input
:class="{active:title != 'Add'}"
v-model="maxRedemptions"
placeholder="Please enter maximum"
type="text"
style="width: 220px"
/>
</div>
<div class="admin_state_item" >
<span>PaidCommission: <span>*</span></span>
<input
v-model="paidCommission"
placeholder="Please enter paidCommission"
type="text"
style="width: 220px"
/>
</div>
<div class="admin_state_item">
<span>Remark: <span>*</span></span>
<input
v-model="remark"
placeholder="Please enter remark"
type="text"
style="width: 220px"
/>
</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 { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { formatTime,isEmail } from "@/tool/util";
import dayjs, { Dayjs } from 'dayjs';
const md5 = require("md5");
export default defineComponent({
components: {
},
emits: ['searchHistoryList'],
setup(props,{emit}) {
let operations = reactive({
operationsModal:false,
operationsEdit:false,
loadingShow:false,
title:''
})
let operationsData = reactive({
rangePickerValue:'',
percentOff:'',
commissionRate:'',
maxRedemptions:'',
cooperator:'',
paidCommission:'',
remark:'',
id:''
})
let init = (funStr,data)=>{
operations.operationsModal = true
operations.operationsEdit = true
operations.title = funStr
if(funStr == 'Add') operations.operationsEdit = false
if(funStr == 'Edit'){
operationsData.id=data.id
operationsData.percentOff=data.percentOff
operationsData.commissionRate=data.commissionRate
operationsData.maxRedemptions=data.maxRedemptions
operationsData.cooperator=data.cooperator
operationsData.paidCommission=data.paidCommission
operationsData.remark=data.remark
operationsData.rangePickerValue = dayjs(new Date(data.redeemBy * 1000).toISOString().split('T')[0],'YYYY/MM/DD');
// operationsData.rangePickerValue='2024-08-05T00:00:06'
// operationsData.validEndTime='2024-08-05T00:00:06'
// operationsData.commissionRate = data.commissionRate
// operationsData.maxRedemptions = data.maxRedemptions
// operationsData.validStartTime = formatTime(data.validStartTime)
// operationsData.validEndTime = formatTime(data.validEndTime)
}
}
let setAddData = ()=>{
const timestampMs = new Date(operationsData.rangePickerValue).getTime() / 1000; // 直接获取毫秒时间戳
return {
"percentOff": operationsData.percentOff,
"maxRedemptions": operationsData.maxRedemptions,
"commissionRate": operationsData.commissionRate,
"timestamp": timestampMs,
cooperator:operationsData.cooperator,
remark:operationsData.remark,
}
}
let setEditData = ()=>{
const timestampMs = new Date(operationsData.rangePickerValue).getTime() / 1000; // 直接获取毫秒时间戳
return {
id: operationsData.id,
paidCommission: operationsData.commissionRate,
cooperator:operationsData.cooperator,
remark:operationsData.remark,
}
}
let cancelDsign = ()=>{
operationsData.rangePickerValue=''
operationsData.percentOff=''
operationsData.commissionRate=''
operationsData.maxRedemptions=''
operationsData.cooperator=''
operationsData.paidCommission=''
operationsData.remark=''
operationsData.id=''
operations.operationsModal = false
}
let setOk = ()=>{
let data
if(operations.title == 'Add'){
data = setAddData()
if(!data.commissionRate || !data.maxRedemptions || !data.timestamp || !data.percentOff)return message.warning('Please check the input box marked with *')
Https.axiosPost(Https.httpUrls.createCoupon, data).then(
(rv) => {
if (rv) {
cancelDsign()
emit('searchHistoryList')
}
}
);
}else{
data = setEditData()
if(!data.cooperator || !data.paidCommission || !data.remark )return message.warning('Please check the input box marked with *')
Https.axiosGet(Https.httpUrls.updatePromCodeInfo,{params:data}).then(
(rv) => {
if (rv) {
cancelDsign()
emit('searchHistoryList')
}
}
);
}
}
return {
...toRefs(operations),
...toRefs(operationsData),
cancelDsign,
init,
focus,
blur,
setOk,
};
},
data() {
return {
};
},
mounted() {},
methods: {
},
});
</script>
<style lang="less" scoped>
:deep(.allUserPoeration_modal){
.ant-modal-body{
display: flex;
flex-direction: column;
}
}
</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{
flex: 1;
overflow-y: auto;
flex-direction: row;
flex-wrap: wrap;
}
}
</style>

View File

@@ -0,0 +1,365 @@
<template>
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Start Date:</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>Start Time:</span>
<a-time-range-picker style="width:250px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
</div> -->
<div class="admin_state_item">
<span>Expired or not:</span>
<a-select
v-model:value="isExpired"
show-search
allowClear
style="width: 250px"
placeholder="Please select"
:options="changeList"
@keydown.enter="gettrialList"
></a-select>
</div>
<div class="admin_state_item">
<span>Cooperator:</span>
<input
v-model="cooperator"
placeholder="Please enter cooperator"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>Promotion Code:</span>
<input
v-model="promotionCode"
placeholder="Please enter promotion code"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</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>
<div class="admin_table_content" ref="historyTable">
<a-table
@resizeColumn="handleResizeColumn"
:columns="columns"
:data-source="dataList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
: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)"
style="margin-right: 2rem;"
>
Edit
</div>
</div>
</template>
</a-table>
</div>
<allUserPoerationsVue ref="allUserPoerationsVue" @searchHistoryList="searchHistoryList"></allUserPoerationsVue>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, reactive, toRefs, computed, toRef } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import allUserPoerationsVue from "./addAllUser.vue";
export default defineComponent({
components: {
allUserPoerationsVue
},
setup() {
const store:any = useStore()
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const dataDom = reactive({
allUserPoerationsVue:null as any,
})
const columns: any = computed(() => {
return [
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "id",
key: "id",
width:100,
sorter: true,
fixed: "left",
},
{
title: 'Max Redemptions',
align: "center",
dataIndex: "maxRedemptions",
key: "maxRedemptions",
width:200,
},
{
title: 'Promotion Code',
align: "center",
ellipsis: true,
dataIndex: "promotionCode",
key: "promotionCode",
width:150,
},
{
title: 'redeemBy',
align: "center",
ellipsis: true,
dataIndex: "redeemBy",
key: "redeemBy",
width:150,
customRender: (record: any) => {
if(record.text){
return new Date(record.text * 1000).toISOString().split('T')[0] // "2025-04-24"
}
},
},
{
title: 'percent Off',
align: "center",
ellipsis: true,
dataIndex: "percentOff",
key: "percentOff",
width:150,
customRender: (record: any) => {
return record.text+'%'
},
},
{
title: 'commissionRate',
align: "center",
ellipsis: true,
dataIndex: "commissionRate",
key: "commissionRate",
width:150,
customRender: (record: any) => {
return record.text+'%'
},
},
{
title: 'cooperator',
align: "center",
ellipsis: true,
dataIndex: "cooperator",
key: "cooperator",
width:150,
},
{
title: 'Label Volmoney',
align: "center",
ellipsis: true,
dataIndex: "totalEarnings",
key: "totalEarnings",
width:150,
},
{
title: 'Commission',
align: "center",
ellipsis: true,
dataIndex: "commission",
key: "commission",
width:150,
},
{
title: 'Commission paid',
align: "center",
ellipsis: true,
dataIndex: "paidCommission",
key: "paidCommission",
width:150,
},
{
title: 'Unpaid commission',
align: "center",
ellipsis: true,
dataIndex: "unpaidCommission",
key: "unpaidCommission",
width:150,
},
//
{
title: 'remark',
align: "center",
ellipsis: true,
dataIndex: "remark",
key: "remark",
width:150,
}, {
title: "Operations",
key: "operation",
width:120,
align: "center",
fixed: "right",
// slots:{customRender:'action'}
Operations: true,
},
];
});
let cooperator = ref('')
let promotionCode = ref('')
let dataList: any = ref([]);
let status: any = ref(0);
let orderBy: any = ref(0);
// let filterOption = (input: any, option: any) => {
// // 使用 option.label 进行搜索
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
// };
const changeList = ref([
{
value: '',
label: 'All',
},
{
value: 'false',
label: 'No',
},
{
value: 'true',
label: 'Yes',
}
])
let addhHistoryList = () => {
dataDom.allUserPoerationsVue.init('Add','')
};
let setAagree = (data:any) =>{
dataDom.allUserPoerationsVue.init('Edit',data)
}
return {
...toRefs(dataDom),
rangePickerValue,
rangeTimeValue,
columns,
dataList,
cooperator,
promotionCode,
renameData,
status,
changeList,
orderBy,
addhHistoryList,
setAagree,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
isExpired:'',
historyTableHeight: 0,
handleResizeColumn: (w:any, col:any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any, filters:any, sorter:any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
console.log(sorter)
// this.gettrialList();
// if(sorter.order){
// if(sorter.columnKey == 'id'){
// this.orderBy = 'id'
// }
// }
this.orderBy = sorter.order == "descend" ? "DESC" : "ASC";
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
// let startTime: any = this.rangeTimeValue[0]
// ? this.rangeTimeValue[0]
// : '00:00:00';
// let endTime: any = this.rangeTimeValue[1]
// ? this.rangeTimeValue[1]
// : '23:59:59';
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1]+' '+'23:59:59'
: "";
let data = {
endTime:endDate,
startTime:startDate,
cooperator:this.cooperator,//合作商
isExpired:this.isExpired,//是否过期
promotionCode:this.promotionCode,//优惠码
orderById:null,//排序字段
size:this.pageSize,
page:this.currentPage,
}
Https.axiosPost(Https.httpUrls.getAllCoupons,data).then((rv: any) => {
if (rv) {
console.log(rv)
this.dataList = rv.records
this.total = rv.total
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
},
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>