服务指令、长者标签 调整图片显示
This commit is contained in:
parent
ec1ad10bf4
commit
0a48ee233c
|
|
@ -29,7 +29,16 @@ export const columns: BasicColumn[] = [
|
||||||
title: '图标',
|
title: '图标',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'pic',
|
dataIndex: 'pic',
|
||||||
customRender: render.renderImage,
|
customRender: ({ text, record }) => {
|
||||||
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
|
const imageUrl = text
|
||||||
|
? text
|
||||||
|
: record.type == 'tx'
|
||||||
|
? import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||||
|
: import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC;
|
||||||
|
return render.renderImage({ text: imageUrl });
|
||||||
|
},
|
||||||
|
// customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '排序',
|
// title: '排序',
|
||||||
|
|
|
||||||
|
|
@ -150,20 +150,28 @@ function edit(record) {
|
||||||
if (record.hasOwnProperty(key)) {
|
if (record.hasOwnProperty(key)) {
|
||||||
tmpData[key] = record[key]
|
tmpData[key] = record[key]
|
||||||
}
|
}
|
||||||
})
|
//赋值
|
||||||
//赋值
|
Object.assign(formData, tmpData);
|
||||||
Object.assign(formData, tmpData);
|
if (props.opeType == 'dmlook') {
|
||||||
if (props.opeType == 'dmlook') {
|
if (!!formData.pic) {
|
||||||
if (!!formData.pic) {
|
dmlookVal.value = props.mediaApiAddress + formData.pic
|
||||||
dmlookVal.value = props.mediaApiAddress + formData.pic
|
|
||||||
} else {
|
|
||||||
if (formData.type == 'qx') {
|
|
||||||
dmlookVal.value = defaultEmoPic
|
|
||||||
} else {
|
} else {
|
||||||
dmlookVal.value = defaultBodyPic
|
if (formData.type == 'qx') {
|
||||||
|
dmlookVal.value = defaultEmoPic
|
||||||
|
} else {
|
||||||
|
dmlookVal.value = defaultBodyPic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!formData.pic) {
|
||||||
|
if (formData.type == 'qx') {
|
||||||
|
formData.pic = defaultEmoPic
|
||||||
|
} else {
|
||||||
|
formData.pic = defaultBodyPic
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,6 +209,9 @@ async function submitForm() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (model.pic == defaultBodyPic || model.pic == defaultEmoPic) {
|
||||||
|
model.pic = null
|
||||||
|
}
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
showIndexColumn: true,
|
showIndexColumn: true,
|
||||||
scroll: { y: '58vh' },
|
scroll: { y: '58vh' },
|
||||||
|
immediate: false,
|
||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 15,
|
pageSize: 15,
|
||||||
|
|
@ -106,7 +107,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
params.excludeIds = excludeIds.value.join(',')
|
params.excludeIds = excludeIds.value.join(',')
|
||||||
}
|
}
|
||||||
params.izEnabled = '0'
|
params.izEnabled = '0'
|
||||||
return Object.assign(params,queryParam)
|
return Object.assign(params, queryParam)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -197,21 +198,22 @@ async function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let { ids } = getSelectedIds();
|
let { ids } = getSelectedIds();
|
||||||
let res = await idListByDS({ dataSourceCode: 'master' });
|
idListByDS({ dataSourceCode: 'master' }).then(res => {
|
||||||
|
// 现有的ID
|
||||||
|
let existingExcludeIds = res.records.map(item => item.id);
|
||||||
|
|
||||||
// 现有的ID
|
// 如果ids不为空,则拆分并添加到排除列表中
|
||||||
let existingExcludeIds = res.records.map(item => item.id);
|
if (ids) {
|
||||||
|
const idsToAdd = ids.split(',');
|
||||||
|
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
|
||||||
|
}
|
||||||
|
|
||||||
// 如果ids不为空,则拆分并添加到排除列表中
|
// 去重并更新excludeIds.value
|
||||||
if (ids) {
|
excludeIds.value = [...new Set(existingExcludeIds)];
|
||||||
const idsToAdd = ids.split(',');
|
|
||||||
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 去重并更新excludeIds.value
|
reload();
|
||||||
excludeIds.value = [...new Set(existingExcludeIds)];
|
})
|
||||||
|
|
||||||
reload();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -117,13 +117,23 @@ export const columns: BasicColumn[] = [
|
||||||
title: '服务指令图片大图',
|
title: '服务指令图片大图',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'previewFile',
|
dataIndex: 'previewFile',
|
||||||
customRender: render.renderImage,
|
customRender: ({ text }) => {
|
||||||
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
|
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||||
|
return render.renderImage({ text: imageUrl });
|
||||||
|
},
|
||||||
|
// customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '服务指令图片小图',
|
title: '服务指令图片小图',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'previewFileSmall',
|
dataIndex: 'previewFileSmall',
|
||||||
customRender: render.renderImage,
|
customRender: ({ text }) => {
|
||||||
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
|
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC;
|
||||||
|
return render.renderImage({ text: imageUrl });
|
||||||
|
},
|
||||||
|
// customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '服务指令描述',
|
title: '服务指令描述',
|
||||||
|
|
@ -147,7 +157,12 @@ export const columns: BasicColumn[] = [
|
||||||
title: '即时指令图标',
|
title: '即时指令图标',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'immediateFile',
|
dataIndex: 'immediateFile',
|
||||||
customRender: render.renderImage,
|
customRender: ({ text }) => {
|
||||||
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
|
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_IM_PIC;
|
||||||
|
return render.renderImage({ text: imageUrl });
|
||||||
|
},
|
||||||
|
// customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,17 @@ function edit(record, isEditMedia_ = false, showMedia_ = true, showExistTags = t
|
||||||
})
|
})
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, tmpData);
|
Object.assign(formData, tmpData);
|
||||||
|
if (props.opeType != 'dmlook') {
|
||||||
|
if (!formData.previewFile) {
|
||||||
|
formData.previewFile = defaultPrePic
|
||||||
|
}
|
||||||
|
if (!formData.previewFileSmall) {
|
||||||
|
formData.previewFileSmall = defaultPreSmallPic
|
||||||
|
}
|
||||||
|
if (!formData.immediateFile) {
|
||||||
|
formData.immediateFile = defaultImmediatePic
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -571,6 +582,16 @@ async function submitForm() {
|
||||||
|
|
||||||
model.mediaFileSavePath = formComputedData.value.mediaFileSavePath
|
model.mediaFileSavePath = formComputedData.value.mediaFileSavePath
|
||||||
|
|
||||||
|
if (model.previewFile == defaultPrePic) {
|
||||||
|
model.previewFile = null
|
||||||
|
}
|
||||||
|
if (model.previewFileSmall == defaultPreSmallPic) {
|
||||||
|
model.previewFileSmall = null
|
||||||
|
}
|
||||||
|
if (model.immediateFile == defaultImmediatePic) {
|
||||||
|
model.immediateFile = null
|
||||||
|
}
|
||||||
|
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
showIndexColumn: true,
|
showIndexColumn: true,
|
||||||
scroll: { y: '58vh' },
|
scroll: { y: '58vh' },
|
||||||
|
immediate: false,
|
||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 15,
|
pageSize: 15,
|
||||||
|
|
@ -293,21 +294,23 @@ async function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let { ids } = getSelectedIds();
|
let { ids } = getSelectedIds();
|
||||||
let res = await idListByDS({ dataSourceCode: 'master' });
|
idListByDS({ dataSourceCode: 'master' }).then(res => {
|
||||||
|
|
||||||
// 现有的ID
|
// 现有的ID
|
||||||
let existingExcludeIds = res.records.map(item => item.id);
|
let existingExcludeIds = res.records.map(item => item.id);
|
||||||
|
|
||||||
// 如果ids不为空,则拆分并添加到排除列表中
|
// 如果ids不为空,则拆分并添加到排除列表中
|
||||||
if (ids) {
|
if (ids) {
|
||||||
const idsToAdd = ids.split(',');
|
const idsToAdd = ids.split(',');
|
||||||
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
|
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去重并更新excludeIds.value
|
// 去重并更新excludeIds.value
|
||||||
excludeIds.value = [...new Set(existingExcludeIds)];
|
excludeIds.value = [...new Set(existingExcludeIds)];
|
||||||
|
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
|
||||||
reload();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue