zhaohy 3 months ago
parent
commit
e1ea9e56cd
  1. BIN
      hx-ai-intelligent/public/asset/file/emissionSource.xlsx
  2. BIN
      hx-ai-intelligent/public/asset/file/energyConsumption.xlsx
  3. 79
      hx-ai-intelligent/src/config/app.config.ts
  4. 44
      hx-ai-intelligent/src/router/dynamicRoute.ts
  5. 98
      hx-ai-intelligent/src/util/dynamicRoutes.ts
  6. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  7. 3
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  8. 10
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
  9. 4
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  10. 80
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  11. 16
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  12. 37
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  13. 8
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  14. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  15. 84
      hx-op/src/view/organizationManage/enterpriseManage/index.vue
  16. 12
      hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue
  17. 2
      lib/paas/store/index.ts
  18. 2
      lib/saas/store/modules/route.ts
  19. 15
      lib/saas/view/system/login.vue
  20. 25
      lib/util/dynamicRoutesss.ts
  21. 4
      lib/util/xlsx-util.ts
  22. 1
      package.json

BIN
hx-ai-intelligent/public/asset/file/emissionSource.xlsx

Binary file not shown.

BIN
hx-ai-intelligent/public/asset/file/energyConsumption.xlsx

Binary file not shown.

79
hx-ai-intelligent/src/config/app.config.ts

