This commit is contained in:
Cc 2024-09-26 14:04:18 +08:00
parent cf2a3e75af
commit 4eaa07d011
394 changed files with 66879 additions and 0 deletions

3
.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

7
.eslintignore Normal file
View File

@ -0,0 +1,7 @@
src/assets
src/icons
public
dist
node_modules
mock
src/common/ckeditor

37
.eslintrc.js Normal file
View File

@ -0,0 +1,37 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
globals: {
BMap: true,
T: true,
qq: true,
},
extends: [
'plugin:vue/vue3-essential',
'plugin:vue/recommended',
'eslint:recommended',
'@vue/prettier',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
'prettier/prettier': 'error',
'vue/no-multiple-template-root': 'off',
'vue/attribute-hyphenation': 'off',
'no-dupe-keys': 'off',
'vue/no-v-html': 'off',
},
};

16
.gitattributes vendored Normal file
View File

@ -0,0 +1,16 @@
*.html text eol=lf
*.css text eol=lf
*.js text eol=lf
*.scss text eol=lf
*.vue text eol=lf
*.hbs text eol=lf
*.sh text eol=lf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
.browserslistrc text eol=lf
.editorconfig text eol=lf
.eslintignore text eol=lf
.gitattributes text eol=lf
LICENSE text eol=lf
*.conf text eol=lf

40
.gitignore vendored Normal file
View File

@ -0,0 +1,40 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Lock files
yarn.lock
pnpm-lock.yaml
package-lock.json
# Yarn v2
.pnp.*
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
# VAB
public/video
*.zip
*.7z

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
ckeditor

3
.stylelintrc.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
extends: ['stylelint-config-recess-order', 'stylelint-config-prettier'],
};

57
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,57 @@
{
"editor.quickSuggestions": {
"strings": true
},
"workbench.colorTheme": "One Monokai",
"editor.tabSize": 2,
"editor.detectIndentation": false,
"emmet.triggerExpansionOnTab": true,
"editor.formatOnSave": true,
"javascript.format.enable": true,
"git.enableSmartCommit": true,
"git.autofetch": true,
"git.confirmSync": false,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"liveServer.settings.donotShowInfoMsg": true,
"explorer.confirmDelete": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"files.exclude": {
"**/.idea": true
},
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true,
"source.fixAll.eslint": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.suggest.snippetsPreventQuickSuggestions": false,
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.vueIndentScriptAndStyle": true,
"docthis.authorName": " Cc ",
"docthis.includeAuthorTag": true,
"docthis.includeDescriptionTag": true,
"docthis.enableHungarianNotationEvaluation": true,
"docthis.inferTypesFromNames": true,
"vetur.format.defaultFormatter.html": "prettier",
"files.autoSave": "off",
"path-intellisense.mappings": {
"@": "${workspaceRoot}/src"
},
"files.eol": "\n"
}

373
LICENSE Normal file
View File

@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
};

70
built.js Normal file
View File

@ -0,0 +1,70 @@
// cli.js,创建于根目录,与命令配置的./cli.js保持一致
const path = require("path");
const fs = require('fs');
const { NodeSSH } = require('node-ssh');
sshPublish();
async function sshPublish() {
let privateKeyPath = '';
const publishDir = '/www/wwwroot/ldhb/dist';
let remoteConfig = undefined;
privateKeyPath = '';
remoteConfig = {
host: '101.133.141.167',
username: 'root',
password: 'Jsld0813',
port: 22,
readyTimeout: 5000000,
};
// 初始化ssh
const ssh = new NodeSSH();
// 连接 服务器
await connect(ssh, remoteConfig, privateKeyPath);
console.log('连接成功');
console.log('开始文件上传!');
// 上传目录到服务器
await uploadDir(ssh, '/dist', publishDir);
console.log('文件上传成功!');
// 执行exit命令
const { stdout, stderr, code, signal } = await ssh.execCommand('exit');
ssh.dispose();
}
function connect(ssh, remoteConfig, privateKeyPath) {
return ssh.connect({
host: remoteConfig.host,
username: remoteConfig.username,
password: remoteConfig.password,
port: remoteConfig.port,
tryKeyboard: true,
// privateKey: fs.readFileSync(path.join(__dirname, privateKeyPath)).toString(),
// privateKey: path.join(__dirname, privateKeyPath),
onKeyboardInteractive: (name, instructions, instructionsLang, prompts, finish) => {
}
});
}
function uploadDir(ssh, localDir, publishDir) {
return ssh.putDirectory(path.join(__dirname, localDir), publishDir, {
recursive: true,
concurrency: 10,
// ^ WARNING: Not all servers support high concurrency
// try a bunch of values and see what works on your server
validate: function (itemPath) {
const baseName = path.basename(itemPath)
return baseName.substr(0, 1) !== '.' && // do not allow dot files
baseName !== 'node_modules' // do not allow node_modules
},
tick: function (localPath, remotePath, error) {
if(error){
console.log(localPath, remotePath, error || '');
} else{
console.log(localPath + ':成功上传');
}
}
});
}

17
deploy.sh Normal file
View File

@ -0,0 +1,17 @@
#强制推送
#!/usr/bin/env bash
set -e
npm run build
cd dist
touch .nojekyll
git init
git add -A
git commit -m 'deploy'
git push -f "https://${access_token}@gitee.com/chu1204505056/vue-admin-beautiful-element-plus.git" master:gh-pages
start "https://gitee.com/chu1204505056/vue-admin-beautiful-element-plus/pages"
cd -
exec /bin/bash

1
error.txt Normal file
View File

@ -0,0 +1 @@
compilation.hooks.buildModule.tap

12
jsconfig.json Normal file
View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "*.ignore.*"]
}

104
mock/controller/user.js Normal file
View File

@ -0,0 +1,104 @@
const tokens = {
admin: 'admin-token',
editor: 'editor-token',
test: 'test-token',
}
module.exports = [
{
url: '/publicKey',
type: 'get',
response() {
return {
code: 200,
msg: 'success',
data: {
mockServer: true,
publicKey:
'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBT2vr+dhZElF73FJ6xiP181txKWUSNLPQQlid6DUJhGAOZblluafIdLmnUyKE8mMHhT3R+Ib3ssZcJku6Hn72yHYj/qPkCGFv0eFo7G+GJfDIUeDyalBN0QsuiE/XzPHJBuJDfRArOiWvH0BXOv5kpeXSXM8yTt5Na1jAYSiQ/wIDAQAB',
},
}
},
},
{
url: '/login',
type: 'post',
response(config) {
const { username } = config.body
const token = tokens[username]
if (!token)
return {
code: 500,
msg: '帐户或密码不正确',
}
return {
code: 200,
msg: 'success',
data: { token },
}
},
},
{
url: '/socialLogin',
type: 'post',
response(config) {
const { code } = config.body
if (!code)
return {
code: 500,
msg: '未成功获取Token',
}
return {
code: 200,
msg: 'success',
data: { token: tokens['admin'] },
}
},
},
{
url: '/userInfo',
type: 'get',
response(config) {
const { token } = config.headers
let roles = ['admin']
let ability = ['READ']
let username = 'admin'
if ('admin-token' === token) {
roles = ['admin']
ability = ['READ', 'WRITE', 'DELETE']
username = 'admin'
}
if ('editor-token' === token) {
roles = ['editor']
ability = ['READ', 'WRITE']
username = 'editor'
}
if ('test-token' === token) {
roles = ['admin', 'editor']
ability = ['READ']
username = 'test'
}
return {
code: 200,
msg: 'success',
data: {
roles,
ability,
username,
avatar: 'https://i.gtimg.cn/club/item/face/img/2/16022_100.gif',
},
}
},
},
{
url: '/logout',
type: 'get',
response() {
return {
code: 200,
msg: 'success',
}
},
},
]

99
mock/index.js Normal file
View File

@ -0,0 +1,99 @@
const chokidar = require('chokidar')
const bodyParser = require('body-parser')
const chalk = require('chalk')
const path = require('path')
const { mock } = require('mockjs')
const { baseURL } = require('../src/config')
const mockDir = path.join(process.cwd(), 'mock')
const { handleMockArray } = require('./utils')
/**
*
* @param url
* @param type
* @param respond
* @returns {{response(*=, *=): void, type: (*|string), url: RegExp}}
*/
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`${baseURL}${url}`),
type: type || 'get',
response(req, res) {
res.status(200)
console.log(chalk.green(`\n> 请求地址:${req.path}`))
if (JSON.stringify(req.body) !== '{}')
console.log(
chalk.green(`> 请求参数(body)${JSON.stringify(req.body)}`)
)
if (JSON.stringify(req.query) !== '{}')
console.log(
chalk.green(`> 请求参数(query)${JSON.stringify(req.query)}`)
)
res.json(mock(respond instanceof Function ? respond(req, res) : respond))
},
}
}
/**
*
* @param app
* @returns {{mockStartIndex: number, mockRoutesLength: number}}
*/
const registerRoutes = (app) => {
let mockLastIndex
const mocks = []
const mockArray = handleMockArray()
mockArray.forEach((item) => {
const obj = require(item)
mocks.push(...obj)
})
const mocksForServer = mocks.map((route) =>
responseFake(route.url, route.type, route.response)
)
const mockRoutesLength = Object.keys(mocksForServer).length
for (const item of mocksForServer) {
app[item.type](item.url, item.response)
mockLastIndex = app._router.stack.length
}
return {
mockRoutesLength,
mockStartIndex: mockLastIndex - mockRoutesLength,
}
}
/**
*
* @param app
*/
module.exports = (app) => {
app.use(bodyParser.json())
app.use(
bodyParser.urlencoded({
extended: true,
})
)
const mockRoutes = registerRoutes(app)
let mockRoutesLength = mockRoutes.mockRoutesLength
let mockStartIndex = mockRoutes.mockStartIndex
chokidar
.watch(mockDir, {
ignored: /mock-server/,
ignoreInitial: true,
})
.on('all', (event) => {
if (event === 'change' || event === 'add') {
try {
app._router.stack.splice(mockStartIndex, mockRoutesLength)
Object.keys(require.cache).forEach((item) => {
if (item.includes(mockDir))
delete require.cache[require.resolve(item)]
})
const mockRoutes = registerRoutes(app)
mockRoutesLength = mockRoutes.mockRoutesLength
mockStartIndex = mockRoutes.mockStartIndex
} catch (error) {
console.log(chalk.red(error))
}
}
})
}

42
mock/utils/index.js Normal file
View File

@ -0,0 +1,42 @@
const { Random } = require('mockjs')
const { join } = require('path')
const fs = require('fs')
/**
* @description 随机生成图片url
* @param width
* @param height
* @returns {string}
*/
function handleRandomImage(width = 50, height = 50) {
return `https://picsum.photos/${width}/${height}?random=${Random.guid()}`
}
/**
* @description 处理所有 controller 模块npm run serve时在node环境中自动输出controller文件夹下Mock接口请勿修改
* @returns {[]}
*/
function handleMockArray() {
const mockArray = []
const getFiles = (jsonPath) => {
const jsonFiles = []
const findJsonFile = (path) => {
const files = fs.readdirSync(path)
files.forEach((item) => {
const fPath = join(path, item)
const stat = fs.statSync(fPath)
if (stat.isDirectory() === true) findJsonFile(item)
if (stat.isFile() === true) jsonFiles.push(item)
})
}
findJsonFile(jsonPath)
jsonFiles.forEach((item) => mockArray.push(`./controller/${item}`))
}
getFiles('mock/controller')
return mockArray
}
module.exports = {
handleRandomImage,
handleMockArray,
}

105
package.json Normal file
View File

