diff --git a/src/views/evaluation/EvaDown.vue b/src/views/evaluation/EvaDown.vue index 12564cce..9905326f 100644 --- a/src/views/evaluation/EvaDown.vue +++ b/src/views/evaluation/EvaDown.vue @@ -77,6 +77,7 @@ import { useStore } from "vuex"; const route = useRoute(); const state = reactive({ searchName: '', + tableLoading: false, tableData:[], total: 0, params: { @@ -145,20 +146,25 @@ import { useStore } from "vuex"; const changePagination = (page,pageSize) => { state.params.pageNo = page state.params.pageSize = pageSize + listData() } const downloadAll = (record) => { window.open(`/activityApi/evaluation/download?id=${route.query.id}`); } const listData = async () => { + state.tableLoading = true await getPage({ id:route.query.id, - + pageNo: state.params.pageNo, + pageSize: state.params.pageSize, }).then((res) => { - state.tableData = res.data.records, - console.log(state.tableData,'data') - state.total = res.data.total + if(res.code === 200){ + state.tableLoading = false + state.tableData = res.data.records, + console.log(state.tableData,'data') + state.total = res.data.total + } }) - } const downloadItem = (record) => { window.open(`/activityApi/evaluation/detail/downloadById?id=${record.id}`) diff --git a/src/views/evaluation/evaluationUpload.vue b/src/views/evaluation/evaluationUpload.vue index 453d446c..b8f44ba0 100644 --- a/src/views/evaluation/evaluationUpload.vue +++ b/src/views/evaluation/evaluationUpload.vue @@ -633,6 +633,7 @@ import { message } from "ant-design-vue"; const router = useRouter(); const state = reactive({ saveList: [], + powerStatus:[], saveListPid: '', idValue: '', valueAll: [], @@ -734,7 +735,12 @@ import { message } from "ant-design-vue"; const changePaginations = (page,pageSize) => { state.params.pageNo = page state.params.pageSize = pageSize + saveListItem() } + watch(()=>state.params.pageSize,()=>{ + state.params.pageNo = 1 + saveListItem() + }) // 添加权限 const paginationAdd = computed(() => ({ total: state.totalAdd, @@ -747,6 +753,7 @@ import { message } from "ant-design-vue"; const changePaginationsAdd = (page,pageSize) => { state.paramsAdd.pageNo = page state.paramsAdd.pageSize = pageSize + searchSave() } const columns = ref([ { @@ -836,11 +843,41 @@ import { message } from "ant-design-vue"; }, { title: "权限", - dataIndex: "permissionList", - key: "permissionList", + dataIndex: "permission", + key: "permission", className: "h", ellipsis: true, width: 100, + customRender: ({ text }) => { + if(text == null){ + return "" + } + const permissions = text.split(',').map(Number); + const displayTexts = []; + for (const permission of permissions) { + switch (permission) { + case 1: + displayTexts.push("查看"); + break; + case 2: + displayTexts.push("上传"); + break; + case 3: + displayTexts.push("清空"); + break; + case 4: + displayTexts.push("编辑"); + break; + case 5: + displayTexts.push("下载"); + break; + case 6: + displayTexts.push("删除"); + break; + } + } + return displayTexts.join(", "); + }, }, { title: "状态", @@ -1168,6 +1205,8 @@ import { message } from "ant-design-vue"; pid:state.saveListPid, nameOrWorkNum:state.searchParam.createNames, status:state.searchParam.status2, + pageNo: state.params.pageNo, + pageSize: state.params.pageSize }).then((res)=>{ console.log(res,'res') if(res.code === 200){ @@ -1185,6 +1224,7 @@ import { message } from "ant-design-vue"; saveListItem() } const of_setting = () => { + state.params.pageNo = 1 state.bg_setting = false } const settingUp = () => { @@ -1209,6 +1249,7 @@ import { message } from "ant-design-vue"; } //搜索权限列表 const searchSaveList = () => { + state.params.pageNo = 1 saveListItem() } const of_addsetting = () => { @@ -1219,15 +1260,21 @@ import { message } from "ant-design-vue"; //搜索权限 const searchSave = async () => { state.tableLoadingAdd = true - await adminList({keyword:state.searchParam.createName}).then((res)=>{ - state.tableDataAdd = res.data - state.tableLoadingAdd = false - console.log(res,'res') - }) - const workNums = state.tableData1.map(item=>item.workNum) - state.tableDataAdd.forEach(item => { - if(workNums.includes(item.userNo)) - item.status = 0 + await adminList({ + keyword:state.searchParam.createName, + pageNo: state.paramsAdd.pageNo, + pageSize: state.paramsAdd.pageSize, + }).then((res)=>{ + if(res.code === 200){ + state.tableDataAdd = res.data + state.tableLoadingAdd = false + console.log(res,'res') + const workNums = state.tableData1.map(item=>item.workNum) + state.tableDataAdd.forEach(item => { + if(workNums.includes(item.userNo)) + item.status = 0 + }) + } }) } const removeSave = () => { @@ -1236,20 +1283,28 @@ import { message } from "ant-design-vue"; } //添加权限确定 const addSettingUp = async () => { - console.log(state.saveList,'state.saveList') await savePermission({userList:state.saveList,pid:state.saveListPid}) saveListItem() of_addsetting() } const powerSetting = async (record) => { + state.powerStatus.push(record) state.bg_power = true - state.checkclick = record.checkclick + state.checkclick = record.permission } const of_power = () => { state.bg_power = false } - const powerTrue = () => { - console.log(state.checkclick,'sss') + const powerTrue = async () => { + state.tableLoadingAdd = true + console.log(state.powerStatus,'sss') + state.powerStatus[0].permission = state.checkclick.join(",") + await savePermission({userList:state.powerStatus,pid:state.saveListPid}).then((res)=>{ + if(res.code === 200){ + searchSave() + saveListItem() + } + }) of_power() } const textEnableAdd = async (record) => {