fix: bug#16173、16172、16138、15092
This commit is contained in:
parent
56b3b0acfb
commit
458b5dd8f9
|
@ -44,6 +44,7 @@
|
||||||
<j-form-item
|
<j-form-item
|
||||||
label="地址"
|
label="地址"
|
||||||
:name="['pointKey']"
|
:name="['pointKey']"
|
||||||
|
validateFirst
|
||||||
:rules="[
|
:rules="[
|
||||||
...ModBusRules.pointKey,
|
...ModBusRules.pointKey,
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,13 +18,6 @@
|
||||||
}"
|
}"
|
||||||
@cancelSelect="selectedRowKeys = []"
|
@cancelSelect="selectedRowKeys = []"
|
||||||
size="small"
|
size="small"
|
||||||
:defaultParams="{
|
|
||||||
pageSize: 10,
|
|
||||||
}"
|
|
||||||
:pagination="{
|
|
||||||
showSizeChanger: true,
|
|
||||||
pageSizeOptions: ['10', '20', '50', '100'],
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<template #headerTitle>
|
<template #headerTitle>
|
||||||
<j-space>
|
<j-space>
|
||||||
|
@ -191,6 +184,7 @@ const table = {
|
||||||
|
|
||||||
// 弹窗相关
|
// 弹窗相关
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
@ -1,42 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal
|
<j-modal visible title="新增" width="1000px" @ok="confirm" @cancel="emits('update:visible', false)">
|
||||||
visible
|
|
||||||
title="新增"
|
|
||||||
width="1000px"
|
|
||||||
@ok="confirm"
|
|
||||||
@cancel="emits('update:visible', false)"
|
|
||||||
>
|
|
||||||
<!-- <j-advanced-search
|
<!-- <j-advanced-search
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
type="simple"
|
type="simple"
|
||||||
@search="(params:any)=>queryParams = {...params}"
|
@search="(params:any)=>queryParams = {...params}"
|
||||||
/> -->
|
/> -->
|
||||||
<pro-search
|
<pro-search :columns="columns" target="simple" @search="(params: any) => queryParams = { ...params }" />
|
||||||
:columns="columns"
|
|
||||||
target="simple"
|
|
||||||
@search="(params:any)=>queryParams = {...params}"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<j-pro-table
|
<j-pro-table ref="tableRef" :columns="columns" :request="getUserList" model="TABLE" :params="queryParams"
|
||||||
ref="tableRef"
|
|
||||||
:columns="columns"
|
|
||||||
:request="getUserList"
|
|
||||||
model="TABLE"
|
|
||||||
:params="queryParams"
|
|
||||||
:rowSelection="{
|
:rowSelection="{
|
||||||
selectedRowKeys: selectedRowKeys,
|
selectedRowKeys: selectedRowKeys,
|
||||||
onSelect: changeSelect,
|
onSelect: changeSelect,
|
||||||
}"
|
onSelectAll: selectAll,
|
||||||
@cancelSelect="selectedRowKeys = []"
|
onSelectNone: ()=>selectedRowKeys = []
|
||||||
:defaultParams="{
|
}">
|
||||||
pageSize: 10,
|
|
||||||
}"
|
|
||||||
:pagination="{
|
|
||||||
pageSizeOptions: ['10', '20', '50', '100'],
|
|
||||||
showSizeChanger: true,
|
|
||||||
hideOnSinglePage: false,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
</j-pro-table>
|
</j-pro-table>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -71,7 +48,7 @@ const columns = [
|
||||||
];
|
];
|
||||||
const queryParams = ref({});
|
const queryParams = ref({});
|
||||||
|
|
||||||
const selectedRowKeys = ref<string[]>([]);
|
const selectedRowKeys = ref<any>([]);
|
||||||
const getUserList = (oParams: any) => {
|
const getUserList = (oParams: any) => {
|
||||||
const params = {
|
const params = {
|
||||||
...oParams,
|
...oParams,
|
||||||
|
@ -117,4 +94,25 @@ const changeSelect = (item: any, state: boolean) => {
|
||||||
}
|
}
|
||||||
selectedRowKeys.value = [...arr.values()];
|
selectedRowKeys.value = [...arr.values()];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
|
||||||
|
if (selected) {
|
||||||
|
changeRows.map((i: any) => {
|
||||||
|
if (!selectedRowKeys.value.includes(i.id)) {
|
||||||
|
selectedRowKeys.value.push(i.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const arr = changeRows.map((item: any) => item.id)
|
||||||
|
const _ids: string[] = [];
|
||||||
|
selectedRowKeys.value.map((i: any) => {
|
||||||
|
if (!arr.includes(i)) {
|
||||||
|
_ids.push(i)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
selectedRowKeys.value = _ids
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue