Merge branch 'master' of http://124.223.211.244:8418/zianxin/biz-pc-cloud
This commit is contained in:
commit
7bab0e2cf5
3 files changed
+73
-33
No files matched your search
@@ -162,7 +162,7 @@ defineExpose({
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 8px 8px -8px rgba(0, 0, 0, 0.1);
|
||||
z-index: 10;
|
||||
|
||||
&-input {
|
||||
@@ -189,7 +189,7 @@ defineExpose({
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-top: 10px;
|
||||
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 -8px 8px -8px rgba(0, 0, 0, 0.1);
|
||||
z-index: 10;
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
|
||||
@@ -3,35 +3,35 @@
|
||||
<splitpanes>
|
||||
<pane size="30">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-scrollbar>
|
||||
<dep-tree
|
||||
ref="depTreeRef"
|
||||
:placeholder="$t('common.queryDeptTip')"
|
||||
:query="deptData.queryList"
|
||||
:show-expand="true"
|
||||
@node-click="handleNodeClick"
|
||||
@treeDeepSearch="treeDeepSearch"
|
||||
switch-inactive-text="当前部门"
|
||||
switch-active-text="当前部门及子部门"
|
||||
>
|
||||
<!-- 没有数据权限提示 -->
|
||||
<template #default="{ node, data }">
|
||||
<el-tooltip
|
||||
v-if="data.isLock"
|
||||
class="item"
|
||||
effect="dark"
|
||||
:content="$t('sysuser.noDataScopeTip')"
|
||||
placement="right-start"
|
||||
>
|
||||
<span>
|
||||
{{ node.label }}
|
||||
<SvgIcon name="ele-Lock" />
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span v-if="!data.isLock">{{ node.label }}</span>
|
||||
</template>
|
||||
</dep-tree>
|
||||
</el-scrollbar>
|
||||
<!-- <el-scrollbar> -->
|
||||
<dep-tree
|
||||
ref="depTreeRef"
|
||||
:placeholder="$t('common.queryDeptTip')"
|
||||
:query="deptData.queryList"
|
||||
:show-expand="true"
|
||||
@node-click="handleNodeClick"
|
||||
@treeDeepSearch="treeDeepSearch"
|
||||
switch-inactive-text="当前部门"
|
||||
switch-active-text="当前部门及子部门"
|
||||
>
|
||||
<!-- 没有数据权限提示 -->
|
||||
<template #default="{ node, data }">
|
||||
<el-tooltip
|
||||
v-if="data.isLock"
|
||||
class="item"
|
||||
effect="dark"
|
||||
:content="$t('sysuser.noDataScopeTip')"
|
||||
placement="right-start"
|
||||
>
|
||||
<span>
|
||||
{{ node.label }}
|
||||
<SvgIcon name="ele-Lock" />
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span v-if="!data.isLock">{{ node.label }}</span>
|
||||
</template>
|
||||
</dep-tree>
|
||||
<!-- </el-scrollbar> -->
|
||||
</div>
|
||||
</pane>
|
||||
<pane class="ml8">
|
||||
@@ -238,7 +238,6 @@ import { auth } from "/@/utils/authFunction"
|
||||
// 动态引入组件
|
||||
const UserForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
const FaceManage = defineAsyncComponent(() => import("./face-manage.vue"))
|
||||
const QueryTree = defineAsyncComponent(() => import("/@/components/QueryTree/index.vue"))
|
||||
const PopoverInput = defineAsyncComponent(() => import("/@/components/PopoverInput/index.vue"))
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@sort-change="sortChangeHandle"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column label="商品名" align="center" prop="productName" />
|
||||
<el-table-column label="商品图片" align="center" prop="code">
|
||||
@@ -14,7 +16,7 @@
|
||||
<preview-image v-if="row.productPic" :src="row.productPic" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品价格" align="center" prop="ticketId">
|
||||
<el-table-column label="商品价格" align="center" prop="productPrice">
|
||||
<template #default="{ row }">
|
||||
<span>{{ displayPrice(row.productPrice) }}</span>
|
||||
</template>
|
||||
@@ -39,6 +41,8 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import * as hardCar from "/@/api/hard/hard-car"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { TableColumnCtx } from "element-plus"
|
||||
import { VNode } from "vue"
|
||||
|
||||
// 定义变量内容
|
||||
const visible = ref(false)
|
||||
@@ -62,6 +66,43 @@ const openDialog = (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
interface SummaryMethodProps<T = any> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
data: T[]
|
||||
}
|
||||
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
const { columns, data } = param
|
||||
const sums: (string | VNode)[] = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = "合计"
|
||||
return
|
||||
}
|
||||
if (column.property === "productPrice" || column.property === "totalPrice") {
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = displayPrice(
|
||||
values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0),
|
||||
)
|
||||
} else {
|
||||
sums[index] = "N/A"
|
||||
}
|
||||
} else {
|
||||
sums[index] = ""
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
|
||||
Reference in new issue
Block a user