2025-06-20

This commit is contained in:
lcc
2025-06-20 09:09:12 +08:00
parent 091fc69a3a
commit 6f4383e88f
10 changed files with 191 additions and 275 deletions
+11
View File
@@ -0,0 +1,11 @@
import request from '@/utils/request';
export async function pageIndex(params) {
const res = await request.get('/home/data', {
params
});
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -12,10 +12,12 @@
<div
class="analysis-chart-card-num ele-text-heading"
style="margin-bottom: 10px"
>101</div
>{{ data.today_clues }}</div
>
<el-divider />
<div class="analysis-chart-card-text">累计线索100000</div>
<div class="analysis-chart-card-text"
>累计线索{{ data.total_clues }}</div
>
</el-card>
</el-col>
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -28,10 +30,12 @@
<div
class="analysis-chart-card-num ele-text-heading"
style="margin-bottom: 10px"
>2323</div
>{{ data.member }}</div
>
<el-divider />
<div class="analysis-chart-card-text">历史成交100000</div>
<div class="analysis-chart-card-text"
>历史成交{{ data.orders }}</div
>
</el-card>
</el-col>
</el-row>
@@ -42,8 +46,8 @@
import { CanvasRenderer } from 'echarts/renderers';
import { LineChart, BarChart } from 'echarts/charts';
import { GridComponent, TooltipComponent } from 'echarts/components';
import { getPayNumList } from '@/api/dashboard/analysis';
import { echartsMixin } from '@/utils/echarts-mixin';
import { pageIndex } from '@/api/home';
use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]);
@@ -55,7 +59,13 @@
// 访问量折线图配置
visitChartOption: {},
// 支付笔数柱状图配置
payNumChartOption: {}
payNumChartOption: {},
data: {
total_clues: 0,
today_clues: 0,
member: 0,
orders: 0
}
};
},
computed: {
@@ -65,91 +75,15 @@
}
},
created() {
this.getPayNumData();
this.fetchData();
},
methods: {
/* 获取数据 */
getPayNumData() {
getPayNumList()
.then((data) => {
this.visitChartOption = {
color: '#975fe5',
tooltip: {
trigger: 'axis',
formatter:
'<i class="ele-chart-dot" style="background: #975fe5;"></i>{b0}: {c0}'
},
grid: {
top: 10,
bottom: 0,
left: 0,
right: 0
},
xAxis: [
{
show: false,
type: 'category',
boundaryGap: false,
data: data.map((d) => d.date)
}
],
yAxis: [
{
show: false,
type: 'value',
splitLine: {
show: false
}
}
],
series: [
{
type: 'line',
smooth: true,
symbol: 'none',
areaStyle: {
opacity: 0.5
},
data: data.map((d) => d.value)
}
]
};
//
this.payNumChartOption = {
tooltip: {
trigger: 'axis',
formatter:
'<i class="ele-chart-dot" style="background: #5b8ff9;"></i>{b0}: {c0}'
},
grid: {
top: 10,
bottom: 0,
left: 0,
right: 0
},
xAxis: [
{
show: false,
type: 'category',
data: data.map((d) => d.date)
}
],
yAxis: [
{
show: false,
type: 'value',
splitLine: {
show: false
}
}
],
series: [
{
type: 'bar',
data: data.map((d) => d.value)
}
]
};
fetchData() {
pageIndex()
.then((res) => {
this.$util.assignObject(this.data, {
...res
});
})
.catch((e) => {
this.$message.error(e.message);
+5 -4
View File
@@ -119,7 +119,7 @@
label: '操作人员',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
width: 120
},
{
prop: 'content',
@@ -127,20 +127,20 @@
label: '内容',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
minWidth: 200
},
{
prop: 'type_name',
label: '类型',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
width: 120
},
{
prop: 'c_time',
label: '时间',
align: 'center',
minWidth: 80,
width: 200,
resizable: false,
showOverflowTooltip: true
}
@@ -191,6 +191,7 @@
this.form.id = this.$route.query.id;
setPageTabTitle(this.title);
this.query();
this.reload();
},
immediate: true
}
+15 -4
View File
@@ -89,6 +89,16 @@
{{ row.rec_text }}
</template>
<template v-else>{{ row.log }}</template>
<div v-if="row.imgs">
<template v-for="(item, index) in row.imgs">
<el-image
style="width: 100px; height: 100px"
:src="item"
:key="index"
:preview-src-list="row.imgs"
></el-image>
</template>
</div>
</template>
</ele-pro-table>
</el-card>
@@ -129,7 +139,7 @@
label: '操作人员',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
width: 120
},
{
prop: 'content',
@@ -137,20 +147,20 @@
label: '内容',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
minWidth: 200
},
{
prop: 'type_name',
label: '类型',
align: 'center',
showOverflowTooltip: true,
minWidth: 80
width: 120
},
{
prop: 'c_time',
label: '时间',
align: 'center',
minWidth: 80,
width: 200,
resizable: false,
showOverflowTooltip: true
}
@@ -201,6 +211,7 @@
this.form.id = this.$route.query.id;
setPageTabTitle(this.title);
this.query();
this.reload();
},
immediate: true
}
+1 -1
View File
@@ -65,7 +65,7 @@
align: 'center'
},
{
prop: 'ctime',
prop: 'createTime',
label: '时间',
align: 'center',
minWidth: 100,
@@ -0,0 +1,120 @@
<!-- 用户编辑弹窗 -->
<template>
<ele-modal
width="70%"
:visible="visible"
:append-to-body="true"
:close-on-click-modal="true"
custom-class="ele-dialog-form"
title="佣金明细"
@update:visible="updateVisible"
>
<!-- 数据表格 -->
<ele-pro-table
ref="table"
:columns="columns"
:datasource="datasource"
cache-key="userCmmssn"
>
</ele-pro-table>
</ele-modal>
</template>
<script>
import { pageCmmssn } from '@/api/user/cmmssn';
export default {
components: {},
props: {
// 弹窗是否打开
visible: Boolean,
// 修改回显的数据
data: Object
},
data() {
const defaultForm = {
id: null
};
return {
defaultForm,
// 表单数据
form: { ...defaultForm },
// 提交状态
loading: false,
// 是否是修改
isUpdate: false,
// 表格列配置
columns: [
{
prop: 'fromCn',
label: '佣金来源',
showOverflowTooltip: true,
slot: 'username',
align: 'center',
minWidth: 100
},
{
prop: 'typeCn',
label: '类型',
showOverflowTooltip: true,
minWidth: 80,
align: 'center'
},
{
prop: 'money',
label: '金额',
showOverflowTooltip: true,
minWidth: 80,
align: 'center'
},
{
prop: 'createTime',
label: '时间',
align: 'center',
minWidth: 100,
resizable: false,
showOverflowTooltip: true
}
]
};
},
computed: {
// 是否开启响应式布局
styleResponsive() {
return this.$store.state.theme.styleResponsive;
}
},
methods: {
/* 更新visible */
updateVisible(value) {
this.$emit('update:visible', value);
},
/* 表格数据源 */
datasource({ page, limit, where, order }) {
where.userId = this.form.id;
return pageCmmssn({ ...where, ...order, page, limit });
},
/* 刷新表格 */
reload(where) {
this.$refs.table.reload({ page: 1, where: where });
}
},
watch: {
visible(visible) {
if (visible) {
if (this.data) {
console.log(this.data);
this.$util.assignObject(this.form, {
...this.data
});
this.isUpdate = true;
this.reload();
} else {
this.isUpdate = false;
}
} else {
this.form = { ...this.defaultForm };
}
}
}
};
</script>
@@ -1,54 +0,0 @@
<!-- 角色选择下拉框 -->
<template>
<el-select
multiple
clearable
:value="value"
class="ele-block"
:placeholder="placeholder"
@input="updateValue"
>
<el-option
v-for="item in data"
:key="item.roleId"
:value="item.roleId"
:label="item.roleName"
/>
</el-select>
</template>
<script>
import { listRoles } from '@/api/system/role';
export default {
props: {
// 选中的数据(v-modal)
value: Array,
// 提示信息
placeholder: {
type: String,
default: '请选择角色'
}
},
data() {
return {
data: []
};
},
created() {
/* 获取角色数据 */
listRoles()
.then((list) => {
this.data = list;
})
.catch((e) => {
this.$message.error(e.message);
});
},
methods: {
updateValue(value) {
this.$emit('input', value);
}
}
};
</script>
@@ -102,11 +102,10 @@
<script>
import { emailReg, phoneReg } from 'ele-admin';
import RoleSelect from './role-select.vue';
import { addUser, updateUser, checkExistence } from '@/api/system/user';
export default {
components: { RoleSelect },
components: {},
props: {
// 弹窗是否打开
visible: Boolean,
@@ -1,99 +0,0 @@
<!-- 用户导入弹窗 -->
<template>
<ele-modal
width="520px"
title="导入用户"
:visible="visible"
@update:visible="updateVisible"
>
<el-upload
drag
action=""
class="ele-block"
v-loading="loading"
accept=".xls,.xlsx"
:show-file-list="false"
:before-upload="doUpload"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处, <em>点击上传</em></div>
<template v-slot:tip>
<div class="el-upload__tip ele-text-center">
<span>只能上传xlsxlsx文件, </span>
<el-link
download
:href="url"
type="primary"
:underline="false"
style="vertical-align: baseline"
>
下载模板
</el-link>
</div>
</template>
</el-upload>
</ele-modal>
</template>
<script>
import { importUsers } from '@/api/system/user';
export default {
props: {
// 是否打开弹窗
visible: Boolean
},
data() {
return {
// 导入请求状态
loading: false,
// 导入模板下载地址
url: 'https://cdn.eleadmin.com/20200610/用户导入模板.xlsx'
};
},
methods: {
/* 上传 */
doUpload(file) {
if (
![
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
].includes(file.type)
) {
this.$message.error('只能选择 excel 文件');
return false;
}
if (file.size / 1024 / 1024 > 10) {
this.$message.error('大小不能超过 10MB');
return false;
}
this.loading = true;
importUsers(file)
.then((msg) => {
this.loading = false;
this.$message.success(msg);
this.updateVisible(false);
this.$emit('done');
})
.catch((e) => {
this.loading = false;
this.$message.error(e.message);
});
return false;
},
/* 更新visible */
updateVisible(value) {
this.$emit('update:visible', value);
}
}
};
</script>
<style lang="scss" scoped>
.ele-block {
:deep(.el-upload),
:deep(.el-upload-dragger) {
width: 100%;
}
}
</style>
+15 -22
View File
@@ -41,33 +41,36 @@
</template>
<!-- 操作列 -->
<template v-slot:action="{ row }">
<!--
<el-link type="primary" :underline="false" @click="openEdit(row)">
查看
</el-link>
<el-link type="primary" :underline="false"> 佣金明细 </el-link>
-->
<el-link type="primary" :underline="false" @click="goCmmssn(row)">
佣金明细
</el-link>
</template>
</ele-pro-table>
</el-card>
<!-- 编辑弹窗 -->
<user-edit :visible.sync="showEdit" :data="current" @done="reload" />
<!-- 导入弹窗 -->
<user-import :visible.sync="showImport" @done="reload" />
<!-- 佣金 -->
<commssn :visible.sync="showCommssn" :data="current" />
</div>
</template>
<script>
import UserSearch from './components/user-search.vue';
import UserEdit from './components/user-edit.vue';
import UserImport from './components/user-import.vue';
import { updateUserStatus } from '@/api/system/user';
import commssn from './components/commssn.vue';
import { pageTeam } from '@/api/user/team';
export default {
name: 'SystemUser',
name: 'userTeam',
components: {
UserSearch,
UserEdit,
UserImport
commssn
},
data() {
return {
@@ -128,8 +131,8 @@
current: null,
// 是否显示编辑弹窗
showEdit: false,
// 是否显示导入弹窗
showImport: false
// 是否显示佣金
showCommssn: false
};
},
methods: {
@@ -146,19 +149,9 @@
this.current = row;
this.showEdit = true;
},
/* 更改状态 */
editStatus(row) {
const loading = this.$loading({ lock: true });
updateUserStatus(row.userId, row.status)
.then((msg) => {
loading.close();
this.$message.success(msg);
})
.catch((e) => {
loading.close();
row.status = !row.status ? 1 : 0;
this.$message.error(e.message);
});
goCmmssn(row) {
this.current = row;
this.showCommssn = true;
}
}
};