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' // 默认全局组件大小,可选值"<large|'default'|small>",默认 'large'
globalComponentSize: 'large', globalComponentSize: 'large',
// 网站logo // 网站logo
logoMini: '@/assets/logo.png', logoMini: '',
}, },
}), }),
actions: { actions: {

View File

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

View File

@ -300,7 +300,6 @@ const getTableData = async() => {
} }
} catch (error) { } catch (error) {
} finally { } finally {
state.tableData.param.moduleName = '';
state.tableData.loading = false; state.tableData.loading = false;
} }
}; };
@ -328,9 +327,11 @@ const jpgFormatter = (row: any) => {
// } else { // } else {
// newPath = row.path.replaceAll('\\\\', '/') // newPath = row.path.replaceAll('\\\\', '/')
// } // }
newPath = newPath.includes('://')?newPath : newPath; // newPath = newPath?.includes('://')?newPath : newPath;
if(!newPath) return;
return `${newPath}`; 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) { if (res?.success) {
state.formData.fileList.push({ url: jpgFormatter(res) }); state.formData.fileList.push({ url: jpgFormatter(res) });
Object.assign(state.formData, res.data); Object.assign(state.formData, res.data);
state.formData.path = res.data.path; state.formData.path = res.data?.path;
uploadDisabled.value = true; uploadDisabled.value = true;
state.formData.loading = false; state.formData.loading = false;
} else { } else {

View File

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

View File

@ -26,8 +26,8 @@
<el-table-column align="center" type="index" label="序号" width="100"/> <el-table-column align="center" type="index" label="序号" width="100"/>
<el-table-column align="center" prop="name" label="作品"> <el-table-column align="center" prop="name" label="作品">
<template #default="scope"> <template #default="scope">
<el-image :src="scope.row.path" lazy <el-image :src="getImagePath(scope.row.path)" lazy
preview-teleported="true" :preview-src-list="[scope.row.path]"/> preview-teleported="true" :preview-src-list="[getImagePath(scope.row.path)]"/>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="phone" label="发布者" show-overflow-tooltip></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 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) => { const toPublic = (row: any) => {
ElMessageBox.confirm('确定要发布该作品吗?', '提示', { 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 // api
const photoApi = photosApi(); const photoApi = photosApi();