|
@@ -19,7 +19,7 @@
|
|
|
<div v-if="tabsKey === '1'" class="hc-flex">
|
|
|
<div class="ml-6 w-[120px]">
|
|
|
<el-select v-model="searchForm1.key1" filterable clearable block placeholder="项目阶段" @change="searchClick1">
|
|
|
- <el-option v-for="item in stateData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option v-for="item in projectStage" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-[100px]">
|
|
@@ -27,28 +27,23 @@
|
|
|
<el-option v-for="item in typeData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+ <el-button v-yes-com:[deriveTableItem] :disabled="tableCheckKeys1.length <= 0" type="primary" class="ml-2">批量导出</el-button>
|
|
|
</div>
|
|
|
<div v-if="tabsKey === '2'" class="hc-flex">
|
|
|
+ <hc-date-year v-model="searchForm2.startYear" v-model:end="searchForm2.endYear" />
|
|
|
<div class="relative ml-3 w-[300px]">
|
|
|
- <hc-search-input v-model="searchForm2.queryValue" color="#151921" text="搜索" @search="searchClick2">
|
|
|
- <template #prepend>
|
|
|
- <el-select v-model="searchForm2.year" placeholder="年份" style="width: 75px">
|
|
|
- <el-option label="2023" value="2023" />
|
|
|
- <el-option label="2024" value="2024" />
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </hc-search-input>
|
|
|
+ <hc-search-input v-model="searchForm2.targetPlan" color="#151921" text="搜索" @search="searchClick2" />
|
|
|
</div>
|
|
|
<div class="ml-6 w-[120px]">
|
|
|
- <el-select v-model="searchForm2.key1" filterable clearable block placeholder="项目阶段" @change="searchClick2">
|
|
|
- <el-option v-for="item in stateData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select v-model="searchForm2.workFocusStage" filterable clearable block placeholder="项目阶段" @change="searchClick2">
|
|
|
+ <el-option v-for="item in projectStage" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+ <el-button v-yes-com:[deriveTableItem] :disabled="tableCheckKeys2.length <= 0" type="primary" class="ml-2">批量导出</el-button>
|
|
|
</div>
|
|
|
- <el-button v-yes-com:[deriveTableItem] type="primary" class="ml-2">批量导出</el-button>
|
|
|
</template>
|
|
|
<HcTableList1 v-if="tabsKey === '1'" ref="table1Ref" />
|
|
|
- <HcTableList2 v-if="tabsKey === '2'" ref="table2Ref" />
|
|
|
+ <HcTableList2 v-if="tabsKey === '2'" :datas="tableData2" :loading="tableLoading2" @tap="rowNameClick2" @check="tableCheck2" @change="searchClick2" />
|
|
|
<template #action>
|
|
|
<hc-pages v-if="tabsKey === '1'" :pages="searchForm1" @change="pageChange1" />
|
|
|
<hc-pages v-if="tabsKey === '2'" :pages="searchForm2" @change="pageChange2" />
|
|
@@ -57,9 +52,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref } from 'vue'
|
|
|
+import { onMounted, ref } from 'vue'
|
|
|
import HcTableList1 from './modules/project-list.vue'
|
|
|
import HcTableList2 from './modules/gist-list.vue'
|
|
|
+import { getDictionaryData } from '~src/utils/tools'
|
|
|
+import mainApi from '~api/project/gist'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
|
|
|
//选项卡切换
|
|
|
const tabsKey = ref('1')
|
|
@@ -69,10 +67,23 @@ const tabsData = ref([
|
|
|
])
|
|
|
const tabsChange = ({ key }) => {
|
|
|
tabsKey.value = key
|
|
|
+ if (key === '1') {
|
|
|
+ searchClick1()
|
|
|
+ } else if (key === '2') {
|
|
|
+ searchClick2()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-//项目阶段
|
|
|
-const stateData = ref([{ value: '1', label: '新开工项目' }, { value: '2', label: '建成项目' }])
|
|
|
+//渲染完成
|
|
|
+onMounted(() => {
|
|
|
+ getDataApi()
|
|
|
+})
|
|
|
+
|
|
|
+//获取接口数据
|
|
|
+const projectStage = ref([])//项目阶段
|
|
|
+const getDataApi = async () => {
|
|
|
+ projectStage.value = await getDictionaryData('projectStage', true)
|
|
|
+}
|
|
|
|
|
|
//项目类型
|
|
|
const typeData = ref([{ value: '1', label: '铁路' }, { value: '2', label: '高速公路' }])
|
|
@@ -83,7 +94,7 @@ const searchForm1 = ref({
|
|
|
current: 1, size: 20, total: 0,
|
|
|
})
|
|
|
const searchForm2 = ref({
|
|
|
- startYear: '', endYear: '', queryValue: '', year: '',
|
|
|
+ targetPlan: '', workFocusStage: null,
|
|
|
current: 1, size: 20, total: 0,
|
|
|
})
|
|
|
|
|
@@ -92,7 +103,8 @@ const searchClick1 = () => {
|
|
|
|
|
|
}
|
|
|
const searchClick2 = () => {
|
|
|
-
|
|
|
+ searchForm2.value.current = 1
|
|
|
+ getTableData2()
|
|
|
}
|
|
|
|
|
|
//分页
|
|
@@ -105,10 +117,42 @@ const pageChange1 = ({ current, size }) => {
|
|
|
const pageChange2 = ({ current, size }) => {
|
|
|
searchForm2.value.current = current
|
|
|
searchForm2.value.size = size
|
|
|
+ getTableData2()
|
|
|
}
|
|
|
|
|
|
const table1Ref = ref(null)
|
|
|
-const table2Ref = ref(null)
|
|
|
+
|
|
|
+//表格数据
|
|
|
+const tableData2 = ref([])
|
|
|
+const tableLoading2 = ref(false)
|
|
|
+
|
|
|
+//表格被选择
|
|
|
+const tableCheckKeys1 = ref([])
|
|
|
+const tableCheckKeys2 = ref([])
|
|
|
+const tableCheck2 = (row) => {
|
|
|
+ tableCheckKeys2.value = row
|
|
|
+}
|
|
|
+
|
|
|
+//获取表格数据
|
|
|
+const getTableData2 = async () => {
|
|
|
+ tableData2.value = []
|
|
|
+ tableLoading2.value = true
|
|
|
+ const { error, code, data } = await mainApi.page(searchForm2.value)
|
|
|
+ //处理数据
|
|
|
+ tableLoading2.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData2.value = getArrValue(data['records'])
|
|
|
+ searchForm2.value.total = data.total || 0
|
|
|
+ } else {
|
|
|
+ tableData2.value = []
|
|
|
+ searchForm2.value.total = 0
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//名称被点击
|
|
|
+const rowNameClick2 = (row) => {
|
|
|
+ console.log(row)
|
|
|
+}
|
|
|
|
|
|
//批量导出
|
|
|
const deriveTableItem = (_, resolve) => {
|