diff --git a/Dockerfile b/Dockerfile index b74483c..b3ff663 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ #设置构建的基础镜像 FROM node:16.15.0 +# 设置工作目录 RUN mkdir -p /project/ WORKDIR /project/ COPY package*.json /project/ -#设置npm下载依赖来源为淘宝源 RUN npm install -g cnpm --registry=https://registry.npm.taobao.org RUN rm -rf node_modules && cd /project #安装项目依赖 -RUN npm install +RUN cnpm install COPY . /project/ -#在启动镜像时执行启动项目的命令 CMD npm run dev +EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8fc0814 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' # compose编排版本为3 +services: + # 服务 + antdpro-demo: + # 服务名称 + hostname: antdpro-demo # 容器主机名 + build: + # 创建容器过程 + context: ./ # 所需素材都在该目录(仓库)下 + dockerfile: Dockerfile # 指定Dockerfile文件 + ports: + # 提供端口 + - 8000:8000 # 对外提供(暴露)的端口 + networks: + # 指定网络 + - dockerbetweennetwork + # volumes: + # # 数据卷 + # - ./ # 将宿主机该仓库内文件与nginx首页文件相关联(容器) +networks: + # 对外公开需要声明networks群集名称 + test: diff --git a/src/pages/list/list/CreatePart.tsx b/src/pages/list/list/CreatePart.tsx index 7c59f32..7b1f378 100644 --- a/src/pages/list/list/CreatePart.tsx +++ b/src/pages/list/list/CreatePart.tsx @@ -47,7 +47,7 @@ const CreatePart: React.FC = (props) => { = (props) => { const descriptions: ProColumns[] = template .filter((item: any) => JSON.stringify(item.view) !== '{}') .map((item: any) => { - const { width, view, ellipsis, ...rest } = item; + const { width, view, ellipsis, dataIndex, title, ...rest } = item; + if (['date'].includes(view.type)) { + return { + title, + span: view.single ? 2 : 1, + key: dataIndex, + valueType: view.type || 'text', + dataIndex, + ellipsis: true, + }; + } return { - ...rest, - render: (text: any) => { + title, + span: view.single ? 2 : 1, + key: dataIndex, + valueType: view.type || 'text', + dataIndex, + ellipsis: true, + render: (n: any, entry: any) => { + let text = entry[dataIndex]; if (item.view && item.view.type === 'image') { if (Array.isArray(text)) { return text.map((i: any) => { @@ -52,15 +68,42 @@ const SliderPart: React.FC = (props) => { return