forked from ddrilling/asb_cloud_front
Merge branch 'dev' into feature/CF2-87-Archive-page-redesign
This commit is contained in:
commit
70a7812e81
159
package-lock.json
generated
159
package-lock.json
generated
@ -42,14 +42,32 @@
|
||||
}
|
||||
},
|
||||
"@apidevtools/json-schema-ref-parser": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.7.tgz",
|
||||
"integrity": "sha512-QdwOGF1+eeyFh+17v2Tz626WX0nucd1iKOm6JUTUvCZdbolblCOOQCxGrQPY0f7jEhn36PiAWqZnsC2r5vmUWg==",
|
||||
"version": "9.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
|
||||
"integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jsdevtools/ono": "^7.1.3",
|
||||
"@types/json-schema": "^7.0.6",
|
||||
"call-me-maybe": "^1.0.1",
|
||||
"js-yaml": "^3.13.1"
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||
"dev": true
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^2.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/code-frame": {
|
||||
@ -2416,9 +2434,9 @@
|
||||
"integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA=="
|
||||
},
|
||||
"@types/minimist": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
|
||||
"integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz",
|
||||
"integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
@ -7335,6 +7353,12 @@
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="
|
||||
},
|
||||
"globalyzer": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
||||
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"globby": {
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz",
|
||||
@ -7348,6 +7372,12 @@
|
||||
"slash": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"globrex": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
||||
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
|
||||
"dev": true
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.6",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
|
||||
@ -9891,12 +9921,12 @@
|
||||
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
|
||||
},
|
||||
"json-schema-ref-parser": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.7.tgz",
|
||||
"integrity": "sha512-uxU9Ix+MVszvCTvBucQiIcNEny3oAEFg7EQHSZw2bquCCuqUqEPEczIdv/Uqo1Zv4/wDPZqOI+ulrMk1ncMtjQ==",
|
||||
"version": "9.0.9",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
|
||||
"integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@apidevtools/json-schema-ref-parser": "9.0.7"
|
||||
"@apidevtools/json-schema-ref-parser": "9.0.9"
|
||||
}
|
||||
},
|
||||
"json-schema-traverse": {
|
||||
@ -10245,9 +10275,9 @@
|
||||
"integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8="
|
||||
},
|
||||
"map-obj": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.0.tgz",
|
||||
"integrity": "sha512-NAq0fCmZYGz9UFEQyndp7sisrow4GroyGeKluyKC/chuITZsPyOyC1UJZPJlVFImhXdROIP5xqouRLThT3BbpQ==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz",
|
||||
"integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==",
|
||||
"dev": true
|
||||
},
|
||||
"map-visit": {
|
||||
@ -10340,14 +10370,23 @@
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
|
||||
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"normalize-package-data": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz",
|
||||
"integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz",
|
||||
"integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hosted-git-info": "^4.0.1",
|
||||
"resolve": "^1.20.0",
|
||||
"is-core-module": "^2.5.0",
|
||||
"semver": "^7.3.4",
|
||||
"validate-npm-package-license": "^3.0.1"
|
||||
}
|
||||
@ -10365,8 +10404,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"hosted-git-info": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "",
|
||||
"version": "2.8.9",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
|
||||
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
||||
"dev": true
|
||||
},
|
||||
"normalize-package-data": {
|
||||
@ -10414,16 +10454,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
||||
@ -10440,9 +10470,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "20.2.7",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
|
||||
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@ -11184,16 +11214,18 @@
|
||||
}
|
||||
},
|
||||
"openapi-typescript": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-3.2.0.tgz",
|
||||
"integrity": "sha512-7tdJ5iL9dpk7/1njKp5Oh3Ue1uYoes5kv87JmYgH6fgC7EcrJxyp328SwQnQUg9+fF+nhMNYhZ4SJ0zK8z+Udg==",
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-3.4.1.tgz",
|
||||
"integrity": "sha512-d84pa1OLdL9lHByP9NdxGFfEnUxletlGbUZgsLl4WUb0I3izIMOr5JCJVLTOeBdOfgYkUI/+q2rhTkZK9bkGzA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"js-yaml": "^4.0.0",
|
||||
"kleur": "^4.1.3",
|
||||
"hosted-git-info": "^3.0.8",
|
||||
"js-yaml": "^4.1.0",
|
||||
"kleur": "^4.1.4",
|
||||
"meow": "^9.0.0",
|
||||
"mime": "^2.5.2",
|
||||
"prettier": "^2.2.1"
|
||||
"prettier": "^2.3.0",
|
||||
"tiny-glob": "^0.2.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"argparse": {
|
||||
@ -11202,10 +11234,19 @@
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||
"dev": true
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz",
|
||||
"integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
|
||||
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^2.0.1"
|
||||
@ -11218,9 +11259,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz",
|
||||
"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
|
||||
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@ -11253,9 +11294,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
|
||||
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^2.0.1"
|
||||
@ -12703,9 +12744,9 @@
|
||||
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz",
|
||||
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
|
||||
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
|
||||
"dev": true
|
||||
},
|
||||
"pretty-bytes": {
|
||||
@ -15655,6 +15696,16 @@
|
||||
"resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
|
||||
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q="
|
||||
},
|
||||
"tiny-glob": {
|
||||
"version": "0.2.9",
|
||||
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
||||
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"globalyzer": "0.1.0",
|
||||
"globrex": "^0.1.2"
|
||||
}
|
||||
},
|
||||
"tiny-invariant": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
|
||||
@ -15871,9 +15922,9 @@
|
||||
"integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw=="
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.13.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.3.tgz",
|
||||
"integrity": "sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig==",
|
||||
"version": "3.14.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.3.tgz",
|
||||
"integrity": "sha512-mic3aOdiq01DuSVx0TseaEzMIVqebMZ0Z3vaeDhFEh9bsc24hV1TFvN74reA2vs08D0ZWfNjAcJ3UbVLaBss+g==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
|
@ -27,12 +27,14 @@
|
||||
"start": "craco start",
|
||||
"build": "craco build",
|
||||
"test": "craco test",
|
||||
"update_openapi":"npx openapi -i http://127.0.0.1:5000/swagger/v1/swagger.json -o src/services/api",
|
||||
"update_openapi_server":"npx openapi -i http://192.168.1.70:5000/swagger/v1/swagger.json -o src/services/api",
|
||||
"react_start": "react-scripts start",
|
||||
"react_build": "react-scripts build",
|
||||
"react_test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"proxy": "http://192.168.1.70:5000",
|
||||
"proxy": "http://192.168.1.58:5000",
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
@ -53,7 +55,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^17.0.3",
|
||||
"openapi-typescript": "^3.2.0",
|
||||
"openapi-typescript": "^3.4.1",
|
||||
"openapi-typescript-codegen": "^0.9.3"
|
||||
}
|
||||
}
|
||||
|
25
src/components/Mark.jsx
Normal file
25
src/components/Mark.jsx
Normal file
@ -0,0 +1,25 @@
|
||||
import {Tooltip, Tag, Typography, Popconfirm, Button } from 'antd'
|
||||
import {UserView} from './UserView'
|
||||
|
||||
const markTypes = {
|
||||
0 : {color:"orange", text : "неизвестно"},
|
||||
1 : {color:"green", text : "согласовано"},
|
||||
}
|
||||
|
||||
const {Text} = Typography
|
||||
|
||||
export const Mark = ({mark, onDelete}) => {
|
||||
const markType = markTypes[mark.idMarkType]??markTypes[0]
|
||||
return <Tooltip title={<UserView user={mark.user}/>}>
|
||||
<Tag color={markType.color}>
|
||||
<Text delete={mark?.isDeleted}>
|
||||
{`${markType.text} ${new Date(mark.dateCreated).toLocaleString()}`}
|
||||
</Text>
|
||||
{(!mark?.isDeleted)&&
|
||||
<Popconfirm title="Отозвать согласование?" onConfirm={onDelete}>
|
||||
<Button type="link">x</Button>
|
||||
</Popconfirm>
|
||||
}
|
||||
</Tag >
|
||||
</Tooltip>
|
||||
}
|
@ -201,7 +201,7 @@ export const ChartTimeBase: React.FC<ChartTimeBaseProps> = ({options, dataParams
|
||||
let thisOptions = {}
|
||||
Object.assign(thisOptions, defaultOptions, options)
|
||||
|
||||
let newChart = new Chart(chartRef.current, {
|
||||
let newChart = new Chart(chartRef.current ?? "", {
|
||||
type: 'line',
|
||||
plugins: [ChartDataLabels],
|
||||
options: thisOptions,
|
||||
|
@ -17,7 +17,7 @@ const pageSize = 12
|
||||
const { RangePicker } = DatePicker
|
||||
const { Search } = Input
|
||||
|
||||
export default function DocumentsTemplate({ idCategory, idWell, accept, headerChild, onChange }) {
|
||||
export default function DocumentsTemplate({ idCategory, idWell, accept, headerChild, customColumns, beforeTable, onChange}) {
|
||||
const [page, setPage] = useState(1)
|
||||
const [filterDataRange, setFilterDataRange] = useState([])
|
||||
const [filterCompanyName, setFilterCompanyName] = useState([])
|
||||
@ -79,6 +79,7 @@ export default function DocumentsTemplate({ idCategory, idWell, accept, headerCh
|
||||
key: "company",
|
||||
render: (_, record) => <CompanyView company={record?.author?.company}/>
|
||||
},
|
||||
...(customColumns??[])
|
||||
]
|
||||
|
||||
const update = () => {
|
||||
@ -174,7 +175,7 @@ export default function DocumentsTemplate({ idCategory, idWell, accept, headerCh
|
||||
|
||||
{headerChild}
|
||||
</div>
|
||||
|
||||
{beforeTable}
|
||||
<EditableTable
|
||||
columns={columns}
|
||||
dataSource={files}
|
||||
|
@ -1,19 +1,24 @@
|
||||
import {Button, Tooltip} from 'antd'
|
||||
import {Popconfirm, Button, Tooltip, Typography} from 'antd'
|
||||
import { FileExcelOutlined } from '@ant-design/icons'
|
||||
import { useEffect, useState } from "react"
|
||||
import {invokeWebApiWrapperAsync, download} from '../../components/factory'
|
||||
import {invokeWebApiWrapperAsync, download, formatBytes} from '../../components/factory'
|
||||
import DocumentsTemplate from './DocumentsTemplate'
|
||||
import LoaderPortal from '../../components/LoaderPortal'
|
||||
import { Flex } from '../../components/Grid'
|
||||
import {DrillingProgramService, WellService} from '../../services/api'
|
||||
import {Mark} from '../../components/Mark'
|
||||
import {UserView} from '../../components/UserView'
|
||||
|
||||
const idFileCategoryDrillingProgramItems = 13;
|
||||
const {Text} = Typography
|
||||
|
||||
export default function DrillingProgram({idWell}) {
|
||||
const [downloadButtonEnabled, selDownloadButtonEnabled] = useState(false)
|
||||
const [showLoader, setShowLoader] = useState(false)
|
||||
const [tooltip, setTooltip] = useState('нет файлов для формирования')
|
||||
const [wellLabel, setWellLabel] = useState(`${idWell}`)
|
||||
const [childKey, setChildKey] = useState();
|
||||
const [lastUpdatedFile, setLastUpdatedFile] = useState();
|
||||
|
||||
useEffect(() => invokeWebApiWrapperAsync(
|
||||
async () => {
|
||||
@ -33,8 +38,11 @@ export default function DrillingProgram({idWell}) {
|
||||
"Не удалось загрузить программу бурения")
|
||||
|
||||
const openProgramPreview = () => invokeWebApiWrapperAsync(async()=>{
|
||||
const filWebUrl = await DrillingProgramService.getFileWebLink(idWell)
|
||||
window.open(filWebUrl, '_blank')
|
||||
const filWebUrl = await DrillingProgramService.getOrCreateSharedUrl(idWell)
|
||||
if(filWebUrl && filWebUrl.length > 0)
|
||||
window.open(filWebUrl, '_blank');
|
||||
else
|
||||
throw new Error("Сервер вернул плохую ссылку")
|
||||
},
|
||||
setShowLoader,
|
||||
"Не удалось создать быстрый просмотр программы")
|
||||
@ -46,13 +54,53 @@ export default function DrillingProgram({idWell}) {
|
||||
return
|
||||
}
|
||||
|
||||
if(files.every(fileInfo => fileInfo?.name.toLowerCase().endsWith('.xlsx'))){
|
||||
const isAllFilesAreExcel = files.every(fileInfo => fileInfo?.name.toLowerCase().endsWith('.xlsx'))
|
||||
const isAnyFileMarked = files.some(file => file?.fileMarks.some(m => m?.idMarkType === 1 && !m?.isDeleted))
|
||||
|
||||
if(isAllFilesAreExcel && isAnyFileMarked){
|
||||
setTooltip('Программа доступна для скачивания')
|
||||
selDownloadButtonEnabled(true)
|
||||
}
|
||||
else{
|
||||
setTooltip('Список файлов содержит недопустимые типы файлов')
|
||||
}
|
||||
const last = files.reduce((pre, cur) => pre.uploadDate > cur.uploadDate ? pre : cur)
|
||||
setLastUpdatedFile(last);
|
||||
}
|
||||
|
||||
const customColumns = [
|
||||
{
|
||||
title: "Метки",
|
||||
key: "fileMarks",
|
||||
render: (_, record) => renderMarksColumn(record?.id, record?.fileMarks)
|
||||
},
|
||||
]
|
||||
|
||||
const renderMarksColumn=(idFile, marks)=>{
|
||||
const validMarks = marks?.filter(m => !(m?.isDeleted))
|
||||
if(validMarks?.length)
|
||||
return validMarks.map(mark => <Mark mark = {mark} onDelete={() => deleteMark(mark.id)}/>)
|
||||
|
||||
return true &&
|
||||
<Popconfirm title="Согласовать файл?" onConfirm={() => addMarkToFile(idFile)}>
|
||||
<Button type="link">Согласовать</Button>
|
||||
</Popconfirm>
|
||||
}
|
||||
|
||||
const addMarkToFile = async (idFile) => {
|
||||
const mark = {
|
||||
idFile: idFile,
|
||||
idMarkType: 1,
|
||||
isDeleted:false,
|
||||
comment: ''}
|
||||
await DrillingProgramService.createFileMark(idWell, mark)
|
||||
selDownloadButtonEnabled(true)
|
||||
setChildKey(Date.now())
|
||||
}
|
||||
|
||||
const deleteMark = async (idMark) => {
|
||||
await DrillingProgramService.deleteFileMark(idWell, idMark)
|
||||
setChildKey(Date.now())
|
||||
}
|
||||
|
||||
const downloadButton = <div>
|
||||
@ -66,32 +114,40 @@ export default function DrillingProgram({idWell}) {
|
||||
Сформировать и скачать
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title={tooltip}>
|
||||
<Tooltip title="Просмотреть через GoogleDrive">
|
||||
<Popconfirm
|
||||
title="Загрузить файл на GoogleDrive для просмотра?"
|
||||
onConfirm={openProgramPreview}
|
||||
disabled={!downloadButtonEnabled}>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={downloadProgram}
|
||||
disabled={!downloadButtonEnabled}>
|
||||
<FileExcelOutlined />
|
||||
Программа бурения {wellLabel}.xlsx
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="Перед просмотром программы бурения сначала сформируйте ее.">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={openProgramPreview}
|
||||
disabled={!downloadButtonEnabled}>
|
||||
Сформировать и просмотреть
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Tooltip>
|
||||
</Flex>
|
||||
</div>
|
||||
|
||||
const lastUpdatedFileView = lastUpdatedFile &&
|
||||
<Text type="secondary">
|
||||
<b>Последнее изменние:</b>
|
||||
"{lastUpdatedFile.name}"
|
||||
[{formatBytes(lastUpdatedFile.size)}]
|
||||
загружен: {new Date(lastUpdatedFile.uploadDate).toLocaleString()}
|
||||
автор: <UserView user={lastUpdatedFile.author}/>
|
||||
</Text>
|
||||
|
||||
return(<LoaderPortal show={showLoader}>
|
||||
<DocumentsTemplate
|
||||
beforeTable={lastUpdatedFileView}
|
||||
idWell={idWell}
|
||||
idCategory={idFileCategoryDrillingProgramItems}
|
||||
accept='.xlsx'
|
||||
headerChild={downloadButton}
|
||||
onChange={filesUpdated} />
|
||||
onChange={filesUpdated}
|
||||
customColumns = {customColumns}
|
||||
key = {childKey}/>
|
||||
</LoaderPortal>)
|
||||
}
|
@ -17,6 +17,7 @@ export type { DrillParamsDto } from './models/DrillParamsDto';
|
||||
export type { EventDto } from './models/EventDto';
|
||||
export type { FileInfoDto } from './models/FileInfoDto';
|
||||
export type { FileInfoDtoPaginationContainer } from './models/FileInfoDtoPaginationContainer';
|
||||
export type { FileMarkDto } from './models/FileMarkDto';
|
||||
export type { FilePublishInfoDto } from './models/FilePublishInfoDto';
|
||||
export type { MeasureDto } from './models/MeasureDto';
|
||||
export type { MessageDto } from './models/MessageDto';
|
||||
@ -69,6 +70,7 @@ export { FileService } from './services/FileService';
|
||||
export { MeasureService } from './services/MeasureService';
|
||||
export { MessageService } from './services/MessageService';
|
||||
export { ReportService } from './services/ReportService';
|
||||
export { RequerstTrackerService } from './services/RequerstTrackerService';
|
||||
export { TelemetryAnalyticsService } from './services/TelemetryAnalyticsService';
|
||||
export { TelemetryDataSaubService } from './services/TelemetryDataSaubService';
|
||||
export { TelemetryDataSpinService } from './services/TelemetryDataSpinService';
|
||||
|
@ -2,6 +2,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { FileMarkDto } from './FileMarkDto';
|
||||
import type { FilePublishInfoDto } from './FilePublishInfoDto';
|
||||
import type { UserDto } from './UserDto';
|
||||
|
||||
@ -15,4 +16,5 @@ export type FileInfoDto = {
|
||||
size?: number;
|
||||
publishInfo?: FilePublishInfoDto;
|
||||
author?: UserDto;
|
||||
fileMarks?: Array<FileMarkDto> | null;
|
||||
}
|
||||
|
15
src/services/api/models/FileMarkDto.ts
Normal file
15
src/services/api/models/FileMarkDto.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { UserDto } from './UserDto';
|
||||
|
||||
export type FileMarkDto = {
|
||||
id?: number;
|
||||
idFile?: number;
|
||||
idMarkType?: number;
|
||||
dateCreated?: string;
|
||||
comment?: string | null;
|
||||
isDeleted?: boolean;
|
||||
user?: UserDto;
|
||||
}
|
@ -3,10 +3,9 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export type TelemetryDataSaubDto = {
|
||||
id?: number;
|
||||
idTelemetry?: number;
|
||||
date?: string;
|
||||
mode?: number | null;
|
||||
idTelemetry?: number;
|
||||
user?: string | null;
|
||||
wellDepth?: number | null;
|
||||
bitDepth?: number | null;
|
||||
|
@ -3,7 +3,6 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export type TelemetryDataSpinDto = {
|
||||
id?: number;
|
||||
idTelemetry?: number;
|
||||
date?: string;
|
||||
topDriveSpeed?: number | null;
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { FileMarkDto } from '../models/FileMarkDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class DrillingProgramService {
|
||||
@ -22,12 +23,12 @@ export class DrillingProgramService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает ссылку на файл программы бурения в облаке
|
||||
* Создает программу бурения
|
||||
* @param idWell id скважины
|
||||
* @returns string Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getFileWebLink(
|
||||
public static async getOrCreateSharedUrl(
|
||||
idWell: number,
|
||||
): Promise<string> {
|
||||
const result = await __request({
|
||||
@ -37,4 +38,44 @@ export class DrillingProgramService {
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Создает метку для файла входящего в проргамму бурения
|
||||
* @param idWell id скважины
|
||||
* @param requestBody метка файла
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async createFileMark(
|
||||
idWell: number,
|
||||
requestBody?: FileMarkDto,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/well/${idWell}/drillingProgram/fileMark`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Помечает метку у файла входящего, в проргамму бурения, как удаленную
|
||||
* @param idWell id скважины
|
||||
* @param idMark id метки
|
||||
* @returns number Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async deleteFileMark(
|
||||
idWell: number,
|
||||
idMark?: number,
|
||||
): Promise<number> {
|
||||
const result = await __request({
|
||||
method: 'DELETE',
|
||||
path: `/api/well/${idWell}/drillingProgram/fileMark`,
|
||||
query: {
|
||||
'idMark': idMark,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { FileInfoDto } from '../models/FileInfoDto';
|
||||
import type { FileInfoDtoPaginationContainer } from '../models/FileInfoDtoPaginationContainer';
|
||||
import type { FileMarkDto } from '../models/FileMarkDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class FileService {
|
||||
@ -70,24 +70,6 @@ export class FileService {
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает информацию о файлах для скважины в выбраной категории
|
||||
* @param idWell id скважины
|
||||
* @param idCategory id категории файла
|
||||
* @returns FileInfoDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getInfosByCategory(
|
||||
idWell: number,
|
||||
idCategory: number,
|
||||
): Promise<Array<FileInfoDto>> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${idWell}/files/category/${idCategory}`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает файл с диска на сервере
|
||||
* @param idWell id скважины
|
||||
@ -124,4 +106,44 @@ export class FileService {
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Создает метку для файла
|
||||
* @param idWell id скважины
|
||||
* @param requestBody метка файла
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async createFileMark(
|
||||
idWell: number,
|
||||
requestBody?: FileMarkDto,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/well/${idWell}/files/fileMark`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Помечает метку у файла как удаленную
|
||||
* @param idWell id скважины
|
||||
* @param idMark id метки
|
||||
* @returns number Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async deleteFileMark(
|
||||
idWell: number,
|
||||
idMark?: number,
|
||||
): Promise<number> {
|
||||
const result = await __request({
|
||||
method: 'DELETE',
|
||||
path: `/api/well/${idWell}/files/fileMark`,
|
||||
query: {
|
||||
'idMark': idMark,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
98
src/services/api/services/RequerstTrackerService.ts
Normal file
98
src/services/api/services/RequerstTrackerService.ts
Normal file
@ -0,0 +1,98 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class RequerstTrackerService {
|
||||
|
||||
/**
|
||||
* @param take
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getAll(
|
||||
take: number = 512,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/RequerstTracker`,
|
||||
query: {
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param take
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getFast(
|
||||
take: number = 512,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/RequerstTracker/fast`,
|
||||
query: {
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param take
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getSlow(
|
||||
take: number = 512,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/RequerstTracker/slow`,
|
||||
query: {
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param take
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getError(
|
||||
take: number = 512,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/RequerstTracker/error`,
|
||||
query: {
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param take
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getUsersStat(
|
||||
take: number = 512,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/RequerstTracker/users`,
|
||||
query: {
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user