修改绿能小数问题
|
@ -45,6 +45,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "5.0.5",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
||||
"less": "^4.3.0",
|
||||
"sass": "1.77.5",
|
||||
"unplugin-auto-import": "0.17.6",
|
||||
|
|
After Width: | Height: | Size: 550 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 289 B |
After Width: | Height: | Size: 413 B |
After Width: | Height: | Size: 551 B |
|
@ -0,0 +1 @@
|
|||
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7834"><path d="M677.888 494.592q0 28.672-10.752 53.76t-29.184 43.52-43.008 29.184-53.248 10.752-53.248-10.752-43.008-29.184-29.184-43.52-10.752-53.76q0-27.648 10.752-52.736t29.184-43.52 43.008-29.184 53.248-10.752 53.248 10.752 43.008 29.184 29.184 43.52 10.752 52.736zM171.008 766.976q-28.672 0-51.2-5.12t-37.888-17.408-23.552-33.28-8.192-52.736l0-346.112q0-57.344 27.136-79.872t85.504-22.528l172.032 0q16.384 0 27.136-6.144t17.408-16.384 11.776-24.064 11.264-28.16q10.24-26.624 35.84-46.08t58.368-19.456l95.232 0q37.888 0 61.952 20.992t32.256 44.544q11.264 30.72 29.696 52.736t38.912 22.016l130.048 0q45.056-1.024 71.68 24.576t26.624 74.752l0 351.232q0 52.224-27.648 79.36t-73.728 27.136l-710.656 0zM539.648 280.576q-45.056 0-83.968 16.896t-67.584 46.08-45.568 68.096-16.896 82.944q0 45.056 16.896 83.968t45.568 67.584 67.584 45.568 83.968 16.896q44.032 0 82.944-16.896t67.584-45.568 45.568-67.584 16.896-83.968q0-44.032-16.896-82.944t-45.568-68.096-67.584-46.08-82.944-16.896zM611.328 169.984q0-16.384-1.536-25.6t-20.992-9.216l-84.992 0q-19.456-1.024-20.992 8.192t-1.536 26.624q-1.024 19.456 2.048 27.648t20.48 8.192l84.992 0q19.456 0 20.992-9.216t1.536-26.624z" p-id="7835"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1 @@
|
|||
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8963"><path d="M253.6 679.2l109.6-109.6C356 552 352 532.8 352 512c0-88 72-160 160-160 20.8 0 40 4 57.6 11.2l82.4-82.4C607.2 264.8 560 256 512 256c-168 0-329.6 106.4-384 256 24 65.6 68.8 123.2 125.6 167.2zM416 512v4.8L516.8 416H512c-52.8 0-96 43.2-96 96zM770.4 344.8l163.2-163.2L888 136l-753.6 753.6 45.6 45.6 192.8-192.8A390.4 390.4 0 0 0 512 768c167.2 0 330.4-106.4 384.8-256-24-65.6-69.6-123.2-126.4-167.2zM512 672c-20 0-40-4-57.6-11.2l53.6-53.6h4.8c52.8 0 96-43.2 96-96v-4.8l53.6-53.6C668 472 672 492 672 512c0 88-72 160-160 160z" p-id="8964"></path></svg>
|
After Width: | Height: | Size: 747 B |
|
@ -0,0 +1 @@
|
|||
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2562"><path d="M1002.7584 475.776L566.2784 39.68 537.1584 10.24a35.584 35.584 0 0 0-50.176 0L21.2544 475.776A72.192 72.192 0 0 0 0.0064 527.744a72.96 72.96 0 0 0 73.28 71.488h48v367.872h781.44V599.232h49.024c19.264 0 37.44-7.552 51.136-21.184 13.696-13.696 21.12-31.872 21.12-51.2 0-19.2-7.552-37.376-21.248-51.072z m-427.52 410.048H448.7744v-230.4h126.464v230.4z m246.144-367.872v367.872h-173.824V628.288a45.184 45.184 0 0 0-45.184-45.184H421.6384a45.184 45.184 0 0 0-45.184 45.184v257.536H202.6304V517.952H94.2144l417.92-417.6 26.048 26.112 391.68 391.488h-108.48z" p-id="2563"></path></svg>
|
After Width: | Height: | Size: 782 B |
|
@ -0,0 +1 @@
|
|||
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6047"><path d="M512 269.27407445c72.81777778 0 131.072-53.39970333 131.072-121.36296334S584.81777778 26.54814777 512 26.54814777 380.928 79.94785223 380.928 147.91111111 439.18222222 269.27407445 512 269.27407445z m165.05363001 116.50844445c-4.8545189-29.12711111-29.12711111-53.39970333-63.10874112-53.39970447h-33.98163001c-9.70903666 0-14.56355555 4.8545189-24.27259221 9.7090378l-43.69066667 33.98162887-43.69066667-38.83614777c-4.8545189-4.8545189-14.56355555-9.70903666-24.27259221-9.70903666h-33.98163001c-33.98163001 0-63.10874112 24.27259221-63.10874112 53.39970333L317.81925888 599.38133333c0 9.70903666 0 19.41807445 9.70903779 24.27259222 4.8545189 4.8545189 14.56355555 9.70903666 24.27259222 9.70903779h33.98163001l29.12711111 310.68918443c4.8545189 29.12711111 29.12711111 53.39970333 63.10873998 53.39970446h72.81777778c33.98163001 0 63.10874112-24.27259221 63.10874112-53.39970446l29.12711111-310.68918443h33.98163001c9.70903666 0 19.41807445-4.8545189 24.27259221-9.70903779 4.8545189-9.70903666 4.8545189-14.56355555 4.8545189-24.27259222l-29.12711111-213.59881443z" p-id="6048"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1 @@
|
|||
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7372"><path d="M511.777943 68.191078c-245.204631 0-443.586864 198.60429-443.586864 443.808922s198.382233 443.808922 443.586864 443.808922 444.030979-198.60429 444.030979-443.808922S756.982574 68.191078 511.777943 68.191078zM819.11568 334.476841 688.191838 334.476841c-14.423501-55.476499-34.617425-108.733447-61.245899-157.995407C708.606797 204.440206 776.509303 261.025968 819.11568 334.476841zM512 158.506037c37.058011 53.256948 65.906036 112.505353 84.767616 175.96978L427.232384 334.475817C446.093964 271.01139 474.941989 211.762985 512 158.506037zM168.491459 600.76158c-7.322779-28.40391-11.538801-58.139142-11.538801-88.76158s4.216022-60.35767 11.538801-88.76158l149.785421 0c-3.550873 29.069059-5.991458 58.582233-5.991458 88.76158s2.440585 59.69252 6.213515 88.76158L168.491459 600.76158zM204.662263 689.523159l130.923842 0c14.423501 55.476499 34.617425 108.733447 61.245899 158.217465C315.171146 819.780829 247.267617 762.974032 204.662263 689.523159zM335.586105 334.476841 204.662263 334.476841c42.605354-73.449849 110.508883-130.257669 192.168718-158.217465C370.202507 225.743394 350.009605 279.000342 335.586105 334.476841zM512 865.493963c-36.835953-53.256948-65.683978-112.505353-84.767616-175.96978l169.535231 0C577.682955 752.987586 548.835953 812.235992 512 865.493963zM615.851253 600.76158 408.148747 600.76158c-4.216022-29.069059-7.100722-58.582233-7.100722-88.76158s2.8847-59.69252 7.100722-88.76158l207.702506 0c4.216022 29.069059 7.100722 58.582233 7.100722 88.76158S620.067274 571.69252 615.851253 600.76158zM627.167996 847.51959c26.628474-49.485041 46.821375-102.519931 61.245899-157.995407l130.923842 0C776.510326 762.974032 708.606797 819.558771 627.167996 847.51959zM705.500039 600.76158c3.550873-29.069059 6.213515-58.582233 6.213515-88.76158s-2.440585-59.69252-6.213515-88.76158l149.785421 0c7.322779 28.40391 11.760858 58.139142 11.760858 88.76158s-4.216022 60.35767-11.760858 88.76158L705.500039 600.76158z" p-id="7373"></path></svg>
|
After Width: | Height: | Size: 2.1 KiB |
|
@ -1,103 +1,127 @@
|
|||
import { createApp } from 'vue'
|
||||
import { createApp } from "vue";
|
||||
|
||||
import Cookies from 'js-cookie'
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
import ElementPlus from 'element-plus'
|
||||
import locale from 'element-plus/es/locale/lang/zh-cn'
|
||||
import 'element-plus/theme-chalk/index.css'
|
||||
import '@/assets/styles/index.scss' // global css
|
||||
import ElementPlus from "element-plus";
|
||||
import locale from "element-plus/es/locale/lang/zh-cn";
|
||||
import "element-plus/theme-chalk/index.css";
|
||||
import "@/assets/styles/index.scss"; // global css
|
||||
|
||||
import App from './App'
|
||||
import store from './store'
|
||||
import router from './router'
|
||||
import directive from './directive' // directive
|
||||
import App from "./App";
|
||||
import store from "./store";
|
||||
import router from "./router";
|
||||
import directive from "./directive"; // directive
|
||||
|
||||
// 注册指令
|
||||
import plugins from './plugins' // plugins
|
||||
import { download } from '@/utils/request'
|
||||
import plugins from "./plugins"; // plugins
|
||||
import { download } from "@/utils/request";
|
||||
|
||||
// svg图标
|
||||
import 'virtual:svg-icons-register'
|
||||
import SvgIcon from '@/components/SvgIcon'
|
||||
import elementIcons from '@/components/SvgIcon/svgicon'
|
||||
import "virtual:svg-icons-register";
|
||||
import SvgIcon from "@/components/SvgIcon";
|
||||
import elementIcons from "@/components/SvgIcon/svgicon";
|
||||
|
||||
import './permission' // permission control
|
||||
import "./permission"; // permission control
|
||||
|
||||
import { useDict } from '@/utils/dict'
|
||||
import { parseTime, resetForm, addDateRange, formatDuraDate, formatDuraTime, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
|
||||
import request from '@/utils/request'
|
||||
import { useDict } from "@/utils/dict";
|
||||
import {
|
||||
parseTime,
|
||||
resetForm,
|
||||
addDateRange,
|
||||
formatDuraDate,
|
||||
formatDuraTime,
|
||||
handleTree,
|
||||
selectDictLabel,
|
||||
selectDictLabels,
|
||||
} from "@/utils/ruoyi";
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 分页组件
|
||||
import Pagination from '@/components/Pagination'
|
||||
import Pagination from "@/components/Pagination";
|
||||
// 自定义表格工具组件
|
||||
import RightToolbar from '@/components/RightToolbar'
|
||||
import RightToolbar from "@/components/RightToolbar";
|
||||
// 富文本组件
|
||||
import Editor from "@/components/Editor"
|
||||
import Editor from "@/components/Editor";
|
||||
// 文件上传组件
|
||||
import FileUpload from "@/components/FileUpload"
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
// 图片上传组件
|
||||
import ImageUpload from "@/components/ImageUpload"
|
||||
import ImageUpload from "@/components/ImageUpload";
|
||||
// 图片预览组件
|
||||
import ImagePreview from "@/components/ImagePreview"
|
||||
import ImagePreview from "@/components/ImagePreview";
|
||||
// 自定义树选择组件
|
||||
import TreeSelect from '@/components/TreeSelect'
|
||||
import TreeSelect from "@/components/TreeSelect";
|
||||
// 字典标签组件
|
||||
import DictTag from '@/components/DictTag'
|
||||
import DictTag from "@/components/DictTag";
|
||||
// Vue3表单组件
|
||||
import VForm3 from '@/lib/vform/designer.umd.js'
|
||||
import '@/lib/vform/designer.style.css'
|
||||
import dayjs from 'dayjs'
|
||||
const app = createApp(App)
|
||||
import VForm3 from "@/lib/vform/designer.umd.js";
|
||||
import "@/lib/vform/designer.style.css";
|
||||
import dayjs from "dayjs";
|
||||
import { notification, message, Modal } from "ant-design-vue";
|
||||
const app = createApp(App);
|
||||
notification.config({
|
||||
placement: "topLeft",
|
||||
bottom: "50px",
|
||||
top: "50px",
|
||||
duration: 3,
|
||||
});
|
||||
|
||||
// 全局方法挂载
|
||||
app.config.globalProperties.useDict = useDict
|
||||
app.config.globalProperties.download = download
|
||||
app.config.globalProperties.parseTime = parseTime
|
||||
app.config.globalProperties.resetForm = resetForm
|
||||
app.config.globalProperties.handleTree = handleTree
|
||||
app.config.globalProperties.addDateRange = addDateRange
|
||||
app.config.globalProperties.formatDuraDate = formatDuraDate
|
||||
app.config.globalProperties.formatDuraTime = formatDuraTime
|
||||
app.config.globalProperties.selectDictLabel = selectDictLabel
|
||||
app.config.globalProperties.selectDictLabels = selectDictLabels
|
||||
app.config.globalProperties.$tryToJson=(str,df)=>{
|
||||
try{
|
||||
if(!str){
|
||||
return df||{};
|
||||
app.config.globalProperties.$confirm = Modal.confirm;
|
||||
app.config.globalProperties.$message = message;
|
||||
app.config.globalProperties.$notification = notification;
|
||||
app.config.globalProperties.$info = Modal.info;
|
||||
app.config.globalProperties.$success = Modal.success;
|
||||
app.config.globalProperties.$error = Modal.error;
|
||||
app.config.globalProperties.$warning = Modal.warning;
|
||||
|
||||
app.config.globalProperties.useDict = useDict;
|
||||
app.config.globalProperties.download = download;
|
||||
app.config.globalProperties.parseTime = parseTime;
|
||||
app.config.globalProperties.resetForm = resetForm;
|
||||
app.config.globalProperties.handleTree = handleTree;
|
||||
app.config.globalProperties.addDateRange = addDateRange;
|
||||
app.config.globalProperties.formatDuraDate = formatDuraDate;
|
||||
app.config.globalProperties.formatDuraTime = formatDuraTime;
|
||||
app.config.globalProperties.selectDictLabel = selectDictLabel;
|
||||
app.config.globalProperties.selectDictLabels = selectDictLabels;
|
||||
app.config.globalProperties.$tryToJson = (str, df) => {
|
||||
try {
|
||||
if (!str) {
|
||||
return df || {};
|
||||
}
|
||||
return JSON.parse(str)||(df||{});
|
||||
}catch{
|
||||
return (df||{});
|
||||
return JSON.parse(str) || df || {};
|
||||
} catch {
|
||||
return df || {};
|
||||
}
|
||||
}
|
||||
app.config.globalProperties.$dt=dayjs;
|
||||
app.config.globalProperties.$http=request;
|
||||
};
|
||||
app.config.globalProperties.$dt = dayjs;
|
||||
app.config.globalProperties.$http = request;
|
||||
|
||||
// 全局组件挂载
|
||||
app.component('DictTag', DictTag)
|
||||
app.component('Pagination', Pagination)
|
||||
app.component('TreeSelect', TreeSelect)
|
||||
app.component('FileUpload', FileUpload)
|
||||
app.component('ImageUpload', ImageUpload)
|
||||
app.component('ImagePreview', ImagePreview)
|
||||
app.component('RightToolbar', RightToolbar)
|
||||
app.component('Editor', Editor)
|
||||
app.component("DictTag", DictTag);
|
||||
app.component("Pagination", Pagination);
|
||||
app.component("TreeSelect", TreeSelect);
|
||||
app.component("FileUpload", FileUpload);
|
||||
app.component("ImageUpload", ImageUpload);
|
||||
app.component("ImagePreview", ImagePreview);
|
||||
app.component("RightToolbar", RightToolbar);
|
||||
app.component("Editor", Editor);
|
||||
|
||||
app.use(router)
|
||||
app.use(store)
|
||||
app.use(plugins)
|
||||
app.use(elementIcons)
|
||||
app.use(router);
|
||||
app.use(store);
|
||||
app.use(plugins);
|
||||
app.use(elementIcons);
|
||||
// 全局注册VForm3,同时注册了v-form-designer、v-form-render等组件
|
||||
app.use(VForm3)
|
||||
app.component('svg-icon', SvgIcon)
|
||||
app.use(VForm3);
|
||||
app.component("svg-icon", SvgIcon);
|
||||
|
||||
directive(app)
|
||||
directive(app);
|
||||
|
||||
// 使用element-plus 并且设置全局的大小
|
||||
app.use(ElementPlus, {
|
||||
locale: locale,
|
||||
// 支持 large、default、small
|
||||
size: Cookies.get('size') || 'default'
|
||||
})
|
||||
size: Cookies.get("size") || "default",
|
||||
});
|
||||
|
||||
app.mount('#app')
|
||||
app.mount("#app");
|
||||
|
|
|
@ -133,6 +133,7 @@ export default {
|
|||
() => {
|
||||
console.log('加载模型成功')
|
||||
cb && cb()
|
||||
this.$emit('change')
|
||||
}
|
||||
)
|
||||
},
|
||||
|
@ -144,6 +145,7 @@ export default {
|
|||
checkNode.children.forEach((m) => {
|
||||
if (api.m_model.has(m.modelId)) {
|
||||
api.Model.setVisible(m.modelId, true)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
this.addModel(m.modelId)
|
||||
}
|
||||
|
@ -155,6 +157,7 @@ export default {
|
|||
checkNode.children.forEach((m) => {
|
||||
if (api.m_model.has(m.modelId)) {
|
||||
api.Model.setVisible(m.modelId, false)
|
||||
this.$emit('change')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -164,12 +167,14 @@ export default {
|
|||
if (checked) {
|
||||
if (api.m_model.has(checkNode.modelId)) {
|
||||
api.Model.setVisible(checkNode.modelId, true)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
this.addModel(checkNode.modelId)
|
||||
}
|
||||
} else {
|
||||
if (api.m_model.has(checkNode.modelId)) {
|
||||
api.Model.setVisible(checkNode.modelId, false)
|
||||
this.$emit('change')
|
||||
}
|
||||
}
|
||||
return
|
||||
|
@ -187,6 +192,7 @@ export default {
|
|||
const checkNode = e.node.dataRef
|
||||
const checked = e.checked
|
||||
api.Model.setVisible(checkNode.modelId, true)
|
||||
this.$emit('change')
|
||||
let externalId = checkNode.externalId
|
||||
if (externalId != 0) {
|
||||
if (checked) {
|
||||
|
@ -204,6 +210,7 @@ export default {
|
|||
if (checked) {
|
||||
this.visibleList = this.MergeArray(nodes, this.visibleList)
|
||||
api.Model.setVisible(checkNode.modelId, true)
|
||||
this.$emit('change')
|
||||
api.Feature.setVisible(this.visibleList.join('#'), true, checkNode.modelId, false)
|
||||
} else {
|
||||
this.visibleList = this.DelArray(this.visibleList, nodes)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<template>
|
||||
<div>1111</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -1,7 +1,34 @@
|
|||
<template>
|
||||
<div class="bim-setting-page">
|
||||
<div id="bimSettingContainer"></div>
|
||||
<model-floor-tree ref="modelFloorTree" :projectMessage="models" v-if="showTree"></model-floor-tree>
|
||||
<model-floor-tree ref="modelFloorTree" @change="doChange" :projectMessage="models" v-if="showTree"></model-floor-tree>
|
||||
<div class="footer-box" v-if="showModels.length>0">
|
||||
<a-tooltip placement="top" title="主视图">
|
||||
<div class="footer-btn" @click="doMenu(0)" :class="activeMenu == 0 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="home" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="top" title="第一人称漫游">
|
||||
<div class="footer-btn" @click="doMenu(1)" :class="activeMenu == 1 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="roam" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="top" title="自定义视点漫游">
|
||||
<div class="footer-btn" @click="doMenu(2)" :class="activeMenu == 2 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="view" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="top" title="视点管理">
|
||||
<div class="footer-btn" @click="doMenu(3)" :class="activeMenu == 3 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="camera" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="top" title="构件隐藏">
|
||||
<div class="footer-btn" @click="doMenu(4)" :class="activeMenu == 4 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="hide" />
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -9,9 +36,12 @@
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import { listBimModel } from '@/api/bim/bimModel'
|
||||
import ModelFloorTree from './ModelFloorTree.vue'
|
||||
import PersonRoaming from './PersonRoaming.vue'
|
||||
import { h } from 'vue'
|
||||
export default {
|
||||
components: {
|
||||
ModelFloorTree,
|
||||
PersonRoaming,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -22,8 +52,11 @@ export default {
|
|||
currentComId: null,
|
||||
subDepts: [],
|
||||
models: [],
|
||||
isMobile: false,
|
||||
showTree: false,
|
||||
initSuccess: false,
|
||||
activeMenu: 0,
|
||||
showModels: [],
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
@ -39,6 +72,47 @@ export default {
|
|||
this.initEngine()
|
||||
},
|
||||
methods: {
|
||||
doChange() {
|
||||
this.showModels = api.m_model.keys().toArray()
|
||||
console.log('--change--')
|
||||
},
|
||||
doMenu(n) {
|
||||
if (n == this.activeMenu) {
|
||||
return
|
||||
}
|
||||
this.activeMenu = n
|
||||
if (n == 0) {
|
||||
api.Model.location(api.m_model.keys().toArray()[0])
|
||||
}
|
||||
if (n == 1) {
|
||||
this.NotificationPopup({
|
||||
title: '第一人称漫游',
|
||||
id: 'PersonRoaming',
|
||||
description: h('PersonRoaming'),
|
||||
})
|
||||
}
|
||||
},
|
||||
NotificationPopup(parameter) {
|
||||
const that = this
|
||||
that.$notification.open({
|
||||
key: 'EngineKey',
|
||||
message: parameter.title,
|
||||
description: parameter.description,
|
||||
class: 'engine-notification ' + (parameter.tips ? parameter.tips : ''),
|
||||
duration: null,
|
||||
placement: parameter.placement ? parameter.placement : that.isMobile ? 'bottomLeft' : 'topRight',
|
||||
style: {
|
||||
top: parameter.top ? parameter.top : '50px',
|
||||
width: parameter.width ? parameter.width : '280px',
|
||||
marginRight: `20px`,
|
||||
borderRadius: '0px',
|
||||
},
|
||||
onClose: this.notifClose,
|
||||
})
|
||||
},
|
||||
notifClose() {
|
||||
this.activeMenu = -1
|
||||
},
|
||||
initEngine() {
|
||||
window.api = new SAPI(
|
||||
{
|
||||
|
@ -56,6 +130,35 @@ export default {
|
|||
() => {
|
||||
this.initSuccess = true
|
||||
console.log('初始化成功')
|
||||
let mapOptions = {
|
||||
imgs: {
|
||||
// 六面图片
|
||||
top: './img/top.png',
|
||||
bottom: './img/under.png',
|
||||
east: './img/east.png',
|
||||
south: './img/south.png',
|
||||
west: './img/west.png',
|
||||
north: './img/north.png',
|
||||
},
|
||||
offset: {
|
||||
// 屏幕坐标偏移
|
||||
corner: GLENavigationCube.RightTop,
|
||||
x: 25,
|
||||
y: 20,
|
||||
},
|
||||
cube: {
|
||||
hoverColor: '#7193dc', // 立方导航快鼠标移过显示颜色
|
||||
size: 75, // 导航立方尺寸
|
||||
hotPointSize: 7, // 导航立方棱角热点区域尺寸
|
||||
cubeTextColor: '#4c4c4ccc', // cube 各个面文字颜色
|
||||
cubeStrokeColor: '#374769cc', // cube 各个面边框颜色
|
||||
cubeFillColor: '#374769cc', // cube 各个面填充颜色
|
||||
},
|
||||
zoomRatios: 1, // 缩放倍率
|
||||
show: true, // 是否显示
|
||||
showAxes: true, // 是否显示XYZ轴线
|
||||
}
|
||||
api.Plugin.initNavCube(mapOptions)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
@ -85,6 +188,35 @@ export default {
|
|||
#bimSettingContainer {
|
||||
height: 100%;
|
||||
}
|
||||
.footer-box {
|
||||
position: absolute;
|
||||
bottom: 10vh;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
background: #274754;
|
||||
border-radius: 4px;
|
||||
.footer-btn {
|
||||
display: inline-flex;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: #fff;
|
||||
}
|
||||
&:hover {
|
||||
background: #408edb97;
|
||||
}
|
||||
&.is-active {
|
||||
svg {
|
||||
fill: rgb(0, 255, 174);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
body.is-sapi {
|
||||
.app-main {
|
||||
|
|
|
@ -1,382 +1,388 @@
|
|||
<template>
|
||||
<div class="app-container green-carbon-data">
|
||||
<template v-if="data.currentPrjId">
|
||||
<el-tabs v-model="data.selTab" type="card" class="main-tab" @click="doTabClick">
|
||||
<el-tab-pane v-for="(it, idx) in data.types" :key="idx" :name="it.value"
|
||||
:label="it.text + '(' + it.count + ')'"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="app-container green-carbon-data">
|
||||
<template v-if="data.currentPrjId">
|
||||
<el-tabs v-model="data.selTab" type="card" class="main-tab" @click="doTabClick">
|
||||
<el-tab-pane v-for="(it, idx) in data.types" :key="idx" :name="it.value" :label="it.text + '(' + it.count + ')'"></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['manage:greenCarbonData:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['manage:greenCarbonData:add']">新增</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="greenCarbonDataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="日期" align="center" prop="dataDate">
|
||||
<template #default="scope">{{ parseTime(scope.row.dataDate, '{y}-{m}-{d}') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料名称" align="center">
|
||||
<template #default="scope">{{ scope.row.greenCarbonItem?.carbonName || '' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="碳排放因子" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.greenCarbonItem?.carbonFactor || '' }} kg
|
||||
CO2/{{ scope.row.greenCarbonItem?.unit || '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预估使用数量" align="center" prop="estimateValue">
|
||||
<template #default="scope">{{(scope.row.estimateValue||0).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预估排放量(KG)" align="center">
|
||||
<template #default="scope">{{ ((scope.row.greenCarbonItem?.carbonFactor || 0) * scope.row.estimateValue).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际使用量" align="center" prop="practicalValue">
|
||||
<template #default="scope">{{(scope.row.practicalValue||0).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际排放量(KG)" align="center">
|
||||
<template #default="scope">{{ ((scope.row.greenCarbonItem?.carbonFactor || 0) * scope.row.practicalValue).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:greenCarbonData:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="greenCarbonDataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="日期" align="center" prop="dataDate">
|
||||
<template #default="scope">{{ parseTime(scope.row.dataDate, '{y}-{m}-{d}') }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料名称" align="center">
|
||||
<template #default="scope">{{ scope.row.greenCarbonItem?.carbonName || '' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="碳排放因子" align="center">
|
||||
<template #default="scope">{{ scope.row.greenCarbonItem?.carbonFactor || '' }} kg
|
||||
CO2/{{ scope.row.greenCarbonItem?.unit || '' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预估使用数量" align="center" prop="estimateValue" />
|
||||
<el-table-column label="预估排放量(KG)" align="center">
|
||||
<template #default="scope">{{ (scope.row.greenCarbonItem?.carbonFactor || 0) * scope.row.estimateValue }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际使用量" align="center" prop="practicalValue" />
|
||||
<el-table-column label="实际排放量(KG)" align="center">
|
||||
<template
|
||||
#default="scope">{{ (scope.row.greenCarbonItem?.carbonFactor || 0) * scope.row.practicalValue }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:greenCarbonData:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:greenCarbonData:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</template>
|
||||
<div v-else style="margin-top:50px;text-align: center;color: #999;">
|
||||
<el-icon color="#999">
|
||||
<WarningFilled />
|
||||
</el-icon> 请选择项目!
|
||||
</div>
|
||||
<!-- 添加或修改建碳管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="greenCarbonDataRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="时间" prop="dataDate">
|
||||
<el-date-picker clearable v-model="form.dataDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="itemId">
|
||||
<template v-slot:label>
|
||||
<span v-if="data.selTab == 1">材料名称</span>
|
||||
<span v-if="data.selTab == 2">耗能名称</span>
|
||||
<span v-if="data.selTab == 3">油料名称</span>
|
||||
</template>
|
||||
<el-select v-model="form.itemId" clearable placeholder="请选择名称" @change="doItemChange">
|
||||
<el-option v-for="it in data.itemList" :key="it.id" :label="it.carbonName" :value="it.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="碳排放因子">
|
||||
<el-input v-model="form.itemData" readonly />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预估使用量" prop="estimateValue">
|
||||
<el-input v-model="form.estimateValue" placeholder="请输入预估使用量" @change="calcDataValue">
|
||||
<template #append v-if="data.selItem">{{ data.selItem.unit }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预估排放量">
|
||||
<el-input v-model="form.estimateValueData" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际使用量" prop="practicalValue">
|
||||
<el-input v-model="form.practicalValue" placeholder="请输入实际使用量" @change="calcDataValue">
|
||||
<template #append v-if="data.selItem">{{ data.selItem.unit }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际排放量">
|
||||
<el-input v-model="form.practicalValueData" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</template>
|
||||
<div v-else style="margin-top:50px;text-align: center;color: #999;">
|
||||
<el-icon color="#999">
|
||||
<WarningFilled />
|
||||
</el-icon>请选择项目!
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<!-- 添加或修改建碳管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="greenCarbonDataRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="时间" prop="dataDate">
|
||||
<el-date-picker clearable v-model="form.dataDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="itemId">
|
||||
<template v-slot:label>
|
||||
<span v-if="data.selTab == 1">材料名称</span>
|
||||
<span v-if="data.selTab == 2">耗能名称</span>
|
||||
<span v-if="data.selTab == 3">油料名称</span>
|
||||
</template>
|
||||
<el-select v-model="form.itemId" clearable placeholder="请选择名称" @change="doItemChange">
|
||||
<el-option v-for="it in data.itemList" :key="it.id" :label="it.carbonName" :value="it.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="碳排放因子">
|
||||
<el-input v-model="form.itemData" readonly />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预估使用量" prop="estimateValue">
|
||||
<el-input v-model="form.estimateValue" placeholder="请输入预估使用量" @change="calcDataValue">
|
||||
<template #append v-if="data.selItem">{{ data.selItem.unit }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预估排放量">
|
||||
<el-input v-model="form.estimateValueData" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际使用量" prop="practicalValue">
|
||||
<el-input v-model="form.practicalValue" placeholder="请输入实际使用量" @change="calcDataValue">
|
||||
<template #append v-if="data.selItem">{{ data.selItem.unit }}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际排放量">
|
||||
<el-input v-model="form.practicalValueData" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="GreenCarbonData">
|
||||
import { listGreenCarbonData, groupByFactorType, getGreenCarbonData, delGreenCarbonData, addGreenCarbonData, updateGreenCarbonData } from "@/api/manage/greenCarbonData";
|
||||
import { listGreenCarbonItem } from "@/api/manage/greenCarbonItem";
|
||||
import greenCarbonData, { getGreenCarbon } from "../greenCarbonItem/greenCarbonData";
|
||||
import {
|
||||
listGreenCarbonData,
|
||||
groupByFactorType,
|
||||
getGreenCarbonData,
|
||||
delGreenCarbonData,
|
||||
addGreenCarbonData,
|
||||
updateGreenCarbonData,
|
||||
} from '@/api/manage/greenCarbonData'
|
||||
import { listGreenCarbonItem } from '@/api/manage/greenCarbonItem'
|
||||
import greenCarbonData, { getGreenCarbon } from '../greenCarbonItem/greenCarbonData'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { onMounted } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
import { onMounted } from 'vue'
|
||||
import { toFixed } from 'ant-design-vue/es/input-number/src/utils/MiniDecimal'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const greenCarbonDataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const greenCarbonDataList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
factorType: 1,
|
||||
itemId: null,
|
||||
estimateValue: null,
|
||||
practicalValue: null,
|
||||
state: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
dataDate: [
|
||||
{ required: true, message: '请选择日期', trigger: 'change' },
|
||||
],
|
||||
itemId: [
|
||||
{ required: true, message: '请选择名称', trigger: 'blur' },
|
||||
],
|
||||
estimateValue: [
|
||||
{ required: true, message: '请输入预估使用量', trigger: 'blur' },
|
||||
],
|
||||
practicalValue: [
|
||||
{ required: true, message: '请输入实际使用量', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
currentPrjId: '',
|
||||
types: greenCarbonData.types.map(it => {
|
||||
it.count = 0;
|
||||
return it;
|
||||
}),
|
||||
selTab: 1,
|
||||
itemList: [],
|
||||
selItem: null,
|
||||
delDatas: [],
|
||||
});
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
factorType: 1,
|
||||
itemId: null,
|
||||
estimateValue: null,
|
||||
practicalValue: null,
|
||||
state: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
dataDate: [{ required: true, message: '请选择日期', trigger: 'change' }],
|
||||
itemId: [{ required: true, message: '请选择名称', trigger: 'blur' }],
|
||||
estimateValue: [{ required: true, message: '请输入预估使用量', trigger: 'blur' }],
|
||||
practicalValue: [{ required: true, message: '请输入实际使用量', trigger: 'blur' }],
|
||||
},
|
||||
currentPrjId: '',
|
||||
types: greenCarbonData.types.map((it) => {
|
||||
it.count = 0
|
||||
return it
|
||||
}),
|
||||
selTab: 1,
|
||||
itemList: [],
|
||||
selItem: null,
|
||||
delDatas: [],
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
function doTabClick() {
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.factorType = data.selTab;
|
||||
getList();
|
||||
queryParams.value.pageNum = 1
|
||||
queryParams.value.factorType = data.selTab
|
||||
getList()
|
||||
}
|
||||
/** 查询建碳管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listGreenCarbonData(queryParams.value).then(response => {
|
||||
greenCarbonDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
loading.value = true
|
||||
listGreenCarbonData(queryParams.value).then((response) => {
|
||||
greenCarbonDataList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function getCounts() {
|
||||
groupByFactorType(queryParams.value).then(d => {
|
||||
let datas = d.data || [];
|
||||
data.types.forEach(it => {
|
||||
let objs = datas.filter(item => item.factorType == it.value);
|
||||
it.count = objs.length > 0 ? objs[0].id : 0;
|
||||
});
|
||||
})
|
||||
groupByFactorType(queryParams.value).then((d) => {
|
||||
let datas = d.data || []
|
||||
data.types.forEach((it) => {
|
||||
let objs = datas.filter((item) => item.factorType == it.value)
|
||||
it.count = objs.length > 0 ? objs[0].id : 0
|
||||
})
|
||||
})
|
||||
}
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
itemId: null,
|
||||
estimateValue: null,
|
||||
practicalValue: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
proxy.resetForm("greenCarbonDataRef");
|
||||
form.value = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
itemId: null,
|
||||
estimateValue: null,
|
||||
practicalValue: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
}
|
||||
proxy.resetForm('greenCarbonDataRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
data.delDatas = selection.map(item => proxy.parseTime(item.dataDate, '{y}-{m}-{d}') + ' - ' + item.greenCarbonItem?.carbonName || '')
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
ids.value = selection.map((item) => item.id)
|
||||
data.delDatas = selection.map((item) => proxy.parseTime(item.dataDate, '{y}-{m}-{d}') + ' - ' + item.greenCarbonItem?.carbonName || '')
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
function doItemChange() {
|
||||
let tmps = data.itemList.filter(d => d.id == form.value.itemId);
|
||||
data.selItem = tmps.length > 0 ? tmps[0] : null;
|
||||
form.value.itemData = tmps.length > 0 ? tmps[0].carbonFactor + ' kg CO2/' + tmps[0].unit : '';
|
||||
calcDataValue();
|
||||
let tmps = data.itemList.filter((d) => d.id == form.value.itemId)
|
||||
data.selItem = tmps.length > 0 ? tmps[0] : null
|
||||
form.value.itemData = tmps.length > 0 ? tmps[0].carbonFactor + ' kg CO2/' + tmps[0].unit : ''
|
||||
calcDataValue()
|
||||
}
|
||||
|
||||
function calcDataValue() {
|
||||
form.value.estimateValueData = "";
|
||||
form.value.practicalValueData = "";
|
||||
if (data.selItem) {
|
||||
if (form.value.estimateValue) {
|
||||
let v1 = form.value.estimateValue * data.selItem.carbonFactor;
|
||||
if (!isNaN(v1)) {
|
||||
form.value.estimateValueData = v1 + ' kg';
|
||||
}
|
||||
}
|
||||
form.value.estimateValueData = ''
|
||||
form.value.practicalValueData = ''
|
||||
if (data.selItem) {
|
||||
if (form.value.estimateValue) {
|
||||
let v1 = form.value.estimateValue * data.selItem.carbonFactor
|
||||
if (!isNaN(v1)) {
|
||||
form.value.estimateValueData = v1.toFixed(2) + ' kg'
|
||||
}
|
||||
}
|
||||
|
||||
if (form.value.practicalValue) {
|
||||
let v1 = form.value.practicalValue * data.selItem.carbonFactor;
|
||||
if (!isNaN(v1)) {
|
||||
form.value.practicalValueData = v1 + ' kg';
|
||||
}
|
||||
if (form.value.practicalValue) {
|
||||
let v1 = form.value.practicalValue * data.selItem.carbonFactor
|
||||
if (!isNaN(v1)) {
|
||||
form.value.practicalValueData = v1.toFixed(2) + ' kg'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (!userStore.currentPrjId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
listGreenCarbonItem({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
projectId: userStore.currentPrjId,
|
||||
comId: userStore.currentComId,
|
||||
carbonFactorType: data.selTab
|
||||
}).then(d => {
|
||||
data.itemList = d.rows || [];
|
||||
});
|
||||
form.value.projectId = userStore.currentPrjId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
open.value = true;
|
||||
title.value = "建碳管理 - " + getGreenCarbon(data.selTab).text + ' - 新增';
|
||||
if (!userStore.currentPrjId) {
|
||||
proxy.$modal.msgWarning('请切换到项目数据!!!')
|
||||
return false
|
||||
}
|
||||
reset()
|
||||
listGreenCarbonItem({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
projectId: userStore.currentPrjId,
|
||||
comId: userStore.currentComId,
|
||||
carbonFactorType: data.selTab,
|
||||
}).then((d) => {
|
||||
data.itemList = d.rows || []
|
||||
})
|
||||
form.value.projectId = userStore.currentPrjId
|
||||
form.value.projectName = userStore.currentProName
|
||||
open.value = true
|
||||
title.value = '建碳管理 - ' + getGreenCarbon(data.selTab).text + ' - 新增'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
listGreenCarbonItem({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
projectId: userStore.currentPrjId,
|
||||
comId: userStore.currentComId,
|
||||
carbonFactorType: data.selTab
|
||||
}).then(d => {
|
||||
data.itemList = d.rows || [];
|
||||
getGreenCarbonData(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "建碳管理 - " + getGreenCarbon(data.selTab).text + ' - 修改';
|
||||
doItemChange();
|
||||
});
|
||||
});
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
listGreenCarbonItem({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
projectId: userStore.currentPrjId,
|
||||
comId: userStore.currentComId,
|
||||
carbonFactorType: data.selTab,
|
||||
}).then((d) => {
|
||||
data.itemList = d.rows || []
|
||||
getGreenCarbonData(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '建碳管理 - ' + getGreenCarbon(data.selTab).text + ' - 修改'
|
||||
doItemChange()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["greenCarbonDataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.comId = userStore.currentComId;
|
||||
if (form.value.id != null) {
|
||||
updateGreenCarbonData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addGreenCarbonData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
getCounts();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
proxy.$refs['greenCarbonDataRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
form.value.comId = userStore.currentComId
|
||||
if (form.value.id != null) {
|
||||
updateGreenCarbonData(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addGreenCarbonData(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
getCounts()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row && row.id ? proxy.parseTime(row.dataDate, '{y}-{m}-{d}') + ' - ' + row.greenCarbonItem?.carbonName || '' : data.delDatas.join(",");
|
||||
proxy.$modal.confirm('是否确认删除建碳管理编号为【' + _ids + '】的数据项?').then(function () {
|
||||
return delGreenCarbonData(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
const _ids =
|
||||
row && row.id
|
||||
? proxy.parseTime(row.dataDate, '{y}-{m}-{d}') + ' - ' + row.greenCarbonItem?.carbonName || ''
|
||||
: data.delDatas.join(',')
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除建碳管理编号为【' + _ids + '】的数据项?')
|
||||
.then(function () {
|
||||
return delGreenCarbonData(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/greenCarbonData/export', {
|
||||
...queryParams.value
|
||||
}, `greenCarbonData_${new Date().getTime()}.xlsx`)
|
||||
proxy.download(
|
||||
'manage/greenCarbonData/export',
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`greenCarbonData_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
queryParams.value.comId = userStore.currentComId;
|
||||
data.currentPrjId = userStore.currentPrjId;
|
||||
getList();
|
||||
getCounts();
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
queryParams.value.comId = userStore.currentComId
|
||||
data.currentPrjId = userStore.currentPrjId
|
||||
getList()
|
||||
getCounts()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.green-carbon-data {
|
||||
.main-tab {
|
||||
.el-tabs__item {
|
||||
&.is-active {
|
||||
background-color: rgb(64, 158, 255);
|
||||
color: #fff;
|
||||
}
|
||||
.main-tab {
|
||||
.el-tabs__item {
|
||||
&.is-active {
|
||||
background-color: rgb(64, 158, 255);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -6,10 +6,10 @@ import createSvgIcon from "./svg-icon";
|
|||
import createCompression from "./compression";
|
||||
import createSetupExtend from "./setup-extend";
|
||||
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
import VueJsx from "@vitejs/plugin-vue-jsx";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
export default function createVitePlugins(viteEnv, isBuild = false) {
|
||||
const vitePlugins = [vue()];
|
||||
const vitePlugins = [VueJsx(), vue()];
|
||||
vitePlugins.push(createAutoImport());
|
||||
vitePlugins.push(createSetupExtend());
|
||||
vitePlugins.push(createSvgIcon(isBuild));
|
||||
|
|