|
|
@@ -5,7 +5,9 @@ import {
|
|
|
LabelModuleListType,
|
|
|
} from '@/api/scene/sceneOperate';
|
|
|
import { WorkShopTempleteType } from '@/api/scene/secene-templet';
|
|
|
-// skyeyev3pc/#/company?companyId=117&labelId=2
|
|
|
+import { useGlobSetting } from '@/hooks/setting';
|
|
|
+
|
|
|
+const { appPCUrl } = useGlobSetting()
|
|
|
|
|
|
export const colomns = [
|
|
|
{ label: '场景名称', prop: 'name', width: 300 },
|
|
|
@@ -18,7 +20,7 @@ export const colomns = [
|
|
|
if (!row.parent && row.labelList?.[0]?.id) {
|
|
|
return (
|
|
|
<a
|
|
|
- href={`/skyeyev3pc/#/company?companyId=${row.id}&labelId=${row.labelList[0]?.id}`}
|
|
|
+ href={`${appPCUrl}#/company?companyId=${row.id}&labelId=${row.labelList[0]?.id}`}
|
|
|
target="_blank"
|
|
|
>
|
|
|
公司预览
|
|
|
@@ -26,7 +28,7 @@ export const colomns = [
|
|
|
);
|
|
|
} else if (row.parent && !row.parent.parent) {
|
|
|
return (
|
|
|
- <a href={`/skyeyev3pc/#/shop?id=${row.id}`} target="_blank">
|
|
|
+ <a href={`${appPCUrl}#/shop?id=${row.id}`} target="_blank">
|
|
|
车间预览
|
|
|
</a>
|
|
|
);
|
|
|
@@ -37,8 +39,8 @@ export const colomns = [
|
|
|
|
|
|
interface DataSourceUser
|
|
|
extends SceneListType<
|
|
|
- GetListWorkshop<WorkspaceAddDatas, WorkShopTempleteType>,
|
|
|
- LabelModuleListType
|
|
|
+ GetListWorkshop<WorkspaceAddDatas, WorkShopTempleteType>,
|
|
|
+ LabelModuleListType
|
|
|
> {
|
|
|
parent?: SceneListType<
|
|
|
GetListWorkshop<WorkspaceAddDatas, WorkShopTempleteType>,
|
|
|
@@ -151,22 +153,21 @@ export const findItemLevel = (data, targetId, targetName, currentLevel = 0) => {
|
|
|
|
|
|
|
|
|
//得到parent
|
|
|
-export const getParent = (data:DataSourceUser[], targetCode:string) => {
|
|
|
+export const getParent = (data: DataSourceUser[], targetCode: string) => {
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//let parentNode = {} as DataSourceUser
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
const item = data[i];
|
|
|
|
|
|
- if (item.code === targetCode ) {
|
|
|
+ if (item.code === targetCode) {
|
|
|
// parentNode = item
|
|
|
return item
|
|
|
}
|
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
const foundItem = getParent(item.children, targetCode);
|
|
|
- if(foundItem){
|
|
|
+ if (foundItem) {
|
|
|
return foundItem
|
|
|
}
|
|
|
}
|