|
|
@@ -10,15 +10,18 @@ export const colorHexMap: Record<string, string> = {
|
|
|
gold: '#faad14',
|
|
|
red: '#f5222d',
|
|
|
gray: '#8c8c8c',
|
|
|
- black: '#000000',
|
|
|
+ black: '#000000',
|
|
|
};
|
|
|
|
|
|
// 2. 定义动态映射的类型(供外部传入)
|
|
|
-export type ProductionStatusMap = Record<string | number, {
|
|
|
- label: string;
|
|
|
- value: number | string;
|
|
|
- color: string;
|
|
|
-}>;
|
|
|
+export type ProductionStatusMap = Record<
|
|
|
+ string | number,
|
|
|
+ {
|
|
|
+ label: string;
|
|
|
+ value: number | string;
|
|
|
+ color: string;
|
|
|
+ }
|
|
|
+>;
|
|
|
|
|
|
// 3. 生成表格列(支持传入动态映射)
|
|
|
export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>) {
|
|
|
@@ -42,12 +45,16 @@ export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>) {
|
|
|
// 空值/异常值处理
|
|
|
const status = record.mineProStatus;
|
|
|
// 从动态映射中取值,兜底未知状态
|
|
|
- const { label, color } = dynamicStatusMap.value[status] || {
|
|
|
- label: '-',
|
|
|
+ const { label, color } = dynamicStatusMap.value[status] || {
|
|
|
+ label: '-',
|
|
|
};
|
|
|
- return h('span', {
|
|
|
- style: { color: colorHexMap[color] }
|
|
|
- }, label);
|
|
|
+ return h(
|
|
|
+ 'span',
|
|
|
+ {
|
|
|
+ style: { color: colorHexMap[color] },
|
|
|
+ },
|
|
|
+ label
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
@@ -157,7 +164,7 @@ export function getSearchFormSchema(dynamicStatusOptions: Ref<{ label: string; v
|
|
|
];
|
|
|
return searchFormSchema;
|
|
|
}
|
|
|
-export const topFormSchema :FormSchema[] = [
|
|
|
+export const topFormSchema: FormSchema[] = [
|
|
|
{
|
|
|
field: 'mineCode',
|
|
|
label: '煤矿名称',
|
|
|
@@ -165,17 +172,15 @@ export const topFormSchema :FormSchema[] = [
|
|
|
componentProps: {
|
|
|
changeOnSelect: false,
|
|
|
initFromStore: false,
|
|
|
- syncToStore: false
|
|
|
+ syncToStore: false,
|
|
|
},
|
|
|
required: true,
|
|
|
- rules: [
|
|
|
- { required: true, message: '请选择煤矿名称', trigger: 'change' },
|
|
|
- ],
|
|
|
+ rules: [{ required: true, message: '请选择煤矿名称', trigger: 'change' }],
|
|
|
},
|
|
|
];
|
|
|
|
|
|
/** 弹框表单配置 */
|
|
|
-export const formSchema :FormSchema[] = [
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
{
|
|
|
field: 'goafName',
|
|
|
label: '工作面名称',
|
|
|
@@ -195,9 +200,7 @@ export const formSchema :FormSchema[] = [
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
},
|
|
|
required: true,
|
|
|
- rules: [
|
|
|
- { required: true, message: '请选择开始时间', trigger: 'change' },
|
|
|
- ],
|
|
|
+ rules: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
|
|
|
},
|
|
|
{
|
|
|
field: 'endTime',
|
|
|
@@ -208,9 +211,7 @@ export const formSchema :FormSchema[] = [
|
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
},
|
|
|
required: true,
|
|
|
- rules: [
|
|
|
- { required: true, message: '请选择结束时间', trigger: 'change' },
|
|
|
- ],
|
|
|
+ rules: [{ required: true, message: '请选择结束时间', trigger: 'blur' }],
|
|
|
},
|
|
|
{
|
|
|
field: 'queCon',
|