Browse Source

彩礼&代码格式化

张正亮 4 years ago
parent
commit
121bb462dd
31 changed files with 357 additions and 273 deletions
  1. 1 2
      .gitignore
  2. 0 5
      .idea/codeStyles/codeStyleConfig.xml
  3. 1 0
      package.json
  4. 1 1
      src/apis/index.js
  5. 3 3
      src/pages/Task/eventManage/index.js
  6. 2 2
      src/pages/Task/historyManage/index.js
  7. 5 6
      src/pages/Task/taskmanage/index.js
  8. 1 1
      src/pages/fengkong/biz/service.js
  9. 1 1
      src/pages/fengkong/features/group/service.js
  10. 2 2
      src/pages/fengkong/namelist/blackdevicelist/service.js
  11. 2 2
      src/pages/fengkong/namelist/blackiplist/service.js
  12. 2 2
      src/pages/fengkong/namelist/blackuserlist/service.js
  13. 2 2
      src/pages/fengkong/namelist/whiteuserlist/service.js
  14. 1 1
      src/pages/fengkong/strategies/service.js
  15. 1 1
      src/pages/fengkong/view/other/other.js
  16. 1 13
      src/pages/fengkong/view/service.js
  17. 5 5
      src/pages/ms/userinfo/services.js
  18. 2 2
      src/pages/platform/auth/rolegroup/TagManage.js
  19. 3 3
      src/pages/platform/auth/rolegroup/index.js
  20. 2 2
      src/pages/platform/auth/rolelist/UserManage.js
  21. 2 2
      src/pages/platform/auth/rolelist/index.js
  22. 2 2
      src/pages/platform/auth/userlist/RoleManage.js
  23. 2 2
      src/pages/platform/auth/userlist/index.js
  24. 292 194
      src/pages/poster/edit/$id$.js
  25. 7 6
      src/pages/poster/edit/service.js
  26. 1 1
      src/pages/poster/list/components/JsonExport/service.js
  27. 1 1
      src/pages/poster/list/components/JsonImport/index.js
  28. 4 6
      src/pages/poster/list/components/JsonImport/service.js
  29. 2 2
      src/pages/poster/list/index.js
  30. 1 1
      src/pages/poster/list/services.js
  31. 5 0
      yarn.lock

+ 1 - 2
.gitignore

@@ -12,8 +12,7 @@
 
 # misc
 .DS_Store
-.idea
-.idea/*
+.idea/
 # umi
 .umi
 .umi-production

+ 0 - 5
.idea/codeStyles/codeStyleConfig.xml

@@ -1,5 +0,0 @@
-<component name="ProjectCodeStyleConfiguration">
-  <state>
-    <option name="PREFERRED_PROJECT_CODE_STYLE" value="wpt" />
-  </state>
-</component>

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "lodash": "^4.17.15",
     "lodash.clonedeep": "^4.5.0",
     "lodash.throttle": "^4.1.1",
+    "moment": "^2.29.1",
     "rc-color-picker": "^1.2.6",
     "react": "^16.9.0",
     "react-copy-to-clipboard": "^5.0.2",

+ 1 - 1
src/apis/index.js

@@ -35,7 +35,7 @@ export function fetchApi (url, params) {
   // }
 }
 
-export function fetchApi_get (url, params) {
+export function fetchApiGet (url, params) {
   return request({
     method: 'GET',
     url,

+ 3 - 3
src/pages/Task/eventManage/index.js

@@ -1,9 +1,9 @@
 import React, { useEffect, useState } from 'react';
 import { FilterTable, FormItem } from 'wptpc-design';
 import { message, Divider, Modal, Popconfirm } from 'antd';
-import { taskApi, dc } from '@/conf/config';
-import { fetchApi_get } from '@/apis/';
+import { fetchApiGet } from '@/apis';
 import { addItem, editItem, delItem } from './services';
+import {dc} from "@/conf/config";
 
 let localrefresh = null;
 export default function EventManage() {
@@ -179,7 +179,7 @@ export default function EventManage() {
   return (
     <>
       <FilterTable
-        fetchApi={fetchApi_get}
+        fetchApi={fetchApiGet}
         fetctWhenMount={true}
         filterSetting={filterSetting}
         tableSetting={tableSetting}

+ 2 - 2
src/pages/Task/historyManage/index.js

@@ -3,7 +3,7 @@ import { FilterTable, FormItem, LongText } from 'wptpc-design';
 import { message, Modal } from 'antd';
 import { dc } from '@/conf/config';
 import moment from 'moment';
-import { fetchApi_get } from '@/apis/';
+import { fetchApiGet } from '@/apis';
 import {} from './services';
 
 function HistoryManage(props) {
@@ -135,7 +135,7 @@ function HistoryManage(props) {
   return (
     <>
       <FilterTable
-        fetchApi={fetchApi_get}
+        fetchApi={fetchApiGet}
         fetctWhenMount={true}
         filterSetting={filterSetting}
         tableSetting={tableSetting}

+ 5 - 6
src/pages/Task/taskmanage/index.js

@@ -1,8 +1,8 @@
 import React, { useEffect, useState } from 'react';
-import { FilterTable, FormItem, LongText } from 'wptpc-design';
-import { message, Divider, Modal, Button, Popconfirm } from 'antd';
+import { FilterTable, FormItem } from 'wptpc-design';
+import { message, Divider, Modal, Popconfirm } from 'antd';
 import { dc } from '@/conf/config';
-import { fetchApi_get } from '@/apis/';
+import { fetchApiGet } from '@/apis';
 import { addItem, editItem, delItem, selectData } from './services';
 
 let localrefresh = null;
@@ -142,7 +142,7 @@ export default function EventManage() {
         return text.isOnline ? <span>已上线</span> : <span>未上线</span>;
       },
     },
-    
+
     {
       title: '延时',
       dataIndex: 'delayTime',
@@ -287,7 +287,7 @@ export default function EventManage() {
   return (
     <>
       <FilterTable
-        fetchApi={fetchApi_get}
+        fetchApi={fetchApiGet}
         fetctWhenMount={true}
         filterSetting={filterSetting}
         tableSetting={tableSetting}
@@ -303,7 +303,6 @@ export default function EventManage() {
         }}
       >
         <FormItem
-          //   fetchApi={fetchApi_get}
           formSetting={formSetting}
           params={formParams}
           onChange={onParamsChange}

+ 1 - 1
src/pages/fengkong/biz/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi, fetchApiGet as fetchApiGet } from '@/apis'
 import { thanos } from '@/conf/config'
 
 // 创建业务分类

+ 1 - 1
src/pages/fengkong/features/group/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi, fetchApiGet } from '@/apis'
 import { thanos } from '@/conf/config'
 
 // 新增策略

+ 2 - 2
src/pages/fengkong/namelist/blackdevicelist/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi } from '@/apis'
 import { thanos } from '@/conf/config'
 
 //删除
@@ -15,4 +15,4 @@ export async function addDeviceId (params) {
 export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
-}
+}

+ 2 - 2
src/pages/fengkong/namelist/blackiplist/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi } from '@/apis'
 import { thanos } from '@/conf/config'
 
 //删除
@@ -15,4 +15,4 @@ export async function addIP (params) {
 export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
-}
+}

+ 2 - 2
src/pages/fengkong/namelist/blackuserlist/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi } from '@/apis'
 import { thanos } from '@/conf/config'
 
 //删除
@@ -15,4 +15,4 @@ export async function addUserId (params) {
 export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
-}
+}

+ 2 - 2
src/pages/fengkong/namelist/whiteuserlist/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis'
+import { fetchApi } from '@/apis'
 import { thanos } from '@/conf/config'
 
 //删除
@@ -15,4 +15,4 @@ export async function addUserId (params) {
 export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
-}
+}

+ 1 - 1
src/pages/fengkong/strategies/service.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi, fetchApiGet } from '@/apis'
 import { thanos } from '@/conf/config'
 
 export async function unBind (params) {

+ 1 - 1
src/pages/fengkong/view/other/other.js

@@ -2,7 +2,7 @@ import React from 'react'
 import { FilterTable } from 'wptpc-design'
 import { thanos } from '@/conf/config'
 import { message, Divider } from 'antd'
-import { update, writeLog, queryLog, reviewOk } from '../service.js'
+import { update, writeLog, queryLog, reviewOk } from '../service'
 import Rv from '@/pages/fengkong/view/other/review'
 import VCM from '@/pages/fengkong/view/other/viewCodeModal'
 import { connect } from 'dva'

+ 1 - 13
src/pages/fengkong/view/service.js

@@ -1,18 +1,6 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi, fetchApiGet } from '@/apis'
 import { thanos } from '@/conf/config'
 
-// 新增策略
-export async function create (params) {
-  const url = `${thanos}/thanos-admin/api/v1/dsl/create`
-  return fetchApi(url, params)
-}
-
-// 测试策略
-export async function test (params) {
-  const url = `${thanos}/thanos-admin//api/v1/dsl/test`
-  return fetchApi(url, params)
-}
-
 // 获取策略详情
 export async function detail (params) {
   const url = `${thanos}/thanos-admin/api/v1/dsl/query`

+ 5 - 5
src/pages/ms/userinfo/services.js

@@ -1,13 +1,13 @@
-import { fetchApi_get } from '@/apis/'
+import { fetchApiGet } from '@/apis'
 import { us } from '@/conf/config'
-import { fetchApi } from '../../../apis'
+import { fetchApi } from '@/apis'
 
 export async function getUserDetail (params) {
   // console.log("params", params)
   //暂时直接访问gt api接口
   // const url = `${us}/ms/web/get-user-info`
   const url = `${us}/ms/web/get-user-info`
-  return fetchApi_get(url, params)
+  return fetchApiGet(url, params)
 }
 // 获取操作日志
 export const getActionLogs = userId => {
@@ -24,5 +24,5 @@ export async function getTagByUser (params){
   //   userinfoId: userId,
   // });
   const url = `${us}/ms/web/get-user-tag`;
-  return fetchApi_get(url, params);
-}
+  return fetchApiGet(url, params);
+}

+ 2 - 2
src/pages/platform/auth/rolegroup/TagManage.js

@@ -3,7 +3,7 @@ import { message } from 'antd';
 import { auth } from '@/conf/config';
 import { connect } from 'dva';
 import { FilterTable, LongText } from 'wptpc-design';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 
 const apiUrl = `${auth}/role/lists`;
 
@@ -63,7 +63,7 @@ class Index extends Component {
       },
     }
 
-    return <FilterTable fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
+    return <FilterTable fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
   }
 }
 

+ 3 - 3
src/pages/platform/auth/rolegroup/index.js

@@ -3,7 +3,7 @@ import { Modal, Divider, Button, message } from 'antd';
 import { connect } from 'dva';
 import { LongText, FilterTable } from 'wptpc-design';
 import { auth } from '@/conf/config';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 import TagManage from './TagManage';
 import Edit from './Edit';
 
@@ -142,7 +142,7 @@ class RoleGroup extends Component {
 
     return (
       <div>
-        <FilterTable fetchApi={fetchApi_get} fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
+        <FilterTable fetchApi={fetchApiGet} fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
         <Modal
           title={`角色管理(${selectedItem.groupName})`}
           visible={showModal}
@@ -159,4 +159,4 @@ class RoleGroup extends Component {
   }
 }
 
-export default RoleGroup
+export default RoleGroup

+ 2 - 2
src/pages/platform/auth/rolelist/UserManage.js

@@ -3,7 +3,7 @@ import { Modal, Badge } from 'antd';
 import { FilterTable } from 'wptpc-design';
 import { auth } from '@/conf/config';
 import { arrayToObj } from '@/utils/utils';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 
 const apiUrl = `${auth}/role/authuser`;
 
@@ -85,7 +85,7 @@ export default class Index extends Component {
         width={760}
         destroyOnClose
       >
-        <FilterTable fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
+        <FilterTable fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
       </Modal>
 )
   }

+ 2 - 2
src/pages/platform/auth/rolelist/index.js

@@ -3,7 +3,7 @@ import { Modal, Divider, Button, Tree, message } from 'antd';
 import { connect } from 'dva';
 import { LongText, FilterTable } from 'wptpc-design';
 import { auth } from '@/conf/config';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 import UserManage from './UserManage';
 import Edit from './Edit';
 
@@ -276,7 +276,7 @@ class RoleList extends Component {
 
     return (
       <div>
-        <FilterTable fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
+        <FilterTable fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
         <UserManage
           visible={showUserModal}
           onOk={this.onUserOk}

+ 2 - 2
src/pages/platform/auth/userlist/RoleManage.js

@@ -3,7 +3,7 @@ import { Modal, Badge } from 'antd';
 import { auth } from '@/conf/config';
 import { arrayToObj } from '@/utils/utils';
 import { FilterTable, LongText } from 'wptpc-design';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 
 const apiUrl = `${auth}/user/roleForSelect`;
 const jobStateBadgeObj = {
@@ -79,7 +79,7 @@ export default class Index extends Component {
         width={960}
         destroyOnClose
       >
-        <FilterTable fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
+        <FilterTable fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} isPage={false} />
       </Modal>
 )
   }

+ 2 - 2
src/pages/platform/auth/userlist/index.js

@@ -4,7 +4,7 @@ import { connect } from 'dva';
 import { auth } from '@/conf/config';
 import { LongText, FilterTable } from 'wptpc-design';
 import { arrayToObj } from '@/utils/utils';
-import { fetchApi_get } from '@/apis';
+import { fetchApiGet } from '@/apis';
 import styles from './index.less';
 import RoleManage from './RoleManage';
 
@@ -247,7 +247,7 @@ class UserList extends Component {
 
     return (
       <div>
-        <FilterTable fetchApi={fetchApi_get} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
+        <FilterTable fetchApi={fetchApiGet} filterSetting={filterSetting} tableSetting={tableSetting} apiUrl={apiUrl} />
         <RoleManage
           visible={showRoleModal}
           onOk={this.onRoleOk}

+ 292 - 194
src/pages/poster/edit/$id$.js

@@ -1,29 +1,30 @@
 /* eslint-disable camelcase */
 import React from 'react'
-import { Button, Form, Input, Select, Slider, Switch,Row,Col, InputNumber, Icon, Popover, Modal, message } from 'antd'
-import { Rnd } from 'react-rnd'
-import { ImagePreview, JsonPage } from 'wptpc-design'
+import {Button, Form, Input, Select, Slider, Switch, Row, Col, InputNumber, Icon, Popover, Modal, message} from 'antd'
+import {Rnd} from 'react-rnd'
+import {ImagePreview, JsonPage} from 'wptpc-design'
 
 import isEmpty from 'lodash/isEmpty'
 // import { connect } from 'dva'
 
 import RcColorPicker from 'rc-color-picker'
 import 'rc-color-picker/assets/index.css'
-import { create, fetchDetail, update,fontList } from './service'
+import {create, fetchDetail, update, fontList} from './service'
 
 import styles from './index.less'
+
 const IconFont = Icon.createFromIconfontCN({
   scriptUrl: '//at.alicdn.com/t/font_2018233_fl4w8ponsnu.js',
 });
