diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..9f1330c --- /dev/null +++ b/readme.md @@ -0,0 +1,28 @@ +下载安装依赖: + npm install + +启动项目: + npm start + +文件结构: + config - Webpack配置 + + node_modules - 依赖 + + public - 静态公共文件 + + src - 逻辑代码 + assets - 静态资源 + style - css + general.css - 全局css样式 + editReport.css - Manager > 服务 > 编辑报告 css样式 + SourceHanSansK-Normal.ttf - 字体 + svg - 静态图片 + + components - 公共组件 + + api - 封装axios请求 + + + + page - 页面 \ No newline at end of file diff --git a/src/assets/sass/_variable.scss b/src/assets/sass/_variable.scss deleted file mode 100644 index 3b15840..0000000 --- a/src/assets/sass/_variable.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin flex($wrap) { - display: flex; - justify-content: center; - align-items: center; - flex-wrap: $wrap; -} \ No newline at end of file diff --git a/src/assets/svg/排序,升序.svg b/src/assets/svg/排序,升序.svg new file mode 100644 index 0000000..6af31b1 --- /dev/null +++ b/src/assets/svg/排序,升序.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svg/排序,降序.svg b/src/assets/svg/排序,降序.svg new file mode 100644 index 0000000..476db15 --- /dev/null +++ b/src/assets/svg/排序,降序.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/index.js b/src/index.js index c24fb78..df2ad8c 100644 --- a/src/index.js +++ b/src/index.js @@ -2,8 +2,5 @@ import React from 'react' import ReactDOM from 'react-dom' import App from './App' import './assets/style/general.css' -import api from './api/request' - -React.$axios = api ReactDOM.render(, document.getElementById('root')) \ No newline at end of file diff --git a/src/pages/home/branch/manage/company/company.js b/src/pages/home/branch/manage/company/company.js index 5648bfa..632223a 100644 --- a/src/pages/home/branch/manage/company/company.js +++ b/src/pages/home/branch/manage/company/company.js @@ -1,24 +1,19 @@ import React, { Component } from 'react' -import { Input, Select, Row, Form, Button } from 'antd' -import FeTable from '@/components/table' +import { Input, Select, Row, Form, Button, Card, Col, Pagination, Descriptions, Image } from 'antd' import api from "@/api/request" import { connect } from 'react-redux'; import store from "@/store/index" import { operationAction } from "@/action/index" +import sortUp from "@/assets/svg/排序,升序.svg" +import sortDown from "@/assets/svg/排序,降序.svg" const { Option } = Select -var status = { - name: '', - sort: '' -} - class ManageCompany extends Component { constructor(props) { super(props) this.state = { data: [], - columns: [], total: 0, form: { search: {}, @@ -50,28 +45,15 @@ class ManageCompany extends Component { onSubmit = () => { api.post("/admin/company/search", this.state.form).then(res => { if (res.result.records.length !== 0) { - const col = Object.keys(res.result.records[0]).map((key, i) => { - return { - title: key, dataIndex: key, align: 'center', key: i, sorter: (a, b, c) => { this.sort(c, key) }, - } - }) - col.push({ - title: '详 情', - dataIndex: '详 情', - key: col.length, - align: 'center', - render: () => 详 情 - }) this.setState({ data: res.result.records, total: res.result.total, - columns: col }) } else { this.setState({ data: [], total: 0, - columns: [] + }) } }).catch(err => { @@ -79,38 +61,37 @@ class ManageCompany extends Component { }) } - sort = (c, item) => { - if (status.name === item && status.sort === c) { - return false + callback(value) { + const newPanes = [...this.props.panes] + const state = newPanes.every(item => { + return item.title === value["企业名称"] ? false : true + }) + if (state) { + newPanes.push({ title: value["企业名称"], content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString(), id: { cid: value["企业ID"] } }); + store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key))) } else { - status = { - name: item, - sort: c - } - this.setState({ - form: Object.assign(this.state.form, { - sort: { [item]: c === 'ascend' ? 'asc' : 'desc' } - }) - }, () => { - this.onSubmit() - }) + return null } } - callback(e, value) { - if (e === '详 情') { - const newPanes = [...this.props.panes] - const state = newPanes.every(item => { - return item.title === value["企业名称"]? false : true + setSortUp(name,value){ + this.setState({ + form: Object.assign(this.state.form, { + sort: { [name]:value } }) - if (state) { - newPanes.push({ title: value["企业名称"], content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString(), id: { cid: value["企业ID"] } }); - store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key))) - } else { - return null - } - } + }, () => { + this.onSubmit() + }) + } + setSortDown(name,value){ + this.setState({ + form: Object.assign(this.state.form, { + sort: { [name]:value } + }) + }, () => { + this.onSubmit() + }) } pageChange = (current, pageSize) => { @@ -142,15 +123,27 @@ class ManageCompany extends Component {
- + + + + + - + + + + + - + + + + + - + + + + + - - + + + +
- + + {this.state.data.map(item => { + return + + + {item["一级行业"]} + {item["企业ID"]} + {item["信用等级"] ? item["信用等级"] : "-"} + {item["ESG等级"] ? item["ESG等级"] : "-"} + + + + })} + + ) } diff --git a/src/pages/home/branch/manage/rate/branch/rateProcess.js b/src/pages/home/branch/manage/rate/branch/rateProcess.js index 1a0310b..8ab1544 100644 --- a/src/pages/home/branch/manage/rate/branch/rateProcess.js +++ b/src/pages/home/branch/manage/rate/branch/rateProcess.js @@ -18,7 +18,7 @@ function RateProcess1(props) { .then(res => { let count = 1 const nodes = [] - const edges = [ + const edges_1 = [ { "id": "e1-2", "source": "1", @@ -92,13 +92,57 @@ function RateProcess1(props) { "animated": true } ] + const edges_2 = [ + { + "id": "e1-2", + "source": "1", + "target": "2", + "animated": true + }, + { + "id": "e1-3", + "source": "1", + "target": "3", + "animated": true + }, + { + "id": "e2-4", + "source": "2", + "target": "4", + "animated": true + }, + { + "id": "e3-4", + "source": "3", + "target": "4", + "animated": true + }, + { + "id": "e4-5", + "source": "4", + "target": "5", + "animated": true + }, + { + "id": "e5-6", + "source": "5", + "target": "6", + "animated": true + }, + { + "id": "e6-7", + "source": "6", + "target": "7", + "animated": true + }, + ] res.info.forEach((item, index) => { Object.keys(item).forEach((key, i) => { nodes.push({ id: count.toString(), data: { label: key }, type: index === 0 ? "input" : index === res.info.length - 1 ? "output" : "default", - position: { x: (i+1) * 200, y: (index + 1) * 100 }, + position: { x: (i + 1) * 200, y: (index + 1) * 100 }, style: item[key] === 1 ? { background: '#87d068', color: '#fff', @@ -115,12 +159,16 @@ function RateProcess1(props) { }) }) setNodes(nodes) - setEdges(edges) + if (props.value.type === "ESG评价流程") { + setEdges(edges_2) + } else { + setEdges(edges_1) + } }) }, [props.value]) return ( -
+
{ api.post("/admin/rating/search", { query: value, skip: 0, limit: 10 }).then(res => { const col = Object.keys(res.result[0]).map((key, i) => { diff --git a/src/pages/home/branch/test/company.js b/src/pages/home/branch/test/company.js index e1892b5..2ccca11 100644 --- a/src/pages/home/branch/test/company.js +++ b/src/pages/home/branch/test/company.js @@ -13,11 +13,11 @@ class TestCompany extends Component { super(props) this.state = { data: [ - { title: "企业认证", desc: "根据企业名称、统一社会信用代码、法人姓名进行企业认证", obj: { company: "", code: "", legal_person: "", cid: "" }, label: ["企业名称", "统一社会信用代码", "法人姓名", "企业ID"], url: "/admin/test/enterprise_certification", method: 'post' }, - { title: "级联删除企业ID", desc: "根据cid,删除与其有关的所有记录", obj: { cid: "", data: [] }, label: ["企业ID", "企业数据"], url: "/admin/test/delete_cid_cascade", method: 'post' }, - { title: "级联删除评价ID", desc: "根据rid,删除与其有关的所有记录", obj: { rid: "", record: "", data: [] }, label: ["评价ID", "评价类型", "评价记录"], url: "/admin/test/delete_rid_cascade", method: 'post' }, - { title: "企业认证状态修改", desc: "修改企业认证状态,只能修改为未认证,如需认证则通过认证接口", obj: { cid: "" }, label: ["企业ID"], url: "/admin/test/change_verified", method: 'get' }, - { title: "级联生成企业主页", desc: "根据rid,生成企业主页信息", obj: { rid: "", types: "" }, label: ["评价ID", "评价类型"], url: "/admin/test/generate_rid_information", method: 'post' }, + // { title: "企业认证", desc: "根据企业名称、统一社会信用代码、法人姓名进行企业认证", obj: { company: "", code: "", legal_person: "", cid: "" }, label: ["企业名称", "统一社会信用代码", "法人姓名", "企业ID"], url: "/admin/test/enterprise_certification", method: 'post' }, + // { title: "级联删除企业ID", desc: "根据cid,删除与其有关的所有记录", obj: { cid: "", data: [] }, label: ["企业ID", "企业数据"], url: "/admin/test/delete_cid_cascade", method: 'post' }, + // { title: "级联删除评价ID", desc: "根据rid,删除与其有关的所有记录", obj: { rid: "", record: "", data: [] }, label: ["评价ID", "评价类型", "评价记录"], url: "/admin/test/delete_rid_cascade", method: 'post' }, + // { title: "企业认证状态修改", desc: "修改企业认证状态,只能修改为未认证,如需认证则通过认证接口", obj: { cid: "" }, label: ["企业ID"], url: "/admin/test/change_verified", method: 'get' }, + // { title: "级联生成企业主页", desc: "根据rid,生成企业主页信息", obj: { rid: "", types: "" }, label: ["评价ID", "评价类型"], url: "/admin/test/generate_rid_information", method: 'post' }, { title: "新增测试企业", desc: "新增一家测试测试", obj: { email: "", company: "", code: "", legal_person: "" }, label: ["邮箱", "企业", "统一社会信用代码", "法人"], url: "/admin/test/new_company", method: 'post' }, ], setIsModalVisible: false, diff --git a/src/utils/rsaKey.js b/src/utils/rsaKey.js index b0dce59..5349175 100644 --- a/src/utils/rsaKey.js +++ b/src/utils/rsaKey.js @@ -1,5 +1,5 @@ import JSEncrypt from "jsencrypt"; - +// RSA加密 export function rsaKey(args) { var encryptor = new JSEncrypt() var pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxBnMmUNpreT9AJVkcAjfTLXb+2C2O8VYaFeOUPkMT+OzZfmS6DSg5WCH/MdZHbYh/rrOTUK2JfxLq9qzqjV4w7i/DNDnplnsRekrdi2qO5rTuutTLAE29b0hx83/xNbTn8yrMoTCLCjLOvcnuFQkcfCLNnCU7lhFWWhHheDd1NEznzuItfrqI10kzb+aIWUzBgVl6zxxlC9OH690LZd16q/cI+oBW286Xyl8MmKnjND4P9Y1cm2IRHikz6RLPgilL1iy/QXb4eQX+2oCcL8lvrQOCCMfKHpJdC7fwxbHxTiUlqeMVY4bXLwkUUl1wH2+DUkob/X9CAFPDow536iUywIDAQAB" diff --git a/src/utils/utils.js b/src/utils/utils.js index e067d87..8da3806 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1,4 +1,7 @@ +// 用于生成表格数据的column列数组对象 export function getColumn(params, slot) { + // 参数一:表格数据是否数组且长度不为0 + // 参数二:类插槽,填入DOM结构 return Array.isArray(params) && params.length !== 0 ? Object.keys(params[0]).map((key, index) => { return { title: key,