@ -3,14 +3,19 @@ import { permission } from '/@/api/origanizemanage';
import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config'; import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config';
import { authorizationService } from '/nerv-base/store/modules/authorization-service'; import { authorizationService } from '/nerv-base/store/modules/authorization-service';
import { get } from 'lodash-es'; import { get } from 'lodash-es';
import { computed, ref, toRef } from 'vue'; import { computed, ref, toRef} from 'vue';
const ORGID = sessionStorage.getItem('ORGID') ? Number(sessionStorage.getItem('ORGID')) : ''; import { router } from '/nerv-lib/saas/router';
const isAdmin = sessionStorage.getItem('ISADMIN') import { replyRoutesButton } from '/@/util/dynamicRoutes';
? Boolean(sessionStorage.getItem('ISADMIN')) import { replyDynamRoutesPath } from '/nerv-lib/util/dynamicRoutesss';
: false; import { useTags } from '/nerv-base/store/modules/tags';
const selectDefaultValue = ref(ORGID);
const selectDefaultDisabled = ref(isAdmin); const ROLEID = sessionStorage.getItem('ROLEID') ? Number(sessionStorage.getItem('ROLEID')) : '';
// const isAdmin = sessionStorage.getItem('ISADMIN')
// ? Boolean(sessionStorage.getItem('ISADMIN'))
// : false;
const selectDefaultValue = ref(ROLEID);
// const selectDefaultDisabled = ref(isAdmin);
const transform = (data, map) => { const transform = (data, map) => {
return Object.keys(map).reduce((pre, cur) => { return Object.keys(map).reduce((pre, cur) => {
pre[cur] = data[map[cur]]; pre[cur] = data[map[cur]];
@ -46,22 +51,25 @@ export const appConfig = {
api: '/carbon-smart/user/login/logInInfo', api: '/carbon-smart/user/login/logInInfo',
size: 'large', size: 'large',
defaultValue: selectDefaultValue, defaultValue: selectDefaultValue,
disabled: selectDefaultDisabled, disabled:false,
// disabled: selectDefaultDisabled,
// autoSelectFirst: true, // autoSelectFirst: true,
placeholder: '请选择', placeholder: '请选择',
onSelect: async (cur, record) => { onSelect: async (cur:any, record:any) => {
console.log(cur, record);
const configStore = appConfigStore(); const configStore = appConfigStore();
const useAuthorization = authorizationService(); const useAuthorization = authorizationService();
sessionStorage.setItem('ORGID', record.orgId); sessionStorage.setItem('ORGID', record.orgId);
sessionStorage.setItem('ROLEID', record.roleId);
const res = await configStore.userResource({ data: record }); const res = await configStore.userResource({ data: record });
useAuthorization.updateUserResource(res.data); useAuthorization.updateUserResource(res.data);
setTimeout(() => {
window.location.reload(); window.location.reload();
}, 200);
// value.value = cur; // value.value = cur;
}, },
resultField: 'data.linkList', resultField: 'data.userRoles',
labelField: 'orgName', labelField: 'orgName',
valueField: 'orgId', valueField: 'roleId',
immediate: true, immediate: true,
dropdownReload: true, dropdownReload: true,
}, },
@ -71,15 +79,33 @@ export const appConfig = {
return http.post('/carbon-smart/user/login', { ...params }); return http.post('/carbon-smart/user/login', { ...params });
}, },
userResourceApi: (params) => { userResourceApi: (params) => {
const { orgId } = get(params, 'data') || { orgId: '' }; const { roleId } = get(params, 'data') || { roleId: '' };
const finalId = orgId || ORGID; const finalId = roleId || ROLEID;
// 解决初始化登录select无初始值的问题 // 解决初始化登录select无初始值的问题
selectDefaultValue.value = finalId; selectDefaultValue.value = finalId;
const userInfo = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)!); // const userInfo = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)!);
const ownOrgInfo = userInfo.linkList?.filter(({ orgId: id }) => id === finalId)[0]; // const ownOrgInfo = userInfo.userRoles?.filter(({ roleId: id }) => id === finalId)[0];
// return http.post('/carbon-smart/user/login/logInPermission', ownOrgInfo).then((res) => {
return http.post('/carbon-smart/user/login/logInPermission', ownOrgInfo).then((res) => { // return res;
// });
// 切换角色时获取新的权限菜单
return http.post('/carbon-smart/user/login/role/permission/'+finalId).then((res) => {
//切换后重新处理动态菜单数据
let resetDynamicRouteList = replyRoutesButton(res.data);
sessionStorage.setItem("dynamicRouteList",JSON.stringify(resetDynamicRouteList));
if(resetDynamicRouteList && resetDynamicRouteList.length>0){
let addDynamicRoutes = replyDynamRoutesPath(resetDynamicRouteList);
addDynamicRoutes.forEach(item => {
if (item.children && !item.component) {
item.component = () => import('/nerv-lib/saas/view/system/application.vue');//hx-ai-intelligent项目下的首页
}
router.addRoute(item);
})
}
//删除所有已经打开的tag标签
useTags().clearTags();
router.replace({ name: 'home' });
return res; return res;
}); });
}, },
@ -96,16 +122,25 @@ export const appConfig = {
linkList: 'linkList', linkList: 'linkList',
permissionVos: 'permissionVos', permissionVos: 'permissionVos',
adminFlag: 'adminFlag', adminFlag: 'adminFlag',
userRoles:'userRoles',
}); });
sessionStorage.setItem('ORGID', info.orgId); sessionStorage.setItem('ORGID', info.orgId);
sessionStorage.setItem('LINKLIST', JSON.stringify(info.linkList)); sessionStorage.setItem('LINKLIST', JSON.stringify(info.linkList));
sessionStorage.setItem('ISADMIN', trD?.adminFlag === '1'); // 头部“企业角色”切换暂不需要以下屏蔽的两个参数
selectDefaultDisabled.value = info?.adminFlag === '1'; // sessionStorage.setItem('ISADMIN', trD?.adminFlag === '1');
selectDefaultValue.value = info.orgId; // selectDefaultDisabled.value = info?.adminFlag === '1';
if(info.userRoles && info.userRoles.length>0){
sessionStorage.setItem('ROLEID', info.userRoles[0].roleId);
sessionStorage.setItem('USERROLES', JSON.stringify(info.userRoles));
selectDefaultValue.value = info.userRoles[0].roleId;
//路由接口数据暂时组装
let getRoutesList = replyRoutesButton(info.userRoles[0].routes);
sessionStorage.setItem("dynamicRouteList",JSON.stringify(getRoutesList))
sessionStorage.setItem("isRefrech",'1')
}
return { data: { ...trD } }; return { data: { ...trD } };
}); });
}, },
useHistoryTag: false, useHistoryTag: false,
// 修改密码配置 // 修改密码配置
updatePassWordInfo: { updatePassWordInfo: {

44
hx-ai-intelligent/src/router/dynamicRoute.ts

@ -0,0 +1,44 @@
const sessionStoreRoute = sessionStorage.getItem("dynamicRouteList");
let getDynamicRouteList = sessionStoreRoute?JSON.parse(sessionStoreRoute):[];
let dynamicRoute:any = [];
// getDynamicRouteList.map(itemRouter => {
// if(itemRouter.children && itemRouter.children.length > 0){
// itemRouter.children.map(childRoute => {
// let modulePath0 = childRoute.component;
// childRoute.component = () => new Function(`return import('/nerv-lib/saas/view/${modulePath0}')`)();///nerv-lib/saas/view/
// if(childRoute.children && childRoute.children.length > 0){
// childRoute.children.map(child2=>{
// let modulePath = child2.component;
// child2.component = () => new Function(`return import('/@/view/${modulePath}')`)();///@/view/
// })
// }else{//如没有下一级菜单代表是一级,重新处理一级菜单路由
// childRoute.component = () => new Function(`return import('/@/view/${modulePath0}')`)();
// }
// })
// }
// dynamicRoute.push(itemRouter)
// })
getDynamicRouteList.forEach(itemRouter => {
if (itemRouter.children && itemRouter.children.length > 0) {
itemRouter.children.forEach(childRoute => {
const modulePath0 = childRoute.component;
// 修改 component 属性
// childRoute.component = () => import(`/nerv-lib/saas/view/${modulePath0}`).then(mod => mod.default);
childRoute.component = () => new Function(`return import('/nerv-lib/saas/view/${modulePath0}')`)();
if (childRoute.children && childRoute.children.length > 0) {
childRoute.children.forEach(child2 => {
const modulePath = child2.component;
// 修改 component 属性
// child2.component = /* @vite-ignore */ () => import(`/@/view/${modulePath}`).then(mod => mod.default);
child2.component = () => new Function(`return import('/@/view/${modulePath}')`)();
});
} else { // 如果没有下一级菜单代表是一级,重新处理一级菜单路由
// childRoute.component = /* @vite-ignore */ () => import(`/@/view/${modulePath0}`).then(mod => mod.default);
childRoute.component = () => new Function(`return import('/@/view/${modulePath0}')`)();
}
});
}
dynamicRoute.push(itemRouter);
});
export default dynamicRoute;

98
hx-ai-intelligent/src/util/dynamicRoutes.ts

@ -0,0 +1,98 @@
/***公共方法==>处理动态路由数据 将“按钮”部分的数据追加到meta中*/
//处理路由按钮,存放在meta中
export const replyRoutesButton = (data:any) => {
if(!data) return;
return data.map(item => {
if(item.children && item.children.length > 0){
item.meta.operates = [];
item.children.map(itemChild => {
if(itemChild.type=="3"){
let operateObj = {title:'',code:''};
operateObj.title = itemChild.meta.title;
operateObj.code = itemChild.name;
item.meta.operates.push(operateObj);
item.children = item.children.filter(its => its.name != itemChild.name);
}
})
if(item.meta.operates.length == 0){
delete item.meta.operates;
}
return {
...item,
children: replyRoutesButton(item.children),
};
}
return item;
});
};
// //处理路由compontent路径
// export const replyRoutesPath = (itemRouter:any) => {
// if (itemRouter.children && itemRouter.children.length > 0) {
// itemRouter.children.forEach(childRoute => {
// const modulePath0 = childRoute.component;
// // 修改 component 属性
// // childRoute.component = () => import(`/nerv-lib/saas/view/${modulePath0}`).then(mod => mod.default);
// childRoute.component = () => new Function(`return import('/nerv-lib/saas/view/${modulePath0}')`)();
// if (childRoute.children && childRoute.children.length > 0) {
// childRoute.children.forEach(child2 => {
// const modulePath = child2.component;
// // 修改 component 属性
// // child2.component = /* @vite-ignore */ () => import(`/@/view/${modulePath}`).then(mod => mod.default);
// child2.component = () => new Function(`return import('/@/view/${modulePath}')`)();
// });
// } else { // 如果没有下一级菜单代表是一级,重新处理一级菜单路由
// // childRoute.component = /* @vite-ignore */ () => import(`/@/view/${modulePath0}`).then(mod => mod.default);
// childRoute.component = () => new Function(`return import('/@/view/${modulePath0}')`)();
// }
// });
// }
// return itemRouter;
// }

5
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue

@ -48,7 +48,7 @@
</a-form> </a-form>
</a-card> </a-card>
</div> </div>
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)"> <div style="display: flex; margin-top: 20px; height: calc(85% - 20px)">
<div class="detailTable"> <div class="detailTable">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1280 }"> <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1280 }">
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
@ -523,6 +523,7 @@
{ {
title: '更新时间', title: '更新时间',
width: 150, width: 150,
ellipsis: true,
dataIndex: 'updateTime', dataIndex: 'updateTime',
}, },
], ],
@ -826,7 +827,7 @@
padding: 16px; padding: 16px;
} }
.search { .search {
height: 16%; height: 15%;
} }
.detailTable { .detailTable {
width: 70%; width: 70%;

3
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue

@ -13,6 +13,9 @@
<a-button type="primary" ghost style="margin-left: 6px" @click="reset">重置</a-button> <a-button type="primary" ghost style="margin-left: 6px" @click="reset">重置</a-button>
</span> </span>
</template> </template>
<template #bodyCell="{ column, text }">
<span>{{ text || '-' }}</span>
</template>
</a-table> </a-table>
<!-- <a-pagination <!-- <a-pagination
:current="queryParams.pageNum" :current="queryParams.pageNum"

10
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts

@ -146,7 +146,7 @@ export const drawerColumns = [
dataIndex: 'dataSources', dataIndex: 'dataSources',
}, },
]; ];
export const setFactorConfig = (orgId) => { export const setFactorConfig = (orgId, treeId, tableId) => {
return ref({ return ref({
api: carbonEmissionFactorLibrary.getTableList, api: carbonEmissionFactorLibrary.getTableList,
params: { orgId, pageNum: 1, pageSize: 9999, emissionList: [0] }, params: { orgId, pageNum: 1, pageSize: 9999, emissionList: [0] },
@ -155,7 +155,8 @@ export const setFactorConfig = (orgId) => {
icon: 'deviceType', icon: 'deviceType',
title: '排放分类', title: '排放分类',
}, },
params: { orgId}, selectedKeys: treeId,
params: { orgId },
dynamicParams: { emissionList: 'id[]' }, dynamicParams: { emissionList: 'id[]' },
defaultExpandAll: true, defaultExpandAll: true,
// checkable:true, // checkable:true,
@ -175,7 +176,10 @@ export const setFactorConfig = (orgId) => {
], ],
}, },
}, },
rowSelection: { type: 'radio' }, rowSelection: {
type: 'radio',
selectedRowKeys: tableId,
},
columns: [ columns: [
{ {
title: '序号', title: '序号',

4
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -297,9 +297,7 @@
indexName: '能源种类', // indexName: '能源种类', //
message: [ message: [
{ label: '1、若必填项未填写,则不能进行导入操作' }, { label: '1、若必填项未填写,则不能进行导入操作' },
{ label: `2、当重复时,则更新数据。` }, { label: '2、文件导入勿超过5MB。' },
{ label: '3、数据将从模版的第五行进行导入。' },
{ label: '4、文件导入勿超过5MB。' },
], ],
}, },
}, },

