选人调整。样式调整
parent
829acc5857
commit
3a7e373394
|
@ -13,12 +13,14 @@
|
||||||
:row-key="rowKey"
|
:row-key="rowKey"
|
||||||
:height="tableHeight"
|
:height="tableHeight"
|
||||||
@select="selected"
|
@select="selected"
|
||||||
|
@select-all="selectAll"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
reserve-selection
|
reserve-selection
|
||||||
v-if="showSelection"
|
v-if="showSelection"
|
||||||
type="selection"
|
type="selection"
|
||||||
width="55"
|
width="55"
|
||||||
|
:selectable="selectable"
|
||||||
/>
|
/>
|
||||||
<el-table-column v-if="showIndex" type="index" width="50" label="序号" />
|
<el-table-column v-if="showIndex" type="index" width="50" label="序号" />
|
||||||
<template>
|
<template>
|
||||||
|
@ -154,6 +156,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "100%",
|
default: "100%",
|
||||||
},
|
},
|
||||||
|
selectable:{
|
||||||
|
type: Function,
|
||||||
|
default: ()=>true,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -192,6 +198,9 @@ export default {
|
||||||
selected(arr, row) {
|
selected(arr, row) {
|
||||||
this.$emit("selected", { arr, row });
|
this.$emit("selected", { arr, row });
|
||||||
},
|
},
|
||||||
|
selectAll(arr) {
|
||||||
|
this.$emit("selectAll", arr);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (this.$refs.elTableRef && this.$refs.elTableRef.doLayout) {
|
if (this.$refs.elTableRef && this.$refs.elTableRef.doLayout) {
|
||||||
|
|
|
@ -24,10 +24,12 @@
|
||||||
:show-index="true"
|
:show-index="true"
|
||||||
:table-height="tableHeight"
|
:table-height="tableHeight"
|
||||||
:multiSelect="multiSelect"
|
:multiSelect="multiSelect"
|
||||||
|
:selectable="selectable"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
@selected="selectRow"
|
@selected="selectRow"
|
||||||
|
@selectAll="selectAll"
|
||||||
rowKey="userId"
|
rowKey="userId"
|
||||||
:rowClick="
|
:rowClick="
|
||||||
(row) => {
|
(row) => {
|
||||||
|
@ -95,6 +97,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
selectable: {
|
||||||
|
type: Function,
|
||||||
|
default: () => true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -126,6 +132,7 @@ export default {
|
||||||
],
|
],
|
||||||
userData: [],
|
userData: [],
|
||||||
isInternalChange: false,
|
isInternalChange: false,
|
||||||
|
selectAllData: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
emits: ["close", "confirm"],
|
emits: ["close", "confirm"],
|
||||||
|
@ -151,9 +158,9 @@ export default {
|
||||||
else
|
else
|
||||||
this.$emit(
|
this.$emit(
|
||||||
"confirm",
|
"confirm",
|
||||||
this.currentSelectedUser.map((ele, index) => ({
|
this.selectedUsers.map((ele, index) => ({
|
||||||
userId: ele,
|
userId: ele.userId,
|
||||||
nickName: this.currentSelectedUserName[index],
|
nickName: ele.nickName,
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -175,32 +182,37 @@ export default {
|
||||||
this.isInternalChange = false;
|
this.isInternalChange = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.selectedUsers = val;
|
// this.selectedUsers = val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectRow({ arr, row }) {
|
selectRow({ arr, row }) {
|
||||||
|
if (!row) return;
|
||||||
if (
|
if (this.selectedUsers.filter((ele) => ele.userId == row.userId).length) {
|
||||||
this.currentSelectedUser.filter((ele) => ele.userId == row.userId)
|
this.selectedUsers = this.selectedUsers.filter(
|
||||||
.length
|
(ele) => ele.userId != row.userId
|
||||||
) {
|
|
||||||
this.currentSelectedUser = this.currentSelectedUser.filter(
|
|
||||||
(ele) => ele != row.userId
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.currentSelectedUser.push(row.userId);
|
this.selectedUsers.push({ userId: row.userId, nickName: row.nickName });
|
||||||
}
|
}
|
||||||
if (
|
},
|
||||||
this.currentSelectedUserName.filter((ele) => ele == row.nickName).length
|
selectAll(arr) {
|
||||||
) {
|
let filterArr = this.selectAllData.filter((ele) =>
|
||||||
this.currentSelectedUserName = this.currentSelectedUserName.filter(
|
!arr.some((item) => item.userId == ele.userId)
|
||||||
(ele) => ele != row.nickName
|
);
|
||||||
);
|
console.log(filterArr,11);
|
||||||
} else {
|
|
||||||
this.currentSelectedUserName.push(row.nickName);
|
|
||||||
}
|
|
||||||
console.log(this.currentSelectedUserName,22);
|
|
||||||
|
|
||||||
|
arr.forEach((ele) => {
|
||||||
|
if (
|
||||||
|
!this.selectedUsers.filter((item) => item.userId == ele.userId).length
|
||||||
|
)
|
||||||
|
this.selectRow({ row: ele });
|
||||||
|
});
|
||||||
|
filterArr.forEach((ele) => {
|
||||||
|
|
||||||
|
this.selectRow({ row: ele});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
fetchUserList: async function () {
|
fetchUserList: async function () {
|
||||||
const response = await systemApi.getUserList({
|
const response = await systemApi.getUserList({
|
||||||
|
@ -227,28 +239,6 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// currentSelectedUser: {
|
|
||||||
// handler(newVal) {
|
|
||||||
// this.isInternalChange = true;
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.selectedUsers = newVal;
|
|
||||||
// if (this.$refs.customTableRef) {
|
|
||||||
// this.$refs.customTableRef.clearSelection();
|
|
||||||
// newVal.forEach((user) => {
|
|
||||||
// const row = this.userData.find(
|
|
||||||
// (item) => item.userId === user.userId
|
|
||||||
// );
|
|
||||||
// if (row) {
|
|
||||||
// this.$refs.customTableRef.toggleRowSelection(row, true);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// this.isInternalChange = false;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// immediate: true,
|
|
||||||
// deep: true,
|
|
||||||
// },
|
|
||||||
currentSelectedUser: {
|
currentSelectedUser: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -263,16 +253,23 @@ export default {
|
||||||
this.selectedUsers = [];
|
this.selectedUsers = [];
|
||||||
this.$refs.customTableRef?.setCurrentRow();
|
this.$refs.customTableRef?.setCurrentRow();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!newVal.length) {
|
if (!newVal.length) {
|
||||||
this.selectedUsers = [];
|
this.selectedUsers = [];
|
||||||
this.$refs.customTableRef?.clearSelection();
|
this.$refs.customTableRef?.clearSelection();
|
||||||
} else {
|
} else {
|
||||||
// this.$refs.customTableRef?.clearSelection();
|
// this.$refs.customTableRef?.clearSelection();
|
||||||
newVal.forEach((item) => {
|
this.selectedUsers = [];
|
||||||
|
newVal.forEach((item, index) => {
|
||||||
|
this.selectedUsers.push({
|
||||||
|
userId: item,
|
||||||
|
nickName: this.currentSelectedUserName[index],
|
||||||
|
});
|
||||||
let row = this.userData.find((ele) => ele.userId == item);
|
let row = this.userData.find((ele) => ele.userId == item);
|
||||||
if (row)
|
if (row) {
|
||||||
|
this.selectAllData.push(row);
|
||||||
this.$refs.customTableRef?.toggleRowSelection(row, true);
|
this.$refs.customTableRef?.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,9 +290,14 @@ export default {
|
||||||
this.$refs.customTableRef?.setCurrentRow(row);
|
this.$refs.customTableRef?.setCurrentRow(row);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
this.selectAllData = [];
|
||||||
this.currentSelectedUser.forEach((item) => {
|
this.currentSelectedUser.forEach((item) => {
|
||||||
let row = newVal.find((ele) => ele.userId == item);
|
let row = newVal.find((ele) => ele.userId == item);
|
||||||
if (row) this.$refs.customTableRef?.toggleRowSelection(row, true);
|
if (row) {
|
||||||
|
this.selectAllData.push(row);
|
||||||
|
|
||||||
|
this.$refs.customTableRef?.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="自评总结" prop="score" v-if="isNormal" width="150">
|
<el-table-column class-name="editCell" label="自评总结" prop="score" v-if="isNormal" minWidth="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -211,11 +211,11 @@ export default {
|
||||||
remark: "",
|
remark: "",
|
||||||
isEdit: "",
|
isEdit: "",
|
||||||
headers: [
|
headers: [
|
||||||
{ label: "考核项", prop: "reviewItem", minWidth: 200 },
|
{ label: "考核项", prop: "reviewItem", minWidth: 150 },
|
||||||
{
|
{
|
||||||
label: "评分标准",
|
label: "评分标准",
|
||||||
prop: "remarks",
|
prop: "remarks",
|
||||||
minWidth: 300,
|
minWidth:this.$route.query.isNormal? 240:360,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// 二维数组,每个子数组代表一个表格的数据
|
// 二维数组,每个子数组代表一个表格的数据
|
||||||
|
@ -521,13 +521,24 @@ export default {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #ff7d00;
|
color: #ff7d00;
|
||||||
}
|
}
|
||||||
::v-deep .sorceTableCell .cell {
|
::v-deep .el-table__body .sorceTableCell .cell {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
::v-deep .sorceTableCell.el-table__cell{
|
||||||
|
padding-right: 10px !important;
|
||||||
|
}
|
||||||
::v-deep .el-table__body .el-table__cell {
|
::v-deep .el-table__body .el-table__cell {
|
||||||
padding: 20px 40px;
|
padding: 20px 40px;
|
||||||
}
|
}
|
||||||
::v-deep .el-table__header .el-table__cell {
|
::v-deep .el-table__header .el-table__cell {
|
||||||
padding: 14px 30px;
|
padding: 14px 30px;
|
||||||
|
|
||||||
|
}
|
||||||
|
::v-deep .el-table__header .el-table__cell .cell{
|
||||||
|
padding-left: 20px !important;
|
||||||
|
}
|
||||||
|
::v-deep .editCell{
|
||||||
|
padding-right: 20px !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
:currentSelectedUserName="currentSelectedUserName"
|
:currentSelectedUserName="currentSelectedUserName"
|
||||||
:showSelection="true"
|
:showSelection="true"
|
||||||
:highligt="false"
|
:highligt="false"
|
||||||
|
:selectable="selectable"
|
||||||
ref="selectUserRef"
|
ref="selectUserRef"
|
||||||
@confirm="handleUserConfirm"
|
@confirm="handleUserConfirm"
|
||||||
@close="handleUserClose"
|
@close="handleUserClose"
|
||||||
|
@ -681,8 +682,14 @@ export default {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log(this.scoreList, 11);
|
|
||||||
},
|
},
|
||||||
|
selectable(row,index){
|
||||||
|
if(row.roles.find((ele)=>ele.roleName=='普通员工')){
|
||||||
|
return true
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTaskList();
|
this.getTaskList();
|
||||||
|
|
|
@ -249,10 +249,11 @@ export default {
|
||||||
|
|
||||||
this.logData.map((item) => {
|
this.logData.map((item) => {
|
||||||
var ele = document.getElementById(item.date.split(" ")[0]);
|
var ele = document.getElementById(item.date.split(" ")[0]);
|
||||||
|
|
||||||
if (ele) {
|
if (ele) {
|
||||||
if (item.state == -1) {
|
if (item.state == -1) {
|
||||||
ele.style = "background:#ecf5ff";
|
ele.style = "background:#ecf5ff";
|
||||||
} else if (item.state == 0) {
|
} else if (item.state == 0||item.state == 1) {
|
||||||
ele.style = `background:linear-gradient(to right, #409eff ${
|
ele.style = `background:linear-gradient(to right, #409eff ${
|
||||||
(item.workTime || 1) * 100
|
(item.workTime || 1) * 100
|
||||||
}% , #ecf5ff ${(item.workTime || 1) * 100}%);color:${
|
}% , #ecf5ff ${(item.workTime || 1) * 100}%);color:${
|
||||||
|
|
Loading…
Reference in New Issue