|
@@ -30,16 +30,39 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
</BasicSearch>
|
|
</BasicSearch>
|
|
|
- <BasicTable :table-data="tableData" :table-config="tableConfig"> </BasicTable>
|
|
|
|
|
|
|
+ <BasicTable
|
|
|
|
|
+ :table-data="tableData"
|
|
|
|
|
+ :table-config="tableConfig"
|
|
|
|
|
+ @update:pageSize="handleSizeChange"
|
|
|
|
|
+ @update:pageNumber="handleCurrentChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #signType="scope">
|
|
|
|
|
+ <span>{{ DRILI_SIGN_TYPE_MAP[scope.row.signType] }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #drillScope="scope">
|
|
|
|
|
+ <span>{{ getDrillScope(scope.row.drillScope) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #confirmStatus="scope">
|
|
|
|
|
+ <span>{{ CONFIRM_STATUS_MAP[scope.row.confirmStatus] }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #action="scope">
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="查看"
|
|
|
|
|
+ @click="handleView(scope.row.drillPlanId, scope.row.signType, scope.row.confirmStatus)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
import BasicSearch from '@/components/BasicSearch.vue';
|
|
import BasicSearch from '@/components/BasicSearch.vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
|
|
+ import ActionButton from '@/components/ActionButton.vue';
|
|
|
import { useEmergencyDrillHook } from './hook';
|
|
import { useEmergencyDrillHook } from './hook';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
@@ -50,10 +73,12 @@
|
|
|
DRILL_SIGN_LIST_TABLE_OPTIONS,
|
|
DRILL_SIGN_LIST_TABLE_OPTIONS,
|
|
|
DRILI_SIGN_LIST_TABLE_COLUMNS,
|
|
DRILI_SIGN_LIST_TABLE_COLUMNS,
|
|
|
} from './configs/sign';
|
|
} from './configs/sign';
|
|
|
|
|
+ import { DRILI_SIGN_TYPE_MAP, CONFIRM_STATUS_MAP } from './constants';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
|
|
- const { drillScopeDice, getDrillScopeDict } = useEmergencyDrillHook();
|
|
|
|
|
|
|
+ const { drillScopeDice, getDrillScopeDict, getDrillScope } = useEmergencyDrillHook();
|
|
|
const { tableConfig, pagination } = useTableConfig(DRILI_SIGN_LIST_TABLE_COLUMNS, DRILL_SIGN_LIST_TABLE_OPTIONS);
|
|
const { tableConfig, pagination } = useTableConfig(DRILI_SIGN_LIST_TABLE_COLUMNS, DRILL_SIGN_LIST_TABLE_OPTIONS);
|
|
|
|
|
+ const router = useRouter();
|
|
|
const searchData = reactive<DrillSignSearch>({
|
|
const searchData = reactive<DrillSignSearch>({
|
|
|
signType: null,
|
|
signType: null,
|
|
|
drillScope: null,
|
|
drillScope: null,
|
|
@@ -68,7 +93,7 @@
|
|
|
};
|
|
};
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
drillSignListQuery.queryParam = {};
|
|
drillSignListQuery.queryParam = {};
|
|
|
- if (searchData.signType !== null) {
|
|
|
|
|
|
|
+ if (searchData.signType) {
|
|
|
drillSignListQuery.queryParam.signType = searchData.signType;
|
|
drillSignListQuery.queryParam.signType = searchData.signType;
|
|
|
}
|
|
}
|
|
|
if (searchData.drillScope) {
|
|
if (searchData.drillScope) {
|
|
@@ -94,6 +119,28 @@
|
|
|
pagination.total = res.totalRow;
|
|
pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
tableConfig.loading = false;
|
|
|
};
|
|
};
|
|
|
|
|
+ const handleSizeChange = (value: number) => {
|
|
|
|
|
+ pagination.pageSize = value;
|
|
|
|
|
+ drillSignListQuery.pageSize = value;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleCurrentChange = (value: number) => {
|
|
|
|
|
+ pagination.pageNumber = value;
|
|
|
|
|
+ drillSignListQuery.pageNumber = value;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleView = (id: number, type: number, status: number) => {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: 'emergency-drill-sign-item',
|
|
|
|
|
+ params: {
|
|
|
|
|
+ id,
|
|
|
|
|
+ },
|
|
|
|
|
+ query: {
|
|
|
|
|
+ type,
|
|
|
|
|
+ status,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getDrillScopeDict();
|
|
getDrillScopeDict();
|
|
|
getTableData();
|
|
getTableData();
|