zhitan-admin/src/main/java/com/zhitan/web/controller/alarm/AlarmAnalyisisController.java
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController; /** * description todu geng * description æ¥è¦åæç¸å ³åè½ * * @author hmj * @date 2024-10-26 17:31 zhitan-admin/src/main/java/com/zhitan/web/controller/auxiliaryinput/ProductOutputController.java
@@ -34,10 +34,9 @@ */ @PreAuthorize("@ss.hasPermi('system:prodoutput:list')") @GetMapping("/productoutput/list") public TableDataInfo list(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { public TableDataInfo list(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { productOutput.setDataType("1"); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput,pageNum,pageSize); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput, pageNum, pageSize); return getDataTable(list); } @@ -47,8 +46,7 @@ @PreAuthorize("@ss.hasPermi('system:prodoutput:export')") @Log(title = "产å产éå½å ¥", businessType = BusinessType.EXPORT) @PostMapping("/productoutput/export") public void export(HttpServletResponse response, ProductOutput productOutput) { public void export(HttpServletResponse response, ProductOutput productOutput) { productOutput.setDataType("1"); List<ProductOutput> list = auxiliaryInputService.selectProductOutputList(productOutput); ExcelUtil<ProductOutput> util = new ExcelUtil<ProductOutput>(ProductOutput.class); @@ -60,8 +58,7 @@ */ @PreAuthorize("@ss.hasPermi('system:prodoutput:query')") @GetMapping(value = "/productoutput/{productOutputId}") public AjaxResult getInfo(@PathVariable("productOutputId") String productOutputId) { public AjaxResult getInfo(@PathVariable("productOutputId") String productOutputId) { return success(auxiliaryInputService.selectProductOutputById(productOutputId)); } @@ -71,8 +68,7 @@ @PreAuthorize("@ss.hasPermi('system:prodoutput:add')") @Log(title = "产å产éå½å ¥", businessType = BusinessType.INSERT) @PostMapping(value = "/productoutput") public AjaxResult add(@RequestBody ProductOutput productOutput) { public AjaxResult add(@RequestBody ProductOutput productOutput) { productOutput.setProductOutputId(UUID.randomUUID().toString()); productOutput.setDataType("1"); return toAjax(auxiliaryInputService.insertProductOutput(productOutput)); @@ -84,8 +80,7 @@ @PreAuthorize("@ss.hasPermi('system:prodoutput:edit')") @Log(title = "产å产éå½å ¥", businessType = BusinessType.UPDATE) @PutMapping(value = "/productoutput") public AjaxResult edit(@RequestBody ProductOutput productOutput) { public AjaxResult edit(@RequestBody ProductOutput productOutput) { return toAjax(auxiliaryInputService.updateProductOutput(productOutput)); } @@ -95,8 +90,7 @@ @PreAuthorize("@ss.hasPermi('system:prodoutput:remove')") @Log(title = "产å产éå½å ¥", businessType = BusinessType.DELETE) @DeleteMapping("/productoutput/{ids}") public AjaxResult remove(@PathVariable String[] ids) { public AjaxResult remove(@PathVariable String[] ids) { return toAjax(auxiliaryInputService.deleteProductOutputByIds(ids)); } @@ -106,10 +100,9 @@ */ @PreAuthorize("@ss.hasPermi('system:meter:list')") @GetMapping("/meter/list") public TableDataInfo meterList(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { public TableDataInfo meterList(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { productOutput.setDataType("2"); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput,pageNum,pageSize); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput, pageNum, pageSize); return getDataTable(list); } @@ -119,8 +112,7 @@ @PreAuthorize("@ss.hasPermi('system:meter:export')") @Log(title = "è½æºä»ªè¡¨å½å ¥", businessType = BusinessType.EXPORT) @PostMapping("/meter/export") public void meterExport(HttpServletResponse response, ProductOutput productOutput) { public void meterExport(HttpServletResponse response, ProductOutput productOutput) { productOutput.setDataType("2"); List<ProductOutput> list = auxiliaryInputService.selectProductOutputList(productOutput); ExcelUtil<ProductOutput> util = new ExcelUtil<ProductOutput>(ProductOutput.class); @@ -132,8 +124,7 @@ */ @PreAuthorize("@ss.hasPermi('system:meter:query')") @GetMapping(value = "/meter/{productOutputId}") public AjaxResult meterGetInfo(@PathVariable("productOutputId") String productOutputId) { public AjaxResult meterGetInfo(@PathVariable("productOutputId") String productOutputId) { return success(auxiliaryInputService.selectProductOutputById(productOutputId)); } @@ -143,8 +134,7 @@ @PreAuthorize("@ss.hasPermi('system:meter:add')") @Log(title = "è½æºä»ªè¡¨å½å ¥", businessType = BusinessType.INSERT) @PostMapping(value = "/meter") public AjaxResult meterAdd(@RequestBody ProductOutput productOutput) { public AjaxResult meterAdd(@RequestBody ProductOutput productOutput) { productOutput.setProductOutputId(UUID.randomUUID().toString()); productOutput.setDataType("2"); return toAjax(auxiliaryInputService.insertProductOutput(productOutput)); @@ -156,8 +146,7 @@ @PreAuthorize("@ss.hasPermi('system:meter:edit')") @Log(title = "è½æºä»ªè¡¨å½å ¥", businessType = BusinessType.UPDATE) @PutMapping(value = "/meter") public AjaxResult meterEdit(@RequestBody ProductOutput productOutput) { public AjaxResult meterEdit(@RequestBody ProductOutput productOutput) { return toAjax(auxiliaryInputService.updateProductOutput(productOutput)); } @@ -167,8 +156,7 @@ @PreAuthorize("@ss.hasPermi('system:meter:remove')") @Log(title = "è½æºä»ªè¡¨å½å ¥", businessType = BusinessType.DELETE) @DeleteMapping("/meter/{ids}") public AjaxResult meterRemove(@PathVariable String[] ids) { public AjaxResult meterRemove(@PathVariable String[] ids) { return toAjax(auxiliaryInputService.deleteProductOutputByIds(ids)); } @@ -177,10 +165,9 @@ */ @PreAuthorize("@ss.hasPermi('system:energyindex:list')") @GetMapping("/energyindex/list") public TableDataInfo energyIndexList(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { public TableDataInfo energyIndexList(ProductOutput productOutput, @RequestParam Long pageNum, @RequestParam Long pageSize) { productOutput.setDataType("3"); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput,pageNum,pageSize); Page<ProductOutput> list = auxiliaryInputService.selectProductOutputPage(productOutput, pageNum, pageSize); return getDataTable(list); } @@ -190,8 +177,7 @@ @PreAuthorize("@ss.hasPermi('system:energyindex:export')") @Log(title = "è½æºææ å½å ¥", businessType = BusinessType.EXPORT) @PostMapping("/energyindex/export") public void energyIndexExport(HttpServletResponse response, ProductOutput productOutput) { public void energyIndexExport(HttpServletResponse response, ProductOutput productOutput) { productOutput.setDataType("3"); List<ProductOutput> list = auxiliaryInputService.selectProductOutputList(productOutput); ExcelUtil<ProductOutput> util = new ExcelUtil<ProductOutput>(ProductOutput.class); @@ -203,8 +189,7 @@ */ @PreAuthorize("@ss.hasPermi('system:energyindex:query')") @GetMapping(value = "/energyindex/{productOutputId}") public AjaxResult energyIndexGetInfo(@PathVariable("productOutputId") String productOutputId) { public AjaxResult energyIndexGetInfo(@PathVariable("productOutputId") String productOutputId) { return success(auxiliaryInputService.selectProductOutputById(productOutputId)); } @@ -214,8 +199,7 @@ @PreAuthorize("@ss.hasPermi('system:energyindex:add')") @Log(title = "è½æºææ å½å ¥", businessType = BusinessType.INSERT) @PostMapping(value = "/energyindex") public AjaxResult energyIndexAdd(@RequestBody ProductOutput productOutput) { public AjaxResult energyIndexAdd(@RequestBody ProductOutput productOutput) { productOutput.setProductOutputId(UUID.randomUUID().toString()); productOutput.setDataType("3"); return toAjax(auxiliaryInputService.insertProductOutput(productOutput)); @@ -227,8 +211,7 @@ @PreAuthorize("@ss.hasPermi('system:energyindex:edit')") @Log(title = "è½æºææ å½å ¥", businessType = BusinessType.UPDATE) @PutMapping(value = "/energyindex") public AjaxResult energyIndexEdit(@RequestBody ProductOutput productOutput) { public AjaxResult energyIndexEdit(@RequestBody ProductOutput productOutput) { return toAjax(auxiliaryInputService.updateProductOutput(productOutput)); } @@ -238,8 +221,7 @@ @PreAuthorize("@ss.hasPermi('system:energyindex:remove')") @Log(title = "è½æºææ å½å ¥", businessType = BusinessType.DELETE) @DeleteMapping("/energyindex/{ids}") public AjaxResult energyIndexRemove(@PathVariable String[] ids) { public AjaxResult energyIndexRemove(@PathVariable String[] ids) { return toAjax(auxiliaryInputService.deleteProductOutputByIds(ids)); } zhitan-admin/src/main/java/com/zhitan/web/controller/homepage/HomePageController.java
@@ -25,30 +25,24 @@ @Autowired public IHomePageService homepageService; /** * @description: å ¨åè½èç»è®¡ * @param timeType * @return * @author: hmj * @date: 2024/10/8 13:41 */ @GetMapping("/energyConsumptionSummation") public AjaxResult energyConsumptionSummation(String timeType) { try { // String modelcode = "Composite_Indicators"; String modelcode = "COMPREHENSIVE_CODE"; return AjaxResult.success(homepageService.energyConsumptionSummation(timeType,modelcode)); } catch (Exception ex) { logger.error("è·ååºéï¼", ex); return AjaxResult.error("è·ååºé!"); } } /** * @description: å ¨åè½èç»è®¡ */ @GetMapping("/energyConsumptionSummation") public AjaxResult energyConsumptionSummation(String timeType) { try { String modelcode = "COMPREHENSIVE_CODE"; return AjaxResult.success(homepageService.energyConsumptionSummation(timeType, modelcode)); } catch (Exception ex) { logger.error("è·ååºéï¼", ex); return AjaxResult.error("è·ååºé!"); } } /** * @description: è½èè¶å¿ * @param timeType * @return * @author: hmj * @date: 2024/10/8 13:41 */ @@ -56,7 +50,7 @@ public AjaxResult energyConsumptionTrend(String timeType) { try { String modelcode = "COMPREHENSIVE_CODE"; HomeEnergyConsumptionTrendVO vo = homepageService.energyConsumptionTrend(timeType,modelcode); HomeEnergyConsumptionTrendVO vo = homepageService.energyConsumptionTrend(timeType, modelcode); return AjaxResult.success(vo); } catch (Exception ex) { @@ -67,8 +61,6 @@ /** * @description: ç§å®¤è½èæå * @param timeType * @return * @author: hmj * @date: 2024/10/8 13:41 */ @@ -76,7 +68,7 @@ public AjaxResult energyConsumptionRanking(String timeType) { try { String modelcode = "COMPREHENSIVE_CODE"; List<RankingEnergyData> consumptionAnalysisVO = homepageService.energyConsumptionRanking(modelcode,timeType); List<RankingEnergyData> consumptionAnalysisVO = homepageService.energyConsumptionRanking(modelcode, timeType); return AjaxResult.success(consumptionAnalysisVO); } catch (Exception ex) { logger.error("è·ååºéï¼", ex); @@ -86,17 +78,14 @@ /** * @description: å³°å¹³è°·å æ¯ * @param timeType * @return * @author: hmj * @date: 2024/10/8 13:41 */ @GetMapping("/peakValley") public AjaxResult peakValley(String timeType) { try { // String modelcode = "Composite_Indicators"; String modelcode = "COMPREHENSIVE_CODE"; List<HomePeakValleyVO> vo = homepageService.peakValley(timeType,modelcode); List<HomePeakValleyVO> vo = homepageService.peakValley(timeType, modelcode); return AjaxResult.success(vo); } catch (Exception ex) { logger.error("è·ååºéï¼", ex); zhitan-system/src/main/java/com/zhitan/knowledgeBase/domain/vo/KnowledgeBaseDetailVO.java
@@ -1,5 +1,7 @@ package com.zhitan.knowledgeBase.domain.vo; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -17,6 +19,7 @@ * id */ @ApiModelProperty(value = "id") @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * æ é¢ zhitan-system/src/main/java/com/zhitan/knowledgeBase/domain/vo/KnowledgeBasePageVO.java
@@ -1,5 +1,8 @@ package com.zhitan.knowledgeBase.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; /** @@ -11,6 +14,7 @@ /** * id */ @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * æ é¢ @@ -31,5 +35,6 @@ /** * å建æ¶é´ */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String createTime; } zhitan-system/src/main/java/com/zhitan/knowledgeBase/service/impl/KnowledgeBaseServiceImpl.java
@@ -48,12 +48,14 @@ // å页æ¥è¯¢ Page<KnowledgeBase> knowledgeBasePage = baseMapper.selectPage(new Page<>(pageDTO.getPageNum(), pageDTO.getPageSize()), Wrappers.<KnowledgeBase>lambdaQuery() .select(KnowledgeBase::getId, KnowledgeBase::getTitle, KnowledgeBase::getType, KnowledgeBase::getContent, KnowledgeBase::getCreateTime) .like(ObjectUtils.isNotEmpty(pageDTO.getTitle()), KnowledgeBase::getTitle, pageDTO.getTitle()) .eq(ObjectUtils.isNotEmpty(pageDTO.getType()), KnowledgeBase::getType, pageDTO.getType()) .eq(KnowledgeBase::getDelFlag, false).orderByDesc(KnowledgeBase::getCreateTime)); List<KnowledgeBase> records = knowledgeBasePage.getRecords(); if (records.isEmpty()){ if (records.isEmpty()) { return voPage; } // æ°æ®è½¬æ¢ @@ -75,12 +77,12 @@ // æ¥è¯¢æ°æ® KnowledgeBase knowledgeBase = baseMapper.selectById(id); if (knowledgeBase != null){ if (knowledgeBase != null) { // æ°æ®è½¬æ¢ BeanUtil.copyProperties(knowledgeBase, vo); vo.setUrl(fileMapper.selectList(Wrappers.<KnowledgeBaseFile>lambdaQuery() .select(KnowledgeBaseFile::getUrl) .eq(KnowledgeBaseFile::getKnowledgeBaseId, id)) .select(KnowledgeBaseFile::getUrl) .eq(KnowledgeBaseFile::getKnowledgeBaseId, id)) .stream().map(KnowledgeBaseFile::getUrl).collect(Collectors.toList())); } return vo; @@ -97,8 +99,8 @@ baseMapper.insert(knowledgeBase); // æå ¥æä»¶ if (ObjectUtils.isNotEmpty(addDTO.getUrl())){ addDTO.getUrl().forEach(url->{ if (ObjectUtils.isNotEmpty(addDTO.getUrl())) { addDTO.getUrl().forEach(url -> { KnowledgeBaseFile file = new KnowledgeBaseFile(); file.setKnowledgeBaseId(knowledgeBase.getId()); file.setUrl(url); @@ -114,7 +116,7 @@ public void edit(KnowledgeBaseEditDTO editDTO) { // æ¥è¯¢æ°æ® KnowledgeBase knowledgeBase = baseMapper.selectById(editDTO.getId()); if (ObjectUtils.isEmpty(knowledgeBase)){ if (ObjectUtils.isEmpty(knowledgeBase)) { throw new ServiceException(MessageConstant.KNOWLEDGE_BASE_NOT_EXIST); } // æ´æ°æ°æ® @@ -126,8 +128,8 @@ .eq(KnowledgeBaseFile::getKnowledgeBaseId, knowledgeBase.getId())); // æå ¥æä»¶ if (ObjectUtils.isNotEmpty(editDTO.getUrl())){ editDTO.getUrl().forEach(url->{ if (ObjectUtils.isNotEmpty(editDTO.getUrl())) { editDTO.getUrl().forEach(url -> { KnowledgeBaseFile file = new KnowledgeBaseFile(); file.setKnowledgeBaseId(knowledgeBase.getId()); file.setUrl(url); @@ -143,7 +145,7 @@ public void delete(Long id) { // æ¥è¯¢æ°æ® KnowledgeBase knowledgeBase = baseMapper.selectById(id); if (ObjectUtils.isEmpty(knowledgeBase)){ if (ObjectUtils.isEmpty(knowledgeBase)) { throw new ServiceException(MessageConstant.KNOWLEDGE_BASE_NOT_EXIST); } // å 餿°æ® zhitan-vue/src/api/policy/knowledgeBase.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,48 @@ import request from '@/utils/request' // è·åå表 export function knowledgeBaseList(params) { return request({ url: '/knowledgeBase/page', method: 'get', params }) } // æ°å¢ export function knowledgeBaseAdd(data) { return request({ url: '/knowledgeBase/add', method: 'post', data }) } // æ¥è¯¦æ export function knowledgeBaseInfo(params) { return request({ url: `/knowledgeBase/detail/${params.id}`, method: 'get', params }) } // ç¼è¾ export function knowledgeBaseEdit(data) { return request({ url: '/knowledgeBase/edit', method: 'post', data }) } //å é¤ export function knowledgeBaseDel(id) { return request({ url: '/knowledgeBase/delete/' + id, method: 'delete', }) } zhitan-vue/src/components/FileUpload/index.vue
@@ -40,7 +40,6 @@ <script setup> import { getToken } from "@/utils/auth"; const props = defineProps({ modelValue: [String, Object, Array], // æ°ééå¶ zhitan-vue/src/views/login.vue
@@ -21,6 +21,7 @@ size="large" auto-complete="off" placeholder="å¯ç " show-password @keyup.enter="handleLogin" > <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> zhitan-vue/src/views/policy/knowledgebase/components/EditModal.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,104 @@ <template> <el-dialog v-model="visible" :title="title" width="600" @close="handleClose"> <el-form :model="form" ref="queryRef" :rules="formRules" label-width="100px" v-loading="loading"> <el-form-item label="æ é¢" prop="title"> <el-input v-model="form.title" placeholder="请è¾å ¥æ é¢" /> </el-form-item> <el-form-item label="è½æºç±»å" prop="type"> <el-select v-model="form.type" placeholder="è¯·éæ©" style="width: 100%;"> <el-option v-for="(item, index) in props.types" :key="index" :label="item.label" :value="item.value"> </el-option> </el-select> </el-form-item> <el-form-item label="å 容" prop="content"> <el-input v-model="form.content" placeholder="请è¾å ¥å 容" /> </el-form-item> <!-- <el-form-item label="éä»¶" prop="url"> <FileUpload></FileUpload> </el-form-item> --> </el-form> <div slot="footer" class="text-right"> <el-button type="primary" @click="submitForm" :loading="loading">ç¡® å®</el-button> <el-button @click="handleClose">å æ¶</el-button> </div> </el-dialog> </template> <script setup> import { knowledgeBaseAdd, knowledgeBaseEdit } from '@/api/policy/knowledgeBase' const { proxy } = getCurrentInstance(); let props = defineProps(['types']) let visible = ref(false) let title = ref('') let loading = ref(false) let form = ref({ title: '', content: '', type: null, url:[] }) let emit = defineEmits(['getList']) const formRules = { title: [{ required: true, trigger: "blur", message: "请è¾å ¥æ é¢" }], type: [{ required: true, trigger: "change", message: "è¯·éæ©è½æºç±»å" }], content: [{ required: true, trigger: "blur", message: "请è¾å ¥å 容" }], } function submitForm() { proxy.$refs.queryRef.validate(valid => { if (valid) { loading.value = true; let obj = form.value.id ? knowledgeBaseEdit(form.value) : knowledgeBaseAdd(form.value) obj.then((res) => { if (res.code == 200) { proxy.$modal.msgSuccess(res.msg); emit('getList') } else { proxy.$modal.msgError(res.msg); } }).catch((err) => { }).finally(() => { handleClose() }); } }) } function handleOpen(row) { if (row && row.id) { title.value = "ç¼è¾ç¥è¯åº" form.value = JSON.parse(JSON.stringify(row)) } else { title.value = "æ·»å ç¥è¯åº" } visible.value = true } function handleClose(value) { visible.value = false loading.value = false proxy.$refs.queryRef.resetFields() form.value = { title: '', content: '', type: null, url:[] } } defineExpose({ handleOpen }) </script> <style lang="scss" scoped></style> zhitan-vue/src/views/policy/knowledgebase/knowledgeBase.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,130 @@ <template> <div class="page"> <div class="form-card"> <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> <el-form-item label="æ é¢"> <el-input v-model="queryParams.title" placeholder="请è¾å ¥æ é¢" clearable/> </el-form-item> <el-form-item label="è½æºç±»å"> <el-select v-model="queryParams.type" placeholder="è¯·éæ©è½æºç±»å" style="width: 100%" clearable> <el-option v-for="dict in types" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> <el-form-item> <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> </el-form-item> </el-form> </div> <div class="table-bg-style"> <div class="theme-dark-mt20 mb20 ml20"> <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> <!-- <el-button type="primary" icon="Delete">å é¤</el-button> --> </div> <div class="table-box"> <el-table :data="tableData" v-loading="loading"> <el-table-column prop="title" label="æ é¢" show-overflow-tooltip align="center" /> <el-table-column prop="typeDesc" label="è½æºç±»å" show-overflow-tooltip align="center" /> <el-table-column prop="content" label="å 容" show-overflow-tooltip align="center" /> <el-table-column prop="createTime" label="å建æ¶é´" show-overflow-tooltip align="center" /> <el-table-column label="æä½" width="300" align="center"> <template #default="scope"> <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> ä¿®æ¹ </el-button> <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)"> å é¤ </el-button> </template> </el-table-column> </el-table> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> </div> </div> <edit-modal ref="EditModalRef" @getList="getList" :types="types" /> </div> </template> <script setup> import EditModal from "./components/EditModal.vue" import { knowledgeBaseList, knowledgeBaseDel } from "@/api/policy/knowledgeBase" let { proxy } = getCurrentInstance() const types = ref([ { label: "çµ", value: 0 }, { label: "æ°´", value: 1 }, { label: "å¤©ç¶æ°", value: 2 }, { label: "è¸æ±½", value: 3 }, ]); let loading = ref(false) let total = ref(0) let tableData = ref([]) let queryParams = ref({ title: "", type:null, pageNum: 1, pageSize: 10, }) function getList() { loading.value = true knowledgeBaseList(queryParams.value).then((res) => { console.log(res.rows) tableData.value = res.rows total.value = res.total loading.value = false }) } getList() let EditModalRef = ref("") function handleAdd(row) { if (EditModalRef.value) { EditModalRef.value.handleOpen(row) } } function handleDel(row) { proxy.$modal .confirm("æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?") .then(function () { return knowledgeBaseDel(row.id) }) .then(() => { getList() proxy.$modal.msgSuccess("å 餿å") }) .catch(() => {}) } function handleQuery() { queryParams.value.pageNum = 1 getList() } function resetQuery() { queryParams.value = { title: "", type:null, pageNum: 1, pageSize: 10, } getList() } </script> <style lang="scss" scoped> @import "@/assets/styles/page.scss"; .header-box { :deep .el-form-item__content { color: #fff; font-size: 16px; } } </style>