80
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -21,20 +21,22 @@
:auto-expand-parent="autoExpandParent" :auto-expand-parent="autoExpandParent"
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:tree-data="gData" :tree-data="gData"
:show-line="{ showLeafIcon: false }"
show-line show-line
@expand="onExpand" @expand="onExpand"
@select="onSelect" @select="onSelect"
style="padding: 0 16px !important"> style="padding: 0 16px !important">
<template #title="data"> <template #title="data">
<span <!-- <span
v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1"> v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1">
{{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }} {{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span> <span style="color: #f50">{{ searchValue }}</span>
{{ {{
data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length) data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length)
}} }}
</span> </span> -->
<span v-else>{{ data.energyType }}</span> <span v-if="data.code">{{ truncatedName(data.energyType + data.code) }}</span>
<span v-else>{{ truncatedName(data.energyType) }}</span>
</template> </template>
</a-tree> </a-tree>
</div> </div>
@ -130,8 +132,8 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch, toRaw, defineExpose } from 'vue'; import { ref, watch, toRaw, defineExpose, nextTick } from 'vue';
import type { TreeProps } from 'ant-design-vue'; import { message, TreeProps } from 'ant-design-vue';
import { Pagination, Modal } from 'ant-design-vue'; import { Pagination, Modal } from 'ant-design-vue';
import { columns, drawerColumns } from '../config'; import { columns, drawerColumns } from '../config';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
@ -225,6 +227,12 @@
expandedKeys.value = keys; expandedKeys.value = keys;
autoExpandParent.value = false; autoExpandParent.value = false;
}; };
const truncatedName = (name) => {
if (name.length > 8) {
return name.substring(0, 8) + '...';
}
return name;
};
// //
const energyType = ref(); const energyType = ref();
const onSelect = (selectedKey: string[], info: any) => { const onSelect = (selectedKey: string[], info: any) => {
@ -245,16 +253,22 @@
return null; return null;
}) })
.filter((item, i, self) => item && self.indexOf(item) === i); .filter((item, i, self) => item && self.indexOf(item) === i);
expandedKeys.value = expanded; // expandedKeys.value = expanded;
searchValue.value = value; searchValue.value = value;
autoExpandParent.value = true; autoExpandParent.value = true;
}); });
// //
const onSearchTreeData = () => {}; const getTreeQuery = ref({
orgId: orgId.value,
});
const onSearchTreeData = () => {
getTreeQuery.value.energyType = searchValue.value;
getTreeData();
};
const statsId = ref(); const statsId = ref();
// //
const getTreeData = () => { const getTreeData = () => {
fetch(quickCalculation.carbonQuickTree, { orgId: orgId.value }).then((res) => { fetch(quickCalculation.carbonQuickTree, getTreeQuery.value).then((res) => {
gData.value = res.data; gData.value = res.data;
energyType.value = gData.value[0].children[0].id; energyType.value = gData.value[0].children[0].id;
statsId.value = gData.value[0].children[0].id; statsId.value = gData.value[0].children[0].id;
@ -271,9 +285,12 @@
}); });
const tableData = ref([]); const tableData = ref([]);
const emissionSources = ref(); const emissionSources = ref();
const treeId = ref([]);
const tableId = ref([]);
const tableConfig = ref({ const tableConfig = ref({
title: '排放因子库', title: '排放因子库',
api: quickCalculation.queryCarbonEmissionPage, api: quickCalculation.queryCarbonEmissionPage,
rowSelection: null,
params: { params: {
orgId, orgId,
energyType, energyType,
@ -307,12 +324,6 @@
dataIndex: 'carbonEmissionSuffix', dataIndex: 'carbonEmissionSuffix',
}, },
{ {
title: '更新时间',
className: 'updateTime',
dataIndex: 'updateTime',
ellipsis: true,
},
{
title: '启用时间', title: '启用时间',
className: 'startTime', className: 'startTime',
dataIndex: 'startTime', dataIndex: 'startTime',
@ -327,6 +338,12 @@
className: 'dataSources', className: 'dataSources',
dataIndex: 'dataSources', dataIndex: 'dataSources',
}, },
{
title: '更新时间',
className: 'updateTime',
dataIndex: 'updateTime',
ellipsis: true,
},
], ],
columnActions: { columnActions: {
title: '操作', title: '操作',
@ -342,8 +359,10 @@
formState.value.factorId = record.factorId; formState.value.factorId = record.factorId;
text.value = '编辑'; text.value = '编辑';
visible.value = true; visible.value = true;
emissionSources.value = record.factorId; //todo emissionSources.value = record.factorId;
queryData.value.factorId = emissionSources.value; //todo queryData.value.factorId = emissionSources.value;
treeId.value = [record.treeId];
tableId.value = [record.factorId];
getNewTable(); getNewTable();
}, },
}, },
@ -450,6 +469,7 @@
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {}; formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
message.success('操作成功!');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
} else { } else {
@ -458,6 +478,7 @@
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {}; formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
message.success('操作成功!');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
} }
@ -487,9 +508,15 @@
}; };
const openVisible = ref(false); const openVisible = ref(false);
const setFactorRef = ref(); const setFactorRef = ref();
const config = setFactorConfig(orgId.value); const config = setFactorConfig(orgId.value, treeId.value, tableId.value);
const selectFactor = () => { const selectFactor = () => {
openVisible.value = true; openVisible.value = true;
nextTick(() => {
setFactorRef.value.nsTableRef.params.emissionList = treeId.value;
setFactorRef.value.nsTableRef.treeElRef.selectedKeys = treeId.value;
setFactorRef.value.nsTableRef.rowSelection.selectedRowKeys = tableId.value;
setFactorRef.value.nsTableRef.reload();
});
}; };
const btnClick = () => { const btnClick = () => {
let selectRowKeys = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys; let selectRowKeys = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys;
@ -624,6 +651,25 @@
:deep(.ant-modal-footer) { :deep(.ant-modal-footer) {
border-top: 10px solid #f0f0f0 !important; border-top: 10px solid #f0f0f0 !important;
} }
:deep(.ns-table-container) {
background: white;
}
:deep(.ns-part-tree) {
border-radius: 8px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
}
:deep(.ns-table-search) {
border-radius: 8px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
}
:deep(.ns-table-main) {
margin-top: 20px !important;
border-radius: 8px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
}
</style> </style>
<style scoped> <style scoped>
th.column-money, th.column-money,

16
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue

@ -1193,11 +1193,11 @@
return regex.test(filename); return regex.test(filename);
}; };
const beforeUpload: UploadProps['beforeUpload'] = (file) => { const beforeUpload: UploadProps['beforeUpload'] = (file) => {
const filename = file.name; // const filename = file.name;
if (!isValidFileName(filename)) { // if (!isValidFileName(filename)) {
message.error('文件名不符合规则'); // message.error('');
return Upload.LIST_IGNORE; // // return Upload.LIST_IGNORE; //
} // }
return false; return false;
}; };
const handleChange = (info: UploadChangeParam) => { const handleChange = (info: UploadChangeParam) => {
@ -1284,14 +1284,16 @@
NsMessage.warn('请选择因子'); NsMessage.warn('请选择因子');
return; return;
} else { } else {
if (newTableData.value.emissionFactorUnits === carbonEmission.value) { if (newTableData.value[0].emissionFactorUnits === carbonEmission.value) {
newTableData.value = setFactorRef.value?.nsTableRef.tableState.selectedRows; newTableData.value = setFactorRef.value?.nsTableRef.tableState.selectedRows;
selectedRowKeysEdit.value = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys; selectedRowKeysEdit.value = setFactorRef.value?.nsTableRef.tableState.selectedRowKeys;
editFormState.value.emissionFactors = newTableData.value[0].emissionFactors; editFormState.value.emissionFactors = newTableData.value[0].emissionFactors;
editFormState.value.factorId = selectedRowKeysEdit.value[0]; editFormState.value.factorId = selectedRowKeysEdit.value[0];
openVisible.value = false; openVisible.value = false;
} else { } else {
NsMessage.warn('因子值单位不统一,请重新选择!'); NsMessage.warn(
'因子值单位与当前因子值单位(' + carbonEmission.value + ')不统一,请重新选择!',
);
} }
} }
}; };

