From d773f9777df29f5e17e45148326cbd784c328dac Mon Sep 17 00:00:00 2001
From: 幻雨堂 <13281837894@163.com>
Date: 星期五, 01 三月 2024 09:16:27 +0800
Subject: [PATCH] 交通指数

---
 src/views/ti/trafficIndex/index.vue |  307 +++++++++++++++++++++++++++-----------------------
 1 files changed, 167 insertions(+), 140 deletions(-)

diff --git a/src/views/ti/trafficIndex/index.vue b/src/views/ti/trafficIndex/index.vue
index 8ffc918..b58e411 100644
--- a/src/views/ti/trafficIndex/index.vue
+++ b/src/views/ti/trafficIndex/index.vue
@@ -1,143 +1,149 @@
 <template>
   <div class="p-2">
-    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
-      <div class="search" v-show="showSearch">
-        <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
-          <el-form-item label="妯″潡鍚嶇О" prop="modeName">
-            <el-input v-model="queryParams.modeName" placeholder="璇疯緭鍏ユā鍧楀悕绉�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣1鍚嶇О" prop="targetOneName">
-            <el-input v-model="queryParams.targetOneName" placeholder="璇疯緭鍏ユ寚鏍�1鍚嶇О" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣1鍊�" prop="targetOneValue">
-            <el-input v-model="queryParams.targetOneValue" placeholder="璇疯緭鍏ユ寚鏍�1鍊�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣1鍗曚綅" prop="targetOneUnit">
-            <el-input v-model="queryParams.targetOneUnit" placeholder="璇疯緭鍏ユ寚鏍�1鍗曚綅" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣1涓婃诞鎴栦笅闄嶅��" prop="targetOneCompareValue">
-            <el-input v-model="queryParams.targetOneCompareValue" placeholder="璇疯緭鍏ユ寚鏍�1涓婃诞鎴栦笅闄嶅��" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣2鍚嶇О" prop="targetTwoName">
-            <el-input v-model="queryParams.targetTwoName" placeholder="璇疯緭鍏ユ寚鏍�2鍚嶇О" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣2鍊�" prop="targetTwoValue">
-            <el-input v-model="queryParams.targetTwoValue" placeholder="璇疯緭鍏ユ寚鏍�2鍊�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣2鍗曚綅" prop="targetTwoUnit">
-            <el-input v-model="queryParams.targetTwoUnit" placeholder="璇疯緭鍏ユ寚鏍�2鍗曚綅" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣2涓婃诞鎴栦笅闄嶅��" prop="targetTwoCompareValue">
-            <el-input v-model="queryParams.targetTwoCompareValue" placeholder="璇疯緭鍏ユ寚鏍�2涓婃诞鎴栦笅闄嶅��" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣3鍚嶇О" prop="targetThreeName">
-            <el-input v-model="queryParams.targetThreeName" placeholder="璇疯緭鍏ユ寚鏍�3鍚嶇О" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣3鍊�" prop="targetThreeValue">
-            <el-input v-model="queryParams.targetThreeValue" placeholder="璇疯緭鍏ユ寚鏍�3鍊�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣3鍗曚綅" prop="targetThreeUnit">
-            <el-input v-model="queryParams.targetThreeUnit" placeholder="璇疯緭鍏ユ寚鏍�3鍗曚綅" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣3涓婃诞鎴栦笅闄嶅��" prop="targetThreeCompareValue">
-            <el-input v-model="queryParams.targetThreeCompareValue" placeholder="璇疯緭鍏ユ寚鏍�3涓婃诞鎴栦笅闄嶅��" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣4鍚嶇О" prop="targetFourName">
-            <el-input v-model="queryParams.targetFourName" placeholder="璇疯緭鍏ユ寚鏍�4鍚嶇О" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣4鍊�" prop="targetFourValue">
-            <el-input v-model="queryParams.targetFourValue" placeholder="璇疯緭鍏ユ寚鏍�4鍊�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣4鍗曚綅" prop="targetFourUnit">
-            <el-input v-model="queryParams.targetFourUnit" placeholder="璇疯緭鍏ユ寚鏍�4鍗曚綅" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鎸囨爣4涓婃诞鎴栦笅闄嶅��" prop="targetFourCompareValue">
-            <el-input v-model="queryParams.targetFourCompareValue" placeholder="璇疯緭鍏ユ寚鏍�4涓婃诞鎴栦笅闄嶅��" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鍛ㄦ湡 1 鏈�  2骞�" prop="periodName">
-            <el-input v-model="queryParams.periodName" placeholder="璇疯緭鍏ュ懆鏈� 1 鏈�  2骞�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="鍛ㄦ湡鍊�" prop="periodValue">
-            <el-input v-model="queryParams.periodValue" placeholder="璇疯緭鍏ュ懆鏈熷��" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item label="0鏈垹闄�   1宸插垹闄�" prop="del">
-            <el-input v-model="queryParams.del" placeholder="璇疯緭鍏�0鏈垹闄�   1宸插垹闄�" clearable style="width: 240px" @keyup.enter="handleQuery" />
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
-            <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-    </transition>
+    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+      <el-tab-pane label="浜ら�氭寚鏁�" name="first"></el-tab-pane>
+      <el-tab-pane label="閰嶇疆" name="second"></el-tab-pane>
+    </el-tabs>
+    <div v-show="activeName=='first'">
+        <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+          <el-form ref="form" :model="form" label-width="80px">
+            缁熻鍛ㄦ湡
+            <el-select v-model="form.year" placeholder="璇烽�夋嫨骞翠唤">
+              <el-option label="2024骞�" value="2024" />
+              <el-option label="2023骞�" value="2023" />
+              <el-option label="2022骞�" value="2022" />
+            </el-select>
+            <el-select v-model="form.month" placeholder="璇烽�夋嫨鏈堜唤">
+              <el-option label="12鏈�" value="12" />
+              <el-option label="11鏈�" value="11" />
+              <el-option label="10鏈�" value="10" />
+            </el-select>
+            鐘舵��
+            <el-select v-model="form.status" placeholder="璇烽�夋嫨鐘舵��">
+              <el-option label="鍏ㄩ儴" value="0" />
+              <el-option label="宸插惎鐢�" value="1" />
+              <el-option label="宸茬鐢�" value="2" />
+            </el-select>
+                &nbsp;&nbsp;&nbsp;
+                <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
+                <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+            
+          </el-form>
+        </transition>
 
-    <el-card shadow="never">
-      <template #header>
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['rs:trafficIndex:add']">鏂板</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['rs:trafficIndex:edit']">淇敼</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['rs:trafficIndex:remove']">鍒犻櫎</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['rs:trafficIndex:export']">瀵煎嚭</el-button>
-          </el-col>
-          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-        </el-row>
-      </template>
-
-      <el-table v-loading="loading" :data="trafficIndexList" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="涓婚敭id" align="center" prop="id" v-if="true" />
-        <el-table-column label="妯″潡鍚嶇О" align="center" prop="modeName" />
-        <el-table-column label="鎸囨爣1鍚嶇О" align="center" prop="targetOneName" />
-        <el-table-column label="鎸囨爣1鍊�" align="center" prop="targetOneValue" />
-        <el-table-column label="鎸囨爣1鍗曚綅" align="center" prop="targetOneUnit" />
-        <el-table-column label="鎸囨爣1鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetOneStatus" />
-        <el-table-column label="鎸囨爣1涓婃诞鎴栦笅闄嶅��" align="center" prop="targetOneCompareValue" />
-        <el-table-column label="鎸囨爣2鍚嶇О" align="center" prop="targetTwoName" />
-        <el-table-column label="鎸囨爣2鍊�" align="center" prop="targetTwoValue" />
-        <el-table-column label="鎸囨爣2鍗曚綅" align="center" prop="targetTwoUnit" />
-        <el-table-column label="鎸囨爣2鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetTwoStatus" />
-        <el-table-column label="鎸囨爣2涓婃诞鎴栦笅闄嶅��" align="center" prop="targetTwoCompareValue" />
-        <el-table-column label="鎸囨爣3鍚嶇О" align="center" prop="targetThreeName" />
-        <el-table-column label="鎸囨爣3鍊�" align="center" prop="targetThreeValue" />
-        <el-table-column label="鎸囨爣3鍗曚綅" align="center" prop="targetThreeUnit" />
-        <el-table-column label="鎸囨爣3鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetThreeStatus" />
-        <el-table-column label="鎸囨爣3涓婃诞鎴栦笅闄嶅��" align="center" prop="targetThreeCompareValue" />
-        <el-table-column label="鎸囨爣4鍚嶇О" align="center" prop="targetFourName" />
-        <el-table-column label="鎸囨爣4鍊�" align="center" prop="targetFourValue" />
-        <el-table-column label="鎸囨爣4鍗曚綅" align="center" prop="targetFourUnit" />
-        <el-table-column label="鎸囨爣4鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetFourStatus" />
-        <el-table-column label="鎸囨爣4涓婃诞鎴栦笅闄嶅��" align="center" prop="targetFourCompareValue" />
-        <el-table-column label="鍚敤鐘舵�� 1鍚敤 2鏈惎鐢�" align="center" prop="status" />
-        <el-table-column label="鍛ㄦ湡 1 鏈�  2骞�" align="center" prop="periodName" />
-        <el-table-column label="鍛ㄦ湡鍊�" align="center" prop="periodValue" />
-        <el-table-column label="0鏈垹闄�   1宸插垹闄�" align="center" prop="del" />
-        <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
-          <template #default="scope">
-            <el-tooltip content="淇敼" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['rs:trafficIndex:edit']"></el-button>
-            </el-tooltip>
-            <el-tooltip content="鍒犻櫎" placement="top">
-              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['rs:trafficIndex:remove']"></el-button>
-            </el-tooltip>
+        <el-card shadow="never">
+          <template #header>
+            <el-row :gutter="10" class="mb8">
+              <el-col :span="1.5">
+                <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['rs:trafficIndex:add']">鏂板</el-button>
+              </el-col>
+              <el-col :span="1.5">
+                <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['rs:trafficIndex:edit']">淇敼</el-button>
+              </el-col>
+              <el-col :span="1.5">
+                <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['rs:trafficIndex:remove']">鍒犻櫎</el-button>
+              </el-col>
+              <el-col :span="1.5">
+                <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['rs:trafficIndex:export']">瀵煎嚭</el-button>
+              </el-col>
+              <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+            </el-row>
           </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"
