|
|
@ -12,58 +12,54 @@ |
|
|
|
|
|
|
|
<script lang="ts" setup="true"> |
|
|
|
import { reactive } from 'vue'; |
|
|
|
import { queryPlugins } from '@/apis/plugin'; |
|
|
|
|
|
|
|
const data = reactive({ |
|
|
|
lists: [ |
|
|
|
{ |
|
|
|
id: '1', |
|
|
|
name: '插件名称', |
|
|
|
versions: 'V1.0.0', |
|
|
|
intro: 'In my dual profession as an educator and health care', |
|
|
|
updateTime: '2021年12月20日', |
|
|
|
authorName: '张三', |
|
|
|
preview: 'https://s4.ax1x.com/2022/01/17/7abX3d.png', |
|
|
|
mine: true, |
|
|
|
tags: [ |
|
|
|
{ btnType: 'primary', name: '医疗' }, |
|
|
|
{ btnType: 'success', name: '打卡' }, |
|
|
|
{ btnType: 'warning', name: '签到' }, |
|
|
|
], |
|
|
|
industryName: '数字医疗', |
|
|
|
sortName: '医疗', |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '2', |
|
|
|
name: '插件名称', |
|
|
|
versions: 'V1.0.0', |
|
|
|
intro: 'In my dual profession as an educator and health care', |
|
|
|
updateTime: '2021年12月20日', |
|
|
|
authorName: '张三', |
|
|
|
preview: 'https://s4.ax1x.com/2022/01/17/7abX3d.png', |
|
|
|
mine: true, |
|
|
|
tags: [ |
|
|
|
{ btnType: 'primary', name: '医疗' }, |
|
|
|
{ btnType: 'success', name: '打卡' }, |
|
|
|
{ btnType: 'warning', name: '签到' }, |
|
|
|
], |
|
|
|
industryName: '数字医疗', |
|
|
|
sortName: '医疗', |
|
|
|
}, |
|
|
|
], |
|
|
|
lists: [], |
|
|
|
currentPage: 1, |
|
|
|
pageSize: 10, |
|
|
|
total: 55, |
|
|
|
total: 0, |
|
|
|
}); |
|
|
|
|
|
|
|
function handleSizeChange(val) { |
|
|
|
console.log(val); |
|
|
|
data.pageSize = val; |
|
|
|
handleQueryPlugins(); |
|
|
|
} |
|
|
|
|
|
|
|
function handleCurrentChange(val) { |
|
|
|
console.log(val); |
|
|
|
data.currentPage = val; |
|
|
|
handleQueryPlugins(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询插件列表 |
|
|
|
* @param {number} depth 查询深度 0则只查名称,1则查询全部 |
|
|
|
* @param {number} name 插件名称,为空则不实用该条件 |
|
|
|
* @param {number} pageNum 第几页 |
|
|
|
* @param {number} pageSize 每页几条信息 |
|
|
|
*/ |
|
|
|
async function handleQueryPlugins() { |
|
|
|
try { |
|
|
|
const { currentPage, pageSize } = data; |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
depth: 1, |
|
|
|
name: '', |
|
|
|
pageNum: currentPage, |
|
|
|
pageSize, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await queryPlugins(params); |
|
|
|
data.lists = res.list; |
|
|
|
data.currentPage = res.pageNum - 0; |
|
|
|
data.pageSize = res.pageSize - 0; |
|
|
|
data.total = res.total - 0; |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
handleQueryPlugins(); |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped></style> |
|
|
|