Merge pull request 'fix:样式修改' (#334) from fix/change_task into test

Reviewed-on: #334
pull/335/head
yaoshuli 1 year ago
commit aa49593f6c

@ -46,6 +46,7 @@ const scrollContainer = ref(null)
const tableData = ref<any>([]) const tableData = ref<any>([])
const finalStore = useFinal() const finalStore = useFinal()
const valuetwo=ref(false) const valuetwo=ref(false)
const loadcheck=ref(false)
let num = 1 let num = 1
const pagination = reactive({ const pagination = reactive({
page: 1, page: 1,
@ -61,11 +62,16 @@ const showActions = computed(() => {
console.log(haeaderstore) console.log(haeaderstore)
function handleCheck(row: any, showcheck: any) { function handleCheck(row: any, showcheck: any) {
let num=0
if (showcheck == false) { if (showcheck == false) {
console.log(tableData.value) console.log(tableData.value)
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
if (item.length > 0) { if (item.length > 0) {
item.forEach((itemx, index) => { item.forEach((itemx, index) => {
console.log(itemx)
if(itemx.states==2){
num=num+1
}
if (row.id == itemx.id) if (row.id == itemx.id)
itemx.showcheck = true itemx.showcheck = true
@ -79,6 +85,9 @@ function handleCheck(row: any, showcheck: any) {
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
if (item.length > 0) { if (item.length > 0) {
item.forEach((itemx, index) => { item.forEach((itemx, index) => {
if(itemx.states==2){
num=num+1
}
if (row.id == itemx.id) if (row.id == itemx.id)
itemx.showcheck = false itemx.showcheck = false
@ -88,6 +97,19 @@ function handleCheck(row: any, showcheck: any) {
}) })
selectionIds.value.pop(row) selectionIds.value.pop(row)
} }
if(selectionIds.value.length==num){
valuetwo.value=true
loadcheck.value=false
}else if(selectionIds.value.length<num&&selectionIds.value.length!=0){
valuetwo.value=false
loadcheck.value=true
}else if(selectionIds.value.length==0){
//alert(selectionIds.value.length)
loadcheck.value=false
valuetwo.value=false
}
} }
function switchBatch() { function switchBatch() {
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
@ -337,12 +359,15 @@ function tishiok(){
reload() reload()
selectionIds.value = [] selectionIds.value = []
modal.getData() modal.getData()
} }
else { else {
message.error(res.message) message.error(res.message)
selectionIds.value = [] selectionIds.value = []
} }
}) })
loadcheck.value=false
valuetwo.value=false valuetwo.value=false
} }
// //
@ -495,10 +520,15 @@ function notpass() {
const modal = unref(headerref)! as any const modal = unref(headerref)! as any
initData(1, 20, {}, props.taskvalue) initData(1, 20, {}, props.taskvalue)
valuetwo.value=false valuetwo.value=false
loadcheck.value=false
selectionIds.value = [] selectionIds.value = []
modal.getData() modal.getData()
// haeaderstore.setDataConfig(true) // haeaderstore.setDataConfig(true)
} }
function chekcall(){
valuetwo.value=true
}
watch( watch(
() => finalStore.asideValue, () => finalStore.asideValue,
(newVal, oldVal) => { (newVal, oldVal) => {
@ -511,7 +541,7 @@ watch(
() => valuetwo.value, () => valuetwo.value,
(newVal, oldVal) => { (newVal, oldVal) => {
let newlist=[] let newlist=[]
let newsels=[]
if(valuetwo.value){ if(valuetwo.value){
tableData.value.map((item)=>{ tableData.value.map((item)=>{
let ooo=[] let ooo=[]
@ -519,7 +549,7 @@ watch(
console.log(item[i]) console.log(item[i])
item[i].showcheck=true item[i].showcheck=true
if(item[i].states == 2){ if(item[i].states == 2){
selectionIds.value.push(item[i]) newsels.push(item[i])
} }
ooo.push(item[i]) ooo.push(item[i])
@ -529,9 +559,10 @@ watch(
item=ooo item=ooo
newlist.push(item) newlist.push(item)
}) })
selectionIds.value=newsels
tableData.value=newlist tableData.value=newlist
}else{ loadcheck.value=false
}else if(!valuetwo.value&&loadcheck.value==false){
tableData.value.map((item)=>{ tableData.value.map((item)=>{
let ooo=[] let ooo=[]
for (let i=0; i<item.length;i++){ for (let i=0; i<item.length;i++){
@ -545,6 +576,7 @@ watch(
}) })
selectionIds.value=[] selectionIds.value=[]
tableData.value=newlist tableData.value=newlist
loadcheck.value=false
} }
@ -660,9 +692,12 @@ defineExpose({
<span>提报人排序</span><SvgIcon style="margin-left: 6px" name="sort" size="13" /> <span>提报人排序</span><SvgIcon style="margin-left: 6px" name="sort" size="13" />
</div> </div>
</div> </div>
<div class="checkall"> <n-checkbox v-model:checked="valuetwo"> <div class="checkall" v-if="!loadcheck"> <n-checkbox v-model:checked="valuetwo">
全选 全选
</n-checkbox></div> </n-checkbox></div>
<div class="checkall" style="right:45.5px" v-if="loadcheck" @click="chekcall">
<div class="checking"></div>全选
</div>
<div style="width: 3vw"> <div style="width: 3vw">
<!-- <SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" /> <!-- <SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" />
<SvgIcon <SvgIcon
@ -1107,6 +1142,7 @@ defineExpose({
background-color: #1980ff; background-color: #1980ff;
border-left: 0; border-left: 0;
border-top: 0; border-top: 0;
border-radius: 0.1rem;
} }
/* 定义滚动条的宽度及背景颜色 */ /* 定义滚动条的宽度及背景颜色 */
::-webkit-scrollbar { ::-webkit-scrollbar {

Loading…
Cancel
Save