Merge branch 'StableVersion' into develop

This commit is contained in:
X1627315083
2024-03-08 11:19:33 +08:00
20 changed files with 1256 additions and 665 deletions

View File

@@ -1,368 +1,342 @@
<template>
<div class="history_page">
<div class="trial_page">
<div class="page_content">
<img
class="page_content_bg"
src="@/assets/images/homePage/bg.png"
src="@/assets/images/homePage/bg1.jpg"
/>
<div class="page_content_body">
<HeaderComponent></HeaderComponent>
<div class="history_page_body">
<div class="history_header">{{ $t('HistoryPage.History') }}</div>
<div class="history_table_search">
<!-- <div class="content_search_block">
<input class="search_input" :placeholder="$t('HistoryPage.inputContent1')" v-model="searchCollectionName" @keydown.enter="searchHistoryList()">
<div class="search_icon_block" @click="searchHistoryList()"><span class="icon iconfont icon-sousuo"></span></div>
</div> -->
<div class="content_search_block">
<a-range-picker class="range_picker" v-model:value="rangePickerValue" :placeholder="[$t('HistoryPage.StartDate'), $t('HistoryPage.EndDate')]" valueFormat="YYYY-MM-DD">
<div class="trial_page_body">
<div class="trial_table_search">
<a-range-picker
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>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchCollectionName" @keydown.enter="searchHistoryList()">
<div class="search_cascader">
<el-cascader
:options="options"
filterable
v-model="value.labelValue"
:collapse-tags="true"
:show-all-levels="false"
:clearable="true"
:placeholder="$t('LibraryPage.Select')"
:max-collapse-tags=3
:props="props"
:collapse-tags-tooltip="true"
ref="cascader"
popper-class="libraryPageCascader"
@visible-change="dropdownVisibleChange"
>
<template #empty>
<div>
{{$t('LibraryPage.Select')}}
</div>
</template>
</el-cascader>
</div>
<div class="intersection">
<div :title="$t('LibraryPage.unionSet')" @click="()=>intersection = 1" v-show="intersection == 0" :class="['icon', 'iconfont','icon-bingji',]"></div>
<div :title="$t('LibraryPage.intersection')" @click="()=>intersection = 0" v-show="intersection == 1" :class="['icon', 'iconfont','icon-bingji1',]"></div>
</div>
<!-- <div class="search_icon_block" @click="getLibraryList('')"><span class="icon iconfont icon-sousuo"></span></div> -->
<div class="generage_btn search_icon_block" @click="searchHistoryList()"><span class="icon iconfont icon-sousuo"></span></div>
</div>
<div class="content_search_block">
<input
class="search_input"
:placeholder="$t('HistoryPage.inputContent1')"
v-model="searchCollectionName"
@keydown.enter="searchHistoryList()"
/>
<div
class="search_icon_block"
@click="searchHistoryList()"
>
<span class="icon iconfont icon-sousuo"></span>
</div>
</div>
</div>
<div class="history_table_content" ref="historyTable">
<a-table :columns="columns" :data-source="collectionList" :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="turnToDetail(record)">{{ $t('HistoryPage.Detail') }}</div>
<div class="operate_item" @click="renameCollection(record,index)">{{ $t('HistoryPage.Rename') }}</div>
<div class="operate_item" @click="retrieveHome(record)">{{ $t('HistoryPage.Retrieve') }}</div>
<div class="operate_item" @click="deleteGroup(record, index)">{{ $t('HistoryPage.Delete') }}</div>
</div>
</template>
<div class="trial_table_content" ref="historyTable">
<a-table
:columns="columns"
:data-source="collectionList"
: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
v-show="status == 0"
class="operate_item"
@click="setConsent(record, index)"
>
consent
</div>
<div
v-show="status == 0"
class="operate_item"
@click="setRefuse(record, index)"
>
refuse
</div>
<!-- <div
class="operate_item"
@click="deleteGroup(record, index)"
>
Delete
</div> -->
</div>
</template>
</a-table>
</div>
</div>
</div>
</div>
<HistoryDetail ref="historyDetail" :groupDetails="groupDetails" :collectionName="collectionName"></HistoryDetail>
<setLabel ref="setLabel"></setLabel>
<RobotAssist></RobotAssist>
<searchLabel ref="searchLabel"></searchLabel>
</div>
</template>
<script lang="ts">
import { defineComponent,ref,createVNode,computed,nextTick,provide} from 'vue'
import { defineComponent, ref, createVNode, computed } from "vue";
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
import HeaderComponent from "@/component/HomePage/Header.vue";
import HistoryDetail from "@/component/Detail/HistoryDetail.vue";
import router from "@/router/index";
import { Https } from "@/tool/https";
import { formatTime } from "@/tool/util"
import { Modal,message } from 'ant-design-vue';
import { formatTime } from "@/tool/util";
import { Modal, message } from "ant-design-vue";
import RobotAssist from "@/component/HomePage/RobotAssist.vue";
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { ElCascader } from 'element-plus'
import { useI18n } from 'vue-i18n';
import setLabel from '@/component/LibraryPage/setLabel.vue';
import searchLabel from '@/component/LibraryPage/searchLabel.vue';
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {
HeaderComponent,
HistoryDetail,
RobotAssist,
setLabel,
ElCascader,
searchLabel
RobotAssist,
},
setup() {
let rangePickerValue:any = ref([])
let renameData:any = ref({}) //修改名字选中的数据
const columns:any = computed(()=>{
return [
{ title: useI18n().t('HistoryPage.CollectionsName'), align:'center', ellipsis: true, width: 150, dataIndex: 'name', key: 'collectionName' },
{ title: useI18n().t('HistoryPage.UptateTime'), align:'center', ellipsis: true,width: 150, dataIndex: 'updateDate', key: 'updateTime',customRender:(record:any)=>{
let time = formatTime(record.text / 1000, 'YYYY-MM-DD hh:mm:ss')
return time
}},
{ title: useI18n().t('HistoryPage.SketchCounts'), align:'center', ellipsis: true, width: 150, dataIndex: 'sketchCount', key: 'sketchCounts' },
let rangePickerValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: 'Email',
align: "center",
ellipsis: true,
width: 170,
dataIndex: "email",
key: "email",
},
{
title: 'Create Time',
align: "center",
ellipsis: 200,
dataIndex: "updateTime",
key: "updateTime",
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: useI18n().t('HistoryPage.Operations'),
key: 'operation',
align:'center',
fixed: 'right',
width: 150,
// slots:{customRender:'action'}
Operations:true,
},
]
});
let collectionList:any = ref([])
let {t} = useI18n()
const options:any = ref([
]);
let value = ref({
labelValue:[],
editLabelValue:[],
})
let props = {
multiple: true,
checkStrictly: true,
emitPath:true,
children:'childList',
value:'id',
label:'classificationName',
}
let intersection = ref(1)
let selectCode = ref('History')
let type:any = {
selectCode:selectCode,
designType:''
}
provide('type',type)
title: 'State',
align: "center",
ellipsis: true,
width: 150,
dataIndex: "status",
key: "status",
customRender: (record: any) => {
let str
if(record.value == 0){
str ='pending'
}else if(record.value == 1){
str ='consent'
}else if(record.value == 2){
str ='reject'
}
return str;
},
},
{
title: 'Address',
align: "center",
ellipsis: true,
width: 150,
dataIndex: "country",
key: "country",
},
{
title: 'Surname',
align: "center",
ellipsis: true,
width: 150,
dataIndex: "surname",
key: "surname",
},
{
title: 'Name',
align: "center",
ellipsis: true,
width: 150,
dataIndex: "userName",
key: "userName",
},
{
title: 'Operations',
key: "operation",
align: "center",
fixed: "right",
width: 200,
// slots:{customRender:'action'}
Operations: true,
},
];
});
let state:any = ref([
{
name:'all',
value:'',
},
{
name:'unprocessed',
value:0,
},
{
name:'pending',
value:1,
},
{
name:'rejected',
value:2,
},
])
let collectionList: any = ref([]);
let status: any = ref(0);
let voluntarily: any = ref(false);
return {
rangePickerValue,
columns,
collectionList,
renameData,
t,
options,
value,
props,
intersection,
selectCode,
}
status,
state,
voluntarily,
};
},
data(){
return{
currentPage:1,
pageSize:10,
total:0,
historyTableHeight:0,
newCollectionName:'',
groupDetails:{},//每个collection的详情
collectionName:'',//选中的名字
searchCollectionName:'',
}
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
newCollectionName: "",
renameVisivle: false, //修改名字弹窗
collectionName: "", //选中的名字
searchCollectionName: "",
};
},
mounted(){
let historyTable:any = this.$refs.historyTable
this.historyTableHeight = historyTable.clientHeight - 130
this.getHistoryList()
this.getClass()
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 130;
this.gettrialList();
},
methods:{
getClass(){
let data = {
"classificationIdList": [],
"classificationName": "",
"createTime": "",
"deleteConfirm": '',
"id": '',
"libraryId": '',
"parentId": '',
"type": this.selectCode,
"updateTime": "",
"userId": ''
}
console.log(data);
Https.axiosPost(Https.httpUrls.queryClassification, data).then(
(rv: any) => {
this.options = rv
rv.forEach((rvItem:any,rvIndex:number) => {
this.options[rvIndex].value = rvItem.id
this.options[rvIndex].label = rvItem.classificationName
rvItem.childList.forEach((childItem:any,index:number) => {
this.options[rvIndex].childList[index].value = childItem.id
this.options[rvIndex].childList[index].label = childItem.classificationName
});
});
}
).catch((res)=>{
});
},
turnToDetail(record:any){
this.groupDetails = record.groupDetails
let historyDetail:any = this.$refs.historyDetail
this.collectionName = record.name
historyDetail.changeDetailShow()
},
methods: {
//改变页码
changePage(e:any){
this.currentPage = e.current
this.pageSize = e.pageSize
this.getHistoryList()
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
//查询列表
searchHistoryList(){
this.currentPage = 1
this.getHistoryList()
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
getHistoryList(){
let startDate:any = this.rangePickerValue ? new Date(this.rangePickerValue[0]).getTime(): ''
let endDate:any = this.rangePickerValue ? new Date(this.rangePickerValue[1]).getTime(): ''
let data = {
page:this.currentPage,
size:this.pageSize,
collectionName:this.searchCollectionName,
startDate:startDate,
endDate:endDate
}
let labelArr:any = []
this.value.labelValue.forEach((item:any)=>{
labelArr.push(item[item.length-1])
})
// console.log(this.value.labelValue);
//获取列表
gettrialList() {
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1]+' '+'00:00:00'
: "";
let data = {
endTime:startDate,
startTime:endDate,
}
console.log(data);
// let data = {
// classificationIdList:labelArr,
// level1Type:this.selectCode,
// level2Type:'',
// page:1,
// modelSex:'',
// pictureName:this.searchCollectionName,
// size:this.pageSize,
// intersection:this.intersection,
// }
Https.axiosPost( Https.httpUrls.queryUserGroup, data).then(
// Https.axiosPost( Https.httpUrls.queryLibraryPage, data).then(
(rv: any) => {
if(this.currentPage > 1 && rv.content.length == 0){
this.currentPage = 1
this.getHistoryList()
}else{
this.collectionList = rv.content
this.total = rv.total
}
}
);
},
//删除分组
deleteGroup(record:any,index:number){
let deleteGroupFun = (id:any,index:number) =>{
let data = {
userGroupId:id
}
Https.axiosPost(Https.httpUrls.deleteUserGroup,data).then(
(rv: any) => {
message.success(this.t('HistoryPage.jsContent1'))
this.collectionList.splice(index,1)
}
);
}
Modal.confirm({
title: this.t('HistoryPage.jsContent2'),
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
centered:true,
mask:false,
onOk() {
deleteGroupFun(record.id,index)
}
});
},
//修改名字
renameCollection(record:any,index:number){
let searchLabel:any = this.$refs.searchLabel
searchLabel.init(record,index)
},
retrieveHome(record:any){
this.$router.push({name:'home',params: {id:record.id}})
},
removeLabel(){
let setLabel:any = this.$refs.setLabel
let cascader:any = this.$refs.cascader
cascader.togglePopperVisible()
let event = new Event('click', {"bubbles":true, "cancelable":true});
document.dispatchEvent(event);
setLabel.init('add',this.options)
},
dropdownVisibleChange(){
let element:any = this.$refs.cascader
nextTick().then(()=>{
let cascader = document.getElementsByClassName('libraryPageCascader')[0]
let cascaderChild = cascader
let element:any = this.$refs.cascader
if(cascader.children.length > 3 ){
}else{
let button1:any = document.createElement("span")
button1.classList.add('started_btn','cascader_btn1')
let button2:any = document.createElement("span")
button2.classList.add('started_btn','cascader_btn2')
let divMax:any = document.createElement("div")
divMax.classList.add('cascader_btn_max')
button1.textContent = 'Edit'
// button2.textContent = '删除'
button1.addEventListener('click',this.removeLabel,false)
divMax.appendChild(button1)
// divMax.appendChild(button2)
cascaderChild?.insertAdjacentElement("afterbegin", divMax);
console.log(this.rangePickerValue,startDate,endDate);
Https.axiosGet(Https.httpUrls.getDesignStatistic,{params:data}).then((rv: any) => {
if (rv) {
console.log(rv);
// cascader.addEventListener('click',this.cascaderClick)
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
let el = element.contentRef?.getElementsByClassName('el-cascader-menu__empty-text')?.[0]
if(el){
el.innerHTML = this.t('LibraryPage.NoLabel')
}
},
setConsent(record: any, index: number){
const formData = new FormData()
formData.append('ids',record.id)
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
Https.axiosPost(Https.httpUrls.trialOrderApproval, {ids:record.id}).then(
(rv: any) => {
message.success('同意成功~')
}
);
},
}
})
setRefuse(record: any, index: number){
const formData = new FormData()
formData.append('ids',record.id)
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
Https.axiosPost(Https.httpUrls.trialOrderRefuse, formData,config).then(
(rv: any) => {
this.gettrialList();
message.success('拒绝成功~')
}
);
},
//删除分组
// 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.collectionList.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">
.history_page {
.trial_page {
width: 100%;
height: 100%;
padding: 0 9rem;
overflow: hidden;
// min-width: 1440px;
position: relative;
overflow: hidden;
// min-width: 1440px;
position: relative;
.page_content {
position: relative;
.page_content_bg {
position: absolute;
width: 100%;
@@ -375,138 +349,115 @@ export default defineComponent({
height: 100%;
box-sizing: border-box;
.history_page_body{
.trial_page_body {
width: 100%;
height: calc(100% - 7rem);
padding: 0 2.5rem 4rem;
box-sizing: border-box;
.history_header{
font-size: 1.8rem;
height: 6.3rem;
line-height: 6.3rem;
font-weight: 500;
color: #333333;
}
.history_table_search{
.trial_table_search {
display: flex;
align-items: center;
.range_picker{
margin-top: 5rem;
color: #fff;
.range_picker {
width: 36rem;
height: 3rem;
margin-right: 2rem;
.ant-picker-input > input{
height: 4.8rem;
.ant-picker-input > input {
font-size: 1.6rem;
}
.range_picker_icon{
.range_picker_icon {
font-size: 2.2rem;
}
}
.ant-picker:hover, .ant-picker-focused{
border-color: #d5d8df;
}
.content_search_block{
display: flex;
align-items: center;
width: 140rem;
.search_input{
height: 3rem;
border-radius: 0.5rem;
width: 20rem;
border: 1px solid rgba(0, 0, 0, 0.15);
padding-left: 1.5rem;
border: 0.2rem solid #d5d8df;
font-size: 1.2rem;
font-weight: 400;
margin-right: 2rem;
&::placeholder {
color: #C2C2C2;
}
}
.search_cascader{
// width: 53%;
width: 38rem;
display: flex;
position: relative;
}
.search_icon_block{
width: 5.2rem;
height: 2.8rem;
line-height: 2.8rem;
text-align: center;
background: #343579;
background-color: #39215b;
cursor: pointer;
border-radius: 2rem;
margin-left: 3rem;
.icon-sousuo{
font-size: 1.6rem;
color: #FFFFFF;
}
}
.intersection{
margin-left: 3rem;
cursor: pointer;
}
}
.content_search_block {
margin-left: 4rem;
display: flex;
.search_input {
width: 32.8rem;
padding-left: 1.5rem;
height: 4.8rem;
line-height: 4.6rem;
background: #ffffff;
border: 0.1rem solid #f1f1f1;
font-size: 1.6rem;
font-weight: 400;
&::placeholder {
color: #c2c2c2;
}
}
.search_icon_block {
width: 7.2rem;
height: 4.8rem;
line-height: 4.8rem;
text-align: center;
background: #343579;
cursor: pointer;
.icon-sousuo {
font-size: 2rem;
color: #ffffff;
}
}
}
}
.history_table_content{
.trial_table_content {
margin-top: 2.6rem;
width: 100%;
height: calc(100% - 13.7rem);
background: rgba(255, 255, 255, 0.6);
background: rgba(255, 255, 255, 0.3);
padding-bottom: 3rem;
.ant-table{
border-radius: 2rem;
backdrop-filter: blur(3rem);
overflow: hidden;
box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.38);
.ant-table {
background: transparent;
}
.ant-table-body{
.ant-table-body {
overflow-y: auto !important;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
&::-webkit-scrollbar { width: 0 !important }
&::-webkit-scrollbar {
width: 0 !important;
}
}
.ant-table-thead > tr > th {
background: #ffffff00;
color: #fff;
border-bottom: none;
backdrop-filter: blur(1rem);
}
.ant-table-thead > tr > th{
background: #FFFFFF;
}
.ant-table-tbody > tr > td{
.ant-table-tbody > tr > td {
border: none;
background: transparent;
// color: #fff;
}
.ant-table-tbody > tr{
&:hover > td{
background: #FFFFFF;
.ant-table-tbody > tr {
&:hover > td {
background: #ffffff3a;
}
}
}
.ant-table-pagination-right{
padding-right: 3.5rem;
}
.ant-table-pagination-right {
padding-right: 3.5rem;
}
.operate_list{
.operate_list {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
.operate_item{
.operate_item {
font-size: 1.4rem;
font-family: Roboto;
font-weight: 400;
@@ -518,46 +469,5 @@ export default defineComponent({
}
}
}
}
.rename_modal_component{
.collection_rename_content{
padding:2rem 9.2rem 3rem;
.rename_form_content{
.rename_form_input{
width: 100%;
height: 4.6rem;
margin-top: 1rem;
border: 0.1rem solid #B4BED7;
padding-left: 2.1rem;
line-height: 4.6rem;
font-size: 1.8rem;
box-sizing: border-box;
&::placeholder {
color:#A5B0C2,
}
}
}
.rename_submit_button{
height: 4.8rem;
line-height: 4.8rem;
background: #343579;
font-size: 2.4rem;
font-weight: 500;
color: #FFFFFF;
width: 16rem;
text-align: center;
cursor: pointer;
margin: 4.5rem auto 0;
}
}
}
</style>