|
@@ -1,9 +1,9 @@
|
|
|
-import { getAlgoInfo, searchAlgoInfo, algoInfoModify } from '@/api/algo/algo';
|
|
|
|
|
|
|
+import { queryAlgoInfoPage, updateAlgoInfo, Records } from '@/api/algo/algo';
|
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
|
|
|
export function useAlgo() {
|
|
export function useAlgo() {
|
|
|
- const algoList = ref([]);
|
|
|
|
|
|
|
+ const algoList = ref<Records[]>();
|
|
|
const page = ref(1);
|
|
const page = ref(1);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const pageSize = ref(12);
|
|
const pageSize = ref(12);
|
|
@@ -14,20 +14,28 @@ export function useAlgo() {
|
|
|
const pushStatement = ref('');
|
|
const pushStatement = ref('');
|
|
|
|
|
|
|
|
const getAlgoDatas = () => {
|
|
const getAlgoDatas = () => {
|
|
|
- return getAlgoInfo(page.value, pageSize.value).then((res) => {
|
|
|
|
|
|
|
+ return queryAlgoInfoPage({ pageNumber: page.value, pageSize: pageSize.value }).then((res) => {
|
|
|
algoList.value = res.records;
|
|
algoList.value = res.records;
|
|
|
total.value = res.totalRow;
|
|
total.value = res.totalRow;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const searchAlgoDatas = () => {
|
|
const searchAlgoDatas = () => {
|
|
|
- return searchAlgoInfo(page.value, keyWord.value).then((res) => {
|
|
|
|
|
|
|
+ return queryAlgoInfoPage({
|
|
|
|
|
+ pageNumber: page.value,
|
|
|
|
|
+ pageSize: pageSize.value,
|
|
|
|
|
+ queryParam: { name: keyWord.value },
|
|
|
|
|
+ }).then((res) => {
|
|
|
algoList.value = res.records;
|
|
algoList.value = res.records;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const modifyAlgoDatas = () => {
|
|
const modifyAlgoDatas = () => {
|
|
|
- return algoInfoModify(algoId.value, pushLinkPrompt.value, pushStatement.value)
|
|
|
|
|
|
|
+ return updateAlgoInfo({
|
|
|
|
|
+ id: algoId.value,
|
|
|
|
|
+ pushStatement: pushLinkPrompt.value,
|
|
|
|
|
+ pushLinkPrompt: pushStatement.value,
|
|
|
|
|
+ })
|
|
|
.then(function () {
|
|
.then(function () {
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
message: '算法数据保存成功',
|
|
message: '算法数据保存成功',
|