|
|
|
@ -86,7 +86,7 @@ const columns: TableColumnList = [
|
|
|
|
|
function handleDelete(row) {
|
|
|
|
|
// message(`您删除了角色名称为${row.name}的这条数据`, { type: "success" });
|
|
|
|
|
// onSearch();
|
|
|
|
|
console.log(row);
|
|
|
|
|
// console.log(row);
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
"确定删除这个算法吗,删除后将无法找回,请谨慎操作",
|
|
|
|
|
"确定删除这个算法吗?",
|
|
|
|
@ -116,23 +116,26 @@ function handleDelete(row) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function searchValue() {
|
|
|
|
|
dataStaticList.value = dataStaticList.value.filter(function (val) {
|
|
|
|
|
return val.type == algorithmValue.value; // 过滤掉前台传过来的id对应的相应数据,并重新返回
|
|
|
|
|
});
|
|
|
|
|
// dataStaticList.value = dataStaticList.value.filter(function (val) {
|
|
|
|
|
// return val.industry == typeValue.value; // 过滤掉前台传过来的id对应的相应数据,并重新返回
|
|
|
|
|
// });
|
|
|
|
|
// dataStaticList.value = dataStaticList.value.filter(function (val) {
|
|
|
|
|
// return val.function == defectValue.value; // 过滤掉前台传过来的id对应的相应数据,并重新返回
|
|
|
|
|
// });
|
|
|
|
|
console.log(dataStaticList.value);
|
|
|
|
|
const list = getPagedData(
|
|
|
|
|
dataStaticList.value,
|
|
|
|
|
pagination.currentPage,
|
|
|
|
|
pagination.pageSize
|
|
|
|
|
);
|
|
|
|
|
const data = dataStaticList.value
|
|
|
|
|
.filter(v =>
|
|
|
|
|
v.type.toLowerCase().includes(algorithmValue.value.toLowerCase())
|
|
|
|
|
)
|
|
|
|
|
.filter(v =>
|
|
|
|
|
v.industry.toLowerCase().includes(typeValue.value.toLowerCase())
|
|
|
|
|
)
|
|
|
|
|
.filter(v =>
|
|
|
|
|
v.function.toLowerCase().includes(defectValue.value.toLowerCase())
|
|
|
|
|
);
|
|
|
|
|
const list = getPagedData(data, pagination.currentPage, pagination.pageSize);
|
|
|
|
|
dataList.value = list.data;
|
|
|
|
|
pagination.total = dataStaticList.value.length;
|
|
|
|
|
pagination.total = data.length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleRefresh() {
|
|
|
|
|
algorithmValue.value = "";
|
|
|
|
|
typeValue.value = "";
|
|
|
|
|
defectValue.value = "";
|
|
|
|
|
searchValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleSizeChange(val: number) {
|
|
|
|
@ -152,7 +155,7 @@ function handleSelectionChange(val) {
|
|
|
|
|
async function onSearch(page = 1, size = 15) {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const { data } = await getAlgorithmList();
|
|
|
|
|
console.log(data);
|
|
|
|
|
// console.log(data);
|
|
|
|
|
// productList.value = data.list;
|
|
|
|
|
// pagination.value = {
|
|
|
|
|
// ...pagination.value,
|
|
|
|
@ -160,7 +163,7 @@ async function onSearch(page = 1, size = 15) {
|
|
|
|
|
// };
|
|
|
|
|
dataStaticList.value = data.list;
|
|
|
|
|
const list = getPagedData(data.list, page, size);
|
|
|
|
|
console.log(list);
|
|
|
|
|
// console.log(list);
|
|
|
|
|
dataList.value = list.data;
|
|
|
|
|
pagination.total = data.list.length;
|
|
|
|
|
// pagination.pageSize = data.pageSize;
|
|
|
|
@ -184,7 +187,7 @@ const typeValue = ref("");
|
|
|
|
|
const defectValue = ref("");
|
|
|
|
|
const options = [
|
|
|
|
|
{
|
|
|
|
|
value: "全部",
|
|
|
|
|
value: "",
|
|
|
|
|
label: "全部"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -198,11 +201,11 @@ const options = [
|
|
|
|
|
];
|
|
|
|
|
const optionsB = [
|
|
|
|
|
{
|
|
|
|
|
value: "全部",
|
|
|
|
|
value: "",
|
|
|
|
|
label: "全部"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: "通用类",
|
|
|
|
|
value: "通用",
|
|
|
|
|
label: "通用类"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -220,7 +223,7 @@ const optionsB = [
|
|
|
|
|
];
|
|
|
|
|
const optionsC = [
|
|
|
|
|
{
|
|
|
|
|
value: "全部",
|
|
|
|
|
value: "",
|
|
|
|
|
label: "全部"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -286,101 +289,101 @@ const formDialogVisible = ref(false);
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-empty>
|
|
|
|
|
</el-card>
|
|
|
|
|
<template v-if="pagination.total > 0">
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="font-bold">苏胜天算法库</span
|
|
|
|
|
><span class="font-bold">({{ pagination.total }})</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="w-full flex justify-stretch mb-4">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="algorithmValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择算法"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="typeValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
<!-- <template v-if="pagination.total > 0"> -->
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="font-bold">苏胜天算法库</span
|
|
|
|
|
><span class="font-bold">({{ pagination.total }})</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="w-full flex justify-stretch mb-4">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="algorithmValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择算法"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="typeValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in optionsB"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="defectValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in optionsC"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button type="primary" color="#1C0D82" @click="searchValue()">
|
|
|
|
|
查询
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="" @click="handleRefresh()"> 重置 </el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<pure-table
|
|
|
|
|
align-whole="left"
|
|
|
|
|
showOverflowTooltip
|
|
|
|
|
table-layout="auto"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
adaptive
|
|
|
|
|
:data="dataList"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:pagination="pagination"
|
|
|
|
|
:paginationSmall="false"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
background: 'var(--el-table-row-hover-bg-color)',
|
|
|
|
|
color: 'var(--el-text-color-primary)'
|
|
|
|
|
}"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
@page-size-change="handleSizeChange"
|
|
|
|
|
@page-current-change="handleCurrentChange"
|
|
|
|
|
>
|
|
|
|
|
<template #name="{ row }">
|
|
|
|
|
<span class="mr-2">{{ row.name }}</span>
|
|
|
|
|
<el-tag
|
|
|
|
|
class="mx-1"
|
|
|
|
|
:class="row.type == '经典算法' ? 'tagStyle' : 'tagDeepStyle'"
|
|
|
|
|
:type="row.type == '经典算法' ? '' : ''"
|
|
|
|
|
effect="plain"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in optionsB"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="defectValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="mr-3"
|
|
|
|
|
{{ row.type }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
<el-button
|
|
|
|
|
class="reset-margin"
|
|
|
|
|
link
|
|
|
|
|
text
|
|
|
|
|
@click="handleDelete(row)"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in optionsC"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button type="primary" color="#1C0D82" @click="searchValue()">
|
|
|
|
|
查询
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type=""> 重置 </el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<pure-table
|
|
|
|
|
align-whole="left"
|
|
|
|
|
showOverflowTooltip
|
|
|
|
|
table-layout="auto"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
adaptive
|
|
|
|
|
:data="dataList"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:pagination="pagination"
|
|
|
|
|
:paginationSmall="false"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
background: 'var(--el-table-row-hover-bg-color)',
|
|
|
|
|
color: 'var(--el-text-color-primary)'
|
|
|
|
|
}"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
@page-size-change="handleSizeChange"
|
|
|
|
|
@page-current-change="handleCurrentChange"
|
|
|
|
|
>
|
|
|
|
|
<template #name="{ row }">
|
|
|
|
|
<span class="mr-2">{{ row.name }}</span>
|
|
|
|
|
<el-tag
|
|
|
|
|
class="mx-1"
|
|
|
|
|
:class="row.type == '经典算法' ? 'tagStyle' : 'tagDeepStyle'"
|
|
|
|
|
:type="row.type == '经典算法' ? '' : ''"
|
|
|
|
|
effect="plain"
|
|
|
|
|
>
|
|
|
|
|
{{ row.type }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
<el-button
|
|
|
|
|
class="reset-margin"
|
|
|
|
|
link
|
|
|
|
|
text
|
|
|
|
|
@click="handleDelete(row)"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</pure-table>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</pure-table>
|
|
|
|
|
</el-card>
|
|
|
|
|
<!-- </template> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|