37
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -39,11 +39,7 @@
placeholder="请输入报告名称" /> placeholder="请输入报告名称" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="报告年度" name="reportYear"> <a-form-item ref="name" label="报告年度" name="reportYear">
<a-date-picker <a-date-picker v-model:value="formState.reportYear" picker="year" valueFormat="YYYY" />
v-model:value="formState.reportYear"
@openChange="openChange"
picker="year"
valueFormat="YYYY" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="适用标准" name="genericStandard"> <a-form-item ref="name" label="适用标准" name="genericStandard">
<a-input <a-input
@ -64,7 +60,6 @@
<a-form-item ref="name" label="报告范围" name="reportScope"> <a-form-item ref="name" label="报告范围" name="reportScope">
<a-range-picker <a-range-picker
v-model:value="formState.reportScope" v-model:value="formState.reportScope"
:defaultPickerValue="defaultPickerValue"
picker="month" picker="month"
:disabledDate="disabledDate" :disabledDate="disabledDate"
valueFormat="YYYY-MM" /> valueFormat="YYYY-MM" />
@ -111,20 +106,22 @@
const selectChange = (value) => { const selectChange = (value) => {
formState.value.reportScope = ''; formState.value.reportScope = '';
}; };
const defaultPickerValue = ref([ // const defaultPickerValue = ref([]);
dayjs('2020'), // // const open = ref(false);
dayjs('2020'), // // const openChange = (status) => {
]); // debugger;
const openChange = (status) => { // open.value = status;
if (status === false) { // if (formState.value.reportYear) {
if (formState.value.reportYear) { // defaultPickerValue.value = [
defaultPickerValue.value = [ // dayjs(formState.value.reportYear),
dayjs(formState.value.reportYear), // dayjs(formState.value.reportYear),
dayjs(formState.value.reportYear), // ];
]; // open.value = false;
} // nextTick(() => {
} // open.value = status; //
}; // });
// }
// };
// form // form
const rules: Record<string, Rule[]> = { const rules: Record<string, Rule[]> = {
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }], reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],

