接口专题咨询
This commit is contained in:
parent
fdb390a574
commit
244a666e2d
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
<el-form :inline="true" :model="filterForm" class="demo-form-inline">
|
<el-form :inline="true" :model="filterForm" class="demo-form-inline">
|
||||||
<el-form-item label="分类">
|
<el-form-item label="分类">
|
||||||
<el-select v-model.trim="filterForm.category" placeholder="Select" clearable filterable >
|
<el-select v-model.trim="filterForm.type" placeholder="Select" clearable filterable >
|
||||||
<el-option v-for="item in categoryList.list" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in categoryList.list" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关键字">
|
<el-form-item label="关键字">
|
||||||
<el-input v-model.trim="filterForm.keyword" placeholder="请输入关键字" clearable />
|
<el-input v-model.trim="filterForm.topicName" placeholder="请输入关键字" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="时间范围">
|
<el-form-item label="时间范围">
|
||||||
<el-date-picker v-model.trim="filterForm.dataRange" type="daterange" range-separator="To"
|
<el-date-picker v-model.trim="filterForm.dataRange" type="daterange" range-separator="To"
|
||||||
|
|
@ -28,21 +28,13 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const emits = defineEmits(['search', 'reset', 'export', 'add'])
|
const emits = defineEmits(['search', 'reset', 'export', 'add'])
|
||||||
|
import { getdatatime } from "utils/time"
|
||||||
const categoryList = reactive({
|
const categoryList = reactive({
|
||||||
list: [{
|
list: []
|
||||||
|
|
||||||
value: 'Option1',
|
|
||||||
label: 'Option1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Option2',
|
|
||||||
label: 'Option2',
|
|
||||||
|
|
||||||
}]
|
|
||||||
})
|
})
|
||||||
const filterForm = reactive({
|
const filterForm:any = reactive({
|
||||||
category:'',
|
type:'',
|
||||||
keyword: '',
|
topicName: '',
|
||||||
dataRange:''
|
dataRange:''
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
@ -52,7 +44,10 @@ const serachFn = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetFn = () => {
|
const resetFn = () => {
|
||||||
emits('reset')
|
filterForm.type = ''
|
||||||
|
filterForm.topicName = ''
|
||||||
|
filterForm.dataRange = getdatatime()
|
||||||
|
emits('reset',filterForm)
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportFn = () => {
|
const exportFn = () => {
|
||||||
|
|
@ -62,7 +57,9 @@ const addFn = () => {
|
||||||
emits('add')
|
emits('add')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
filterForm.dataRange = getdatatime()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="paination_out">
|
<div class="paination_out">
|
||||||
<Pagination :currentPage="paginationInfo.currentPage" :pageSize="paginationInfo.pageSize" @sendPage="getPageFn"></Pagination>
|
<Pagination :currentPage="paginationInfo.pageNum" :pageSize="paginationInfo.pageSize" @sendPage="getPageFn"></Pagination>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -36,52 +36,18 @@
|
||||||
import headerTop from "./com/headerTop.vue"
|
import headerTop from "./com/headerTop.vue"
|
||||||
import addCom from "./com/addCom.vue"
|
import addCom from "./com/addCom.vue"
|
||||||
import { ElConfirmBeforeOpert } from "utils/elementCom"
|
import { ElConfirmBeforeOpert } from "utils/elementCom"
|
||||||
|
import { apiBmTopicInfoList } from "http/api/config"
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
const addComRef = ref()
|
const addComRef = ref()
|
||||||
const paginationInfo = reactive({
|
const paginationInfo = reactive({
|
||||||
currentPage: 1,
|
pageNum: 1,
|
||||||
pageSize: 15
|
pageSize: 15
|
||||||
})
|
})
|
||||||
const tableData = [
|
let total = ref(0)
|
||||||
{
|
|
||||||
v_id: '1',
|
|
||||||
v_title: '2016-05-03',
|
|
||||||
v_category: 'Tom',
|
|
||||||
v_publisher: 'California',
|
|
||||||
v_showCount: 'Los Angeles',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
v_id: '2',
|
|
||||||
v_title: '2016-05-03',
|
|
||||||
v_category: 'Tom',
|
|
||||||
v_publisher: 'California',
|
|
||||||
v_showCount: 'Los Angeles',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
v_id: '3',
|
|
||||||
v_title: '2016-05-03',
|
|
||||||
v_category: 'Tom',
|
|
||||||
v_publisher: 'California',
|
|
||||||
v_showCount: 'Los Angeles',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
v_id: '4',
|
|
||||||
v_title: '2016-05-03',
|
|
||||||
v_category: 'Tom',
|
|
||||||
v_publisher: 'California',
|
|
||||||
v_showCount: 'Los Angeles',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
v_id: '5',
|
|
||||||
v_title: '2016-05-03',
|
|
||||||
v_category: 'Tom',
|
|
||||||
v_publisher: 'California',
|
|
||||||
v_showCount: 'Los Angeles',
|
|
||||||
},
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
let tableListInfo = reactive({
|
let tableListInfo = reactive({
|
||||||
list: tableData
|
list: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const showRowFn = (row: any) => {
|
const showRowFn = (row: any) => {
|
||||||
|
|
@ -96,11 +62,20 @@ const editRowFn = (row: any) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteItem = (row: any) => {
|
const deleteItem = async (row: any) => {
|
||||||
const itemID = row.v_id
|
const itemID = row.id
|
||||||
console.log("ITEMid", row)
|
const index = tableListInfo.list.findIndex((ele: any) => ele.id == itemID)
|
||||||
}
|
const res = await apiBmCarouselSetsListDelete(itemID)
|
||||||
|
let tipMessage = "删除成功"
|
||||||
|
|
||||||
|
tableListInfo.list.splice(index, 1)
|
||||||
|
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: tipMessage
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
const deleteRowFn = (row: any) => {
|
const deleteRowFn = (row: any) => {
|
||||||
ElConfirmBeforeOpert(
|
ElConfirmBeforeOpert(
|
||||||
'操作确认',
|
'操作确认',
|
||||||
|
|
@ -112,15 +87,26 @@ const deleteRowFn = (row: any) => {
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let searchParams: any = {
|
||||||
const searchFn = () => {
|
carName: ''
|
||||||
|
}
|
||||||
|
const searchFn = (params: any) => {
|
||||||
|
searchParams = params
|
||||||
|
console.log("searchParams", params)
|
||||||
|
searchParams.beginTime = moment(params.dataRange[0]).format('yyyy-MM-DD')
|
||||||
|
searchParams.endTime = moment(params.dataRange[1]).format('yyyy-MM-DD')
|
||||||
|
initTableList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetFn = () => {
|
const resetFn = (params: any) => {
|
||||||
|
searchParams = params
|
||||||
|
console.log("searchParams", params)
|
||||||
|
searchParams.beginTime = moment(params.dataRange[0]).format('yyyy-MM-DD')
|
||||||
|
searchParams.endTime = moment(params.dataRange[1]).format('yyyy-MM-DD')
|
||||||
|
initTableList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const exportFn = () => {
|
const exportFn = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -132,14 +118,30 @@ const addFn = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getPageFn = (val: any) => {
|
const getPageFn = (val: any) => {
|
||||||
paginationInfo.currentPage = val.currentPage
|
paginationInfo.pageNum = val.pageNum
|
||||||
paginationInfo.pageSize = val.pageSize
|
paginationInfo.pageSize = val.pageSize
|
||||||
initTableList()
|
initTableList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const initTableList =()=>{
|
const initTableList = async () => {
|
||||||
|
const params = {
|
||||||
|
...searchParams,
|
||||||
|
...paginationInfo
|
||||||
}
|
}
|
||||||
|
const res: any = await apiBmTopicInfoList(params)
|
||||||
|
console.log("apiBmTopicInfoList", res)
|
||||||
|
tableListInfo.list = res.rows.map((ele: any) => {
|
||||||
|
return {
|
||||||
|
...ele,
|
||||||
|
status: ele.status == 1 ? true : false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// tableListInfo.list =
|
||||||
|
total.value = res.total
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
initTableList()
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { linkReg } from "utils/reg"
|
import { linkReg } from "utils/reg"
|
||||||
import { apiBmCarouselSetsById, apiBmCarouselSetsAddorupdate } from "http/api/config"
|
import { apiBmCarouselSetsById, apiBmCarouselSetsAddorupdate } from "http/api/config"
|
||||||
|
import { emit } from "process"
|
||||||
const emits = defineEmits(['send'])
|
const emits = defineEmits(['send'])
|
||||||
const addShow = ref(false)
|
const addShow = ref(false)
|
||||||
let title: any = ref("新增")
|
let title: any = ref("新增")
|
||||||
|
|
@ -141,6 +142,7 @@ const updateFn = async () => {
|
||||||
message: title.value + '成功'
|
message: title.value + '成功'
|
||||||
})
|
})
|
||||||
addShow.value = false
|
addShow.value = false
|
||||||
|
emit("send")
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ import { ElConfirmBeforeOpert } from "utils/elementCom"
|
||||||
import { apiBmCarouselSetsListDelete, apiBmCarouselSetList, apiBmCarouselSetsAddorupdate } from "http/api/config"
|
import { apiBmCarouselSetsListDelete, apiBmCarouselSetList, apiBmCarouselSetsAddorupdate } from "http/api/config"
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { status } from "nprogress"
|
|
||||||
const addComRef = ref()
|
const addComRef = ref()
|
||||||
const paginationInfo = reactive({
|
const paginationInfo = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue