From 04b8eff075a04db23e6f908855699b4d2954588c Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期四, 23 五月 2024 18:47:01 +0800 Subject: [PATCH] 380新产品,优化 --- jcdm-ui/src/views/main/pr/tightenReport/index.vue | 74 +++++++++++++++++++++++------------- 1 files changed, 47 insertions(+), 27 deletions(-) diff --git a/jcdm-ui/src/views/main/pr/tightenReport/index.vue b/jcdm-ui/src/views/main/pr/tightenReport/index.vue index f1f45df..5a7f8af 100644 --- a/jcdm-ui/src/views/main/pr/tightenReport/index.vue +++ b/jcdm-ui/src/views/main/pr/tightenReport/index.vue @@ -14,14 +14,17 @@ placeholder="璇疯緭鍏ュ伐浣嶅彿" @keyup.enter.native="handleQuery"/> </el-form-item> - <el-form-item label-width="120" label="閲囬泦鏃堕棿" prop="startDate"> - <el-date-picker - v-model="dateRange" - type="daterange" - range-separator="鑷�" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡"> - </el-date-picker> + <el-form-item label-width="130" label="淇濆瓨鏃ユ湡" prop="dateConditions"> + <el-date-picker + v-model="queryParams.dateConditions" + type="datetimerange" + :picker-options="pickerOptions" + value-format="yyyy-MM-dd HH:mm:ss" + range-separator="鑷�" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + align="right"> + </el-date-picker> </el-form-item> <el-form-item style="float: right"> <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">鏌ヨ</el-button> @@ -35,16 +38,16 @@ <el-table-column type="selection" width="55" align="center" /> <el-table-column label="绠变綋缂栫爜" align="center" width="200" prop="sfcCode"></el-table-column> <el-table-column label="宸ヤ綅" align="center" prop="locationCode"></el-table-column> - <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"></el-table-column> <el-table-column label="鍙傛暟鍚嶇О" align="center" prop="paramName"></el-table-column> + <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"></el-table-column> <el-table-column label="鍙傛暟鍊�" align="center" prop="paramValue"></el-table-column> + <el-table-column label="鍗曚綅" align="center" prop="unit"></el-table-column> + <el-table-column label="缁撴灉" align="center" prop="state"></el-table-column> <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectionTime" width="180"> <template slot-scope="scope"> <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> </template> </el-table-column> - <el-table-column label="鐘舵��" align="center" prop="state"></el-table-column> - <el-table-column label="鍗曚綅" align="center" prop="unit"></el-table-column> </el-table> <el-empty v-else> <span slot="description">鏆傛棤鏁版嵁</span> @@ -110,7 +113,37 @@ unit: null, type: '鎷х揣鏁版嵁', startDate: null, - endDate: null + endDate: null, + dateConditions: [], + }, + pickerOptions: { + shortcuts: [{ + text: '鏈�杩戜竴鍛�', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + }, + class: 'custom-shortcut' // 娣诲姞class灞炴�� + }, { + text: '鏈�杩戜竴涓湀', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + }, + class: 'custom-shortcut' // 娣诲姞class灞炴�� + }, { + text: '鏈�杩戜笁涓湀', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + }, + }] }, } }, @@ -118,21 +151,6 @@ this.getList(); }, methods: { - - // async fetchData() { - // // 鏋勫缓API璇锋眰鐨刄RL锛屼娇鐢ㄩ�夋嫨鐨勬棩鏈熻寖鍥翠綔涓烘煡璇㈠弬鏁� - // const url = `@/api/main/da/paramCollection/paramCollection?startDate=${this.dateRange[0]}&endDate=${this.dateRange[1]}`; - // - // try { - // // 鍙戦�丄PI璇锋眰锛岃幏鍙栨煡璇㈢粨鏋� - // const response = await fetch(url); - // const data = await response.json(); - // console.log(data); // 澶勭悊鏌ヨ缁撴灉锛屾瘮濡傚湪鎺у埗鍙拌緭鍑烘垨鏄剧ず鍦ㄩ〉闈笂 - // } catch (error) { - // console.error('Error fetching data:', error); - // } - // }, - // }, reset() { this.form = { @@ -200,4 +218,6 @@ ::v-deep .el-card__body{ padding: 15px 20px 0px 20px; } + +/* 娣诲姞鍏朵粬鏍峰紡灞炴�� */ </style> -- Gitblit v1.9.3