-      />
-    </el-card>
+          <el-table v-loading="loading" :data="trafficIndexList" @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55" align="center" />
+            <el-table-column label="搴忓彿" type="index" width="50"/>
+            <el-table-column label="妯″潡鍚嶇О" align="center" prop="modeName" />
+            <el-table-column label="鎸囨爣1鍚嶇О" align="center" prop="targetOneName" />
+            <el-table-column label="鎸囨爣1鍊�" align="center" prop="targetOneValue" />
+            <el-table-column label="鎸囨爣1鍗曚綅" align="center" prop="targetOneUnit" />
+            <el-table-column label="鎸囨爣1鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetOneStatus" />
+            <el-table-column label="鎸囨爣1涓婃诞鎴栦笅闄嶅��" align="center" prop="targetOneCompareValue" />
+            <el-table-column label="鎸囨爣2鍚嶇О" align="center" prop="targetTwoName" />
+            <el-table-column label="鎸囨爣2鍊�" align="center" prop="targetTwoValue" />
+            <el-table-column label="鎸囨爣2鍗曚綅" align="center" prop="targetTwoUnit" />
+            <el-table-column label="鎸囨爣2鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetTwoStatus" />
+            <el-table-column label="鎸囨爣2涓婃诞鎴栦笅闄嶅��" align="center" prop="targetTwoCompareValue" />
+            <el-table-column label="鎸囨爣3鍚嶇О" align="center" prop="targetThreeName" />
+            <el-table-column label="鎸囨爣3鍊�" align="center" prop="targetThreeValue" />
+            <el-table-column label="鎸囨爣3鍗曚綅" align="center" prop="targetThreeUnit" />
+            <el-table-column label="鎸囨爣3鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetThreeStatus" />
+            <el-table-column label="鎸囨爣3涓婃诞鎴栦笅闄嶅��" align="center" prop="targetThreeCompareValue" />
+            <el-table-column label="鎸囨爣4鍚嶇О" align="center" prop="targetFourName" />
+            <el-table-column label="鎸囨爣4鍊�" align="center" prop="targetFourValue" />
+            <el-table-column label="鎸囨爣4鍗曚綅" align="center" prop="targetFourUnit" />
+            <el-table-column label="鎸囨爣4鐘舵�� 1 涓婃诞 2涓嬮檷" align="center" prop="targetFourStatus" />
+            <el-table-column label="鎸囨爣4涓婃诞鎴栦笅闄嶅��" align="center" prop="targetFourCompareValue" />
+            <el-table-column label="鍚敤鐘舵�� 1鍚敤 2鏈惎鐢�" align="center" prop="status" />
+            <el-table-column label="鍛ㄦ湡 1 鏈�  2骞�" align="center" prop="periodName" />
+            <el-table-column label="鍛ㄦ湡鍊�" align="center" prop="periodValue" />
+            <el-table-column label="0鏈垹闄�   1宸插垹闄�" align="center" prop="del" />
+            <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+              <template #default="scope">
+                <el-tooltip content="淇敼" placement="top">
+                  <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['rs:trafficIndex:edit']"></el-button>
+                </el-tooltip>
+                <el-tooltip content="鍒犻櫎" placement="top">
+                  <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['rs:trafficIndex:remove']"></el-button>
+                </el-tooltip>
+              </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"
+          />
+        </el-card>
+      </div>
+      <div v-show="activeName=='second'">
+      <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+        <div class="search" v-show="showSearch">
+          <el-upload
+            action="#"
+            list-type="picture-card"
+            :auto-upload="false">
+              <i slot="default" class="el-icon-plus"></i>
+              <div slot="file" slot-scope="{file}">
+                <img
+                  class="el-upload-list__item-thumbnail"
+                  :src="file.url" alt=""
+                >
+                <span class="el-upload-list__item-actions">
+                  <span
+                    class="el-upload-list__item-preview"
+                    @click="handlePictureCardPreview(file)"
+                  >
+                    <i class="el-icon-zoom-in"></i>
+                  </span>
+                  <span
+                    v-if="!disabled"
+                    class="el-upload-list__item-delete"
+                    @click="handleDownload(file)"
+                  >
+                    <i class="el-icon-download"></i>
+                  </span>
+                  <span
+                    v-if="!disabled"
+                    class="el-upload-list__item-delete"
+                    @click="handleRemove(file)"
+                  >
+                    <i class="el-icon-delete"></i>
+                  </span>
+                </span>
+              </div>
+        </el-upload>
+        <el-dialog :visible.sync="dialogVisible">
+          <img width="100%" :src="dialogImageUrl" alt="">
+        </el-dialog>
+        </div>
+      </transition>
+
+      
+    </div>
     <!-- 娣诲姞鎴栦慨鏀逛氦閫氭寚鏁板璇濇 -->
     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
       <el-form ref="trafficIndexFormRef" :model="form" :rules="rules" label-width="80px">
