Compare commits
30 Commits
main_beta
...
40b95aae29
| Author | SHA1 | Date | |
|---|---|---|---|
| 40b95aae29 | |||
| 81813cbdb6 | |||
|
|
863def2d7a | ||
|
|
1dcfeed999 | ||
| ed058096be | |||
|
|
47168c77d8 | ||
|
|
a8db600e90 | ||
|
|
baf731526f | ||
|
|
c8d7fdd0f6 | ||
|
|
c47dba53d9 | ||
|
|
e44d018f20 | ||
| 51922734ba | |||
|
|
1af5fbd87c | ||
|
|
f2b5dd2a8d | ||
| 36b4608ddf | |||
| 49c5d07b65 | |||
| dced583c7f | |||
| aa853f539b | |||
| e7dd16454c | |||
|
|
b40163b2e7 | ||
|
|
cecaaacf4b | ||
|
|
76987e8ea6 | ||
|
|
7555c7093d | ||
| 5ae5353baa | |||
|
|
09a300e98a | ||
|
|
7a496e6407 | ||
| e69cffbdb6 | |||
|
|
bcac3326a3 | ||
| f9393dfca8 | |||
| 67fe2e22fc |
2
.env
2
.env
@@ -1,5 +1,5 @@
|
|||||||
# 标题
|
# 标题
|
||||||
VITE_APP_TITLE=国瑞报表系统
|
VITE_APP_TITLE=国瑞药业报表系统
|
||||||
|
|
||||||
# 项目本地运行端口号
|
# 项目本地运行端口号
|
||||||
VITE_PORT=80
|
VITE_PORT=80
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ VITE_NODE_ENV=production
|
|||||||
VITE_DEV=false
|
VITE_DEV=false
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://127.0.0.1:48080'
|
VITE_BASE_URL='http://192.168.1.241'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|||||||
BIN
src/assets/imgs/background.jpg
Normal file
BIN
src/assets/imgs/background.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 KiB |
BIN
src/assets/imgs/jsc.png
Normal file
BIN
src/assets/imgs/jsc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
BIN
src/assets/imgs/sjzt.png
Normal file
BIN
src/assets/imgs/sjzt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/imgs/szls.png
Normal file
BIN
src/assets/imgs/szls.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
src/assets/imgs/wlzt.png
Normal file
BIN
src/assets/imgs/wlzt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
src/assets/imgs/znbb.png
Normal file
BIN
src/assets/imgs/znbb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@@ -4,6 +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"
|
||||||
@@ -68,11 +69,14 @@
|
|||||||
></InputTimeRange>
|
></InputTimeRange>
|
||||||
</template>
|
</template>
|
||||||
<template #header v-if="Object.keys(dimensionFields)?.length">
|
<template #header v-if="Object.keys(dimensionFields)?.length">
|
||||||
<div style="display:flex;margin-left:40px">
|
<div style="display:flex;align-items:center;border-top:1px solid #eee;margin-bottom:10px;padding-top:10px;">
|
||||||
<el-checkbox-group @change="searchDimension" v-model="tableSearch['Group by']"
|
<span style="margin-right:10px;">维度:</span>
|
||||||
|
<el-checkbox-group
|
||||||
|
@change="searchDimension" v-model="tableSearch['Group by']"
|
||||||
placeholder="请选择内容">
|
placeholder="请选择内容">
|
||||||
<template v-for="(item,key) in dimensionFields">
|
<template v-for="(item,key) in dimensionFields">
|
||||||
<el-checkbox v-if="tableSearch['Group by']&&tableSearch['Group by'].includes(key)||!tableSearch['Group by']?.length"
|
<el-checkbox
|
||||||
|
v-if="tableSearch['Group by']&&tableSearch['Group by'].includes(key)||!tableSearch['Group by']?.length"
|
||||||
:key="key"
|
:key="key"
|
||||||
:value="key"
|
:value="key"
|
||||||
:label="item.label"></el-checkbox>
|
:label="item.label"></el-checkbox>
|
||||||
@@ -115,6 +119,8 @@ const { mergeLocaleMessage, t } = useI18n() // 国际化
|
|||||||
|
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const isInit = ref(false)
|
const isInit = ref(false)
|
||||||
|
const isSearch = ref(false)
|
||||||
|
|
||||||
|
|
||||||
const tableOption = ref<any>({})
|
const tableOption = ref<any>({})
|
||||||
const tableData = ref<any>([])
|
const tableData = ref<any>([])
|
||||||
@@ -128,6 +134,7 @@ 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 hideColumns=ref<string[]>([])
|
||||||
const dateTimeRange=ref<string[]>([])
|
const dateTimeRange=ref<string[]>([])
|
||||||
const timeRange=ref<string[]>([])
|
const timeRange=ref<string[]>([])
|
||||||
const amountFieds=ref<any>({})
|
const amountFieds=ref<any>({})
|
||||||
@@ -136,6 +143,7 @@ const crudRef = ref()
|
|||||||
const dimensionFields=ref<any>({})
|
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 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(() => {
|
||||||
@@ -165,18 +173,35 @@ const summaryMethod1=({columns,data})=>{
|
|||||||
})
|
})
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
function getCurrentDate() {
|
||||||
|
const now = new Date();
|
||||||
|
// 补零函数:小于10则前面加0
|
||||||
|
const padZero = (num) => num.toString().padStart(2, '0');
|
||||||
|
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = padZero(now.getMonth() + 1);
|
||||||
|
const day = padZero(now.getDate());
|
||||||
|
|
||||||
|
// 返回格式化后的字符串或对象,按需选择
|
||||||
|
return {
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
day,
|
||||||
|
fullDate: `${year}-${month}-${day}` // 拼接成 2026-02-24 格式
|
||||||
|
};
|
||||||
|
}
|
||||||
const initTable = async () => {
|
const initTable = async () => {
|
||||||
isInit.value = false
|
isInit.value = false
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const { fieldList: apiFieldList, reportVo } = await ReportApi.getWebConfig(props.reportCode)
|
const { fieldList: apiFieldList, reportVo } = await ReportApi.getWebConfig(props.reportCode)
|
||||||
|
|
||||||
// 存储字段列表到响应式引用
|
|
||||||
fieldList.value = apiFieldList
|
fieldList.value = apiFieldList
|
||||||
|
|
||||||
const isHeight = reportVo.tableConfig?.includes('height')
|
const isHeight = reportVo.tableConfig?.includes('height')
|
||||||
const isPage = reportVo.dataConfig?.includes('page')
|
const isPage = reportVo.dataConfig?.includes('page')
|
||||||
const isPermi = reportVo.dataConfig?.includes('authTrue')
|
const isPermi = reportVo.dataConfig?.includes('authTrue')
|
||||||
const isHideExport = reportVo.tableConfig?.includes('hideExport')
|
const isHideExport = reportVo.tableConfig?.includes('hideExport')
|
||||||
|
hideColumns.value=[]
|
||||||
tableInfo.value = { ...reportVo, isPage, isHeight, isPermi, isHideExport }
|
tableInfo.value = { ...reportVo, isPage, isHeight, isPermi, isHideExport }
|
||||||
tableOption.value = {
|
tableOption.value = {
|
||||||
selection: !isHideExport,
|
selection: !isHideExport,
|
||||||
@@ -189,40 +214,49 @@ const initTable = async () => {
|
|||||||
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,
|
||||||
|
|
||||||
column: {}
|
column: {}
|
||||||
}
|
}
|
||||||
//国际化处理
|
|
||||||
const fieldLengObj = assembleLengObj(apiFieldList, 'labelI18n', 'fieldCode', 'fieldName')
|
const fieldLengObj = assembleLengObj(apiFieldList, 'labelI18n', 'fieldCode', 'fieldName')
|
||||||
for (const key in fieldLengObj) {
|
for (const key in fieldLengObj) {
|
||||||
mergeLocaleMessage(key, { [props.reportCode]: fieldLengObj[key] })
|
mergeLocaleMessage(key, { [props.reportCode]: fieldLengObj[key] })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据parentFieldCode判断表头结构
|
// 分离固定列和动态列
|
||||||
const hasSubFields = Array.isArray(apiFieldList) && apiFieldList.some(field => field.parentFieldCode && field.parentFieldCode !== '')
|
const fixedFields = apiFieldList.filter(f => f.isFixedColumn === 'Y')
|
||||||
|
const dynamicFields = apiFieldList.filter(f => f.isFixedColumn !== 'Y')
|
||||||
|
|
||||||
// 构建父子关系映射
|
// 处理固定列
|
||||||
const parentChildMap = new Map()
|
fixedFields.forEach((item) => {
|
||||||
const childParentMap = new Map()
|
const config: any = {
|
||||||
|
prop: item.fieldCode,
|
||||||
// 建立映射关系
|
label: t(`${props.reportCode}.${item.fieldCode}`),
|
||||||
apiFieldList.forEach(field => {
|
type: 'input',
|
||||||
|
overHidden: true,
|
||||||
|
isExport: item.isExport == 'Y',
|
||||||
|
search: item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y',
|
||||||
|
fixed: true
|
||||||
|
}
|
||||||
|
tableOption.value.column[item.fieldCode] = config
|
||||||
|
})
|
||||||
|
|
||||||
|
// 构建父子关系映射(仅用于识别子字段配置)
|
||||||
|
const childFieldConfigs = new Map()
|
||||||
|
dynamicFields.forEach(field => {
|
||||||
if (field.parentFieldCode && field.parentFieldCode !== '') {
|
if (field.parentFieldCode && field.parentFieldCode !== '') {
|
||||||
// 这是子字段
|
if (!childFieldConfigs.has(field.parentFieldCode)) {
|
||||||
childParentMap.set(field.fieldCode, field.parentFieldCode)
|
childFieldConfigs.set(field.parentFieldCode, [])
|
||||||
if (!parentChildMap.has(field.parentFieldCode)) {
|
|
||||||
parentChildMap.set(field.parentFieldCode, [])
|
|
||||||
}
|
}
|
||||||
parentChildMap.get(field.parentFieldCode).push(field.fieldCode)
|
childFieldConfigs.get(field.parentFieldCode).push(field)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//字段处理 - 构建正确的表头结构
|
// 处理动态列(暂不构建children,等数据返回后动态生成)
|
||||||
apiFieldList.forEach((item, index) => {
|
dynamicFields.forEach((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,
|
||||||
@@ -231,60 +265,55 @@ const initTable = async () => {
|
|||||||
overHidden: true,
|
overHidden: true,
|
||||||
isExport: item.isExport == 'Y',
|
isExport: item.isExport == 'Y',
|
||||||
sortable: item.isShowSort == 'Y' ? 'custom' : false,
|
sortable: item.isShowSort == 'Y' ? 'custom' : false,
|
||||||
search: item.queryIsWeb == 'Y',
|
search: item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y',
|
||||||
|
_hasChildConfig: childFieldConfigs.has(item.fieldCode),
|
||||||
|
_childConfigs: childFieldConfigs.get(item.fieldCode) || []
|
||||||
}
|
}
|
||||||
|
if(item.queryIsWeb == 'Y'&&item.isHideSearch !== 'Y') isSearch.value=true
|
||||||
// 如果该字段有子字段,添加子列配置
|
if(!!item.searchDefaultValue){
|
||||||
if (parentChildMap.has(item.fieldCode)) {
|
if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){
|
||||||
const childFields = parentChildMap.get(item.fieldCode)
|
tableSearch.value[config.prop]=getCurrentDate().year
|
||||||
config.children = childFields.map(childFieldCode => {
|
}else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){
|
||||||
const childField = apiFieldList.find(f => f.fieldCode === childFieldCode)
|
tableSearch.value[config.prop]=new Date().getMonth() + 1
|
||||||
return {
|
}else if(item.fieldType=='Date'&&item.searchDefaultValue=='当日'){
|
||||||
prop: childField.fieldCode,
|
tableSearch.value[config.prop]=getCurrentDate().fullDate
|
||||||
label: t(`${props.reportCode}.${childField.fieldCode}`),
|
}else{
|
||||||
type: 'input',
|
tableSearch.value[config.prop]=item.searchDefaultValue
|
||||||
overHidden: true,
|
|
||||||
isExport: childField.isExport == 'Y',
|
|
||||||
sortable: childField.isShowSort == 'Y' ? 'custom' : false,
|
|
||||||
search: childField.queryIsWeb == 'Y'
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
tableOption.value.showSummary=true
|
tableOption.value.showSummary=true
|
||||||
}
|
}
|
||||||
|
if(item.width){
|
||||||
|
config.width=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
|
||||||
|
}
|
||||||
|
if(item.isHideCol == 'Y') {
|
||||||
|
config.hide = true
|
||||||
|
hideColumns.value.push( config.prop )
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.queryMode == 'RANGE') config.searchRange = true
|
if (item.queryMode == 'RANGE') config.searchRange = true
|
||||||
if (['Integer', 'BigInt', 'BigDecimal'].includes(item.fieldType)) config.type = 'number'
|
if (['Integer', 'BigInt', 'BigDecimal'].includes(item.fieldType)) config.type = 'number'
|
||||||
else if (item.fieldType == 'Date') {
|
else if (item.fieldType == 'Date') {
|
||||||
config.type = 'date'
|
config.type = 'date'
|
||||||
config.format = 'YYYY-MM-DD'
|
config.format = 'YYYY-MM-DD'
|
||||||
config.valueFormat = 'YYYY-MM-DD'
|
config.valueFormat = 'YYYY-MM-DD'
|
||||||
if(config.searchRange){
|
if(config.searchRange) dateRange.value.push(config.prop)
|
||||||
dateRange.value.push(config.prop)
|
|
||||||
}
|
|
||||||
} else if (item.fieldType == 'Time') {
|
} else if (item.fieldType == 'Time') {
|
||||||
config.type = 'time'
|
config.type = 'time'
|
||||||
config.format = 'HH:mm:ss'
|
config.format = 'HH:mm:ss'
|
||||||
config.valueFormat = 'HH:mm:ss'
|
config.valueFormat = 'HH:mm:ss'
|
||||||
|
if(config.searchRange) timeRange.value.push(config.prop)
|
||||||
if(config.searchRange){
|
|
||||||
timeRange.value.push(config.prop)
|
|
||||||
}
|
|
||||||
} else if (item.fieldType == 'DateTime') {
|
} else if (item.fieldType == 'DateTime') {
|
||||||
config.type = 'datetime'
|
config.type = 'datetime'
|
||||||
config.format = 'YYYY-MM-DD HH:mm:ss'
|
config.format = 'YYYY-MM-DD HH:mm:ss'
|
||||||
config.valueFormat = 'YYYY-MM-DD HH:mm:ss'
|
config.valueFormat = 'YYYY-MM-DD HH:mm:ss'
|
||||||
if(config.searchRange){
|
if(config.searchRange) dateTimeRange.value.push(config.prop)
|
||||||
dateTimeRange.value.push(config.prop)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.type == 'number' && config.searchRange) numberRange.value.push(config.prop)
|
if (config.type == 'number' && config.searchRange) numberRange.value.push(config.prop)
|
||||||
@@ -292,15 +321,27 @@ const initTable = async () => {
|
|||||||
config.searchType = 'tag'
|
config.searchType = 'tag'
|
||||||
}
|
}
|
||||||
if (item.queryMode == 'NE') config.searchLabel = `${config.label} !=`
|
if (item.queryMode == 'NE') config.searchLabel = `${config.label} !=`
|
||||||
tableOption.value.column[item.fieldCode] = config
|
if(!item.parentFieldCode&&!!item.parentFieldName){
|
||||||
|
if(tableOption.value.column[item.parentFieldName]){
|
||||||
|
tableOption.value.column[item.parentFieldName].children.push(config)
|
||||||
|
}else{
|
||||||
|
tableOption.value.column[item.parentFieldName]={
|
||||||
|
children:[config],
|
||||||
|
label:item.parentFieldName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
tableOption.value.column[item.fieldCode] = config
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
isInit.value = true
|
isInit.value = true
|
||||||
searchChange()
|
searchChange()
|
||||||
initTableLayout()
|
initTableLayout()
|
||||||
}
|
}
|
||||||
const searchDimension=()=>{
|
const searchDimension=()=>{
|
||||||
|
|
||||||
searchChange()
|
searchChange()
|
||||||
}
|
}
|
||||||
const initTableLayout = () => {
|
const initTableLayout = () => {
|
||||||
@@ -366,28 +407,158 @@ const getTableData = async (isLoading = true) => {
|
|||||||
if (isLoading) loading.value = true
|
if (isLoading) loading.value = true
|
||||||
const searchObj = await getSearchData()
|
const searchObj = await getSearchData()
|
||||||
try {
|
try {
|
||||||
const data = await ReportApi.getTableList(props.reportCode, searchObj)
|
// 获取数据
|
||||||
|
let data = await ReportApi.getTableList(props.reportCode, searchObj)
|
||||||
|
|
||||||
|
// 功能测试:CS_DTBT报表使用模拟数据
|
||||||
|
if (props.reportCode === 'CS_DTBT') {
|
||||||
|
data = {
|
||||||
|
records: [
|
||||||
|
{ "yuefen": "一月", "benyue": 100, "leiji": 110 },
|
||||||
|
{ "yuefen": "一月", "benyue": 120, "leiji": 130 },
|
||||||
|
{ "yuefen": "二月", "benyue": 140, "leiji": 150 },
|
||||||
|
{ "yuefen": "二月", "benyue": 160, "leiji": 170 },
|
||||||
|
{ "yuefen": "三月", "benyue": 180, "leiji": 190 },
|
||||||
|
{ "yuefen": "三月", "benyue": 200, "leiji": 210 },
|
||||||
|
{ "yuefen": "四月", "benyue": null, "leiji": null },
|
||||||
|
{ "yuefen": "四月", "benyue": 220, "leiji": 230 },
|
||||||
|
{ "yuefen": "五月", "benyue": 333, "leiji": 444 },
|
||||||
|
{ "yuefen": "六月", "benyue": 555, "leiji": 555 },
|
||||||
|
{ "yuefen": "六月", "benyue": 666, "leiji": 666 },
|
||||||
|
|
||||||
|
],
|
||||||
|
total: 6
|
||||||
|
}
|
||||||
|
}
|
||||||
if (tablePage.value) tablePage.value['total'] = data.total
|
if (tablePage.value) tablePage.value['total'] = data.total
|
||||||
|
|
||||||
// 处理包含子字段的数据
|
// 查找动态分组字段(用于生成一级表头)
|
||||||
let processedData = data.records
|
const groupField = fieldList.value.find(f => f.isDynamicGroup === 'Y')
|
||||||
// 根据字段配置判断是否需要处理子字段
|
|
||||||
const hasSubFields = Array.isArray(fieldList.value) && fieldList.value.length > 0 &&
|
|
||||||
fieldList.value.some(field => field.parentFieldCode && field.parentFieldCode !== '')
|
|
||||||
|
|
||||||
if (hasSubFields) {
|
// 动态生成二维表头
|
||||||
processedData = data.records.map(record => {
|
if (data.records && data.records.length > 0) {
|
||||||
const flatRecord = { ...record }
|
const newColumns = {}
|
||||||
// 处理子字段数据
|
|
||||||
fieldList.value.forEach(field => {
|
// 保留固定列
|
||||||
if (field.parentFieldCode && field.parentFieldCode !== '') {
|
for (const colKey in tableOption.value.column) {
|
||||||
// 这是子字段,从父字段中提取数据
|
const colConfig = tableOption.value.column[colKey]
|
||||||
const parentData = record[field.parentFieldCode]
|
if (colConfig.fixed) {
|
||||||
if (parentData && typeof parentData === 'object') {
|
newColumns[colKey] = colConfig
|
||||||
flatRecord[field.fieldCode] = parentData[field.fieldCode]
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (groupField) {
|
||||||
|
// 有分组字段,从数据中提取所有不重复的分组值(一级表头)
|
||||||
|
const groupValues = [...new Set(data.records.map(r => r[groupField.fieldCode]))].filter(Boolean)
|
||||||
|
|
||||||
|
// 找到所有子字段配置(按sortNum排序)
|
||||||
|
const childFields = fieldList.value
|
||||||
|
.filter(f =>
|
||||||
|
f.parentFieldCode &&
|
||||||
|
f.parentFieldCode !== '' &&
|
||||||
|
f.isFixedColumn !== 'Y'
|
||||||
|
)
|
||||||
|
.sort((a, b) => (a.sortNum || 0) - (b.sortNum || 0))
|
||||||
|
|
||||||
|
// 为每个分组值生成列
|
||||||
|
groupValues.forEach(groupValue => {
|
||||||
|
const parentProp = `group_${groupValue}`
|
||||||
|
newColumns[parentProp] = {
|
||||||
|
label: groupValue,
|
||||||
|
children: childFields.map(childField => ({
|
||||||
|
prop: `${parentProp}_${childField.fieldCode}`,
|
||||||
|
label: t(`${props.reportCode}.${childField.fieldCode}`),
|
||||||
|
type: ['Integer', 'BigInt', 'BigDecimal'].includes(childField.fieldType) ? 'number' : 'input',
|
||||||
|
overHidden: true,
|
||||||
|
isExport: childField.isExport == 'Y'
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
// 没有分组字段,使用原有的逻辑
|
||||||
|
for (const colKey in tableOption.value.column) {
|
||||||
|
const colConfig = tableOption.value.column[colKey]
|
||||||
|
if (!colConfig.fixed) {
|
||||||
|
newColumns[colKey] = colConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tableOption.value.column = newColumns
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将扁平数据按分组字段转换为二维表头数据
|
||||||
|
let processedData = []
|
||||||
|
|
||||||
|
if (groupField && data.records.length > 0) {
|
||||||
|
// 有分组字段,根据分组字段值进行分组
|
||||||
|
const fixedFields = fieldList.value.filter(f => f.isFixedColumn === 'Y')
|
||||||
|
const childFields = fieldList.value
|
||||||
|
.filter(f => f.parentFieldCode && f.parentFieldCode !== '' && f.isFixedColumn !== 'Y')
|
||||||
|
.sort((a, b) => (a.sortNum || 0) - (b.sortNum || 0))
|
||||||
|
|
||||||
|
// 获取所有分组值
|
||||||
|
const groupValues = [...new Set(data.records.map(r => r[groupField.fieldCode]))].filter(Boolean)
|
||||||
|
|
||||||
|
// 按分组字段值对数据进行分组
|
||||||
|
const groupedData = {}
|
||||||
|
data.records.forEach(record => {
|
||||||
|
const groupValue = record[groupField.fieldCode]
|
||||||
|
if (!groupedData[groupValue]) {
|
||||||
|
groupedData[groupValue] = []
|
||||||
|
}
|
||||||
|
groupedData[groupValue].push(record)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 计算需要生成的行数(根据固定列配置或分组内最大数据量)
|
||||||
|
let rowCount = 1
|
||||||
|
if (fixedFields.length > 0 && fixedFields[0].fixedColumnValue) {
|
||||||
|
rowCount = fixedFields[0].fixedColumnValue.split(',').length
|
||||||
|
} else {
|
||||||
|
// 如果没有固定列,取每个分组中数据最多的数量
|
||||||
|
rowCount = Math.max(...Object.values(groupedData).map((arr: any[]) => arr.length))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按行处理数据
|
||||||
|
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
||||||
|
const flatRecord = {}
|
||||||
|
|
||||||
|
// 处理固定列
|
||||||
|
fixedFields.forEach(field => {
|
||||||
|
if (field.fixedColumnValue) {
|
||||||
|
const fixedValues = field.fixedColumnValue.split(',')
|
||||||
|
flatRecord[field.fieldCode] = fixedValues[rowIndex] || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 处理动态列数据(根据分组字段值获取对应数据)
|
||||||
|
groupValues.forEach(groupValue => {
|
||||||
|
const groupRecords = groupedData[groupValue] || []
|
||||||
|
const record = groupRecords[rowIndex]
|
||||||
|
|
||||||
|
if (record) {
|
||||||
|
const parentProp = `group_${groupValue}`
|
||||||
|
childFields.forEach(childField => {
|
||||||
|
flatRecord[`${parentProp}_${childField.fieldCode}`] = record[childField.fieldCode]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
processedData.push(flatRecord)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 没有分组字段,直接处理数据
|
||||||
|
processedData = data.records.map((record, recordIndex) => {
|
||||||
|
const flatRecord = { ...record }
|
||||||
|
|
||||||
|
// 处理固定列
|
||||||
|
fieldList.value.forEach(field => {
|
||||||
|
if (field.isFixedColumn === 'Y' && field.fixedColumnValue) {
|
||||||
|
const fixedValues = field.fixedColumnValue.split(',')
|
||||||
|
flatRecord[field.fieldCode] = fixedValues[recordIndex] || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return flatRecord
|
return flatRecord
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -467,6 +638,15 @@ const clearSearch = () => {
|
|||||||
const searchChange = (params?, done?) => {
|
const searchChange = (params?, done?) => {
|
||||||
if (tablePage.value) tablePage.value['currentPage'] = 1
|
if (tablePage.value) tablePage.value['currentPage'] = 1
|
||||||
getTableData().finally(() => {
|
getTableData().finally(() => {
|
||||||
|
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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -529,10 +709,12 @@ defineExpose({
|
|||||||
&::after{
|
&::after{
|
||||||
content:'、'
|
content:'、'
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-of-type::after{
|
&:last-of-type::after{
|
||||||
content:''
|
content:''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.lastAmountRow{
|
.lastAmountRow{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default {
|
|||||||
noPermission: `抱歉,您无权访问此页面。`,
|
noPermission: `抱歉,您无权访问此页面。`,
|
||||||
pageError: '抱歉,您访问的页面不存在。',
|
pageError: '抱歉,您访问的页面不存在。',
|
||||||
networkError: '抱歉,服务器报告错误。',
|
networkError: '抱歉,服务器报告错误。',
|
||||||
returnToHome: '返回首页'
|
returnToHome: '返回工作台'
|
||||||
},
|
},
|
||||||
permission: {
|
permission: {
|
||||||
hasPermission: `请设置操作权限标签值`,
|
hasPermission: `请设置操作权限标签值`,
|
||||||
@@ -157,7 +157,7 @@ export default {
|
|||||||
router: {
|
router: {
|
||||||
login: '登录',
|
login: '登录',
|
||||||
socialLogin: '社交登录',
|
socialLogin: '社交登录',
|
||||||
home: '首页',
|
home: '工作台',
|
||||||
analysis: '分析页',
|
analysis: '分析页',
|
||||||
workplace: '工作台'
|
workplace: '工作台'
|
||||||
},
|
},
|
||||||
@@ -275,7 +275,7 @@ export default {
|
|||||||
},
|
},
|
||||||
exception: {
|
exception: {
|
||||||
backLogin: '返回登录',
|
backLogin: '返回登录',
|
||||||
backHome: '返回首页',
|
backHome: '返回工作台',
|
||||||
subTitle403: '抱歉,您无权访问此页面。',
|
subTitle403: '抱歉,您无权访问此页面。',
|
||||||
subTitle404: '抱歉,您访问的页面不存在。',
|
subTitle404: '抱歉,您访问的页面不存在。',
|
||||||
subTitle500: '抱歉,服务器报告错误。',
|
subTitle500: '抱歉,服务器报告错误。',
|
||||||
@@ -292,7 +292,7 @@ export default {
|
|||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
backSignIn: '返回',
|
backSignIn: '返回',
|
||||||
signInFormTitle: '登录',
|
signInFormTitle: '国瑞药业工业互联网平台',
|
||||||
ssoFormTitle: '三方授权',
|
ssoFormTitle: '三方授权',
|
||||||
mobileSignInFormTitle: '手机登录',
|
mobileSignInFormTitle: '手机登录',
|
||||||
qrSignInFormTitle: '二维码登录',
|
qrSignInFormTitle: '二维码登录',
|
||||||
|
|||||||
@@ -95,7 +95,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
|
.width-50{
|
||||||
|
width: 50% !important;
|
||||||
|
}
|
||||||
/* nprogress 适配 element-plus 的主题色 */
|
/* nprogress 适配 element-plus 的主题色 */
|
||||||
#nprogress {
|
#nprogress {
|
||||||
& .bar {
|
& .bar {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import dayjs from 'dayjs'
|
|||||||
import type { TableColumnCtx } from 'element-plus'
|
import type { TableColumnCtx } from 'element-plus'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期快捷选项适用于 el-date-picker
|
* 日期快捷选项适用于 -picker
|
||||||
*/
|
*/
|
||||||
export const defaultShortcuts = [
|
export const defaultShortcuts = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,79 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="prefixCls" class="relative h-[100%]">
|
<div :class="prefixCls" class="relative h-[100%]" :style="{ backgroundImage: 'url(' + localImage + ')' ,backgroundSize:'cover'}">
|
||||||
<div class="relative mx-auto h-full flex">
|
<div class="relative mx-auto h-full flex" style=" margin: 0 auto;">
|
||||||
<div
|
<div
|
||||||
v-if="!appStore.getMobile"
|
class="relative flex-1 p-30px lt-sm:p-10px overflow-x-hidden overflow-y-auto"
|
||||||
:class="`${prefixCls}__left flex-1 bg-#409eff dark:bg-[var(--login-bg-color)] relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
|
:class="`${prefixCls}__right`">
|
||||||
>
|
|
||||||
<!-- 左上角的 logo + 系统标题 -->
|
|
||||||
<div
|
|
||||||
class="relative flex items-center text-white mt-30px"
|
|
||||||
:style="{ marginTop: leftStyle.logo.mt }"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt=""
|
|
||||||
class="mr-10px"
|
|
||||||
:style="{ height: leftStyle.logo.height }"
|
|
||||||
src="@/assets/imgs/logo_white.png"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<!-- 左边的背景图 + 欢迎语 -->
|
|
||||||
<Transition
|
|
||||||
appear
|
|
||||||
enter-active-class="animate__animated animate__bounceInLeft"
|
|
||||||
tag="div"
|
|
||||||
>
|
|
||||||
<div :style="{ marginTop: leftStyle.bottomText.textMt }">
|
|
||||||
<div
|
|
||||||
class="pos-relative w-100% overflow-hidden"
|
|
||||||
:style="{ height: leftStyle.lottie.boxHeight }"
|
|
||||||
>
|
|
||||||
<vue3-lottie
|
|
||||||
class="pos-absolute"
|
|
||||||
:style="{ left: leftStyle.lottie.left, top: leftStyle.lottie.top }"
|
|
||||||
:animation-data="loginAnimationData"
|
|
||||||
:height="leftStyle.lottie.height"
|
|
||||||
:width="leftStyle.lottie.width"
|
|
||||||
:auto-play="true"
|
|
||||||
:loop="true"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="flex justify-center w-100%"
|
|
||||||
:style="{ marginTop: leftStyle.bottomText.textMt }"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="pos-relative overflow-hidden"
|
|
||||||
:style="{ width: leftStyle.bottomText.width, height: leftStyle.bottomText.height }"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt=""
|
|
||||||
class="pos-absolute top-0"
|
|
||||||
:style="{ width: leftStyle.bottomText.width, left: leftStyle.bottomText.left }"
|
|
||||||
src="@/assets/imgs/login/login_text.png"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Transition>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="relative flex-1 p-30px bg-#e3f0ff lt-sm:p-10px overflow-x-hidden overflow-y-auto"
|
|
||||||
:class="`${prefixCls}__right`"
|
|
||||||
>
|
|
||||||
<!-- 右上角的主题、语言选择 -->
|
|
||||||
<div
|
|
||||||
class="relative z-2 flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
|
|
||||||
>
|
|
||||||
<div class="flex items-center at-2xl:hidden at-xl:hidden">
|
|
||||||
<img alt="" class="mr-10px h-32px" src="@/assets/imgs/logo.png" />
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-end space-x-10px h-48px">
|
|
||||||
<ThemeSwitch />
|
|
||||||
<LocaleDropdown class="dark:text-white lt-xl:text-white" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 右边的登录界面 -->
|
<!-- 右边的登录界面 -->
|
||||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||||
<div
|
<div
|
||||||
@@ -83,25 +13,33 @@
|
|||||||
<div class="bg-#fff dark:bg-[var(--login-bg-color)] b-rounded-20px px-20px">
|
<div class="bg-#fff dark:bg-[var(--login-bg-color)] b-rounded-20px px-20px">
|
||||||
<!-- 账号登录 -->
|
<!-- 账号登录 -->
|
||||||
<LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
<LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||||
<!-- 手机登录 -->
|
|
||||||
<MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
|
||||||
<!-- 二维码登录 -->
|
|
||||||
<QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
|
||||||
<!-- 三方登录 -->
|
|
||||||
<!-- <SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="pos-fixed bottom-0px left-50% lt-md:left-0px lt-sm:left-0px lt-xl:left-0px lt-xl:left-0px z-1"
|
|
||||||
>
|
|
||||||
<img class="w-138px block" src="@/assets/imgs/login/login_right_bg_1.png" alt="" />
|
|
||||||
</div>
|
|
||||||
<div class="pos-fixed right--38px top--23px">
|
|
||||||
<img class="w-160px block" src="@/assets/imgs/login/login_right_bg_2.png" alt="" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tags">
|
||||||
|
<div class="module cockpit">
|
||||||
|
<img :src="jsc"/>
|
||||||
|
驾驶舱
|
||||||
|
</div>
|
||||||
|
<div class="module iot">
|
||||||
|
<img :src="wlzt"/>
|
||||||
|
物联中台
|
||||||
|
</div>
|
||||||
|
<div class="module data-center">
|
||||||
|
<img :src="sjzt"/>
|
||||||
|
数据中台
|
||||||
|
</div>
|
||||||
|
<div class="module report">
|
||||||
|
<img :src="znbb"/>
|
||||||
|
智能报表
|
||||||
|
</div>
|
||||||
|
<div class="module digital-twin">
|
||||||
|
<img :src="szls"/>
|
||||||
|
数字孪生
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -110,9 +48,16 @@ import { useAppStore } from '@/store/modules/app'
|
|||||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||||
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
|
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
import { LoginForm } from './components'
|
||||||
import { LoginForm, MobileForm, QrCodeForm, SSOLoginVue } from './components'
|
|
||||||
import * as loginAnimation from '@/assets/json/login_left.json'
|
import * as loginAnimation from '@/assets/json/login_left.json'
|
||||||
|
import jsc from '@/assets/imgs/jsc.png'
|
||||||
|
import sjzt from '@/assets/imgs/sjzt.png'
|
||||||
|
import szls from '@/assets/imgs/szls.png'
|
||||||
|
import wlzt from '@/assets/imgs/wlzt.png'
|
||||||
|
import znbb from '@/assets/imgs/znbb.png'
|
||||||
|
|
||||||
|
// import { useRoute } from 'vue-router';
|
||||||
|
import localImage from '@/assets/imgs/background.jpg'
|
||||||
|
|
||||||
defineOptions({ name: 'Login' })
|
defineOptions({ name: 'Login' })
|
||||||
|
|
||||||
@@ -157,6 +102,9 @@ const newClass = computed(() => {
|
|||||||
const toggle = appStore.getFullscreen ? 'is-toggle' : ''
|
const toggle = appStore.getFullscreen ? 'is-toggle' : ''
|
||||||
return toggle ? toggle : mobile
|
return toggle ? toggle : mobile
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// const route = useRoute();
|
||||||
|
// console.log(route.query)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -179,4 +127,78 @@ $prefix-cls: #{$namespace}-login;
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%) scale(0.7, 0.6);
|
transform: translate(-50%, -50%) scale(0.7, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags{
|
||||||
|
position:absolute;
|
||||||
|
bottom:20px;
|
||||||
|
left:50%;
|
||||||
|
display: grid;
|
||||||
|
width: 1000px;
|
||||||
|
transform:translateX(-50%);
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
gap: 20px;
|
||||||
|
|
||||||
|
.module {
|
||||||
|
display: flex;
|
||||||
|
padding: 20px;
|
||||||
|
font-size: 26px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module img {
|
||||||
|
width: 72px;
|
||||||
|
height: 72px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module.iot,
|
||||||
|
.module.data-center,
|
||||||
|
.module.report,
|
||||||
|
.module.digital-twin {
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 50px; /* 图标和文字之间的间距 */
|
||||||
|
img{
|
||||||
|
margin:0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 驾驶舱:深蓝色渐变 */
|
||||||
|
.module.cockpit {
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
background: linear-gradient(180deg, rgb(109 147 245 / 75%), rgb(7 38 111 / 75%));
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 130px;
|
||||||
|
height: 130px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 物联中台:中蓝色渐变 */
|
||||||
|
.module.iot {
|
||||||
|
background: linear-gradient(180deg, rgb(130 156 223 / 75%), rgb(7 38 111 / 75%));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 数据中台:青绿色渐变 */
|
||||||
|
.module.data-center {
|
||||||
|
background: linear-gradient(180deg, rgb(46 192 182 / 75%), rgb(40 180 170 / 75%));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 智能报表:绿色渐变 */
|
||||||
|
.module.report {
|
||||||
|
background: linear-gradient(180deg, rgb(77 212 122 / 75%), rgb(60 180 100 / 75%));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 数字孪生:浅蓝色渐变 */
|
||||||
|
.module.digital-twin {
|
||||||
|
background: linear-gradient(180deg, rgb(111 181 235 / 75%), rgb(60 140 200 / 75%));
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -74,6 +74,75 @@ export const useRenderVxeColumn = (useType = 'table') => {
|
|||||||
return <el-input class="my-cell" text="text" v-model={row[prop]} placeholder={placeholder ? placeholder : '请输入 ' + column.title} />
|
return <el-input class="my-cell" text="text" v-model={row[prop]} placeholder={placeholder ? placeholder : '请输入 ' + column.title} />
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
LowInputDefualt: {
|
||||||
|
default: (renderOpts, { row, column, fieldProp }, isStop) => {
|
||||||
|
const prop = fieldProp || column.field
|
||||||
|
if (isStop) return (<div> <span>{row[prop]}</span> {stopIcon} </div>)
|
||||||
|
return <span>{row[prop]}</span>
|
||||||
|
},
|
||||||
|
edit: (renderOpts, { row, column, fieldProp ,rowIndex}) => {
|
||||||
|
const { placeholder } = renderOpts
|
||||||
|
const prop = fieldProp || column.field
|
||||||
|
const dicData=[]
|
||||||
|
if(['年','年度','年份'].includes(row.fieldName)){
|
||||||
|
dicData.push({label:'本年',value:'本年'})
|
||||||
|
dicData.push({label:'指定年份',value:'指定'})
|
||||||
|
}else if( ['月','月度','月份'].includes(row.fieldName)){
|
||||||
|
dicData.push({label:'本月',value:'本月'})
|
||||||
|
dicData.push({label:'指定月份',value:'指定'})
|
||||||
|
}else if(row.fieldType=='Date'){
|
||||||
|
dicData.push({label:'当日',value:'当日'})
|
||||||
|
dicData.push({label:'指定日期',value:'指定'})
|
||||||
|
}
|
||||||
|
if(dicData.length){
|
||||||
|
return [
|
||||||
|
<avue-select
|
||||||
|
popper-class="vxe-table--ignore-clear"
|
||||||
|
v-model={row.defaultSelect}
|
||||||
|
placeholder={'请选择'}
|
||||||
|
class={row.defaultSelect=="指定"?'width-50':''}
|
||||||
|
dic={dicData}
|
||||||
|
clearable={true}
|
||||||
|
onChange={({value}) => {
|
||||||
|
if(value!=='指定') row[prop]=value
|
||||||
|
else row[prop]=''
|
||||||
|
// 再触发自定义事件
|
||||||
|
if (renderOpts.events && renderOpts.events.change) {
|
||||||
|
renderOpts.events.change(row, column.field, rowIndex)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onClear={() => {
|
||||||
|
// 触发清空事件
|
||||||
|
if (renderOpts.events && renderOpts.events.clear) {
|
||||||
|
renderOpts.events.clear(row, column.field, rowIndex)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
row.defaultSelect === "指定"&&row.fieldType!=='Date' && (
|
||||||
|
<el-input
|
||||||
|
class={row.defaultSelect?'my-cell width-50':'my-cell'}
|
||||||
|
type="text"
|
||||||
|
v-model={row[prop]}
|
||||||
|
placeholder={placeholder || `请输入 ${column.title}`}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
row.defaultSelect === "指定"&&row.fieldType=='Date' && (
|
||||||
|
<el-date-picker
|
||||||
|
class={row.defaultSelect?'my-cell width-50':'my-cell'}
|
||||||
|
v-model={row[prop]}
|
||||||
|
placeholder={placeholder || `请输入 ${column.title}`}
|
||||||
|
format={'YYYY-MM-DD'}
|
||||||
|
valueFormat={'YYYY-MM-DD'}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return <el-input class="my-cell" text="text" v-model={row[prop]} placeholder={placeholder ? placeholder : '请输入 ' + column.title} />
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
LowNumber: {
|
LowNumber: {
|
||||||
default: (renderOpts, { row, column }, isStop) => {
|
default: (renderOpts, { row, column }, isStop) => {
|
||||||
if (isStop) return (<div> <span>{row[column.field]}</span> {stopIcon} </div>)
|
if (isStop) return (<div> <span>{row[column.field]}</span> {stopIcon} </div>)
|
||||||
@@ -183,6 +252,44 @@ export const useRenderVxeColumn = (useType = 'table') => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
LowSelectMultiple: {
|
||||||
|
default: (renderOpts, { row, column }, isStop = false) => {
|
||||||
|
const { dicData } = renderOpts
|
||||||
|
const value = row[column.field]
|
||||||
|
|
||||||
|
const valStr=value?dicData.filter(item=>value.includes(item.value)).map(item=>item.label).join(','):''
|
||||||
|
return <span>{valStr}</span>
|
||||||
|
},
|
||||||
|
edit: (renderOpts, { row, rowIndex, column }) => {
|
||||||
|
const { multiple, filterable, allowCreate, typeKey ,dicData} = renderOpts
|
||||||
|
interface DictItem {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
[key: string]: any; // 兼容其他可能的字段
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<el-select
|
||||||
|
popper-class="vxe-table--ignore-clear"
|
||||||
|
v-model={row[column.field]}
|
||||||
|
placeholder={'请选择 ' + column.title}
|
||||||
|
multiple={multiple}
|
||||||
|
filterable={filterable}
|
||||||
|
collapseTags={true}
|
||||||
|
collapseTagsTooltip={true}
|
||||||
|
allowCreate={allowCreate}
|
||||||
|
clearable={true}
|
||||||
|
>
|
||||||
|
{dicData.map((item: DictItem, index: number) => (
|
||||||
|
<el-option
|
||||||
|
key={index} // 建议用 item.value 作为 key,更稳定
|
||||||
|
label={item.label}
|
||||||
|
value={item.value}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</el-select>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
LowSummaryBottomSql: {
|
LowSummaryBottomSql: {
|
||||||
default: (renderOpts, { row, column }, isStop = false) => {
|
default: (renderOpts, { row, column }, isStop = false) => {
|
||||||
const { dicObj } = renderOpts
|
const { dicObj } = renderOpts
|
||||||
@@ -266,6 +373,32 @@ export const useRenderVxeColumn = (useType = 'table') => {
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
LowButton: {
|
||||||
|
default: (renderOpts, { row, column }) => {
|
||||||
|
const { buttonText, disabled } = renderOpts
|
||||||
|
const isDisabled = typeof disabled === 'function' ? disabled(row) : disabled
|
||||||
|
if (isDisabled) return <span style="color: #c0c4cc;">-</span>
|
||||||
|
return <span style="color: #409eff; cursor: pointer;">{buttonText || '操作'}</span>
|
||||||
|
},
|
||||||
|
edit: (renderOpts, { row, column }) => {
|
||||||
|
const { buttonText, buttonType, buttonSize, disabled } = renderOpts
|
||||||
|
const isDisabled = typeof disabled === 'function' ? disabled(row) : disabled
|
||||||
|
return (
|
||||||
|
<el-button
|
||||||
|
type={buttonType || 'primary'}
|
||||||
|
size={buttonSize || 'small'}
|
||||||
|
disabled={isDisabled}
|
||||||
|
onClick={() => {
|
||||||
|
if (renderOpts.events && renderOpts.events.click) {
|
||||||
|
renderOpts.events.click(row)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{buttonText || '操作'}
|
||||||
|
</el-button>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const key in lowControl) {
|
for (const key in lowControl) {
|
||||||
|
|||||||
@@ -40,6 +40,65 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</DesignPopup>
|
</DesignPopup>
|
||||||
|
<!-- 固定列行配置弹窗 -->
|
||||||
|
<DesignPopup
|
||||||
|
v-model="fixedColumnDialog.visible"
|
||||||
|
title="配置固定列内容"
|
||||||
|
width="600px"
|
||||||
|
:is-footer="true"
|
||||||
|
:handleClose="handleFixedColumnClose"
|
||||||
|
>
|
||||||
|
<template #default>
|
||||||
|
<div style="padding: 20px;">
|
||||||
|
<el-alert
|
||||||
|
title="提示"
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
style="margin-bottom: 20px;"
|
||||||
|
>
|
||||||
|
为该固定列的每一行配置不同的显示内容。点击"添加行"按钮增加新行,输入内容后保存。
|
||||||
|
</el-alert>
|
||||||
|
|
||||||
|
<div style="margin-bottom: 15px;">
|
||||||
|
<ElButton type="primary" @click="addFixedColumnRow" size="small">
|
||||||
|
<Icon icon="ep:plus" />
|
||||||
|
添加行
|
||||||
|
</ElButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="fixedColumnDialog.rows.length === 0" style="text-align: center; padding: 40px; color: #909399;">
|
||||||
|
暂无配置,请点击"添加行"按钮添加内容
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else style="max-height: 400px; overflow-y: auto;">
|
||||||
|
<div
|
||||||
|
v-for="(row, index) in fixedColumnDialog.rows"
|
||||||
|
:key="index"
|
||||||
|
style="display: flex; align-items: center; margin-bottom: 10px;"
|
||||||
|
>
|
||||||
|
<span style="width: 80px; color: #606266;">第 {{ index + 1 }} 行:</span>
|
||||||
|
<ElInput
|
||||||
|
v-model="row.value"
|
||||||
|
placeholder="请输入该行显示的内容"
|
||||||
|
style="flex: 1; margin-right: 10px;"
|
||||||
|
/>
|
||||||
|
<ElButton
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="removeFixedColumnRow(index)"
|
||||||
|
:icon="Delete"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</ElButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<ElButton @click="handleFixedColumnCancel">取 消</ElButton>
|
||||||
|
<ElButton type="primary" @click="handleFixedColumnSave">确 定</ElButton>
|
||||||
|
</template>
|
||||||
|
</DesignPopup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -49,6 +108,7 @@ import { tableInfoOption, dicObj } from '../designData'
|
|||||||
import { formattingLengStr } from '@/utils/lowDesign'
|
import { formattingLengStr } from '@/utils/lowDesign'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import * as DictDataApi from '@/api/system/dict/dict.type'
|
import * as DictDataApi from '@/api/system/dict/dict.type'
|
||||||
|
import { Delete } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
defineOptions({ name: 'TableInfo' })
|
defineOptions({ name: 'TableInfo' })
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
@@ -86,15 +146,29 @@ const tabsRef = ref()
|
|||||||
// 父字段引用
|
// 父字段引用
|
||||||
const parentFieldMap = ref(new Map())
|
const parentFieldMap = ref(new Map())
|
||||||
|
|
||||||
|
// 固定列行配置弹窗
|
||||||
|
const fixedColumnDialog = ref({
|
||||||
|
visible: false,
|
||||||
|
currentRow: null as any,
|
||||||
|
rows: [] as Array<{ value: string }>,
|
||||||
|
originalValue: '' // 保存原始值,用于取消时恢复
|
||||||
|
})
|
||||||
|
|
||||||
const fieldList = computed(() => {
|
const fieldList = computed(() => {
|
||||||
let dicData: Array<{ label: string; value: string; type: string }> = []
|
let dicData: Array<{ label: string; value: string; type: string }> = []
|
||||||
infoData.value.basics.forEach((item) => {
|
infoData.value.basics.forEach((item) => {
|
||||||
|
|
||||||
if (item.fieldCode && item.isDb == 'Y')
|
if (item.fieldCode && item.isDb == 'Y')
|
||||||
dicData.push({
|
dicData.push({
|
||||||
label: `${item.fieldCode}${item.fieldName ? '(' + item.fieldName + ')' : ''}`,
|
label: `${item.fieldCode}${item.fieldName ? '(' + item.fieldName + ')' : ''}`,
|
||||||
value: item.fieldCode,
|
value: item.fieldCode,
|
||||||
type: item.fieldType
|
type: item.fieldType
|
||||||
})
|
})
|
||||||
|
if(item.searchDefaultValue&&['当日','本月','本年'].includes(item.searchDefaultValue)){
|
||||||
|
item.defaultSelect=item.searchDefaultValue
|
||||||
|
}else if(item.searchDefaultValue){
|
||||||
|
item.defaultSelect='指定'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return dicData
|
return dicData
|
||||||
})
|
})
|
||||||
@@ -223,6 +297,61 @@ const addSubFieldRow = (parentField, parentRowIndex) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开固定列行配置弹窗
|
||||||
|
const openFixedColumnDialog = (row) => {
|
||||||
|
fixedColumnDialog.value.currentRow = row
|
||||||
|
// 保存原始值
|
||||||
|
fixedColumnDialog.value.originalValue = row.fixedColumnValue || ''
|
||||||
|
|
||||||
|
// 将字符串转换为数组:按逗号分割
|
||||||
|
let rowsArray = []
|
||||||
|
if (row.fixedColumnValue && typeof row.fixedColumnValue === 'string' && row.fixedColumnValue.trim() !== '') {
|
||||||
|
rowsArray = row.fixedColumnValue.split(',').map(value => ({ value: value }))
|
||||||
|
}
|
||||||
|
fixedColumnDialog.value.rows = rowsArray
|
||||||
|
fixedColumnDialog.value.visible = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加固定列行
|
||||||
|
const addFixedColumnRow = () => {
|
||||||
|
fixedColumnDialog.value.rows.push({ value: '' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除固定列行
|
||||||
|
const removeFixedColumnRow = (index) => {
|
||||||
|
fixedColumnDialog.value.rows.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消固定列配置
|
||||||
|
const handleFixedColumnCancel = () => {
|
||||||
|
// 恢复原始值
|
||||||
|
if (fixedColumnDialog.value.currentRow) {
|
||||||
|
fixedColumnDialog.value.currentRow.fixedColumnValue = fixedColumnDialog.value.originalValue
|
||||||
|
}
|
||||||
|
fixedColumnDialog.value.visible = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理弹窗关闭(X按钮或遮罩层)
|
||||||
|
const handleFixedColumnClose = (done: () => void) => {
|
||||||
|
// 恢复原始值
|
||||||
|
if (fixedColumnDialog.value.currentRow) {
|
||||||
|
fixedColumnDialog.value.currentRow.fixedColumnValue = fixedColumnDialog.value.originalValue
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存固定列配置
|
||||||
|
const handleFixedColumnSave = () => {
|
||||||
|
if (fixedColumnDialog.value.currentRow) {
|
||||||
|
// 将数组转换为字符串:使用逗号拼接
|
||||||
|
const rowValues = fixedColumnDialog.value.rows.map(row => row.value)
|
||||||
|
fixedColumnDialog.value.currentRow.fixedColumnValue = rowValues.join(',')
|
||||||
|
|
||||||
|
message.success(`已保存固定列"${fixedColumnDialog.value.currentRow.fieldName}"的行配置(共${fixedColumnDialog.value.rows.length}行)`)
|
||||||
|
}
|
||||||
|
fixedColumnDialog.value.visible = false
|
||||||
|
}
|
||||||
|
|
||||||
const initEditInfoData = () => {
|
const initEditInfoData = () => {
|
||||||
const data = tableInfoOption.formattingInitData(props.editInfoData)
|
const data = tableInfoOption.formattingInitData(props.editInfoData)
|
||||||
const fieldList: any[] = []
|
const fieldList: any[] = []
|
||||||
@@ -257,7 +386,9 @@ const initEditInfoData = () => {
|
|||||||
if (fieldItem.hasChildren === 'Y') {
|
if (fieldItem.hasChildren === 'Y') {
|
||||||
fieldItem.hasChildren = 'Y'
|
fieldItem.hasChildren = 'Y'
|
||||||
}
|
}
|
||||||
|
if (!!fieldItem.isHideDimension&&Object.prototype.toString.call(fieldItem.isHideDimension) == '[object String]') {
|
||||||
|
fieldItem.isHideDimension=fieldItem.isHideDimension.split(',')
|
||||||
|
}
|
||||||
fieldList.push(fieldItem)
|
fieldList.push(fieldItem)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -282,12 +413,14 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tableInfoOption.infoColumn.fieldColumn.isHideDimension.editRender.dicData = infoData.value.basics.map(({fieldCode,fieldName})=>{
|
||||||
|
return {label:fieldName,value:fieldCode}
|
||||||
|
})
|
||||||
// 设置父字段下拉选项
|
// 设置父字段下拉选项
|
||||||
const updateParentFieldOptions = () => {
|
const updateParentFieldOptions = () => {
|
||||||
// 获取所有parentFieldCode为空的字段作为可选父字段
|
// 获取所有parentFieldCode为空且非固定列的字段作为可选父字段
|
||||||
const parentFieldOptions = infoData.value.basics
|
const parentFieldOptions = infoData.value.basics
|
||||||
.filter(field => !field.parentFieldCode && field.fieldCode && field.fieldName)
|
.filter(field => !field.parentFieldCode && field.fieldCode && field.fieldName && field.isFixedColumn !== 'Y')
|
||||||
.map(field => ({
|
.map(field => ({
|
||||||
label: `${field.fieldName}`,
|
label: `${field.fieldName}`,
|
||||||
value: field.fieldCode
|
value: field.fieldCode
|
||||||
@@ -332,11 +465,12 @@ onMounted(() => {
|
|||||||
row.isSubField = false;
|
row.isSubField = false;
|
||||||
_lastSelectedValue = '';
|
_lastSelectedValue = '';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 清空选择
|
|
||||||
handleParentFieldClear(row);
|
|
||||||
_lastSelectedValue = '';
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// // 清空选择
|
||||||
|
// handleParentFieldClear(row);
|
||||||
|
// _lastSelectedValue = '';
|
||||||
|
//}
|
||||||
// 更新父字段选项
|
// 更新父字段选项
|
||||||
updateParentFieldOptions();
|
updateParentFieldOptions();
|
||||||
},
|
},
|
||||||
@@ -461,6 +595,41 @@ onMounted(() => {
|
|||||||
// 初始化父字段选项
|
// 初始化父字段选项
|
||||||
updateParentFieldOptions()
|
updateParentFieldOptions()
|
||||||
|
|
||||||
|
// 添加固定列选项的change事件处理
|
||||||
|
tableInfoOption.infoColumn.fieldColumn.isFixedColumn.editRender.events = {
|
||||||
|
change: (row) => {
|
||||||
|
if (row.isFixedColumn === 'Y') {
|
||||||
|
// 固定列不能有父字段
|
||||||
|
if (row.parentFieldCode) {
|
||||||
|
handleParentFieldClear(row)
|
||||||
|
}
|
||||||
|
// 固定列不能有子字段
|
||||||
|
if (row.hasChildren === 'Y') {
|
||||||
|
row.hasChildren = 'N'
|
||||||
|
// 清除所有子字段的父子关系
|
||||||
|
infoData.value.basics.forEach(field => {
|
||||||
|
if (field.parentFieldCode === row.fieldCode) {
|
||||||
|
handleParentFieldClear(field)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 取消固定列时清空固定列内容
|
||||||
|
row.fixedColumnValue = ''
|
||||||
|
}
|
||||||
|
updateParentFieldOptions()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加固定列内容配置按钮的点击事件
|
||||||
|
tableInfoOption.infoColumn.fieldColumn.fixedColumnValue.editRender.events = {
|
||||||
|
click: (row) => {
|
||||||
|
if (row.isFixedColumn === 'Y') {
|
||||||
|
openFixedColumnDialog(row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 设置字典Code的下拉选项
|
// 设置字典Code的下拉选项
|
||||||
DictDataApi.getSimpleDictTypeList().then((dicData) => {
|
DictDataApi.getSimpleDictTypeList().then((dicData) => {
|
||||||
const dicObj = {}
|
const dicObj = {}
|
||||||
|
|||||||
@@ -149,18 +149,28 @@ const infoColumn = {
|
|||||||
fieldColumn: {
|
fieldColumn: {
|
||||||
fieldCode: { title: '字段编码', minWidth: 120, editRender: { name: 'LowInput', verifyEdit: true } },
|
fieldCode: { title: '字段编码', minWidth: 120, editRender: { name: 'LowInput', verifyEdit: true } },
|
||||||
fieldName: { title: '字段名称', minWidth: 120, editRender: { name: 'LowInput' } },
|
fieldName: { title: '字段名称', minWidth: 120, editRender: { name: 'LowInput' } },
|
||||||
parentFieldName: { title: '父字段名称', width: 120, editRender: { name: 'LowSelect', dicData: [], filterable: true, clearable: true } },
|
parentFieldName: { title: '父字段名称', width: 120, editRender: { name: 'LowSelect', dicData: [], filterable: true,allowCreate:true, clearable: true } },
|
||||||
labelI18n: { title: '国际化配置', width: 140, editRender: { name: 'LowMonacoEditorInput', events: {} } },
|
labelI18n: { title: '国际化配置', width: 140, editRender: { name: 'LowMonacoEditorInput', events: {} } },
|
||||||
fieldType: { title: '字段类型', minWidth: 100, editRender: { name: 'LowSelect', verifyEdit: true, dicData: dicObj.fieldType, dicObj: getDicObj('fieldType') } },
|
fieldType: { title: '字段类型', minWidth: 100, editRender: { name: 'LowSelect', verifyEdit: true, dicData: dicObj.fieldType, dicObj: getDicObj('fieldType') } },
|
||||||
|
width: { title: '列宽', width: 120, align: "center", editRender: { name: 'LowInput', verifyEdit: true } },
|
||||||
|
|
||||||
|
isFixedColumn: { title: '固定列', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
|
fixedColumnValue: { title: '固定列内容', width: 110, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isFixedColumn !== 'Y', buttonText: '配置内容', buttonType: 'primary', buttonSize: 'small', events: {} } },
|
||||||
queryIsDb: { title: '接口查询', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
queryIsDb: { title: '接口查询', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
queryIsWeb: { title: '查询控件', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
queryIsWeb: { title: '查询控件', width: 75, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||||
|
searchDefaultValue: { title: '默认值', width: 180, align: "center", editRender: { name: 'LowInputDefualt' , verifyEdit: true} },
|
||||||
|
|
||||||
queryMode: { title: '查询模式', width: 130, editRender: { name: 'LowSelect', verifyEdit: true, dicData: dicObj.queryMode, dicObj: getDicObj('queryMode') } },
|
queryMode: { title: '查询模式', width: 130, editRender: { name: 'LowSelect', verifyEdit: true, dicData: dicObj.queryMode, dicObj: getDicObj('queryMode') } },
|
||||||
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' } },
|
||||||
|
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: [] } },
|
||||||
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' } },
|
||||||
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' } },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -179,6 +189,10 @@ for (const key in infoColumn) {
|
|||||||
if (!keys.includes('hasChildren')) {
|
if (!keys.includes('hasChildren')) {
|
||||||
keys.push('hasChildren')
|
keys.push('hasChildren')
|
||||||
}
|
}
|
||||||
|
// 确保固定列内容字段被包含
|
||||||
|
if (!keys.includes('fixedColumnValue')) {
|
||||||
|
keys.push('fixedColumnValue')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
infoApiKey[apiKey[key]] = keys
|
infoApiKey[apiKey[key]] = keys
|
||||||
}
|
}
|
||||||
@@ -187,7 +201,11 @@ for (const key in infoColumn) {
|
|||||||
//默认值
|
//默认值
|
||||||
const infoDefaultData = {
|
const infoDefaultData = {
|
||||||
basics: {
|
basics: {
|
||||||
fieldCode: '', fieldName: '', parentFieldName: '', labelI18n: '', fieldType: 'String', queryIsDb: 'N', queryIsWeb: 'N', queryMode: 'LIKE', dictCode: '', isExport: 'Y', isShowSort: 'N', isAmount: '', isDimension: '', hasChildren: 'N', isSubField: false, parentFieldId: '', parentFieldCode: '',
|
|
||||||
|
// fieldCode: '', fieldName: '', parentFieldName: '', labelI18n: '', fieldType: 'String', queryIsDb: 'N', queryIsWeb: 'N', queryMode: 'LIKE', dictCode: '',isHideCol:'N', isExport: 'Y', isShowSort: 'N', isAmount: '', isDimension: '',isHideDimension:'', hasChildren: 'N', isSubField: false, parentFieldId: '', parentFieldCode: '',
|
||||||
|
|
||||||
|
fieldCode: '', fieldName: '', parentFieldName: '', labelI18n: '', fieldType: 'String', isFixedColumn: 'N', fixedColumnValue: '', queryIsDb: 'N', queryIsWeb: 'N', queryMode: 'LIKE', dictCode: '', isExport: 'Y', isShowSort: 'N', isAmount: '', isDimension: '', isDynamicGroup: 'N', hasChildren: 'N', isSubField: false, parentFieldId: '', parentFieldCode: '',
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ const tableFormVerify = (type) => {
|
|||||||
const index = Number(i)
|
const index = Number(i)
|
||||||
const item = filedData[index]
|
const item = filedData[index]
|
||||||
item.sortNum = index + 1
|
item.sortNum = index + 1
|
||||||
|
item.isHideDimension?item.isHideDimension=item.isHideDimension.join(','):''
|
||||||
let messageText = ''
|
let messageText = ''
|
||||||
let tabKey = 'mysql'
|
let tabKey = 'mysql'
|
||||||
// 子字段不能再包含子字段
|
// 子字段不能再包含子字段
|
||||||
|
|||||||
Reference in New Issue
Block a user