Compare commits
3 Commits
main_beta
...
bcac3326a3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcac3326a3 | ||
| f9393dfca8 | |||
| 67fe2e22fc |
@@ -68,7 +68,7 @@
|
||||
></InputTimeRange>
|
||||
</template>
|
||||
<template #header v-if="Object.keys(dimensionFields)?.length">
|
||||
<div style="display:flex;margin-left:40px">
|
||||
<div style="display:flex;margin-left:40px">
|
||||
<el-checkbox-group @change="searchDimension" v-model="tableSearch['Group by']"
|
||||
placeholder="请选择内容">
|
||||
<template v-for="(item,key) in dimensionFields">
|
||||
@@ -136,6 +136,7 @@ const crudRef = ref()
|
||||
const dimensionFields=ref<any>({})
|
||||
const exportLoading = ref(false)
|
||||
const fieldList = ref<any[]>([]) // 添加fieldList引用
|
||||
const hideFeilds= ref<any>({})
|
||||
const permissions =
|
||||
wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[route.meta.menuDataId as string] || false
|
||||
const selectIds = computed(() => {
|
||||
@@ -258,6 +259,8 @@ const initTable = async () => {
|
||||
}
|
||||
if(item.isDimension=='Y'){
|
||||
dimensionFields.value[config.prop]=config
|
||||
hideFeilds.value[config.prop]=item.isHideDimension
|
||||
|
||||
}
|
||||
|
||||
if (item.queryMode == 'RANGE') config.searchRange = true
|
||||
@@ -301,6 +304,7 @@ const initTable = async () => {
|
||||
initTableLayout()
|
||||
}
|
||||
const searchDimension=()=>{
|
||||
|
||||
searchChange()
|
||||
}
|
||||
const initTableLayout = () => {
|
||||
@@ -467,6 +471,15 @@ const clearSearch = () => {
|
||||
const searchChange = (params?, done?) => {
|
||||
if (tablePage.value) tablePage.value['currentPage'] = 1
|
||||
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)
|
||||
})
|
||||
if (done) done()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
noPermission: `抱歉,您无权访问此页面。`,
|
||||
pageError: '抱歉,您访问的页面不存在。',
|
||||
networkError: '抱歉,服务器报告错误。',
|
||||
returnToHome: '返回首页'
|
||||
returnToHome: '返回工作台'
|
||||
},
|
||||
permission: {
|
||||
hasPermission: `请设置操作权限标签值`,
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
router: {
|
||||
login: '登录',
|
||||
socialLogin: '社交登录',
|
||||
home: '首页',
|
||||
home: '工作台',
|
||||
analysis: '分析页',
|
||||
workplace: '工作台'
|
||||
},
|
||||
@@ -275,7 +275,7 @@ export default {
|
||||
},
|
||||
exception: {
|
||||
backLogin: '返回登录',
|
||||
backHome: '返回首页',
|
||||
backHome: '返回工作台',
|
||||
subTitle403: '抱歉,您无权访问此页面。',
|
||||
subTitle404: '抱歉,您访问的页面不存在。',
|
||||
subTitle500: '抱歉,服务器报告错误。',
|
||||
|
||||
@@ -86,29 +86,25 @@ export default {
|
||||
selectedApp: null,
|
||||
appsData: {
|
||||
统计报表: [
|
||||
{id: 'office1', name: '文档编辑器', iconClass: 'el-icon-document'},
|
||||
{id: 'office2', name: '电子表格', iconClass: 'el-icon-tickets'},
|
||||
{id: 'office3', name: '演示文稿', iconClass: 'el-icon-present'},
|
||||
{id: 'office4', name: 'PDF阅读器', iconClass: 'el-icon-notebook-2'}
|
||||
{id: 'office1', name: '驾驶舱总屏幕', iconClass: 'el-icon-document'},
|
||||
{id: 'office2', name: '销售报表', iconClass: 'el-icon-tickets'},
|
||||
{id: 'office3', name: '生产报表', iconClass: 'el-icon-present'}
|
||||
],
|
||||
工业互联网: [
|
||||
{id: 'dev1', name: 'IDE Pro', iconClass: 'el-icon-setting'},
|
||||
{id: 'dev2', name: 'Git 工具箱', iconClass: 'el-icon-share'},
|
||||
{id: 'dev3', name: 'API测试工具', iconClass: 'el-icon-connection'},
|
||||
{id: 'dev4', name: '数据库管理', iconClass: 'el-icon-data-line'}
|
||||
{id: 'dev1', name: '产线组态', iconClass: 'el-icon-setting'}
|
||||
],
|
||||
数据中心: [
|
||||
{id: 'fun1', name: '音乐播放器', iconClass: 'el-icon-headset'},
|
||||
{id: 'fun2', name: '视频观看', iconClass: 'el-icon-video-play'},
|
||||
{id: 'fun3', name: '游戏中心', iconClass: 'el-icon-game'},
|
||||
{id: 'fun4', name: '阅读器', iconClass: 'el-icon-reading'}
|
||||
],
|
||||
系统工具: [
|
||||
{id: 'sys1', name: '系统监控', iconClass: 'el-icon-monitor'},
|
||||
{id: 'sys2', name: '磁盘清理', iconClass: 'el-icon-delete-solid'},
|
||||
{id: 'sys3', name: '网络诊断', iconClass: 'el-icon-mobile-phone'},
|
||||
{id: 'sys4', name: '安全防护', iconClass: 'el-icon-lock'}
|
||||
数据中台: [
|
||||
{id: 'fun1', name: '数据采集', iconClass: 'el-icon-headset'},
|
||||
// {id: 'fun2', name: '视频观看', iconClass: 'el-icon-video-play'},
|
||||
// {id: 'fun3', name: '游戏中心', iconClass: 'el-icon-game'},
|
||||
// {id: 'fun4', name: '阅读器', iconClass: 'el-icon-reading'}
|
||||
]
|
||||
// 系统工具: [
|
||||
// {id: 'sys1', name: '系统监控', iconClass: 'el-icon-monitor'},
|
||||
// {id: 'sys2', name: '磁盘清理', iconClass: 'el-icon-delete-solid'},
|
||||
// {id: 'sys3', name: '网络诊断', iconClass: 'el-icon-mobile-phone'},
|
||||
// {id: 'sys4', name: '安全防护', iconClass: 'el-icon-lock'}
|
||||
// ]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
default: (renderOpts, { row, column }, isStop = false) => {
|
||||
const { dicObj } = renderOpts
|
||||
|
||||
@@ -89,6 +89,7 @@ const parentFieldMap = ref(new Map())
|
||||
const fieldList = computed(() => {
|
||||
let dicData: Array<{ label: string; value: string; type: string }> = []
|
||||
infoData.value.basics.forEach((item) => {
|
||||
|
||||
if (item.fieldCode && item.isDb == 'Y')
|
||||
dicData.push({
|
||||
label: `${item.fieldCode}${item.fieldName ? '(' + item.fieldName + ')' : ''}`,
|
||||
@@ -257,7 +258,9 @@ const initEditInfoData = () => {
|
||||
if (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)
|
||||
})
|
||||
|
||||
@@ -282,7 +285,9 @@ onMounted(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
tableInfoOption.infoColumn.fieldColumn.isHideDimension.editRender.dicData = infoData.value.basics.map(({fieldCode,fieldName})=>{
|
||||
return {label:fieldName,value:fieldCode}
|
||||
})
|
||||
// 设置父字段下拉选项
|
||||
const updateParentFieldOptions = () => {
|
||||
// 获取所有parentFieldCode为空的字段作为可选父字段
|
||||
|
||||
@@ -159,7 +159,8 @@ const infoColumn = {
|
||||
isExport: { title: '是否可导出', width: 90, align: "center", editRender: { name: 'LowCheckbox' } },
|
||||
isAmount: { title: '是否合计', width: 75, align: "center", editRender: { name: 'LowCheckboxSum' } },
|
||||
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' } },
|
||||
hasChildren: { title: '子字段', width: 90, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isSubField === true, buttonText: '添加子字段', buttonType: 'primary', buttonSize: 'small' } },
|
||||
},
|
||||
@@ -187,7 +188,7 @@ for (const key in infoColumn) {
|
||||
//默认值
|
||||
const infoDefaultData = {
|
||||
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: '', 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 item = filedData[index]
|
||||
item.sortNum = index + 1
|
||||
|
||||
item.isHideDimension?item.isHideDimension=item.isHideDimension.join(','):''
|
||||
let messageText = ''
|
||||
let tabKey = 'mysql'
|
||||
// 子字段不能再包含子字段
|
||||
|
||||
Reference in New Issue
Block a user