Browse Source

fix:通知管理

temp
zhaohy 2 months ago
parent
commit
f10045b64d
  1. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  2. 5
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  3. 21
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue
  4. 214
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue

3
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue

@ -11,6 +11,9 @@
}" }"
@click="clickSwitch({ enableRules: record.enableRules, record: record })" /> @click="clickSwitch({ enableRules: record.enableRules, record: record })" />
</template> </template>
<template v-if="column.dataIndex === 'valueType'">
{{ record.valueType.label }}
</template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 新增or编辑界面 --> <!-- 新增or编辑界面 -->

5
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -235,8 +235,8 @@
}; };
// //
const qzOptions = ref<SelectProps['options']>([ const qzOptions = ref<SelectProps['options']>([
{ value: 1, label: '实时值', code: '1' }, { value: 1, label: '实时值' },
{ value: 2, label: '平均值', code: '2' }, { value: 2, label: '平均值' },
]); ]);
// //
const ljOptions = ref<SelectProps['options']>([ const ljOptions = ref<SelectProps['options']>([
@ -331,6 +331,7 @@
infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || []; infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || [];
delete infoObject.value.hxAlarmRuleLogicList; delete infoObject.value.hxAlarmRuleLogicList;
infoObject.value.deviceType = selectDevice; infoObject.value.deviceType = selectDevice;
infoObject.value.valueType = infoObject.value.valueType.value;
infoObject.value.ruleType = infoObject.value.ruleType + ''; infoObject.value.ruleType = infoObject.value.ruleType + '';
} }
}); });

21
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue

@ -44,7 +44,7 @@
width: 5px; width: 5px;
height: 15px; height: 15px;
background: inherit; background: inherit;
background-color: rgba(251, 156, 67, 1); background-color: #2778ff;
border: none; border: none;
border-radius: 5px; border-radius: 5px;
-moz-box-shadow: none; -moz-box-shadow: none;
@ -66,6 +66,9 @@
:scroll="{ x: 800, y: 700 }" :scroll="{ x: 800, y: 700 }"
:pagination="pagination"> :pagination="pagination">
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'address'">
{{ record.userRoleInfos?.[0].deptRoleInfoList }}
</template>
<template v-if="column.dataIndex === 'operation'"> <template v-if="column.dataIndex === 'operation'">
<a style="color: rgb(210, 0, 5)" @click="remove(record)">移除</a> <a style="color: rgb(210, 0, 5)" @click="remove(record)">移除</a>
</template> </template>
@ -93,7 +96,7 @@
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
dataIndex: 'address', dataIndex: 'index',
width: 80, width: 80,
fixed: 'left', fixed: 'left',
customRender: (text: any) => { customRender: (text: any) => {
@ -102,7 +105,7 @@
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'deviceName', dataIndex: 'realName',
width: 80, width: 80,
fixed: 'left', fixed: 'left',
key: 'deviceName', key: 'deviceName',
@ -115,13 +118,13 @@
}, },
{ {
title: '组织关系', title: '组织关系',
dataIndex: 'site', dataIndex: 'orgName',
key: 'site', key: 'site',
}, },
{ {
title: '部门', title: '部门',
dataIndex: 'department', dataIndex: 'address',
key: 'department', key: 'address',
}, },
{ {
title: '操作', title: '操作',
@ -155,7 +158,7 @@
visibleModel.value = true; visibleModel.value = true;
let ids = []; let ids = [];
dataSource.value.forEach((item) => { dataSource.value.forEach((item) => {
ids.push(item.id); ids.push(item.userId);
}); });
linkPeoples.value.getData({ id: ids, data: dataSource }); linkPeoples.value.getData({ id: ids, data: dataSource });
}; };
@ -223,7 +226,7 @@
// //
const remove = (data: any) => { const remove = (data: any) => {
dataSource.value.forEach((item, index) => { dataSource.value.forEach((item, index) => {
if (item.id === data.id) { if (item.userId === data.userId) {
dataSource.value.splice(index, 1); dataSource.value.splice(index, 1);
} }
}); });
@ -236,7 +239,7 @@
obj.selectList = []; obj.selectList = [];
dataSource.value.forEach((item) => { dataSource.value.forEach((item) => {
obj.selectList.push({ obj.selectList.push({
people: item.id, userId: item.userId,
}); });
}); });
console.log(obj, '数据'); console.log(obj, '数据');

214
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue

@ -24,20 +24,18 @@
src="https://files.axshare.com/gsc/4T0UQR/7e/5d/a2/7e5da2a277344db8af30521cefeb70cc/images/告警设置/u150.svg?pageId=1f58c1ba-b461-4fe8-a2b3-295f1e7b0aa0" /> src="https://files.axshare.com/gsc/4T0UQR/7e/5d/a2/7e5da2a277344db8af30521cefeb70cc/images/告警设置/u150.svg?pageId=1f58c1ba-b461-4fe8-a2b3-295f1e7b0aa0" />
<div style="width: 100%; height: 370px; overflow-y: auto"> <div style="width: 100%; height: 370px; overflow-y: auto">
<a-tree <a-tree
:expanded-keys="expandedKeys" v-model:selectedKeys="selectedKeys"
:auto-expand-parent="autoExpandParent" v-model:expandedKeys="expandedKeys"
:tree-data="gData" :tree-data="deptTreeData"
@select="onSelect" @select="onSelect"
@expand="onExpand"
/></div> /></div>
<!-- <ns-tree-api v-bind="config" @select="treeSelect" /> -->
</div> </div>
<div class="box-right"> <div class="box-right">
<div style="width: 100%; display: flex; position: relative"> <div style="width: 100%; display: flex; position: relative">
<div class="border-card"></div> <div class="border-card"></div>
<span style="margin-left: 24px; color: #333333">人员列表 </span> <span style="margin-left: 24px; color: #333333">人员列表 </span>
<a-input-search <a-input-search
v-model:value="name" v-model:value="realName"
style="margin-bottom: 8px; width: 280px; position: absolute; right: 20px" style="margin-bottom: 8px; width: 280px; position: absolute; right: 20px"
placeholder="请输入" placeholder="请输入"
allowClear="true" allowClear="true"
@ -54,11 +52,18 @@
onChange: onSelectChange, onChange: onSelectChange,
}" }"
:columns="columns" :columns="columns"
:loading="loading"
:data-source="dataSource" :data-source="dataSource"
:rowKey="(record: any) => record.id" :rowKey="(record: any) => record.userId"
:pagination="pagination" :pagination="pagination"
:bordered="true" :bordered="true"
:size="'middle'" /> :size="'middle'">
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'address'">
{{ record.userRoleInfos?.[0].deptRoleInfoList }}
</template>
</template>
</a-table>
</div> </div>
</div> </div>
</div> </div>
@ -69,51 +74,23 @@
import { ref, watch, computed } from 'vue'; import { ref, watch, computed } from 'vue';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import type { TreeProps } from 'ant-design-vue'; import type { TreeProps } from 'ant-design-vue';
import { device } from '/@/api/deviceManage'; import { origanizemanage } from '/@/api/origanizemanage';
import { department } from '/@/api/origanizemanage';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
// import { editTreeConfig } from './config'; // import { editTreeConfig } from './config';
//
const x = 3;
const y = 2;
const z = 1;
const genData: TreeProps['treeData'] = [];
const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => {
const preKey = _preKey || '0';
const tns = _tns || genData;
const children = [];
for (let i = 0; i < x; i++) {
const key = `${preKey}-${i}`;
tns.push({ title: key, key });
if (i < y) {
children.push(key);
}
}
if (_level < 0) {
return tns;
}
const level = _level - 1;
children.forEach((key, index) => {
tns[index].children = [];
return generateData(level, key, tns[index].children);
});
};
generateData(z);
const dataList: TreeProps['treeData'] = []; const dataList: TreeProps['treeData'] = [];
const generateList = (data: TreeProps['treeData']) => { const generateList = (data: TreeProps['treeData']) => {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
const node = data[i]; const node = data[i];
const key = node.key; const key = node.key;
dataList.push({ key, title: key }); dataList.push({ key, title: node.title });
if (node.children) { if (node.children) {
generateList(node.children); generateList(node.children);
} }
} }
}; };
generateList(genData);
const getParentKey = ( const getParentKey = (
key: string | number, key: string | number,
tree: TreeProps['treeData'], tree: TreeProps['treeData'],
@ -133,55 +110,101 @@
}; };
export default defineComponent({ export default defineComponent({
setup(props, { emit }) { setup(props, { emit }) {
// const config = computed(() => {
// return editTreeConfig(result);
// });
// //
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
const dataSource = ref([]); const dataSource = ref([]);
const loading = ref(false);
const selectedRowKey = ref([]); const selectedRowKey = ref([]);
const selectedRow = ref([]); const selectedRow = ref([]);
const name = ref(null); const realName = ref(null);
//
const expandedKeys = ref<(string | number)[]>([]);
const selectedKeys = ref([]);
const searchValue = ref<string>('');
const deviceName = ref<string>('');
const autoExpandParent = ref<boolean>(true);
const deptTreeData = ref([]);
//
const selectOrgId = ref('');
selectOrgId.value = result;
//
const selectDeptId = ref('');
const onSearch = () => { const onSearch = () => {
http pagination.value.current = 1;
.post(device.queryDevicePage, { getList();
pageNum: pagination.value.current,
pageSize: pagination.value.pageSize,
deviceName: name.value,
orgId: orgId.value,
})
.then((res) => {
dataSource.value = res.data.records;
pagination.value.total = res.data.total;
});
}; };
const onSelect = (selectedKeys: any, info: any) => { const onSelect = (selectedKeys: any, info: any) => {
console.log('selected', selectedKeys, info.node.dataRef); selectedKeys.value = selectedKeys;
if (info.node.dataRef.deptInfo) {
selectDeptId.value = info.node.dataRef.deptInfo.deptId;
selectOrgId.value = info.node.dataRef.deptInfo.orgId;
}
if (info.node.dataRef.orgInfo) {
selectOrgId.value = info.node.dataRef.orgInfo.orgId;
selectDeptId.value = '';
}
pagination.value.current = 1; pagination.value.current = 1;
onSearch(); getList();
};
//
const processDepartmentTree = (tree) => {
tree.forEach((item) => {
item.deptInfo = item.deptInfo;
item.key = item.deptInfo.deptId;
item.title = item.deptInfo.deptName;
item.children = processDepartmentTree(item.children); //
});
return tree;
}; };
const handleChangePage = (current: number, pageSize: number) => { //
pagination.value.current = current; const getDepartList = (params) => {
pagination.value.pageSize = pageSize; return http.post(department.queryDeptTree, params).then((res) => {
const result = res.data.map((item) => ({
key: item.orgInfo.orgId,
orgInfo: item.orgInfo,
title: item.orgInfo.orgName,
children: processDepartmentTree(item.deptTrees),
}));
return result;
});
};
//
const getTreeData = () => {
getDepartList({ orgId: orgId.value }).then((res) => {
deptTreeData.value = res;
selectedKeys.value = [orgId.value];
generateList(deptTreeData.value);
});
};
//
const getList = () => {
loading.value = true;
http http
.post(device.queryDevicePage, { .post(origanizemanage.userList, {
pageNum: pagination.value.current, pageNum: pagination.value.current,
pageSize: pagination.value.pageSize, pageSize: pagination.value.pageSize,
orgId: orgId.value, orgId: selectOrgId.value,
deptId: selectDeptId.value,
realName: realName.value,
}) })
.then((res) => { .then((res) => {
dataSource.value = res.data.records; dataSource.value = res.data.records;
pagination.value.total = res.data.total; pagination.value.total = res.data.total;
loading.value = false;
}); });
console.log(selectedRowKey.value, selectedRow.value);
}; };
const onSelectChange = (selectedRowKeys: any, selectedRows: any) => { const handleChangePage = (current: number, pageSize: number) => {
console.log(selectedRowKeys, selectedRows); pagination.value.current = current;
console.log(selectedRows, '数据'); pagination.value.pageSize = pageSize;
getList();
};
const onSelectChange = (selectedRowKeys: any, selectedRows: any) => {
selectedRowKey.value = selectedRowKeys; selectedRowKey.value = selectedRowKeys;
selectedRow.value = selectedRows; selectedRow.value = selectedRows;
}; };
@ -200,14 +223,14 @@
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
dataIndex: 'address', dataIndex: 'index',
customRender: (text: any) => { customRender: (text: any) => {
return text.index + 1; return text.index + 1;
}, },
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'deviceName', dataIndex: 'realName',
}, },
{ {
title: '性别', title: '性别',
@ -215,7 +238,7 @@
}, },
{ {
title: '组织关系', title: '组织关系',
dataIndex: 'address', dataIndex: 'orgName',
}, },
{ {
title: '部门 ', title: '部门 ',
@ -227,48 +250,32 @@
emit('handleOk', { id: selectedRowKey.value, data: selectedRow.value }); emit('handleOk', { id: selectedRowKey.value, data: selectedRow.value });
show.value = false; show.value = false;
pagination.value.current = 1; pagination.value.current = 1;
realName.value = null;
searchValue.value = '';
}; };
const getData = (data: any) => { const getData = (data: any) => {
selectedRow.value = data.data; selectedRow.value = data.data;
selectedRowKey.value = data.id; selectedRowKey.value = data.id;
show.value = true; show.value = true;
http //
.post(device.queryDevicePage, { getList();
pageNum: pagination.value.current, //
pageSize: pagination.value.pageSize, getTreeData();
orgId: orgId.value,
})
.then((res) => {
dataSource.value = res.data.records;
pagination.value.total = res.data.total;
});
}; };
const show = ref(false); const show = ref(false);
const handleCancel = () => { const handleCancel = () => {
// //
pagination.value.current = 1; pagination.value.current = 1;
realName.value = null;
emit('handleCancel', null); emit('handleCancel', null);
show.value = false; show.value = false;
}; };
//
const expandedKeys = ref<(string | number)[]>([]);
const searchValue = ref<string>('');
const deviceName = ref<string>('');
const autoExpandParent = ref<boolean>(true);
const gData = ref<TreeProps['treeData']>(genData);
const onExpand = (keys: string[]) => {
expandedKeys.value = keys;
autoExpandParent.value = false;
console.log(keys, '数据');
};
watch(searchValue, (value) => { watch(searchValue, (value) => {
console.log(gData.value, '数据');
const expanded = dataList const expanded = dataList
.map((item: TreeProps['treeData'][number]) => { .map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) { if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, gData.value); console.log(item.title.indexOf(value));
return getParentKey(item.key, deptTreeData.value);
} }
return null; return null;
}) })
@ -276,30 +283,35 @@
expandedKeys.value = expanded; expandedKeys.value = expanded;
searchValue.value = value; searchValue.value = value;
autoExpandParent.value = true; autoExpandParent.value = true;
console.log(expandedKeys.value, '数据');
}); });
return { return {
columns, columns,
name, realName,
orgId, orgId,
// config, processDepartmentTree,
onSearch, onSearch,
getList,
loading,
dataSource, dataSource,
onSelect, onSelect,
gData, deptTreeData,
onExpand,
selectedRow, selectedRow,
selectedRowKey, selectedRowKey,
autoExpandParent, autoExpandParent,
expandedKeys, expandedKeys,
selectedKeys,
onSelectChange, onSelectChange,
pagination, pagination,
handleOk, handleOk,
show, show,
getData, getData,
getTreeData,
getDepartList,
searchValue, searchValue,
deviceName, deviceName,
handleCancel, handleCancel,
selectDeptId,
selectOrgId,
}; };
}, },
}); });
@ -313,7 +325,7 @@
width: 5px; width: 5px;
height: 15px; height: 15px;
background: inherit; background: inherit;
background-color: rgba(251, 156, 67, 1); background-color: @primary-color;
border: none; border: none;
border-radius: 5px; border-radius: 5px;
-moz-box-shadow: none; -moz-box-shadow: none;

Loading…
Cancel
Save