Merge branch 'zcwy-0306' into dev0223

This commit is contained in:
zhangsir
2024-03-27 15:37:24 +08:00
2 changed files with 53 additions and 28 deletions

View File

@@ -22,11 +22,11 @@
style="width: 270px; height: 40px; border-radius: 8px;margin-right: 14px;" style="width: 270px; height: 40px; border-radius: 8px;margin-right: 14px;"
/> />
</div> </div>
<div class="down_header_btn btn1"> <div class="down_header_btn btn1" @click="searchList">
<div class="search"></div> <div class="search"></div>
<span class="btnText">搜索</span> <span class="btnText">搜索</span>
</div> </div>
<div class="down_header_btn btn2"> <div class="down_header_btn btn2" @click="searchNo">
<div class="search"></div> <div class="search"></div>
<span class="btnText">重置</span> <span class="btnText">重置</span>
</div> </div>
@@ -154,9 +154,10 @@ import { useStore } from "vuex";
const listData = async () => { const listData = async () => {
state.tableLoading = true state.tableLoading = true
await getPage({ await getPage({
id:route.query.id, pid:route.query.id,
pageNo: state.params.pageNo, pageNo: state.params.pageNo,
pageSize: state.params.pageSize, pageSize: state.params.pageSize,
searchParam:state.searchName
}).then((res) => { }).then((res) => {
if(res.code === 200){ if(res.code === 200){
state.tableLoading = false state.tableLoading = false
@@ -166,6 +167,15 @@ import { useStore } from "vuex";
} }
}) })
} }
const searchList = () => {
state.params.pageNo = 1
listData()
}
const searchNo = () => {
state.searchName = ''
state.params.pageNo = 1
listData()
}
const downloadItem = (record) => { const downloadItem = (record) => {
window.open(`/activityApi/evaluation/detail/downloadById?id=${record.id}`) window.open(`/activityApi/evaluation/detail/downloadById?id=${record.id}`)
}; };
@@ -191,6 +201,8 @@ import { useStore } from "vuex";
downloadItem, downloadItem,
pagination, pagination,
listData, listData,
searchList,
searchNo,
downloadAll, downloadAll,
userInfo, userInfo,
} }

View File