@@ -215,9 +221,9 @@
 <script setup name="TrafficIndex" lang="ts">
 import { listTrafficIndex, getTrafficIndex, delTrafficIndex, addTrafficIndex, updateTrafficIndex } from '@/api/ti/trafficIndex';
 import { TrafficIndexVO, TrafficIndexQuery, TrafficIndexForm } from '@/api/ti/trafficIndex/types';
+import type { TabsPaneContext, UploadProps, UploadUserFile } from "element-plus";
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-
 const trafficIndexList = ref<TrafficIndexVO[]>([]);
 const buttonLoading = ref(false);
 const loading = ref(true);
@@ -226,15 +232,20 @@
 const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
-
+const activeName = ref('first');
 const queryFormRef = ref<ElFormInstance>();
 const trafficIndexFormRef = ref<ElFormInstance>();
-
+const dialogImageUrl =ref('');
+const dialogVisible= ref(false);
+const disabled= ref(false);
 const dialog = reactive<DialogOption>({
   visible: false,
   title: ''
 });
-
+const options = {
+  label: false,
+  value: ''
+};
 const initFormData: TrafficIndexForm = {
   id: undefined,
   modeName: undefined,
@@ -426,7 +437,9 @@
   dialog.visible = true;
   dialog.title = "娣诲姞浜ら�氭寚鏁�";
 }
-
+const handleClick = (tab: TabsPaneContext, event: Event) => {
+  console.log(tab.props.label, activeName)
+}
 /** 淇敼鎸夐挳鎿嶄綔 */
 const handleUpdate = async (row?: TrafficIndexVO) => {
   reset();
@@ -473,4 +486,18 @@
 onMounted(() => {
   getList();
 });
+function handleRemove(file:string) {
+        console.log(file);
+      };
+type files = {    //鑷畾涔夌被鍨�
+    url: string;
+  };
+function  handlePictureCardPreview(file:files) {
+        dialogImageUrl.value = file.url;
+        dialogVisible.value = true;
+      };
+function handleDownload(file:string) {
+        console.log(file);
+      };
+      
 </script>

--
Gitblit v1.8.0