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

View File

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

View File

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

View File

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

View File

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