@ -0,0 +1,105 @@
{
"name": "lidinghb",
"version": "1.0.0",
"author": "chuzhixin",
"license": "Mozilla Public License Version 2.0",
"private": true,
"participants": [
"fwfmiao"
],
"homepage": "https://chu1204505056.gitee.io/vue-admin-beautiful-element-plus",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build && node ./built.js",
"lint": "vue-cli-service lint",
"clear": "npm cache clean -f&&rimraf node_modules&&npm install --registry=https://registry.npm.taobao.org",
"use:npm": "nrm use npm",
"update": "ncu -u --reject eslint,sass,sass-loader,compression-webpack-plugin,filemanager-webpack-plugin --registry https://registry.npm.taobao.org&&npm install --registry=https://registry.npm.taobao.org&&cnpm i image-webpack-loader -D",
"use:taobao": "nrm use taobao",
"deploy": "start ./deploy.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chuzhixin/vue-admin-beautiful-element-plus.git"
},
"externals": {
"BMap": "BMap",
"map": "map",
"T": "T"
},
"dependencies": {
"@ckeditor/ckeditor5-alignment": "^36.0.1",
"@ckeditor/ckeditor5-build-classic": "^36.0.1",
"@ckeditor/ckeditor5-font": "^36.0.1",
"@ckeditor/ckeditor5-highlight": "^36.0.1",
"@ckeditor/ckeditor5-image": "^36.0.1",
"@ckeditor/ckeditor5-vue": "^4.0.1",
"@element-plus/icons": "^0.0.11",
"@tinymce/tinymce-vue": "^5.0.0",
"axios": "^0.21.1",
"clipboard": "^2.0.8",
"core-js": "^3.15.0",
"dayjs": "^1.10.5",
"echarts": "^5.4.0",
"element-plus": "1.0.2-beta.48",
"element-ui": "^2.15.9",
"ezuikit-js": "^0.6.3",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^3.0.0-rc.1",
"jsencrypt": "^3.2.0",
"lodash": "^4.17.21",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"qs": "^6.10.1",
"quill-image-drop-module": "^1.0.3",
"quill-image-resize-module": "^3.0.0",
"remixicon": "^2.5.0",
"screenfull": "^5.1.0",
"tinymce": "^6.3.2",
"vab-layouts": "^0.0.4",
"vue": "^3.0.4",
"vue-baidu-map": "^0.21.22",
"vue-echarts": "^6.0.0-rc.6",
"vue-quill-editor": "^3.0.6",
"vue-router": "^4.0.0-rc.6",
"vuex": "^4.0.0-rc.2",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.13",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-plugin-router": "^4.5.13",
"@vue/cli-plugin-vuex": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/compiler-sfc": "^3.1.1",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^11.0.0-beta.2",
"crypto-js": "^4.1.1",
"eslint": "^7.21.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.11.1",
"filemanager-webpack-plugin": "^4.0.0",
"lint-staged": "^11.0.0",
"prettier": "^2.3.1",
"sass": "^1.56.2",
"sass-loader": "^10.4.1",
"stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-recess-order": "^2.4.0",
"svg-sprite-loader": "^6.0.8",
"vab-config": "^0.0.8",
"vue-loader": "^15.10.0",
"vue-loader-v16": "^16.0.0-beta.5.4",
"webpackbar": "^5.0.2-3"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
"git add"
]
}
}

16
prettier.config.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'avoid',
htmlWhitespaceSensitivity: 'ignore',
vueIndentScriptAndStyle: false,
endOfLine: 'lf',
};

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

55
public/index.html Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
<link href="<%= BASE_URL %>favicon.ico" rel="icon" />
<title><%= VUE_APP_TITLE %></title>
<meta
content=""
name="keywords"
/>
<meta
content=""
name="description"
/>
<meta content="<%= VUE_APP_AUTHOR %>" name="author" />
<link href="<%= BASE_URL %>static/css/loading.css" rel="stylesheet" />
<style>
.BMap_cpyCtrl,
.anchorBL {
display: none;
}
</style>
<!-- <script-->
<!-- type="text/javascript"-->
<!-- src="http://api.map.baidu.com/api?v=3.0&ak=GtLdawsoHFdlkmqxypPL5ZgtyTE6eEyC"-->
<!-- ></script>-->
<!-- &lt;!&ndash; <script src="https://api.map.baidu.com/api?v=2.0&type=webgl&ak=GtLdawsoHFdlkmqxypPL5ZgtyTE6eEyC"></script>&ndash;&gt;-->
<script
src="http://api.tianditu.gov.cn/api?v=4.0&tk=2a0073fb7c3b0f0994c63e7a396d6ec1"
type="text/javascript"
></script>
<!-- <script-->
<!-- src="https://map.qq.com/api/gljs?v=1.exp&key=RQJBZ-6ZOCX-3QI4R-Z3JUH-GFDOS-YYBJ4"-->
<!-- ></script>-->
<!-- <script-->
<!-- charset="utf-8"-->
<!-- src="https://map.qq.com/api/js?v=2.exp&key=RQJBZ-6ZOCX-3QI4R-Z3JUH-GFDOS-YYBJ4"-->
<!-- ></script>-->
<script src="https://map.qq.com/api/js?v=2.exp&key=RQJBZ-6ZOCX-3QI4R-Z3JUH-GFDOS-YYBJ4">
</script>
</head>
<body>
<noscript>
非常抱歉鉴于安全考量,您无法查看<%= VUE_APP_TITLE %>
源代码该系统基于vue-admin-beautiful开发
</noscript>
<div id="vue-admin-beautiful-element-plus"></div>
<script>
var SecretKey = 'a6f06fa252c463b60f05b717d0e0f684';
</script>
</body>
</html>

3
src/App.vue Normal file
View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

121
src/api/alarm.js Normal file
View File

@ -0,0 +1,121 @@
import request from '@/utils/request';
import store from '@/store';
import { baseURL } from '@/config';
//分页查询报警记录
export function getAlarm(data) {
var param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.handlerName != '') {
param += '&handlerName=' + data.handlerName;
}
if (data.alarmLevel != '') {
param += '&alarmLevel=' + data.alarmLevel;
}
if (data.alarmCategory != '') {
param += '&alarmCategory=' + data.alarmCategory;
}
if (data.start != '' && data.end != '') {
param += '&start=' + data.start + '&end=' + data.end;
}
if (data.status != 3) {
param += '&status=' + data.status;
}
return request({
url: '/alarmRecord/listPage' + param,
method: 'get',
data,
});
}
//当前/实时报警查询
export function getCurrentData(data) {
var param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != undefined && data.projectId != '') {
param += '&projectId=' + data.projectId;
}
return request({
url: '/alarmRecord/current' + param,
method: 'get',
data,
});
}
//报警级别字典数据查询
export function alarmLevelDict(data) {
return request({
url: '/alarmRecord/alarmLevelDict',
method: 'get',
data,
});
}
//报警类别字典数据查询
export function alarmCategoryDict(data) {
return request({
url: '/alarmRecord/alarmCategoryDict',
method: 'get',
data,
});
}
//报警类别字典数据查询
export function doAdd(data) {
return request({
url: '/alarmRecord/insert?token=' + store.getters['user/token'],
method: 'post',
data,
});
}
//报警转工单
export function toTask(data) {
return request({
url: '/alarmRecord/toTask',
method: 'post',
data,
});
}
//处理人
export function handlers(data) {
return request({
url: '/task/handlers?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
//获取途强车辆设备列表
export function tqDevices(data) {
return request({
url: '/task/tqDevices?projectId=' + data.projectId,
method: 'get',
data,
});
}
//删除
export function doDelete(data) {
return request({
url: '/alarmRecord/remove',
method: 'post',
data,
});
}
//导出
export function alarmExport(data) {
var param = '?projectId=' + data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.handlerName != '') {
param += '&handlerName=' + data.handlerName;
}
if (data.alarmLevel != '') {
param += '&alarmLevel=' + data.alarmLevel;
}
if (data.alarmCategory != '') {
param += '&alarmCategory=' + data.alarmCategory;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return baseURL + 'alarmRecordReport/export' + param;
}

57
src/api/alarmuser.js Normal file
View File

@ -0,0 +1,57 @@
import request from '@/utils/request';
export function getList(data) {
return request({
url: '/alarmUser/list?page=' + data.page + '&size=' + data.size,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/alarmUser/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/alarmUser/remove?userId=' + data.userId,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/alarmUser/insert',
method: 'post',
data,
});
}
//根据用户id查询报警站点列表
export function alarmProjects(data) {
return request({
url: '/alarmUser/alarmProjectIds?userId=' + data.userId,
method: 'get',
data,
});
}
//查询所有项目
export function allProject(data) {
return request({
url: '/alarmUser/allProjects',
method: 'get',
data,
});
}
//将该用户添加到站点报警联系人中
export function assignToProjects(data) {
return request({
url: '/alarmUser/addProjects',
method: 'post',
data,
});
}

212
src/api/analysis.js Normal file
View File

@ -0,0 +1,212 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//日运行报表
export function dailyReport(data) {
return request({
url:
'/dataAnalysis/dailyReport?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId +
'&time=' +
data.time,
method: 'get',
data,
});
}
//周运行报表
export function weeklyReport(data) {
return request({
url:
'/dataAnalysis/weeklyReport?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId +
'&start=' +
data.start +
'&end=' +
data.end,
method: 'get',
data,
});
}
//日运行报表
export function monthlyReport(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.month != '') {
param += '&month=' + data.month;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return request({
url: '/waterElec/waterDay' + param,
method: 'get',
data,
});
}
//水量日报导出
export function exportDevice(data) {
let param = '?projectId=' + data.projectId + '&month=' + data.month;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return baseURL + '/waterElec/waterDayExport' + param;
}
//电量日报
export function elecDay(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.month != '') {
param += '&month=' + data.month;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return request({
url: '/waterElec/elecDay' + param,
method: 'get',
data,
});
}
//电量日报导出
export function elecDayExport(data) {
let param = '?projectId=' + data.projectId + '&month=' + data.month;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return baseURL + '/waterElec/elecDayExport' + param;
}
//站点月运行报表
export function deviceMonth(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.month != '') {
param += '&month=' + data.month;
}
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.projectName != '') {
param += '&projectName=' + data.projectName;
}
return request({
url: '/deviceReport/deviceMonth' + param,
method: 'get',
data,
});
}
//站点月运行导出
export function deviceMonthExport(data) {
let param = '?month=' + data.month;
if (data.projectName != '') {
param += '&projectName=' + data.projectName;
}
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
return baseURL + '/deviceReport/deviceMonth/export' + param;
}
//水量月报
export function waterMonth(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.year != '') {
param += '&year=' + data.year;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return request({
url: '/waterElec/waterMonth' + param,
method: 'get',
data,
});
}
//水量月报导出
export function waterMonthExport(data) {
let param = '?projectId=' + data.projectId + '&year=' + data.year;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return baseURL + '/waterElec/waterMonthExport' + param;
}
//电量月报
export function elecMonth(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.year != '') {
param += '&year=' + data.year;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return request({
url: '/waterElec/elecMonth' + param,
method: 'get',
data,
});
}
//电量月报导出
export function elecMonthExport(data) {
let param = '?projectId=' + data.projectId + '&year=' + data.year;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
return baseURL + '/waterElec/elecMonthExport' + param;
}
//查询工厂数据
export function haianList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.startTime) {
param += '&startTime=' + data.startTime;
param += '&endTime=' + data.endTime;
}
return request({
url: '/haian/list' + param,
method: 'get',
});
}
export function saveHian(data) {
return request({
url: '/haian/update',
method: 'post',
data,
});
}
export function addHian(data) {
return request({
url: '/haian/add',
method: 'post',
data,
});
}
export function delHian(data) {
return request({
url: '/haian/remove/' + data,
method: 'post',
});
}
export function HianDevice() {
return request({
url: '/haian/devices',
method: 'get',
});
}

9
src/api/api.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export function fileUpdate(data) {
return request({
url: '/upload/file',
method: 'post',
data,
});
}

73
src/api/apply.js Normal file
View File

