Compare commits
7 Commits
main_beta
...
5ae5353baa
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ae5353baa | |||
|
|
09a300e98a | ||
|
|
7a496e6407 | ||
| e69cffbdb6 | |||
|
|
bcac3326a3 | ||
| f9393dfca8 | |||
| 67fe2e22fc |
@@ -128,6 +128,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 +137,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(() => {
|
||||||
@@ -177,6 +179,7 @@ const initTable = async () => {
|
|||||||
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,
|
||||||
@@ -258,8 +261,12 @@ const initTable = async () => {
|
|||||||
}
|
}
|
||||||
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') {
|
||||||
@@ -301,6 +308,7 @@ const initTable = async () => {
|
|||||||
initTableLayout()
|
initTableLayout()
|
||||||
}
|
}
|
||||||
const searchDimension=()=>{
|
const searchDimension=()=>{
|
||||||
|
|
||||||
searchChange()
|
searchChange()
|
||||||
}
|
}
|
||||||
const initTableLayout = () => {
|
const initTableLayout = () => {
|
||||||
@@ -467,6 +475,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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: '抱歉,服务器报告错误。',
|
||||||
|
|||||||
@@ -183,6 +183,43 @@ export const useRenderVxeColumn = (useType = 'table') => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
LowSelectMultiple: {
|
||||||
|
default: (renderOpts, { row, column }, isStop = false) => {
|
||||||
|
const { dicData } = renderOpts
|
||||||
|
const value = row[column.field]
|
||||||
|
const valStr=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
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ const parentFieldMap = ref(new Map())
|
|||||||
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 + ')' : ''}`,
|
||||||
@@ -257,7 +258,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,7 +285,9 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tableInfoOption.infoColumn.fieldColumn.isHideDimension.editRender.dicData = infoData.value.basics.map(({fieldCode,fieldName})=>{
|
||||||
|
return {label:fieldName,value:fieldCode}
|
||||||
|
})
|
||||||
// 设置父字段下拉选项
|
// 设置父字段下拉选项
|
||||||
const updateParentFieldOptions = () => {
|
const updateParentFieldOptions = () => {
|
||||||
// 获取所有parentFieldCode为空的字段作为可选父字段
|
// 获取所有parentFieldCode为空的字段作为可选父字段
|
||||||
|
|||||||
@@ -157,9 +157,11 @@ const infoColumn = {
|
|||||||
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' } },
|
||||||
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' } },
|
||||||
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' } },
|
||||||
},
|
},
|
||||||
@@ -187,7 +189,7 @@ 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: '',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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