Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp
This commit is contained in:
@@ -21,12 +21,12 @@
|
||||
// watch(
|
||||
// () => router.currentRoute.value,
|
||||
// (e) => {
|
||||
// // if (Cookies.get('nervsid') === undefined && e.fullPath !== '/login') {
|
||||
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) === undefined && e.fullPath !== '/login') {
|
||||
// // message.warn('登陆信息已过期,请重新登录!', 1);
|
||||
// // router.push('/login');
|
||||
// // }
|
||||
// // } else {
|
||||
// // if (Cookies.get('nervsid') !== undefined && e === '/login') {
|
||||
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) !== undefined && e === '/login') {
|
||||
// // let url = window.sessionStorage.getItem('url');
|
||||
// // url === null ? window.sessionStorage.setItem('url', '/doorway/visitor/audit') : '';
|
||||
// // router.push(url === null ? '/doorway' : url);
|
||||
|
@@ -11,4 +11,8 @@ export enum group {
|
||||
creatOrUpdate = `${BASE_URL}/deviceGroup/creatOrUpdate`, // 左侧树节点新增编辑
|
||||
del = `${BASE_URL}/deviceGroup/del`,
|
||||
move = `${BASE_URL}/deviceGroup/move`,
|
||||
queryEditGroup = `${BASE_URL}/deviceGroup/queryEditGroup`, // 分组树
|
||||
queryGroupPage = `${BASE_URL}/deviceGroup/queryGroupPage`, // 分组列表
|
||||
saveGroupList = `${BASE_URL}/deviceGroup/saveGroupList`, // 分组保存
|
||||
delGroupList = `${BASE_URL}/deviceGroup/delGroupList`, // 分组删除
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ export const appConfig = {
|
||||
// 解决初始化登录select无初始值的问题
|
||||
selectDefaultValue.value = finalId;
|
||||
|
||||
const userInfo = JSON.parse(sessionStorage.getItem('userInfo')!);
|
||||
const userInfo = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)!);
|
||||
const ownOrgInfo = userInfo.linkList?.filter(({ orgId: id }) => id === finalId)[0];
|
||||
|
||||
return http.post('/carbon-smart/user/login/logInPermission', ownOrgInfo).then((res) => {
|
||||
|
@@ -493,7 +493,7 @@ import { log } from 'node:console';
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: carbonEmissionFactorLibrary.del,
|
||||
dynamicParams: { id: 'id[]' },
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
@@ -573,7 +573,7 @@ import { log } from 'node:console';
|
||||
{
|
||||
label: '删除',
|
||||
name: 'userDelete',
|
||||
dynamicParams: 'id',
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
api: carbonEmissionFactorLibrary.del,
|
||||
@@ -617,11 +617,27 @@ import { log } from 'node:console';
|
||||
options: [
|
||||
{
|
||||
label: 'CO2',
|
||||
value: 0,
|
||||
value: 'CO2',
|
||||
},
|
||||
{
|
||||
label: 'CO2e',
|
||||
value: 1,
|
||||
value: 'CO2e',
|
||||
},
|
||||
{
|
||||
label: 'SF6',
|
||||
value:'SF6',
|
||||
},
|
||||
{
|
||||
label: 'CH4',
|
||||
value: 'CH4',
|
||||
},
|
||||
{
|
||||
label: 'PFCs',
|
||||
value: 'PFCs',
|
||||
},
|
||||
{
|
||||
label: 'HFCs',
|
||||
value: 'HFCs',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@@ -7,64 +7,70 @@ export const tableColumns = [
|
||||
},
|
||||
{
|
||||
title: '能源种类',
|
||||
dataIndex: 'money',
|
||||
dataIndex: 'energyType',
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
className: 'column-money',
|
||||
dataIndex: 'money',
|
||||
className: 'unit',
|
||||
dataIndex: 'unit',
|
||||
},
|
||||
{
|
||||
title: '全年',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'yearly',
|
||||
},
|
||||
{
|
||||
title: '1月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'jan',
|
||||
customRender: ({ text, record }) => ({
|
||||
children: text,
|
||||
attrs: {
|
||||
style: record.janFlag === 1 ? 'color: red' : 'color: blue'
|
||||
}
|
||||
})
|
||||
},
|
||||
{
|
||||
title: '2月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'feb',
|
||||
},
|
||||
{
|
||||
title: '3月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'mar',
|
||||
},
|
||||
{
|
||||
title: '4月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'apr',
|
||||
},
|
||||
{
|
||||
title: '5月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'may',
|
||||
},
|
||||
{
|
||||
title: '6月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'jun',
|
||||
},
|
||||
{
|
||||
title: '7月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'jul',
|
||||
},
|
||||
{
|
||||
title: '8月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'aug',
|
||||
},
|
||||
{
|
||||
title: '9月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'sep',
|
||||
},
|
||||
{
|
||||
title: '10月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'oct',
|
||||
},
|
||||
{
|
||||
title: '11月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'nov',
|
||||
},
|
||||
{
|
||||
title: '12月',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'dec',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<template #title>
|
||||
<a-date-picker v-model:value="selectYear" picker="year" />
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" />
|
||||
<div class="buttonGroup">
|
||||
<a-button type="primary" @click="addNewData">新增</a-button>
|
||||
<a-button type="primary">导入</a-button>
|
||||
@@ -27,11 +27,14 @@
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-pagination
|
||||
:current="current"
|
||||
:page-size="pageSize"
|
||||
:total="0"
|
||||
:show-total="(total, range) => `${range[0]}-${range[1]} of ${total} items`" />
|
||||
<a-pagination
|
||||
:current="current"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
style="display: flex;justify-content: center;margin-top: 16px;"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
@change="onChange" />
|
||||
<!-- 新增数据库数据 -->
|
||||
<a-drawer
|
||||
:width="500"
|
||||
@@ -47,42 +50,80 @@
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-item ref="name" label="能源种类" name="name">
|
||||
<a-input v-model:value="formState.name" />
|
||||
<a-form-item ref="name" label="能源种类" name="energyType">
|
||||
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" />
|
||||
</a-form-item>
|
||||
<a-form-item label="计量单位">
|
||||
<a-cascader v-model:value="value" :options="options" placeholder="Please select" />
|
||||
<a-form-item label="计量单位" name="unit">
|
||||
<a-cascader v-model:value="formState.unit" :options="options" />
|
||||
</a-form-item>
|
||||
<a-form-item label="自动采集节点">
|
||||
<a-form-item label="自动采集节点" name="collectionNode">
|
||||
<a-tree-select
|
||||
v-model:value="treeValue"
|
||||
style="width: 300px"
|
||||
placeholder="Please select"
|
||||
v-model:value="formState.collectionNode"
|
||||
:tree-line="true"
|
||||
:tree-data="treeData"
|
||||
tree-node-filter-prop="title"
|
||||
>
|
||||
<template #title="{ value: val, title }">
|
||||
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
|
||||
<template v-else>{{ title }}</template>
|
||||
</template>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="计算碳排" name="resource">
|
||||
<a-radio-group v-model:value="formState.resource">
|
||||
<a-radio value="1">是</a-radio>
|
||||
<a-radio value="2">否</a-radio>
|
||||
<a-form-item label="计算碳排" name="isComputeCarbon">
|
||||
<a-radio-group v-model:value="formState.isComputeCarbon" @change="changeRadio">
|
||||
<a-radio value="0">是</a-radio>
|
||||
<a-radio value="1">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="排放类型" name="region">
|
||||
<a-select v-model:value="formState.region" placeholder="请选择排放类型">
|
||||
<a-select-option value="shanghai">Zone one</a-select-option>
|
||||
<a-select-option value="beijing">Zone two</a-select-option>
|
||||
<a-form-item label="排放类型" name="emissionType">
|
||||
<a-select v-model:value="formState.emissionType" placeholder="请选择排放类型">
|
||||
<a-select-option value="直接排放">直接排放</a-select-option>
|
||||
<a-select-option value="间接排放">间接排放</a-select-option>
|
||||
<a-select-option value="其他">其他</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="1月" name="delivery">
|
||||
<a-switch v-model:checked="formState.delivery" />
|
||||
</a-form-item>
|
||||
<a-row>
|
||||
<a-col :span="24" style="display:flex;justify-content: space-around;">
|
||||
<a-form-item label="1月" name="janFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.janFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="2月" name="febFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.febFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="3月" name="marFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.marFlag" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" style="display:flex;justify-content: space-around;">
|
||||
<a-form-item label="4月" name="aprFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.aprFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="5月" name="mayFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.mayFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="6月" name="junFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.junFlag" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" style="display:flex;justify-content: space-around;">
|
||||
<a-form-item label="7月" name="julFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.julFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="8月" name="augFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.augFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="9月" name="sepFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.sepFlag" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" style="display:flex;justify-content: space-around;">
|
||||
<a-form-item label="10月" name="octFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.octFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="11月" name="novFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.novFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="12月" name="decFlag" :label-col="switchLabelCol" :wrapper-col="switchWrapperCol">
|
||||
<a-switch v-model:checked="formState.decFlag" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||
@@ -95,13 +136,17 @@
|
||||
import { ref,reactive, toRaw } from 'vue';
|
||||
import type { UnwrapRef } from 'vue';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import type { CascaderProps,TreeSelectProps } from 'ant-design-vue';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { tableColumns } from '../config';
|
||||
import { energyConsumption } from '/@/api/carbonEmissionFactorLibrary';
|
||||
defineOptions({
|
||||
name: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
|
||||
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
'a-pagination': Pagination,
|
||||
},
|
||||
});
|
||||
|
||||
const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
|
||||
@@ -111,30 +156,61 @@
|
||||
const selectYear = ref<Dayjs>();
|
||||
const current = ref<number>(1);
|
||||
const pageSize = ref<number>(10);
|
||||
const total = ref<number>()
|
||||
const queryParams = ref({
|
||||
pageNum:current.value,
|
||||
pageSize:pageSize.value,
|
||||
})
|
||||
const visible = ref(false);
|
||||
const value = ref<string[]>([]);
|
||||
const data = ref([]);
|
||||
interface FormState {
|
||||
name: string;
|
||||
region: string | undefined;
|
||||
delivery: boolean;
|
||||
resource: string;
|
||||
energyType: string;
|
||||
unit: string;
|
||||
collectionNode: string;
|
||||
emissionType: string | undefined;
|
||||
isComputeCarbon: string;
|
||||
janFlag: boolean;
|
||||
febFlag: boolean;
|
||||
marFlag: boolean;
|
||||
aprFlag: boolean;
|
||||
mayFlag: boolean;
|
||||
junFlag: boolean;
|
||||
julFlag: boolean;
|
||||
augFlag: boolean;
|
||||
sepFlag: boolean;
|
||||
octFlag: boolean;
|
||||
novFlag: boolean;
|
||||
decFlag: boolean;
|
||||
}
|
||||
const formRef = ref();
|
||||
const labelCol = { span: 5 };
|
||||
const wrapperCol = { span: 13 };
|
||||
const wrapperCol = { span: 19 };
|
||||
const switchLabelCol = { span: 10 };
|
||||
const switchWrapperCol = { span: 14 };
|
||||
const formState: UnwrapRef<FormState> = reactive({
|
||||
name: '',
|
||||
region: undefined,
|
||||
delivery: false,
|
||||
resource: '',
|
||||
energyType: '',
|
||||
unit: '',
|
||||
collectionNode: '',
|
||||
emissionType: undefined,
|
||||
isComputeCarbon: '',
|
||||
janFlag: false,
|
||||
febFlag: false,
|
||||
marFlag: false,
|
||||
aprFlag: false,
|
||||
mayFlag: false,
|
||||
junFlag: false,
|
||||
julFlag: false,
|
||||
augFlag: false,
|
||||
sepFlag: false,
|
||||
octFlag: false,
|
||||
novFlag: false,
|
||||
decFlag: false,
|
||||
});
|
||||
// 定义form表单的必填
|
||||
const rules: Record<string, Rule[]> = {
|
||||
name: [
|
||||
{ required: true, message: '请输入能源种类', trigger: 'change' },
|
||||
],
|
||||
resource: [{ required: true, message: 'Please select activity resource', trigger: 'change' }],
|
||||
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
|
||||
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }],
|
||||
emissionType : [{ required: false, message: '请输入选择排放类型', trigger: 'change' }]
|
||||
};
|
||||
// 定义计量单位级联选择的变量
|
||||
const options: CascaderProps['options'] = [
|
||||
@@ -172,7 +248,6 @@
|
||||
},
|
||||
];
|
||||
// 定义自动采集节点数的变量
|
||||
const treeValue = ref<string>();
|
||||
const treeData = ref<TreeSelectProps['treeData']>([
|
||||
{
|
||||
title: 'parent 1',
|
||||
@@ -199,13 +274,33 @@
|
||||
],
|
||||
},
|
||||
]);
|
||||
// 年份选择改变触发
|
||||
const changeYearData = () => {
|
||||
queryParams.value.year = selectYear.value.format('YYYY')
|
||||
getTableList()
|
||||
}
|
||||
// 获取表格数据
|
||||
const getTableList = () => {
|
||||
fetch(energyConsumption.pageList).then((res) => {
|
||||
console.log(res,'aaaaaa');
|
||||
fetch(energyConsumption.pageList , queryParams.value).then((res) => {
|
||||
data.value = res.data.records
|
||||
total.value = res.data.total
|
||||
});
|
||||
};
|
||||
getTableList()
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number,size: number) => {
|
||||
current.value = pageNumber;
|
||||
pageSize.value = size;
|
||||
};
|
||||
// 计算碳排切换
|
||||
const changeRadio = (e) => {
|
||||
if(e.target.value==='0'){
|
||||
rules.emissionType.required = true
|
||||
}else{
|
||||
rules.emissionType.required = false
|
||||
}
|
||||
console.log(rules);
|
||||
};
|
||||
// 点击确定提交
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
@@ -217,9 +312,6 @@
|
||||
console.log('error', error);
|
||||
});
|
||||
};
|
||||
const resetForm = () => {
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
// 点击新增按钮
|
||||
const addNewData = () => {
|
||||
visible.value = true
|
||||
@@ -227,6 +319,7 @@
|
||||
// 关闭新增抽屉
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
|
@@ -4,24 +4,6 @@
|
||||
// height: 100%;
|
||||
position: relative;
|
||||
// background: linear-gradient(#badaff, #8cabeb, #7095de);
|
||||
.drawer-box {
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
border-radius: 2px;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: rgba(0, 0 ,0 ,0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
.drawer-icon {
|
||||
|
||||
}
|
||||
}
|
||||
// 照明设备功能总容器
|
||||
.lighting-img-box {
|
||||
position: relative;
|
||||
@@ -88,9 +70,9 @@
|
||||
background: rgba(80, 236, 244, 0.3);
|
||||
border: 2px solid rgb(80, 236, 244);
|
||||
}
|
||||
.area-item:hover {
|
||||
border:2px solid white;
|
||||
}
|
||||
// .area-item:hover {
|
||||
// transform: scale(1.05);
|
||||
// }
|
||||
.area-item {
|
||||
cursor: pointer;
|
||||
transition: all ease 0.2s;
|
||||
@@ -125,20 +107,21 @@
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
.group-shadow {
|
||||
transition: all ease 0.2s;
|
||||
}
|
||||
.group-shadow:hover {
|
||||
border: 2px solid white;
|
||||
}
|
||||
// .group-shadow {
|
||||
// transition: all ease 0.2s;
|
||||
// }
|
||||
// .group-shadow:hover {
|
||||
// transform: scale(1.05);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 总容器与抽屉按钮
|
||||
.ns-content-main {
|
||||
position: relative;
|
||||
// 抽屉伸缩按钮
|
||||
.drawer-box {
|
||||
// 抽屉打开按钮
|
||||
.drawer-box-in {
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
border-radius: 2px;
|
||||
@@ -152,8 +135,22 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
.drawer-icon {
|
||||
|
||||
}
|
||||
}
|
||||
// 抽屉关闭按钮
|
||||
.drawer-box-out {
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
border-radius: 2px;
|
||||
position: fixed;
|
||||
right: 496px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
background: rgba(0, 0 ,0 ,0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,73 +9,156 @@
|
||||
</div>
|
||||
<!-- 楼层区域 -->
|
||||
<div class="area">
|
||||
<div class="area-item area1" :class="{ 'isActive': area === 1 }" @click="getArea(1)">
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow1" @click.stop="getArea(1.1)"></div>
|
||||
</div>
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow1" @click.stop="getArea(1.2)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="area-item area2" @click="getArea(2)">
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow2" @click.stop="getArea(2.1)"></div>
|
||||
</div>
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow2" @click.stop="getArea(2.2)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="area-item area3" @click="getArea(3)">
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow3" @click.stop="getArea(3.1)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="area-item area4" @click="getArea(4)">
|
||||
<div class="light-group">
|
||||
<div class="group-shadow group-shadow4" @click.stop="getArea(4.1)"></div>
|
||||
<div
|
||||
v-for="(item, index) in treeData"
|
||||
:class="computedClass(item.id)"
|
||||
@click="getArea(item.id)"
|
||||
:key="index">
|
||||
<div v-for="(v, i) in item.children" :key="i" class="light-group">
|
||||
<div class="group-shadow group-shadow1" :class="computedClass(v.id)" @click.stop="getArea(v.id)"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 照明设备 -->
|
||||
<div class="lights">
|
||||
<light :styleObject="{left: '190px', bottom: '200px'}" :type="1"></light>
|
||||
<light :styleObject="{left: '245px', bottom: '125px'}" :type="2"></light>
|
||||
<light :styleObject="{left: '355px', bottom: '160px'}" :type="3"></light>
|
||||
<light :styleObject="{left: '295px', bottom: '230px'}" :type="3"></light>
|
||||
<light :styleObject="{left: '460px', bottom: '230px'}" :type="3"></light>
|
||||
<light :styleObject="{left: '510px', bottom: '190px'}" :type="3"></light>
|
||||
<light :styleObject="{left: '415px', bottom: '275px'}" :type="1"></light>
|
||||
<light v-for="(item, index) in bulbs" :key="index" :styleObject="item.styleText" :type="item.type" :visible="item.visible"></light>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧抽屉的触发按钮 -->
|
||||
<div class="drawer-box" v-if="!visible">
|
||||
<double-left-outlined class="drawer-icon" style="color: rgba(255, 255, 255, 1)" />
|
||||
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
|
||||
<double-left-outlined class="drawer-icon" style="color: white" />
|
||||
</div>
|
||||
<!-- 左侧抽屉的关闭按钮 -->
|
||||
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
|
||||
<double-right-outlined class="drawer-icon" style="color: white;" />
|
||||
</div>
|
||||
<!-- 右侧抽屉 -->
|
||||
<a-drawer
|
||||
v-model:visible="visible"
|
||||
class="drawer-item"
|
||||
width="496"
|
||||
placement="right"
|
||||
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }"
|
||||
:closable="false"
|
||||
id="Odrawer"
|
||||
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="控制面板">
|
||||
<tabs1 @changeArea="getArea" :treeData="treeData"></tabs1>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="计划列表" force-render>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="日志"></a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-drawer>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import { ref } from 'vue';
|
||||
import { treeData } from './treeData'
|
||||
import light from './light.vue';
|
||||
import tabs1 from './tabs1.vue'
|
||||
// ICON
|
||||
import {
|
||||
DoubleLeftOutlined,
|
||||
DoubleRightOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
|
||||
let area = ref(1)
|
||||
let visible = ref(false)
|
||||
// 分区 - 当前选择的分区 - 默认选择一区
|
||||
let area = ref(['1'])
|
||||
// 分区 - 分区小灯泡
|
||||
const bulbs = ref([
|
||||
{
|
||||
styleText: { left: '190px', bottom: '200px' },
|
||||
area: 1,
|
||||
type: 1,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '245px', bottom: '125px' },
|
||||
area: 1,
|
||||
type: 2,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '355px', bottom: '160px' },
|
||||
area: 1,
|
||||
type: 3,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '295px', bottom: '230px' },
|
||||
area: 1,
|
||||
type: 3,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '425px', bottom: '230px' },
|
||||
area: 2,
|
||||
type: 3,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '470px', bottom: '190px' },
|
||||
area: 2,
|
||||
type: 3,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '380px', bottom: '275px' },
|
||||
area: 2,
|
||||
type: 3,
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
styleText: { left: '700px', bottom: '320px' },
|
||||
area: 3,
|
||||
type: 1,
|
||||
visible: true
|
||||
},
|
||||
])
|
||||
|
||||
// 分区 - 单个分区切换
|
||||
const getArea = (result: any) => {
|
||||
// 如果传入的值是数组
|
||||
if (Array.isArray(result)) {
|
||||
area.value = result
|
||||
// 如果不是数组
|
||||
} else {
|
||||
area.value.length = 0
|
||||
area.value[0] = String(result)
|
||||
}
|
||||
}
|
||||
// 分区 - 多个分区切换,只有照明回路能够触发多个分区
|
||||
// 分区 - 样式函数
|
||||
const computedClass = (number: number) => {
|
||||
if (area.value.indexOf(number) != -1) {
|
||||
return `isActive area-item area${number}`
|
||||
} else {
|
||||
return `area-item area${number}`
|
||||
}
|
||||
}
|
||||
|
||||
const getArea = (number: any) => {
|
||||
alert(number)
|
||||
// 抽屉 - 当前选择的tab
|
||||
let activeKey = ref('1');
|
||||
// 抽屉 - 打开状态
|
||||
let visible = ref(false);
|
||||
// 抽屉 - 开关事件
|
||||
const toggleDrawer = () => {
|
||||
visible.value = !visible.value;
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@import "./indexs.less";
|
||||
.isActive {
|
||||
border: 2px solid white !important;
|
||||
border: 3px solid white !important;
|
||||
}
|
||||
:deep(.ant-tabs-tab-btn) {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="icon-box" :style="styleObject">
|
||||
<div class="icon-box" :style="styleObject" v-show="visible">
|
||||
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="">
|
||||
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="">
|
||||
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="">
|
||||
@@ -43,9 +43,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
defineProps({
|
||||
styleObject: Object,
|
||||
type: Number
|
||||
styleObject: Object,
|
||||
type: Number,
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const result = ref({
|
||||
|
1018
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
Normal file
1018
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,88 @@
|
||||
import { ref } from 'vue';
|
||||
export const treeData = ref([
|
||||
{
|
||||
label: '站厅',
|
||||
id: '1',
|
||||
// 前端遍历后添加,属前端属性
|
||||
selected: false,
|
||||
children: [{
|
||||
label: '站厅1区',
|
||||
id: '1-1',
|
||||
// 前端属性
|
||||
selected: false,
|
||||
// 后端属性(表示禁用了一个设备)
|
||||
stop: false,
|
||||
// 当前的控制模式
|
||||
type: 3
|
||||
},{
|
||||
label: '站厅2区',
|
||||
id: '1-2',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 1
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '站台',
|
||||
id: '2',
|
||||
selected: false,
|
||||
children: [{
|
||||
label: '站台1区',
|
||||
id: '2-1',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 1
|
||||
},{
|
||||
label: '站台2区',
|
||||
id: '2-2',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 2
|
||||
},{
|
||||
label: '站台3区',
|
||||
id: '2-3',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 3
|
||||
},{
|
||||
label: '站台4区',
|
||||
id: '2-4',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 1
|
||||
}]
|
||||
},{
|
||||
label: '办公室',
|
||||
id: '3',
|
||||
selected: false,
|
||||
children: [{
|
||||
label: '办公室1区',
|
||||
id: '3-1',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 2
|
||||
}]
|
||||
},{
|
||||
label: '楼道',
|
||||
id: '4',
|
||||
selected: false,
|
||||
children: [{
|
||||
label: '楼道1区',
|
||||
id: '4-1',
|
||||
selected: false,
|
||||
stop: false,
|
||||
type: 3
|
||||
}]
|
||||
},
|
||||
]);
|
||||
|
||||
export const controlType = ref([{
|
||||
name: '托管',
|
||||
type: 1,
|
||||
},{
|
||||
name: 'AI',
|
||||
type: 2,
|
||||
},{
|
||||
name: '手动',
|
||||
type: 3,
|
||||
}])
|
@@ -4,10 +4,13 @@ import { http } from '/nerv-lib/util';
|
||||
import { ref } from 'vue';
|
||||
import { group } from '/@/api/deviceManage';
|
||||
import { dict } from '/@/api';
|
||||
const tableKeyMap = [
|
||||
import { origanizemanage } from '/@/api/origanizemanage';
|
||||
const tableCalKeyMap = [
|
||||
{
|
||||
title: '来源企业',
|
||||
dataIndex: 'id',
|
||||
dataIndex: 'orgName',
|
||||
// textEllipsis: true,
|
||||
// textNumber: 4,
|
||||
},
|
||||
{
|
||||
title: '设备id',
|
||||
@@ -32,20 +35,18 @@ const tableKeyMap = [
|
||||
dataIndex: 'position',
|
||||
},
|
||||
];
|
||||
const tableCalKeyMap = [
|
||||
const tableKeyMap = [
|
||||
{
|
||||
title: '来源企业',
|
||||
dataIndex: 'id',
|
||||
dataIndex: 'orgName',
|
||||
},
|
||||
{
|
||||
title: '节点编号',
|
||||
dataIndex: 'deviceName',
|
||||
textNumber: 8,
|
||||
textEllipsis: true,
|
||||
dataIndex: 'pointNum',
|
||||
},
|
||||
{
|
||||
title: '节点路径',
|
||||
dataIndex: 'position',
|
||||
dataIndex: 'routeName',
|
||||
},
|
||||
];
|
||||
const doWnload = (url) => {
|
||||
@@ -125,6 +126,26 @@ export const formSchema = [
|
||||
],
|
||||
},
|
||||
];
|
||||
export const editTreeConfig = (orgId) => ({
|
||||
selectedKeys: ['0-0'],
|
||||
defaultExpandAll: true,
|
||||
api: group.queryEditGroup,
|
||||
params: { orgId },
|
||||
resultField: 'data.orgInfos',
|
||||
fieldNames: { title: 'orgName', key: 'orgId' },
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'orgName',
|
||||
component: 'NsInput',
|
||||
autoSubmit: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入企业名称',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
export const treeConfig = (orgId) => {
|
||||
return {
|
||||
defaultExpandAll: true,
|
||||
@@ -133,15 +154,8 @@ export const treeConfig = (orgId) => {
|
||||
title: '能耗分组',
|
||||
},
|
||||
params: { orgId },
|
||||
showLine: { showLeafIcon: false },
|
||||
|
||||
api: group.queryDeviceGroupTree,
|
||||
// api: () => {
|
||||
// return new Promise((resolve) => {
|
||||
// setTimeout(() => {
|
||||
// resolve({ data: [{ title: '全部', key: 'all', children: data.data }] });
|
||||
// }, 100);
|
||||
// });
|
||||
// },
|
||||
transform: (data) => {
|
||||
return [{ pointName: '全部', id: 'all', selectable: false, children: data }];
|
||||
},
|
||||
@@ -176,12 +190,11 @@ export const treeConfig = (orgId) => {
|
||||
},
|
||||
};
|
||||
};
|
||||
export const tableConfig = (el, elGroup, elFormula) => {
|
||||
export const tableConfig = (el, elGroup, elFormula, defaultParams) => {
|
||||
return {
|
||||
title: '点位信息',
|
||||
// api: '/carbon_emission/device/getDeviceList',
|
||||
value: mockData.value,
|
||||
|
||||
api: group.queryGroupPage,
|
||||
params: defaultParams.value,
|
||||
headerActions: [
|
||||
{
|
||||
label: '编辑',
|
||||
@@ -193,7 +206,7 @@ export const tableConfig = (el, elGroup, elFormula) => {
|
||||
},
|
||||
{
|
||||
label: '批量删除',
|
||||
name: 'groupTemDownload',
|
||||
name: 'groupBatDelete',
|
||||
type: 'primary',
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
@@ -244,7 +257,7 @@ export const tableConfig = (el, elGroup, elFormula) => {
|
||||
|
||||
{
|
||||
label: '批量分组',
|
||||
name: 'groupTemDownload',
|
||||
name: 'groupBatGroup',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
elGroup.value.toggle();
|
||||
@@ -252,7 +265,7 @@ export const tableConfig = (el, elGroup, elFormula) => {
|
||||
},
|
||||
{
|
||||
label: '公式编辑',
|
||||
name: 'groupTemDownload',
|
||||
name: 'groupFormulaEdit',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
elFormula.value.toggle();
|
||||
@@ -265,7 +278,7 @@ export const tableConfig = (el, elGroup, elFormula) => {
|
||||
actions: [
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'groupDelete',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: () => {
|
||||
@@ -341,11 +354,13 @@ export const tableConfig = (el, elGroup, elFormula) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const tableConfigCal = (el, elGroup, elFormula) => {
|
||||
export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => {
|
||||
// 分组节点
|
||||
return {
|
||||
title: '点位信息',
|
||||
// api: '/carbon_emission/device/getDeviceList',
|
||||
value: mockData.value,
|
||||
params: defaultParams,
|
||||
|
||||
headerActions: [
|
||||
{
|
||||
@@ -413,12 +428,12 @@ export const tableConfigCal = (el, elGroup, elFormula) => {
|
||||
actions: [
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
name: 'groupDelete',
|
||||
dynamicParams: 'id',
|
||||
confirm: true,
|
||||
handle: () => {
|
||||
mockData.value.splice(0, 1);
|
||||
},
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: group.delGroupList,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@@ -1,53 +1,72 @@
|
||||
<template>
|
||||
<ns-drawer
|
||||
v-model:visible="visible"
|
||||
size="large"
|
||||
:width="800"
|
||||
class="custom-class"
|
||||
title="编辑"
|
||||
title=" "
|
||||
destroyOnClose
|
||||
:ok="btnClick"
|
||||
:cancel="() => (visible = false)"
|
||||
placement="right">
|
||||
<div class="drawerContainer">
|
||||
<ns-tree-api v-bind="treeConfig" @select="treeSelect" />
|
||||
<ns-tree-api v-bind="config" @select="treeSelect" />
|
||||
<a-transfer
|
||||
v-model:target-keys="targetKeys"
|
||||
:data-source="mockData"
|
||||
:data-source="dataSource"
|
||||
style="height: 100%; width: 66%"
|
||||
oneWay
|
||||
:listStyle="listStyle"
|
||||
show-search
|
||||
:render="(item) => item.title"
|
||||
:filter-option="filterOption"
|
||||
:render="(item) => item.title" />
|
||||
@change="handleChange" />
|
||||
</div>
|
||||
</ns-drawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { treeConfig } from './config';
|
||||
|
||||
const visible = ref(false);
|
||||
const mockData = ref([]);
|
||||
|
||||
import { editTreeConfig } from './config';
|
||||
import { group } from '/@/api/deviceManage';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
const props = defineProps({ params: Object });
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
const config = computed(() => {
|
||||
return editTreeConfig(result);
|
||||
});
|
||||
const visible = ref(true);
|
||||
const dataSource = ref([]);
|
||||
const listStyle = {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
};
|
||||
const targetKeys = ref<string[]>([]);
|
||||
const targetKeys = ref([]);
|
||||
const currentId = ref('');
|
||||
const toggle = () => {
|
||||
visible.value = !visible.value;
|
||||
};
|
||||
const handleChange = (nextTargetKeys: string[], direction: string, moveKeys: string[]) => {
|
||||
console.log('targetKeys: ', nextTargetKeys);
|
||||
console.log('direction: ', direction);
|
||||
console.log('moveKeys: ', moveKeys);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getMock('上海公司');
|
||||
});
|
||||
|
||||
const filterOption = (inputValue: string, option: MockData) => {
|
||||
return option.description.indexOf(inputValue) > -1;
|
||||
const filterOption = (inputValue: string, option: any) => {
|
||||
return option?.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1;
|
||||
};
|
||||
|
||||
const btnClick = () => {
|
||||
visible.value = false;
|
||||
NsMessage.success('编辑成功');
|
||||
// visible.value = false;
|
||||
|
||||
http
|
||||
.post(group.saveGroupList, {
|
||||
...props.params,
|
||||
saveOrgId: currentId.value,
|
||||
saveGroupIds: targetKeys.value,
|
||||
})
|
||||
.then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
});
|
||||
};
|
||||
function treeSelect(
|
||||
selectedKeys: never[],
|
||||
@@ -62,26 +81,27 @@
|
||||
const {
|
||||
dataRef: { title },
|
||||
} = e.node;
|
||||
|
||||
getMock(title);
|
||||
currentId.value = selectedKeys[0];
|
||||
getData(currentId.value);
|
||||
}
|
||||
const getMock = (company) => {
|
||||
const keys = [];
|
||||
const mData = [];
|
||||
for (let i = 0; i < 60; i++) {
|
||||
const data = {
|
||||
key: i.toString(),
|
||||
title: `A00${i + 1}总用电量(${company})`,
|
||||
description: `description of content${i + 1}`,
|
||||
chosen: Math.random() * 2 > 1,
|
||||
};
|
||||
if (data.chosen) {
|
||||
keys.push(data.key);
|
||||
}
|
||||
mData.push(data);
|
||||
}
|
||||
mockData.value = mData;
|
||||
targetKeys.value = keys;
|
||||
const getData = (id) => {
|
||||
http
|
||||
.post(group.queryEditGroup, {
|
||||
orgId: result,
|
||||
queryOrgId: id,
|
||||
...props.params,
|
||||
// energyType: props.params.energyType,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data.groups?.map((item) => {
|
||||
item['title'] = item.pointName;
|
||||
item['key'] = item.id.toString();
|
||||
return item;
|
||||
});
|
||||
targetKeys.value = res.data.linkGroups.map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
toggle,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<editDrawer ref="editDrawerRef" />
|
||||
<editDrawer ref="editDrawerRef" :params="defaultParams" />
|
||||
<editGroup ref="editGroupRef" />
|
||||
<editFormula ref="editFormulaRef" />
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
</template>
|
||||
</ns-tree-api>
|
||||
</div>
|
||||
<ns-view-list-table v-show="defaultType" class="table" v-bind="config" />
|
||||
<ns-view-list-table v-show="!defaultType" class="table" v-bind="configCal" />
|
||||
<ns-view-list-table v-if="defaultType" class="table" v-bind="config" ref="tableRef" />
|
||||
<ns-view-list-table v-else class="table" v-bind="configCal" ref="tableCalRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -53,14 +53,18 @@
|
||||
type opType = 'up' | 'down';
|
||||
const { getParams } = useParams();
|
||||
const modalFormRef = ref();
|
||||
const tableRef = ref();
|
||||
const tableCalRef = ref();
|
||||
const editDrawerRef = ref();
|
||||
const editGroupRef = ref();
|
||||
const editFormulaRef = ref();
|
||||
const treeRef = ref();
|
||||
const defaultType = ref(true);
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
const config = tableConfig(editDrawerRef, editGroupRef, editFormulaRef);
|
||||
const configCal = tableConfigCal(editDrawerRef, editGroupRef, editFormulaRef);
|
||||
const defaultParams = ref({ orgId: result, energyType: '用电量', id: 19 });
|
||||
|
||||
const config = tableConfig(editDrawerRef, editGroupRef, editFormulaRef, defaultParams);
|
||||
const configCal = tableConfigCal(editDrawerRef, editGroupRef, editFormulaRef, defaultParams);
|
||||
const tConfig = treeConfig(result);
|
||||
const nsModalFormConfig = ref({
|
||||
api: group.creatOrUpdate,
|
||||
@@ -150,8 +154,17 @@
|
||||
{ title: '下移', key: 'moveDown', func: (data) => moveNode(data, 'down') },
|
||||
{ title: '删除', key: 'deleteNode', func: (data) => deleteNode(data) },
|
||||
];
|
||||
const handleSelect = () => {
|
||||
defaultType.value = !defaultType.value;
|
||||
const handleSelect = (key, record) => {
|
||||
console.log(record);
|
||||
const {
|
||||
node: { pointType, id, energyType },
|
||||
} = record;
|
||||
defaultParams.value.energyType = energyType;
|
||||
defaultParams.value.id = id;
|
||||
defaultType.value = pointType === '分组节点';
|
||||
defaultType.value
|
||||
? tableRef.value?.nsTableRef.reload()
|
||||
: tableCalRef.value?.nsTableRef.reload();
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
@@ -194,7 +194,7 @@
|
||||
const selectRoleRef = ref();
|
||||
const formSchema = formConfig(disabled as any);
|
||||
const formSchema2 = formConfig2(roleDisabled as any);
|
||||
const { orgName, projectId, orgId } = JSON.parse(sessionStorage.getItem('userInfo'));
|
||||
const { orgName, projectId, orgId } = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH));
|
||||
// const orgId = JSON.parse(sessionStorage.getItem('ORGID'));
|
||||
const roleTreeData = ref([]);
|
||||
const rolePermissionTreeData = ref([]);
|
||||
|
@@ -89,7 +89,7 @@ export const formConfig = (disabled) => {
|
||||
label: '组织关系',
|
||||
field: 'orgName',
|
||||
component: 'NsInput',
|
||||
defaultValue: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
|
||||
defaultValue: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
maxLength: 30,
|
||||
|
@@ -104,7 +104,7 @@
|
||||
const treeDataDept = ref([]);
|
||||
const treeData2 = ref([]);
|
||||
const userAuthList = ref([]);
|
||||
// const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
|
||||
// const orgId = JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgId;
|
||||
const orgId = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
const orgTreeConfig = ref({
|
||||
selectedKeys: ['0-0'],
|
||||
@@ -291,7 +291,7 @@
|
||||
setTimeout(() => {
|
||||
formData.value = {
|
||||
sex: '男',
|
||||
orgName: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
|
||||
orgName: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName,
|
||||
};
|
||||
userAuthList.value.splice(0);
|
||||
});
|
||||
|
Reference in New Issue
Block a user