@ -0,0 +1,73 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//水质申请分页查询
export function getWaterApply(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.signUser != '') {
param += '&signUser=' + data.signUser;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return request({
url: '/waterApply/list' + param,
method: 'get',
data,
});
}
//相关字典数据查询
export function getDictData(data) {
return request({
url: '/waterApply/dict',
method: 'get',
data,
});
}
//水质申请删除
export function doDelete(data) {
return request({
url: '/waterApply/remove',
method: 'post',
data,
});
}
//水质申请添加
export function doAdd(data) {
return request({
url: '/waterApply/add',
method: 'post',
data,
});
}
//水质申请修改
export function doEdit(data) {
return request({
url: '/waterApply/update',
method: 'post',
data,
});
}
//导出
export function exportWaterApply(data) {
var param = '?projectId=' + data.projectId;
if (data.signUser != '') {
param += '&signUser=' + data.signUser;
}
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return baseURL + 'waterApplyReport/export' + param;
}

9
src/api/city.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export function getCity(data) {
return request({
url: '/iot/project/getLayerSysArea',
method: 'get',
data,
});
}

73
src/api/clock.js Normal file
View File

@ -0,0 +1,73 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//打卡列表分页查询
export function getClockData(data) {
let param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.signUser != '') {
param += '&signUser=' + data.signUser;
}
if (data.start != '') {
param += '&start=' + data.start;
}
if (data.end != '') {
param += '&end=' + data.end;
}
if ((data.type != '' && data.type != 2) || data.type == 0) {
param += '&type=' + data.type;
}
return request({
url: '/sign/list' + param,
method: 'get',
data,
});
}
//修改打卡位置
export function doEdit(data) {
return request({
url: '/sign/updateLocation?id=' + data.id + '&location=' + data.location,
method: 'post',
data,
});
}
//打卡记录删除
export function doDelete(data) {
return request({
url: '/sign/remove',
method: 'post',
data,
});
}
//打卡记录导出
export function doExport(data) {
let param = '?projectId=' + data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.signUser != '') {
param += '&signUser=' + data.signUser;
}
if (data.start != undefined && data.end != undefined) {
param += '&start=' + data.start + '&end=' + data.end;
}
return baseURL + '/sign/export' + param;
}
// 运动轨迹
export function getTrajectory(data) {
const param =
'?userId=' + data.userId + '&start=' + data.start + '&end=' + data.end;
return request({
url: '/sign/trajectory' + param,
method: 'get',
data,
});
}

44
src/api/dept.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request';
// 部门列表
export function getDeptList(data) {
return request({
url: '/sysDept/list',
method: 'get',
data,
});
}
// 部门树状图
export function getDeptTreeList(data) {
return request({
url: '/sysDept/deptTree',
method: 'get',
data,
});
}
// 删除部门
export function doDeptDelete(data) {
return request({
url: '/sysDept/delete?deptId=' + data.deptId,
method: 'post',
data,
});
}
// 修改部门
export function doDeptEdit(data) {
return request({
url: '/sysDept/update',
method: 'post',
data,
});
}
// 新增部门
export function doDeptAdd(data) {
return request({
url: '/sysDept/add',
method: 'post',
data,
});
}

290
src/api/device.js Normal file
View File

@ -0,0 +1,290 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '' && data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
if (data.code != '' && data.code != undefined) {
param += '&code=' + data.code;
}
if (data.name != '' && data.name != undefined) {
param += '&name=' + data.name;
}
if (data.community != '' && data.community != undefined) {
param += '&community=' + data.community;
}
if (data.townCode != '' && data.townCode != undefined) {
param += '&townCode=' + data.townCode;
}
if (data.commPro != '' && data.commPro != undefined) {
param += '&commPro=' + data.commPro;
}
if (data.status != 3) {
param += '&status=' + data.status;
}
return request({
url: '/deviceReport/list' + param,
method: 'get',
data,
});
}
export function getDeviceData(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '' && data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
if (data.serial != '' && data.serial != undefined) {
param += '&serial=' + data.serial;
}
if (data.name != '' && data.name != undefined) {
param += '&name=' + data.name;
}
if (data.community != '' && data.community != undefined) {
param += '&community=' + data.community;
}
if (data.townCode != '' && data.townCode != undefined) {
param += '&townCode=' + data.townCode;
}
if (
data.commPro != '全部协议' &&
data.commPro != undefined &&
data.commPro != '全部'
) {
param += '&commPro=' + data.commPro;
}
if (data.status != 3 && data.status != undefined) {
param += '&status=' + data.status;
}
return request({
url: '/iot/device/select' + param,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/iot/device/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/iot/device/remove',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/iot/device/insert',
method: 'post',
data,
});
}
export function selectDeviceInfo(data) {
return request({
url: '/iot/device/selectDeviceInfo?deviceId=' + data.deviceId,
method: 'get',
data,
});
}
export function getDictData(data) {
return request({
url: '/iot/device/dict',
method: 'get',
data,
});
}
export function selectAllProject(data) {
return request({
url: '/iot/device/selectAllProject',
method: 'get',
data,
});
}
export function selectAllGroup(data) {
return request({
url: '/iot/device/selectAllGroup?projectId=' + data.projectId,
method: 'get',
data,
});
}
export function selectAllAlarmUser(data) {
return request({
url: '/iot/device/selectAllAlarmUser',
method: 'get',
data,
});
}
export function copy(data) {
return request({
url:
'/iot/device/copy?deviceId=' +
data.deviceId +
'&name=' +
data.name +
'&code=' +
data.code +
'&serial=' +
data.serial,
method: 'post',
data,
});
}
export function getLatestDataByDevice(data) {
let param =
'?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size;
if (data.sensorName != '') {
param += '&sensorName=' + data.sensorName;
}
return request({
url: '/deviceReport/latestData' + param,
method: 'get',
data,
});
}
export function getLatestData(data) {
const param =
'?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size;
return request({
url: '/deviceData/latestData' + param,
method: 'get',
data,
});
}
export function getLatestDataByDevices(data) {
const param = '?deviceCode=' + data.deviceCode + '&dataKey=' + data.dataKey;
return request({
url: '/deviceData/getLatestDataByDevice' + param,
method: 'get',
data,
});
}
export function getHistoryData(data) {
return request({
url:
'/deviceData/getHistoryData?dataKey=' +
data.dataKey +
'&start=' +
data.start +
'&deviceCode=' +
data.deviceCode +
'&end=' +
data.end,
method: 'get',
data,
});
}
export function getReportHistoryData(data) {
return request({
url:
'/deviceData/getHistoryChartData?dataKey=' +
data.dataKey +
'&start=' +
data.start +
'&deviceCode=' +
data.deviceCode +
'&end=' +
data.end,
method: 'get',
data,
});
}
//根据项目查询项目下的乡镇街道列表
export function getTownsByProject(data) {
return request({
url: '/iot/device/getTownsByProject?projectId=' + data.projectId,
method: 'get',
data,
});
}
//查询乡镇街道下的社区列表
export function getCommunitiesByTown(data) {
return request({
url: '/iot/device/getCommunitiesByTown?townCode=' + data.townCode,
method: 'get',
data,
});
}
//站点导出(运维)
export function exportDevice(data) {
var param = '?projectId=' + data.projectId;
return baseURL + '/deviceReport/exportDevice' + param;
}
//站点导出(物联平台)
export function exportIotDevice(data) {
var param = '?projectId=' + data.projectId;
return baseURL + '/iot/device/exportDevice' + param;
}
//最新数据导出
export function exportData(data) {
var param = '?deviceCode=' + data.deviceCode;
return baseURL + '/deviceReport/exportData' + param;
}
//最新数据导出(物联平台)
export function exportIotData(data) {
var param = '?deviceCode=' + data.deviceCode;
return baseURL + '/iot/device/exportData' + param;
}
//根据站点code查询传感器列表
export function sensors(data) {
return request({
url: '/deviceData/sensors?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
//获取盒子列表
export function boxList(data) {
return request({
url: '/fbox/boxList',
method: 'get',
data,
});
}
//盒子同步
export function fboxSync(data, projectId) {
return request({
url: '/fbox/sync?projectId=' + projectId,
method: 'post',
data,
});
}
//根据站点编号和传输id查询传感器信息
export function sensorInfo(data) {
var param = '?deviceCode=' + data.deviceCode + '&dataKey=' + data.dataKey;
return request({
url: '/deviceData/sensorInfo' + param,
method: 'get',
data,
});
}

103
src/api/download.js Normal file
View File

@ -0,0 +1,103 @@
import axios from 'axios';
import store from '@/store';
const ajax = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
timeout: 100000,
});
const token = store.getters['user/token'];
ajax.interceptors.request.use(
config => {
config.headers = {
token: token,
// OrgId: auth.getUser().orgId,
// UserId: auth.getUser().id,
};
return config;
},
err => {
return Promise.reject(err);
}
);
const downloadFile = async (url, options) => {
await ajax
.get(url, { responseType: 'arraybuffer' })
.then(resp => download(resp, options));
};
const downloadPostFile = async (url, options) => {
await ajax
.post(url, { responseType: 'arraybuffer' })
.then(resp => download(resp, options));
};
const getFile = async (url, options) => {
await ajax
.get(url, { responseType: 'blob' })
.then(resp => download(resp, options));
};
const download = (resp, options) => {
const blob = new Blob([resp.data], {
type: options.fileType ? options.fileType : 'application/octet-binary',
});
//创建下载的链接
const href = window.URL.createObjectURL(blob);
downloadBlob(href, options.fileName);
};
const downloadBlob = (blobUrl, fileName, revokeObjectURL) => {
const downloadElement = document.createElement('a');
downloadElement.href = blobUrl;
//下载后文件名
downloadElement.download = fileName;
document.body.appendChild(downloadElement);
//点击下载
downloadElement.click();
//下载完成移除元素
document.body.removeChild(downloadElement);
if (revokeObjectURL == null || revokeObjectURL) {
//释放掉blob对象
window.URL.revokeObjectURL(blobUrl);
}
};
const getDownloadFileUrl = async (url, fileType) => {
let blob;
await ajax.get(url, { responseType: 'blob' }).then(resp => {
blob = new Blob([resp.data], {
type: fileType ? fileType : 'application/octet-binary',
});
});
return window.URL.createObjectURL(blob);
};
const getDownloadFileUrlByPost = async (url, data, fileType) => {
let blob;
await ajax.post(url, data, { responseType: 'blob' }).then(resp => {
blob = new Blob([resp.data], {
type: fileType ? fileType : 'application/octet-binary',
});
});
return window.URL.createObjectURL(blob);
};
const getDownloadFileBlob = async (url, fileType) => {
let blob;
await ajax.get(url, { responseType: 'blob' }).then(resp => {
blob = new Blob([resp.data], {
type: fileType ? fileType : 'application/octet-binary',
});
});
return blob;
};
export default {
ajax,
downloadFile,
getFile,
getDownloadFileUrl,
downloadPostFile,
getDownloadFileUrlByPost,
getDownloadFileBlob,
downloadBlob,
};

60
src/api/flow.js Normal file
View File

@ -0,0 +1,60 @@
import request from '@/utils/request';
//查询sim卡列表
export function getList(data) {
let param = '?pageIndex=' + data.page + '&size=' + data.size;
if (data.iccid != '' && data.iccid != undefined) {
param += '&iccid=' + data.iccid;
}
if (data.status != '' && data.status != undefined) {
param += '&status=' + data.status;
}
return request({
url: '/telcom/api/getSimList' + param,
method: 'get',
data,
});
}
//查询单个卡流量使用情况
export function getTrafficBySim(data) {
const param =
'?accessNum=' + data.accessNum + '&billingCycleID=' + data.billingCycleID;
return request({
url: '/telcom/api/getTrafficBySim' + param,
method: 'get',
data,
});
}
//sim卡绑定设备
export function simBindDevice(data) {
const param =
'?accessNum=' + data.accessNum + '&deviceCode=' + data.deviceCode;
return request({
url: '/telcom/api/simBindDevice' + param,
method: 'post',
data,
});
}
//查询企业用户数
export function getSimTotal(data) {
return request({
url: '/telcom/api/getSimTotal',
method: 'get',
data,
});
}
//本月流量排名
export function rankCurrentMonth(data) {
return request({
url: '/telcom/api/rankCurrentMonth',
method: 'post',
data,
});
}
//根据项目id查询力鼎站点列表
export function ldDeviceByProjectId(data) {
return request({
url: '/telcom/api/ldDeviceByProjectId?projectId=' + data.projectId,
method: 'get',
data,
});
}

101
src/api/fluorite.js Normal file
View File

@ -0,0 +1,101 @@
import request from '@/utils/request';
export function getList(data) {
return request({
url: '/ys/author/select?page=' + data.page + '&size=' + data.size,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/ys/author/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/ys/author/delete?id=' + data.id,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/ys/author/insert',
method: 'post',
data,
});
}
//获取设备列表
export function getDevices(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.account != '' && data.account != undefined) {
param += '&account=' + data.account;
}
if (data.sonserName != '' && data.sonserName != undefined) {
param += '&sonserName=' + data.sonserName;
}
if (data.deviceSerial != '' && data.deviceSerial != undefined) {
param += '&deviceSerial=' + data.deviceSerial;
}
if (data.status != 3 && data.status != undefined) {
param += '&status=' + data.status;
}
return request({
url: '/ys/api/getDevices' + param,
method: 'get',
data,
});
}
//获取播放地址
export function getLiveAddr(data) {
return request({
url:
'/ys/api/getLiveAddr?account=' +
data.account +
'&deviceSerial=' +
data.deviceSerial,
method: 'get',
data,
});
}
//获取播放地址
export function ldDeviceByProjectId(data) {
return request({
url: '/ys/api/ldDeviceByProjectId?projectId=' + data.projectId,
method: 'get',
data,
});
}
//萤石设备绑定力鼎站点
export function ysBindDevice(data) {
return request({
url:
'/ys/api/ysBindDevice?ysSerial=' +
data.ysSerial +
'&code=' +
data.code +
'&account=' +
data.account,
method: 'post',
data,
});
}
export function capture(data) {
return request({
url:
'/ys/author/capture?account=' +
data.account +
'&captureFlag=' +
data.captureFlag,
method: 'post',
data,
});
}