8
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue

@ -417,7 +417,6 @@
const editData = (record) => { const editData = (record) => {
open.value = true; open.value = true;
if (record.isLastYear !== undefined) { if (record.isLastYear !== undefined) {
formState.value.ids = [record.id];
if (record.lastYear === '是') { if (record.lastYear === '是') {
formState.value.isLastYear = 1; formState.value.isLastYear = 1;
disabled.value = false; disabled.value = false;
@ -425,10 +424,12 @@
formState.value.isLastYear = 0; formState.value.isLastYear = 0;
disabled.value = true; disabled.value = true;
} }
}
formState.value.ids = [record.id];
formState.value.conversionRate = record.conversionRate; formState.value.conversionRate = record.conversionRate;
formState.value.lastYearList = [record.lastYearActualUsage]; formState.value.lastYearList = [record.lastYearActualUsage];
formState.value.ids = [record.id];
formState.value.budget = record.budget; formState.value.budget = record.budget;
}
}; };
const disabled = ref(true); const disabled = ref(true);
const selectChange = (value) => { const selectChange = (value) => {
@ -995,6 +996,9 @@
:deep(.ant-card-bordered) { :deep(.ant-card-bordered) {
border: unset; border: unset;
} }
:deep(.ant-input-number-handler-wrap){
display: none;
}
</style> </style>
<style scoped> <style scoped>
.editable-row-operations a { .editable-row-operations a {

2
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue

@ -674,7 +674,7 @@
} }
.contant { .contant {
width: 100%; width: 100%;
height: calc(94% - 5vh); height: calc(94% - 5vh - 24px);
overflow-y: auto; overflow-y: auto;
padding: 12px; padding: 12px;
.chartsPart { .chartsPart {

84
hx-op/src/view/organizationManage/enterpriseManage/index.vue

@ -32,7 +32,7 @@
v-model:value="searchValue" v-model:value="searchValue"
style="margin-bottom: 8px" style="margin-bottom: 8px"
@search="onSearch" /> --> @search="onSearch" /> -->
<a-tree v-if="treeData?.length" v-model:checkedKeys="checkedKeys" v-bind="serverTree" /> <a-tree v-if="treeData?.length" v-model:checkedKeys="checkedKeys" v-bind="serverTree"/>
</ns-drawer> </ns-drawer>
<TreeAdd ref="treeAdd" @ok="handleOk" :info="currentBoundaryRecord" /> <TreeAdd ref="treeAdd" @ok="handleOk" :info="currentBoundaryRecord" />
@ -50,6 +50,7 @@
// import { mockData, treeData } from './mock'; // import { mockData, treeData } from './mock';
import { enterPrise } from '/@/api/origanizemanage'; import { enterPrise } from '/@/api/origanizemanage';
import { tableConfig as insertConfig } from './config'; import { tableConfig as insertConfig } from './config';
import { string } from 'vue-types';
defineOptions({ defineOptions({
name: 'EnterpriseManageIndex', name: 'EnterpriseManageIndex',
}); });
@ -82,7 +83,6 @@
const comApi = computed(() => { const comApi = computed(() => {
return calMap[opType.value as keyof typeof calMap]; return calMap[opType.value as keyof typeof calMap];
}); });
// tablereloaddrawerclose // tablereloaddrawerclose
const fetch = (params, isReload = true) => { const fetch = (params, isReload = true) => {
http.post(comApi.value, params).then(() => { http.post(comApi.value, params).then(() => {
@ -152,14 +152,20 @@
}); });
}; };
// // checkedKeys
const serverOK = () => { const serverOK = () => {
let getPermissionSelected = totalCheckedKeys.value;
if(getPermissionSelected.length==0){
NsMessage.success('请选择相应的权限菜单分配!');
return false;
}else{
const params = { const params = {
orgId: currentServerRecord.value?.orgId, orgId: currentServerRecord.value?.orgId,
orgName: currentServerRecord.value?.orgName, orgName: currentServerRecord.value?.orgName,
permissionVoList: totalCheckedKeys.value, permissionVoList: getPermissionSelected,
}; };
fetch(params, false); fetch(params, false);
}
}; };
const ServiceSelect = (selectedKeys: any, info: any) => { const ServiceSelect = (selectedKeys: any, info: any) => {
@ -197,10 +203,61 @@
// //
const getTree = (params) => { const getTree = (params) => {
return http.post(enterPrise.permissionTree, params).then((res) => { return http.post(enterPrise.permissionTree, params).then((res) => {
treeData.value = res.data?.data; // treeData.value = res.data?.data;
let dataTreeList = res.data?.data;
let getDataTreeList = dataTreeListReply(dataTreeList)
treeData.value = filterTreeData(getDataTreeList);
});
};
// hidden"
const dataTreeListReply =(data:any)=>{
return data.map(item => {
if (item.menus && item.menus.length > 0) {
return {
...item,
menus: dataTreeListReply(item.menus),
};
}
if (item.menus && item.menus.length == 0) {
item.hidden = true;
}
return item;
}); });
}
//menus
const filterTreeData = (data:any) => {
return data.map(item => {
//menus
if (item.menus && item.menus.length > 0) {
item.menus.map(itemchild=>{
if(itemchild.menus && itemchild.menus.length==0){
item.class = 'parentNodeArrowHide';
}
})
return {
...item,
menus: filterTreeData(item.menus),
}; };
getTree({}); }else{
if(item.hidden){
item.class = 'leafNodeHide';
}
}
return item;
})
//hidden
// return data.filter(item => !item.hidden).map(item => {
// if (item.menus) {
// return {
// ...item,
// menus: filterTreeData(item.menus),
// };
// }
// return item;
// });
}
getTree({})
// //
const getPermissionData = (params) => { const getPermissionData = (params) => {
@ -210,6 +267,13 @@
.map((item) => { .map((item) => {
return item.permissionId; return item.permissionId;
}); });
const finalResult = res.data.map((items) => {
return {
halfCheck: items.halfCheck,
permissionId: items.permissionId,
};
})
totalCheckedKeys.value = finalResult;
}); });
}; };
@ -354,3 +418,11 @@
} }
} }
</style> </style>
<style>
.leafNodeHide{
display:none!important;
}
.parentNodeArrowHide .ant-tree-switcher{
visibility: hidden;
}
</style>

