feat : 新增echarts中指定日期展示及细节优化
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<div class="site-name">
|
||||
{{ siteName }}
|
||||
</div>
|
||||
<div class="tunnel-title"></div>
|
||||
<tunnel-title/>
|
||||
<div class="all-del-btn" v-if="showOperation">
|
||||
<div class="all-btn" style=" margin-right: 40px;" v-if="!showAddIcon" @click="handleAdd">
|
||||
添加
|
||||
@@ -45,8 +45,8 @@
|
||||
</div>
|
||||
<div class="tunnel-right">
|
||||
<div>
|
||||
<!-- <div class="fan-icon"></div>-->
|
||||
<!-- <span>风机异常</span>-->
|
||||
<!-- <div class="fan-icon"></div>-->
|
||||
<!-- <span>风机异常</span>-->
|
||||
</div>
|
||||
<div class="icons-block">
|
||||
<div v-for="equItem in iconsList" :key="item.icon" class="icon-text">
|
||||
@@ -79,6 +79,9 @@
|
||||
<el-form-item label="隧道长度" prop="totalLength">
|
||||
<el-input type="number" v-model="form.totalLength" placeholder="请输入隧道长度"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="施工长度" prop="constructionLength">-->
|
||||
<!-- <el-input type="number" v-model="form.constructionLength" placeholder="请输入施工长度"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否默认">
|
||||
<el-radio-group v-model="form.isDefault">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
@@ -112,17 +115,19 @@
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {getTunnelList, addTunnel, deleteTunnel} from "@/api/tunnelManage";
|
||||
import {getSiteDetail} from "@/api/site";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
import {getTunnelBySiteId} from "@/api/largeScreen";
|
||||
|
||||
const validateNumber = (rule, value) => {
|
||||
const reg = /^[A-Za-z0-9]+$/;
|
||||
return reg.test(value);
|
||||
}
|
||||
const router = useRouter()
|
||||
const showAddIcon = ref(true)
|
||||
const params = router.currentRoute.value.params;
|
||||
const siteId = reactive(params.siteId)
|
||||
const userId = reactive(params.userId)
|
||||
const type = reactive(params.type)
|
||||
const validateNumber = (rule, value) => {
|
||||
const reg = /^[A-Za-z0-9]+$/;
|
||||
return reg.test(value);
|
||||
}
|
||||
const formRules = ref({
|
||||
tunnelName: [{required: true, message: '请输入隧道名称', trigger: ['blur', 'change']}],
|
||||
tunnelAlias: [{required: true, message: '请输入隧道简称', trigger: ['blur', 'change']}],
|
||||
@@ -130,7 +135,8 @@ const formRules = ref({
|
||||
{required: true, message: '请输入序列号', trigger: ['blur', 'change']},
|
||||
{validator: validateNumber, message: '请输入英文、数字、英文数字组合的用户名', trigger: ['blur', 'change']}
|
||||
],
|
||||
totalLength: [{required: true, message: '请输入隧道长度', trigger: ['blur', 'change']}]
|
||||
totalLength: [{required: true, message: '请输入隧道长度', trigger: ['blur', 'change']}],
|
||||
constructionLength: [{required: true, message: '请输入施工长度', trigger: ['blur', 'change']}]
|
||||
})
|
||||
const showFirst = ref(true)
|
||||
const showOperation = ref(true)
|
||||
@@ -208,11 +214,12 @@ const total = ref(10);
|
||||
onMounted(() => {
|
||||
showOperation.value = localStorage.getItem('roleKey') !== 'tunnel_admin';
|
||||
})
|
||||
|
||||
const handleGoSiteOrIndex = () => {
|
||||
if (type === 'bySite') {
|
||||
router.push('/site/' + userId)
|
||||
router.push('/site/' + userId + '/' + localStorage.getItem('currentSiteId'))
|
||||
} else if (type === 'byHome') {
|
||||
router.push('/')
|
||||
router.push('/' + 'siteToHome/' + siteId)
|
||||
}
|
||||
}
|
||||
//根据站点id获取隧道信息
|
||||
@@ -233,7 +240,6 @@ const getList = () => {
|
||||
total.value = res.data.total
|
||||
tunnelList.value = res.data.rows
|
||||
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||
|
||||
// siteName.value = res.data.siteName
|
||||
} else {
|
||||
ElMessage.warning(res.msg)
|
||||
@@ -277,7 +283,15 @@ const handleSubmit = (instance) => {
|
||||
const handlePreview = (id) => {
|
||||
console.log('预览')
|
||||
if (id) {
|
||||
router.push('/' + id)
|
||||
getTunnelBySiteId(siteId).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
if (res.data.filter((item) => item.value == id).length === 0) {
|
||||
ElMessage.warning('当前预览的隧道未准备好, 不予展示, 请添加设备后再试!')
|
||||
} else {
|
||||
router.push('/' + id + '/' + siteId)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
const handleGoToEditTunnel = (tunnelId) => {
|
||||
|
||||
Reference in New Issue
Block a user