37
src/api/group.js Normal file
View File

@ -0,0 +1,37 @@
import request from '@/utils/request';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.name != undefined && data.name != '') {
param += '&name=' + data.name;
}
return request({
url: '/iot/project/group/select' + param,
method: 'get',
data,
});
}
export function doDelete(data) {
return request({
url: '/iot/project/group/remove?groupId=' + data.groupId,
method: 'post',
data,
});
}
export function remove(data) {
return request({
url: '/iot/project/group/remove?groupId=' + data.groupId,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/iot/project/group/saveOrUpdate',
method: 'post',
data,
});
}

76
src/api/index.js Normal file
View File

@ -0,0 +1,76 @@
import request from '@/utils/request';
// 基本信息
export function getBasicData(data) {
var param = '?month=' + data.month;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/basic' + param,
method: 'get',
data,
});
}
// 能耗指标
export function getConsumptionData(data) {
var param = '?start=' + data.start + '&end=' + data.end;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/energyConsumption' + param,
method: 'get',
data,
});
}
// 运维信息-巡检填报统计
export function getInspectionData(data) {
var param = '?start=' + data.start + '&end=' + data.end;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/inspection' + param,
method: 'get',
data,
});
}
// 运维信息-告警统计
export function getAlarmData(data) {
var param = '?start=' + data.start + '&end=' + data.end;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/alarm' + param,
method: 'get',
data,
});
}
// 运维信息-任务工单统计
export function getTaskData(data) {
var param = '?start=' + data.start + '&end=' + data.end;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/task' + param,
method: 'get',
data,
});
}
// 考勤统计
export function getAttendanceData(data) {
var param = '?start=' + data.start + '&end=' + data.end;
if (data.projectId != undefined) {
param += '&projectId=' + data.projectId;
}
return request({
url: '/overview/attendance' + param,
method: 'get',
data,
});
}

75
src/api/inspection.js Normal file
View File

@ -0,0 +1,75 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//巡检分页查询
export function getList(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.inspectorName != '') {
param += '&inspectorName=' + data.inspectorName;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return request({
url: '/inspection/list' + param,
method: 'get',
data,
});
}
//相关字典数据查询
export function dict(data) {
return request({
url: '/inspection/dict',
method: 'get',
data,
});
}
//获取站点列表
export function getDevices(data) {
return request({
url: '/task/devices?projectId=' + data.projectId,
method: 'get',
data,
});
}
//巡检添加
export function doAdd(data) {
return request({
url: '/inspection/add',
method: 'post',
data,
});
}
//巡检修改
export function toEdit(data) {
return request({
url: '/inspection/update',
method: 'post',
data,
});
}
//删除
export function doDelete(data) {
return request({
url: '/inspection/remove',
method: 'post',
data,
});
}
//导出
export function doExport(data) {
var param = '?projectId=' + data.projectId;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
return baseURL + '/taskReport/export' + param;
}

39
src/api/intention.js Normal file
View File

@ -0,0 +1,39 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
export function getList(data) {
return request({
url: '/intentionCustomer/select?page=' + data.page + '&size=' + data.size,
method: 'get',
data,
});
}
export function doDelete(data) {
return request({
url: '/intentionCustomer/remove?customerId=' + data.customerId,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/intentionCustomer/insert',
method: 'post',
data,
});
}
export function doEdit(data) {
return request({
url: '/intentionCustomer/update',
method: 'post',
data,
});
}
// 导出意向用户
export function intentionExport(data) {
return baseURL + '/intentionCustomer/export';
}

47
src/api/knowledge.js Normal file
View File

@ -0,0 +1,47 @@
import request from '@/utils/request';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.title != undefined && data.title != '') {
param += '&title=' + data.title;
}
if (data.date != undefined && data.date != '') {
param += '&date=' + data.date;
}
return request({
url: '/knowledge/list' + param,
method: 'get',
data,
});
}
export function doDelete(data) {
return request({
url: '/knowledge/remove',
method: 'post',
data,
});
}
export function doEdit(data) {
return request({
url: '/knowledge/update',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/knowledge/insert',
method: 'post',
data,
});
}
export function getCategoryDict(data) {
return request({
url: '/knowledge/categoryDict',
method: 'get',
data,
});
}

89
src/api/log.js Normal file
View File

@ -0,0 +1,89 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
// 登录日志
export function loginLogData(data) {
return request({
url:
'/loginLog/list?page=' +
data.page +
'&size=' +
data.size +
'&userName=' +
data.userName +
'&start=' +
data.start +
'&end=' +
data.end,
method: 'get',
data,
});
}
// 删除登录日志
export function removeLoginData(data) {
return request({
url: '/loginLog/remove',
method: 'post',
data,
});
}
// 登录日志导出
export function exportLoginLog(data) {
let param = '?start=' + data.start + '&end=' + data.end;
if (data.userName != '') {
param += '&userName=' + data.userName;
}
return baseURL + '/loginLog/export' + param;
}
// 查询操作类型
export function getBusinessType(data) {
return request({
url: '/operLog/businessType',
method: 'get',
data,
});
}
// 操作日志
export function actionLogData(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.businessType != '') {
param += '&businessType=' + data.businessType;
}
if ((data.status != '' && data.status != 2) || data.status == 0) {
param += '&status=' + data.status;
}
if (data.operName != '') {
param += '&operName=' + data.operName;
}
return request({
url: '/operLog/list' + param,
method: 'get',
data,
});
}
// 删除操作日志
export function removeActionLog(data) {
return request({
url: '/operLog/remove',
method: 'post',
data,
});
}
// 导出操作日志
export function exportActionLog(data) {
let param = '?start=' + data.start + '&end=' + data.end;
if (data.businessType != '') {
param += '&businessType=' + data.businessType;
}
if (data.operName != '') {
param += '&operName=' + data.operName;
}
if ((data.status != '' && data.status != 2) || data.status == 0) {
param += '&status=' + data.status;
}
return baseURL + '/operLog/export' + param;
}

74
src/api/maintenance.js Normal file
View File

@ -0,0 +1,74 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//设备列表分页查询
export function getList(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.equipmentName != '') {
param += '&equipmentName=' + data.equipmentName;
}
return request({
url: '/equipment/list' + param,
method: 'get',
data,
});
}
//获取站点列表
export function getDevices(data) {
return request({
url: '/task/devices?projectId=' + data.projectId,
method: 'get',
data,
});
}
//字典数据获取
export function alarmCategoryDict(data) {
return request({
url: '/equipment/dict',
method: 'get',
data,
});
}
//添加
export function doAdd(data) {
return request({
url: '/equipment/add',
method: 'post',
data,
});
}
//修改
export function doEdit(data) {
return request({
url: '/equipment/update',
method: 'post',
data,
});
}
//删除
export function doDelete(data) {
return request({
url: '/alarmRecord/remove',
method: 'post',
data,
});
}
//导出
export function doExport(data) {
var param = '?projectId=' + data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.equipmentName != '') {
param += '&equipmentName=' + data.equipmentName;
}
return baseURL + 'equipment/export' + param;
}

95
src/api/manage.js Normal file
View File

@ -0,0 +1,95 @@
import request from '@/utils/request';
import { encrypt } from '@/utils/encrypt';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.userName != '') {
param += '&userName=' + data.userName;
}
if (data.nickName != '') {
param += '&nickName=' + data.nickName;
}
if (data.phone != '') {
param += '&phone=' + data.phone;
}
if (data.email != '') {
param += '&email=' + data.email;
}
if (data.deptId != '') {
param += '&deptId=' + data.deptId;
}
return request({
url: '/sysUser/select' + param,
method: 'get',
data,
});
}
export async function doEdit(data) {
if (data.password != null) {
data.password = await encrypt(data.password);
}
return request({
url: '/sysUser/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/sysUser/remove',
method: 'post',
data,
});
}
export async function doAdd(data) {
if (data.password != '') {
data.password = await encrypt(data.password);
}
return request({
url: '/sysUser/insert',
method: 'post',
data,
});
}
export function getProjectIdByUserId(data) {
return request({
url: '/sysUser/getProjectIdByUserId?userId=' + data.userId,
method: 'get',
data,
});
}
export function assignRole(data) {
return request({
url: '/sysUser/assignRole',
method: 'post',
data,
});
}
export function assignProject(data) {
return request({
url: '/sysUser/assignProject',
method: 'post',
data,
});
}
//为用户分配小程序角色
export function assignMiniRole(data) {
return request({
url: '/sysUser/assignMiniRole',
method: 'post',
data,
});
}
//查询所有项目
export function getAllProjects(data) {
return request({
url: '/sysUser/getAllProjects',
method: 'get',
});
}

31
src/api/material.js Normal file
View File

@ -0,0 +1,31 @@
import request from '@/utils/request';
import { encrypt } from '@/utils/encrypt';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.name != '') {
param += '&name=' + data.name;
}
return request({
url: '/material/icon/list' + param,
method: 'get',
data,
});
}
//添加
export function doAdd(data) {
return request({
url: '/material/icon/insert',
method: 'post',
data,
});
}
//修改
export function doDelete(data) {
return request({
url: '/material/icon/remove',
method: 'post',
data,
});
}

118
src/api/menu.js Normal file
View File

@ -0,0 +1,118 @@
import request from '@/utils/request';
import { getUserInfos } from './user';
export function getList(data) {
return request({
url: '/sysMenu/select',
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/sysMenu/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/sysMenu/remove?menuId=' + data.menuId,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/sysMenu/insert',
method: 'post',
data,
});
}
export function getCustom(data) {
return request({
url: '/sysMenu/selectCustom',
method: 'get',
data,
});
}
//小程序菜单查询
export function miniMenuSelect(data) {
return request({
url: '/miniMenu/select',
method: 'get',
data,
});
}
//小程序菜单添加
export function miniMenuInsert(data) {
return request({
url: '/miniMenu/insert',
method: 'post',
data,
});
}
//小程序菜单修改
export function miniMenuUpdate(data) {
return request({
url: '/miniMenu/update',
method: 'post',
data,
});
}
//小程序菜单删除
export function miniMenuRemove(data) {
return request({
url: '/miniMenu/remove?menuId=' + data.menuId,
method: 'post',
data,
});
}
export function fetchProjectList(data = {}) {
return request({
url: '/iot/project/select?page=1&size=100',
method: 'get',
data,
});
// const mock = [
// {
// id: 1,
// name: '力鼎环保智慧云系统',
// },
// {
// id: 2,
// name: '力鼎环保智慧云系统2',
// },
// {
// id: 3,
// name: '力鼎环保智慧云系统3',
// },
// ];
//
// return Promise.resolve(mock);
}
// 查询当前用户的项目列表
export function getCurrentUserProjects(data) {
return request({
url: '/system/getCurrentUserProjects',
method: 'get',
data,
});
}
export async function fetchMenuByProject(project) {
const { data = [] } = await getUserInfos();
const menus = data?.menus || [];
return Promise.resolve(
project.len === 0
? menus
: menus.slice(menus.length - project.len, menus.length)
);
}

