Compare commits

..

No commits in common. "master" and "Branch_cjh" have entirely different histories.

13 changed files with 347 additions and 267 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -4,7 +4,6 @@
/* 设置所有对话框的header颜色固定 */ /* 设置所有对话框的header颜色固定 */
.el-dialog__header{ .el-dialog__header{
background-color: #158484; background-color: #158484;
color:white;
font-size: 28px; font-size: 28px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -23,7 +22,6 @@
padding: 0; padding: 0;
background-color: #f5f6fa; background-color: #f5f6fa;
margin: 0; margin: 0;
border-radius: 12px;
} }
.el-dialog__footer{ .el-dialog__footer{
background-color: white; background-color: white;

View File

@ -28,10 +28,10 @@
@date: 2024年6月29日 @date: 2024年6月29日
@author: myz @author: myz
--> -->
<!-- <el-menu-item index="/test"> <el-menu-item index="/test">
<el-icon><View /></el-icon> <el-icon><View /></el-icon>
<span v-show = '!isFold'>测试专用</span> <span v-show = '!isFold'>测试专用</span>
</el-menu-item> --> </el-menu-item>
</el-menu> </el-menu>
</el-container> </el-container>
</template> </template>
@ -70,7 +70,7 @@ export default{
<style scoped> <style scoped>
.containerSystemName{ .containerSystemName{
color:white; /**字体颜色为白色 */ color:white; /**字体颜色为白色 */
background-color: #1aa4a4; /*容器背景颜色*/ background-color: #158484; /* 容器背景颜色 */
display: flex; display: flex;
justify-content: center; /**水平居中 */ justify-content: center; /**水平居中 */
align-items: center; /**竖直居中 */ align-items: center; /**竖直居中 */
@ -86,7 +86,7 @@ export default{
color:white color:white
} }
.text-systemName{ .text-systemName{
background-color: transparent; background-color: #158484; /* 容器背景颜色 */
display: flex; display: flex;
/**竖直居中 */ /**竖直居中 */
align-items: center; align-items: center;
@ -97,8 +97,7 @@ export default{
} }
.containerSelections{ .containerSelections{
color: white; color: white;
/* background-color: #1DAFAF; */ background-color: #1DAFAF;
@apply bg-gradient-to-tr from-cyan-400 to-teal-500;
height: 94%; height: 94%;
width:100%; width:100%;
border:0px; border:0px;

View File

@ -30,7 +30,7 @@
<el-select v-model = 'form.logic' style="width: 60%;"> <el-select v-model = 'form.logic' style="width: 60%;">
<el-option label = 'AND 逻辑与' value = 'AND' /> <el-option label = 'AND 逻辑与' value = 'AND' />
<el-option label = 'OR 逻辑或' value = 'OR' /> <el-option label = 'OR 逻辑或' value = 'OR' />
<el-option label = 'NOR 逻辑非' value = 'NOR' />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 约束列 --> <!-- 约束列 -->

View File

@ -2,9 +2,9 @@
<!-- 父组件:HomePage --> <!-- 父组件:HomePage -->
<div class="card-container"> <div class="card-container">
<!-- PS: 网络版本将替换'tableData' 'cluesTableData' --> <!-- PS: 网络版本将替换'tableData' 'cluesTableData' -->
<el-card v-for="(item, index) in cluesTableData" :key="index" class="card-item"> <el-card v-for="(item, index) in tableData" :key="index" class="card-item">
<div class="card-content"> <div class="card-content">
<h2 id = 'cdbID' class = 'font-bold text-xl'>线索库唯一标识:{{ item.id }}</h2> <h2 id = 'cdbID' class = 'font-bold'>线索库唯一标识:{{ item.clue_id }}</h2>
<h1 id = 'cdbName'>线索库名:{{ item.name }}</h1> <h1 id = 'cdbName'>线索库名:{{ item.name }}</h1>
<el-button size="small" round @click="watchClue(item)"> <el-button size="small" round @click="watchClue(item)">
查看 查看
@ -77,9 +77,6 @@
this.$handleNetError(error); this.$handleNetError(error);
}); });
} }
},
computed:{
}, },
// //
beforeMount() { beforeMount() {

View File

@ -16,7 +16,7 @@
</div> </div>
<div class="demo-select"> <div class="demo-select">
<div class="block"> <div class="block">
<span class="demonstration">选择线索指定日期列</span> <span class="demonstration">选择线索起始日期列</span>
<el-select v-model="selectedrow" placeholder="请选择列名"> <el-select v-model="selectedrow" placeholder="请选择列名">
<el-option <el-option
v-for="row in rowOptions" v-for="row in rowOptions"

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="demo-select"> <div class="demo-select">
<div class="block"> <div class="block">
<span class="demonstration">选择起始日期</span> <span class="demonstration">选择起始</span>
<el-select v-model="selectedrow" placeholder="请选择列名"> <el-select v-model="selectedrow" placeholder="请选择列名">
<el-option <el-option
v-for="row in rowOptions" v-for="row in rowOptions"
@ -27,7 +27,7 @@
</div> </div>
<div class="demo-select"> <div class="demo-select">
<div class="block"> <div class="block">
<span class="demonstration">选择截止日期</span> <span class="demonstration">选择截止</span>
<el-select v-model="selectedrow2" placeholder="请选择列名"> <el-select v-model="selectedrow2" placeholder="请选择列名">
<el-option <el-option
v-for="row in rowOptions2" v-for="row in rowOptions2"

View File

@ -33,7 +33,7 @@ const routes: Array<RouteRecordRaw> = [
{ {
path: '/test', path: '/test',
name: 'test', name: 'test',
component: ()=>import('@/views/ShowGraph.vue') component: ()=>import('@/views/newHomePage.vue')
} }
] ]
} }

