Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
XieYongHong 2023-07-12 11:25:13 +08:00
commit 763f9bbb93
5 changed files with 54 additions and 21 deletions

View File

@ -157,6 +157,7 @@ const columns = [
title: 'ID',
dataIndex: 'id',
key: 'id',
ellipsis:true,
search: {
type: 'string',
defaultTermType: 'eq',
@ -166,6 +167,7 @@ const columns = [
title: '名称',
dataIndex: 'name',
key: 'name',
ellipsis:true,
search: {
type: 'string',
first: true,
@ -175,6 +177,7 @@ const columns = [
title: '通道数量',
dataIndex: 'channelNumber',
key: 'channelNumber',
width:100,
scopedSlots: true,
},
{
@ -192,6 +195,7 @@ const columns = [
return v;
},
},
width:80
},
];
const params = ref<Record<string, any>>({});

View File

@ -974,7 +974,7 @@ const formRules = {
}
],
code: [{ required: true, message: '请选择模板'}],
signName: [{ required: true, message: '请输入签名' }],
signName: [{ required: true, message: '请选择签名' }],
phoneNumber: [
{ max: 64, message: '最多可输入64个字符' },
{

View File

@ -430,6 +430,9 @@ const selectChange = () => {
xData.push(item.data.timeString);
sData.push(item.data.value);
});
const maxY = sData.sort((a,b)=>{
return b-a
})[0]
alarmStatisticsOption.value = {
xAxis: {
type: 'category',
@ -448,7 +451,7 @@ const selectChange = () => {
grid: {
top: '2%',
bottom: '5%',
left: '24px',
left: maxY > 10000 ? '50px' : '40px',
right: '48px',
},
series: [

View File

@ -11,6 +11,10 @@
ref="tableRef"
:request="table.requestFun"
:gridColumn="2"
:scroll="{
x:true,
y:610,
}"
:params="queryParams"
:rowSelection="{
selectedRowKeys: tableData._selectedRowKeys,
@ -613,6 +617,7 @@ watch(
<style lang="less" scoped>
.product-container {
:deep(.ant-table td) { white-space: nowrap; }
:deep(.ant-table-tbody) {
.ant-table-cell {
.ant-space-item {

View File

@ -23,7 +23,9 @@
:params="queryParams"
:rowSelection="{
selectedRowKeys: table._selectedRowKeys,
onChange: table.onSelectChange,
onSelect: table.onSelectChange,
onSelectNone:() => table._selectedRowKeys = [],
onSelectAll:selectAll
}"
model="TABLE"
:defaultParams="{
@ -53,15 +55,15 @@ const props = defineProps<{
//
const loading = ref(false);
const confirm = () => {
if (department.crossPageKeys.length && props.parentId) {
if (table._selectedRowKeys && props.parentId) {
loading.value = true;
bindUser_api(props.parentId, department.crossPageKeys)
bindUser_api(props.parentId,table._selectedRowKeys)
.then(() => {
onlyMessage('操作成功');
emits('confirm');
emits('update:visible', false);
// table._selectedRowKeys = [];
department.setSelectedKeys([]);
table._selectedRowKeys = []
})
.finally(() => (loading.value = false));
} else {
@ -100,7 +102,6 @@ const table = reactive({
_selectedRowKeys: [] as string[],
requestFun: async (oParams: any) => {
table.cancelSelect();
if (props.parentId) {
const params = {
...oParams,
@ -136,25 +137,45 @@ const table = reactive({
};
}
},
onSelectChange: (keys: string[]) => {
onSelectChange: (row: any[],selected:Boolean) => {
// console.log(': ', keys);
// table._selectedRowKeys = keys;
department.setSelectedKeys(keys, keys.length ? 'concat' : '');
},
cancelSelect: () => {
// console.log(' ', 1111111111);
// table._selectedRowKeys = [];
department.setSelectedKeys([], 'concat');
// department.setSelectedKeys(keys, keys.length ? 'concat' : '');
const arr = new Set(table._selectedRowKeys)
if(selected){
arr.add(row.id)
}else{
arr.delete(row.id)
}
table._selectedRowKeys = [...arr.values()];
},
});
const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
if (selected) {
changeRows.map((i: any) => {
if (!table._selectedRowKeys.includes(i.id)) {
table._selectedRowKeys.push(i.id)
}
})
} else {
const arr = changeRows.map((item: any) => item.id)
const _ids: string[] = [];
table._selectedRowKeys.map((i: any) => {
if (!arr.includes(i)) {
_ids.push(i)
}
})
table._selectedRowKeys = _ids;
}
}
watch(
() => department.crossPageKeys,
(val: string[]) => {
// console.log('crossPageKeys: ', val);
table._selectedRowKeys = val;
},
);
// watch(
// () => department.crossPageKeys,
// (val: string[]) => {
// // console.log('crossPageKeys: ', val);
// table._selectedRowKeys = val;
// },
// );
</script>
<style lang="less" scoped>