Compare commits
42 Commits
31df51dcc6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a683da95a | ||
|
|
abba12dd82 | ||
|
|
213811c84d | ||
|
|
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 |
@@ -29,3 +29,8 @@ export const getUserSelectDeptList = (type) => {
|
|||||||
export const getUserSelectRoleList = () => {
|
export const getUserSelectRoleList = () => {
|
||||||
return request.get({ url: `/lideeyunji/adapter/role/list` })
|
return request.get({ url: `/lideeyunji/adapter/role/list` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取设备类型选择器列表
|
||||||
|
export const getSblxSelectList = () => {
|
||||||
|
return request.get({ url: `/system/sblx/simple-list` })
|
||||||
|
}
|
||||||
|
|||||||
@@ -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 })
|
||||||
|
}
|
||||||
|
|||||||
40
src/api/system/sblx/index.ts
Normal file
40
src/api/system/sblx/index.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface SblxVO {
|
||||||
|
id?: number
|
||||||
|
industryName: string
|
||||||
|
industryCode: string
|
||||||
|
parentId: number
|
||||||
|
sort: number
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询设备类型(精简)列表
|
||||||
|
export const getSimpleSblxList = async (): Promise<SblxVO[]> => {
|
||||||
|
return await request.get({ url: '/system/sblx/simple-list' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询设备类型列表
|
||||||
|
export const getSblxPage = async (params: PageParam) => {
|
||||||
|
return await request.get({ url: '/system/sblx/list', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询设备类型详情
|
||||||
|
export const getSblx = async (id: number) => {
|
||||||
|
return await request.get({ url: '/system/sblx/get?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增设备类型
|
||||||
|
export const createSblx = async (data: SblxVO) => {
|
||||||
|
return await request.post({ url: '/system/sblx/create', data: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改设备类型
|
||||||
|
export const updateSblx = async (params: SblxVO) => {
|
||||||
|
return await request.put({ url: '/system/sblx/update', data: params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除设备类型
|
||||||
|
export const deleteSblx = async (id: number) => {
|
||||||
|
return await request.delete({ url: '/system/sblx/delete?id=' + id })
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -295,8 +295,10 @@ defineExpose({ validate })
|
|||||||
&.control-tree,
|
&.control-tree,
|
||||||
&.control-cascader,
|
&.control-cascader,
|
||||||
&.control-regionSelect,
|
&.control-regionSelect,
|
||||||
|
&.control-sblxSelect,
|
||||||
&.control-userSelect,
|
&.control-userSelect,
|
||||||
&.control-deptSelect,
|
&.control-deptSelect,
|
||||||
|
&.control-sblxSelect,
|
||||||
&.control-dicTableSelect,
|
&.control-dicTableSelect,
|
||||||
&.control-map,
|
&.control-map,
|
||||||
&.control-color,
|
&.control-color,
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -69,14 +99,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;align-items:center;border-top:1px solid #eee;margin-bottom:10px;padding-top:10px;">
|
<div style="display:flex;padding-top:10px;margin-bottom:10px;border-top:1px solid #eee;align-items:center;">
|
||||||
<span style="margin-right:10px;">维度:</span>
|
<span style="margin-right:10px;">维度:</span>
|
||||||
<el-checkbox-group
|
<el-checkbox-group
|
||||||
@change="searchDimension" v-model="tableSearch['Group by']"
|
@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
|
<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,17 +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)){
|
|
||||||
|
if(['年','年度','年份','月','月度','月份','年月'].includes(item.fieldName)&&config.search){
|
||||||
config.searchSpan=3
|
config.searchSpan=3
|
||||||
config.searchLabelWidth=60
|
|
||||||
if(item.fieldName.includes('年')){
|
if(item.fieldName.includes('年')){
|
||||||
config.searchType='year'
|
config.searchType='year'
|
||||||
|
config.valueFormat = 'YYYY'
|
||||||
}else if(item.fieldName.includes('月')){
|
}else if(item.fieldName.includes('月')){
|
||||||
config.searchType='select'
|
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'}]
|
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
|
||||||
@@ -298,14 +465,15 @@ 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)
|
||||||
}
|
}
|
||||||
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'
|
||||||
@@ -368,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) => {
|
||||||
@@ -407,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报表使用模拟数据
|
||||||
@@ -435,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
|
||||||
}
|
}
|
||||||
@@ -560,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] || ''
|
||||||
@@ -573,34 +746,54 @@ 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()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -645,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 (done) done()
|
||||||
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()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
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)
|
||||||
@@ -715,6 +902,18 @@ 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:'、'
|
||||||
@@ -725,6 +924,41 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.el-table){
|
||||||
|
--el-table-border-color: #000;
|
||||||
|
|
||||||
|
.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-right: 1px solid #000 !important;
|
||||||
|
border-bottom: 1px solid #000 !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
td.textAlignCell .cell{
|
||||||
|
span{
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tfoot .el-table__cell{
|
||||||
|
border-top: 1px solid #000 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lastAmountRow{
|
.lastAmountRow{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ const dateType = [
|
|||||||
]
|
]
|
||||||
const treeType = ['tree', 'cascader']
|
const treeType = ['tree', 'cascader']
|
||||||
const selectType = ['select', 'radio', 'checkbox', 'switch']
|
const selectType = ['select', 'radio', 'checkbox', 'switch']
|
||||||
const avueSlotType = ['userSelect', 'deptSelect', 'dicTableSelect']
|
const avueSlotType = ['userSelect', 'deptSelect', 'sblxSelect', 'dicTableSelect']
|
||||||
|
|
||||||
const changeType = [...timeType, ...dateType, ...treeType, ...selectType, ...avueSlotType]
|
const changeType = [...timeType, ...dateType, ...treeType, ...selectType, ...avueSlotType]
|
||||||
const vBind = computed(() => {
|
const vBind = computed(() => {
|
||||||
|
|||||||
@@ -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,11 +96,17 @@ 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]
|
||||||
} else menu[key] = menuObj[key]
|
} else menu[key] = menuObj[key]
|
||||||
}
|
}
|
||||||
return { menu, more }
|
return { menu, more }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -27,6 +27,20 @@
|
|||||||
@set-form-data="setFormData"
|
@set-form-data="setFormData"
|
||||||
></DeptSelect>
|
></DeptSelect>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="control.controlType == 'sblxSelect'">
|
||||||
|
<!-- 设备类型选择 -->
|
||||||
|
<SblxSelect
|
||||||
|
ref="slotRef"
|
||||||
|
v-model="model"
|
||||||
|
:column="currColumn"
|
||||||
|
:disabled="disabled"
|
||||||
|
:size="scope.size"
|
||||||
|
:type="currFormType"
|
||||||
|
:prop="control.prop"
|
||||||
|
:scope="scope"
|
||||||
|
@set-form-data="setFormData"
|
||||||
|
></SblxSelect>
|
||||||
|
</template>
|
||||||
<template v-else-if="control.controlType == 'dicTableSelect'">
|
<template v-else-if="control.controlType == 'dicTableSelect'">
|
||||||
<!-- 表格选择 -->
|
<!-- 表格选择 -->
|
||||||
<DicTableSelect
|
<DicTableSelect
|
||||||
@@ -127,7 +141,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineOptions({ name: 'AvueSlot' })
|
import UserSelect from './UserSelect.vue'
|
||||||
|
import DeptSelect from './DeptSelect.vue'
|
||||||
|
import SblxSelect from './SblxSelect.vue'
|
||||||
|
|
||||||
|
defineOptions({ name: 'AvueSlot', components: { UserSelect, DeptSelect, SblxSelect } })
|
||||||
|
|
||||||
interface Control {
|
interface Control {
|
||||||
controlType: string
|
controlType: string
|
||||||
@@ -159,7 +177,7 @@ const currFormType = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const currColumn = computed(() => {
|
const currColumn = computed(() => {
|
||||||
if (['userSelect', 'deptSelect', 'dicTableSelect'].includes(props.control.controlType)) {
|
if (['userSelect', 'deptSelect', 'sblxSelect', 'dicTableSelect'].includes(props.control.controlType)) {
|
||||||
if (props.slotType == 'search' && props.control) {
|
if (props.slotType == 'search' && props.control) {
|
||||||
return Object.assign(props.scope.column, props.control.column || {})
|
return Object.assign(props.scope.column, props.control.column || {})
|
||||||
}
|
}
|
||||||
|
|||||||
529
src/components/LowDesign/src/shareControl/SblxSelect.vue
Normal file
529
src/components/LowDesign/src/shareControl/SblxSelect.vue
Normal file
@@ -0,0 +1,529 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sblx-select-box w-100%">
|
||||||
|
<div
|
||||||
|
class="sblx-input"
|
||||||
|
:class="[
|
||||||
|
{ disabled, 'cursor-not-allowed!': disabled && !props.column?.multiple },
|
||||||
|
type,
|
||||||
|
size
|
||||||
|
]"
|
||||||
|
@click="openSblxSelect"
|
||||||
|
>
|
||||||
|
<template v-if="selectId.length">
|
||||||
|
<div class="sblx-text-list" v-if="props.column?.multiple">
|
||||||
|
<el-tag
|
||||||
|
v-for="id in selectId"
|
||||||
|
:key="id"
|
||||||
|
:closable="!disabled && !column.readonly"
|
||||||
|
type="info"
|
||||||
|
:size="size"
|
||||||
|
@close="tagValueClose(id)"
|
||||||
|
>
|
||||||
|
{{ getCurrText(id) }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div v-else class="px-11px overflow-hidden text-ellipsis ws-nowrap">
|
||||||
|
{{ getCurrText(selectId[0]) }}
|
||||||
|
<span
|
||||||
|
v-if="
|
||||||
|
['add', 'edit'].includes(type) &&
|
||||||
|
props.column?.clearable !== false &&
|
||||||
|
!disabled &&
|
||||||
|
!column.readonly
|
||||||
|
"
|
||||||
|
class="sblx-input-clear pos-absolute right-11px top-50% cursor-pointer hidden"
|
||||||
|
style="transform: translateY(-50%)"
|
||||||
|
@click.stop="tagValueClose(selectId[0])"
|
||||||
|
>
|
||||||
|
<Icon :size="14" color="#909399" icon="ep:circle-close"></Icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="empty-text" v-else>{{ placeholderText }}</div>
|
||||||
|
<div class="sblx-num" v-if="column.multiple && selectId.length >= 2">
|
||||||
|
{{ t('Avue.control.selectPrepend') }}
|
||||||
|
<span>{{ selectId.length }}</span>
|
||||||
|
{{ t('Avue.control.selectAppend') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<DesignPopup
|
||||||
|
v-if="['add', 'edit'].includes(type)"
|
||||||
|
v-model="dialogData.value"
|
||||||
|
v-model:isFull="dialogData.isFull"
|
||||||
|
v-bind="dialogData.params"
|
||||||
|
:isBodyFull="true"
|
||||||
|
>
|
||||||
|
<template #default>
|
||||||
|
<el-container class="h-100%" v-loading="loading">
|
||||||
|
<el-main class="box-border">
|
||||||
|
<avue-tree
|
||||||
|
ref="sblxRef"
|
||||||
|
class="sblx-tree"
|
||||||
|
:option="treeSblxOption"
|
||||||
|
:data="treeSblxData"
|
||||||
|
@check-change="checkChange"
|
||||||
|
@node-click="nodeClick"
|
||||||
|
>
|
||||||
|
<template #default="{ data }">
|
||||||
|
<span
|
||||||
|
class="el-tree-node__label"
|
||||||
|
:class="{
|
||||||
|
disabled: !column.multiple && data.disabled,
|
||||||
|
active:
|
||||||
|
!column.multiple && data[treeSblxOption.props.value] == sblxSelect[0]?.id
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ data[treeSblxOption.props.label] }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</avue-tree>
|
||||||
|
</el-main>
|
||||||
|
<el-aside width="200px">
|
||||||
|
<div
|
||||||
|
class="h-100% flex-basis-200px flex-shrink-0"
|
||||||
|
:style="{ borderLeft: 'var(--el-border)' }"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="box-border h-31px pb-5px pt-5px text-center"
|
||||||
|
:style="{ borderBottom: 'var(--el-border)' }"
|
||||||
|
>
|
||||||
|
<span>{{ t('Avue.control.selectPrepend') }}({{ sblxSelectId.length }})</span>
|
||||||
|
<el-button
|
||||||
|
class="mt--3px p-0"
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
v-if="sblxSelectId.length"
|
||||||
|
@click="deepClear"
|
||||||
|
>
|
||||||
|
{{ t('Avue.form.emptyBtn') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="box-border flex flex-wrap items-center overflow-x-hidden overflow-y-auto p-10px"
|
||||||
|
:style="{
|
||||||
|
height: 'calc(100% - 31px)',
|
||||||
|
columnGap: '6px',
|
||||||
|
rowGap: '6px',
|
||||||
|
alignContent: 'start'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-tag
|
||||||
|
v-for="id in sblxSelectId"
|
||||||
|
:key="id"
|
||||||
|
:closable="true"
|
||||||
|
type="info"
|
||||||
|
:size="size"
|
||||||
|
class="h-auto! py-4px! ws-break-spaces! break-anywhere! line-height-none"
|
||||||
|
@close="tagTableClose(id)"
|
||||||
|
>
|
||||||
|
{{ getCurrText(id) }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
</DesignPopup>
|
||||||
|
<DesignPopup
|
||||||
|
v-else
|
||||||
|
v-model="detailDialog"
|
||||||
|
:width="800"
|
||||||
|
:title="`<span>${column.label}</span><span class='text-14px'>(${t('Avue.control.totalPrepend')} ${selectId.length} ${t('Avue.control.totalAppend')})</span>`"
|
||||||
|
:dialogParams="{ alignCenter: true }"
|
||||||
|
>
|
||||||
|
<template #default>
|
||||||
|
<div class="h-100% box-border flex p-20px">
|
||||||
|
<div
|
||||||
|
class="box-border flex flex-wrap items-center overflow-x-hidden overflow-y-auto"
|
||||||
|
:style="{
|
||||||
|
height: '100%',
|
||||||
|
columnGap: '6px',
|
||||||
|
rowGap: '6px',
|
||||||
|
alignContent: 'start'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-tag
|
||||||
|
v-for="id in selectId"
|
||||||
|
:key="id"
|
||||||
|
type="info"
|
||||||
|
:size="size"
|
||||||
|
class="h-auto! py-4px! ws-break-spaces! break-anywhere! line-height-none"
|
||||||
|
>
|
||||||
|
{{ lowStore.dicObj[dicKey]?.[id] || id }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</DesignPopup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useLowStoreWithOut } from '@/store/modules/low'
|
||||||
|
import { listToTree, forEach } from '@/utils/tree'
|
||||||
|
import * as DicApi from '@/api/design/dic/index'
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
|
defineOptions({ name: 'SblxSelect' })
|
||||||
|
|
||||||
|
interface Column {
|
||||||
|
label: string
|
||||||
|
disabledIds: Array<string> //禁止选择的id
|
||||||
|
multiple?: boolean //多选
|
||||||
|
checkStrictly?: boolean //父子不互相关联
|
||||||
|
leafOnly?: boolean //勾选值只保留子节点
|
||||||
|
stopParent?: boolean //禁用父级勾选
|
||||||
|
accordion?: boolean //每次只展开一个同级树节点
|
||||||
|
separator?: string //分隔符
|
||||||
|
readonly?: boolean
|
||||||
|
placeholder?: string
|
||||||
|
textFormatter?: string //回显名称格式化
|
||||||
|
clearable?: boolean
|
||||||
|
}
|
||||||
|
interface Props {
|
||||||
|
column: Column
|
||||||
|
prop: string
|
||||||
|
type: string
|
||||||
|
size?: 'small' | 'large' | 'default'
|
||||||
|
disabled?: boolean
|
||||||
|
scope?: object
|
||||||
|
}
|
||||||
|
interface TreeSblx {
|
||||||
|
id: string
|
||||||
|
parentId: string
|
||||||
|
industryName: string
|
||||||
|
disabled?: boolean
|
||||||
|
children?: TreeSblx[]
|
||||||
|
}
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
const model = defineModel<string>()
|
||||||
|
const emit = defineEmits(['set-form-data'])
|
||||||
|
const { t } = useI18n()
|
||||||
|
const lowStore = useLowStoreWithOut()
|
||||||
|
const dicKey = 'sblxSelect'
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const timer = ref<any>(null)
|
||||||
|
const sblxSelect = ref<any>([])
|
||||||
|
const sblxSelectId = ref<Array<number | string>>([])
|
||||||
|
const treeSblxOption = ref({
|
||||||
|
addBtn: false,
|
||||||
|
menu: false,
|
||||||
|
nodeKey: 'id',
|
||||||
|
multiple: props.column.multiple,
|
||||||
|
checkStrictly: props.column.checkStrictly,
|
||||||
|
accordion: props.column.accordion,
|
||||||
|
props: { label: 'industryName', value: 'id', childern: 'children' }
|
||||||
|
})
|
||||||
|
const treeSblxData = ref<TreeSblx[]>([])
|
||||||
|
const dialogData = ref({
|
||||||
|
value: false,
|
||||||
|
isFull: false,
|
||||||
|
params: {
|
||||||
|
width: '600px',
|
||||||
|
title: t('Avue.control.select') + ' ' + (props.column.label || '设备类型'),
|
||||||
|
footerBtn: [
|
||||||
|
{
|
||||||
|
params: {},
|
||||||
|
name: t('Avue.common.cancelBtn'),
|
||||||
|
icon: 'material-symbols:close-rounded',
|
||||||
|
clickFun: () => {
|
||||||
|
dialogData.value.value = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
params: { type: 'primary' },
|
||||||
|
name: t('Avue.common.submitBtn'),
|
||||||
|
icon: 'material-symbols:check-rounded',
|
||||||
|
clickFun: () => {
|
||||||
|
model.value = getCurrSblxSelect('confirm').join(',')
|
||||||
|
setTimeout(() => {
|
||||||
|
dialogData.value.value = false
|
||||||
|
}, 30)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dialogParams: {
|
||||||
|
closeOnPressEscape: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const detailDialog = ref(false)
|
||||||
|
|
||||||
|
const sblxRef = ref()
|
||||||
|
|
||||||
|
const selectId = computed(() => {
|
||||||
|
if (!model.value) return []
|
||||||
|
if (typeof model.value != 'string') {
|
||||||
|
try {
|
||||||
|
return [(model.value as Number).toString()]
|
||||||
|
} catch (error) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return model.value.split(',')
|
||||||
|
})
|
||||||
|
|
||||||
|
const placeholderText = computed(() => {
|
||||||
|
let text = ''
|
||||||
|
if (!props.disabled && !props.column.readonly) {
|
||||||
|
text =
|
||||||
|
props.column.placeholder ||
|
||||||
|
`${t('Avue.tip.select')} ${props.column.label || '设备类型'}`
|
||||||
|
}
|
||||||
|
return text
|
||||||
|
})
|
||||||
|
|
||||||
|
const getCurrText = (id) => {
|
||||||
|
if (id) id = `${id}`
|
||||||
|
const text = lowStore.dicObj[dicKey]?.[id] || ''
|
||||||
|
const formatter = props.column.textFormatter
|
||||||
|
if (formatter) {
|
||||||
|
return formatter.replace(/{dicCode}/g, id).replace(/{dicText}/g, text)
|
||||||
|
}
|
||||||
|
return text || id
|
||||||
|
}
|
||||||
|
|
||||||
|
const deepClear = () => {
|
||||||
|
if (props.column.multiple) sblxRef.value.setCheckedKeys([])
|
||||||
|
else {
|
||||||
|
sblxRef.value.setCurrentKey(null)
|
||||||
|
sblxSelect.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const checkChange = () => {
|
||||||
|
if (!props.column.multiple) return false
|
||||||
|
if (timer.value) clearTimeout(timer.value)
|
||||||
|
timer.value = setTimeout(() => {
|
||||||
|
sblxSelect.value = sblxRef.value.getCheckedNodes(props.column.leafOnly || false)
|
||||||
|
}, 30)
|
||||||
|
}
|
||||||
|
const nodeClick = (data) => {
|
||||||
|
if (props.column.multiple || data.disabled) return false
|
||||||
|
if (sblxSelect.value.length && sblxSelect.value[0].id == data.id) deepClear()
|
||||||
|
else sblxSelect.value = [data]
|
||||||
|
}
|
||||||
|
const openSblxSelect = () => {
|
||||||
|
const index = props.scope?.['index']
|
||||||
|
if (props.column['onClick']) {
|
||||||
|
props.column['onClick']({ value: model.value, column: props.column, index })
|
||||||
|
} else if (props.column['click'])
|
||||||
|
props.column['click']({ value: model.value, column: props.column, index })
|
||||||
|
if (props.disabled || props.column.readonly) {
|
||||||
|
if (selectId.value && selectId.value.length) detailDialog.value = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialogData.value.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const tagValueClose = (id) => {
|
||||||
|
let list = model.value ? model.value.split(',') : []
|
||||||
|
list = list.filter((key) => key != id)
|
||||||
|
model.value = list.join(',')
|
||||||
|
}
|
||||||
|
const tagTableClose = (id) => {
|
||||||
|
if (props.column.multiple) {
|
||||||
|
sblxRef.value.setChecked(id, false)
|
||||||
|
} else deepClear()
|
||||||
|
}
|
||||||
|
const getCurrSblxSelect = (type?) => {
|
||||||
|
const dicObj = {}
|
||||||
|
const textList: string[] = []
|
||||||
|
const ids = sblxSelect.value.map((item) => {
|
||||||
|
if (item.id && item.industryName) {
|
||||||
|
dicObj[item.id] = item.industryName
|
||||||
|
textList.push(item.industryName)
|
||||||
|
}
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
if (type == 'confirm') {
|
||||||
|
emit('set-form-data', '$' + props.prop, textList.join(props.column.separator || ' | '))
|
||||||
|
}
|
||||||
|
lowStore.setDicObj(dicKey, dicObj)
|
||||||
|
return ids
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSblxList = (getType) => {
|
||||||
|
const { multiple, disabledIds } = props.column
|
||||||
|
let currData: any = {}
|
||||||
|
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
let data = await DicApi.getSblxSelectList()
|
||||||
|
data = data.map((item) => {
|
||||||
|
if (disabledIds && disabledIds.includes(item.id)) item.disabled = true
|
||||||
|
if (getType == 'init' && !multiple && selectId.value.includes(item.id)) currData = item
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
const treeProps = { id: 'id', pid: 'parentId', children: 'children' }
|
||||||
|
let treeData = listToTree(data, treeProps)
|
||||||
|
|
||||||
|
if (props.column.stopParent) {
|
||||||
|
forEach(
|
||||||
|
treeData,
|
||||||
|
(node) => {
|
||||||
|
if (node[treeProps.children]?.length) node.disabled = true
|
||||||
|
},
|
||||||
|
treeProps.children
|
||||||
|
)
|
||||||
|
}
|
||||||
|
treeSblxData.value = treeData
|
||||||
|
setTimeout(() => {
|
||||||
|
if (multiple) {
|
||||||
|
sblxRef.value.setCheckedKeys(selectId.value)
|
||||||
|
sblxSelect.value = sblxRef.value.getCheckedNodes(props.column.leafOnly || false)
|
||||||
|
} else {
|
||||||
|
if (currData.id) {
|
||||||
|
sblxRef.value.setCurrentKey(currData.id)
|
||||||
|
sblxSelect.value = [currData]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 30)
|
||||||
|
resolve(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => model.value,
|
||||||
|
(value) => {
|
||||||
|
const selectObj = {}
|
||||||
|
cloneDeep(sblxSelect.value).forEach((item) => {
|
||||||
|
delete item.children
|
||||||
|
selectObj[item[treeSblxOption.value.nodeKey]] = item
|
||||||
|
})
|
||||||
|
const changeObj = {
|
||||||
|
value,
|
||||||
|
column: props.column,
|
||||||
|
selectObj,
|
||||||
|
row: props.scope?.['row'],
|
||||||
|
index: props.scope?.['index']
|
||||||
|
}
|
||||||
|
if (props.column['onChange']) props.column['onChange'](changeObj)
|
||||||
|
else if (props.column['change']) props.column['change'](changeObj)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => dialogData.value.value,
|
||||||
|
(val) => {
|
||||||
|
if (!val) {
|
||||||
|
if (sblxRef.value) deepClear()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getSblxList('init')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => sblxSelect.value,
|
||||||
|
(val) => {
|
||||||
|
sblxSelectId.value = getCurrSblxSelect()
|
||||||
|
dialogData.value.params.footerBtn[1].name = `${t('Avue.common.submitBtn')}(${val.length})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.sblx-tree {
|
||||||
|
.el-tree-node__label {
|
||||||
|
&.active {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sblx-input {
|
||||||
|
display: flex;
|
||||||
|
height: var(--el-component-size);
|
||||||
|
font-size: var(--el-text-base);
|
||||||
|
color: var(--el-input-text-color, var(--el-text-color-regular));
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: var(--el-bg-color);
|
||||||
|
background-image: none;
|
||||||
|
border: var(--el-border);
|
||||||
|
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
||||||
|
box-sizing: border-box;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.sblx-text-list {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 11px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
column-gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
margin: 0 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #999;
|
||||||
|
text-align: left;
|
||||||
|
flex: 1;
|
||||||
|
text-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sblx-num {
|
||||||
|
height: 100%;
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
line-height: var(--el-component-size);
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
background-color: var(--el-fill-color-light);
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 2px;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
&.edit,
|
||||||
|
&.add {
|
||||||
|
background-color: var(--el-disabled-bg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.view {
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.sblx-text-list {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sblx-num {
|
||||||
|
margin-right: -20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
height: var(--el-component-size-small);
|
||||||
|
font-size: var(--el-font-size-extra-small);
|
||||||
|
|
||||||
|
.sblx-num {
|
||||||
|
height: var(--el-component-size-small);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.large {
|
||||||
|
height: var(--el-component-size-large);
|
||||||
|
font-size: var(--el-font-size-large);
|
||||||
|
|
||||||
|
.sblx-num {
|
||||||
|
height: var(--el-component-size-large);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.sblx-input-clear {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -411,6 +411,21 @@ const regionSelectConfig = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const sblxSelectConfig = [
|
||||||
|
{
|
||||||
|
title: '控件配置',
|
||||||
|
list: [
|
||||||
|
{ label: '多选', value: 'multiple', val: false, type: 'switch', dic: dicObj.boolean },
|
||||||
|
{ label: '回显名称格式化', value: 'textFormatter', val: '', type: 'select', dic: dicObj.dictTextFormatter, params: { filterable: true, allowCreate: true } },
|
||||||
|
{ label: '父子不互相关联', value: 'checkStrictly', val: false, type: 'switch', dic: dicObj.boolean },
|
||||||
|
{ label: '勾选值只保留子节点', value: 'leafOnly', val: false, type: 'switch', dic: dicObj.boolean },
|
||||||
|
{ label: '禁用父级勾选', value: 'stopParent', val: false, type: 'switch', dic: dicObj.boolean },
|
||||||
|
{ label: '每次只展开一个同级树节点', value: 'accordion', val: false, type: 'switch', dic: dicObj.boolean },
|
||||||
|
{ label: '分隔符', value: 'separator', val: ' | ' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
// const ueditorConfig=[]
|
// const ueditorConfig=[]
|
||||||
|
|
||||||
const customControlConfig = [
|
const customControlConfig = [
|
||||||
@@ -431,5 +446,5 @@ export default {
|
|||||||
selectConfig, radioConfig, checkboxConfig, switchConfig, treeConfig, cascaderConfig,
|
selectConfig, radioConfig, checkboxConfig, switchConfig, treeConfig, cascaderConfig,
|
||||||
dateConfig, timeConfig,
|
dateConfig, timeConfig,
|
||||||
fileConfig, imageConfig,
|
fileConfig, imageConfig,
|
||||||
monacoEditorConfig, markDownConfig, dicTableSelectConfig, userSelectConfig, deptSelectConfig, regionSelectConfig, customControlConfig
|
monacoEditorConfig, markDownConfig, dicTableSelectConfig, userSelectConfig, deptSelectConfig, sblxSelectConfig, regionSelectConfig, customControlConfig
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ const initColumn = (column: object, control, ruleObj, componentData: Object, oth
|
|||||||
verifyControl.isControl = false
|
verifyControl.isControl = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (['userSelect', 'deptSelect', 'dicTableSelect'].includes(type) && parentProp.indexOf('layoutTable') === 0) {
|
if (['userSelect', 'deptSelect', 'sblxSelect', 'dicTableSelect'].includes(type) && parentProp.indexOf('layoutTable') === 0) {
|
||||||
//表格布局详情模式
|
//表格布局详情模式
|
||||||
if (type == 'dicTableSelect') {
|
if (type == 'dicTableSelect') {
|
||||||
//表格选择回显
|
//表格选择回显
|
||||||
@@ -279,7 +279,7 @@ const initColumn = (column: object, control, ruleObj, componentData: Object, oth
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (['userSelect', 'deptSelect', 'markDown', 'comboBox'].includes(type)) {
|
if (['userSelect', 'deptSelect', 'sblxSelect', 'markDown', 'comboBox'].includes(type)) {
|
||||||
verifyControl.isForm = true
|
verifyControl.isForm = true
|
||||||
}
|
}
|
||||||
if (type == 'regionSelect') {
|
if (type == 'regionSelect') {
|
||||||
@@ -546,11 +546,11 @@ export const initFormOption: (formOption: any, formType: string, onlyId: string
|
|||||||
}
|
}
|
||||||
//表单数据格式化
|
//表单数据格式化
|
||||||
export const formDataFormatting = (formOption, formData, formType) => {
|
export const formDataFormatting = (formOption, formData, formType) => {
|
||||||
const echoObj = { userSelect: [], deptSelect: [] }
|
const echoObj = { userSelect: [], deptSelect: [], sblxSelect: [] }
|
||||||
const handleValue = (column, data, key, parentType) => {
|
const handleValue = (column, data, key, parentType) => {
|
||||||
const type = column[key]?.type
|
const type = column[key]?.type
|
||||||
if (data[key] === '' || data[key] === null || data[key] === undefined || !type) return
|
if (data[key] === '' || data[key] === null || data[key] === undefined || !type) return
|
||||||
if (['userSelect', 'deptSelect', 'dicTableSelect'].includes(type)) {
|
if (['userSelect', 'deptSelect', 'sblxSelect', 'dicTableSelect'].includes(type)) {
|
||||||
if (data[key] instanceof Array || typeof data[key] == 'number') data[key] = data[key].toString()
|
if (data[key] instanceof Array || typeof data[key] == 'number') data[key] = data[key].toString()
|
||||||
if (type == 'dicTableSelect') {
|
if (type == 'dicTableSelect') {
|
||||||
const { dictTable, dictCode, dictText } = column[key]
|
const { dictTable, dictCode, dictText } = column[key]
|
||||||
@@ -613,9 +613,10 @@ export const formDataFormatting = (formOption, formData, formType) => {
|
|||||||
if (key.indexOf('&') !== -1 && key.split('&')[1] != 'id') return true
|
if (key.indexOf('&') !== -1 && key.split('&')[1] != 'id') return true
|
||||||
return /^(\d+)$/.test(str + '');
|
return /^(\d+)$/.test(str + '');
|
||||||
})
|
})
|
||||||
if (['userSelect', 'deptSelect'].includes(key)) {
|
if (['userSelect', 'deptSelect', 'sblxSelect'].includes(key)) {
|
||||||
if (echoObj[key].length) {
|
if (echoObj[key].length) {
|
||||||
dicApiData.push({ [key == 'userSelect' ? 'userIdList' : 'deptIdList']: [...new Set(echoObj[key])] })
|
const keyMap = { userSelect: 'userIdList', deptSelect: 'deptIdList', sblxSelect: 'sblxIdList' }
|
||||||
|
dicApiData.push({ [keyMap[key]]: [...new Set(echoObj[key])] })
|
||||||
}
|
}
|
||||||
} else if (echoObj[key]?.length) {
|
} else if (echoObj[key]?.length) {
|
||||||
const [dbformId, code, label] = key.split('&')
|
const [dbformId, code, label] = key.split('&')
|
||||||
@@ -624,11 +625,12 @@ 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' },
|
||||||
deptList: { dicKey: 'deptSelect', label: 'name' }
|
deptList: { dicKey: 'deptSelect', label: 'name' },
|
||||||
|
sblxList: { dicKey: 'sblxSelect', label: 'industryName' }
|
||||||
}
|
}
|
||||||
for (const key in dicData) {
|
for (const key in dicData) {
|
||||||
const dicObj = {}
|
const dicObj = {}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { encryptAES } from '@/components/LowDesign/src/utils/aes'
|
|||||||
import { getDicTableText } from '@/api/design/dic'
|
import { getDicTableText } from '@/api/design/dic'
|
||||||
|
|
||||||
|
|
||||||
//设置用户、部门控件数据名称
|
//设置用户、部门、设备类型控件数据名称
|
||||||
export const setUserAndDeptName = (params) => {
|
export const setUserAndDeptName = (params) => {
|
||||||
let { userIdList, deptIdList } = params
|
let { userIdList, deptIdList, sblxIdList } = params
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const lowStore = useLowStoreWithOut()
|
const lowStore = useLowStoreWithOut()
|
||||||
const dictLabel: object[] = []
|
const dictLabel: object[] = []
|
||||||
@@ -19,12 +19,18 @@ export const setUserAndDeptName = (params) => {
|
|||||||
deptIdList = [...new Set(deptIdList)]
|
deptIdList = [...new Set(deptIdList)]
|
||||||
dictLabel.push({ deptIdList })
|
dictLabel.push({ deptIdList })
|
||||||
}
|
}
|
||||||
|
sblxIdList = (sblxIdList || []).filter(id => !lowStore.dicObj?.sblxSelect?.[id])
|
||||||
|
if (sblxIdList?.length) {
|
||||||
|
sblxIdList = [...new Set(sblxIdList)]
|
||||||
|
dictLabel.push({ sblxIdList })
|
||||||
|
}
|
||||||
if (dictLabel.length) {
|
if (dictLabel.length) {
|
||||||
const dictKeyData = {
|
const dictKeyData = {
|
||||||
userList: { dicKey: 'userSelect', label: 'nickname' },
|
userList: { dicKey: 'userSelect', label: 'nickname' },
|
||||||
deptList: { dicKey: 'deptSelect', label: 'name' }
|
deptList: { dicKey: 'deptSelect', label: 'name' },
|
||||||
|
sblxList: { dicKey: 'sblxSelect', label: 'industryName' }
|
||||||
}
|
}
|
||||||
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 = {}
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ const initColumn = (data, componentData, columnParams) => {
|
|||||||
column[fieldCode].type = 'input'
|
column[fieldCode].type = 'input'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (['userSelect', 'deptSelect'].includes(controlType)) {
|
if (['userSelect', 'deptSelect', 'sblxSelect'].includes(controlType)) {
|
||||||
let configData: any = {
|
let configData: any = {
|
||||||
findType: 'all',
|
findType: 'all',
|
||||||
formatter: (row, value, valueText, column) => {
|
formatter: (row, value, valueText, column) => {
|
||||||
@@ -392,6 +392,9 @@ const initColumn = (data, componentData, columnParams) => {
|
|||||||
if (controlType == 'deptSelect' && optionData['deptCustomStr']) {
|
if (controlType == 'deptSelect' && optionData['deptCustomStr']) {
|
||||||
optionData['deptCustomStr'] = decodeURIComponent(escape(atob(optionData['deptCustomStr'])))
|
optionData['deptCustomStr'] = decodeURIComponent(escape(atob(optionData['deptCustomStr'])))
|
||||||
}
|
}
|
||||||
|
if (controlType == 'sblxSelect' && optionData['sblxCustomStr']) {
|
||||||
|
optionData['sblxCustomStr'] = decodeURIComponent(escape(atob(optionData['sblxCustomStr'])))
|
||||||
|
}
|
||||||
setDeepObject(controlsData, optionData)
|
setDeepObject(controlsData, optionData)
|
||||||
Object.keys(customData).forEach(key => {
|
Object.keys(customData).forEach(key => {
|
||||||
if (customData[key] && controlsData[key] && customData[key] instanceof Object) {
|
if (customData[key] && controlsData[key] && customData[key] instanceof Object) {
|
||||||
@@ -532,7 +535,7 @@ const initColumn = (data, componentData, columnParams) => {
|
|||||||
if (isList) controlData.slotList.push('list')
|
if (isList) controlData.slotList.push('list')
|
||||||
if (isSearch && !column[fieldCode].searchType) {
|
if (isSearch && !column[fieldCode].searchType) {
|
||||||
controlData.slotList.push('search')
|
controlData.slotList.push('search')
|
||||||
if (['userSelect', 'deptSelect', 'dicTableSelect'].includes(controlType) && column[fieldCode].searchMultiple) {
|
if (['userSelect', 'deptSelect', 'sblxSelect', 'dicTableSelect'].includes(controlType) && column[fieldCode].searchMultiple) {
|
||||||
searchOption['column'].multiple = true
|
searchOption['column'].multiple = true
|
||||||
}
|
}
|
||||||
if (searchOption) controlData = { ...controlData, ...searchOption }
|
if (searchOption) controlData = { ...controlData, ...searchOption }
|
||||||
@@ -552,7 +555,7 @@ const initButton = (data, context) => {
|
|||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const currentRoute = router.currentRoute.value
|
const currentRoute = router.currentRoute.value
|
||||||
const currPath = currentRoute.meta?.menuDataId as string
|
const currPath = currentRoute.meta?.menuDataId as string
|
||||||
const permissions = wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[currPath] || false
|
const permissions = wsCache.get(CACHE_KEY.USER).lideeYunJipermissions?.[currPath] || false
|
||||||
const { model, defaultTip, tableId, getPermiKey, webConfigRoleButtonVoList, isSub } = context
|
const { model, defaultTip, tableId, getPermiKey, webConfigRoleButtonVoList, isSub } = context
|
||||||
const defPermiObj = {
|
const defPermiObj = {
|
||||||
addBtn: 'create', addChild: 'create',
|
addBtn: 'create', addChild: 'create',
|
||||||
@@ -833,7 +836,7 @@ export const tableFormatting = (data, column, otherData: any = {}) => {
|
|||||||
let currData = isArray ? cloneDeep(data) : cloneDeep([data])
|
let currData = isArray ? cloneDeep(data) : cloneDeep([data])
|
||||||
const dateControl = {}
|
const dateControl = {}
|
||||||
const regionControl = {}
|
const regionControl = {}
|
||||||
const userAndDeptControl: any = { props: [], userIds: [], deptIds: [], typeKey: { userSelect: 'user', deptSelect: 'dept' } }
|
const userAndDeptControl: any = { props: [], userIds: [], deptIds: [], sblxIds: [], typeKey: { userSelect: 'user', deptSelect: 'dept', sblxSelect: 'sblx' } }
|
||||||
const dicTableData = { propObj: {}, keyList: [] as Array<string>, dicStoreKey: {} }
|
const dicTableData = { propObj: {}, keyList: [] as Array<string>, dicStoreKey: {} }
|
||||||
for (const prop in column) {
|
for (const prop in column) {
|
||||||
const { type, hide, lazy, dictType, valueFormat } = column[prop]
|
const { type, hide, lazy, dictType, valueFormat } = column[prop]
|
||||||
@@ -886,7 +889,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,20 +902,21 @@ 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' },
|
||||||
|
sblxList: { dicKey: 'sblxSelect', label: 'industryName', value: 'id' }
|
||||||
}
|
}
|
||||||
DicApi.getDicTableText(dicApiData).then(dicData => {
|
DicApi.getDicTableText(dicApiData).then(dicData => {
|
||||||
for (const key in dicData) {
|
for (const key in dicData) {
|
||||||
@@ -1016,7 +1020,7 @@ export const getMultipleProp = (column) => {
|
|||||||
const props: Array<string> = []
|
const props: Array<string> = []
|
||||||
for (const prop in column) {
|
for (const prop in column) {
|
||||||
const { type, multiple } = column[prop]
|
const { type, multiple } = column[prop]
|
||||||
if (['select', 'dicTableSelect', 'userSelect', 'deptSelect'].includes(type) && multiple) props.push(prop)
|
if (['select', 'dicTableSelect', 'userSelect', 'deptSelect', 'sblxSelect'].includes(type) && multiple) props.push(prop)
|
||||||
}
|
}
|
||||||
return { more_select_field: props.join(',') }
|
return { more_select_field: props.join(',') }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ export default [
|
|||||||
type: 'deptSelect', controlType: 'select', label: '部门选择框', icon: 'mingcute:department-line',
|
type: 'deptSelect', controlType: 'select', label: '部门选择框', icon: 'mingcute:department-line',
|
||||||
findType: 'all',
|
findType: 'all',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'sblxSelect', controlType: 'select', label: '设备类型选择框', icon: 'ep:setting',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'regionSelect', controlType: 'select', label: '地区选择框', icon: 'hugeicons:global-editing',
|
type: 'regionSelect', controlType: 'select', label: '地区选择框', icon: 'hugeicons:global-editing',
|
||||||
regionType: 'ssq',
|
regionType: 'ssq',
|
||||||
@@ -194,4 +197,4 @@ export default [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ const getComponentName = (type, controlType, component) => {
|
|||||||
'dicTableSelect',
|
'dicTableSelect',
|
||||||
'userSelect',
|
'userSelect',
|
||||||
'deptSelect',
|
'deptSelect',
|
||||||
|
'sblxSelect',
|
||||||
'markDown'
|
'markDown'
|
||||||
].includes(type)
|
].includes(type)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default defineComponent({
|
|||||||
name: 'Layout',
|
name: 'Layout',
|
||||||
setup() {
|
setup() {
|
||||||
return () => (
|
return () => (
|
||||||
<section class={[prefixCls, `${prefixCls}__${layout.value}`, 'w-[100%] h-[100%] relative']}>
|
<section class={[prefixCls, `${prefixCls}__${layout.value}`, 'w-[100%] h-[100%] relative']} >
|
||||||
{mobile.value && !collapse.value ? (
|
{mobile.value && !collapse.value ? (
|
||||||
<div
|
<div
|
||||||
class="absolute left-0 top-0 z-99 h-full w-full bg-[var(--el-color-black)] opacity-30"
|
class="absolute left-0 top-0 z-99 h-full w-full bg-[var(--el-color-black)] opacity-30"
|
||||||
|
|||||||
@@ -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)]'
|
||||||
]"
|
]"
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ const whiteList = [
|
|||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
debugger
|
|
||||||
start()
|
start()
|
||||||
loadStart()
|
loadStart()
|
||||||
if (getAccessToken()) {
|
if (getAccessToken()) {
|
||||||
|
|||||||
@@ -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: ' ',
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ interface DeptVO {
|
|||||||
|
|
||||||
interface UserInfoVO {
|
interface UserInfoVO {
|
||||||
permissions: object
|
permissions: object
|
||||||
lideeYunjipermissions: object
|
lideeYunJipermissions: object
|
||||||
roles: string[]
|
roles: string[]
|
||||||
isSetUser: boolean
|
isSetUser: boolean
|
||||||
user: UserVO
|
user: UserVO
|
||||||
@@ -43,7 +43,7 @@ interface UserInfoVO {
|
|||||||
export const useUserStore = defineStore('admin-user', {
|
export const useUserStore = defineStore('admin-user', {
|
||||||
state: (): UserInfoVO => ({
|
state: (): UserInfoVO => ({
|
||||||
permissions: {},
|
permissions: {},
|
||||||
lideeYunjipermissions: {},
|
lideeYunJipermissions: {},
|
||||||
roles: [],
|
roles: [],
|
||||||
isSetUser: false,
|
isSetUser: false,
|
||||||
user: {
|
user: {
|
||||||
@@ -58,8 +58,8 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
getPermissions(): object {
|
getPermissions(): object {
|
||||||
return this.permissions
|
return this.permissions
|
||||||
},
|
},
|
||||||
getLideeYunjipermissions(): object {
|
getLideeYunJipermissions(): object {
|
||||||
return this.lideeYunjipermissions
|
return this.lideeYunJipermissions
|
||||||
},
|
},
|
||||||
getRoles(): string[] {
|
getRoles(): string[] {
|
||||||
return this.roles
|
return this.roles
|
||||||
@@ -82,7 +82,7 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
userInfo = await getInfo()
|
userInfo = await getInfo()
|
||||||
}
|
}
|
||||||
this.permissions = userInfo.permissions
|
this.permissions = userInfo.permissions
|
||||||
this.lideeYunjipermissions = userInfo.lideeYunjipermissions
|
this.lideeYunJipermissions = userInfo.lideeYunJipermissions
|
||||||
this.roles = userInfo.roles
|
this.roles = userInfo.roles
|
||||||
this.user = userInfo.user
|
this.user = userInfo.user
|
||||||
this.deptInfo = userInfo.deptInfoList
|
this.deptInfo = userInfo.deptInfoList
|
||||||
@@ -112,7 +112,7 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
},
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
this.permissions = {}
|
this.permissions = {}
|
||||||
this.lideeYunjipermissions = {}
|
this.lideeYunJipermissions = {}
|
||||||
this.roles = []
|
this.roles = []
|
||||||
this.isSetUser = false
|
this.isSetUser = false
|
||||||
this.user = {
|
this.user = {
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
.control-cascader,
|
.control-cascader,
|
||||||
.control-switch,
|
.control-switch,
|
||||||
.control-regionSelect,
|
.control-regionSelect,
|
||||||
|
.control-sblxSelect,
|
||||||
.control-dicTableSelect,
|
.control-dicTableSelect,
|
||||||
.control-map,
|
.control-map,
|
||||||
.control-color,
|
.control-color,
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ 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 = '/'
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ 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){
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ export const dicObj = {
|
|||||||
{ label: '表格选择框', value: 'dicTableSelect' },
|
{ label: '表格选择框', value: 'dicTableSelect' },
|
||||||
{ label: '用户选择框', value: 'userSelect' },
|
{ label: '用户选择框', value: 'userSelect' },
|
||||||
{ label: '部门选择框', value: 'deptSelect' },
|
{ label: '部门选择框', value: 'deptSelect' },
|
||||||
|
{ label: '设备类型选择框', value: 'sblxSelect' },
|
||||||
{ label: '地区选择框', value: 'regionSelect' },
|
{ label: '地区选择框', value: 'regionSelect' },
|
||||||
{ label: '代码编辑器', value: 'monacoEditor' },
|
{ label: '代码编辑器', value: 'monacoEditor' },
|
||||||
{ label: '富文本', value: 'ueditor' },
|
{ label: '富文本', value: 'ueditor' },
|
||||||
|
|||||||
205
src/views/system/sblx/index.vue
Normal file
205
src/views/system/sblx/index.vue
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<avue-crud
|
||||||
|
ref="crudRef"
|
||||||
|
v-model="tableForm"
|
||||||
|
v-model:search="tableSearch"
|
||||||
|
:table-loading="loading"
|
||||||
|
:data="tableData"
|
||||||
|
:option="tableOption"
|
||||||
|
:permission="permission"
|
||||||
|
:before-open="beforeOpen"
|
||||||
|
@search-change="searchChange"
|
||||||
|
@search-reset="resetChange"
|
||||||
|
@row-save="rowSave"
|
||||||
|
@row-update="rowUpdate"
|
||||||
|
@row-del="rowDel"
|
||||||
|
@refresh-change="getTableData"
|
||||||
|
>
|
||||||
|
<!-- 表单 -->
|
||||||
|
<template #parentId-form>
|
||||||
|
<el-tree-select
|
||||||
|
v-model="tableForm.parentId"
|
||||||
|
:data="sblxTree"
|
||||||
|
:props="{ children: 'children', label: 'industryName', value: 'id' }"
|
||||||
|
check-strictly
|
||||||
|
default-expand-all
|
||||||
|
placeholder="请选择上级设备类型"
|
||||||
|
value-key="id"
|
||||||
|
style="width: 366px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<!-- 自定义按钮 -->
|
||||||
|
<template #menu-left="{ size }">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
:size="size"
|
||||||
|
@click="defaultExpandAllShow = !defaultExpandAllShow"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-sort"
|
||||||
|
>展开/折叠</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</avue-crud>
|
||||||
|
</ContentWrap>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
import * as SblxApi from '@/api/system/sblx'
|
||||||
|
|
||||||
|
defineOptions({ name: 'SystemSblx' })
|
||||||
|
|
||||||
|
const crudRef = ref()
|
||||||
|
useCrudHeight(crudRef)
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const { getCurrPermi } = useCrudPermi()
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const defaultExpandAllShow = ref(true) // 默认展开所有表项
|
||||||
|
const tableOption = reactive({
|
||||||
|
align: 'center',
|
||||||
|
headerAlign: 'center',
|
||||||
|
searchMenuSpan: 6,
|
||||||
|
searchMenuPosition: 'left',
|
||||||
|
labelSuffix: ' ',
|
||||||
|
span: 24,
|
||||||
|
rowKey: 'id',
|
||||||
|
rowParentKey: 'parentId',
|
||||||
|
defaultExpandAll: defaultExpandAllShow,
|
||||||
|
dialogWidth: '50%',
|
||||||
|
column: {
|
||||||
|
parentId: {
|
||||||
|
label: '上级设备类型',
|
||||||
|
hide: true,
|
||||||
|
minWidth: 100,
|
||||||
|
rules: [{ required: true, message: '上级设备类型不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
industryName: {
|
||||||
|
label: '设备类型名称',
|
||||||
|
align: 'left',
|
||||||
|
headerAlign: 'left',
|
||||||
|
search: true,
|
||||||
|
minWidth: 100,
|
||||||
|
rules: [{ required: true, message: '设备类型名称不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
industryCode: {
|
||||||
|
label: '设备类型编码',
|
||||||
|
minWidth: 100,
|
||||||
|
rules: [{ required: true, message: '设备类型编码不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
sort: {
|
||||||
|
label: '显示顺序',
|
||||||
|
width: 80,
|
||||||
|
span: 12,
|
||||||
|
type: 'number',
|
||||||
|
rules: [{ required: true, message: '显示顺序不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}) //表格配置
|
||||||
|
const tableForm = ref<any>({})
|
||||||
|
const tableData = ref()
|
||||||
|
const tableSearch = ref({})
|
||||||
|
const sblxTree = ref() // 上级设备类型
|
||||||
|
const permission = getCurrPermi(['system:sblx'])
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getTableData = async () => {
|
||||||
|
loading.value = true
|
||||||
|
let searchObj = {
|
||||||
|
...tableSearch.value
|
||||||
|
}
|
||||||
|
for (let key in searchObj) if (searchObj[key] === '') delete searchObj[key]
|
||||||
|
try {
|
||||||
|
const data = await SblxApi.getSblxPage(searchObj)
|
||||||
|
|
||||||
|
tableData.value = handleTree(data)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const searchChange = (params, done) => {
|
||||||
|
getTableData().finally(() => {
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 清空按钮操作 */
|
||||||
|
const resetChange = () => {
|
||||||
|
searchChange({}, () => {})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单打开前 */
|
||||||
|
const beforeOpen = async (done, type) => {
|
||||||
|
await getTree()
|
||||||
|
const id = tableForm.value.id
|
||||||
|
if (['edit', 'view'].includes(type) && id) {
|
||||||
|
tableForm.value = await SblxApi.getSblx(id)
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增操作 */
|
||||||
|
const rowSave = async (form, done, loading) => {
|
||||||
|
let bool = await SblxApi.createSblx(form).catch(() => false)
|
||||||
|
if (bool) {
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
resetChange()
|
||||||
|
done()
|
||||||
|
} else loading()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 编辑操作 */
|
||||||
|
const rowUpdate = async (form, index, done, loading) => {
|
||||||
|
let bool = await SblxApi.updateSblx(form).catch(() => false)
|
||||||
|
if (bool) {
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
getTableData()
|
||||||
|
done()
|
||||||
|
} else loading()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const rowDel = async (form, index) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await SblxApi.deleteSblx(form.id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getTableData()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得设备类型树 */
|
||||||
|
const getTree = async () => {
|
||||||
|
sblxTree.value = []
|
||||||
|
const data = await SblxApi.getSimpleSblxList()
|
||||||
|
let sblx: SblxTree = { id: 0, industryName: '顶级设备类型', children: [] }
|
||||||
|
sblx.children = handleTree(data, 'id', 'parentId')
|
||||||
|
sblxTree.value.push(sblx)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => defaultExpandAllShow.value,
|
||||||
|
() => {
|
||||||
|
crudRef.value?.refreshTable()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
await getTableData()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-form-item__label) {
|
||||||
|
width: 100px !important;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
6
types/global.d.ts
vendored
6
types/global.d.ts
vendored
@@ -50,4 +50,10 @@ declare global {
|
|||||||
name: string
|
name: string
|
||||||
children?: Tree[] | any[]
|
children?: Tree[] | any[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface SblxTree {
|
||||||
|
id: number
|
||||||
|
industryName: string
|
||||||
|
children?: Tree[] | any[]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user