Merge remote-tracking branch 'origin/feature/v1.2灵机空间-内容上传审核_rxd' into test

# Conflicts:
#	pnpm-lock.yaml
#	src/components/text-over-tips/index.vue
#	src/layouts/Basic.vue
#	src/main.ts
#	src/router/constants.ts
#	src/router/typeings.d.ts
#	src/utils/tools.ts
#	vite.config.ts
This commit is contained in:
rd
2025-08-14 15:27:10 +08:00
13 changed files with 76 additions and 71 deletions

View File

@ -51,7 +51,6 @@ const props = defineProps({
default: false,
},
});
const data = reactive({});
const isShow = ref(false);
const contentStyle = computed(() => {

View File

@ -110,10 +110,6 @@ provide('toggleDrawerMenu', () => {
<style scoped lang="scss">
$layout-max-width: 1100px;
.layout {
// width: 100%;
// height: 100%;
}
.layout-navbar {
position: fixed;
top: 0;

View File

@ -26,4 +26,11 @@ app.component('NoData', NoData);
app.component('SvgIcon', SvgIcon);
(Object.keys(directives) as Array<keyof typeof directives>).forEach((k) => app.use(directives[k])); // 注册指令
app.use(store).use(router).mount('#app');
app.use(store);
app.use(router);
Object.values(directives).forEach((directive) => {
app.use(directive);
}); // 注册指令
app.mount('#app');

View File

@ -23,10 +23,10 @@ export const DEFAULT_ROUTE = {
export const MENU_GROUP_IDS = {
DATA_ENGINE_ID: 1, // 全域数据分析
AGENT: 2, // 智能体
AGENT: 2,
MANAGEMENT_ID: 3, // 管理中心
PROPERTY_ID: 4, // 资产营销平台
WORK_BENCH_ID: 5, // 工作台
WRITER_CREATIVE_GENERATION_WORKSHOP_ID: 6, // 内容稿件-写手侧
CREATIVE_GENERATION_WORKSHOP_ID: 7, // 创意生成工坊
CREATIVE_GENERATION_WORKSHOP_ID: 7 // 创意生成工坊
};

View File

@ -14,8 +14,8 @@ declare module 'vue-router' {
noAffix?: boolean; // if set true, the tag will not affix in the tab-bar
ignoreCache?: boolean; // if set true, the page will not be cached
hideSidebar?: boolean;
isAgentRoute?:boolean;
hideFooter?: boolean;
isAgentRoute?:boolean;
requireLogin?: boolean; // 是否需要登陆才能访问
}
}

View File

@ -397,7 +397,7 @@ export function getImageMainColor(imageUrl: string): Promise<string> {
const avgColor = {
r: Math.round(maxGroup.sumR / maxGroup.count),
g: Math.round(maxGroup.sumG / maxGroup.count),
b: Math.round(maxGroup.sumB / maxGroup.count),
b: Math.round(maxGroup.sumB / maxGroup.count)
};
resolve(`rgb(${avgColor.r},${avgColor.g},${avgColor.b})`);
@ -427,38 +427,28 @@ function medianCut(data: Uint8ClampedArray, levels: number): any[] {
if (a < 128) continue;
colors.push({
r,
g,
b,
r, g, b,
count: 1,
sumR: r,
sumG: g,
sumB: b,
sumR: r, sumG: g, sumB: b
});
}
// 如果没有颜色数据,返回默认白色
if (colors.length === 0) {
return [
{
count: 1,
sumR: 255,
sumG: 255,
sumB: 255,
},
];
return [{
count: 1,
sumR: 255, sumG: 255, sumB: 255
}];
}
// 开始中位数切分
let colorGroups = [
{
colors,
count: colors.length,
sumR: colors.reduce((sum, c) => sum + c.r, 0),
sumG: colors.reduce((sum, c) => sum + c.g, 0),
sumB: colors.reduce((sum, c) => sum + c.b, 0),
},
];
let colorGroups = [{
colors,
count: colors.length,
sumR: colors.reduce((sum, c) => sum + c.r, 0),
sumG: colors.reduce((sum, c) => sum + c.g, 0),
sumB: colors.reduce((sum, c) => sum + c.b, 0)
}];
for (let i = 0; i < levels; i++) {
const newGroups = [];
@ -470,12 +460,12 @@ function medianCut(data: Uint8ClampedArray, levels: number): any[] {
}
// 找出颜色范围最大的通道
const rMin = Math.min(...group.colors.map((c) => c.r));
const rMax = Math.max(...group.colors.map((c) => c.r));
const gMin = Math.min(...group.colors.map((c) => c.g));
const gMax = Math.max(...group.colors.map((c) => c.g));
const bMin = Math.min(...group.colors.map((c) => c.b));
const bMax = Math.max(...group.colors.map((c) => c.b));
const rMin = Math.min(...group.colors.map(c => c.r));
const rMax = Math.max(...group.colors.map(c => c.r));
const gMin = Math.min(...group.colors.map(c => c.g));
const gMax = Math.max(...group.colors.map(c => c.g));
const bMin = Math.min(...group.colors.map(c => c.b));
const bMax = Math.max(...group.colors.map(c => c.b));
const rRange = rMax - rMin;
const gRange = gMax - gMin;
@ -489,9 +479,15 @@ function medianCut(data: Uint8ClampedArray, levels: number): any[] {
}
// 按最大范围通道排序
type ColorChannel = 'r' | 'g' | 'b';
const safeSortChannel = sortChannel as ColorChannel;
group.colors.sort((a, b) => a[safeSortChannel] - b[safeSortChannel]);
group.colors.sort((a, b) => {
if (sortChannel === 'r') {
return a.r - b.r;
} else if (sortChannel === 'g') {
return a.g - b.g;
} else {
return a.b - b.b;
}
});
// 切分中位数
const mid = Math.floor(group.colors.length / 2);
@ -504,7 +500,7 @@ function medianCut(data: Uint8ClampedArray, levels: number): any[] {
count: group1.length,
sumR: group1.reduce((sum, c) => sum + c.r, 0),
sumG: group1.reduce((sum, c) => sum + c.g, 0),
sumB: group1.reduce((sum, c) => sum + c.b, 0),
sumB: group1.reduce((sum, c) => sum + c.b, 0)
});
newGroups.push({
@ -512,7 +508,7 @@ function medianCut(data: Uint8ClampedArray, levels: number): any[] {
count: group2.length,
sumR: group2.reduce((sum, c) => sum + c.r, 0),
sumG: group2.reduce((sum, c) => sum + c.g, 0),
sumB: group2.reduce((sum, c) => sum + c.b, 0),
sumB: group2.reduce((sum, c) => sum + c.b, 0)
});
}

View File

@ -136,7 +136,7 @@ export default {
});
if (code === 200) {
taskStatus.value = TASK_STATUS.SUCCESS;
works.value = data ? [data] : [];
data && works.value.push(data);
}
};
@ -189,8 +189,9 @@ export default {
<Upload
action="/"
draggable
multiple
customRequest={handleUpload}
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv"
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv,.m4v"
show-file-list={false}
>
{{

View File

@ -277,7 +277,7 @@ export default {
onClick={(e) => onDelete(e, item, index)}
/>
<TextOverTips
context={item.content}
context={item.title}
line={1}
class={`cts !color-#211F24 mb-8px ${selectCardInfo.value.id === item.id ? 'bold' : ''}`}
/>

View File

@ -158,7 +158,7 @@ export default {
});
if (code === 200) {
taskStatus.value = TASK_STATUS.SUCCESS;
works.value = data ? [data] : [];
data && works.value.push(data);
}
};
@ -220,8 +220,9 @@ export default {
<Upload
action="/"
draggable
multiple
customRequest={handleUpload}
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv"
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv,.m4v"
show-file-list={false}
>
{{

View File

@ -278,7 +278,7 @@ export default {
onClick={(e) => onDelete(e, item, index)}
/>
<TextOverTips
context={item.content}
context={item.title}
line={1}
class={`cts !color-#211F24 mb-8px ${selectCardInfo.value.id === item.id ? 'bold' : ''}`}
/>

View File

@ -19,7 +19,7 @@
class="ignore-export"
@onReset="handleReset"
v-model:query="query"
@onSearch="onSearch"
@onSearch="handleSearch"
:disabled="loading"
></listSearchForm>
@ -29,6 +29,7 @@
@onSearch="onSearch"
@updateQuery="handleUpdateQuery"
/>
<a-spin v-if="loading" tip="AI分析中" />
<div v-if="listData.total > 0" class="pagination-box flex justify-end ignore-export">
<a-pagination
@ -44,10 +45,13 @@
/>
</div>
</div>
<!-- 投放建议-->
<MonthData v-if="tabData == 'placement_guide'" :overview="aiResult.overview"></MonthData>
<PlacementSuggestions v-if="tabData == 'placement_guide'" :optimization="aiResult.optimization"></PlacementSuggestions>
<PlacementSuggestions
v-if="tabData == 'placement_guide'"
:optimization="aiResult.optimization"
></PlacementSuggestions>
<div v-if="tabData == 'placement_guide'" class="ignore-export">
<a-space class="down-btn">
@ -132,12 +136,9 @@ const onSearch = async () => {
let result;
if (tabData.value === 'placement_guide') {
result = await getPlacementGuide(query);
console.log(1);
placementGuideList.value = result?.data?.data || [];
if (placementGuideList.value.length > 0 && isGetAi.value) {
loading.value = true;
syncGetAiResult();
startTask();
}
} else {
result = await getPlacementGuideHistory(query);
guideHistoryList.value = result?.data?.data || [];
@ -145,6 +146,16 @@ const onSearch = async () => {
listData.total = result.data.total;
isGetAi.value = true;
};
const handleSearch = async () => {
await onSearch();
if (placementGuideList.value.length > 0 && isGetAi.value) {
loading.value = true;
syncGetAiResult();
startTask();
}
};
const aiResult = reactive({
optimization: [], // 投放建议优化
action_guide: [], // 新投放建议生成