Quellcode durchsuchen

feat: 优化项目管理 中的 项目概况显示

yanglzh vor 1 Jahr
Ursprung
Commit
be13a244f0

+ 1 - 1
src/components/chart/options.ts

@@ -361,7 +361,7 @@ export function getLineOption({
     },
     legend: { left: 'center', top: 0, data: legend },
     grid: { top: 30, bottom: 0, left: 35, right: 30, containLabel: true },
-    color: ['rgb(6, 176, 60)', 'rgb(253, 109, 90)'],
+    // color: ['rgb(6, 176, 60)', 'rgb(253, 109, 90)'],
     xAxis: {
       type: 'category',
       data: xAxis

+ 1 - 1
src/views/iot/dataAnalysis/exponentialTrend/index.vue

@@ -121,7 +121,7 @@ function getData() {
     chart.value.draw(
       getLineOption({
         datas: [res.map(item => item.dataValue)],
-        xAxis: res.map(item => item.date),
+        xAxis: res.map(item => item.dataTime),
         legend: [propertyName.value],
         dataZoom: [{ // 这部分是dataZoom的配置
             type: 'slider', // 这里可以选择你需要的dataZoom类型

+ 8 - 1
src/views/iot/projects/detail/index.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="page">
     <el-card shadow="nover" class="small-padding">
-      <el-tabs :model-value="'1'" size="small" class="h-full">
+      <el-tabs :model-value="'0'" size="small" class="h-full">
+        <el-tab-pane label="项目概况" name="0" lazy>
+          <InfoVue></InfoVue>
+        </el-tab-pane>
+        <el-tab-pane label="网关和设备" name="1" lazy>
+          <DeviceVue :resourcesTypes="1"></DeviceVue>
+        </el-tab-pane>
         <el-tab-pane label="网关和设备" name="1" lazy>
           <DeviceVue :resourcesTypes="1"></DeviceVue>
         </el-tab-pane>
@@ -21,6 +27,7 @@
 
 <script lang="ts" setup>
 import TopoVue from './topo.vue'
+import InfoVue from './info.vue'
 // import VideoVue from './video.vue'
 import DeviceVue from './device.vue'
 import SceneVue from './scene.vue'

+ 23 - 14
src/views/iot/projects/detail/info.vue

@@ -1,30 +1,39 @@
 <template>
   <div class="tab-content" v-loading="laoding">
-    <div class="flex-row" style="gap:20px;align-items: flex-start;">
-      <el-card shadow="nover" class="flex1">
-        <template #header>场景概况</template>
-        <EditVue ref="editRef" style="margin-top: 20px;"></EditVue>
-      </el-card>
-      <el-card shadow="nover" class="flex1">
-        <template #header>设备列表</template>
-      </el-card>
-    </div>
+    <div class="subtitle"><span></span> <el-button type="primary" size="small" @click="edit()">编辑</el-button></div>
+    <el-descriptions class="margin-top" :column="2" border>
+      <el-descriptions-item label="项目名称">{{ data.name }} </el-descriptions-item>
+      <el-descriptions-item label="关键客户">{{ data.customName }} </el-descriptions-item>
+      <el-descriptions-item label="地区">{{ data.address ? JSON.parse(data.address)?.name : '' }} </el-descriptions-item>
+      <el-descriptions-item label="渠道商">{{ data.channelMerchants }} </el-descriptions-item>
+      <el-descriptions-item label="维修公司">{{ data.repairCompany }} </el-descriptions-item>
+      <el-descriptions-item label="维修电话">{{ data.repairMobile }} </el-descriptions-item>
+      <el-descriptions-item label="详细地址">{{ data.addressDetail }} </el-descriptions-item>
+    </el-descriptions>
+    <EditForm ref="editFormRef" @getList="getInfo()"></EditForm>
   </div>
 </template>
 
 <script lang="ts" setup>
 import { useRoute } from 'vue-router';
-import EditVue from '../list/edit.vue'
+import EditForm from '../list/edit-dialog.vue';
 import api from '/@/api/projects';
 import { ref } from 'vue';
 const route = useRoute();
 
 const code = route.params.id as string
 
-const editRef = ref();
 const laoding = ref(false);
+const editFormRef = ref();
+const data = ref<any>({});
+getInfo()
+function getInfo() {
+  api.detail(code).then((res: any) => {
+    data.value = res
+  }).finally(() => laoding.value = false)
+}
 
-api.detail(code).then((res: any) => {
-  editRef.value.open(res)
-}).finally(() => laoding.value = false)
+function edit() {
+  editFormRef.value.open(data.value);
+}
 </script>

+ 0 - 1
src/views/iot/projects/list/index.vue

@@ -76,7 +76,6 @@ import { ElMessageBox, ElMessage } from 'element-plus';
 import getOrigin from '/@/utils/origin'
 import EditForm from './edit-dialog.vue';
 import { ref } from 'vue';
-import { status } from 'nprogress';
 
 const editFormRef = ref();
 const ids = ref<number[]>([]);