-const { Option } = Select
-const { confirm } = Modal
+const {Option} = Select
+const {confirm} = Modal
 
 const unique = (arr) => {
   return Array.from(new Set(arr))
 }
 
 export default class Edit extends React.PureComponent {
-  state={
+  state = {
     name: '',
     description: '',
     bg: {
@@ -34,18 +35,18 @@ export default class Edit extends React.PureComponent {
     },
     element: [],
     activeObjectIndex: 0,
-    canvasArea:false,// 鼠标是否在画布区域
+    canvasArea: false,// 鼠标是否在画布区域
     editName: '',
     imgs: [], // 预览图片的url
     previwVisible: false, // 预览框是否展示
-    fontList:[],//字体列表
+    fontList: [],//字体列表
   }
   keyPress = event => {
-    const { activeObjectIndex,canvasArea } = this.state
-    const activeObject=this.state.element[activeObjectIndex] || {}
+    const {activeObjectIndex, canvasArea} = this.state
+    const activeObject = this.state.element[activeObjectIndex] || {}
     const e = event || window.event;
-    const { keyCode } = e;
-    var ctrlKey = e.ctrlKey || e.metaKey;
+    const {keyCode} = e;
+    const ctrlKey = e.ctrlKey || e.metaKey;
     // console.log("🚀 ~ file: $id$.js ~ line 45 ~ Edit ~ ctrlKey", ctrlKey)
     // console.log("🚀 ~ file: $id$.js ~ line 44 ~ Edit ~ keyCode", keyCode)
 
@@ -56,7 +57,7 @@ export default class Edit extends React.PureComponent {
       let list = [];
       if (localStorage.getItem('posterElement') && JSON.parse(localStorage.getItem('posterElement'))?.length > 0) {
         list = JSON.parse(localStorage.getItem('posterElement'));
-        if (this.state.id&&list.length===1) {
+        if (this.state.id && list.length === 1) {
           this.reback = false;
           return
         }
@@ -87,23 +88,23 @@ export default class Edit extends React.PureComponent {
     if (keyCode === 37) {
       e.preventDefault();
       //左
-      this.updateElement(activeObjectIndex, { dx: activeObject.dx-1 })
+      this.updateElement(activeObjectIndex, {dx: activeObject.dx - 1})
     }
     if (keyCode === 38) {
       e.preventDefault();
       //上
-      this.updateElement(activeObjectIndex, { dy: activeObject.dy-1 })
+      this.updateElement(activeObjectIndex, {dy: activeObject.dy - 1})
     }
     if (keyCode === 39) {
       e.preventDefault();
       // 右
-      this.updateElement(activeObjectIndex, { dx: activeObject.dx+1 })
+      this.updateElement(activeObjectIndex, {dx: activeObject.dx + 1})
 
     }
     if (keyCode === 40) {
       e.preventDefault();
       //下
-      this.updateElement(activeObjectIndex, { dy: activeObject.dy+1 })
+      this.updateElement(activeObjectIndex, {dy: activeObject.dy + 1})
 
     }
   };
@@ -116,34 +117,35 @@ export default class Edit extends React.PureComponent {
   removeKeyUpEvent = () => {
     window.removeEventListener('keydowm', this.keyPress);
   };
+
   componentDidMount() {
     this.addKeyUpEvent();
-    localStorage.setItem("posterElement",'')
-    this.setState({ posterHeight: document.body.clientHeight - document.getElementById('poster').offsetTop - 35 })
+    localStorage.setItem("posterElement", '')
+    this.setState({posterHeight: document.body.clientHeight - document.getElementById('poster').offsetTop - 35})
     if (this.props.match.params.id) {
-      fetchDetail({ id: this.props.match.params.id }).then(res => {
+      fetchDetail({id: this.props.match.params.id}).then(res => {
         if (!isEmpty(res.data)) {
-          const { data: { description, name, id, preview, config: [bg, ...element] } } = res
-          this.setState({ name: name, description: description, element: element, id: id, bg: bg, imgs: [preview] })
+          const {data: {description, name, id, preview, config: [bg, ...element]}} = res
+          this.setState({name: name, description: description, element: element, id: id, bg: bg, imgs: [preview]})
         }
       })
       fontList().then(res => {
         if (res.code === 0) {
-          this.setState({fontList:res.data})
+          this.setState({fontList: res.data})
         }
       })
     }
   }
+
   componentDidUpdate(prevProps, prevState) {
-    const { name, description, bg, element } = this.state;
-    const { name: nameprev, description: descriptionprev, bg: bgprev, element: elementprev } = prevState;
-    console.log(name,nameprev,111);
+    const {name, description, bg, element} = this.state;
+    const {name: nameprev, description: descriptionprev, bg: bgprev, element: elementprev} = prevState;
     if (name === nameprev && description === descriptionprev && JSON.stringify(bg) === JSON.stringify(bgprev) && JSON.stringify(element) === JSON.stringify(elementprev)) {
       return
     }
 
     const temListStr = localStorage.getItem('posterElement');
-    let obj={}
+    let obj = {}
     let list = [];
     if (temListStr) {
       list = JSON.parse(temListStr);
@@ -157,35 +159,37 @@ export default class Edit extends React.PureComponent {
       element: element,
       name: name,
       description: description,
-      bg:bg,
+      bg: bg,
     })
     // 最多储存 30 步的操作
-    if (list.length >30) {
-      list=list.slice(-30)
+    if (list.length > 30) {
+      list = list.slice(-30)
     }
-    localStorage.setItem('posterElement',JSON.stringify(list))
+    localStorage.setItem('posterElement', JSON.stringify(list))
   }
+
   componentWillUnmount() {
     this.removeKeyUpEvent();
-    localStorage.setItem('posterElement','')
+    localStorage.setItem('posterElement', '')
   }
+
   updateBgState = (value) => {
-    this.setState({ bg: { ...this.state.bg, ...value } })
+    this.setState({bg: {...this.state.bg, ...value}})
   }
 
-  updateElement =(index, value) => {
+  updateElement = (index, value) => {
     // console.log(index, value);
     const _ele = this.state.element.slice()
     const _tar = _ele[index]  // dom
     // console.log(_tar,value);
     _ele[index] = {
-      ..._tar ,
+      ..._tar,
       ...value,
     }
-    this.setState({ element: _ele })
+    this.setState({element: _ele})
   }
 
-  delElement =(index, name) => {
+  delElement = (index, name) => {
     confirm({
       title: '确定删除' + name + '?',
       okText: 'Yes',
@@ -194,15 +198,31 @@ export default class Edit extends React.PureComponent {
       onOk: () => {
         const _ele = this.state.element.slice()
         _ele.splice(index, 1)
-        this.setState({ element: _ele })
+        this.setState({element: _ele})
       }
 
     })
   }
 
+  // 修改二维码logo
+  changeQrLogo = (logo) => {
+    let logos = new Map();
+    logos.set('wpt_high', 'https://cdn.weipaitang.com/static/20200413eb9effec-3871-ffec3871-cd41-baed9e98535e-W200H200');
+    logos.set('youjiang', 'https://cdn.weipaitang.com/static/202004141c0b320a-9cdc-320a9cdc-d090-e4b5964fee9d-W200H200');
+    logos.set('cl', 'https://cdn.weipaitang.com/static/20210607d591559f-70e6-559f70e6-7427-f899f240d7a0-W284H285');
+
+    let logoUrl = logos.get(logo);
+    // 默认logo
+    if (typeof logoUrl === "undefined"){
+      logoUrl = "https://cdn.weipaitang.com/static/20200413d4263aa5-6423-3aa56423-4e8d-a96e1d9d93f3-W200H200"
+    }
+
+    return `url(` + logoUrl + `)`
+  }
+
   addShape = (type) => {
     const _ele = this.state.element.slice()
-    const { dx, dy } = _ele[this.state.activeObjectIndex] || { dx: 0, dy: 45 }
+    const {dx, dy} = _ele[this.state.activeObjectIndex] || {dx: 0, dy: 45}
 
     switch (type) {
       case 'text':
@@ -223,7 +243,7 @@ export default class Edit extends React.PureComponent {
         _ele.push({
           type: 'pic',
           path: '#pic_' + (this.state.element.filter(item => item.type === 'pic').length + 1) + '#',
-          content: 'https://cdn01t.weipaitang.com/img/20200407u1hmwwai-75so-tvze-5z15-oynukyk8esad-W1125H1500/w/640',
+          content: 'https://cdn.weipaitang.com/img/20210417B2gW3tnOlVzgfja0TSqvdlE1YhnFV4QOtwswRdvwLiQKqnyDGLxPXHP3I3vXTiL0-W1080H1080/w/640',
           w: '100',
           h: '100',
           dx: dx + 15,
@@ -236,7 +256,7 @@ export default class Edit extends React.PureComponent {
         _ele.push({
           type: 'mat',
           path: '#mat_' + (this.state.element.filter(item => item.type === 'mat').length + 1) + '#',
-          content: 'https://cdn01t.weipaitang.com/img/20200407u1hmwwai-75so-tvze-5z15-oynukyk8esad-W1125H1500/w/640',
+          content: 'https://cdn.weipaitang.com/img/202012147ystzory-b7hg-43vc-kg1g-goacjxmsbimr-W2415H2415/w/640',
           w: '100',
           h: '100',
           dx: dx + 15,
@@ -259,13 +279,13 @@ export default class Edit extends React.PureComponent {
       default:
         break
     }
-    this.setState({ element: _ele, activeObjectIndex: _ele.length - 1 }, () => {
+    this.setState({element: _ele, activeObjectIndex: _ele.length - 1}, () => {
       // this.setState({ activeObjectIndex: this.state.element.length - 1 })
     })
   }
 
   save = () => {
-    const { id, name, description, bg, element } = this.state
+    const {id, name, description, bg, element} = this.state
     const handleFun = id ? update : create
 
     element.map(item => {
@@ -305,19 +325,28 @@ export default class Edit extends React.PureComponent {
   //   document.fonts.add(font);
   //   document.body.classList.add("fonts-loaded");
   // }
-  render () {
-    const { bg: { w: bgWidth, h: bgHeight, c: bgColor }, activeObjectIndex, element, name, description, imgs, previwVisible } = this.state
+  render() {
+    const {
+      bg: {w: bgWidth, h: bgHeight, c: bgColor},
+      activeObjectIndex,
+      element,
+      name,
+      description,
+      imgs,
+      previwVisible
+    } = this.state
     const activeObject = element[activeObjectIndex] || {}
     const group = element.map(item => item.group)
-    const _element = element.map((item, index) => ({ ...item, index: index }))
+    const _element = element.map((item, index) => ({...item, index: index}))
     // console.log('activeObject',activeObject);
     return (
-      <div id="poster" style={{ height: this.state.posterHeight, display: 'flex', flexDirection: 'column' }}>
+      <div id="poster" style={{height: this.state.posterHeight, display: 'flex', flexDirection: 'column'}}>
         <div className={styles.header}>
-          <span>模版:<Input style={{ width: '200px' }} value={name} onChange={e => this.setState({ name: e.target.value })}/></span>
-          <span>&emsp;描述:<Input style={{ width: '200px' }} value={description} onChange={e => this.setState({ description: e.target.value })}/></span>
+          <span>模版:<Input style={{width: '200px'}} value={name} onChange={e => this.setState({name: e.target.value})}/></span>
+          <span>&emsp;描述:<Input style={{width: '200px'}} value={description}
+                                onChange={e => this.setState({description: e.target.value})}/></span>
           <span>
-            <Button onClick={() => this.setState({ previwVisible: true })}>预览</Button>
+            <Button onClick={() => this.setState({previwVisible: true})}>预览</Button>
             <Button type="primary" onClick={this.save}>保存</Button>
           </span>
         </div>
@@ -326,23 +355,23 @@ export default class Edit extends React.PureComponent {
             <div className={styles.box}>
               <h2>背景</h2>
               <Form layout="vertical">
-                <Form.Item label="宽度" >
+                <Form.Item label="宽度">
                   <Input value={bgWidth} onChange={(e) => {
-                    this.updateBgState({ w: Number.parseFloat(e.target.value || 0) })
+                    this.updateBgState({w: Number.parseFloat(e.target.value || 0)})
                   }}/>
                 </Form.Item>
                 <Form.Item label="高度">
                   <Input value={bgHeight} onChange={(e) => {
-                    this.updateBgState({ h: Number.parseFloat(e.target.value || 0) })
+                    this.updateBgState({h: Number.parseFloat(e.target.value || 0)})
                   }}/>
                 </Form.Item>
                 <Form.Item label="背景色">
-                  <div style={{ width: '60px' }}>
+                  <div style={{width: '60px'}}>
                     <RcColorPicker
                       color={bgColor}
-                      onChange={({ color }) => this.updateBgState({ c: color })}
+                      onChange={({color}) => this.updateBgState({c: color})}
                     >
-                      <Input />
+                      <Input/>
                     </RcColorPicker>
                   </div>
                 </Form.Item>
@@ -350,12 +379,16 @@ export default class Edit extends React.PureComponent {
             </div>
             <div className={styles.box}>
               <h2>元素</h2>
-              <div style={{ fontSize: 18,cursor:"pointer" }} >
-                <Row >
-                  <Col span={12} onClick={() => this.addShape('text')}><IconFont type='iconwenben'/><span style={{display:'inline-block', margin:5}}>文本</span></Col>
-                  <Col span={12} onClick={() => this.addShape('pic')}><Icon type="picture" /><span style={{display:'inline-block', margin:5}}>图片</span></Col>
-                  <Col span={12} onClick={() => this.addShape('qr')}><Icon type="qrcode" /><span style={{display:'inline-block', margin:5}}>二维码</span></Col>
-                  <Col span={12} onClick={() => this.addShape('mat')}><IconFont type='iconsucai'/><span style={{display:'inline-block', margin:5}}>素材</span></Col>
+              <div style={{fontSize: 18, cursor: "pointer"}}>
+                <Row>
+                  <Col span={12} onClick={() => this.addShape('text')}><IconFont type='iconwenben'/><span
+                    style={{display: 'inline-block', margin: 5}}>文本</span></Col>
+                  <Col span={12} onClick={() => this.addShape('pic')}><Icon type="picture"/><span
+                    style={{display: 'inline-block', margin: 5}}>图片</span></Col>
+                  <Col span={12} onClick={() => this.addShape('qr')}><Icon type="qrcode"/><span
+                    style={{display: 'inline-block', margin: 5}}>二维码</span></Col>
+                  <Col span={12} onClick={() => this.addShape('mat')}><IconFont type='iconsucai'/><span
+                    style={{display: 'inline-block', margin: 5}}>素材</span></Col>
                 </Row>
               </div>
               {/* <ul className={styles.elem}>
@@ -369,24 +402,32 @@ export default class Edit extends React.PureComponent {
               <ul className={styles.layer}>
                 {
                   unique(group).map((_item) => {
-                    console.log(_element,'_element');
+                    console.log(_element, '_element');
                     return <React.Fragment>
                       <div>分组:{_item || '未分组'}</div>
                       {
                         _element.filter(item => item.group === _item).map((item, index) => (
                           <li
                             className={`${activeObjectIndex === item.index ? styles.selected : ''} ${styles[item.type]}`}
-                            onClick={() => this.setState({ activeObjectIndex: item.index })}>
-                            <div className={styles.tem} style={{ display: 'inline-block', verticalAlign: -2, backgroundColor: '#1890ff05' }} >
-                              {item.type === 'pic'&&<Icon type="picture"  />}
-                              {item.type === 'mat'&&<IconFont type="iconsucai"  />}
-                              {item.type === 'text'&&<IconFont type="iconwenben" />}
-                              {item.type === 'qr' && <Icon type="qrcode" />}
-                              {item.isTemplate ? <IconFont type="iconmu"  />:<IconFont type="iconkongbai"  />}
+                            onClick={() => this.setState({activeObjectIndex: item.index})}>
+                            <div className={styles.tem}
+                                 style={{display: 'inline-block', verticalAlign: -2, backgroundColor: '#1890ff05'}}>
+                              {item.type === 'pic' && <Icon type="picture"/>}
+                              {item.type === 'mat' && <IconFont type="iconsucai"/>}
+                              {item.type === 'text' && <IconFont type="iconwenben"/>}
+                              {item.type === 'qr' && <Icon type="qrcode"/>}
+                              {item.isTemplate ? <IconFont type="iconmu"/> : <IconFont type="iconkongbai"/>}
                             </div>
-                            {((item.type === 'pic'||item.type === 'mat') ? item.path : item.t || '').toString().replace(/#/g, '')}
-                            <Popover placement="right" content={<div><p onClick={() => this.setState({ visible: true, editIndex: item.index, editType: item.type, editName: (item.type === 'pic'||item.type === 'mat' )? item.path : item.t || '' })}>重命名</p><p onClick={() => this.delElement(item.index, item.type === 'pic' ? item.path : item.t)}>删除</p></div>}>
-                              <Icon type="setting" theme="filled" />
+                            {((item.type === 'pic' || item.type === 'mat') ? item.path : item.t || '').toString().replace(/#/g, '')}
+                            <Popover placement="right" content={<div><p onClick={() => this.setState({
+                              visible: true,
+                              editIndex: item.index,
+                              editType: item.type,
+                              editName: (item.type === 'pic' || item.type === 'mat') ? item.path : item.t || ''
+                            })}>重命名</p><p
+                              onClick={() => this.delElement(item.index, item.type === 'pic' ? item.path : item.t)}>删除</p>
+                            </div>}>
+                              <Icon type="setting" theme="filled"/>
                             </Popover>
                           </li>
                         ))
@@ -398,7 +439,11 @@ export default class Edit extends React.PureComponent {
               </ul>
             </div>
           </div>
-          <div className={styles.middle} onMouseEnter={()=>{this.setState({canvasArea:true})}} onMouseLeave={()=>{this.setState({canvasArea:false})}}>
+          <div className={styles.middle} onMouseEnter={() => {
+            this.setState({canvasArea: true})
+          }} onMouseLeave={() => {
+            this.setState({canvasArea: false})
+          }}>
             <div id="canvas" style={{
               position: 'relative',
               width: Number(bgWidth),
@@ -416,12 +461,17 @@ export default class Edit extends React.PureComponent {
                     return (
                       <Rnd
                         disableDragging={item.fixed}
-                        size={{ width: Number.parseFloat(item.weight), height: Number.parseFloat(item.height) }}
-                        position={{ x: item.dx, y: item.dy - item.size }}
-                        onDragStop={(e, d) => { this.updateElement(index, { dx: d.x, dy: d.y + item.size }) }}
+                        size={{width: Number.parseFloat(item.weight), height: Number.parseFloat(item.height)}}
+                        position={{x: item.dx, y: item.dy - item.size}}
+                        onDragStop={(e, d) => {
+                          this.updateElement(index, {dx: d.x, dy: d.y + item.size})
+                        }}
                         onResizeStop={(e, direction, ref, delta, position) => { // 单击、双击文字框 出现白屏
-                         if (ref.style.width && ref.style.height)this.updateElement(index, { width: Number.parseFloat(ref.style.width||0), height: Number.parseFloat(ref.style.height||0), ...position })
-                       }}
+                          if (ref.style.width && ref.style.height) this.updateElement(index, {
+                            width: Number.parseFloat(ref.style.width || 0),
+                            height: Number.parseFloat(ref.style.height || 0), ...position
+                          })
+                        }}
                         bounds="parent"
                         className={
                           activeObjectIndex === index ? styles.outline : ""
@@ -433,7 +483,7 @@ export default class Edit extends React.PureComponent {
                         <div
                           className={styles.textRnd}
                           onClick={() =>
-                            this.setState({ activeObjectIndex: index })
+                            this.setState({activeObjectIndex: index})
                           }
                           style={{
                             WebkitLineClamp: clampLine,
@@ -447,7 +497,7 @@ export default class Edit extends React.PureComponent {
                             position: 'relative',
                             textAlign: item.float_x,
                             writingMode: item.vertical && "vertical-lr",
-                            display: item.vertical&& "inline-block" || item.float_x === 'center' && "inline-block",
+                            display: item.vertical && "inline-block" || item.float_x === 'center' && "inline-block",
                             // left: (Number.parseFloat(bgWidth) - Number.parseFloat(item.dx) - Number.parseFloat(item.width)) / 2 + 'px'
                           }}
                         >
@@ -459,18 +509,23 @@ export default class Edit extends React.PureComponent {
                   if (item.type === 'pic' || item.type === 'mat') {
                     return (
                       <Rnd
-                        size={{ width: Number.parseFloat(item.w), height: Number.parseFloat(item.h) }}
-                        position={{ x: item.dx, y: item.dy }}
-                        onDragStop={(e, d) => { this.updateElement(index, { dx: d.x, dy: d.y }) }}
+                        size={{width: Number.parseFloat(item.w), height: Number.parseFloat(item.h)}}
+                        position={{x: item.dx, y: item.dy}}
+                        onDragStop={(e, d) => {
+                          this.updateElement(index, {dx: d.x, dy: d.y})
+                        }}
                         onResizeStop={(e, direction, ref, delta, position) => {
-                          this.updateElement(index, { w: Number.parseFloat(ref.style.width), h: Number.parseFloat(ref.style.height), ...position })
+                          this.updateElement(index, {
+                            w: Number.parseFloat(ref.style.width),
+                            h: Number.parseFloat(ref.style.height), ...position
+                          })
                         }}
                         bounds="parent"
                         className={activeObjectIndex === index ? styles.outline : ''}
 
                       >
                         <div
-                          onClick={() => this.setState({ activeObjectIndex: index })}
+                          onClick={() => this.setState({activeObjectIndex: index})}
                           style={{
                             backgroundRepeat: 'no-repeat',
                             backgroundSize: 'cover',
@@ -487,26 +542,43 @@ export default class Edit extends React.PureComponent {
                     )
                   }
                   if (item.type === 'qr') {
+                    console.log(item)
                     return (
                       <Rnd
-                        size={{ width: Number.parseFloat(item.size), height: Number.parseFloat(item.size) }}
-                        position={{ x: item.dx, y: item.dy }}
-                        onDragStop={(e, d) => { this.updateElement(index, { dx: d.x, dy: d.y }) }}
+                        size={{width: Number.parseFloat(item.size), height: Number.parseFloat(item.size)}}
+                        position={{x: item.dx, y: item.dy}}
+                        onDragStop={(e, d) => {
+                          this.updateElement(index, {dx: d.x, dy: d.y})
+                        }}
                         onResizeStop={(e, direction, ref, delta, position) => {
-                          this.updateElement(index, { size: Number.parseFloat(ref.style.width), ...position })
+                          this.updateElement(index, {size: Number.parseFloat(ref.style.width), ...position})
                         }}
                         bounds="parent"
                         className={activeObjectIndex === index ? styles.outline : ''}
 
                       >
+                        {/*<div*/}
+                        {/*  onClick={() => this.setState({activeObjectIndex: index})}*/}
+                        {/*  style={{*/}
+                        {/*    backgroundRepeat: 'no-repeat',*/}
+                        {/*    backgroundSize: 'cover',*/}
+                        {/*    backgroundImage: `url(${item.logo === 'wpt_high' || item.logo === 'youjiang' || item.logo === 'cl'*/}
+                        {/*      ? (item.logo === 'wpt_high'*/}
+                        {/*        ? 'https://cdn.weipaitang.com/static/20200413eb9effec-3871-ffec3871-cd41-baed9e98535e-W200H200'*/}
+                        {/*        : 'https://cdn.weipaitang.com/static/202004141c0b320a-9cdc-320a9cdc-d090-e4b5964fee9d-W200H200')*/}
+                        {/*      : 'https://cdn.weipaitang.com/static/20200413d4263aa5-6423-3aa56423-4e8d-a96e1d9d93f3-W200H200'})`,*/}
+                        {/*    width: Number.parseFloat(item.size || '0') + 'px',*/}
+                        {/*    height: Number.parseFloat(item.size || '0') + 'px'*/}
+                        {/*  }}*/}
+                        {/*>*/}
+                        {/*</div>*/}
+
                         <div
-                          onClick={() => this.setState({ activeObjectIndex: index })}
+                          onClick={() => this.setState({activeObjectIndex: index})}
                           style={{
                             backgroundRepeat: 'no-repeat',
                             backgroundSize: 'cover',
-                            backgroundImage: `url(${item.logo === 'wpt_high' || item.logo === 'youjiang'
-                          ? (item.logo === 'wpt_high' ? 'https://cdn.weipaitang.com/static/20200413eb9effec-3871-ffec3871-cd41-baed9e98535e-W200H200' : 'https://cdn.weipaitang.com/static/202004141c0b320a-9cdc-320a9cdc-d090-e4b5964fee9d-W200H200')
-                          : 'https://cdn.weipaitang.com/static/20200413d4263aa5-6423-3aa56423-4e8d-a96e1d9d93f3-W200H200'})`,
+                            backgroundImage: this.changeQrLogo(item.logo),
                             width: Number.parseFloat(item.size || '0') + 'px',
                             height: Number.parseFloat(item.size || '0') + 'px'
                           }}
@@ -526,68 +598,77 @@ export default class Edit extends React.PureComponent {
                 <div className={styles.box}>
                   <h2>
                     <span>文字</span>
-                    <span style={{float:'right',fontSize:14}}>
-                      <span style={{marginRight:5}}>设置为母版</span>
-                      <Switch checked={activeObject.isTemplate||false}  onChange={(checked) => this.updateElement(activeObjectIndex, { isTemplate: checked })}/>
+                    <span style={{float: 'right', fontSize: 14}}>
+                      <span style={{marginRight: 5}}>设置为模板</span>
+                      <Switch checked={activeObject.isTemplate || false}
+                              onChange={(checked) => this.updateElement(activeObjectIndex, {isTemplate: checked})}/>
                     </span>
                   </h2>
                   <Form layout="vertical">
                     <Form.Item label="内容">
-                      <Input.TextArea rows={3} value={activeObject.content} onChange={(e) => this.updateElement(activeObjectIndex, { content: e.target.value })}/>
+                      <Input.TextArea rows={3} value={activeObject.content}
+                                      onChange={(e) => this.updateElement(activeObjectIndex, {content: e.target.value})}/>
                     </Form.Item>
                     <Form.Item label="字体">
-                      <Select value={activeObject.font} onChange={(value) => this.updateElement(activeObjectIndex, { font: value })}>
+                      <Select value={activeObject.font}
+                              onChange={(value) => this.updateElement(activeObjectIndex, {font: value})}>
                         {(this.state.fontList || []).map(item => {
-                          return <Option value={item.value}>{ item.option}</Option>
+                          return <Option value={item.value}>{item.option}</Option>
                         })}
                       </Select>
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="字体大小" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} min={12} max={100} value={activeObject.size} onChange={(value) => this.updateElement(activeObjectIndex, { size: value })} />
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="字体大小" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} min={12} max={100} value={activeObject.size}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {size: value})}/>
                       </Form.Item>
-                      <Form.Item label="字体颜色" style={{ flex: 1 }}>
-                        <div style={{ width: '60px' }}
+                      <Form.Item label="字体颜色" style={{flex: 1}}>
+                        <div style={{width: '60px'}}
                         >
                           <RcColorPicker
                             color={activeObject.c}
-                            onChange={({ color }) => this.updateElement(activeObjectIndex, { c: color })}
+                            onChange={({color}) => this.updateElement(activeObjectIndex, {c: color})}
                           >
-                            <Input />
+                            <Input/>
                           </RcColorPicker>
                         </div>
 
                       </Form.Item>
                     </div>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="X偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dx} onChange={(value) => this.updateElement(activeObjectIndex, { dx: value })}/>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="X偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dx}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dx: value})}/>
                       </Form.Item>
-                      <Form.Item label="Y偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dy} onChange={(value) => this.updateElement(activeObjectIndex, { dy: value })}/>
+                      <Form.Item label="Y偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dy}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dy: value})}/>
                       </Form.Item>
                     </div>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="文字宽度" style={{ flex: 1 }}>
-                        <InputNumber value={activeObject.width} style={{ width: 80 }} onChange={(value) => this.updateElement(activeObjectIndex, { width: value })}/>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="文字宽度" style={{flex: 1}}>
+                        <InputNumber value={activeObject.width} style={{width: 80}}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {width: value})}/>
                       </Form.Item>
-                      <Form.Item label="文字高度" style={{ flex: 1 }}>
-                        <InputNumber value={activeObject.height} style={{ width: 80 }} onChange={(value) => this.updateElement(activeObjectIndex, { height: value })}/>
+                      <Form.Item label="文字高度" style={{flex: 1}}>
+                        <InputNumber value={activeObject.height} style={{width: 80}}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {height: value})}/>
                       </Form.Item>
                     </div>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="X居中" style={{ flex: 1 }}>
-                        <Select value={activeObject.float_x||""} style={{ width: 80 }} onChange={(value) => this.updateElement(activeObjectIndex, { float_x: value })}>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="X居中" style={{flex: 1}}>
+                        <Select value={activeObject.float_x || ""} style={{width: 80}}
+                                onChange={(value) => this.updateElement(activeObjectIndex, {float_x: value})}>
                           <Option value="">不居中</Option>
                           <Option value="center">居中</Option>
                           {/* <Option value="right">right</Option> */}
                           <Option value="left">居左</Option>
                         </Select>
                       </Form.Item>
-                      <Form.Item label="文字垂直" style={{ flex: 1 }}>
+                      <Form.Item label="文字垂直" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.vertical}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { vertical: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {vertical: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
@@ -598,33 +679,33 @@ export default class Edit extends React.PureComponent {
                         min={0}
                         max={1}
                         step="0.1"
-                        onChange={(value) => this.updateElement(activeObjectIndex, { opacity: value })}
+                        onChange={(value) => this.updateElement(activeObjectIndex, {opacity: value})}
                         value={activeObject.opacity}
                       />
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="固定位置" style={{ flex: 1 }}>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="固定位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.fixed}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { fixed: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {fixed: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
-                      <Form.Item label="浮动位置" style={{ flex: 1 }}>
+                      <Form.Item label="浮动位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.relative}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { relative: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {relative: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
                     </div>
-                    <Form.Item label="分组" style={{ flex: 1 }}>
+                    <Form.Item label="分组" style={{flex: 1}}>
                       <InputNumber
-                        style={{ width: 100 }}
+                        style={{width: 100}}
                         value={activeObject.group}
-                        onChange={(value) => this.updateElement(activeObjectIndex, { group: value || undefined })}
+                        onChange={(value) => this.updateElement(activeObjectIndex, {group: value || undefined})}
                       />
                     </Form.Item>
                   </Form>
@@ -637,65 +718,72 @@ export default class Edit extends React.PureComponent {
                 <div className={styles.box}>
                   <h2>
                     <span>二维码</span>
-                    <span style={{float:'right',fontSize:14}}>
-                      <span style={{marginRight:5}}>设置为母版</span>
-                      <Switch checked={activeObject.isTemplate||false}  onChange={(checked) => this.updateElement(activeObjectIndex, { isTemplate: checked })}/>
+                    <span style={{float: 'right', fontSize: 14}}>
+                      <span style={{marginRight: 5}}>设置为模版</span>
+                      <Switch checked={activeObject.isTemplate || false}
+                              onChange={(checked) => this.updateElement(activeObjectIndex, {isTemplate: checked})}/>
                     </span>
                   </h2>
                   <Form layout="vertical">
                     <Form.Item label="内容">
-                      <Input value={activeObject.content} onChange={(e) => this.updateElement(activeObjectIndex, { content: e.target.value })}/>
+                      <Input value={activeObject.content}
+                             onChange={(e) => this.updateElement(activeObjectIndex, {content: e.target.value})}/>
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="X偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dx} onChange={(value) => this.updateElement(activeObjectIndex, { dx: value })}/>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="X偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dx}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dx: value})}/>
                       </Form.Item>
-                      <Form.Item label="Y偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dy} onChange={(value) => this.updateElement(activeObjectIndex, { dy: value })}/>
+                      <Form.Item label="Y偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dy}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dy: value})}/>
                       </Form.Item>
                     </div>
                     <Form.Item label="LOGO">
                       <Switch
-                        checked={activeObject.logo === 'wpt_high' || activeObject.logo === 'youjiang'}
-                        onChange={(checked) => this.updateElement(activeObjectIndex, { logo: checked ? 'wpt_high' : false })}
+                        checked={activeObject.logo === 'wpt_high' || activeObject.logo === 'youjiang' || activeObject.logo === 'cl'}
+                        onChange={(checked) => this.updateElement(activeObjectIndex, {logo: checked ? 'wpt_high' : false})}
                         checkedChildren="开"
                         unCheckedChildren="关"
                       />
                       {
-                        (activeObject.logo === 'wpt_high' || activeObject.logo === 'youjiang') && (
-                          <Select value={activeObject.logo} style={{ width: 120, marginLeft: '5px' }} onChange={value => this.updateElement(activeObjectIndex, { logo: value })}>
+                        (activeObject.logo === 'wpt_high' || activeObject.logo === 'youjiang' || activeObject.logo === 'cl') && (
+                          <Select value={activeObject.logo} style={{width: 120, marginLeft: '5px'}}
+                                  onChange={value => this.updateElement(activeObjectIndex, {logo: value})}>
                             <Option value="wpt_high">微拍堂</Option>
                             <Option value="youjiang">有匠</Option>
+                            <Option value="cl">彩礼</Option>
                           </Select>
                         )
                       }
                     </Form.Item>
                     <Form.Item label="大小">
-                      <InputNumber style={{ width: 100 }} value={activeObject.size} onChange={(value) => this.updateElement(activeObjectIndex, { size: value })}/>
+                      <InputNumber style={{width: 100}} value={activeObject.size}
+                                   onChange={(value) => this.updateElement(activeObjectIndex, {size: value})}/>
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="固定位置" style={{ flex: 1 }}>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="固定位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.fixed}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { fixed: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {fixed: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
-                      <Form.Item label="浮动位置" style={{ flex: 1 }}>
+                      <Form.Item label="浮动位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.relative}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { relative: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {relative: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
                     </div>
-                    <Form.Item label="分组" style={{ flex: 1 }}>
+                    <Form.Item label="分组" style={{flex: 1}}>
                       <InputNumber
-                        style={{ width: 100 }}
+                        style={{width: 100}}
                         value={activeObject.group}
-                        onChange={(value) => this.updateElement(activeObjectIndex, { group: value || undefined })}
+                        onChange={(value) => this.updateElement(activeObjectIndex, {group: value || undefined})}
                       />
                     </Form.Item>
                   </Form>
@@ -704,100 +792,107 @@ export default class Edit extends React.PureComponent {
             }
 
             {
-              (activeObject.type === 'pic'||activeObject.type === 'mat') && (
+              (activeObject.type === 'pic' || activeObject.type === 'mat') && (
                 <div className={styles.box}>
                   <h2>
                     <span>{activeObject.type === 'pic' ? "图片" : "素材"}</span>
-                    <span style={{float:'right',fontSize:14}}>
-                      <span style={{marginRight:5}}>设置为母版</span>
-                      <Switch checked={activeObject.isTemplate||false}  onChange={(checked) => this.updateElement(activeObjectIndex, { isTemplate: checked })}/>
+                    <span style={{float: 'right', fontSize: 14}}>
+                      <span style={{marginRight: 5}}>设置为模板</span>
+                      <Switch checked={activeObject.isTemplate || false}
+                              onChange={(checked) => this.updateElement(activeObjectIndex, {isTemplate: checked})}/>
                     </span>
                   </h2>
                   <Form layout="vertical">
                     <Form.Item label="路径">
-                      <Input value={activeObject.content} onChange={(e) => this.updateElement(activeObjectIndex, { content: e.target.value })}/>
+                      <Input value={activeObject.content}
+                             onChange={(e) => this.updateElement(activeObjectIndex, {content: e.target.value})}/>
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="宽" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.w} onChange={(value) => this.updateElement(activeObjectIndex, { w: value })}/>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="宽" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.w}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {w: value})}/>
                       </Form.Item>
-                      <Form.Item label="高" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.h} onChange={(value) => this.updateElement(activeObjectIndex, { h: value })}/>
+                      <Form.Item label="高" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.h}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {h: value})}/>
                       </Form.Item>
                     </div>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="X偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dx} onChange={(value) => this.updateElement(activeObjectIndex, { dx: value })}/>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="X偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dx}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dx: value})}/>
                       </Form.Item>
-                      <Form.Item label="Y偏移" style={{ flex: 1 }}>
-                        <InputNumber style={{ width: 80 }} value={activeObject.dy} onChange={(value) => this.updateElement(activeObjectIndex, { dy: value })}/>
+                      <Form.Item label="Y偏移" style={{flex: 1}}>
+                        <InputNumber style={{width: 80}} value={activeObject.dy}
+                                     onChange={(value) => this.updateElement(activeObjectIndex, {dy: value})}/>
                       </Form.Item>
                     </div>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="圆形" style={{ flex: 1 }}>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="圆形" style={{flex: 1}}>
                         <Switch checked={(activeObject.round || '').toString() === 'true'} onChange={(checked) => {
                           if (checked) {
-                            this.updateElement(activeObjectIndex, { round: 'true' })
+                            this.updateElement(activeObjectIndex, {round: 'true'})
                           } else {
-                            this.updateElement(activeObjectIndex, { round: 'false' })
+                            this.updateElement(activeObjectIndex, {round: 'false'})
                           }
-                        }} checkedChildren="开" unCheckedChildren="关" />
+                        }} checkedChildren="开" unCheckedChildren="关"/>
                       </Form.Item>
-                      <Form.Item label="圆角" style={{ flex: 1 }}>
+                      <Form.Item label="圆角" style={{flex: 1}}>
                         <Input
                           placeholder="圆角半径"
-                          style={{ width: 100 }}
+                          style={{width: 100}}
                           value={activeObject.corner}
-                          onChange={(e) => this.updateElement(activeObjectIndex, { corner: e.target.value })}
+                          onChange={(e) => this.updateElement(activeObjectIndex, {corner: e.target.value})}
                         />
                       </Form.Item>
                     </div>
                     <Form.Item label="高斯模糊">
                       <Input
                         value={activeObject.gauss}
-                        onChange={(e) => this.updateElement(activeObjectIndex, { gauss: e.target.value })}
+                        onChange={(e) => this.updateElement(activeObjectIndex, {gauss: e.target.value})}
                       />
                     </Form.Item>
                     <Form.Item label="图片裁剪选项">
                       {activeObject.align}
-                      <Select value={activeObject.align} onChange={(value) => this.updateElement(activeObjectIndex, { align: value })}>
+                      <Select value={activeObject.align}
+                              onChange={(value) => this.updateElement(activeObjectIndex, {align: value})}>
                         <Option value="">为空不选</Option>
                         <Option value="vertical-align">垂直居中</Option>
                         <Option value="horizontal-align">水平居中</Option>
                         <Option value="both-align">垂直水平居中</Option>
                       </Select>
                     </Form.Item>
-                    <div style={{ display: 'flex' }}>
-                      <Form.Item label="固定位置" style={{ flex: 1 }}>
+                    <div style={{display: 'flex'}}>
+                      <Form.Item label="固定位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.fixed}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { fixed: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {fixed: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
-                      <Form.Item label="浮动位置" style={{ flex: 1 }}>
+                      <Form.Item label="浮动位置" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.relative}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { relative: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {relative: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>
-                      {activeObject.type === 'pic' && <Form.Item label="使用原图" style={{ flex: 1 }}>
+                      {activeObject.type === 'pic' && <Form.Item label="使用原图" style={{flex: 1}}>
                         <Switch
                           checked={activeObject.original}
-                          onChange={(checked) => this.updateElement(activeObjectIndex, { original: checked })}
+                          onChange={(checked) => this.updateElement(activeObjectIndex, {original: checked})}
                           checkedChildren="开"
                           unCheckedChildren="关"
                         />
                       </Form.Item>}
                     </div>
-                    <Form.Item label="分组" style={{ flex: 1 }}>
+                    <Form.Item label="分组" style={{flex: 1}}>
                       <InputNumber
-                        style={{ width: 100 }}
+                        style={{width: 100}}
                         value={activeObject.group}
-                        onChange={(value) => this.updateElement(activeObjectIndex, { group: value || undefined })}
+                        onChange={(value) => this.updateElement(activeObjectIndex, {group: value || undefined})}
                       />
                     </Form.Item>
                   </Form>
@@ -810,17 +905,20 @@ export default class Edit extends React.PureComponent {
           title="重命名"
           visible={this.state.visible}
           onOk={() => {
-            this.updateElement(this.state.editIndex, { [(this.state.editType === 'pic'||this.state.editType === 'mat') ? 'path' : 't']: '#' + this.state.editName + '#' })
-            this.setState({ visible: false })
+            this.updateElement(this.state.editIndex, {[(this.state.editType === 'pic' || this.state.editType === 'mat') ? 'path' : 't']: '#' + this.state.editName + '#'})
+            this.setState({visible: false})
           }}
-          onCancel={() => this.setState({ visible: false })}
+          onCancel={() => this.setState({visible: false})}
         >
-          <Input value={this.state.editName.replace(/#/g, '')} onChange={e => this.setState({ editName: e.target.value })} />
+          <Input value={this.state.editName.replace(/#/g, '')}
+                 onChange={e => this.setState({editName: e.target.value})}/>
         </Modal>
         <ImagePreview
           images={imgs}
           visible={previwVisible}
-          onClose={() => { this.setState({ previwVisible: false }) }}
+          onClose={() => {
+            this.setState({previwVisible: false})
+          }}
         />
       </div>
     )

+ 7 - 6
src/pages/poster/edit/service.js

@@ -1,25 +1,26 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
-import { dc } from '@/conf/config'
+import {fetchApi, fetchApiGet as fetchApiGet} from '@/apis'
+import {dc} from '@/conf/config'
 
 // 新增海报模版
-export async function create (params) {
+export async function create(params) {
   const url = `${dc}/api/poster/create`
   return fetchApi(url, params)
 }
+
 // 海报详情
-export async function fetchDetail (params) {
+export async function fetchDetail(params) {
   const url = `${dc}/api/poster/detail`
   return fetchApiGet(url, params)
 }
 
 // 海报编辑
-export async function update (params) {
+export async function update(params) {
   const url = `${dc}/api/poster/update`
   return fetchApi(url, params)
 }
 
 // 字体列表
-export async function fontList (params) {
+export async function fontList(params) {
   const url = `${dc}/api/poster/font-list`
   return fetchApiGet(url, params)
 }

+ 1 - 1
src/pages/poster/list/components/JsonExport/service.js

@@ -1,4 +1,4 @@
-import {  fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApiGet } from '@/apis'
 import { dc } from '@/conf/config'
 
 // export async function batchbindrole(params) {

+ 1 - 1
src/pages/poster/list/components/JsonImport/index.js

@@ -10,7 +10,7 @@ export default function JsonImport({ refresh }) {
   const { TextArea } = Input;
 
   const onExportPower2JsonModalCancel = () => {
-    setAreaChange();
+    setAreaChange('');
     setvisible(false);
   };
 

+ 4 - 6
src/pages/poster/list/components/JsonImport/service.js

@@ -1,12 +1,10 @@
-import { fetchApi } from '@/apis/'
-import { dc } from '@/conf/config'
-
-
+import {fetchApi} from '@/apis'
+import {dc} from '@/conf/config'
 
 
 // 提交json
-export async function subJsonService (params) {
+export async function subJsonService(params) {
   const url = `${dc}/api/poster/create`
-  console.log(fetchApi,'fetchApi');
+  console.log(fetchApi, 'fetchApi');
   return fetchApi(url, params)
 }

+ 2 - 2
src/pages/poster/list/index.js

@@ -9,7 +9,7 @@ import { routerRedux } from 'dva/router'
 import ConfigModal from './components/ConfigModal'
 import CopyTemplateModal from './components/CopyTemplateModal'
 import { dc } from '@/conf/config'
-import { fetchApi_get } from '@/apis/'
+import { fetchApiGet } from '@/apis'
 import ExportPower from './components/JsonExport'
 import ImportPower from './components/JsonImport'
 import { delTemplateAction, changePosterState } from './services'
@@ -250,7 +250,7 @@ class Poster extends Component {
     return (
       <div className={styles.poster}>
         <FilterTable
-          fetchApi={fetchApi_get}
+          fetchApi={fetchApiGet}
           tableSetting={tableSettingConfig}
           filterSetting={filterSettingConfig}
           apiUrl={apiUrl}

+ 1 - 1
src/pages/poster/list/services.js

@@ -1,4 +1,4 @@
-import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { fetchApi, fetchApiGet } from '@/apis'
 import { dc } from '@/conf/config'
 
 // 获取配置属性信息

+ 5 - 0
yarn.lock

@@ -10863,6 +10863,11 @@ moment@2.x, moment@^2.22.1, moment@^2.24.0:
   resolved "http://npm.wpt.la/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
   integrity sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s=
 
+moment@^2.29.1:
+  version "2.29.1"
+  resolved "http://npm.wpt.la/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+  integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
+
 moo@^0.4.3:
   version "0.4.3"
   resolved "http://npm.wpt.la/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"