View File

@ -11,7 +11,7 @@
<el-main class ='container_Tools_Main'> <el-main class ='container_Tools_Main'>
<el-header class ='containerTools'> <el-header class ='containerTools'>
<!-- 模式切换按钮 --> <!-- 模式切换按钮 -->
<el-button class = 'btnDelete' @click="deleteSelected"> <el-button class = 'btnDelete'>
<el-tooltip content = '批量删除'> <el-tooltip content = '批量删除'>
<el-icon><Delete /></el-icon> <el-icon><Delete /></el-icon>
</el-tooltip> </el-tooltip>
@ -180,7 +180,9 @@ export default{
searchDialogVisible : false, searchDialogVisible : false,
// //
"Constraints":[ "Constraints":[
{"merge":"AND","col_id":"3","type":"double","down":"0","up":"INF","inside":"","date":""}, // 1_30
{"merge":"AND","col_id":"2","type":"date","down":"","up":"","inside":"","date":"03.06.2024,30.06.2024"}, // !_22024/1/1
{"merge":"OR","col_id":"4","type":"string","down":"","up":"","inside":"AAA","date":""} // 1_4(),AAA
], ],
pageTitle, // /线 pageTitle, // /线
clueId, // 线ID clueId, // 线ID
@ -350,49 +352,6 @@ export default{
this.$handleNetError(error); this.$handleNetError(error);
}); });
}, },
async deleteSelected(){
//
if(this.selectedColumnData.length == 0){
this.$message({
type: 'warning',
message: '请选择要删除的线索'
});
return;
}
//
const deleteItems = this.selectedColumnData.map(item=>({
table_id: this.clueId,
clue_id: item.clue_id
}));
let flag = true;
try{
for(let i = 0; i < deleteItems.length; i++){
let response = await this.$axios.post('http://localhost:8000/delClue/', deleteItems[i]);
if(response.data.message == "删除失败"){
flag = false;
this.$message({
type:'error',
message:'删除失败,请重试!'
});
}
}
}catch(error){
flag = false;
this.$handleNetError(error);
}
if(flag){
this.$message({
type: 'success',
message: '删除成功,即将刷新界面'
});
//
location.reload();
}
},
// 线 // 线
editClue(row){ editClue(row){
let editDataID = { let editDataID = {
@ -453,10 +412,6 @@ export default{
console.log(newv); console.log(newv);
}, },
}, },
beforeMount(){
this.getClueCols();
this.getClueData();
}
}; };
</script> </script>

View File

@ -18,10 +18,9 @@
</el-button> </el-button>
<el-dialog <el-dialog
v-model="dialogVisible" v-model="dialogVisible"
title="上传文档"
width="500" width="500"
align-center align-center
style = 'border-radius: 20px; color:white;'
:show-close = 'false'
> >
<div> <div>
<el-upload <el-upload

