提交 103c01cc authored 作者: lidongxu's avatar lidongxu

fix(bi): 修复 tabs 顺序上下的问题,修复竞品表格第一列商品和店铺名字

同上
上级 425a9e06
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"axios": "0.28.1", "axios": "0.28.1",
"clipboard": "2.0.11", "clipboard": "2.0.11",
"echarts": "^5.4.0", "echarts": "^5.4.0",
"element-plus": "2.7.6", "element-plus": "^2.9.3",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"fuse.js": "6.6.2", "fuse.js": "6.6.2",
"gsap": "^3.12.5", "gsap": "^3.12.5",
......
...@@ -129,7 +129,8 @@ ...@@ -129,7 +129,8 @@
// 覆盖默认样式 // 覆盖默认样式
.el-select { .el-select {
width: 100%; width: 210px;
// width: 100%;
} }
.el-tabs { .el-tabs {
......
...@@ -131,9 +131,12 @@ aside { ...@@ -131,9 +131,12 @@ aside {
padding: 20px; padding: 20px;
>.container { >.container {
flex: 1;
width: 100%; width: 100%;
padding: 20px; padding: 20px;
background-color: var(--el-bg-color-overlay); background-color: var(--el-bg-color-overlay);
display: flex;
flex-direction: column;
} }
} }
......
<template>
<div>
<el-form ref="form" :model="openForm" inline>
<el-form-item v-for="(obj, key) in openForm" :key="key" :label="obj.name">
<template v-if="obj.type === 'input'">
<el-input prefix-icon="el-icon-search" v-model="obj.value" clearable @input="sel"></el-input>
</template>
<!-- 添加其他表单类型的模板 -->
</el-form-item>
</el-form>
<!-- 添加表格和其他内容 -->
</div>
</template>
<script setup>
import { ref } from 'vue';
import { debounce } from '@/utils';
const openForm = ref({});
const formOrder = ref([]);
const tableHeaderList = ref([]);
const tableData = ref([]);
const tableLoading = ref(true);
const isOnlyLoadData = ref(false);
const props = defineProps({
openObj: {
type: Object,
required: true
},
isCheckBox: {
type: Boolean,
default: false
},
nodeKeys: {
type: [String, Number]
}
});
watch(props.openObj, (newValue) => {
console.log('newValue', newValue)
const newObj = {};
const order = [];
if (!isOnlyLoadData.value) {
newValue.boxhead.forEach((obj, index) => {
newObj[obj.select_key] = obj;
order.push(obj.select_key);
});
openForm.value = newObj;
formOrder.value = order;
}
tableHeaderList.value = newValue.queryDisplay;
tableData.value = newValue.rows;
tableLoading.value = false;
});
const formatterFn = (row, column) => {
return row[column.property] || '无';
};
const sel = debounce(() => {
tableLoading.value = true;
isOnlyLoadData.value = true;
const queryObj = {};
Object.entries(openForm.value).forEach(([key, value]) => {
if (value.value) {
queryObj[key] = value.value.trim();
}
});
emit('sel', queryObj);
});
const selectAllFn = (rows) => {
if (!props.isCheckBox) {
table.clearSelection();
emit('input', []);
}
};
const selectFn = (rows) => {
if (!props.isCheckBox) {
table.clearSelection();
rows.length > 0 && table.toggleRowSelection(rows[rows.length - 1]);
}
emit('input', rows.length > 0 ? [rows[rows.length - 1]] : []);
};
</script>
<style scoped></style>
...@@ -50,6 +50,8 @@ import CategoryTree from '@/components/CategoryTree' ...@@ -50,6 +50,8 @@ import CategoryTree from '@/components/CategoryTree'
import BackToUp from '@/components/BackToUp' import BackToUp from '@/components/BackToUp'
// 自定义 toolTip // 自定义 toolTip
import CustomToolTip from '@/components/ToolTip' import CustomToolTip from '@/components/ToolTip'
// 开窗查询组件
import OpenDialog from '@/components/OpenDialog'
const app = createApp(App) const app = createApp(App)
...@@ -79,6 +81,7 @@ app.component('NoData', NoData) ...@@ -79,6 +81,7 @@ app.component('NoData', NoData)
app.component('CategoryTree', CategoryTree) app.component('CategoryTree', CategoryTree)
app.component('BackToUp', BackToUp) app.component('BackToUp', BackToUp)
app.component('CustomToolTip', CustomToolTip) app.component('CustomToolTip', CustomToolTip)
app.component('OpenDialog', OpenDialog)
// 全局插件 // 全局插件
app.use(plugins) app.use(plugins)
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</div> </div>
<el-table :data="data" <el-table :data="data"
style="width: 100%"> style="width: 100%">
<el-table-column prop="platformStore" <el-table-column :prop="isStore ? 'platformStore' : 'prdName'"
label="店铺" /> :label="isStore ? '店铺' : '商品'" />
<el-table-column prop="date" <el-table-column prop="date"
label="日期" label="日期"
v-if="!dateMerge" /> v-if="!dateMerge" />
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
'流量增速': 'llzs' '流量增速': 'llzs'
} }
const props = defineProps({ const props = defineProps({
isStore: {
type: Boolean,
default: true
},
column: { column: {
type: Object, type: Object,
default: () => { default: () => {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="container"> <div class="container">
<el-tabs v-model="activeName" <el-tabs v-model="activeName" class="tabs">
class="tabs">
<el-tab-pane v-for="item in list" <el-tab-pane v-for="item in list"
:label="item.name" :label="item.name"
:name="item.name"> :name="item.name">
...@@ -35,7 +34,7 @@ provide('activeName', activeName); ...@@ -35,7 +34,7 @@ provide('activeName', activeName);
.tabs { .tabs {
display: flex; display: flex;
flex-direction: column; flex-direction: column-reverse;
::v-deep(.el-tabs__content) { ::v-deep(.el-tabs__content) {
flex: 1; flex: 1;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div :class="{chart_wrap : showType === 'charts', table_wrap : showType === 'table'}" <div :class="{ chart_wrap: showType === 'charts', table_wrap: showType === 'table' }"
v-loading="loading"> v-loading="loading">
<template v-if="queryParams.prdList.length > 0 && queryParams.typeList.length > 0 && !loading"> <template v-if="queryParams.prdList.length > 0 && queryParams.typeList.length > 0 && !loading">
<template v-if="showType === 'charts'"> <template v-if="showType === 'charts'">
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<table-list :column="queryParams.typeList" <table-list :column="queryParams.typeList"
:data="tableList" :data="tableList"
:dateMerge="dateMerge" :dateMerge="dateMerge"
:isStore="false"
@changeType="changeType" @changeType="changeType"
@queryTable="getList" @queryTable="getList"
@dateMerge="dateMergeFn"></table-list> @dateMerge="dateMergeFn"></table-list>
...@@ -119,6 +120,7 @@ const initChartsData = (data) => { ...@@ -119,6 +120,7 @@ const initChartsData = (data) => {
// 图表数据 // 图表数据
data.forEach((list, index) => { data.forEach((list, index) => {
index = index * 4 index = index * 4
console.log(list)
// list: 每个商品数据集合 // list: 每个商品数据集合
// 公共的配置 // 公共的配置
let commonObj = { let commonObj = {
...@@ -143,7 +145,7 @@ const initChartsData = (data) => { ...@@ -143,7 +145,7 @@ const initChartsData = (data) => {
opacity: 0.8, opacity: 0.8,
color: getAdditionalColor(index) color: getAdditionalColor(index)
}, },
name: list[0]?.platformStore + '-交易增速', name: list[0]?.prdName + '-交易增速',
data: [] data: []
} }
let llzsObj = { let llzsObj = {
...@@ -155,7 +157,7 @@ const initChartsData = (data) => { ...@@ -155,7 +157,7 @@ const initChartsData = (data) => {
opacity: 0.8, opacity: 0.8,
color: getAdditionalColor(index + 1) color: getAdditionalColor(index + 1)
}, },
name: list[0]?.platformStore + '-流量增速', name: list[0]?.prdName + '-流量增速',
data: [], data: [],
} }
let uvObj = { let uvObj = {
...@@ -167,7 +169,7 @@ const initChartsData = (data) => { ...@@ -167,7 +169,7 @@ const initChartsData = (data) => {
opacity: 0.8, opacity: 0.8,
color: getAdditionalColor(index + 2) color: getAdditionalColor(index + 2)
}, },
name: list[0]?.platformStore + '-独立访客范围', name: list[0]?.prdName + '-独立访客范围',
data: [] data: []
} }
let zfmjObj = { let zfmjObj = {
...@@ -179,7 +181,7 @@ const initChartsData = (data) => { ...@@ -179,7 +181,7 @@ const initChartsData = (data) => {
opacity: 0.8, opacity: 0.8,
color: getAdditionalColor(index + 3) color: getAdditionalColor(index + 3)
}, },
name: list[0]?.platformStore + '-支付买家数', name: list[0]?.prdName + '-支付买家数',
data: [] data: []
} }
// list: 循环每一天的数据 // list: 循环每一天的数据
...@@ -289,7 +291,7 @@ const filterTableData = () => { ...@@ -289,7 +291,7 @@ const filterTableData = () => {
// 没有日期合并 // 没有日期合并
if (dateMerge.value) { if (dateMerge.value) {
tableList.value = allTableList.value.map(o => { tableList.value = allTableList.value.map(o => {
const platformStore = o[0].platformStore const prdName = o[0].prdName
const zfmj = (o.reduce((sum, obj) => { const zfmj = (o.reduce((sum, obj) => {
return sum += ((obj.zfmjPeak + obj.zfmjUnder) / 2) return sum += ((obj.zfmjPeak + obj.zfmjUnder) / 2)
}, 0) / o.length).toFixed(2) }, 0) / o.length).toFixed(2)
...@@ -303,7 +305,7 @@ const filterTableData = () => { ...@@ -303,7 +305,7 @@ const filterTableData = () => {
return sum += ((obj.llzsPeak + obj.llzsUnder) / 2) return sum += ((obj.llzsPeak + obj.llzsUnder) / 2)
}, 0) / o.length).toFixed(2) }, 0) / o.length).toFixed(2)
return { return {
platformStore, zfmj, jyzs, uv, llzs prdName, zfmj, jyzs, uv, llzs
} }
}) })
......
...@@ -170,7 +170,7 @@ const queryParams = reactive({ // 查询参数 ...@@ -170,7 +170,7 @@ const queryParams = reactive({ // 查询参数
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}) })
const form = reactive({ // 增/改表单参数 let form = reactive({ // 增/改表单参数
channelId: '1', // 默认渠道:"电商" channelId: '1', // 默认渠道:"电商"
platformId: '1', // 默认平台:"天猫" platformId: '1', // 默认平台:"天猫"
}) })
......
...@@ -161,6 +161,26 @@ ...@@ -161,6 +161,26 @@
controls-position="right" controls-position="right"
:min="0" /> :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="考勤规则"
prop="ruleList">
<el-popover placement="bottom-start"
width="750"
trigger="click">
<template #reference>
<el-input-tag v-model="form.ruleList"
tag-type="primary"
tag-effect="plain"
placeholder="选择考勤规则">
<template #tag="{ value }">
<div class="flex items-center">>
<span>{{ value }}</span>
</div>
</template>
</el-input-tag>
</template>
<open-dialog :openObj="attStruData" />
</el-popover>
</el-form-item>
<el-form-item label="岗位状态" <el-form-item label="岗位状态"
prop="status"> prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
...@@ -190,7 +210,7 @@ ...@@ -190,7 +210,7 @@
<script setup <script setup
name="Post"> name="Post">
import { listPost, addPost, delPost, getPost, updatePost } from "@/api"; import { listPost, addPost, delPost, getPost, updatePost, attendanceOpenFQAPI } from "@/api";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
...@@ -204,6 +224,8 @@ ...@@ -204,6 +224,8 @@
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const attQuery = ref({}) // 考勤查询对象
const attStruData = ref({}); // 考勤开窗结构+对象
const data = reactive({ const data = reactive({
form: {}, form: {},
...@@ -233,6 +255,17 @@ ...@@ -233,6 +255,17 @@
}); });
} }
// 获取考勤规则-开窗数据+结构
const getAttOpenDialog = async () => {
const { data } = await attendanceOpenFQAPI(attQuery.value)
console.log(data)
attStruData.value = data
}
getAttOpenDialog()
const attendanceSelFn = () => {
}
/** 取消按钮 */ /** 取消按钮 */
function cancel() { function cancel() {
open.value = false; open.value = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论