12
hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue

@ -106,7 +106,7 @@
const componentIsshow = ref(false);// const componentIsshow = ref(false);//
const redirectIsshow = ref(true);// const redirectIsshow = ref(true);//
const keepAliveIsshow = ref(false);// const keepAliveIsshow = ref(false);//
const hideChildrenIsshow = ref(false);// const hideChildrenIsshow = ref(true);//
interface FormState { interface FormState {
menuName: string; menuName: string;
previousMenu:string; previousMenu:string;
@ -164,7 +164,6 @@
}; };
// //
const chanageMenuType = (e:any,typeMenu:any)=>{ const chanageMenuType = (e:any,typeMenu:any)=>{
console.log(e)
let currentType = null; let currentType = null;
if(e && e.target){ if(e && e.target){
currentType = e.target.value; currentType = e.target.value;
@ -184,7 +183,7 @@
componentIsshow.value = false; componentIsshow.value = false;
redirectIsshow.value = true; redirectIsshow.value = true;
keepAliveIsshow.value = false; keepAliveIsshow.value = false;
hideChildrenIsshow.value = false; hideChildrenIsshow.value = true;
}else if(currentType==2){// }else if(currentType==2){//
menuNameIsshow.value = true; menuNameIsshow.value = true;
preMenuIsshow.value = true; preMenuIsshow.value = true;
@ -245,9 +244,8 @@
} }
if(menuRadioType.value==1){ if(menuRadioType.value==1){
params.pid = currentLineData.value?currentLineData.value.pid:"root";//pid,'root' params.pid = currentLineData.value?currentLineData.value.pid:"root";//pid,'root'
params.hideChildren = formState.value.hideChildren;//
} }
console.log("1234567777")
console.log(menuRadioType.value)
if(addOrEditType.value==1){// if(addOrEditType.value==1){//
http.post(menuS.queryMenuPageAdd, params).then(() => { http.post(menuS.queryMenuPageAdd, params).then(() => {
NsMessage.success('操作成功'); NsMessage.success('操作成功');
@ -315,7 +313,9 @@
menuCode:'', menuCode:'',
type:'', type:'',
menuJumpUrl:'', menuJumpUrl:'',
menuRedirect:'' menuRedirect:'',
keepAlive:false,
hideChildren:false
}; };
}else if(type==2){// }else if(type==2){//
drawerTitele.value = '编辑菜单'; drawerTitele.value = '编辑菜单';

2
lib/paas/store/index.ts

@ -1,6 +1,8 @@
import type { App } from 'vue'; import type { App } from 'vue';
import { createPinia } from 'pinia'; import { createPinia } from 'pinia';
const store = createPinia(); const store = createPinia();
// import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// store.use(piniaPluginPersistedstate)
export function setupStore(app: App<Element>) { export function setupStore(app: App<Element>) {
app.use(store); app.use(store);

2
lib/saas/store/modules/route.ts

@ -135,4 +135,6 @@ export const useRouteStore = defineStore({
}); });
}, },
}, },
// //开启数据缓存
// persist:true,
}); });

