ZaiZai пре 1 година
родитељ
комит
b2bc5b754a
4 измењених фајлова са 50 додато и 49 уклоњено
  1. 1 1
      public/version.json
  2. 20 0
      src/api/modules/anomaly/api.js
  3. 28 47
      src/views/anomaly/index.vue
  4. 1 1
      src/views/home/datav.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240411105919"
+  "value": "20240412150402"
 }

+ 20 - 0
src/api/modules/anomaly/api.js

@@ -0,0 +1,20 @@
+import { HcApi } from '../../request/index'
+
+export default {
+    //分页
+    async page(form) {
+        return HcApi({
+            url: '/api/blade-attach/project/page-warning',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //撤销
+    async repeal(form) {
+        return HcApi({
+            url: '/api/blade-attach/project/repeal-warning',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+}

+ 28 - 47
src/views/anomaly/index.vue

@@ -2,18 +2,18 @@
     <div class="hc-layout-box anonaly-page">
         <hc-card :scrollbar="false" action-size="lg">
             <template #header>
-                <el-select v-model="searchForm.key1" class="w-[148px]" placeholder="异常类型">
+                <el-select v-model="searchForm.type" class="w-[148px]" placeholder="异常类型">
                     <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
-                <el-select v-model="searchForm.key2" class="ml-2 w-[100px]" placeholder="异常等级">
+                <el-select v-model="searchForm.grade" class="ml-2 w-[100px]" placeholder="异常等级">
                     <el-option v-for="item in levelOptions" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
-                <el-select v-model="searchForm.key3" class="ml-2 w-[100px]" placeholder="是否撤销">
+                <el-select v-model="searchForm.isAnnul" class="ml-2 w-[100px]" placeholder="是否撤销">
                     <el-option :value="1" label="是" />
-                    <el-option :value="2" label="否" />
+                    <el-option :value="0" label="否" />
                 </el-select>
                 <div class="relative ml-3 w-[300px]">
-                    <hc-search-input v-model="searchForm.queryValue" color="#151921" text="搜索" @search="searchClick" />
+                    <hc-search-input v-model="searchForm.searchValue" color="#151921" text="搜索" @search="searchClick" />
                 </div>
             </template>
             <template #extra>
@@ -57,17 +57,32 @@
 
 <script setup>
 import { onMounted, ref } from 'vue'
+import mainApi from '~api/anomaly/api'
 
+//渲染完成
 onMounted(() => {
 
 })
 
 //搜索表单
 const searchForm = ref({
-    queryValue: null, current: 1, size: 20, total: 0, key1: '', key2: '', key3: '',
+    searchValue: null, current: 1, size: 20, total: 0, key1: '', key2: '', key3: '',
 })
-const typeOptions = ref([{ value: '1', label: '项目进度异常' }, { value: '2', label: '项目投资异常' }])
-const levelOptions = ref([{ value: '1', label: '三级' }, { value: '2', label: '二级' }])
+
+const typeOptions = ref([{ value: '2', label: '项目进度异常' }, { value: '1', label: '项目投资异常' }])
+const levelOptions = ref([{ value: '1', label: '一级' }, { value: '2', label: '二级' }, { value: '2', label: '三级' }])
+
+const searchClick = () => {
+
+}
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格
 const tableColumn = [
     { key: 'key1', name: '项目名称', align: 'center' },
     { key: 'key2', name: '异常类型', align: 'center' },
@@ -79,37 +94,10 @@ const tableColumn = [
     { key: 'key8', name: '撤销结束时间', align: 'center' },
     { key: 'action', name: '操作', fixed: 'right', align: 'center' },
 ]
-const tableData = ref([
-    {
-        key1: '成渝高速',
-        key2: '项目进度异常',
-        key3: '第一季度',
-        key4: '2021-3-1 14:31',
-        key5: '三级',
-        key6: '否',
-        key7: '',
-    },
-    {
-        key1: '成渝高速',
-        key2: '项目进度异常',
-        key3: '第一季度',
-        key4: '2021-3-1 14:31',
-        key5: '一级',
-        key6: '否',
-        key7: '',
-    },
-    {
-        key1: '成渝铁路重庆站至江津段改造',
-        key2: '项目进度异常',
-        key3: '第一季度',
-        key4: '2021-3-1 14:31',
-        key5: '二级',
-        key6: '否',
-        key7: '',
-    },
-])
+const tableData = ref([])
+
 //设置单元格的样式
-const tableCellStyle = ({ row, column, rowIndex, columnIndex }) => {
+const tableCellStyle = ({ row, column }) => {
     if (column.property === 'key5' && row.key5 === '二级') {
         return {
             backgroundColor: '#FF9102',
@@ -127,19 +115,12 @@ const tableCellStyle = ({ row, column, rowIndex, columnIndex }) => {
         }
     }
 }
-const getTableData = () => {
+
+const getTableData = async () => {
 
 }
 
-const searchClick = () => {
 
-}
-//分页被点击
-const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
 const tableCheckedKeys = ref([])
 //多选事件
 const tableSelectionChange = (rows) => {

+ 1 - 1
src/views/home/datav.vue

@@ -12,7 +12,7 @@
                 </div>
                 <div class="hc-datav-search-select hc-flex w-full">
                     <div ref="searchRef" class="relative">
-                        <HcDatavSelect v-model="searchForm.year" :datas="yearArr" :clearable="false" />
+                        <HcDatavSelect v-model="searchForm.year" :datas="yearArr" :clearable="false" @change="searchChange" />
                         <HcDatavSelect v-model="pageType" :datas="pageTypeArr" :clearable="false" @change="pageTypeChange" />
                         <template v-if="pageType === '1'">
                             <HcDatavSelect v-model="searchForm.month" :datas="monthArr" placeholder="选择月份" @change="searchChange" />