Compare commits
44 Commits
2364ff6278
...
dev_sh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4a03fb756 | ||
|
|
f4eca63a29 | ||
|
|
b07c03b00a | ||
|
|
f2c856b61c | ||
|
|
d6d5f75fb6 | ||
|
|
c8d152f595 | ||
|
|
a441538178 | ||
|
|
7e57cfb871 | ||
|
|
c5ff4c263f | ||
|
|
eeb6f27d47 | ||
|
|
b2a130930c | ||
|
|
b35b04452a | ||
|
|
081544019c | ||
|
|
e545aa36ca | ||
|
|
85f7484c57 | ||
|
|
cb77ad837b | ||
|
|
03c8d49a9c | ||
|
|
201a4464bb | ||
|
|
e8fce71d0e | ||
|
|
774895f901 | ||
|
|
386fb026b5 | ||
|
|
280ff0837f | ||
|
|
6625e0c1a3 | ||
|
|
354f839b4e | ||
|
|
5b95cc85f0 | ||
|
|
cf511deeef | ||
|
|
2217b14377 | ||
|
|
d57c46b531 | ||
|
|
b6d970175e | ||
|
|
b9c60b8c48 | ||
|
|
fbe8c8ba4e | ||
| 4260e35018 | |||
| 89b3c978c5 | |||
| ccfb06113a | |||
|
|
e33fcb33fe | ||
|
|
5154baf6a7 | ||
| 957ebbe28d | |||
|
|
ca4ebdfb7c | ||
|
|
b34b599513 | ||
|
|
31df51dcc6 | ||
|
|
0caec67d4a | ||
|
|
5b3c7d8327 | ||
| 2c848827b3 | |||
| 8ec002300b |
@@ -89,4 +89,7 @@ export const batchGetTableList = (reportCodes: string, data?) => {
|
|||||||
return request.post({ url: `/lideeyunji/report-data/batch/list/${reportCodes}`, data })
|
return request.post({ url: `/lideeyunji/report-data/batch/list/${reportCodes}`, data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取综合销售报表合计
|
||||||
|
export const getAggMonthTotalDetail = (data) => {
|
||||||
|
return request.post({ url: `lideeyunji/agg/month/total/detail`, data })
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ defineProps({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ElCard :class="[prefixCls, 'mb-15px']" shadow="never">
|
<ElCard :class="[prefixCls]" shadow="never">
|
||||||
<template v-if="title" #header>
|
<template v-if="title" #header>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<span class="text-16px font-700">{{ title }}</span>
|
<span class="text-16px font-700">{{ title }}</span>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class="low-reoprt"
|
class="low-reoprt"
|
||||||
:class="[`low-report__${reportCode}`, { summary: tableOption.showSummary }]"
|
:class="[`low-report__${reportCode}`, { summary: tableOption.showSummary }]"
|
||||||
>
|
>
|
||||||
<div v-if="isSearch" style="margin-bottom:6px">查询:</div>
|
|
||||||
<avue-crud
|
<avue-crud
|
||||||
ref="crudRef"
|
ref="crudRef"
|
||||||
v-model:search="tableSearch"
|
v-model:search="tableSearch"
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
:option="tableOption"
|
:option="tableOption"
|
||||||
v-bind="crudBind"
|
v-bind="crudBind"
|
||||||
:summary-method=summaryMethod1
|
:summary-method=summaryMethod1
|
||||||
|
:row-style="rowStyleMethod"
|
||||||
|
:cell-class-name="cellClassNameMethod"
|
||||||
@search-change="searchChange"
|
@search-change="searchChange"
|
||||||
@search-reset="resetChange"
|
@search-reset="resetChange"
|
||||||
@refresh-change="refreshChange"
|
@refresh-change="refreshChange"
|
||||||
@@ -21,6 +23,9 @@
|
|||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
>
|
>
|
||||||
|
<template #search>
|
||||||
|
<!-- <div v-if="isSearch" style="margin-bottom:6px">查询:</div> -->
|
||||||
|
</template>
|
||||||
<!-- 自定义表格头部操作 -->
|
<!-- 自定义表格头部操作 -->
|
||||||
<template #menu-left="{ size }">
|
<template #menu-left="{ size }">
|
||||||
<ElButton
|
<ElButton
|
||||||
@@ -39,6 +44,31 @@
|
|||||||
<Icon :size="14" icon="clarity:export-line"></Icon>
|
<Icon :size="14" icon="clarity:export-line"></Icon>
|
||||||
<span>{{ t('Avue.crud.excelBtn') }}</span>
|
<span>{{ t('Avue.crud.excelBtn') }}</span>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
|
<div ref="tableHeightRef"></div>
|
||||||
|
</template>
|
||||||
|
<template v-for="prop in searchReportSlots" :key="prop" #[`${prop}-search`]="scope" >
|
||||||
|
<div>
|
||||||
|
<el-select
|
||||||
|
v-model="tableSearch[prop]"
|
||||||
|
:multiple="scope.column.multiple"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
remote-show-suffix
|
||||||
|
clearable
|
||||||
|
:disabled="loading"
|
||||||
|
:collapse-tags="scope.column.collapseTags"
|
||||||
|
:collapse-tags-tooltip="scope.column.collapseTagsTooltip"
|
||||||
|
:placeholder="'请选择'+scope.column.label"
|
||||||
|
:remote-method="(query) => remoteMethod(query, scope.column)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item,index) in scope.column.dicData"
|
||||||
|
:key="index"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-for="prop in numberRange" :key="prop" #[`${prop}-search`]="scope">
|
<template v-for="prop in numberRange" :key="prop" #[`${prop}-search`]="scope">
|
||||||
<InputNumberRange
|
<InputNumberRange
|
||||||
@@ -76,7 +106,7 @@
|
|||||||
placeholder="请选择内容">
|
placeholder="请选择内容">
|
||||||
<template v-for="(item,key) in dimensionFields">
|
<template v-for="(item,key) in dimensionFields">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-if="tableSearch['Group by']&&tableSearch['Group by'].includes(key)||!tableSearch['Group by']?.length"
|
v-if="1"
|
||||||
:key="key"
|
:key="key"
|
||||||
:value="key"
|
:value="key"
|
||||||
:label="item.label"></el-checkbox>
|
:label="item.label"></el-checkbox>
|
||||||
@@ -92,11 +122,13 @@ v-if="tableSearch['Group by']&&tableSearch['Group by'].includes(key)||!tableSear
|
|||||||
import * as ReportApi from '@/api/design/report'
|
import * as ReportApi from '@/api/design/report'
|
||||||
import { InputNumberRange,InputDateRange ,InputDateTimeRange,InputTimeRange} from '../shareControl/index'
|
import { InputNumberRange,InputDateRange ,InputDateTimeRange,InputTimeRange} from '../shareControl/index'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
import { assembleLengObj } from '@/utils/lowDesign'
|
import { assembleLengObj } from '@/utils/lowDesign'
|
||||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import Avue from '@smallwei/avue'
|
import Avue from '@smallwei/avue'
|
||||||
|
import { Console } from 'console'
|
||||||
defineOptions({ name: 'LowReport' })
|
defineOptions({ name: 'LowReport' })
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -116,24 +148,34 @@ const { wsCache } = useCache()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { mergeLocaleMessage, t } = useI18n() // 国际化
|
const { mergeLocaleMessage, t } = useI18n() // 国际化
|
||||||
|
const defualtSearch=ref<any>({})
|
||||||
|
const transferFields={
|
||||||
|
'zoneName':'salezonename',
|
||||||
|
'saleTypeName':'saletypename',
|
||||||
|
'salerName':'salername',
|
||||||
|
'goodsName':'goodsname',
|
||||||
|
'customName':'customname',
|
||||||
|
'dosageName':'dosagename',
|
||||||
|
|
||||||
|
}
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const isInit = ref(false)
|
const isInit = ref(false)
|
||||||
const isSearch = ref(false)
|
const isSearch = ref(false)
|
||||||
|
|
||||||
|
const tableHeightRef = ref<any>(null)
|
||||||
const tableOption = ref<any>({})
|
const tableOption = ref<any>({})
|
||||||
const tableData = ref<any>([])
|
const tableData = ref<any>([])
|
||||||
const tableSearch = ref({
|
const tableSearch = ref({
|
||||||
'Group by':[]
|
'Group by':[]
|
||||||
})
|
})
|
||||||
const tablePage = ref<any>({ currentPage: 1, pageSize: 100, total: 0 })
|
const tablePage = ref<any>({ currentPage: 1, pageSize: 50, total: 0 })
|
||||||
const tableSelect = ref<any>([])
|
const tableSelect = ref<any>([])
|
||||||
const tableSort = ref({ column: '', order: '' })
|
const tableSort = ref({ column: '', order: '' })
|
||||||
const tableInfo = ref<any>({})
|
const tableInfo = ref<any>({})
|
||||||
const timerObj = ref<any>({})
|
const timerObj = ref<any>({})
|
||||||
const numberRange = ref<string[]>([])
|
const numberRange = ref<string[]>([])
|
||||||
const dateRange=ref<string[]>([])
|
const dateRange=ref<string[]>([])
|
||||||
|
const searchReportSlots=ref<string[]>([])
|
||||||
const hideColumns=ref<string[]>([])
|
const hideColumns=ref<string[]>([])
|
||||||
const dateTimeRange=ref<string[]>([])
|
const dateTimeRange=ref<string[]>([])
|
||||||
const timeRange=ref<string[]>([])
|
const timeRange=ref<string[]>([])
|
||||||
@@ -144,22 +186,77 @@ const dimensionFields=ref<any>({})
|
|||||||
const exportLoading = ref(false)
|
const exportLoading = ref(false)
|
||||||
const fieldList = ref<any[]>([]) // 添加fieldList引用
|
const fieldList = ref<any[]>([]) // 添加fieldList引用
|
||||||
const hideFeilds= ref<any>({})
|
const hideFeilds= ref<any>({})
|
||||||
|
const hideCols=ref<any>([])
|
||||||
|
const dictFieldList=ref<any>([])
|
||||||
|
const textAlignFiels=ref<any>({})
|
||||||
const permissions =
|
const permissions =
|
||||||
wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[route.meta.menuDataId as string] || false
|
wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[route.meta.menuDataId as string] || false
|
||||||
const selectIds = computed(() => {
|
const selectIds = computed(() => {
|
||||||
return tableSelect.value.map((item) => item['id'])
|
return tableSelect.value.map((item) => item['id'])
|
||||||
})
|
})
|
||||||
|
const remoteMethod= async(query,column)=>{
|
||||||
|
if(!query){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let params={
|
||||||
|
pageSize: 100,
|
||||||
|
pageNo:1,
|
||||||
|
}
|
||||||
|
params[transferFields[column.prop]?transferFields[column.prop]:column.prop]=query
|
||||||
|
|
||||||
|
let data = await ReportApi.getTableList(column.reportCode,params)
|
||||||
|
column.dicData=column.formatterDic(data)
|
||||||
|
}
|
||||||
const crudBind = computed(() => {
|
const crudBind = computed(() => {
|
||||||
const obj = {}
|
const obj = {}
|
||||||
if (tableInfo.value.isPage) obj['page'] = tablePage.value
|
if (tableInfo.value.isPage) obj['page'] = tablePage.value
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function getElementToBodyTop(el) {
|
||||||
|
if (!el || !(el instanceof HTMLElement)) return 0;
|
||||||
|
|
||||||
|
// 1. 获取元素相对于视口的位置(top是元素顶部到视口顶部的距离)
|
||||||
|
const rect = el.getBoundingClientRect();
|
||||||
|
// 2. 视口顶部到body顶部的距离 = 页面滚动的距离(window.scrollY)
|
||||||
|
// 最终距离 = 元素视口top + 页面滚动距离 - body的margin/padding(可选,根据场景)
|
||||||
|
const bodyTop = document.body.getBoundingClientRect().top; // body自身的偏移(通常为0)
|
||||||
|
return rect.top - bodyTop + window.scrollY;
|
||||||
|
}
|
||||||
|
const tableHeight=ref(0)
|
||||||
|
watch(()=>tableHeightRef.value,()=>{
|
||||||
|
if(tableHeightRef.value){
|
||||||
|
setTimeout(()=>{
|
||||||
|
observeHeightChange(document.querySelector('.avue-crud__search'))
|
||||||
|
if(tableOption.value.showSummary&&tableOption.value.index&&tableOption.value.selection){
|
||||||
|
document.querySelector('tfoot tr td').colSpan="2"
|
||||||
|
document.querySelectorAll('tfoot tr td')[1].style.display="none"
|
||||||
|
}
|
||||||
|
|
||||||
|
},2000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let resizeObserver = null;
|
||||||
|
const observeHeightChange = (targetEl) => {
|
||||||
|
// 确保元素已挂载
|
||||||
|
if (!targetEl) return;
|
||||||
|
// 创建ResizeObserver实例
|
||||||
|
resizeObserver = new ResizeObserver((entries) => {
|
||||||
|
const calcH= getElementToBodyTop(tableHeightRef.value)
|
||||||
|
tableHeight.value= ('calc(100vh - '+(parseInt(calcH+160))+"px)")
|
||||||
|
if(document.querySelector('.el-table').style){
|
||||||
|
document.querySelector('.el-table').style.height=tableHeight.value
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 开始监听目标元素
|
||||||
|
resizeObserver.observe(targetEl);
|
||||||
|
};
|
||||||
const setLastAmountRowClass=(row,rowIndex)=>{
|
const setLastAmountRowClass=(row,rowIndex)=>{
|
||||||
if(row.isAmount===true){
|
if(row.isAmount===true){
|
||||||
return 'lastAmountRow'
|
return 'lastAmountRow'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const summaryMethod1=({columns,data})=>{
|
const summaryMethod1=({columns,data})=>{
|
||||||
// 1. 初始化汇总结果数组(和表格列数量一致)
|
// 1. 初始化汇总结果数组(和表格列数量一致)
|
||||||
const result = new Array(columns.length).fill("");
|
const result = new Array(columns.length).fill("");
|
||||||
@@ -173,6 +270,21 @@ const summaryMethod1=({columns,data})=>{
|
|||||||
})
|
})
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
const rowStyleMethod=({row,rowIndex})=>{
|
||||||
|
let styleObj={}
|
||||||
|
dictFieldList.value.forEach(item=>{
|
||||||
|
if(row[item.prop]){
|
||||||
|
styleObj['color']=item.dicData.find(d=>d.value===row[item.prop]).cssClass
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return styleObj
|
||||||
|
}
|
||||||
|
|
||||||
|
const cellClassNameMethod=({row,column,rowIndex,columnIndex})=>{
|
||||||
|
if(textAlignFiels.value[column.property]){
|
||||||
|
return 'textAlignCell'
|
||||||
|
}
|
||||||
|
}
|
||||||
function getCurrentDate() {
|
function getCurrentDate() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
// 补零函数:小于10则前面加0
|
// 补零函数:小于10则前面加0
|
||||||
@@ -204,19 +316,20 @@ const initTable = async () => {
|
|||||||
hideColumns.value=[]
|
hideColumns.value=[]
|
||||||
tableInfo.value = { ...reportVo, isPage, isHeight, isPermi, isHideExport }
|
tableInfo.value = { ...reportVo, isPage, isHeight, isPermi, isHideExport }
|
||||||
tableOption.value = {
|
tableOption.value = {
|
||||||
selection: !isHideExport,
|
selection: false,
|
||||||
reserveSelection: true,
|
reserveSelection: true,
|
||||||
menu: false,
|
menu: false,
|
||||||
addBtn: false,
|
addBtn: false,
|
||||||
height: isHeight ? 'auto' : undefined,
|
height: isHeight ? 'auto' : undefined,
|
||||||
calcHeight: isHeight ?10 : '',
|
calcHeight: isHeight ?10 : '',
|
||||||
index: reportVo.tableConfig.includes('index'),
|
index: reportVo.tableConfig.includes('index'),
|
||||||
|
indexLabel: '序号',
|
||||||
|
indexWidth: 54,
|
||||||
border: reportVo.tableConfig.includes('border'),
|
border: reportVo.tableConfig.includes('border'),
|
||||||
stripe: reportVo.tableConfig.includes('stripe'),
|
// stripe: reportVo.tableConfig.includes('stripe'),
|
||||||
showSummary:false,
|
showSummary:false,
|
||||||
|
|
||||||
stripe:true,
|
stripe:true,
|
||||||
|
searchBtnText:'查询',
|
||||||
column: {}
|
column: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +342,7 @@ const initTable = async () => {
|
|||||||
const fixedFields = apiFieldList.filter(f => f.isFixedColumn === 'Y')
|
const fixedFields = apiFieldList.filter(f => f.isFixedColumn === 'Y')
|
||||||
const dynamicFields = apiFieldList.filter(f => f.isFixedColumn !== 'Y')
|
const dynamicFields = apiFieldList.filter(f => f.isFixedColumn !== 'Y')
|
||||||
|
|
||||||
|
|
||||||
// 处理固定列
|
// 处理固定列
|
||||||
fixedFields.forEach((item) => {
|
fixedFields.forEach((item) => {
|
||||||
const config: any = {
|
const config: any = {
|
||||||
@@ -253,11 +367,14 @@ const initTable = async () => {
|
|||||||
childFieldConfigs.get(field.parentFieldCode).push(field)
|
childFieldConfigs.get(field.parentFieldCode).push(field)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// let tableDicData=[]
|
||||||
|
// if( dynamicFields.filter(item=>['货品名称','剂型名称'].includes(item.fieldName)&&item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y')?.length){
|
||||||
|
// tableDicData =await ReportApi.getTableList(props.reportCode)
|
||||||
|
|
||||||
|
// }
|
||||||
// 处理动态列(暂不构建children,等数据返回后动态生成)
|
// 处理动态列(暂不构建children,等数据返回后动态生成)
|
||||||
dynamicFields.forEach((item, index) => {
|
dynamicFields.forEach(async (item, index) => {
|
||||||
if (item.parentFieldCode && item.parentFieldCode !== '') return
|
if (item.parentFieldCode && item.parentFieldCode !== '') return
|
||||||
|
|
||||||
const config: any = {
|
const config: any = {
|
||||||
prop: item.fieldCode,
|
prop: item.fieldCode,
|
||||||
label: t(`${props.reportCode}.${item.fieldCode}`),
|
label: t(`${props.reportCode}.${item.fieldCode}`),
|
||||||
@@ -272,7 +389,7 @@ const initTable = async () => {
|
|||||||
if(item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y') isSearch.value=true
|
if(item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y') isSearch.value=true
|
||||||
if(!!item.searchDefaultValue){
|
if(!!item.searchDefaultValue){
|
||||||
if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){
|
if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){
|
||||||
tableSearch.value[config.prop]=getCurrentDate().year
|
tableSearch.value[config.prop]=getCurrentDate().year.toString()
|
||||||
}else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){
|
}else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){
|
||||||
tableSearch.value[config.prop]=new Date().getMonth() + 1
|
tableSearch.value[config.prop]=new Date().getMonth() + 1
|
||||||
}else if(item.fieldType=='Date'&&item.searchDefaultValue=='当日'){
|
}else if(item.fieldType=='Date'&&item.searchDefaultValue=='当日'){
|
||||||
@@ -280,12 +397,67 @@ const initTable = async () => {
|
|||||||
}else{
|
}else{
|
||||||
tableSearch.value[config.prop]=item.searchDefaultValue
|
tableSearch.value[config.prop]=item.searchDefaultValue
|
||||||
}
|
}
|
||||||
|
defualtSearch.value[config.prop]=tableSearch.value[config.prop]
|
||||||
}
|
}
|
||||||
if(['年','年度','年份','月','月度','月份','年月'].includes(item.fieldName)){
|
|
||||||
config.searchSpan=3
|
|
||||||
config.searchLabelWidth=60
|
|
||||||
|
|
||||||
|
if(['年','年度','年份','月','月度','月份','年月'].includes(item.fieldName)&&config.search){
|
||||||
|
config.searchSpan=3
|
||||||
|
if(item.fieldName.includes('年')){
|
||||||
|
config.searchType='year'
|
||||||
|
config.valueFormat = 'YYYY'
|
||||||
|
}else if(item.fieldName.includes('月')){
|
||||||
|
config.searchType='select'
|
||||||
|
config.dicData=[{label:'1月',value:'1'},{label:'2月',value:'2'},{label:'3月',value:'3'},{label:'4月',value:'4'},{label:'5月',value:'5'},{label:'6月',value:'6'},{label:'7月',value:'7'},{label:'8月',value:'8'},{label:'9月',value:'9'},{label:'10月',value:'10'},{label:'11月',value:'11'},{label:'12月',value:'12'}]
|
||||||
}
|
}
|
||||||
|
if(props.reportCode=='ZHXSQK'&&item.isDimension=='Y'){
|
||||||
|
tableSearch.value['Group by'].push(item.fieldCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(item.fieldName=='效期剩余时间(天)分类') config.searchSpan=5
|
||||||
|
|
||||||
|
if(config.search) config.searchLabelWidth=item.fieldName.length*12 +40
|
||||||
|
const moreIn="MORE_IN".includes(item.queryMode)
|
||||||
|
config.searchType=moreIn?'select':config.searchType
|
||||||
|
config.multiple=config.collapseTags=config.collapseTagsTooltip =moreIn
|
||||||
|
item.queryMode=='LIKE'?config.multiple=config.collapseTags=config.collapseTagsTooltip =true:''
|
||||||
|
const jkTableDicFields={
|
||||||
|
'货品名称':'hpmx',
|
||||||
|
'货品':'hpmx',
|
||||||
|
'剂型':'jxjk',
|
||||||
|
'产品':'hpmx',
|
||||||
|
'产品名称':'hpmx',
|
||||||
|
'剂型名称':'jxjk',
|
||||||
|
'客户名称':'khxx',
|
||||||
|
'销售类型':'xslx',
|
||||||
|
'客户':'khxx',
|
||||||
|
'业务员':'ywyxx',
|
||||||
|
'业务区域':'ywqy',
|
||||||
|
'标准品名':'bzpm',
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Object.keys(jkTableDicFields).includes(item.fieldName)&&config.search){
|
||||||
|
config.dataType= 'string'
|
||||||
|
config.reportCode= `${jkTableDicFields[item.fieldName]}`
|
||||||
|
const formatterData=(res) => { //请求数据格式化
|
||||||
|
const arr=[...new Set(res.records.map(item=>item[transferFields[config.prop]?transferFields[config.prop]:config.prop]))]
|
||||||
|
return arr.map(item=>({label:item,value:item}))
|
||||||
|
}
|
||||||
|
ReportApi.getTableList(jkTableDicFields[item.fieldName],{pageSize: 50, pageNo:1}).then(res=>{
|
||||||
|
config.dicData=formatterData(res)
|
||||||
|
})
|
||||||
|
config.formatterDic=formatterData
|
||||||
|
searchReportSlots.value.push(config.prop)
|
||||||
|
// config.multiple?tableSearch.value[config.prop]=item.searchDefaultValue?item.searchDefaultValue.split(','):[]:''
|
||||||
|
}
|
||||||
|
if(item.dictCode){
|
||||||
|
const dictData=getStrDictOptions(item.dictCode)
|
||||||
|
config.dicData=dictData
|
||||||
|
config.searchType= 'select'
|
||||||
|
config.dataType= 'string'
|
||||||
|
dictFieldList.value.push(config)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!!item.isAmount){
|
if(!!item.isAmount){
|
||||||
index==0?amountFieds.value.fistField=config.prop:''
|
index==0?amountFieds.value.fistField=config.prop:''
|
||||||
amountFieds.value[item.isAmount]=config
|
amountFieds.value[item.isAmount]=config
|
||||||
@@ -293,12 +465,13 @@ const initTable = async () => {
|
|||||||
}
|
}
|
||||||
if(item.width){
|
if(item.width){
|
||||||
config.width=item.width
|
config.width=item.width
|
||||||
|
config.widthOld=item.width
|
||||||
}
|
}
|
||||||
if(item.isDimension=='Y'){
|
if(item.isDimension=='Y'){
|
||||||
dimensionFields.value[config.prop]=config
|
dimensionFields.value[config.prop]=config
|
||||||
hideFeilds.value[config.prop]=item.isHideDimension
|
hideFeilds.value[config.prop]=item.isHideDimension
|
||||||
}
|
}
|
||||||
if(item.isHideCol == 'Y') {
|
if(item.isHideCol == 'Y') {hideCols.value.push(config.prop)
|
||||||
config.hide = true
|
config.hide = true
|
||||||
hideColumns.value.push(config.prop)
|
hideColumns.value.push(config.prop)
|
||||||
}
|
}
|
||||||
@@ -363,6 +536,7 @@ const initTableLayout = () => {
|
|||||||
timerObj.value.layout = setTimeout(() => {
|
timerObj.value.layout = setTimeout(() => {
|
||||||
if (crudRef.value) crudRef.value.getTableHeight()
|
if (crudRef.value) crudRef.value.getTableHeight()
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionChange = (data) => {
|
const selectionChange = (data) => {
|
||||||
@@ -402,17 +576,21 @@ const getSearchData = () => {
|
|||||||
resolve(searchObj)
|
resolve(searchObj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const computedIncluedes=(row,prop)=>{
|
||||||
|
return (typeof row[prop])==='string'&&(row[prop].includes('🔴')||row[prop].includes('🟢'))
|
||||||
|
}
|
||||||
const getTableData = async (isLoading = true) => {
|
const getTableData = async (isLoading = true) => {
|
||||||
if (timerObj.value.getTableData) clearTimeout(timerObj.value.getTableData)
|
if (timerObj.value.getTableData) clearTimeout(timerObj.value.getTableData)
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
timerObj.value.getTableData = setTimeout(() => resolve(true), 100)
|
timerObj.value.getTableData = setTimeout(() => resolve(true), 100)
|
||||||
})
|
})
|
||||||
|
textAlignFiels.value={}
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
if (isLoading) loading.value = true
|
if (isLoading) loading.value = true
|
||||||
const searchObj = await getSearchData()
|
const searchObj = await getSearchData()
|
||||||
try {
|
try {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
|
||||||
let data = await ReportApi.getTableList(props.reportCode, searchObj)
|
let data = await ReportApi.getTableList(props.reportCode, searchObj)
|
||||||
|
|
||||||
// 功能测试:CS_DTBT报表使用模拟数据
|
// 功能测试:CS_DTBT报表使用模拟数据
|
||||||
@@ -430,7 +608,6 @@ const getTableData = async (isLoading = true) => {
|
|||||||
{ "yuefen": "五月", "benyue": 333, "leiji": 444 },
|
{ "yuefen": "五月", "benyue": 333, "leiji": 444 },
|
||||||
{ "yuefen": "六月", "benyue": 555, "leiji": 555 },
|
{ "yuefen": "六月", "benyue": 555, "leiji": 555 },
|
||||||
{ "yuefen": "六月", "benyue": 666, "leiji": 666 },
|
{ "yuefen": "六月", "benyue": 666, "leiji": 666 },
|
||||||
|
|
||||||
],
|
],
|
||||||
total: 6
|
total: 6
|
||||||
}
|
}
|
||||||
@@ -555,9 +732,10 @@ const getTableData = async (isLoading = true) => {
|
|||||||
// 没有分组字段,直接处理数据
|
// 没有分组字段,直接处理数据
|
||||||
processedData = data.records.map((record, recordIndex) => {
|
processedData = data.records.map((record, recordIndex) => {
|
||||||
const flatRecord = { ...record }
|
const flatRecord = { ...record }
|
||||||
|
|
||||||
// 处理固定列
|
// 处理固定列
|
||||||
fieldList.value.forEach(field => {
|
fieldList.value.forEach(field => {
|
||||||
|
computedIncluedes(record,field.fieldCode)&&!textAlignFiels.value[field.fieldCode]?textAlignFiels.value[field.fieldCode]=true:''
|
||||||
|
|
||||||
if (field.isFixedColumn === 'Y' && field.fixedColumnValue) {
|
if (field.isFixedColumn === 'Y' && field.fixedColumnValue) {
|
||||||
const fixedValues = field.fixedColumnValue.split(',')
|
const fixedValues = field.fixedColumnValue.split(',')
|
||||||
flatRecord[field.fieldCode] = fixedValues[recordIndex] || ''
|
flatRecord[field.fieldCode] = fixedValues[recordIndex] || ''
|
||||||
@@ -569,33 +747,53 @@ const getTableData = async (isLoading = true) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tableData.value = processedData
|
tableData.value = processedData
|
||||||
// amountFieds.value={
|
Object.values(tableOption.value.column).forEach( item=>{
|
||||||
// 'thissaqty_s':{
|
let oldHide=hideCols.value.indexOf(item.prop)!==-1
|
||||||
// prop:'thissaqty',
|
item.hide=tableData.value[0]&&((tableSearch.value['Group by']&&tableData.value[0][item.prop]===undefined&&!item.children)||(item.children?.every(child=>(!['yearplan','yearrate'].includes(child.prop))&&(tableData.value[0][child.prop]===undefined))))||oldHide
|
||||||
// },
|
const prH=hideColumns.value.indexOf(item.prop)
|
||||||
// "monthsaqty_s":{
|
item.hide?(prH===-1?hideColumns.value.push(item.prop):''):(prH!==-1&&hideCols.value.indexOf(item.prop)===-1?hideColumns.value.splice(prH,1):'')
|
||||||
// prop:'monthsaqty',
|
})
|
||||||
//},
|
|
||||||
//'lastsaqty_s':{
|
|
||||||
// prop:'lastsaqty'
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
//tableData.value[0]['thissaqty_s']=6083195687
|
|
||||||
// tableData.value[0]['monthsaqty_s']=972705058
|
|
||||||
// tableData.value[0]['lastsaqty_s']=6075936725
|
|
||||||
|
|
||||||
let keys=Object.keys(amountFieds.value)
|
let keys=Object.keys(amountFieds.value)
|
||||||
if(!!keys.length&&!!tableData.value.length){
|
if(!!keys.length&&!!tableData.value.length){
|
||||||
let obj={isAmount:true}
|
let obj={isAmount:true}
|
||||||
|
let value={...tableData.value[0]}
|
||||||
|
if(tableInfo.value.reportCode==='ZHXSQK'){
|
||||||
|
value=(await ReportApi.getAggMonthTotalDetail(searchObj))[0]
|
||||||
|
// searchObj['usemonth']?'':value.thisMonthSaMoney_s=value.thissamoney_s
|
||||||
|
|
||||||
|
}
|
||||||
keys.forEach(item=>{
|
keys.forEach(item=>{
|
||||||
let key=amountFieds.value[item].prop
|
let key=amountFieds.value[item].prop
|
||||||
key!=='fistField'?obj[key]=tableData.value[0][item]:''
|
key!=='fistField'?obj[key]=value[item]:''
|
||||||
})
|
})
|
||||||
amountObj.value=obj
|
amountObj.value=obj
|
||||||
}
|
}
|
||||||
|
let field=tableSearch.value['Group by']
|
||||||
|
let hides=[]
|
||||||
|
if(field.length){
|
||||||
|
field.forEach(item=>{
|
||||||
|
hides=Object.keys(hideFeilds.value).length?hideFeilds.value[item].split(','):[]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Object.keys(tableOption.value.column).forEach(key=>{
|
||||||
|
let item=tableOption.value.column[key]
|
||||||
|
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
||||||
|
})
|
||||||
|
Object.keys(tableOption.value.column).forEach(key=>{
|
||||||
|
const showCols=Object.values(tableOption.value.column).filter(item=>!item.hide)
|
||||||
|
let item=tableOption.value.column[key]
|
||||||
|
item.children?'':(item.width=showCols.length<14?undefined:item.widthOld)
|
||||||
|
item.children?.forEach(child=>{
|
||||||
|
child.width=showCols.length<14?undefined:child.widthOld
|
||||||
|
})
|
||||||
|
})
|
||||||
resolve(data.records)
|
resolve(data.records)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
if (isLoading) loading.value = false
|
if (isLoading) loading.value = false
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -640,24 +838,18 @@ const clearSearch = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchChange = (params?, done?) => {
|
const searchChange = async (params?, done?) => {
|
||||||
if (tablePage.value) tablePage.value['currentPage'] = 1
|
if (tablePage.value) tablePage.value['currentPage'] = 1
|
||||||
getTableData().finally(() => {
|
await getTableData()
|
||||||
let field=tableSearch.value['Group by']
|
|
||||||
let hides=[]
|
|
||||||
if(field.length){
|
|
||||||
hides=Object.keys(hideFeilds.value).length?hideFeilds.value[field].split(','):[]
|
|
||||||
}
|
|
||||||
Object.keys(tableOption.value.column).forEach(key=>{
|
|
||||||
let item=tableOption.value.column[key]
|
|
||||||
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
|
||||||
})
|
|
||||||
if (done) done()
|
if (done) done()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const resetChange = () => {
|
const resetChange = () => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
tableSearch.value = {}
|
tableSearch.value = {
|
||||||
|
'Group by':tableSearch.value['Group by']||[],
|
||||||
|
...defualtSearch.value
|
||||||
|
}
|
||||||
if (tablePage.value) tablePage.value['currentPage'] = 1
|
if (tablePage.value) tablePage.value['currentPage'] = 1
|
||||||
await getTableData()
|
await getTableData()
|
||||||
resolve(true)
|
resolve(true)
|
||||||
@@ -710,6 +902,15 @@ defineExpose({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-form-item--default){
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
:deep(.avue-crud__pagination){
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
:deep(.avue-crud__tip){
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
.amountBox{
|
.amountBox{
|
||||||
&::after{
|
&::after{
|
||||||
content:'、'
|
content:'、'
|
||||||
@@ -720,6 +921,36 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.el-table){
|
||||||
|
.is-group th.el-table__cell,th.el-table__cell{
|
||||||
|
background-color: #C6EFFE;
|
||||||
|
}
|
||||||
|
.el-table__body tr.hover-row>td.el-table__cell{
|
||||||
|
background-color: #FFFFD2;
|
||||||
|
|
||||||
|
}
|
||||||
|
&.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
|
||||||
|
background-color: #FFFFD2;
|
||||||
|
}
|
||||||
|
td.el-table__cell,th.el-table__cell{
|
||||||
|
border-bottom: 1px solid #000 !important;
|
||||||
|
|
||||||
|
border-right: 1px solid #000 !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
td.textAlignCell .cell{
|
||||||
|
span{
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--el-table-border-color: #000;
|
||||||
|
tfoot .el-table__cell{
|
||||||
|
border-top: 1px solid #000 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lastAmountRow{
|
.lastAmountRow{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ const btnData = computed(() => {
|
|||||||
if (!btnObj[key].display) continue
|
if (!btnObj[key].display) continue
|
||||||
btn[key] = btnObj[key]
|
btn[key] = btnObj[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
return { [props.type]: btn }
|
return { [props.type]: btn }
|
||||||
} else {
|
} else {
|
||||||
const menuObj = cloneDeep(props.buttonObj.menu)
|
const menuObj = cloneDeep(props.buttonObj.menu)
|
||||||
@@ -95,6 +96,12 @@ const btnData = computed(() => {
|
|||||||
if (props.row && props.row[`$btn__${key}`] !== undefined) {
|
if (props.row && props.row[`$btn__${key}`] !== undefined) {
|
||||||
menuObj[key].display = props.row[`$btn__${key}`]
|
menuObj[key].display = props.row[`$btn__${key}`]
|
||||||
}
|
}
|
||||||
|
if(props.buttonObj.setConfig&&props.row){
|
||||||
|
let data= props.buttonObj.setConfig(props.row)
|
||||||
|
Object.keys(data).forEach(key => {
|
||||||
|
menuObj[key]={ ...menuObj[key],...data[key]}
|
||||||
|
})
|
||||||
|
}
|
||||||
if (!menuObj[key].display) continue
|
if (!menuObj[key].display) continue
|
||||||
if (props.type == 'more' && Object.keys(menu).length >= (props.maxNum || 1)) {
|
if (props.type == 'more' && Object.keys(menu).length >= (props.maxNum || 1)) {
|
||||||
more[key] = menuObj[key]
|
more[key] = menuObj[key]
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ const getTableData = async () => {
|
|||||||
})
|
})
|
||||||
if (userIds.length) {
|
if (userIds.length) {
|
||||||
const dicRes = await DicApi.getDicTableText({
|
const dicRes = await DicApi.getDicTableText({
|
||||||
lideeYunji_dictLabel: encryptAES(JSON.stringify([{ userIdList: [...new Set(userIds)] }]))
|
lideeYunJi_dictLabel: encryptAES(JSON.stringify([{ userIdList: [...new Set(userIds)] }]))
|
||||||
})
|
})
|
||||||
if (dicRes?.userList) {
|
if (dicRes?.userList) {
|
||||||
dicRes.userList.forEach((item) => (userObj[item.id] = item.nickname))
|
dicRes.userList.forEach((item) => (userObj[item.id] = item.nickname))
|
||||||
|
|||||||
@@ -1618,6 +1618,12 @@ const beforeOpen = async (done, type) => {
|
|||||||
const beforeClose = async (done, type) => {
|
const beforeClose = async (done, type) => {
|
||||||
tableCurrRow.value = {}
|
tableCurrRow.value = {}
|
||||||
tableCurrType.value = ''
|
tableCurrType.value = ''
|
||||||
|
try {
|
||||||
|
if (jsEnhanceObj.value.beforeFormData)
|
||||||
|
jsEnhanceObj.value.beforeFormData({}, type,'close')
|
||||||
|
} catch (error) {
|
||||||
|
enhanceErrorTip('js增强【beforeFormData】方法执行异常,请检查', error)
|
||||||
|
}
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1897,6 +1903,16 @@ const initEnhanceUseFun = () => {
|
|||||||
if (!curConfig) enhanceErrorTip(`调用useFun.setPropConfig方法,未找到字段:${prop}`, '')
|
if (!curConfig) enhanceErrorTip(`调用useFun.setPropConfig方法,未找到字段:${prop}`, '')
|
||||||
else setDeepObject(curConfig, config)
|
else setDeepObject(curConfig, config)
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 设置按钮配置
|
||||||
|
* @param prop 数据绑定key
|
||||||
|
* @param config 需修改的配置,非覆盖,格式Object,支持深结构修改 例:'params.deep.deep'
|
||||||
|
*/
|
||||||
|
setMenuButtonConfig: (prop, config) => {
|
||||||
|
if(buttonObj.value){
|
||||||
|
setDeepObject(buttonObj.value, config)
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 设置附表控件配置
|
* 设置附表控件配置
|
||||||
* @param prop 数据绑定key
|
* @param prop 数据绑定key
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ export const formDataFormatting = (formOption, formData, formType) => {
|
|||||||
}
|
}
|
||||||
if (dicApiData.length) {
|
if (dicApiData.length) {
|
||||||
DicApi.getDicTableText({
|
DicApi.getDicTableText({
|
||||||
lideeYunji_dictLabel: encryptAES(JSON.stringify(dicApiData))
|
lideeYunJi_dictLabel: encryptAES(JSON.stringify(dicApiData))
|
||||||
}).then(dicData => {
|
}).then(dicData => {
|
||||||
const dictData = {
|
const dictData = {
|
||||||
userList: { dicKey: 'userSelect', label: 'nickname' },
|
userList: { dicKey: 'userSelect', label: 'nickname' },
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const setUserAndDeptName = (params) => {
|
|||||||
userList: { dicKey: 'userSelect', label: 'nickname' },
|
userList: { dicKey: 'userSelect', label: 'nickname' },
|
||||||
deptList: { dicKey: 'deptSelect', label: 'name' }
|
deptList: { dicKey: 'deptSelect', label: 'name' }
|
||||||
}
|
}
|
||||||
getDicTableText({ lideeYunji_dictLabel: encryptAES(JSON.stringify(dictLabel)) }).then(
|
getDicTableText({ lideeYunJi_dictLabel: encryptAES(JSON.stringify(dictLabel)) }).then(
|
||||||
(dicData) => {
|
(dicData) => {
|
||||||
for (const key in dicData) {
|
for (const key in dicData) {
|
||||||
const dicObj = {}
|
const dicObj = {}
|
||||||
|
|||||||
@@ -886,7 +886,7 @@ export const tableFormatting = (data, column, otherData: any = {}) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//查询回显文本
|
//查询回显文本
|
||||||
const dicApiData: any = { lideeYunji_dictLabel: [] }
|
const dicApiData: any = { lideeYunJi_dictLabel: [] }
|
||||||
if (dicTableData.keyList.length) {
|
if (dicTableData.keyList.length) {
|
||||||
const dicTableApiData: Array<string> = []
|
const dicTableApiData: Array<string> = []
|
||||||
dicTableData.keyList.forEach(key => {
|
dicTableData.keyList.forEach(key => {
|
||||||
@@ -899,17 +899,17 @@ export const tableFormatting = (data, column, otherData: any = {}) => {
|
|||||||
dicTableData[key].dataList = [...new Set(dicTableData[key].dataList)].filter((id: string) => !lowStore.dicObj[key] ? true : !lowStore.dicObj[key][id])
|
dicTableData[key].dataList = [...new Set(dicTableData[key].dataList)].filter((id: string) => !lowStore.dicObj[key] ? true : !lowStore.dicObj[key][id])
|
||||||
if (dicTableData[key].dataList.length) dicTableApiData.push(dicTableData[key])
|
if (dicTableData[key].dataList.length) dicTableApiData.push(dicTableData[key])
|
||||||
})
|
})
|
||||||
dicApiData.lideeYunji_dictLabel.push(...dicTableApiData)
|
dicApiData.lideeYunJi_dictLabel.push(...dicTableApiData)
|
||||||
}
|
}
|
||||||
for (const key in userAndDeptControl.typeKey) {
|
for (const key in userAndDeptControl.typeKey) {
|
||||||
const abbr = userAndDeptControl.typeKey[key]
|
const abbr = userAndDeptControl.typeKey[key]
|
||||||
userAndDeptControl[`${abbr}Ids`] = userAndDeptControl[`${abbr}Ids`].filter(id => {
|
userAndDeptControl[`${abbr}Ids`] = userAndDeptControl[`${abbr}Ids`].filter(id => {
|
||||||
return /^(\d+)$/.test(id + '')
|
return /^(\d+)$/.test(id + '')
|
||||||
})
|
})
|
||||||
if (userAndDeptControl[`${abbr}Ids`].length) dicApiData.lideeYunji_dictLabel.push({ [`${abbr}IdList`]: [...new Set(userAndDeptControl[`${abbr}Ids`])] })
|
if (userAndDeptControl[`${abbr}Ids`].length) dicApiData.lideeYunJi_dictLabel.push({ [`${abbr}IdList`]: [...new Set(userAndDeptControl[`${abbr}Ids`])] })
|
||||||
}
|
}
|
||||||
if (dicApiData.lideeYunji_dictLabel.length) {
|
if (dicApiData.lideeYunJi_dictLabel.length) {
|
||||||
dicApiData.lideeYunji_dictLabel = encryptAES(JSON.stringify(dicApiData.lideeYunji_dictLabel))
|
dicApiData.lideeYunJi_dictLabel = encryptAES(JSON.stringify(dicApiData.lideeYunJi_dictLabel))
|
||||||
const dictData = {
|
const dictData = {
|
||||||
userList: { dicKey: 'userSelect', label: 'nickname', value: 'id' },
|
userList: { dicKey: 'userSelect', label: 'nickname', value: 'id' },
|
||||||
deptList: { dicKey: 'deptSelect', label: 'name', value: 'id' }
|
deptList: { dicKey: 'deptSelect', label: 'name', value: 'id' }
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ const elementHover = (element) => {
|
|||||||
<p>部门:${processInstance.value.startUser.deptName}</p>
|
<p>部门:${processInstance.value.startUser.deptName}</p>
|
||||||
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
||||||
} else if (element.value.type === 'bpmn:UserTask') {
|
} else if (element.value.type === 'bpmn:UserTask') {
|
||||||
// debugger
|
|
||||||
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||||
if (!task) {
|
if (!task) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ const formatComponentInstance = (component, route) => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section
|
<section
|
||||||
|
style="padding-bottom:0"
|
||||||
:class="[
|
:class="[
|
||||||
'flex-1 p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]'
|
'flex-1 p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]'
|
||||||
]"
|
]"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useDictStoreWithOut } from '@/store/modules/dict'
|
|||||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||||
import { useLowStoreWithOut } from '@/store/modules/low'
|
import { useLowStoreWithOut } from '@/store/modules/low'
|
||||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||||
|
import * as authUtil from '@/utils/auth'
|
||||||
const { start, done } = useNProgress()
|
const { start, done } = useNProgress()
|
||||||
|
|
||||||
const { loadStart, loadDone } = usePageLoading()
|
const { loadStart, loadDone } = usePageLoading()
|
||||||
@@ -63,7 +63,24 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
loadStart()
|
loadStart()
|
||||||
if (getAccessToken()) {
|
if (getAccessToken()) {
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
|
const ticketUrl = queryParams.get('url');
|
||||||
|
const ssUrl = queryParams.get('ssUrl');
|
||||||
|
|
||||||
|
if(ticketUrl!=null&&ssUrl==null){
|
||||||
|
next()
|
||||||
|
}else if(ticketUrl!=null&&ssUrl!==null){
|
||||||
|
const accessToken =authUtil.getAccessToken();
|
||||||
|
if(accessToken!=null){
|
||||||
|
const urll=ticketUrl+"?ticket="+accessToken;
|
||||||
|
window.location.href = urll+(ssUrl?"&redirect="+ssUrl:'');
|
||||||
|
}else{
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
next({ path: '/' })
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 获取所有字典
|
// 获取所有字典
|
||||||
const dictStore = useDictStoreWithOut()
|
const dictStore = useDictStoreWithOut()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const setupAvue = async (app: App<Element>) => {
|
|||||||
searchSpan: 6,
|
searchSpan: 6,
|
||||||
searchMenuSpan: 6,
|
searchMenuSpan: 6,
|
||||||
searchMenuPosition: 'left',
|
searchMenuPosition: 'left',
|
||||||
searchIndex: 3,
|
searchIndex: 4,
|
||||||
searchIcon: true,
|
searchIcon: true,
|
||||||
searchShowBtn: true,
|
searchShowBtn: true,
|
||||||
labelSuffix: ' ',
|
labelSuffix: ' ',
|
||||||
|
|||||||
@@ -50,9 +50,11 @@
|
|||||||
|
|
||||||
--app-content-bg-color: #f5f7f9;
|
--app-content-bg-color: #f5f7f9;
|
||||||
|
|
||||||
--app-footer-height: 50px;
|
--app-footer-height: 30px;
|
||||||
|
|
||||||
--transition-time-02: 0.2s;
|
--transition-time-02: 0.2s;
|
||||||
|
|
||||||
|
--el-fill-color-lighter: #F5F5F6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
|
|||||||
@@ -89,9 +89,6 @@ export default {
|
|||||||
appsData: []
|
appsData: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.fetchApps()
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
categorizedApps() {
|
categorizedApps() {
|
||||||
const result = {};
|
const result = {};
|
||||||
@@ -135,6 +132,9 @@ export default {
|
|||||||
return Object.keys(this.filteredCategories).length;
|
return Object.keys(this.filteredCategories).length;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchApps()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchApps() {
|
async fetchApps() {
|
||||||
try {
|
try {
|
||||||
@@ -155,7 +155,8 @@ export default {
|
|||||||
handleAppClick(app) {
|
handleAppClick(app) {
|
||||||
const uri = Array.isArray(app.redirectUris) ? app.redirectUris[0] : app.redirectUris
|
const uri = Array.isArray(app.redirectUris) ? app.redirectUris[0] : app.redirectUris
|
||||||
if (uri) {
|
if (uri) {
|
||||||
window.location.href = uri
|
window.open(uri,'_blank');
|
||||||
|
// window.location.href = uri
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('未配置重定向地址')
|
this.$message.warning('未配置重定向地址')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ const newClass = computed(() => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$prefix-cls: #{$namespace}-login;
|
$prefix-cls: #{$namespace}-login;
|
||||||
|
.bg-\#fff{
|
||||||
|
--un-bg-opacity: 0.3;
|
||||||
|
}
|
||||||
.#{$prefix-cls} {
|
.#{$prefix-cls} {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
mode="pop"
|
mode="pop"
|
||||||
@success="handleLogin"
|
@success="handleLogin"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -141,7 +140,6 @@ const loginData = reactive({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
const getCode = async () => {
|
const getCode = async () => {
|
||||||
// 情况一,未开启:则直接登录
|
// 情况一,未开启:则直接登录
|
||||||
@@ -174,7 +172,6 @@ const getCookie = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据域名,获得租户信息
|
// 根据域名,获得租户信息
|
||||||
const getTenantByWebsite = async () => {
|
const getTenantByWebsite = async () => {
|
||||||
const website = location.host
|
const website = location.host
|
||||||
@@ -189,7 +186,6 @@ const loading = ref() // ElLoading.service 返回的实例
|
|||||||
const handleLogin = async (params) => {
|
const handleLogin = async (params) => {
|
||||||
loginLoading.value = true
|
loginLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const data = await validForm()
|
const data = await validForm()
|
||||||
if (!data) return
|
if (!data) return
|
||||||
|
|
||||||
@@ -210,9 +206,8 @@ const handleLogin = async (params) => {
|
|||||||
authUtil.removeLoginForm()
|
authUtil.removeLoginForm()
|
||||||
}
|
}
|
||||||
authUtil.setToken(res)
|
authUtil.setToken(res)
|
||||||
debugger
|
|
||||||
if (!redirect.value) {
|
|
||||||
|
|
||||||
|
if (!redirect.value) {
|
||||||
redirect.value = '/'
|
redirect.value = '/'
|
||||||
}
|
}
|
||||||
// 判断是否为SSO登录
|
// 判断是否为SSO登录
|
||||||
@@ -222,18 +217,20 @@ const handleLogin = async (params) => {
|
|||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value
|
const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value
|
||||||
const accessToken =authUtil.getAccessToken();
|
const accessToken =authUtil.getAccessToken();
|
||||||
debugger
|
|
||||||
console.log(accessToken);
|
console.log(accessToken);
|
||||||
if(ticketUrl!=null){
|
if(ticketUrl!=null){
|
||||||
var urll=ticketUrl+"?ticket="+accessToken;
|
|
||||||
window.location.href = urll
|
|
||||||
}else{
|
|
||||||
|
|
||||||
|
var urll=ticketUrl+"?ticket="+accessToken;
|
||||||
|
var ssUrl=queryParams.get('ssUrl')
|
||||||
|
window.location.href = urll+(ssUrl?"&redirect="+ssUrl:'');
|
||||||
|
}else{
|
||||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
|||||||
@@ -164,14 +164,14 @@ const infoColumn = {
|
|||||||
dictCode: { title: '字典Code', width: 180, editRender: { name: 'LowSelect', verifyEdit: true, filterable: true, noStop: true, dicData: [] } },
|
dictCode: { title: '字典Code', width: 180, editRender: { name: 'LowSelect', verifyEdit: true, filterable: true, noStop: true, dicData: [] } },
|
||||||
isExport: { title: '是否可导出', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
isExport: { title: '是否可导出', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
isHideCol: { title: '隐藏列', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
isHideCol: { title: '隐藏列', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
isHideSearch: { title: '隐藏搜索', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
// isHideSearch: { title: '隐藏搜索', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
isAmount: { title: '是否合计', width: 75, align: "center", editRender: { name: 'LowCheckboxSum' } },
|
isAmount: { title: '是否合计', width: 75, align: "center", editRender: { name: 'LowCheckboxSum' } },
|
||||||
isDimension: { title: '是否维度', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
isDimension: { title: '是否维度', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
|
|
||||||
isHideDimension: { title: '维度隐藏列', width: 180, editRender: { name: 'LowSelectMultiple', verifyEdit: true, filterable: true, multiple:true,dicData: [] } },
|
isHideDimension: { title: '维度隐藏列', width: 180, editRender: { name: 'LowSelectMultiple', verifyEdit: true, filterable: true, multiple:true,dicData: [] } },
|
||||||
isShowSort: { title: '是否排序', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
isShowSort: { title: '是否排序', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
isDynamicGroup: { title: '动态分组', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
//isDynamicGroup: { title: '动态分组', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
hasChildren: { title: '子字段', width: 90, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isSubField === true, buttonText: '添加子字段', buttonType: 'primary', buttonSize: 'small' } },
|
//hasChildren: { title: '子字段', width: 90, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isSubField === true, buttonText: '添加子字段', buttonType: 'primary', buttonSize: 'small' } },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -354,7 +354,6 @@ const tableFormVerify = (type) => {
|
|||||||
let tabKey = 'mysql'
|
let tabKey = 'mysql'
|
||||||
// 子字段不能再包含子字段
|
// 子字段不能再包含子字段
|
||||||
if (item.isSubField && item.hasChildren === 'Y') {
|
if (item.isSubField && item.hasChildren === 'Y') {
|
||||||
debugger
|
|
||||||
messageText = `<div style="line-height:24px">
|
messageText = `<div style="line-height:24px">
|
||||||
<div>子字段不能包含子字段</div>
|
<div>子字段不能包含子字段</div>
|
||||||
<div>序号:${index + 1}</div>
|
<div>序号:${index + 1}</div>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
:row-class-name="rowClassName"
|
:row-class-name="rowClassName"
|
||||||
@checkbox-all="(obj) => emit('selection-change', obj)"
|
@checkbox-all="(obj) => emit('selection-change', obj)"
|
||||||
@checkbox-change="(obj) => emit('selection-change', obj)"
|
@checkbox-change="(obj) => emit('selection-change', obj)"
|
||||||
@cell-click="(obj) => emit('cell-click', obj)"
|
@cell-click="cellClick"
|
||||||
>
|
>
|
||||||
<vxe-column v-if="tabItem.edit" type="checkbox" width="50" align="center"></vxe-column>
|
<vxe-column v-if="tabItem.edit" type="checkbox" width="50" align="center"></vxe-column>
|
||||||
<vxe-column type="seq" width="50" align="center"></vxe-column>
|
<vxe-column type="seq" width="50" align="center"></vxe-column>
|
||||||
@@ -106,7 +106,16 @@ const testClick = (row) => {
|
|||||||
console.log('测试按钮被点击:', row)
|
console.log('测试按钮被点击:', row)
|
||||||
alert('测试按钮工作正常!')
|
alert('测试按钮工作正常!')
|
||||||
}
|
}
|
||||||
|
const cellClick = (obj) => {
|
||||||
|
const scrollLeft = vxeTableRef.value.getScroll().scrollLeft
|
||||||
|
const scrollTop = vxeTableRef.value.getScroll().scrollTop
|
||||||
|
emit('cell-click', obj)
|
||||||
|
nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
vxeTableRef.value.scrollTo(scrollLeft,scrollTop)
|
||||||
|
}, 1)
|
||||||
|
})
|
||||||
|
}
|
||||||
defineExpose({ vxeTableRef })
|
defineExpose({ vxeTableRef })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user