更新笔触和管理员页面

This commit is contained in:
X1627315083
2024-03-15 09:21:17 +08:00
parent bc314a2f83
commit b15d2e467f
29 changed files with 2792 additions and 1385 deletions

View File

@@ -1,26 +1,13 @@
<template>
<div class="allUser_page">
<div class="allUser_table_search">
<!-- <div class="allUser_state">
<div class="allUser_state_item allUser_table_voluntarily">
<span>voluntarily:</span>
<a-switch v-model:checked="voluntarily" @change="setIsAutoApproval" />
</div>
<div class="allUser_state_item">
<span>State:</span>
<a-select v-model:value="currentState.value" size="large" style="width:280px" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
</div>
</div>
<div class="allUser_search">
<div class="allUser_search_item" @click="searchHistoryList">Search</div>
</div> -->
</div>
<div class="allUser_table_content" ref="historyTable">
<a-table
:columns="columns"
:data-source="collectionList"
:scroll="{ y: historyTableHeight }"
:data-source="dataList"
:scroll="{ y: historyTableHeight}"
@change="changePage"
:pagination="{
showSizeChanger: true,
@@ -31,36 +18,11 @@
bordered: false,
}"
>
<template
<!-- <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>
</template> -->
</a-table>
</div>
</div>
@@ -91,114 +53,68 @@ export default defineComponent({
title: 'Email',
align: "center",
ellipsis: true,
width: 70,
width: 30,
dataIndex: "email",
key: "email",
fixed: 'left',
},
{
title: 'User Id',
align: "center",
width: 30,
dataIndex: "id",
key: "id",
},
{
title: 'User Name',
align: "center",
ellipsis: true,
width: 30,
dataIndex: "userName",
key: "userName",
},
{
title: 'Given Name',
align: "center",
ellipsis: true,
width: 30,
dataIndex: "givenName",
key: "givenName",
},
{
title: 'Create Time',
align: "center",
width: 70,
dataIndex: "updateTime",
key: "updateTime",
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
width: 30,
dataIndex: "createTime",
key: "createTime",
},
{
title: 'State',
title: 'Title',
align: "center",
ellipsis: true,
width: 70,
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;
},
width: 30,
dataIndex: "title",
key: "title",
},
{
title: 'Address',
{
title: 'Country',
align: "center",
ellipsis: true,
width: 70,
width: 30,
dataIndex: "country",
key: "country",
fixed: 'right',
},
{
title: 'Surname',
align: "center",
ellipsis: true,
width: 70,
dataIndex: "surname",
key: "surname",
},
{
title: 'Name',
align: "center",
ellipsis: true,
width: 70,
dataIndex: "userName",
key: "userName",
},
{
title: 'Operations',
key: "operation",
align: "center",
fixed: "right",
width: 70,
// slots:{customRender:'action'}
Operations: true,
},
];
});
let currentState = ref({
name:'all',
value:'',
state:false,
},)
let state:any = ref([
{
label:'all',
value:'',
},
{
label:'pending',
value:0,
},
{
label:'consent',
value:1,
},
{
label:'rejected',
value:2,
},
])
let collectionList: any = ref([]);
let dataList: any = ref([]);
let userInfo: any = {};
let status: any = ref(0);
let voluntarily: any = ref(false);
return {
columns,
collectionList,
dataList,
renameData,
userInfo,
status,
currentState,
state,
voluntarily,
};
},
data() {
@@ -219,80 +135,29 @@ export default defineComponent({
this.gettrialList();
let userInfo:any = getCookie("userInfo")
this.userInfo = JSON.parse(userInfo);
this.getIsAutoApproval()
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
// this.gettrialList();
},
//获取是否自动审批
getIsAutoApproval(){
Https.axiosPost(Https.httpUrls.getIsAutoApproval, {}).then(
(rv: any) => {
this.voluntarily = rv
}
);
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
setIsAutoApproval(){
Https.axiosPost(Https.httpUrls.switchIsAutoApproval, {}).then(
(rv: any) => {
this.getIsAutoApproval
}
);
},
//获取列表
gettrialList() {
let data = {
page: this.currentPage,
size: this.pageSize,
status: this.currentState.value,
// startDate:startDate,
// endDate:endDate
};
Https.axiosPost(Https.httpUrls.trialOrderList, data).then(
(rv: any) => {
this.collectionList = rv.content;
}
);
Https.axiosGet(Https.httpUrls.inquiryGetTrial).then((rv)=>{
console.log(rv);
this.dataList = rv
})
},
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('拒绝成功~')
}
);
},
setState(){
this.currentState.state = true
},
setStateItem(item:any){
this.currentState = item
this.currentState.state = false
},
},
});
</script>