Browse Source

更新依赖,优化项目资料收集-项目列表

ZaiZai 1 year ago
parent
commit
8f81fa6f51
5 changed files with 26 additions and 110 deletions
  1. 1 1
      package.json
  2. 0 2
      src/components/index.js
  3. 0 48
      src/components/win-size/win-size.vue
  4. 21 55
      src/views/project/admin/list.vue
  5. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
         "dayjs": "^1.11.10",
         "echarts": "^5.5.0",
         "element-plus": "2.6.2",
-        "hc-vue3-ui": "^3.7.9",
+        "hc-vue3-ui": "^3.8.0",
         "js-base64": "^3.7.7",
         "js-fast-way": "^0.4.7",
         "js-md5": "^0.8.3",

+ 0 - 2
src/components/index.js

@@ -1,5 +1,4 @@
 import { setupDirective } from './directive/index'
-import HcWinSize from './win-size/win-size.vue'
 import HcMenuIcon from './menu-icon/menu-icon.vue'
 import HcIconInput from './icon-input/icon-input.vue'
 import HcDateYear from './date-year/date-year.vue'
@@ -13,7 +12,6 @@ export const setupComponents = (App) => {
     setupDirective(App)
 
     //自定义组件
-    App.component('HcWinSize', HcWinSize)
     App.component('HcMenuIcon', HcMenuIcon)
     App.component('HcIconInput', HcIconInput)
     App.component('HcDateYear', HcDateYear)

+ 0 - 48
src/components/win-size/win-size.vue

@@ -1,48 +0,0 @@
-<template>
-    <div class="is-no" />
-</template>
-
-<script setup>
-import { onMounted, onUnmounted } from 'vue'
-
-//事件
-const emit = defineEmits(['change'])
-
-defineOptions({
-    name: 'HcWinSize',
-})
-
-onMounted(() => {
-    windowResize()
-    setTimeout(() => {
-        onWindowResize()
-    }, 100)
-})
-
-//监听浏览器窗口变化
-const windowResize = () => {
-    window.addEventListener('resize', resizeEvent)
-}
-const resizeEvent = () => {
-    window.requestAnimationFrame(() => {
-        onWindowResize()
-    })
-}
-
-//获取尺寸
-const onWindowResize = () => {
-    const dom = document.documentElement
-    emit('change', { h: dom.offsetHeight, w: dom.offsetWidth })
-}
-
-//被卸载
-onUnmounted(() => {
-    window.removeEventListener('resize', resizeEvent)
-})
-</script>
-
-<style scoped lang="scss">
-.is-no {
-    display: none;
-}
-</style>

+ 21 - 55
src/views/project/admin/list.vue

@@ -1,53 +1,8 @@
 <template>
-    <hc-card class="hc-project-collect-admin-list">
-        <template #header>
-            <div v-if="isWidths >= 1660" class="hc-flex">
-                <hc-date-year v-model="searchForm.startYear" v-model:end="searchForm.endYear" />
-                <div class="relative ml-3 w-[300px]">
-                    <hc-search-input v-model="searchForm.queryValue" text="搜索" color="#151921" @search="searchClick">
-                        <template #prepend>
-                            <el-select v-model="searchForm.year" placeholder="年份" clearable style="width: 80px">
-                                <el-option label="2023" value="2023" />
-                                <el-option label="2024" value="2024" />
-                            </el-select>
-                        </template>
-                    </hc-search-input>
-                </div>
-            </div>
-            <div v-else class="hc-flex">
-                <div class="w-[120px]">
-                    <el-select v-model="searchForm.key1" filterable clearable block placeholder="项目阶段" @change="searchClick">
-                        <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" />
-                    </el-select>
-                </div>
-                <div class="ml-2 w-[100px]">
-                    <el-select v-model="searchForm.key2" filterable clearable block placeholder="项目类型" @change="searchClick">
-                        <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-                    </el-select>
-                </div>
-            </div>
-        </template>
-        <template #extra>
-            <div v-if="isWidths >= 1660" class="hc-flex">
-                <div class="w-[120px]">
-                    <el-select v-model="searchForm.key1" filterable clearable block placeholder="项目阶段" @change="searchClick">
-                        <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" />
-                    </el-select>
-                </div>
-                <div class="ml-2 w-[100px]">
-                    <el-select v-model="searchForm.key2" filterable clearable block placeholder="项目类型" @change="searchClick">
-                        <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-                    </el-select>
-                </div>
-            </div>
-            <el-button type="success" class="ml-6" @click="reportsClick">生成报告</el-button>
-            <el-button v-del-com:[delTableItem] type="danger" class="ml-2" :disabled="tableCheckKeys.length <= 0">批量删除</el-button>
-            <el-button type="warning" class="ml-2" @click="importClick">导入</el-button>
-            <el-button v-yes-com:[deriveTableItem] type="primary" class="ml-2" :disabled="tableCheckKeys.length <= 0">批量导出</el-button>
-        </template>
-        <template v-if="isWidths < 1660" #search>
+    <hc-card class="hc-project-collect-admin-list" w-to="1660">
+        <template #headerToSearch>
             <hc-date-year v-model="searchForm.startYear" v-model:end="searchForm.endYear" />
-            <div class="relative ml-4 w-[500px]">
+            <div class="relative ml-3 w-[300px]">
                 <hc-search-input v-model="searchForm.queryValue" text="搜索" color="#151921" @search="searchClick">
                     <template #prepend>
                         <el-select v-model="searchForm.year" placeholder="年份" clearable style="width: 80px">
@@ -58,6 +13,24 @@
                 </hc-search-input>
             </div>
         </template>
+        <template #extraToHeader>
+            <div class="w-[120px]">
+                <el-select v-model="searchForm.key1" filterable clearable block placeholder="项目阶段" @change="searchClick">
+                    <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+            </div>
+            <div class="ml-2 w-[100px]">
+                <el-select v-model="searchForm.key2" filterable clearable block placeholder="项目类型" @change="searchClick">
+                    <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+            </div>
+        </template>
+        <template #extra>
+            <el-button type="success" class="ml-6" @click="reportsClick">生成报告</el-button>
+            <el-button v-del-com:[delTableItem] type="danger" class="ml-2" :disabled="tableCheckKeys.length <= 0">批量删除</el-button>
+            <el-button type="warning" class="ml-2" @click="importClick">导入</el-button>
+            <el-button v-yes-com:[deriveTableItem] type="primary" class="ml-2" :disabled="tableCheckKeys.length <= 0">批量导出</el-button>
+        </template>
         <HcTableList ref="tableRef" is-admin @tap="rowNameClick" @check="tableCheck" />
         <template #action>
             <div>建设规模:共计 xx 公里</div>
@@ -110,7 +83,6 @@
             </div>
         </hc-dialog>
     </hc-card>
-    <HcWinSize @change="onWindowResize" />
 </template>
 
 <script setup>
@@ -214,12 +186,6 @@ const importClick = () => {
 const modalImportClose = () => {
     isImportShow.value = false
 }
-
-//窗口大小改变
-const isWidths = ref()
-const onWindowResize = ({ w }) => {
-    isWidths.value = w
-}
 </script>
 
 <style lang="scss">

+ 4 - 4
yarn.lock

@@ -2000,10 +2000,10 @@ has-flag@^4.0.0:
   resolved "http://39.108.216.210:9000/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
   integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
 
-hc-vue3-ui@^3.7.9:
-  version "3.7.9"
-  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-3.7.9.tgz#d097ead1481c355d084dc6b508390e89473090f2"
-  integrity sha512-QTmK4EEp0rmdTVIp7EtZPaS+kAN74FdxhmzEO7JDU7zusSPK0iV+d6PMVLxO67KHRl0i7Cs8H+6El/3EsZauVg==
+hc-vue3-ui@^3.8.0:
+  version "3.8.0"
+  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-3.8.0.tgz#ee3b4ba2281b043818725dac5f295193b80d95b0"
+  integrity sha512-LEsBYfKFWEV+w0XhNL3C02gsovkKYVf9Y2dj3HFmtPYA03bL11NGui/kw9lcx0x5cMjPc27lu3GpmmfqjLuzbA==
   dependencies:
     axios "^1.6.8"
     dayjs "^1.11.10"