Browse Source

节假日和110

master
laishajiang 2 years ago
parent
commit
4b2db5d68a
  1. 35
      src/views/holiday/index.vue
  2. 36
      src/views/reportpolice/report.vue

35
src/views/holiday/index.vue

@ -2,7 +2,7 @@
<div class="index-lists" v-loading="loading">
<el-card class="!border-none" shadow="never">
<el-form :inline="true" style="display: flex; justify-content: center;margin-top: 10px;margin-right: 70px;">
<el-form :inline="true" style="display: flex; margin-top: 10px;margin-right: 70px;">
<el-form-item label="请选择年份">
<el-date-picker type="year" v-model="currenYear" placeholder="请选择年份" value-format="YYYY"></el-date-picker>
</el-form-item>
@ -21,10 +21,7 @@
<div class="holiday-cell" v-show="data.type === 'current-month'"
:id="index + '-' + data.day"
:class="{ 'is-holiday': ifHoliday(data.day) }, { 'is-adjust': ifAdjustDay(data.day) }">
{{ data.day.split('-')[2] }}
<span class="holiday-text">{{ ifHoliday(data.day) ? '休' : '' }}</span>
<span class="adjust-text">{{ ifAdjustDay(data.day) ? '班' : '' }}</span>
<span class="content-text">{{ dayContent(data.day) }}</span>
{{ formatDay(data.day).split('-')[2] }}
</div>
</template>
</el-calendar>
@ -59,6 +56,16 @@ const getDateData = () => {
console.log(err);
});
}
const formatDay = (day) => {
// day "2023-09-05"
const [year, month, dayWithZero] = day.split('-');
// 使 parseInt 0 toString
const formattedDay = parseInt(dayWithZero, 10).toString();
// 0
// const formattedDay = dayWithZero.padStart(2, '0');
//
return `${year}-${month}-${formattedDay}`;
}
onBeforeMount(() => {
getDateData();
})
@ -156,10 +163,12 @@ const dayContent = (day) => {
}
.holiday-cell {
position: relative;
width: 50px;
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
left: 5px;
}
.holiday-text {
position: absolute;
@ -186,21 +195,21 @@ const dayContent = (day) => {
white-space: nowrap;
}
.is-holiday {
border-radius: 5px;
background: linear-gradient(145deg, #a7d2b3, #c6f9d5);
border-radius: 50px 50px 50px 50px;
background: #298F17;
}
.is-adjust {
/* .is-adjust {
border-radius: 5px;
background: linear-gradient(145deg, #d9a2a2, #ffc1c1);
}
} */
.scrollbar-container {
height: calc(100vh - 200px);
}
.is-today {
/* .is-today {
border-radius: 5px;
background: linear-gradient(145deg, #d9a2a2, #ffc1c1);
}
} */
</style>

36
src/views/reportpolice/report.vue

@ -61,9 +61,10 @@
</el-form>
</header>
<main>
<div class="table-container">
<el-table :data="report" style="width: 100%" >
<el-tabs v-model="activeTab" @tab-click="handleClick">
<el-tab-pane label="未处理" name="table1">
<div class="table-container">
<el-table :data="report" style="width: 100%" >
<el-table-column prop="contactPhone" label="报警电话" align="center" width="160" />
<el-table-column prop="hzsj" label="话终时间" align="center" width="160" />
<el-table-column prop="contactName" label="报警人名" align="center" />
@ -83,7 +84,24 @@
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="已剔除" name="table2">
<div class="table-container">
<el-table :data="report" style="width: 100%" >
<el-table-column prop="contactPhone" label="报警电话" align="center" width="160" />
<el-table-column prop="hzsj" label="话终时间" align="center" width="160" />
<el-table-column prop="contactName" label="报警人名" align="center" />
<el-table-column prop="jjlxdmms" label="报警类型" align="center"/>
<el-table-column prop="ysjqxzmc" label="接警性质" align="center"/>
<el-table-column prop="gxdwmc" label="管辖单位" align="center"/>
<el-table-column prop="content" show-overflow-tooltip label="报警内容" align="center"/>
<el-table-column prop="xchfnr" show-overflow-tooltip label="反馈结警" align="center"/>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<div class="flex mt-4 end">
<el-pagination @size-change="getList" @current-change="getList" :current-page="query.current"
:page-sizes="[10, 20, 50]" :page-size="query.size" v-model:current-page="query.current"
@ -119,14 +137,22 @@ function handleMail(row) {
activeReportId.value = row.id;
}
function getList() {
query.value.activeTab = activeTab.value;
getReport(query.value).then((data) => {
console.log("dddddddddddddddddddddddddddddddddddddddd")
report.value = data.records;
totalSize.total = data.total;
totalSize.pages = data.pages;
});
}
function handleClick(tab){
if(tab.index == 0){
activeTab.value = "table1"
}else{
activeTab.value = "table2"
}
getList();
}
function reset() {
query.value = {}
getList()

Loading…
Cancel
Save