@@ -50,19 +50,19 @@
> >
<template #operation="{ record, column }"> <template #operation="{ record, column }">
<a-space> <a-space>
<a-button type="link" @click="bgcheck(record)"> <a-button v-if="trueFalse(record.permission,1)" type="link" @click="bgcheck(record)">
<a-tooltip> <a-tooltip>
<template #title>查看</template> <template #title>查看</template>
<span class="check"></span> <span class="check"></span>
</a-tooltip> </a-tooltip>
</a-button> </a-button>
<a-button type="link" @click="bgupload1(record)"> <a-button type="link" @click="bgupload1(record)" v-if="trueFalse(record.permission,2)||trueFalse(record.permission,4)">
<a-tooltip> <a-tooltip>
<template #title>上传</template> <template #title>上传</template>
<span class="upload"></span> <span class="upload"></span>
</a-tooltip> </a-tooltip>
</a-button> </a-button>
<a-button type="link" @click="downloadAll(record)"> <a-button v-if="trueFalse(record.permission,5)" type="link" @click="downloadAll(record)">
<a-tooltip> <a-tooltip>
<template #title>下载</template> <template #title>下载</template>
<span class="download"></span> <span class="download"></span>
@@ -78,7 +78,7 @@
</a> </a>
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item key="0"> <a-menu-item v-if="trueFalse(record.permission,4)" key="0">
<a-button type="link" class="btn_item" @click="openEdit(record)"> <a-button type="link" class="btn_item" @click="openEdit(record)">
<span class="release"></span> <span class="release"></span>
编辑 编辑
@@ -90,13 +90,13 @@
权限设置 权限设置
</a-button> </a-button>
</a-menu-item> </a-menu-item>
<a-menu-item key="2"> <a-menu-item key="2" v-if="trueFalse(record.permission,6)">
<a-button type="link" class="btn_item" @click="deleteItem(record)"> <a-button type="link" class="btn_item" @click="deleteItem(record)">
<span class="delete"></span> <span class="delete"></span>
删除 删除
</a-button> </a-button>
</a-menu-item> </a-menu-item>
<a-menu-item key="3"> <a-menu-item key="3" v-if="trueFalse(record.permission,3)">
<a-button type="link" class="btn_item" @click="emptyItem(record)"> <a-button type="link" class="btn_item" @click="emptyItem(record)">
<span class="empty"></span> <span class="empty"></span>
清空 清空
@@ -632,10 +632,11 @@ import { message } from "ant-design-vue";
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
const router = useRouter(); const router = useRouter();
const state = reactive({ const state = reactive({
loadData: false,
saveList: [], saveList: [],
powerStatus:[], powerStatus:{},
saveListPid: '', saveListPid: '',
idValue: '', idValue: null,
valueAll: [], valueAll: [],
uploadStatus: true, uploadStatus: true,
uploadId: '', uploadId: '',
@@ -694,6 +695,11 @@ import { message } from "ant-design-vue";
state.tableLoading = true state.tableLoading = true
listData() listData()
}) })
const trueFalse = (per,i) => {
if (per) {
return (per + "").split(",").some(t => t== i);
}
}
//搜索 //搜索
const serchList = () => { const serchList = () => {
state.tableLoading = true state.tableLoading = true
@@ -710,7 +716,8 @@ import { message } from "ant-design-vue";
await list({ await list({
evaluationName: state.serchName, evaluationName: state.serchName,
pageNo: state.searchParam.pageNo, pageNo: state.searchParam.pageNo,
pageSize: state.searchParam.pageSize pageSize: state.searchParam.pageSize,
workNum:userInfo.value.userNo
}).then((res) => { }).then((res) => {
console.log(res,'resdata') console.log(res,'resdata')
state.tableData = res.data.records state.tableData = res.data.records
@@ -995,12 +1002,13 @@ import { message } from "ant-design-vue";
} }
const bgupload1 = (record) => { const bgupload1 = (record) => {
console.log(record,'record') console.log(record,'record')
state.btShowEdit = trueFalse(record.permission,2)
state.uploadId = record.id state.uploadId = record.id
state.uploadName = userInfo.value.realName state.uploadName = userInfo.value.realName
state.formData = {...record} state.formData = {...record}
state.uploadStatus = false state.uploadStatus = false
state.bg_check = true; state.bg_check = true;
state.btShow = false state.btShow = trueFalse(record.permission,4)
} }
const downloadAll = async (record) => { const downloadAll = async (record) => {
window.open(`/activityApi/evaluation/download?id=${record.id}`); window.open(`/activityApi/evaluation/download?id=${record.id}`);
@@ -1010,6 +1018,7 @@ import { message } from "ant-design-vue";
state.errorMessage = '' state.errorMessage = ''
state.uploadId = '' state.uploadId = ''
state.uploadName = '' state.uploadName = ''
state.loadData = false
state.uploadStatus = true state.uploadStatus = true
state.btShow = true state.btShow = true
state.btShowEdit = true state.btShowEdit = true
@@ -1044,7 +1053,7 @@ import { message } from "ant-design-vue";
console.log(res.data,'data') console.log(res.data,'data')
}) })
} }
if(state.valueAll.length != 0){ if(state.valueAll.length != 0 && !state.loadData){
state.valueAll.forEach((item)=>{ state.valueAll.forEach((item)=>{
if(item.createId){ if(item.createId){
item.createId = userInfo.value.userId item.createId = userInfo.value.userId
@@ -1138,7 +1147,6 @@ import { message } from "ant-design-vue";
return false return false
} }
const handleChange = (info) => { const handleChange = (info) => {
console.log(info,'aaa')
let resFileList = [...info.fileList]; let resFileList = [...info.fileList];
resFileList = resFileList.slice(-2); resFileList = resFileList.slice(-2);
@@ -1196,6 +1204,7 @@ import { message } from "ant-design-vue";
state.bg_check = true state.bg_check = true
state.btShow = true state.btShow = true
state.btShowEdit = false state.btShowEdit = false
state.loadData = true
state.formData = {...record} state.formData = {...record}
} }
//权限列表 //权限列表
@@ -1283,12 +1292,13 @@ import { message } from "ant-design-vue";
} }
//添加权限确定 //添加权限确定
const addSettingUp = async () => { const addSettingUp = async () => {
console.log(state.saveList,'saveList')
await savePermission({userList:state.saveList,pid:state.saveListPid}) await savePermission({userList:state.saveList,pid:state.saveListPid})
saveListItem() saveListItem()
of_addsetting() of_addsetting()
} }
const powerSetting = async (record) => { const powerSetting = async (record) => {
state.powerStatus.push(record) state.powerStatus = (record)
state.bg_power = true state.bg_power = true
state.checkclick = record.permission state.checkclick = record.permission
} }
@@ -1296,25 +1306,27 @@ import { message } from "ant-design-vue";
state.bg_power = false state.bg_power = false
} }
const powerTrue = async () => { const powerTrue = async () => {
state.tableLoadingAdd = true // state.tableLoadingAdd = true
console.log(state.powerStatus,'sss') state.powerStatus.permission = state.checkclick.join(",")
state.powerStatus[0].permission = state.checkclick.join(",") // state.powerStatus[0].permission = state.checkclick.join(",")
await savePermission({userList:state.powerStatus,pid:state.saveListPid}).then((res)=>{ // await savePermission({userList:state.powerStatus,pid:state.saveListPid}).then((res)=>{
if(res.code === 200){ // if(res.code === 200){
searchSave() // searchSave()
saveListItem() // saveListItem()
} // }
}) // })
of_power() of_power()
} }
const textEnableAdd = async (record) => { const textEnableAdd = async (record) => {
console.log(record,'record')
await updateStatus({status:0,id:record.id}).then((res)=>{ await updateStatus({status:0,id:record.id}).then((res)=>{
if(res.code === 200){ if(res.code === 200){
console.log(res,'res')
message.success('启用成功') message.success('启用成功')
record.statusList = 0 record.statusList = 0
state.saveList.push(record) if(state.powerStatus.id === record.id){
state.saveList.push(state.powerStatus)
}else{
state.saveList.push(record)
}
saveListItem() saveListItem()
} }
}) })
@@ -1347,6 +1359,7 @@ import { message } from "ant-design-vue";
searchStatusVal2, searchStatusVal2,
serchList, serchList,
serchListNo, serchListNo,
trueFalse,
columns, columns,
columnsAdd, columnsAdd,
columns2, columns2,