View File

@ -1,110 +1,137 @@
// Variable overrides first
$primary: #900;
$enable-shadows: true;
$prefix: "mo-";
// Then import Bootstrap
@import "../node_modules/bootstrap/scss/bootstrap";
import * as echarts from 'echarts';
<template> <template>
<el-container class = 'h-full bg-blue-100'> <el-header class = 'containerHead'>
<el-header class = 'containerHead'>
<HeaderPage :pageTitle = 'pageTitle'></HeaderPage> <HeaderPage :pageTitle = 'pageTitle'></HeaderPage>
<el-button class = 'btnReturnHomePage' @click="returnHome"> <el-button class = 'btnReturnHomePage' @click="returnHome">
<el-tooltip content = '返回上一级'> <el-tooltip content = '返回首页'>
<el-icon><Back /></el-icon> <el-icon><ArrowLeft /></el-icon>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
</el-header> </el-header>
<el-container id = "containerMain"> <el-container>
<div class="left-grid"> <div class="container">
<el-card class = 'h-full w-full'> <div class="left-grid">
<!-- 选项栏 --> <el-card>
<div class="navbar bg-white flex justify-center pt-0">
<span class="text-2xl font-bold pt-0">绘图选项</span>
</div>
<!-- 多元素多性质比较项 -->
<div class = 'rounded-3xl bg-slate-100 shadow-md flex justify-between items-center font-bold pr-7'>
<el-switch <el-switch
v-model="OpenSelected" v-model="OpenSelected"
class="ml-2 " class="ml-2"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
/> />
<p6 v-show= OpenSelected>启用多属性值比较</p6> <p6 v-show= OpenSelected>启用多元素/多性质比较</p6>
<p6 v-show= !OpenSelected>禁用多属性值比较</p6> <p6 v-show= !OpenSelected>禁用多元素/多性质比较</p6>
</div> <el-select v-model="Selectedcol" placeholder="Select" style="width: 240px" v-show="OpenSelected">
<!-- 选择栏 --> <el-option
<el-select v-model="Selectedcol" placeholder="输入指定的属性" style="width: 100%; margin-top: 2%; margin-bottom: 2%" v-show="OpenSelected"> v-for="(item,index) in mycolumns"
<el-option :key="index"
v-for="(item,index) in mycolumns" :label="item.label"
:key="index" :value="item.prop"
:label="item.label" />
:value="item.prop" </el-select>
/>
</el-select>
<div v-show = OpenSelected> <div v-show = OpenSelected>
<div> <div>
<div style="max-width: 600px; display: flex; flex-direction: row; align-items: center; margin-bottom: 10px;" v-for="(i, index) in SelectedName" :key="index"> <div style="max-width: 600px; display: flex; flex-direction: row; align-items: center; margin-bottom: 10px;" v-for="(i, index) in SelectedName" :key="index">
<el-alert :title="`已选中:${i}`" type="success" :closable="false" style="margin-right: 10px;"></el-alert> <el-alert :title="`已选中:${i}`" type="success" :closable="false" style="margin-right: 10px;"></el-alert>
<button class = 'bg-red-400 text-white w-20 rounded:' plain @click="deleteSelected(index)">删除</button> <el-button type="success" plain @click="deleteSelected(index)">删除</el-button>
</div> </div>
</div> </div>
<div> <div>
<el-input <el-input
v-model="SelectNowName" v-model="SelectNowName"
style="width: 100%; margin-bottom: 2%" style="width: 240px"
placeholder="输入需要统计的属性值" placeholder="输入需要选择的实体名称"
clearable clearable
/> />
<button class="btn btn-accent w-full text-white" @click="AddSelectedName">确定</button> <el-button type="primary" @click="AddSelectedName">确定</el-button>
</div> </div>
</div> </div>
<el-divider /> <el-divider />
<div class = 'w-full'>
<el-form class = 'w-full'> <el-row>
<div class="demo-select"> <el-form>
<!-- 选项栏 --> <div class="demo-select">
<div class="navbar bg-white flex justify-center pt-0"> <div class="block">
<span class="text-2xl font-bold pt-0">数据可视化类型</span> <span class="demonstration">数据可视化</span>
<el-select v-model="selectedEntity" placeholder="选择生成的表格类型" style="width: 400px">
<el-option
v-for="entity in entityOptions"
:key="entity.value"
:label="entity.label"
:value="entity.value"
></el-option>
</el-select>
</div>
</div> </div>
<el-select v-model="selectedEntity" placeholder="选择生成的表格类型" style="width: 400px; margin-bottom: 2%;"> <!-- 动态输入组件 -->
<el-option <component
v-for="entity in entityOptions" :is="currentComponent"
:key="entity.value" ref="dynamicComponent"
:label="entity.label" @change="handlerow"
:value="entity.value" @update:selectedEntity="handleSelectedEntity"
></el-option> @update:selectedrow="handleSelectedRow"
</el-select> @update:selectedChartType="handleSelectedChartType"
</div> @update:selectedrow2="handleSelectedRow2"
<!-- 动态输入组件 --> @update:selectedrow3="handleSelectedRow3"
<component @update:selectedcul1="handleUpdateSelectedCul"
:is="currentComponent" @update:selectedcul2="handleUpdateSelectedCul"
ref="dynamicComponent" @update:selectedcul3="handleUpdateSelectedCul"
@change="handlerow" :rowOptions="convertedColumns"
@update:selectedEntity="handleSelectedEntity" :rowOptions2="convertedColumns"
@update:selectedrow="handleSelectedRow" :Message1="SendOpenSelected"
@update:selectedChartType="handleSelectedChartType" :Message2="SendOpenSelected"
@update:selectedrow2="handleSelectedRow2" :Message3="SendOpenSelected"
@update:selectedrow3="handleSelectedRow3" :Message4="SendOpenSelected"
@update:selectedcul1="handleUpdateSelectedCul" >
@update:selectedcul2="handleUpdateSelectedCul" </component>
@update:selectedcul3="handleUpdateSelectedCul" <!-- <el-card v-if="entity">
:rowOptions="convertedColumns" <el-row>
:rowOptions2="convertedColumns" <el-table
:Message1="SendOpenSelected" :data="columnData"
:Message2="SendOpenSelected" :show-header="true"
:Message3="SendOpenSelected" :max-height="200"
:Message4="SendOpenSelected" @selection-change="handleSelectionChange"
> stripe
</component> >
</el-form> <el-table-column type="selection" width="55" style="background-color: black;"/>
<el-footer class = 'p-0'> <el-table-column
<button class = 'btn text-white w-full btn-accent' @click="handleGenerateChart"> prop="name"
绘图 label="对象"
</button> header-style="background-color: black; color: white;"
</el-footer> style="text-align: center;">
</el-table-column>
</el-table>
</el-row>
</el-card> -->
<el-form-item>
<el-button type="primary" size="medium" @click="handleGenerateChart">
点击生成图表
</el-button>
</el-form-item>
</el-form>
</el-row>
</el-card>
</div> </div>
</el-card> <div class="right-grid" v-if="hasUpperContent">
</div>
<div class="right-grid" v-if="hasUpperContent"> <el-button type="danger" @click="clearchart">取消</el-button>
<button>取消</button> <div ref="chartContainer" class="chart-container"></div>
<div ref="chartContainer" class="chart-container"></div>
</div>
<div class="right-grid" v-else> <div ref="chartContainer" class="chart-container"></div> </div> </div>
<div class="right-grid" v-else> <div ref="chartContainer" class="chart-container"></div> </div>
</div>
</el-container> </el-container>
</el-container>
</template> </template>
<script> <script>
@ -112,6 +139,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import { markRaw } from 'vue'; import { markRaw } from 'vue';
import { useRouter } from 'vue-router';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import Entity1Form from '@/components/graph/Entity1Form.vue'; import Entity1Form from '@/components/graph/Entity1Form.vue';
import Entity2Form from '@/components/graph/Entity2Form.vue'; import Entity2Form from '@/components/graph/Entity2Form.vue';
@ -119,7 +147,8 @@ import Entity3Form from '@/components/graph/Entitu3Form.vue';
import Entity4Form from '@/components/graph/Entity4Form.vue'; import Entity4Form from '@/components/graph/Entity4Form.vue';
// import Entity5Form from '@/components/graph//Entity5Form.vue'; // import Entity5Form from '@/components/graph//Entity5Form.vue';
import HeaderPage from "@/components/HeaderPage.vue"; import HeaderPage from "@/components/HeaderPage.vue";
import { avatarEmits } from 'element-plus';
import AddDialog from '@/components/components_cluespage/AddDialog.vue';
export default { export default {
components: { components: {
@ -127,6 +156,7 @@ export default {
Entity2Form, Entity2Form,
Entity3Form, Entity3Form,
Entity4Form, Entity4Form,
HeaderPage HeaderPage
}, },
props: ['columns','tabledata'], props: ['columns','tabledata'],
@ -137,7 +167,7 @@ export default {
selectedColumnData:Array, selectedColumnData:Array,
xz:[], xz:[],
yz:[], yz:[],
pageTitle:'线索可视化', pageTitle:'图形可视化',
mytable:[], mytable:[],
mycolumns:'', mycolumns:'',
item:[], item:[],
@ -156,24 +186,42 @@ export default {
chartInstance: null ,// chartInstance: null ,//
selectedEntity: '', // selectedEntity: '', //
entityOptions: [ entityOptions: [
{ value: 'entity1', label: '统计某一日期的分布' }, { value: 'entity1', label: '以单一日期存在为横坐标' },
{value:'entity2',label:'统计于某一日期开始,某一日期结束的数量分布'}, {value:'entity2',label:'以两个日期之间存在为横坐标'},
{ value: 'entity3', label: '统计指定间隔的实数分布' }, { value: 'entity3', label: '实数区间为横坐标' },
{ value: 'entity4', label: '统计字符串意义上的分布' }, { value: 'entity4', label: '字符串意义上的完全相同为横坐标' },
], ],
dates: [], dates: [],
SelectedName: [], SelectedName: [],
SelectNowName: ref(''), SelectNowName: ref(''),
OpenSelected: ref(true), OpenSelected: ref(false),
Selectedcol:"", Selectedcol:"",
// //
Selectedcul:[], Selectedcul:[],
}; };
}, },
// watch: {
// mytable: {
// handler(newVal, oldVal) {
// console.log('mytable changed');
// console.log('New Value:', newVal);
// console.log('Old Value:', oldVal);
// // mytable
// },
// deep: true // deeptrue
// }
// },
computed: { computed: {
// entity()
// {
// if (this.selectedEntity=='entity5')
// return 1;
// else
// return 0;
// },
columnData() { columnData() {
if (this.srow) if (this.srow)
{ {
@ -213,8 +261,11 @@ export default {
}, },
created() created()
{ {
//console.log(this.$route.params.tabledata)
this.mytable=JSON.parse(this.$route.params.tabledata); this.mytable=JSON.parse(this.$route.params.tabledata);
this.mycolumns = JSON.parse(this.$route.params.columns); this.mycolumns = JSON.parse(this.$route.params.columns);
// console.log('Parsed columns:', this.mycolumns,this.table);
}, },
methods: { methods: {
isValidDate(year, month, day) { isValidDate(year, month, day) {
@ -249,10 +300,80 @@ export default {
this.SelectNowName = ''; this.SelectNowName = '';
} }
}, },
// handleSelectionChange(selection) {
// // selection
// let obj=selection.map(item=>item.name)
// // console.log(obj)
// this.selectedColumnData =selection.map(item=>item.name)
// // console.log( this.selectedColumnData);
// // console.log(':', selection);
// },
returnHome(){ returnHome(){
window.history.back(); window.history.back();
}, },
// extractThreeColumns(tableData) {
// let extractedData = tableData.map(row => ({
// month: row[this.srow3],
// product: row[this.srow],
// amount: row[this.srow2]
// }));
// return extractedData;
// },
// count_sum_time()
// {
// this.hasUpperContent = true;
// let counts = {};
// let salesData=this.extractThreeColumns(this.mytable);
// // console.log(salesData)
// // counts
// salesData.forEach(record => {
// let { month, product, amount } = record;
// let currentMonth=new Date(month)
// let monthKey1 = currentMonth.getFullYear() + '-' + (currentMonth.getMonth() + 1);
// if (!counts[monthKey1]) {
// counts[monthKey1] = {};
// }
// if ( !counts[monthKey1][product])
// counts[monthKey1][product] = amount;
// else
// counts[monthKey1][product] += amount;
// });
// // counts
// const products = this.selectedColumnData;
// let years = Array.from(new Set(salesData.map(record => new Date(record.month).getFullYear()+ '-' + (new Date(record.month).getMonth() + 1)))).sort();
// // Create the structure similar to 'source'
// let result = [['product', ...years]];
// products.forEach(product => {
// let rowData = [product];
// for (let i = 0; i < years.length; i++) {
// rowData.push(0);
// }
// result.push(rowData);
// });
// products.forEach(product=>
// {
// years.forEach(year => {
// if (counts[year][product])
// result[products.indexOf(product)+1][years.indexOf(year)+1]+=counts[year][product];
// else
// result[products.indexOf(product)+1][years.indexOf(year)+1]+=0;
// });
// }
// )
// // console.log(result)
// return result;
// },
countsumbystring() { countsumbystring() {
// //
this.hasUpperContent = true; this.hasUpperContent = true;
@ -308,6 +429,8 @@ export default {
foundLabel = this.mycolumns[num-1].label; foundLabel = this.mycolumns[num-1].label;
selectname.push(foundLabel) selectname.push(foundLabel)
} }
} }
@ -1533,17 +1656,18 @@ currentDate.setDate(currentDate.getDate()+1);
border-radius: 2%; border-radius: 2%;
padding: 20px; padding: 20px;
height: 100%; height: 100%;
width: 28%;
} }
.right-grid { .right-grid {
background-color: #dcdcdc; background-color: #e9d7df;
border-radius: 2%; border-radius: 2%;
padding: 20px; padding: 20px;
height: 100%; height: 100%;
width: 72%;
border-color: aquamarine;
} }
.chart-container { .chart-container {
width: 90%; width: 90%;
height: 90%; height: 90%;
@ -1582,7 +1706,7 @@ currentDate.setDate(currentDate.getDate()+1);
.containerHead{ .containerHead{
padding:0; padding:0;
height:6%; height:8%;
padding :0; padding :0;
width: 100%; width: 100%;
display:flex; display:flex;
@ -1598,19 +1722,5 @@ currentDate.setDate(currentDate.getDate()+1);
width: 3%; width: 3%;
font-weight: 25px; font-weight: 25px;
} }
.el-button{
background-color: transparent;
margin:2;
padding:2;
border: 0;
color: #0e5858;
font-size: 24px;
}
.el-button:hover{
background-color: rgba(255, 255, 255, 0.7);
}
#containerMain{
background-color: #f5f6fa;
}
</style> </style>

View File

@ -1,10 +1,10 @@
<template> <template>
<div style="background-color: #fff; height: 100vh;"> <div style="background-color: #fff; height: 100vh;">
<el-container style="height: 100%; display: flex; flex-direction: column;"> <el-container style="height: 100%; display: flex; flex-direction: column;">
<el-header class="withrawHeader" style = "height: 6%;"> <el-header class="withrawHeader">
<HeaderPage :pageTitle = 'pageTitle'></HeaderPage> <h1 class="headerText">回收站</h1>
</el-header> </el-header>
<el-main class = 'bg-red-400' style="flex: 1; overflow: auto; background-color: #f5f6fa"> <el-main style="flex: 1; overflow: auto;">
<!-- 工具栏 --> <!-- 工具栏 -->
<el-header class="toolbar" style="padding: 10px;"> <el-header class="toolbar" style="padding: 10px;">
<el-tooltip class="withdrawToolTip" content="撤销对选中线索的删除"> <el-tooltip class="withdrawToolTip" content="撤销对选中线索的删除">
@ -55,11 +55,11 @@
<script> <script>
import axios from 'axios'; import axios from 'axios';
import HeaderPage from "@/components/HeaderPage.vue" // import HeaderPage from "@/components/HeaderPage.vue"
export default { export default {
components:{ components:{
HeaderPage // HeaderPage
}, },
data() { data() {
const clueId = this.$route.params.id; const clueId = this.$route.params.id;
@ -97,7 +97,7 @@ export default {
{ {
return return
} }
this.tableData = res.data; // data this.tableData = res.data.data; // data
}) })
.catch(error => { .catch(error => {
this.$handleNetError(error); // this.$handleNetError(error); //
@ -147,8 +147,8 @@ export default {
}, },
// 线 // 线
deleteClue(row){ deleteClue(row){
if (row.type == "删除表"){ // if (row.type == 0){ //
this.$axios.post('http://localhost:8000/deleteTable/',{table_id:row.table_id}).then(response=>{ this.$axios.post('http:localhosat:8000/deleteTable/',{table_id:row.table_id}).then(response=>{
if(response.data.message == '删除成功'){ if(response.data.message == '删除成功'){
// //
this.$message({ this.$message({
@ -162,8 +162,8 @@ export default {
.catch(error=>{ .catch(error=>{
this.$handleNetError(error); this.$handleNetError(error);
}) })
}else if(row.type == "删除线索"){ // 线 }else if(row.type == 1){ // 线
this.$axios.post('http://localhost:8000/deleteSelected/',{table_id:row.table_id, clue_id:row.clue_id}).then(response=>{ this.$axios.post('http:localhosat:8000/deleteSelected/',{table_id:row.table_id, clue_id:row.clue_id}).then(response=>{
if(response.data.message == '删除成功'){ if(response.data.message == '删除成功'){
// //
this.$message({ this.$message({
@ -185,7 +185,7 @@ export default {
} }
}, },
// 线 // 线
async deleteSelected(){ deleteSelected(){
// //
if(this.deleteClues.length == 0){ if(this.deleteClues.length == 0){
this.$message({ this.$message({
@ -202,45 +202,54 @@ export default {
clue_id: row?.clue_id ?? null, // clue_idnull clue_id: row?.clue_id ?? null, // clue_idnull
})); }));
let flag = true; //
for(let i = 0; i < deleteItems.length; i++){
try{ if(deleteItems[i].type == 0){ //
// this.axios.post('http://localhost:8000/deleteTable',{table_id: deleteItems[i].table_id}).then(response=>{
for(let i = 0; i < deleteItems.length; i++){ if(response.data.message == '删除成功'){
if(deleteItems[i].type == "删除表"){ // //
let response = await this.$axios.post('http://localhost:8000/deleteTable/',{table_id: deleteItems[i].table_id}) this.$message({
if(response.data.message == '删除失败'){ type: 'success',
message: '删除成功'
});
}else{
this.$message({ this.$message({
type: 'error', type: 'error',
message: '删除失败' message: '删除失败'
}); });
return;
} }
}else if(deleteItems[i].type == "删除线索"){ // 线 })
let response = await this.$axios.post('http://localhost:8000/deleteSelected/',{table_id:deleteItems[i].table_id, clue_id:deleteItems[i].clue_id}) .catch(error=>{
if(response.data.message == '删除失败'){ this.$handleNetError(error);
})
}else if(deleteItems[i].type == 1){ // 线
this.$axios.post('http://localhost:8000/deleteSelected/',
{table_id:deleteItems[i].table_id, clue_id:deleteItems[i].clue_id}).then(response=>{
if(response.data.message == '删除成功'){
//
this.$message({
type: 'success',
message: '删除成功'
});
}else{
this.$message({ this.$message({
type: 'error', type: 'error',
message: '删除失败' message: '删除失败'
}); });
return;
} }
} })
.catch(error=>{
this.$handleNetError(error); //
return;
})
} }
}catch (error){
flag = false;
this.$handleNetError(error);
} }
this.$message({
if(flag){ type: 'success',
this.$message({ message: '删除成功,即将刷新界面'
type: 'success', });
message: '删除成功,即将刷新界面' //
}); location.reload();
//
location.reload();
}
}, },
refreshData(){ refreshData(){
location.reload(); location.reload();
@ -248,15 +257,7 @@ export default {
}, },
mounted() { mounted() {
this.getDelete(); // this.getDelete(); //
}, }
watch: {
tableData(newv,oldv){
for(let i of newv){
if(i.type == 0) i.type = "删除表";
else i.type = "删除线索"
}
}
},
// //
}; };
@ -294,13 +295,4 @@ export default {
background-color: white; background-color: white;
align-items: center; align-items: center;
} }
.withdrawHeader{
height:6%;
padding :0;
width: 100%;
display:flex;
justify-content: space-between;
background-color: white;
align-items: center;
}
</style> </style>

View File

@ -6,25 +6,77 @@
</HeaderPage> </HeaderPage>
</el-header> </el-header>
<el-main style="padding:0; height:94%; display: flex; width:100%;" > <el-main style="padding:0; height:94%; display: flex; width:100%;" >
<el-container id = "container_Statistics" class ='flex justify-center p-2 '> <el-container id = "container_Statistics">
<div class="stats stats-vertical shadow bg-white text-gray-900 w-full"> <el-header class = 'flex justify-center h-1/5 pt-3'>
<div class="stat w-full"> <div class="stats stats-vertical lg:stats-horizontal shadow bg-white text-gray-900">
<div class="stat">
<div class="stat-title text-gray-700">已导入的线索库数量</div> <div class="stat-title text-gray-700">已导入的线索库数量</div>
<div class="stat-value">{{cluesTableAmount}}</div> <div class="stat-value">31K</div>
<div class="stat-desc">文件导入/已经存储的线索库</div> <div class="stat-desc">文件导入/已经存储的线索库</div>
</div> </div>
<div class="stat"> <div class="stat">
<div class="stat-title text-gray-700">总线索数</div> <div class="stat-title text-gray-700">总线索数</div>
<div class="stat-value">{{ cluesAmount }}</div> <div class="stat-value">4,200</div>
<div class="stat-desc">文件导入/已经储存的线索数</div> <div class="stat-desc">文件导入/已经储存的线索数</div>
</div> </div>
<div class="stat"> <div class="stat">
<div class="stat-title text-gray-700">回收站记录数量</div> <div class="stat-title text-gray-700">回收站记录数量</div>
<div class="stat-value">{{withdrawLogsAmount}}</div> <div class="stat-value">1,200</div>
<div class="stat-desc">删除的记录(批量/单条)</div> <div class="stat-desc">删除的记录(批量/单条)</div>
</div> </div>
</div> </div>
</el-header>
<div class="hero bg-white-200 min-h-screen">
<div class="hero-content text-center">
<div class="max-w-md">
<h1 class="text-5xl font-bold">你好欢迎来到线索库管理系统</h1>
<p class="py-6">
提供直观的线索库管理工具
</p>
<button class="btn btn-primary">Get Started</button>
</div>
</div>
</div>
<!-- <el-main>
<div class="carousel rounded-box">
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.jpg"
alt="Burger" />
</div>
<div class="carousel-item">
<img
src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.jpg"
alt="Burger" />
</div>
</div>
</el-main> -->
</el-container> </el-container>
<el-container id = "container_Tools_Main" class ='shadow-lg'> <el-container id = "container_Tools_Main" class ='shadow-lg'>
<!--这是主体的头栏用于防止工具等--> <!--这是主体的头栏用于防止工具等-->
@ -102,28 +154,9 @@ export default{
fileName:'', fileName:'',
isFileUploaded:false, isFileUploaded:false,
cardsPerRow: 3, // 3 cardsPerRow: 3, // 3
cluesTableAmount: 0,
cluesAmount: 0,
withdrawLogsAmount: 0,
statistics: '',
} }
}, },
methods:{ methods:{
getStatistics(){
this.$axios.get('http://localhost:8000/showStatistics/').then(res=>{
if(res.data.message=="null")
{
return
}
this.statistics = res.data;
this.cluesTableAmount = this.statistics.all_table;
this.cluesAmount = this.statistics.all_clues;
this.withdrawLogsAmount = this.statistics.all_del_records;
})
.catch(error=>{
this.$handleNetError(error);
});
},
openDialog(){ openDialog(){
this.dialogVisible = true; this.dialogVisible = true;
}, },
@ -166,9 +199,6 @@ export default{
this.dialogVisible1 = false// this.dialogVisible1 = false//
}) })
} }
},
beforeMount(){
this.getStatistics();
} }
} }
</script> </script>
@ -198,7 +228,7 @@ export default{
} }
/* 工具栏和主体样式 */ /* 工具栏和主体样式 */
#container_Tools_Main{ #container_Tools_Main{
width: 90%; width: 50%;
padding: 0; padding: 0;
margin: 0; margin: 0;
height:100%; height:100%;
@ -216,6 +246,6 @@ export default{
} }
#container_Statistics{ #container_Statistics{
background-color: #f5f6fa; background-color: #f5f6fa;
width:20%;; width:50%;
} }
</style> </style>