This commit is contained in:
夕阳微笑1 2025-01-24 17:52:45 +08:00
commit ddacd5f546
7 changed files with 33 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -151,7 +151,7 @@ export const useThemeConfig = defineStore('themeConfig', {
// 默认全局组件大小,可选值"<large|'default'|small>",默认 'large'
globalComponentSize: 'large',
// 网站logo
logoMini: '@/assets/logo.png',
logoMini: '',
},
}),
actions: {

View File

@ -35,6 +35,7 @@ const getArticleDetailById = async(id:number) => {
let res = await artApi.getArticleDetail(id);
if(res?.success) {
state.data = res.data;
if(res.data.title) document.title = res.data.title;
}
} catch (error) {
ElMessage.error('获取文章详情失败');

View File

@ -300,7 +300,6 @@ const getTableData = async() => {
}
} catch (error) {
} finally {
state.tableData.param.moduleName = '';
state.tableData.loading = false;
}
};
@ -328,9 +327,11 @@ const jpgFormatter = (row: any) => {
// } else {
// newPath = row.path.replaceAll('\\\\', '/')
// }
newPath = newPath.includes('://')?newPath : newPath;
return `${newPath}`;
// newPath = newPath?.includes('://')?newPath : newPath;
if(!newPath) return;
let index = newPath?.indexOf('?');
return newPath?.includes('://') ? newPath.substring(0,(!index||index===-1) ? newPath.length : index) : encodeURI(newPath.startsWith('/') ? newPath : ('/'+newPath));
// return `${newPath}`;
}
//
@ -382,7 +383,7 @@ const getPhotoDetail = async (id: number) => {
if (res?.success) {
state.formData.fileList.push({ url: jpgFormatter(res) });
Object.assign(state.formData, res.data);
state.formData.path = res.data.path;
state.formData.path = res.data?.path;
uploadDisabled.value = true;
state.formData.loading = false;
} else {

View File

@ -44,6 +44,7 @@
</template>
</el-table-column>
<el-table-column prop="serviceName" align="center" label="作品类型" show-overflow-tooltip></el-table-column>
<el-table-column prop="number" align="center" label="排序" show-overflow-tooltip></el-table-column>
<el-table-column prop="createtime" align="center" label="时间" :formatter="dateFormatter" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
@ -89,8 +90,8 @@
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="作品类型:" prop="serviceName">
<el-select size="default" v-model="state.recommend.form.serviceName" placeholder="请选择作品类型" clearable filterable>
<el-option v-for="(item,index) in state.special.data" :key="index" :label="item.name" :value="item.name"></el-option>
<el-select size="default" v-model="state.recommend.specialIndex" placeholder="请选择作品类型" clearable filterable @change="handleSelectService">
<el-option v-for="(item,index) in state.special.data" :key="index" :label="item.name" :value="index"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -213,7 +214,8 @@ const state = reactive<any>({
ordHide: false,
effFile: {},
effHide: false
}
},
specialIndex: ''
}
});
@ -275,6 +277,13 @@ const getTableData = async() => {
}
};
//
const handleSelectService = (index:any) => {
state.recommend.form.serviceName = state.special.data[index].name;
state.recommend.form.serviceId = state.special.data[index].id;
console.log(index);
}
//
const reviewRecommend = (row:any) => {
ElMessageBox.prompt('排序号','编辑',{
@ -324,8 +333,10 @@ const reset = () =>{
current: 1,
size: 10,
serviceName: '',
serviceId: '',
isBackend: 1
}
state.recommend.specialIndex = '';
getTableData();
}
@ -334,6 +345,7 @@ const closeDialog = () => {
setTimeout(() => {
state.recommend.show = false;
state.recommend.form = {};
state.recommend.specialIndex = '';
handleOrdRemove();
handleEffRemove();
}, 300)

View File

@ -26,8 +26,8 @@
<el-table-column align="center" type="index" label="序号" width="100"/>
<el-table-column align="center" prop="name" label="作品">
<template #default="scope">
<el-image :src="scope.row.path" lazy
preview-teleported="true" :preview-src-list="[scope.row.path]"/>
<el-image :src="getImagePath(scope.row.path)" lazy
preview-teleported="true" :preview-src-list="[getImagePath(scope.row.path)]"/>
</template>
</el-table-column>
<!-- <el-table-column prop="phone" label="发布者" show-overflow-tooltip></el-table-column> -->
@ -167,6 +167,13 @@ const reset = () =>{
const replayFormRef = ref();
//
const getImagePath = (path: string) =>{
if(!path) return;
let index = path?.indexOf('?');
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(path);
}
//
const toPublic = (row: any) => {
ElMessageBox.confirm('确定要发布该作品吗?', '提示', {

View File

@ -255,7 +255,7 @@ const state = reactive({
});
//
const viteUrl = import.meta.env.DEV ? 'http://8.138.171.103/pixel/' : import.meta.env.VITE_API_URL;
const viteUrl = import.meta.env.DEV ? 'http://8.138.171.103/pixel/' : (import.meta.env.VITE_API_URL+'pixel/');
// api
const photoApi = photosApi();