15
lib/saas/view/system/login.vue

@ -79,6 +79,7 @@
import { Cookies } from '/nerv-lib/util/cookie'; import { Cookies } from '/nerv-lib/util/cookie';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { replyDynamRoutesPath } from '/nerv-lib/util/dynamicRoutesss';
export default defineComponent({ export default defineComponent({
name: 'UserLogin', name: 'UserLogin',
@ -194,12 +195,22 @@
name: initRouterList.length === 0 ? 'error403' : res.data[0]['code'], name: initRouterList.length === 0 ? 'error403' : res.data[0]['code'],
}); });
} else { } else {
router.replace({ name: 'root' }); const sessionStoreRoute = sessionStorage.getItem("dynamicRouteList");
let getDynamicRouteList = sessionStoreRoute?JSON.parse(sessionStoreRoute):[];
if(getDynamicRouteList && getDynamicRouteList.lenght>0){
let addDynamicRoutes = replyDynamRoutesPath(getDynamicRouteList);
addDynamicRoutes.forEach(item => {
if (item.children && !item.component) {
item.component = () => import('/nerv-lib/saas/view/system/application.vue');//hx-ai-intelligent
}
router.addRoute(item);
});
}
router.replace({ name: 'home' });
} }
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err);
loading.value = false; loading.value = false;
} }
} }