132
src/api/monitor.js Normal file
View File

@ -0,0 +1,132 @@
import request from '@/utils/request';
import { uniqueId } from 'lodash';
export const getSiteList = () => {
return request({
url: '/map/devices?projectId=' + sessionStorage.getItem('projectId'),
method: 'get',
}).then(res => {
return (res?.data || []).map(mo => {
return {
...mo,
label: mo.townName,
id: uniqueId('mo'),
iconType: 'folder',
type: 'town',
children: (mo.communities || []).map(co => {
return {
...mo,
...co,
label: co.communityName,
id: uniqueId('co'),
ids: co.id,
iconType: 'folder',
type: 'community',
children: (co.devices || []).map(de => {
return {
...mo,
...co,
...de,
iconType: 'device',
type: 'device',
label: de.name,
id: uniqueId('de'),
ids: de.id,
};
}),
};
}),
};
});
});
};
//站点详情
export function getDeviceInfo(data) {
return request({
url: '/map/deviceInfo?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
//项目下站点列表
export function getDeviceList(data) {
return request({
url: '/device/list?projectId=' + data.projectId,
method: 'get',
data,
});
}
//站点信息
export function getDeviceInfos(data) {
return request({
url: '/device/deviceInfo?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
// 获取监控播放地址
export function getLiveAddr(data) {
return request({
url: '/device/liveAddr?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
// 水质达标率
export function getWaterRate(data) {
return request({
url: '/device/waterRate?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
// 抓拍照片
export function getCaptureImg(data) {
return request({
url:
'/device/captureImg?deviceCode=' + data.deviceCode + '&page=' + data.page,
method: 'get',
data,
});
}
//传感器数据 可读
export function deviceCode(data) {
return request({
url:
'/device/sensors?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size,
method: 'get',
data,
});
}
//传感器数据 可读
export function sensorsOfWrite(data) {
return request({
url:
'/device/sensorsOfWrite?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size,
method: 'get',
data,
});
}
//下发数据
export function writeData(data) {
return request({
url:
'/deviceSensor/write?deviceCode=' +
data.deviceCode +
'&dataKey=' +
data.dataKey +
'&dataValue=' +
data.dataValue,
method: 'post',
data,
});
}

106
src/api/project.js Normal file
View File

@ -0,0 +1,106 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.regionCode) {
param += '&regionCode=' + data.regionCode;
}
if (data.name) {
param += '&name=' + data.name;
}
if (data.leader) {
param += '&leader=' + data.leader;
}
if (data.contact) {
param += '&contact=' + data.contact;
}
if (data.groupId) {
param += '&groupId=' + data.groupId;
}
return request({
url: '/iot/project/select' + param,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/iot/project/update',
method: 'post',
data,
});
}
export function getProjectGroup(data) {
return request({
url: '/iot/project/selectAllProjectGroup',
method: 'get',
data,
});
}
//查询报警方式列表
export function selectAlarmTypeList(data) {
return request({
url: '/iot/project/selectAlarmTypeList',
method: 'get',
data,
});
}
//查询所有报警联系人以及项目所绑定的报警联系人
export function getAlarmUser(data) {
return request({
url: '/iot/project/getAlarmUser?projectId=' + data.projectId,
method: 'get',
data,
});
}
//查询所有报警联系人以及项目所绑定的报警联系人
export function addAlarmUsers(data) {
return request({
url: '/iot/project/addAlarmUsers',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/iot/project/remove?',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/iot/project/insert',
method: 'post',
data,
});
}
//导出
export function exportProject(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.regionCode) {
param += '&regionCode=' + data.regionCode;
}
if (data.name) {
param += '&name=' + data.name;
}
if (data.leader) {
param += '&leader=' + data.leader;
}
if (data.contact) {
param += '&contact=' + data.contact;
}
if (data.groupId) {
param += '&groupId=' + data.groupId;
}
return baseURL + '/iot/project/export' + param;
}

8
src/api/publicKey.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request';
export function getPublicKey() {
return request({
url: '/publicKey',
method: 'get',
});
}

101
src/api/repair.js Normal file
View File

@ -0,0 +1,101 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//报修分页查询
export function getList(data) {
let param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.repairPersonName != '') {
param += '&repairPersonName=' + data.repairPersonName;
}
if (data.deviceType != '') {
param += '&deviceType=' + data.deviceType;
}
if (data.repairItem != '') {
param += '&repairItem=' + data.repairItem;
}
if (data.repairType != '') {
param += '&repairType=' + data.repairType;
}
return request({
url: '/repair/list' + param,
method: 'get',
data,
});
}
//相关字典数据查询
export function getDictData(data) {
return request({
url: '/repair/dict',
method: 'get',
data,
});
}
//该站点下设备列表
export function getEquipments(data) {
return request({
url: '/repair/equipments?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
//报修添加
export function doAdd(data) {
return request({
url: '/repair/add',
method: 'post',
data,
});
}
//报修修改
export function doEdit(data) {
return request({
url: '/repair/update',
method: 'post',
data,
});
}
//报修删除
export function doDelete(data) {
return request({
url: '/repair/remove',
method: 'post',
data,
});
}
//导出
export function doExport(data) {
var param = '?projectId=' + data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.repairPersonName != '') {
param += '&repairPersonName=' + data.repairPersonName;
}
if (data.deviceType != '') {
param += '&deviceType=' + data.deviceType;
}
if (data.equipmentName != '') {
param += '&equipmentName=' + data.equipmentName;
}
if (data.repairType != '') {
param += '&repairType=' + data.repairType;
}
return baseURL + 'repair/export' + param;
}
//报修转任务
export function toTask(data) {
return request({
url: '/repair/toTask',
method: 'post',
data,
});
}

111
src/api/role.js Normal file
View File

@ -0,0 +1,111 @@
import request from '@/utils/request';
export function getList(data) {
let pram = '?page=' + data.page + '&size=' + data.size;
if (data.name) {
pram += '&name=' + data.name;
}
return request({
url: '/sysRole/select' + pram,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/sysRole/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/sysRole/remove',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/sysRole/insert',
method: 'post',
data,
});
}
export function getMenuIdsByRoleId(data) {
return request({
url: '/sysRole/getMenuIdsByRoleId?roleId=' + data.roleId,
method: 'get',
data,
});
}
export function assignMenu(data) {
return request({
url: '/sysRole/assignMenu',
method: 'post',
data,
});
}
//分页查询小程序角色
export function miniRoleSelect(data) {
let pram = '?page=' + data.page + '&size=' + data.size;
if (data.name != undefined) {
pram += '&name=' + data.name;
}
return request({
url: '/miniRole/select' + pram,
method: 'get',
data,
});
}
//添加小程序角色
export function miniRoleInsert(data) {
return request({
url: '/miniRole/insert',
method: 'post',
data,
});
}
//修改小程序角色
export function miniRoleUpdate(data) {
return request({
url: '/miniRole/update',
method: 'post',
data,
});
}
//删除小程序角色
export function miniRoleRemove(data) {
return request({
url: '/miniRole/remove?roleId=' + data.roleId,
method: 'post',
data,
});
}
//授权小程序角色
export function miniRoleAssignMenu(data) {
return request({
url: '/miniRole/assignMenu',
method: 'post',
data,
});
}
//获取角色菜单ids
export function getMiniRoleMenuIdsByRoleId(data) {
return request({
url: '/miniRole/getMenuIdsByRoleId?roleId=' + data.roleId,
method: 'get',
data,
});
}

110
src/api/sensor.js Normal file
View File

@ -0,0 +1,110 @@
import request from '@/utils/request';
export function getList(data) {
let pram = '?page=' + data.page + '&size=' + data.size;
if (data.deviceId != '') {
pram += '&deviceId=' + data.deviceId;
}
if (data.sensorName != '') {
pram += '&sensorName=' + data.sensorName;
}
return request({
url: '/iot/sensor/select' + pram,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/iot/sensor/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/iot/sensor/remove',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/iot/sensor/insert',
method: 'post',
data,
});
}
//字典数据获取
export function getDictData(data) {
return request({
url: '/iot/sensor/dict',
method: 'get',
data,
});
}
//查询传感器属性列表
export function selectAttribute(data) {
return request({
url: '/iot/sensor/selectAttribute',
method: 'get',
data,
});
}
//查询传感器属性为数值时传感点类型列表
export function selectSensorType(data) {
return request({
url: '/iot/sensor/selectSensorType',
method: 'get',
data,
});
}
//查询传感器属性为数值时传感点单位列表
export function selectSensorUnit(data) {
return request({
url: '/iot/sensor/selectSensorUnit',
method: 'get',
data,
});
}
//查询传感器存储策略列表
export function selectStoreStrategy(data) {
return request({
url: '/iot/sensor/selectStoreStrategy',
method: 'get',
data,
});
}
//查询传感器功能码列表
export function selectFunctionCode(data) {
return request({
url: '/iot/sensor/selectFunctionCode',
method: 'get',
data,
});
}
//查询传感器数据格式列表
export function selectDataFormat(data) {
return request({
url: '/iot/sensor/selectDataFormat',
method: 'get',
data,
});
}
//查询传感器读写权限列表
export function selectReadWrite(data) {
return request({
url: '/iot/sensor/selectReadWrite',
method: 'get',
data,
});
}

9
src/api/staff.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
//日运行报表
export function getList(data) {
return request({
url: '/addressBook/book?projectId=' + data.projectId,
method: 'get',
data,
});
}

25
src/api/sys.js Normal file
View File

@ -0,0 +1,25 @@
import request from '@/utils/request';
export async function doEdit(data) {
return request({
url: '/webInfo/saveOrUpdate',
method: 'post',
data,
});
}
export async function doAdd(data) {
return request({
url: 'webInfo/saveOrUpdate',
method: 'post',
data,
});
}
export async function getData(data) {
return request({
url: '/webInfo/select',
method: 'get',
data,
});
}

66
src/api/sysdict.js Normal file
View File

@ -0,0 +1,66 @@
import request from '@/utils/request';
export function getList(data) {
const param = '?page=' + data.page + '&size=' + data.size;
return request({
url: '/sysDict/select' + param,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/sysDict/updateDictType',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/sysDict/removeDictType?dictTypeId=' + data.dictTypeId,
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/sysDict/insertDictType',
method: 'post',
data,
});
}
export function selectDeviceInfo(data) {
return request({
url: '/iot/device/selectDeviceInfo?deviceId=' + data.deviceId,
method: 'post',
data,
});
}
export function insertDictData(data) {
return request({
url: '/sysDict/insertDictData',
method: 'post',
data,
});
}
export function updateDictData(data) {
return request({
url: '/sysDict/updateDictData',
method: 'post',
data,
});
}
export function removeDictData(data) {
return request({
url: '/sysDict/removeDictData?dictDataId=' + data.dictDataId,
method: 'post',
data,
});
}

94
src/api/task.js Normal file
View File

@ -0,0 +1,94 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//任务分页查询
export function getList(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&type=' +
data.type +
'&projectId=' +
data.projectId;
if (data.status != 3) {
param += '&status=' + data.status;
}
return request({
url: '/task/list' + param,
method: 'get',
data,
});
}
//获取报警用户列表
export function getHandlers(data) {
return request({
url: '/task/handlers?deviceCode=' + data.deviceCode,
method: 'get',
data,
});
}
//获取站点列表
export function getDevices(data) {
return request({
url: '/task/devices?projectId=' + data.projectId,
method: 'get',
data,
});
}
//删除任务
export function doDelete(data) {
return request({
url: '/task/remove',
method: 'post',
data,
});
}
//新建任务
export function doAdd(data) {
return request({
url: '/task/add',
method: 'post',
data,
});
}
//任务反馈
export function feedback(data) {
return request({
url: '/task/feedback',
method: 'post',
data,
});
}
//水质申请修改
export function doEdit(data) {
return request({
url: '/task/update',
method: 'post',
data,
});
}
//导出
export function taskExport(data) {
var param = '?projectId=' + data.projectId;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
return baseURL + '/taskReport/export' + param;
}
//任务级别字典数据
export function getTaskLevel(data) {
return request({
url: '/task/taskLevel',
method: 'get',
data,
});
}
//任务类型字典数据
export function getTaskType(data) {
return request({
url: '/task/taskType',
method: 'get',
data,
});
}

73
src/api/testing.js Normal file
View File

@ -0,0 +1,73 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
//水质检测分页查询
export function getList(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.code != '') {
param += '&code=' + data.code;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return request({
url: '/waterDetection/list' + param,
method: 'get',
data,
});
}
//水质申请删除
export function doDelete(data) {
return request({
url: '/waterDetection/remove',
method: 'post',
data,
});
}
//水质申请添加
export function doAdd(data) {
return request({
url: '/waterDetection/add',
method: 'post',
data,
});
}
//水质申请修改
export function doEdit(data) {
return request({
url: '/waterDetection/update',
method: 'post',
data,
});
}
//导出
export function exportWaterDetection(data) {
var param = '?projectId=' + data.projectId;
if (data.deviceName != '') {
param += '&deviceName=' + data.deviceName;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return baseURL + '/waterDetectionReport/export' + param;
}
//达标率
export function waterRate(data) {
var param = '?projectId=' + data.projectId;
if (data.code != '') {
param += '&deviceCode=' + data.code;
}
if (data.date != '') {
param += '&date=' + data.date;
}
return request({
url: '/waterDetection/rate' + param,
method: 'get',
data,
});
}

8
src/api/tq.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request';
export function getDeviceList(data) {
return request({
url: '/tq/api/getDeviceList',
method: 'get',
data,
});
}

116
src/api/trigger.js Normal file
View File

@ -0,0 +1,116 @@
import request from '@/utils/request';
export function getList(data) {
let param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.deviceId != '') {
param += '&deviceId=' + data.deviceId;
}
return request({
url: '/iot/trigger/select' + param,
method: 'get',
data,
});
}
export function doEdit(data) {
return request({
url: '/iot/trigger/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/iot/trigger/remove',
method: 'post',
data,
});
}
export function doAdd(data) {
return request({
url: '/iot/trigger/insert',
method: 'post',
data,
});
}
//根据触发器id获取触发器详情
export function selectTriggerById(data) {
return request({
url: '/iot/trigger/selectTriggerById?triggerId=' + data.triggerId,
method: 'get',
data,
});
}
//获取报警级别列表
export function selectAllAlarmLevel(data) {
return request({
url: '/iot/trigger/selectAllAlarmLevel',
method: 'get',
data,
});
}
//获取触发条件列表
export function selectAllTriggerCondition(data) {
return request({
url: '/iot/trigger/selectAllTriggerCondition',
method: 'get',
data,
});
}
//获取报警联系人列表
export function selectAllAlarmUser(data) {
return request({
url: '/iot/trigger/selectAllAlarmUser',
method: 'get',
data,
});
}
//获取报警方式列表
export function selectAllAlarmType(data) {
return request({
url: '/iot/trigger/selectAllAlarmType',
method: 'get',
data,
});
}
//获取要联控的设备列表
export function selectControlDevices(data) {
return request({
url: '/iot/trigger/selectDeviceByProjectId?projectId=' + data.projectId,
method: 'get',
data,
});
}
//根据要联控的设备获取传感器列表
export function selectSensorByDeviceId(data) {
return request({
url: '/iot/trigger/selectSensorByDeviceId?deviceId=' + data.deviceId,
method: 'get',
data,
});
}
//获取报警信息模板列表
export function selectAllSmsConfig(data) {
return request({
url: '/iot/trigger/selectAllSmsConfig',
method: 'get',
data,
});
}
//根据项目id查询设备列表
export function selectDeviceByProjectId(data) {
return request({
url: '/iot/trigger/selectDeviceByProjectId?projectId=' + data.projectId,
method: 'get',
data,
});
}

59
src/api/triggerRule.js Normal file
View File

@ -0,0 +1,59 @@
import request from '@/utils/request';
//查询传感器下触发器规则列表
export function getList(data) {
var param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
if (data.sensorName != '') {
param += '&sensorName=' + data.sensorName;
}
return request({
url: '/triggerRule/list' + param,
method: 'get',
data,
});
}
//查询项目下的传感器列表
export function getSensorsData(data) {
return request({
url: '/triggerRule/sensors?projectId=' + data.projectId,
method: 'get',
data,
});
}
//修改某个触发器规则
export function doEdit(data) {
return request({
url: '/triggerRule/update',
method: 'post',
data,
});
}
export function doDelete(data) {
return request({
url: '/triggerRule/remove',
method: 'post',
data,
});
}
//为某个传感器添加触发器规则
export function doAdd(data) {
return request({
url: '/triggerRule/add',
method: 'post',
data,
});
}
//批量应用触发器规则到整个项目
export function triggerRuleUse(data) {
return request({
url: '/triggerRule/use',
method: 'post',
data,
});
}

99
src/api/user.js Normal file
View File

@ -0,0 +1,99 @@
import request from '@/utils/request';
import { encrypt } from '@/utils/encrypt';
import { loginRSA } from '@/config';
export async function login(data) {
if (loginRSA) {
data.password = await encrypt(data.passwords);
}
delete data.passwords;
return request({
url: '/system/login',
method: 'post',
data,
});
}
export function getUserInfos() {
return request({
url: '/system/getUserInfo',
method: 'get',
});
}
export function logout() {
return request({
url: '/system/logout',
method: 'post',
});
}
export function getAuthMenu() {
return request({
url: '/sysMenu/select',
method: 'get',
});
}
//获取二维码url
export function getQrCode() {
return request({
url: '/system/wechat/getQrCode',
method: 'get',
});
}
//为用户分配项目
export function assignProject(data) {
return request({
url: '/sysUser/assignProject',
method: 'post',
data,
});
}
//查询用户的项目列表
export function getProjectsByUserId(data) {
return request({
url: '/sysUser/getProjectsByUserId?userId=' + data.userId,
method: 'get',
});
}
// 扫码登录
export function codeLoginCallback(data) {
return request({
url: '/system/wechat/login?scene=' + data.scene,
method: 'get',
});
}
// 微信和用户绑定
export function userBindWechat(data) {
return request({
url: '/system/bind?userName=' + data.userName + '&openid=' + data.openid,
method: 'post',
});
}
// 修改密码
export function userUpdatePwd(data) {
return request({
url:
'/sysProfile/updatePwd?oldPwd=' + data.oldPwd + '&newPwd=' + data.newPwd,
method: 'post',
});
}
// 修改用户信息
export function updateInfo(data) {
return request({
url: '/sysProfile/updateInfo',
method: 'post',
data,
});
}
// 查询用户信息
export function userInfo(data) {
return request({
url: '/sysProfile/userInfo',
method: 'get',
data,
});
}

49
src/api/vehicle.js Normal file
View File

@ -0,0 +1,49 @@
import request from '@/utils/request';
//打卡列表分页查询
export function getList(data) {
const param =
'?page=' +
data.page +
'&size=' +
data.size +
'&projectId=' +
data.projectId;
return request({
url: '/vehicle/list' + param,
method: 'get',
data,
});
}
//获取设备,设备详情,位置信息
export function getDeviceList(data) {
return request({
url: '/tq/api/getDeviceList',
method: 'get',
data,
});
}
//项目列表
export function getProjects(data) {
return request({
url: '/tq/api/projects',
method: 'get',
data,
});
}
//途强设备与力鼎项目(支持多个)绑定
export function bindProject(data) {
return request({
url:
'/tq/api/bindProject?imei=' +
data.imei +
'&num=' +
data.num +
'&projectIds=' +
data.projectIds,
method: 'post',
data,
});
}

21
src/api/video.js Normal file
View File

@ -0,0 +1,21 @@
import request from '@/utils/request';
//获取该项目下萤石云设备
export function getList(data) {
return request({
url: '/video/devices?projectId=' + data.projectId,
method: 'get',
data,
});
}
//获取播放地址
export function getLiveAddr(data) {
return request({
url:
'/video/getLiveAddr?account=' +
data.account +
'&deviceSerial=' +
data.deviceSerial,
method: 'get',
data,
});
}

1
src/api/video.vue Normal file
View File

@ -0,0 +1 @@
<template>video</template>

162
src/api/wechat.js Normal file
View File

@ -0,0 +1,162 @@
import request from '@/utils/request';
//查询菜单
export function getMenuList(data) {
return request({
url: '/wechatMp/menu/list',
method: 'get',
data,
});
}
//获取菜单类型
export function getMenuType(data) {
return request({
url: '/wechatMp/menu/type',
method: 'get',
data,
});
}
//创建菜单
export function addMenuPub(data) {
return request({
url: '/wechatMp/menu/pub',
method: 'post',
data,
});
}
//删除菜单
export function delMenuRemove() {
return request({
url: '/wechatMp/menu/remove',
method: 'post',
});
}
//关注自动回复
//查询回复规则
export function getSubscribeReply(data) {
return request({
url: '/wechatMp/subscribeReply/getReply',
method: 'get',
data,
});
}
//根据素材类型分页查询素材列表
export function getMaterialList(data) {
if (data.page == null) {
data.page = 1;
}
const param =
'?page=' + data.page + '&size=' + data.size + '&type=' + data.type;
return request({
url: '/wechatMp/material/list' + param,
method: 'get',
data,
});
}
//素材类型字典查询
export function getMaterialType(data) {
return request({
url: '/wechatMp/material/type',
method: 'get',
data,
});
}
//消息类型字典查询
export function getMaterialMsgType(data) {
return request({
url: '/wechatMp/subscribeReply/msgType',
method: 'get',
data,
});
}
//保存或修改
export function materialSaveOrUpdate(data) {
return request({
url: '/wechatMp/subscribeReply/saveOrUpdate',
method: 'post',
data,
});
}
//删除
export function materialRemove(data) {
return request({
url: '/wechatMp/subscribeReply/remove?id=' + data.id,
method: 'post',
data,
});
}
//关键词自动回复
//关键字匹配类型
export function getMatchType(data) {
return request({
url: '/wechatMp/keywordReply/matchType',
method: 'get',
data,
});
}
//查询
export function getKeywordReplyList(data) {
const param = '?page=' + data.page + '&size=' + data.size;
return request({
url: '/wechatMp/keywordReply/list' + param,
method: 'get',
data,
});
}
//新增
export function keywordReplyAdd(data) {
return request({
url: '/wechatMp/keywordReply/insert',
method: 'post',
data,
});
}
//修改
export function keywordReplyEdit(data) {
return request({
url: '/wechatMp/keywordReply/update',
method: 'post',
data,
});
}
//删除
export function keywordReplyRemove(data) {
return request({
url: '/wechatMp/keywordReply/remove',
method: 'post',
data,
});
}
//默认自动回复
//查询回复规则
export function getReplyType(data) {
return request({
url: '/wechatMp/defaultReply/getReply',
method: 'get',
data,
});
}
//查询回复规则
export function getDefaultReplyType(data) {
return request({
url: '/wechatMp/defaultReply/getReply',
method: 'get',
data,
});
}
//保存或修改
export function defaultReplySaveOrUpdate(data) {
return request({
url: '/wechatMp/defaultReply/saveOrUpdate',
method: 'post',
data,
});
}
//删除
export function defaultReplyRemove(data) {
return request({
url: '/wechatMp/defaultReply/remove?id=' + data.id,
method: 'post',
data,
});
}

BIN
src/assets/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/assets/ewm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
src/assets/folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
src/assets/gis.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

BIN
src/assets/group.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
src/assets/home/jd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
src/assets/home/js.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/home/jt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
src/assets/home/ljydl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/assets/home/ljysl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/assets/interrupt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
src/assets/marker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

BIN
src/assets/position.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
src/assets/stop.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
src/assets/success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
src/assets/touxiang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -0,0 +1,34 @@
/**
* 配置文档地址
* https://ckeditor.com/docs/ckeditor5/latest/api/adapter-ckfinder.html
*/
export const knowledgeEditorConfig = {
language: 'zh-cn',
fontFamily: {},
fontSize: {
options: [9, 11, 13, 'default', 17, 19, 21],
supportAllValues: true,
},
toolbar: [
'heading',
'|',
'bold',
'italic',
'Link',
'bulletedList',
'numberedList',
'alignment',
'|',
'fontFamily',
'fontSize',
'fontColor',
'fontBackgroundColor',
'highlight',
'|',
'blockQuote',
'|',
'undo',
'redo',
],
};

7
src/common/ckeditor/ckeditor.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,496 @@
/**
* @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved.
* This file is licensed under the terms of the MIT License (see LICENSE.md).
*/
:root {
--ck-sample-base-spacing: 2em;
--ck-sample-color-white: #fff;
--ck-sample-color-green: #279863;
--ck-sample-color-blue: #1a9aef;
--ck-sample-container-width: 1285px;
--ck-sample-sidebar-width: 350px;
--ck-sample-editor-min-height: 400px;
--ck-sample-editor-z-index: 10;
}
/* --------- EDITOR STYLES ---------------------------------------------------------------------------------------- */
.editor__editable,
/* Classic build. */
main .ck-editor[role='application'] .ck.ck-content,
/* Decoupled document build. */
.ck.editor__editable[role='textbox'],
.ck.ck-editor__editable[role='textbox'],
/* Inline & Balloon build. */
.ck.editor[role='textbox'] {
width: 100%;
background: #fff;
font-size: 1em;
line-height: 1.6em;
min-height: var(--ck-sample-editor-min-height);
padding: 1.5em 2em;
}
.ck.ck-editor__editable {
background: #fff;
border: 1px solid hsl(0, 0%, 70%);
width: 100%;
}
/* Because of sidebar `position: relative`, Edge is overriding the outline of a focused editor. */
.ck.ck-editor__editable {
position: relative;
z-index: var(--ck-sample-editor-z-index);
}
.editor-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
position: relative;
width: 100%;
justify-content: center;
}
/* --------- DECOUPLED (DOCUMENT) BUILD. ---------------------------------------------*/
body[data-editor='DecoupledDocumentEditor'] .document-editor__toolbar {
width: 100%;
}
body[data-editor='DecoupledDocumentEditor'] .collaboration-demo__editable,
body[data-editor='DecoupledDocumentEditor'] .row-editor .editor {
/* A pixel is added for each of the border. */
width: calc(21cm + 2px);
min-height: calc(29.7cm + 2px);
/* To avoid having extra scrolls inside the editor container. */
height: fit-content;
padding: 2cm 1.2cm;
margin: 2.5rem;
border: 1px hsl( 0, 0%, 82.7% ) solid;
background-color: var(--ck-sample-color-white);
box-shadow: 0 0 5px hsla( 0, 0%, 0%, .1 );
box-sizing: border-box;
}
body[data-editor='DecoupledDocumentEditor'] .row-editor {
display: flex;
position: relative;
justify-content: center;
overflow-y: auto;
background-color: #f2f2f2;
border: 1px solid hsl(0, 0%, 77%);
/* Limit the max-height of the editor to avoid scrolling from bottom to top to see the toolbar. */
max-height: 700px;
}
body[data-editor='DecoupledDocumentEditor'] .sidebar {
background: transparent;
border: 0;
box-shadow: none;
}
/* --------- COMMENTS & TRACK CHANGES FEATURE ---------------------------------------------------------------------- */
.sidebar {
padding: 0 15px;
position: relative;
min-width: var(--ck-sample-sidebar-width);
max-width: var(--ck-sample-sidebar-width);
font-size: 20px;
border: 1px solid hsl(0, 0%, 77%);
background: hsl(0, 0%, 98%);
border-left: 0;
overflow: hidden;
min-height: 100%;
flex-grow: 1;
}
/* Do not inherit styles related to the editable editor content. See line 25.*/
.sidebar .ck-content[role='textbox'],
.ck.ck-annotation-wrapper .ck-content[role='textbox'] {
min-height: unset;
width: unset;
padding: 0;
background: transparent;
}
.sidebar.narrow {
min-width: 60px;
flex-grow: 0;
}
.sidebar.hidden {
display: none !important;
}
#sidebar-display-toggle {
position: absolute;
z-index: 1;
width: 30px;
height: 30px;
text-align: center;
left: 15px;
top: 30px;
border: 0;
padding: 0;
color: hsl( 0, 0%, 50% );
transition: 250ms ease color;
background-color: transparent;
}
#sidebar-display-toggle:hover {
color: hsl( 0, 0%, 30% );
cursor: pointer;
}
#sidebar-display-toggle:focus,
#sidebar-display-toggle:active {
outline: none;
border: 1px solid #a9d29d;
}
#sidebar-display-toggle svg {
fill: currentColor;
}
/* --------- COLLABORATION FEATURES (USERS) ------------------------------------------------------------------------ */
.row-presence {
width: 100%;
border: 1px solid hsl(0, 0%, 77%);
border-bottom: 0;
background: hsl(0, 0%, 98%);
padding: var(--ck-spacing-small);
/* Make `border-bottom` as `box-shadow` to not overlap with the editor border. */
box-shadow: 0 1px 0 0 hsl(0, 0%, 77%);
/* Make `z-index` bigger than `.editor` to properly display tooltips. */
z-index: 20;
}
.ck.ck-presence-list {
flex: 1;
padding: 1.25rem .75rem;
}
.presence .ck.ck-presence-list__counter {
order: 2;
margin-left: var(--ck-spacing-large)
}
/* --------- REAL TIME COLLABORATION FEATURES (SHARE TOPBAR CONTAINER) --------------------------------------------- */
.collaboration-demo__row {
display: flex;
position: relative;
justify-content: center;
overflow-y: auto;
background-color: #f2f2f2;
border: 1px solid hsl(0, 0%, 77%);
}
body[data-editor='InlineEditor'] .collaboration-demo__row {
border: 0;
}
.collaboration-demo__container {
max-width: var(--ck-sample-container-width);
margin: 0 auto;
padding: 1.25rem;
}
.presence, .collaboration-demo__row {
transition: .2s opacity;
}
.collaboration-demo__topbar {
background: #fff;
border: 1px solid var(--ck-color-toolbar-border);
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 0;
border-radius: 4px 4px 0 0;
}
.collaboration-demo__topbar .btn {
margin-right: 1em;
outline-offset: 2px;
outline-width: 2px;
background-color: var( --ck-sample-color-blue );
}
.collaboration-demo__topbar .btn:focus,
.collaboration-demo__topbar .btn:hover {
border-color: var( --ck-sample-color-blue );
}
.collaboration-demo__share {
display: flex;
align-items: center;
padding: 1.25rem .75rem
}
.collaboration-demo__share-description p {
margin: 0;
font-weight: bold;
font-size: 0.9em;
}
.collaboration-demo__share input {
height: auto;
font-size: 0.9em;
min-width: 220px;
margin: 0 10px;
border-radius: 4px;
border: 1px solid var(--ck-color-toolbar-border)
}
.collaboration-demo__share button,
.collaboration-demo__share input {
height: 40px;
padding: 5px 10px;
}
.collaboration-demo__share button {
position: relative;
}
.collaboration-demo__share button:focus {
outline: none;
}
.collaboration-demo__share button[data-tooltip]::before,
.collaboration-demo__share button[data-tooltip]::after {
position: absolute;
visibility: hidden;
opacity: 0;
pointer-events: none;
transition: all .15s cubic-bezier(.5,1,.25,1);
z-index: 1;
}
.collaboration-demo__share button[data-tooltip]::before {
content: attr(data-tooltip);
padding: 5px 15px;
border-radius: 3px;
background: #111;
color: #fff;
text-align: center;
font-size: 11px;
top: 100%;
left: 50%;
margin-top: 5px;
transform: translateX(-50%);
}
.collaboration-demo__share button[data-tooltip]::after {
content: '';
border: 5px solid transparent;
width: 0;
font-size: 0;
line-height: 0;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-bottom: 5px solid #111;
border-top: none;
}
.collaboration-demo__share button[data-tooltip]:hover:before,
.collaboration-demo__share button[data-tooltip]:hover:after {
visibility: visible;
opacity: 1;
}
.collaboration-demo--ready {
overflow: visible;
height: auto;
}
.collaboration-demo--ready .presence,
.collaboration-demo--ready .collaboration-demo__row {
opacity: 1;
}
/* --------- PAGINATION FEATURE ------------------------------------------------------------------------------------ */
/* Pagination view line must be stacked at least at the same level as the editor,
otherwise it will be hidden underneath. */
.ck.ck-pagination-view-line {
z-index: var(--ck-sample-editor-z-index);
}
/* --------- REVISION HISTORY FEATURE ------------------------------------------------------------------------------ */
.revision-viewer-container {
display: none;
}
.revision-viewer-sidebar {
position: relative;
min-width: 310px;
overflow: hidden;
background: var(--ck-color-toolbar-background);
border: 1px solid var(--ck-color-toolbar-border);
margin-left: -1px;
}
/* A case when Pagination and Revision History features are enabled in the editor. */
/* Move the square with page number from the Pagination plugin to the left side, so that it does not cover the RH sidebar. */
body[data-revision-history='true'] .ck.ck-pagination-view-line::after {
transform: translateX(-100%) !important;
left: -1px !important;
right: unset !important;
}
/* --------- SAMPLE GENERIC STYLES (not related to CKEditor) ------------------------------------------------------- */
body, html {
padding: 0;
margin: 0;
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
}
body {
height: 100%;
color: #2D3A4A;
}
body * {
box-sizing: border-box;
}
a {
color: #38A5EE;
}
header .centered {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
min-height: 8em;
}
header h1 a {
font-size: 20px;
display: flex;
align-items: center;
color: #2D3A4A;
text-decoration: none;
}
header h1 img {
display: block;
height: 64px;
}
header nav ul {
margin: 0;
padding: 0;
list-style-type: none;
}
header nav ul li {
display: inline-block;
}
header nav ul li + li {
margin-left: 1em;
}
header nav ul li a {
font-weight: bold;
text-decoration: none;
color: #2D3A4A;
}
header nav ul li a:hover {
text-decoration: underline;
}
main .message {
padding: 0 0 var(--ck-sample-base-spacing);
background: var(--ck-sample-color-green);
color: var(--ck-sample-color-white);
}
main .message::after {
content: "";
z-index: -1;
display: block;
height: 10em;
width: 100%;
background: var(--ck-sample-color-green);
position: absolute;
left: 0;
}
main .message h2 {
position: relative;
padding-top: 1em;
font-size: 2em;
}
.centered {
/* Hide overlapping comments. */
overflow: hidden;
max-width: var(--ck-sample-container-width);
margin: 0 auto;
padding: 0 var(--ck-sample-base-spacing);
}
.row {
display: flex;
position: relative;
}
.btn {
cursor: pointer;
padding: 8px 16px;
font-size: 1rem;
user-select: none;
border-radius: 4px;
transition: color .2s ease-in-out,background-color .2s ease-in-out,border-color .2s ease-in-out,opacity .2s ease-in-out;
background-color: var(--ck-sample-color-button-blue);
border-color: var(--ck-sample-color-button-blue);
color: var(--ck-sample-color-white);
display: inline-block;
}
.btn--tiny {
padding: 6px 12px;
font-size: .8rem;
}
footer {
margin: calc(2*var(--ck-sample-base-spacing)) var(--ck-sample-base-spacing);
font-size: .8em;
text-align: center;
color: rgba(0,0,0,.4);
}
/* --------- RWD --------------------------------------------------------------------------------------------------- */
@media screen and ( max-width: 800px ) {
:root {
--ck-sample-base-spacing: 1em;
}
header h1 {
width: 100%;
}
header h1 img {
height: 40px;
}
header nav ul {
text-align: right;
}
main .message h2 {
font-size: 1.5em;
}
}

142
src/common/ckeditor/zh.js Normal file
View File

@ -0,0 +1,142 @@
!(function (e) {
const t = (e.zh = e.zh || {});
(t.dictionary = Object.assign(t.dictionary || {}, {
'%0 of %1': '%0/%1',
Aquamarine: '淺綠色',
Big: '大',
Black: '黑色',
'Block quote': '段落引用',
Blue: '藍色',
'Blue marker': '藍色標記',
Bold: '粗體',
'Break text': '上及下',
'Bulleted List': '符號清單',
Cancel: '取消',
'Cannot determine a category for the uploaded file.':
'無法確定上傳檔案的分類。',
'Cannot upload file:': '無法上傳檔案:',
'Caption for image: %0': '影像標題:%0',
'Caption for the image': '影像的標題',
'Centered image': '置中圖片',
'Change image text alternative': '修改圖片的替代文字',
'Choose heading': '選取標題',
Column: '欄',
'Decrease indent': '減少縮排',
Default: '預設',
'Delete column': '刪除欄',
'Delete row': '刪除列',
'Dim grey': '淡灰色',
'Document colors': '文件顏色',
Downloadable: '可下載',
'Dropdown toolbar': '下拉選單',
'Edit block': '編輯區塊',
'Edit link': '編輯連結',
'Editor block content toolbar': '編輯器區塊內容工具列',
'Editor contextual toolbar': '編輯器關聯式工具列',
'Editor editing area: %0': '編輯器編輯區:%0',
'Editor toolbar': '編輯器工具',
'Enter image caption': '輸入圖片說明',
'Font Background Color': '前景顏色',
'Font Color': '字體顏色',
'Font Family': '字型',
'Font Size': '字體大小',
'Full size image': '完整尺寸圖片',
Green: '綠色',
'Green marker': '綠色標記',
'Green pen': '綠色筆',
Grey: '灰色',
'Header column': '標題欄',
'Header row': '標題列',
Heading: '標題',
'Heading 1': '標題 1',
'Heading 2': '標題 2',
'Heading 3': '標題 3',
'Heading 4': '標題 4',
'Heading 5': '標題 5',
'Heading 6': '標題 6',
Highlight: '高亮',
Huge: '特大',
'Image toolbar': '圖片工具',
'image widget': '圖片小工具',
'In line': '行中',
'Increase indent': '增加縮排',
'Insert column left': '插入左方欄',
'Insert column right': '插入右方欄',
'Insert image': '插入圖片',
'Insert media': '插入影音',
'Insert paragraph after block': '在這個區塊後面插入一個段落',
'Insert paragraph before block': '在這個區塊前面插入一個段落',
'Insert row above': '插入上方列',
'Insert row below': '插入下方列',
'Insert table': '插入表格',
Italic: '斜體',
'Left aligned image': '向左對齊圖片',
'Light blue': '亮藍色',
'Light green': '亮綠色',
'Light grey': '亮灰色',
Link: '連結',
'Link URL': '連結˙ URL',
'Media URL': '影音網址',
'media widget': '影音小工具',
'Merge cell down': '合併下方儲存格',
'Merge cell left': '合併左方儲存格',
'Merge cell right': '合併右方儲存格',
'Merge cell up': '合併上方儲存格',
'Merge cells': '合併儲存格',
Next: '下一',
'Numbered List': '有序清單',
'Open file manager': '開啟檔案管理程式',
'Open in a new tab': '在新視窗開啟',
'Open link in new tab': '在新視窗開啟連結',
'Open media in new tab': '在新分頁打開媒體',
Orange: '橘色',
Paragraph: '段落',
'Paste the media URL in the input.': '在輸入框貼上影音網址。',
'Pink marker': '粉色標記',
'Press Enter to type after or press Shift + Enter to type before the widget':
'按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入',
Previous: '上一',
Purple: '紫色',
Red: '紅色',
'Red pen': '紅色筆',
Redo: '重做',
'Remove color': '移除顏色',
'Remove highlight': '清除高亮',
'Rich Text Editor': '豐富文字編輯器',
'Right aligned image': '向右對齊圖片',
Row: '列',
Save: '儲存',
'Select all': '選取全部',
'Select column': '選擇欄',
'Select row': '選擇列',
'Show more items': '顯示更多',
'Side image': '側邊圖片',
Small: '小',
'Split cell horizontally': '水平分割儲存格',
'Split cell vertically': '垂直分割儲存格',
'Table toolbar': '表格工具',
'Text alternative': '替代文字',
'Text highlight toolbar': '高亮',
'The URL must not be empty.': '網址不能空白。',
'This link has no URL': '連結沒有URL',
'This media URL is not supported.': '不支援此影音網址。',
Tiny: '特小',
'Tip: Paste the URL into the content to embed faster.':
'提示:在內容貼上網址更快崁入。',
'Toggle caption off': '關閉表標題',
'Toggle caption on': '開啟表標題',
Turquoise: '藍綠色',
Undo: '取消',
Unlink: '移除連結',
'Upload failed': '上傳失敗',
'Upload in progress': '正在上傳',
White: '白色',
'Widget toolbar': '小工具',
'Wrap text': '文繞圖',
Yellow: '黃色',
'Yellow marker': '黃色標記',
})),
(t.getPluralForm = function (e) {
return 0;
});
})(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {}));

86
src/common/location.js Normal file
View File

@ -0,0 +1,86 @@
//转换常数
var x_pi = (3.14159265358979324 * 3000.0) / 180.0;
var pi = 3.14159265358979324;
var a = 6378245.0;
var ee = 0.00669342162296594323;
export function transformLon(x, y) {
var ret =
300.0 +
x +
2.0 * y +
0.1 * x * x +
0.1 * x * y +
0.1 * Math.sqrt(Math.abs(x));
ret +=
(20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi) * 2.0) / 3.0;
ret +=
(20.0 * Math.sin(x * pi) + 40.0 * Math.sin((x / 3.0) * pi) * 2.0) / 3.0;
ret +=
(150.0 * Math.sin((x / 12.0) * pi) +
300.0 * Math.sin((x / 30.0) * pi) * 2.0) /
3.0;
return ret;
}
export function transformLat(x, y) {
var ret =
-100.0 +
2.0 * x +
3.0 * y +
0.2 * y * y +
0.1 * x * y +
0.2 * Math.sqrt(Math.abs(x));
ret +=
(20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi) * 2.0) / 3.0;
ret +=
((20.0 * Math.sin(y * pi) + 40.0 * Math.sin((y / 3.0) * pi)) * 2.0) / 3.0;
ret +=
((160.0 * Math.sin((y / 12.0) * pi) + 320 * Math.sin((y * pi) / 30.0)) *
2.0) /
3.0;
return ret;
}
export function outOfChina(lat, lon) {
if (lon < 72.004 || lon > 137.8347) {
return true;
}
if (lat < 0.8293 || lat > 55.8271) {
return true;
}
return false;
}
/*
* WGS-84是国际标准GPS坐标Google Earth使用或者GPS模块天地图
* GCJ-02中国坐标偏移标准Google Map高德腾讯使用
* BD-09百度坐标偏移标准Baidu Map使用
*/
/**
* wgLat 纬度
* wgLon 经度
* GCJ-02 WGS-84 的转换
* */
export function gcj_wgs_encrypts(wgLat, wgLon) {
var point = {};
if (outOfChina(wgLat, wgLon)) {
point.lat = wgLat;
point.lng = wgLon;
return point;
}
var dLat = transformLat(wgLon - 105.0, wgLat - 35.0);
var dLon = transformLon(wgLon - 105.0, wgLat - 35.0);
var radLat = (wgLat / 180.0) * pi;
var magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
var sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / (a * (1 - ee)) / (magic * sqrtMagic);
dLon = (dLon * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * pi);
var mglat = wgLat + dLat * pi;
var mglng = wgLon + dLon;
point.lat = wgLat * 2 - mglat;
point.lon = wgLon * 2 - mglng;
return point;
}

115
src/common/times.js Normal file
View File

@ -0,0 +1,115 @@
export function getFMdate(number, separator) {
const n = parseInt(number);
const nd = new Date();
const day = nd.getDate();
const setd = new Date(nd.setDate(day + n));
const ryear = setd.getFullYear();
const rmonth = setd.getMonth() + 1;
const rday = setd.getDate();
let frmonth, frday;
// month day + '0'
if (rmonth < 10) {
frmonth = '0' + rmonth;
} else {
frmonth = rmonth;
}
if (rday < 10) {
frday = '0' + rday;
} else {
frday = rday;
}
// separator
const sep = separator ? separator : '-';
return ryear + sep + frmonth + sep + frday;
}
export function getDate(time = '') {
var now = new Date();
if (time != '') {
now = new Date(time);
}
const year = now.getFullYear(); //得到年份
let month = now.getMonth(); //得到月份
let date = now.getDate(); //得到日期
month = month + 1;
month = month.toString().padStart(2, '0');
date = date.toString().padStart(2, '0');
return `${year}-${month}-${date}`;
}
export function getDate1(time = '') {
var now = new Date();
if (time != '') {
now = new Date(time);
}
const year = now.getFullYear(); //得到年份
let month = now.getMonth(); //得到月份
month = month + 1;
month = month.toString().padStart(2, '0');
return `${year}-${month}`;
}
export function getDate2(time = '') {
var now = new Date();
if (time != '') {
now = new Date(time);
}
const year = now.getFullYear(); //得到年份
return `${year}`;
}
//获取前几天时间
export function getPastTime(month) {
const time = new Date();
const yy = time.getFullYear(); //获取完整的年份(4位,1970-???)
const M = time.getMonth() + 1; //获取当前月份(0-11,0代表1月),
const d = time.getDate(); //获取当前日(1-31)
// 获取指定的过去时间
const past = M - month;
const pastM = past < 0 ? past + 12 : past > 10 ? past : '0' + past;
// 小于9的在前面加0
const MM = M > 9 ? M : '0' + M;
const dd = d > 9 ? d : '0' + d;
// 指定的过去时间
const PastTime = yy + '-' + pastM + '-' + dd;
// 当前时间
const nowTime = yy + '-' + MM + '-' + dd;
return [PastTime, nowTime];
}
export function getPastTime1() {
const today = new Date();
const yy = today.getFullYear(); //获取完整的年份(4位,1970-???)
const M = today.getMonth() + 1; //获取当前月份(0-11,0代表1月),
const d = today.getDate(); //获取当前日(1-31)
const previousDay = new Date(today);
previousDay.setDate(today.getDate() - 1);
const year = previousDay.getFullYear();
const month = (previousDay.getMonth() + 1).toString().padStart(2, '0');
const day = previousDay.getDate().toString().padStart(2, '0');
// 小于9的在前面加0
const MM = M > 9 ? M : '0' + M;
const dd = d > 9 ? d : '0' + d;
// 指定的过去时间
const PastTime = year + '-' + month + '-' + day;
// 当前时间
const nowTime = yy + '-' + MM + '-' + dd;
return [PastTime, nowTime];
}
// 时间戳转换日期格式方法
export function formatDateTime(value) {
var date = new Date();
if (value != '') {
date = new Date(value);
}
const y = date.getFullYear(); // 年
let MM = date.getMonth() + 1; // 月
MM = MM < 10 ? '0' + MM : MM;
let d = date.getDate(); // 日
d = d < 10 ? '0' + d : d;
let h = date.getHours(); // 时
h = h < 10 ? '0' + h : h;
let m = date.getMinutes(); // 分
m = m < 10 ? '0' + m : m;
let s = date.getSeconds(); // 秒
s = s < 10 ? '0' + s : s;
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
}

Some files were not shown because too many files have changed in this diff Show More