25
lib/util/dynamicRoutesss.ts

@ -0,0 +1,25 @@
//处理路由compontent路径
export const replyDynamRoutesPath = (data:any) => {
return data.map(item => {
if(item.children && item.children.length > 0){
item.children.map(itemChild => {
if(itemChild.component){
const modulePath0 = itemChild.component;
itemChild.component = () => new Function(`return import('/nerv-lib/saas/view/${modulePath0}')`)();
if(itemChild.children && itemChild.children.length > 0){
itemChild.children.map(itemChildChild => {
if(itemChildChild.component){
const modulePath1 = itemChildChild.component;
itemChildChild.component = () => new Function(`return import('/@/view/${modulePath1}')`)();
}
})
}else{
itemChild.component = () => new Function(`return import('/@/view/${modulePath0}')`)();
}
}
})
}
return item;
})
}

4
lib/util/xlsx-util.ts

@ -129,11 +129,13 @@ export const importFile = (
headers: { token: Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) }, headers: { token: Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) },
}) })
.then((res) => { .then((res) => {
if (res) { if (res.data.data) {
NsMessage.success('导入成功', 1, () => { NsMessage.success('导入成功', 1, () => {
reload && reload(); reload && reload();
successBack && successBack(res); successBack && successBack(res);
}); });
} else {
NsMessage.error(res.data.msg || '导入失败');
} }
}) })
.catch((err) => { .catch((err) => {

1
package.json

@ -68,6 +68,7 @@
"nanoid": "^4.0.2", "nanoid": "^4.0.2",
"path-to-regexp": "^6.2.1", "path-to-regexp": "^6.2.1",
"pinia": "^2.0.14", "pinia": "^2.0.14",
"pinia-plugin-persistedstate": "^3.2.1",
"pnpm": "^8.7.6", "pnpm": "^8.7.6",
"qrcode.vue": "^3.3.3", "qrcode.vue": "^3.3.3",
"recorder-core": "^1.3.23122400", "recorder-core": "^1.3.23122400",

Loading…
Cancel
Save