Commit f85a61e8f281da5147563520156c8594683b3b16

Authored by 严涛
0 parents

项目初始化

Showing 84 changed files with 4724 additions and 0 deletions

Too many changes to show.

To preserve performance only 84 of 689 files are displayed.

  1 +# 标题
  2 +VITE_APP_TITLE = '能源'
  3 +
  4 +# api
  5 +VITE_API_BASE_URL = '/dev-api'
  6 +
  7 +VITE_ASSET_URL = '/src/assets'
  8 +
  9 +# 接线图
  10 +VITE_YKITE_DIAGRA_URL = 'http://127.0.0.1:8887'
  11 +
  12 +#WebSocket
  13 +VITE_WEBSOCKET_URL = ''
  14 +
  15 +# 高德地图key
  16 +VITE_AMAP_API_KEY = ''
  17 +
  18 +# 高德地图密钥
  19 +VITE_AMAP_API_CODE = ''
  20 +
  21 +# 心知天气插件key (https://www.seniverse.com/widgetv3)
  22 +VITE_WEATHER_API = ''
  23 +
  24 +# 大屏模板1图片配置(背景图、中央图、二级页背景图)
  25 +VITE_Bi_DEFAULT_CONFIG={"background":"","backgroundCover":"","detailBackground":""}
  26 +
  27 +# 大屏模板2图片配置(背景图、中央图)
  28 +VITE_Bi_TECHNOLOGY_CONFIG={"background":"","backgroundCover":""}
  29 +
  30 +# 版权信息
  31 +VITE_COPYRIGHT = {"copyright": "Copyright © 2026 能源管理系统","record": ""}
... ...
  1 +# 标题
  2 +VITE_APP_TITLE = '云捷EMS能源'
  3 +
  4 +# api
  5 +VITE_API_BASE_URL = '/prod-api'
  6 +
  7 +VITE_ASSET_URL = '/assets'
  8 +
  9 +# 接线图
  10 +VITE_YKITE_DIAGRA_URL = 'http://127.0.0.1:8887'
  11 +
  12 +#WebSocket
  13 +VITE_WEBSOCKET_URL = ''
  14 +
  15 +# 高德地图key
  16 +VITE_AMAP_API_KEY = ''
  17 +
  18 +# 高德地图密钥
  19 +VITE_AMAP_API_CODE = ''
  20 +
  21 +# 心知天气插件key (https://www.seniverse.com/widgetv3)
  22 +VITE_WEATHER_API = ''
  23 +
  24 +# 大屏模板1图片配置(背景图、中央图、二级页背景图)
  25 +VITE_Bi_DEFAULT_CONFIG={"background":"","backgroundCover":""}
  26 +
  27 +# 大屏模板2图片配置(背景图、中央图)
  28 +VITE_Bi_TECHNOLOGY_CONFIG={"background":"","backgroundCover":""}
  29 +
  30 +# 版权信息
  31 +VITE_COPYRIGHT = {"copyright": "Copyright © 2026 能源管理系统","record": ""}
\ No newline at end of file
... ...
  1 +node_modules
  2 +.DS_Store
  3 +dist
  4 +dist-ssr
  5 +package-lock.json
  6 +yarn.lock
  7 +*.local
  8 +.idea
  9 +/*.log
  10 +/.vscode
... ...
  1 +# 是否锁定npm install 时的Node版本
  2 +engine-strict = true
... ...
  1 +/dist/*
  2 +.local
  3 +.output.js
  4 +/node_modules/**
  5 +
  6 +**/*.svg
  7 +**/*.sh
\ No newline at end of file
... ...
  1 +module.exports = {
  2 + tabWidth: 2,
  3 + semi: true,
  4 + printWidth: 160,
  5 + singleQuote: true,
  6 + quoteProps: 'consistent',
  7 + htmlWhitespaceSensitivity: 'strict',
  8 + vueIndentScriptAndStyle: true,
  9 +};
... ...
  1 +module.exports = {
  2 + extends: [
  3 + 'stylelint-config-standard',
  4 + 'stylelint-config-rational-order',
  5 + 'stylelint-config-prettier',
  6 + 'stylelint-config-recommended-vue',
  7 + ],
  8 + defaultSeverity: 'warning',
  9 + plugins: ['stylelint-order'],
  10 + rules: {
  11 + 'at-rule-no-unknown': [
  12 + true,
  13 + {
  14 + ignoreAtRules: ['plugin'],
  15 + },
  16 + ],
  17 + 'rule-empty-line-before': [
  18 + 'always',
  19 + {
  20 + except: ['after-single-line-comment', 'first-nested'],
  21 + },
  22 + ],
  23 + 'selector-pseudo-class-no-unknown': [
  24 + true,
  25 + {
  26 + ignorePseudoClasses: ['deep'],
  27 + },
  28 + ],
  29 + },
  30 +};
... ...
  1 +FROM nginx:latest
  2 +
  3 +# 将项目根目录下dist文件夹下的所有文件复制到镜像中 /usr/share/nginx/html/ 目录下
  4 +COPY dist/ /usr/share/nginx/html/
  5 +# default.conf 为nginx默认配置文件
  6 +COPY default.conf /etc/nginx/conf.d/default.conf
\ No newline at end of file
... ...
  1 +# Vue3-Arco-Design
  2 +
  3 +#### Description
  4 +使用Vue3+TypeScript+Pinain+Arco Design构建
  5 +
  6 +#### Software Architecture
  7 +Software architecture description
  8 +
  9 +#### Installation
  10 +
  11 +1. xxxx
  12 +2. xxxx
  13 +3. xxxx
  14 +
  15 +#### Instructions
  16 +
  17 +1. xxxx
  18 +2. xxxx
  19 +3. xxxx
  20 +
  21 +#### Contribution
  22 +
  23 +1. Fork the repository
  24 +2. Create Feat_xxx branch
  25 +3. Commit your code
  26 +4. Create Pull Request
  27 +
  28 +
  29 +#### Gitee Feature
  30 +
  31 +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
  32 +2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
  33 +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
  34 +4. The most valuable open source project [GVP](https://gitee.com/gvp)
  35 +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
  36 +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
... ...
  1 +# Arco 文档:https://arco.design/vue/docs/start
  2 +# Arco Design Pro
  3 +
  4 +## 配置
  5 +```
  6 +1、配置Host
  7 + # 由于不同网络对镜像的访问有限制,所以统一配置Host
  8 + 185.199.110.133 raw.githubusercontent.com
  9 +
  10 +2、配置源
  11 + npm config set registry https://registry.npmmirror.com/ -g
  12 +
  13 +3、查看
  14 + npm config get registry
  15 +
  16 +## 安装项目依赖
  17 +```
  18 +npm install
  19 +```
  20 +
  21 +### 运行项目
  22 +```
  23 +npm run dev
  24 +```
  25 +
  26 +### 打包发布
  27 +```
  28 +npm run build
  29 +```
  30 +
  31 +### 打包发布(Demo站点)
  32 +```
  33 +npm run build:demo
  34 +```
... ...
  1 +module.exports = {
  2 + plugins: ['@vue/babel-plugin-jsx'],
  3 +}
... ...
  1 +// @see: https://cz-git.qbenben.com/zh/guide
  2 +/** @type {import('cz-git').UserConfig} */
  3 +
  4 +module.exports = {
  5 + ignores: [(commit) => commit.includes('init')],
  6 + extends: ['@commitlint/config-conventional'],
  7 + rules: {
  8 + // @see: https://commitlint.js.org/#/reference-rules
  9 + 'body-leading-blank': [2, 'always'],
  10 + 'footer-leading-blank': [1, 'always'],
  11 + 'header-max-length': [2, 'always', 108],
  12 + 'subject-empty': [2, 'never'],
  13 + 'type-empty': [2, 'never'],
  14 + 'subject-case': [0],
  15 + 'type-enum': [
  16 + 2,
  17 + 'always',
  18 + [
  19 + 'feat',
  20 + 'fix',
  21 + 'docs',
  22 + 'style',
  23 + 'refactor',
  24 + 'perf',
  25 + 'test',
  26 + 'build',
  27 + 'ci',
  28 + 'chore',
  29 + 'revert',
  30 + 'wip',
  31 + 'workflow',
  32 + 'types',
  33 + 'release',
  34 + ],
  35 + ],
  36 + },
  37 + prompt: {
  38 + alias: { fd: 'docs: fix typos' },
  39 + messages: {
  40 + type: '选择你要提交的类型 :',
  41 + scope: '选择一个提交范围(可选):',
  42 + customScope: '请输入自定义的提交范围 :',
  43 + subject: '填写简短精炼的变更描述 :\n',
  44 + body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
  45 + breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
  46 + footerPrefixesSelect: '选择关联issue前缀(可选):',
  47 + customFooterPrefix: '输入自定义issue前缀 :',
  48 + footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
  49 + confirmCommit: '是否提交或修改commit ?',
  50 + },
  51 + types: [
  52 + // 中文版
  53 + { value: 'feat', name: '特性: 🚀 新增功能', emoji: '🚀' },
  54 + { value: 'fix', name: '修复: 🧩 修复缺陷', emoji: '🧩' },
  55 + { value: 'docs', name: '文档: 📚 文档变更', emoji: '📚' },
  56 + {
  57 + value: 'reformat',
  58 + name: '格式: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)',
  59 + emoji: '🎨',
  60 + },
  61 + {
  62 + value: 'refactor',
  63 + name: '重构: ♻️ 代码重构(不包括 bug 修复、功能新增)',
  64 + emoji: '♻️',
  65 + },
  66 + { value: 'perf', name: '性能: ⚡️ 性能优化', emoji: '⚡️' },
  67 + {
  68 + value: 'test',
  69 + name: '测试: ✅ 添加疏漏测试或已有测试改动',
  70 + emoji: '✅',
  71 + },
  72 + {
  73 + value: 'build',
  74 + name: '构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)',
  75 + emoji: '📦️',
  76 + },
  77 + { value: 'ci', name: '集成: 🎡 修改 CI 配置、脚本', emoji: '🎡' },
  78 + { value: 'revert', name: '回退: ⏪️ 回滚 commit', emoji: '⏪️' },
  79 + {
  80 + value: 'chore',
  81 + name: '其他: 🔨 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
  82 + emoji: '🔨',
  83 + },
  84 + ],
  85 + useEmoji: true,
  86 + emojiAlign: 'center',
  87 + useAI: false,
  88 + aiNumber: 1,
  89 + themeColorCode: '',
  90 + scopes: [],
  91 + allowCustomScopes: true,
  92 + allowEmptyScopes: true,
  93 + customScopesAlign: 'bottom',
  94 + customScopesAlias: 'custom',
  95 + emptyScopesAlias: 'empty',
  96 + upperCaseSubject: false,
  97 + markBreakingChangeMode: false,
  98 + allowBreakingChanges: ['feat', 'fix'],
  99 + breaklineNumber: 100,
  100 + breaklineChar: '|',
  101 + skipQuestions: [],
  102 + issuePrefixes: [
  103 + { value: 'closed', name: 'closed: ISSUES has been processed' },
  104 + ],
  105 + customIssuePrefixAlign: 'top',
  106 + emptyIssuePrefixAlias: 'skip',
  107 + customIssuePrefixAlias: 'custom',
  108 + allowCustomIssuePrefix: true,
  109 + allowEmptyIssuePrefix: true,
  110 + confirmColorize: true,
  111 + maxHeaderLength: Infinity,
  112 + maxSubjectLength: Infinity,
  113 + minSubjectLength: 0,
  114 + scopeOverrides: undefined,
  115 + defaultBody: '',
  116 + defaultIssues: '',
  117 + defaultScope: '',
  118 + defaultSubject: '',
  119 + },
  120 +}
... ...
  1 +// generated by unplugin-vue-components
  2 +// We suggest you to commit this file into source control
  3 +// Read more: https://github.com/vuejs/core/pull/3399
  4 +import '@vue/runtime-core'
  5 +
  6 +export {}
  7 +
  8 +declare module '@vue/runtime-core' {
  9 + export interface GlobalComponents {
  10 + AAffix: typeof import('@arco-design/web-vue')['Affix']
  11 + AAlert: typeof import('@arco-design/web-vue')['Alert']
  12 + AAvatar: typeof import('@arco-design/web-vue')['Avatar']
  13 + ABadge: typeof import('@arco-design/web-vue')['Badge']
  14 + ABreadcrumb: typeof import('@arco-design/web-vue')['Breadcrumb']
  15 + ABreadcrumbItem: typeof import('@arco-design/web-vue')['BreadcrumbItem']
  16 + AButton: typeof import('@arco-design/web-vue')['Button']
  17 + ACard: typeof import('@arco-design/web-vue')['Card']
  18 + ACardMeta: typeof import('@arco-design/web-vue')['CardMeta']
  19 + ACascader: typeof import('@arco-design/web-vue')['Cascader']
  20 + ACheckbox: typeof import('@arco-design/web-vue')['Checkbox']
  21 + ACheckboxGroup: typeof import('@arco-design/web-vue')['CheckboxGroup']
  22 + ACol: typeof import('@arco-design/web-vue')['Col']
  23 + ACollapse: typeof import('@arco-design/web-vue')['Collapse']
  24 + ACollapseItem: typeof import('@arco-design/web-vue')['CollapseItem']
  25 + AColorPicker: typeof import('@arco-design/web-vue')['ColorPicker']
  26 + AComment: typeof import('@arco-design/web-vue')['Comment']
  27 + AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider']
  28 + ADatePicker: typeof import('@arco-design/web-vue')['DatePicker']
  29 + ADescriptions: typeof import('@arco-design/web-vue')['Descriptions']
  30 + ADescriptionsItem: typeof import('@arco-design/web-vue')['DescriptionsItem']
  31 + ADivider: typeof import('@arco-design/web-vue')['Divider']
  32 + ADoption: typeof import('@arco-design/web-vue')['Doption']
  33 + ADrawer: typeof import('@arco-design/web-vue')['Drawer']
  34 + ADropdown: typeof import('@arco-design/web-vue')['Dropdown']
  35 + AEmpty: typeof import('@arco-design/web-vue')['Empty']
  36 + AForm: typeof import('@arco-design/web-vue')['Form']
  37 + AFormItem: typeof import('@arco-design/web-vue')['FormItem']
  38 + AGrid: typeof import('@arco-design/web-vue')['Grid']
  39 + AGridItem: typeof import('@arco-design/web-vue')['GridItem']
  40 + AInput: typeof import('@arco-design/web-vue')['Input']
  41 + AInputNumber: typeof import('@arco-design/web-vue')['InputNumber']
  42 + AInputPassword: typeof import('@arco-design/web-vue')['InputPassword']
  43 + AInputSearch: typeof import('@arco-design/web-vue')['InputSearch']
  44 + ALayout: typeof import('@arco-design/web-vue')['Layout']
  45 + ALayoutContent: typeof import('@arco-design/web-vue')['LayoutContent']
  46 + ALayoutFooter: typeof import('@arco-design/web-vue')['LayoutFooter']
  47 + ALayoutHeader: typeof import('@arco-design/web-vue')['LayoutHeader']
  48 + ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider']
  49 + ALink: typeof import('@arco-design/web-vue')['Link']
  50 + AList: typeof import('@arco-design/web-vue')['List']
  51 + AListItem: typeof import('@arco-design/web-vue')['ListItem']
  52 + AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta']
  53 + AMenu: typeof import('@arco-design/web-vue')['Menu']
  54 + AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
  55 + AModal: typeof import('@arco-design/web-vue')['Modal']
  56 + AOption: typeof import('@arco-design/web-vue')['Option']
  57 + APagination: typeof import('@arco-design/web-vue')['Pagination']
  58 + APopconfirm: typeof import('@arco-design/web-vue')['Popconfirm']
  59 + APopover: typeof import('@arco-design/web-vue')['Popover']
  60 + AProgress: typeof import('@arco-design/web-vue')['Progress']
  61 + ARadio: typeof import('@arco-design/web-vue')['Radio']
  62 + ARadioGroup: typeof import('@arco-design/web-vue')['RadioGroup']
  63 + ARangePicker: typeof import('@arco-design/web-vue')['RangePicker']
  64 + AResult: typeof import('@arco-design/web-vue')['Result']
  65 + ARow: typeof import('@arco-design/web-vue')['Row']
  66 + ASelect: typeof import('@arco-design/web-vue')['Select']
  67 + ASkeleton: typeof import('@arco-design/web-vue')['Skeleton']
  68 + ASkeletonLine: typeof import('@arco-design/web-vue')['SkeletonLine']
  69 + ASpace: typeof import('@arco-design/web-vue')['Space']
  70 + ASpin: typeof import('@arco-design/web-vue')['Spin']
  71 + AStatistic: typeof import('@arco-design/web-vue')['Statistic']
  72 + AStep: typeof import('@arco-design/web-vue')['Step']
  73 + ASteps: typeof import('@arco-design/web-vue')['Steps']
  74 + ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
  75 + ASwitch: typeof import('@arco-design/web-vue')['Switch']
  76 + ATable: typeof import('@arco-design/web-vue')['Table']
  77 + ATableColumn: typeof import('@arco-design/web-vue')['TableColumn']
  78 + ATabPane: typeof import('@arco-design/web-vue')['TabPane']
  79 + ATabs: typeof import('@arco-design/web-vue')['Tabs']
  80 + ATag: typeof import('@arco-design/web-vue')['Tag']
  81 + ATextarea: typeof import('@arco-design/web-vue')['Textarea']
  82 + ATimeline: typeof import('@arco-design/web-vue')['Timeline']
  83 + ATimelineItem: typeof import('@arco-design/web-vue')['TimelineItem']
  84 + ATimePicker: typeof import('@arco-design/web-vue')['TimePicker']
  85 + ATooltip: typeof import('@arco-design/web-vue')['Tooltip']
  86 + ATree: typeof import('@arco-design/web-vue')['Tree']
  87 + ATreeSelect: typeof import('@arco-design/web-vue')['TreeSelect']
  88 + ATrigger: typeof import('@arco-design/web-vue')['Trigger']
  89 + ATypography: typeof import('@arco-design/web-vue')['Typography']
  90 + ATypographyParagraph: typeof import('@arco-design/web-vue')['TypographyParagraph']
  91 + ATypographyText: typeof import('@arco-design/web-vue')['TypographyText']
  92 + ATypographyTitle: typeof import('@arco-design/web-vue')['TypographyTitle']
  93 + AUpload: typeof import('@arco-design/web-vue')['Upload']
  94 + RouterLink: typeof import('vue-router')['RouterLink']
  95 + RouterView: typeof import('vue-router')['RouterView']
  96 + }
  97 +}
... ...
  1 +/**
  2 + * If you use the template method for development, you can use the unplugin-vue-components plugin to enable on-demand loading support.
  3 + * 按需引入
  4 + * https://github.com/antfu/unplugin-vue-components
  5 + * https://arco.design/vue/docs/start
  6 + * Although the Pro project is full of imported components, this plugin will be used by default.
  7 + * 虽然Pro项目中是全量引入组件,但此插件会默认使用。
  8 + */
  9 +import Components from 'unplugin-vue-components/vite'
  10 +import { ArcoResolver } from 'unplugin-vue-components/resolvers'
  11 +
  12 +export default function configArcoResolverPlugin() {
  13 + const arcoResolverPlugin = Components({
  14 + dirs: [], // Avoid parsing src/components. 避免解析到src/components
  15 + deep: false,
  16 + resolvers: [ArcoResolver()],
  17 + })
  18 + return arcoResolverPlugin
  19 +}
... ...
  1 +/**
  2 + * Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated
  3 + * gzip压缩
  4 + * https://github.com/anncwb/vite-plugin-compression
  5 + */
  6 +import type { Plugin } from 'vite'
  7 +import compressPlugin from 'vite-plugin-compression'
  8 +
  9 +export default function configCompressPlugin(
  10 + compress: 'gzip' | 'brotli',
  11 + deleteOriginFile = false
  12 +): Plugin | Plugin[] {
  13 + const plugins: Plugin[] = []
  14 +
  15 + if (compress === 'gzip') {
  16 + plugins.push(
  17 + compressPlugin({
  18 + ext: '.gz',
  19 + deleteOriginFile,
  20 + })
  21 + )
  22 + }
  23 +
  24 + if (compress === 'brotli') {
  25 + plugins.push(
  26 + compressPlugin({
  27 + ext: '.br',
  28 + algorithm: 'brotliCompress',
  29 + deleteOriginFile,
  30 + })
  31 + )
  32 + }
  33 + return plugins
  34 +}
... ...
  1 +/**
  2 + * Image resource files used to compress the output of the production environment
  3 + * 图片压缩
  4 + * https://github.com/anncwb/vite-plugin-imagemin
  5 + */
  6 +import viteImagemin from 'vite-plugin-imagemin'
  7 +
  8 +export default function configImageminPlugin() {
  9 + const imageminPlugin = viteImagemin({
  10 + gifsicle: {
  11 + optimizationLevel: 7,
  12 + interlaced: false,
  13 + },
  14 + optipng: {
  15 + optimizationLevel: 7,
  16 + },
  17 + mozjpeg: {
  18 + quality: 20,
  19 + },
  20 + pngquant: {
  21 + quality: [0.8, 0.9],
  22 + speed: 4,
  23 + },
  24 + svgo: {
  25 + plugins: [
  26 + {
  27 + name: 'removeViewBox',
  28 + },
  29 + {
  30 + name: 'removeEmptyAttrs',
  31 + active: false,
  32 + },
  33 + ],
  34 + },
  35 + })
  36 + return imageminPlugin
  37 +}
... ...
  1 +/**
  2 + * Introduces component library styles on demand.
  3 + * 按需引入组件库样式
  4 + * https://github.com/anncwb/vite-plugin-style-import
  5 + */
  6 +
  7 +import styleImport from 'vite-plugin-style-import'
  8 +
  9 +export default function configStyleImportPlugin() {
  10 + const styleImportPlugin = styleImport({
  11 + libs: [
  12 + {
  13 + libraryName: '@arco-design/web-vue',
  14 + esModule: true,
  15 + resolveStyle: (name) => {
  16 + // The use of this part of the component must depend on the parent, so it can be ignored directly.
  17 + // 这部分组件的使用必须依赖父级,所以直接忽略即可。
  18 + const ignoreList = [
  19 + 'config-provider',
  20 + 'anchor-link',
  21 + 'sub-menu',
  22 + 'menu-item',
  23 + 'menu-item-group',
  24 + 'breadcrumb-item',
  25 + 'form-item',
  26 + 'step',
  27 + 'card-grid',
  28 + 'card-meta',
  29 + 'collapse-panel',
  30 + 'collapse-item',
  31 + 'descriptions-item',
  32 + 'list-item',
  33 + 'list-item-meta',
  34 + 'table-column',
  35 + 'table-column-group',
  36 + 'tab-pane',
  37 + 'tab-content',
  38 + 'timeline-item',
  39 + 'tree-node',
  40 + 'skeleton-line',
  41 + 'skeleton-shape',
  42 + 'grid-item',
  43 + 'carousel-item',
  44 + 'doption',
  45 + 'option',
  46 + 'optgroup',
  47 + 'icon',
  48 + 'dsubmenu',
  49 + 'dgroup',
  50 + ]
  51 + // List of components that need to map imported styles
  52 + // 需要映射引入样式的组件列表
  53 + const replaceList = {
  54 + 'typography-text': 'typography',
  55 + 'typography-title': 'typography',
  56 + 'typography-paragraph': 'typography',
  57 + 'typography-link': 'typography',
  58 + 'dropdown-button': 'dropdown',
  59 + 'input-password': 'input',
  60 + 'input-search': 'input',
  61 + 'input-group': 'input',
  62 + 'radio-group': 'radio',
  63 + 'checkbox-group': 'checkbox',
  64 + 'layout-sider': 'layout',
  65 + 'layout-content': 'layout',
  66 + 'layout-footer': 'layout',
  67 + 'layout-header': 'layout',
  68 + 'month-picker': 'date-picker',
  69 + 'range-picker': 'date-picker',
  70 + 'row': 'grid', // 'grid/row.less'
  71 + 'col': 'grid', // 'grid/col.less'
  72 + 'avatar-group': 'avatar',
  73 + 'image-preview': 'image',
  74 + 'image-preview-group': 'image',
  75 + 'cascader-panel': 'cascader',
  76 + }
  77 + if (ignoreList.includes(name)) return ''
  78 + // eslint-disable-next-line no-prototype-builtins
  79 + return replaceList.hasOwnProperty(name)
  80 + ? `@arco-design/web-vue/es/${replaceList[name]}/style/css.js`
  81 + : `@arco-design/web-vue/es/${name}/style/css.js`
  82 + // less
  83 + // return `@arco-design/web-vue/es/${name}/style/index.js`;
  84 + },
  85 + },
  86 + ],
  87 + })
  88 + return styleImportPlugin
  89 +}
... ...
  1 +/**
  2 + * Generation packaging analysis
  3 + * 生成打包分析
  4 + */
  5 +import visualizer from 'rollup-plugin-visualizer'
  6 +import { isReportMode } from '../utils'
  7 +
  8 +export default function configVisualizerPlugin() {
  9 + if (isReportMode()) {
  10 + return visualizer({
  11 + filename: './node_modules/.cache/visualizer/stats.html',
  12 + open: true,
  13 + gzipSize: true,
  14 + brotliSize: true,
  15 + })
  16 + }
  17 + return []
  18 +}
... ...
  1 +/**
  2 + * Whether to generate package preview
  3 + * 是否生成打包报告
  4 + */
  5 +export default {}
  6 +
  7 +export function isReportMode(): boolean {
  8 + return process.env.REPORT === 'true'
  9 +}
... ...
  1 +import {resolve} from 'path'
  2 +import {defineConfig} from 'vite'
  3 +import vue from '@vitejs/plugin-vue'
  4 +import vueJsx from '@vitejs/plugin-vue-jsx'
  5 +import svgLoader from 'vite-svg-loader'
  6 +export default defineConfig({
  7 + plugins: [
  8 + vue(), vueJsx(), svgLoader({svgoConfig: {}})
  9 + ],
  10 + resolve: {
  11 + alias: [
  12 + {
  13 + find: '@',
  14 + replacement: resolve(__dirname, '../src'),
  15 + },
  16 + {
  17 + find: 'assets',
  18 + replacement: resolve(__dirname, '../src/assets'),
  19 + },
  20 + {
  21 + find: 'vue-i18n',
  22 + replacement: 'vue-i18n/dist/vue-i18n.cjs.js', // Resolve the i18n warning issue
  23 + },
  24 + {
  25 + find: 'vue',
  26 + replacement: 'vue/dist/vue.esm-bundler.js', // compile template
  27 + },
  28 + ],
  29 + extensions: ['.ts', '.js'],
  30 + },
  31 + define: {
  32 + 'process.env': {},
  33 + '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': 'true',
  34 + },
  35 + css: {
  36 + preprocessorOptions: {
  37 + less: {
  38 + modifyVars: {
  39 + hack: `true; @import (reference) "${resolve(
  40 + 'src/assets/style/breakpoint.less'
  41 + )}";`,
  42 + },
  43 + javascriptEnabled: true,
  44 + },
  45 + }
  46 + },
  47 +})
... ...
  1 +import { mergeConfig } from 'vite'
  2 +// import eslint from 'vite-plugin-eslint'
  3 +import baseConfig from './vite.config.base'
  4 +export default mergeConfig(
  5 + {
  6 + mode: 'development',
  7 + server: {
  8 + host: '0.0.0.0',
  9 + port: '8888',
  10 + open: true,
  11 + fs: {
  12 + strict: true,
  13 + },
  14 + proxy:{
  15 + '/dev-api': {
  16 + target:"http://127.0.0.1:8080",
  17 + changeOrigin: true,
  18 + rewrite: (path) => path.replace(/^\/dev-api/, '')
  19 + }
  20 + }
  21 + },
  22 + plugins: [
  23 + // eslint({
  24 + // cache: false,
  25 + // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
  26 + // exclude: ['node_modules'],
  27 + // }),
  28 + ]
  29 + },
  30 + baseConfig
  31 +)
... ...
  1 +import { mergeConfig } from 'vite'
  2 +import baseConfig from './vite.config.base'
  3 +import configCompressPlugin from './plugin/compress'
  4 +import configVisualizerPlugin from './plugin/visualizer'
  5 +import configArcoResolverPlugin from './plugin/arcoResolver'
  6 +import configStyleImportPlugin from './plugin/styleImport'
  7 +import configImageminPlugin from './plugin/imagemin'
  8 +
  9 +export default mergeConfig(
  10 + {
  11 + mode: 'production',
  12 + plugins: [
  13 + configCompressPlugin('gzip'),
  14 + configVisualizerPlugin(),
  15 + configArcoResolverPlugin(),
  16 + configStyleImportPlugin(),
  17 + process.env.SKIP_IMAGEMIN === 'true' ? [] : configImageminPlugin(),
  18 + ],
  19 + build: {
  20 + rollupOptions: {
  21 + output: {
  22 + manualChunks: {
  23 + arco: ['@arco-design/web-vue'],
  24 + chart: ['echarts', 'vue-echarts'],
  25 + vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'],
  26 + },
  27 + },
  28 + },
  29 + chunkSizeWarningLimit: 2000,
  30 + },
  31 + },
  32 + baseConfig
  33 +)
... ...
  1 +server {
  2 + # 监听端口
  3 + listen 80;
  4 + server_name localhost;
  5 +
  6 + location / {
  7 + # 编译后代码文件位置
  8 + root /usr/share/nginx/html;
  9 + # 编译后代码访问页
  10 + index index.html index.htm;
  11 + # 解决URL栏直接访问404问题
  12 + try_files $uri $uri/ /index.html;
  13 + }
  14 +
  15 + # 反向代理
  16 + # /api/ 为url拦截标志 如 localhost/api/xxx 请求会被拦截 ,最后得到请求地址为 http://server/api/xxx
  17 + location /api/ {
  18 + # 实际的访问地址
  19 + # proxy_pass http://127.0.0.1:9000/;
  20 + }
  21 +
  22 + # 开启GZip压缩
  23 + gzip on;
  24 + gzip_disable "MSIE [1-6]\.";
  25 + gzip_proxied any;
  26 + gzip_min_length 1k;
  27 + gzip_comp_level 5;
  28 + gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  29 +}
\ No newline at end of file
... ...
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <meta charset="UTF-8"/>
  5 + <link
  6 + rel="shortcut icon"
  7 + type="image/x-icon"
  8 + href="./src/assets/favicon-light.ico"
  9 + />
  10 + <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  11 + <title id="app-title"></title>
  12 + <script type="module">
  13 + document.addEventListener('DOMContentLoaded', function () {
  14 + document.querySelector('#app-title').innerHTML = import.meta.env.VITE_APP_TITLE;
  15 + console.log(import.meta.env.VITE_APP_TITLE)
  16 + });
  17 + </script>
  18 + <style>
  19 + .first-loading-wrp {
  20 + display: flex;
  21 + flex-direction: column;
  22 + align-items: center;
  23 + justify-content: center;
  24 + width: 100vw;
  25 + height: 100vh;
  26 + position: fixed;
  27 + top: 0;
  28 + left: 0;
  29 + background: url("src/assets/svg/loading-background.svg") no-repeat;
  30 + background-size: 100% 100%;
  31 + }
  32 +
  33 + .first-loading-wrp > h1 {
  34 + font-size: 30px;
  35 + font-weight: bolder;
  36 + }
  37 +
  38 + .first-loading-wrp .loading-wrp {
  39 + display: flex;
  40 + align-items: center;
  41 + justify-content: center;
  42 + padding: 98px;
  43 + }
  44 +
  45 + .dot {
  46 + position: relative;
  47 + box-sizing: border-box;
  48 + display: inline-block;
  49 + width: 64px;
  50 + height: 64px;
  51 + font-size: 64px;
  52 + transform: rotate(45deg);
  53 + animation: antRotate 1.2s infinite linear;
  54 + }
  55 +
  56 + .dot i {
  57 + position: absolute;
  58 + display: block;
  59 + width: 28px;
  60 + height: 28px;
  61 + background-color: #1890ff;
  62 + border-radius: 100%;
  63 + opacity: 0.3;
  64 + transform: scale(0.75);
  65 + transform-origin: 50% 50%;
  66 + animation: antSpinMove 1s infinite linear alternate;
  67 + }
  68 +
  69 + .dot i:nth-child(1) {
  70 + top: 0;
  71 + left: 0;
  72 + }
  73 +
  74 + .dot i:nth-child(2) {
  75 + top: 0;
  76 + right: 0;
  77 + -webkit-animation-delay: 0.4s;
  78 + animation-delay: 0.4s;
  79 + }
  80 +
  81 + .dot i:nth-child(3) {
  82 + right: 0;
  83 + bottom: 0;
  84 + -webkit-animation-delay: 0.8s;
  85 + animation-delay: 0.8s;
  86 + }
  87 +
  88 + .dot i:nth-child(4) {
  89 + bottom: 0;
  90 + left: 0;
  91 + -webkit-animation-delay: 1.2s;
  92 + animation-delay: 1.2s;
  93 + }
  94 +
  95 + @keyframes antRotate {
  96 + to {
  97 + -webkit-transform: rotate(405deg);
  98 + transform: rotate(405deg);
  99 + }
  100 + }
  101 +
  102 + @-webkit-keyframes antRotate {
  103 + to {
  104 + -webkit-transform: rotate(405deg);
  105 + transform: rotate(405deg);
  106 + }
  107 + }
  108 +
  109 + @keyframes antSpinMove {
  110 + to {
  111 + opacity: 1;
  112 + }
  113 + }
  114 +
  115 + @-webkit-keyframes antSpinMove {
  116 + to {
  117 + opacity: 1;
  118 + }
  119 + }
  120 + </style>
  121 +</head>
  122 +<body>
  123 +<noscript>
  124 + <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
  125 + Please enable it to continue.</strong>
  126 +</noscript>
  127 +<div id="app">
  128 + <div class="first-loading-wrp">
  129 + <div class="loading-wrp">
  130 + <span class="dot dot-spin">
  131 + <i></i>
  132 + <i></i>
  133 + <i></i>
  134 + <i></i>
  135 + </span>
  136 + </div>
  137 + </div>
  138 +</div>
  139 +<script type="module" src="/src/main.ts"></script>
  140 +</body>
  141 +</html>
... ...
  1 +{
  2 + "name": "yunpower-ui",
  3 + "description": "能源管理系统",
  4 + "version": "1.0.0",
  5 + "private": true,
  6 + "author": "yunpower Team",
  7 + "license": "MIT",
  8 + "scripts": {
  9 + "dev": "vite --config ./config/vite.config.dev.ts --mode dev",
  10 + "build:test": "vite build --config ./config/vite.config.prod.ts --mode test",
  11 + "build:demo": "vite build --config ./config/vite.config.prod.ts --mode demo",
  12 + "build:zhongqiang": "vite build --config ./config/vite.config.prod.ts --mode zhongqiang",
  13 + "build": "vite build --config ./config/vite.config.prod.ts --mode prod",
  14 + "report": "cross-env REPORT=true npm run build",
  15 + "preview": "npm run build && vite preview --host",
  16 + "type:check": "vue-tsc --noEmit --skipLibCheck",
  17 + "lint-staged": "npx lint-staged",
  18 + "prepare": "husky install",
  19 + "commit": "cz"
  20 + },
  21 + "lint-staged": {
  22 + "*.{js,ts,jsx,tsx}": [
  23 + "prettier --write",
  24 + "eslint --fix"
  25 + ],
  26 + "*.vue": [
  27 + "prettier --write",
  28 + "eslint --fix"
  29 + ],
  30 + "*.{less,css}": [
  31 + "prettier --write"
  32 + ]
  33 + },
  34 + "config": {
  35 + "commitizen": {
  36 + "path": "node_modules/cz-git"
  37 + }
  38 + },
  39 + "dependencies": {
  40 + "@amap/amap-jsapi-loader": "^1.0.1",
  41 + "@arco-design/web-vue": "^2.55.2",
  42 + "@arco-themes/vue-ykite-theme": "^0.0.9",
  43 + "@highlightjs/vue-plugin": "^2.1.0",
  44 + "@types/crypto-js": "^4.2.2",
  45 + "@types/echarts": "^4.9.18",
  46 + "@types/file-saver": "^2.0.7",
  47 + "@vueuse/core": "^9.3.0",
  48 + "@wangeditor/editor": "^5.1.23",
  49 + "@wangeditor/editor-for-vue": "^5.1.12",
  50 + "arco-design-pro-vue": "^2.7.2",
  51 + "axios": "1.6.0",
  52 + "bignumber.js": "^9.1.2",
  53 + "color": "^4.2.3",
  54 + "crypto-js": "^4.2.0",
  55 + "date-fns": "^2.30.0",
  56 + "dayjs": "^1.11.5",
  57 + "echarts": "^5.4.0",
  58 + "echarts-liquidfill": "^3.1.0",
  59 + "file-saver": "^2.0.5",
  60 + "grid-layout-plus": "^1.0.5",
  61 + "highlight.js": "^11.8.0",
  62 + "js-beautify": "^1.14.11",
  63 + "lodash": "^4.17.21",
  64 + "mitt": "^3.0.0",
  65 + "nprogress": "^0.2.0",
  66 + "pinia": "^2.0.23",
  67 + "pinia-plugin-persistedstate": "^3.1.0",
  68 + "qs": "^6.11.2",
  69 + "sortablejs": "^1.15.0",
  70 + "table-excel": "^2.0.5",
  71 + "vue": "^3.2.40",
  72 + "vue-echarts": "^6.2.3",
  73 + "vue-i18n": "^9.2.2",
  74 + "vue-router": "^4.0.14"
  75 + },
  76 + "devDependencies": {
  77 + "@arco-plugins/vite-vue": "^1.4.5",
  78 + "@commitlint/cli": "^17.1.2",
  79 + "@commitlint/config-conventional": "^17.1.0",
  80 + "@types/color": "^3.0.6",
  81 + "@types/lodash": "^4.14.186",
  82 + "@types/nprogress": "^0.2.0",
  83 + "@types/qs": "^6.9.10",
  84 + "@types/sortablejs": "^1.15.0",
  85 + "@typescript-eslint/eslint-plugin": "^5.40.0",
  86 + "@typescript-eslint/parser": "^5.40.0",
  87 + "@vitejs/plugin-vue": "^3.1.2",
  88 + "@vitejs/plugin-vue-jsx": "^2.0.1",
  89 + "@vue/babel-plugin-jsx": "^1.1.1",
  90 + "consola": "^2.15.3",
  91 + "cross-env": "^7.0.3",
  92 + "cz-git": "^1.5.3",
  93 + "eslint": "^8.25.0",
  94 + "eslint-config-airbnb-base": "^15.0.0",
  95 + "eslint-config-prettier": "^8.5.0",
  96 + "eslint-import-resolver-typescript": "^3.5.1",
  97 + "eslint-plugin-import": "^2.26.0",
  98 + "eslint-plugin-prettier": "^4.2.1",
  99 + "eslint-plugin-vue": "^9.6.0",
  100 + "husky": "^8.0.1",
  101 + "less": "^4.1.3",
  102 + "less-loader": "^11.1.3",
  103 + "lint-staged": "^13.0.3",
  104 + "postcss-html": "^1.5.0",
  105 + "prettier": "^2.7.1",
  106 + "rollup": "^3.9.1",
  107 + "rollup-plugin-visualizer": "^5.8.2",
  108 + "stylelint": "^14.13.0",
  109 + "stylelint-config-prettier": "^9.0.3",
  110 + "stylelint-config-rational-order": "^0.1.2",
  111 + "stylelint-config-recommended-vue": "^1.4.0",
  112 + "stylelint-config-standard": "^29.0.0",
  113 + "stylelint-order": "^5.0.0",
  114 + "typescript": "^5.4.5",
  115 + "unplugin-vue-components": "^0.22.12",
  116 + "vite": "3.2.7",
  117 + "vite-plugin-compression": "^0.5.1",
  118 + "vite-plugin-eslint": "^1.8.1",
  119 + "vite-plugin-imagemin": "^0.6.1",
  120 + "vite-plugin-style-import": "1.4.1",
  121 + "vite-svg-loader": "^3.6.0",
  122 + "vue-tsc": "^1.8.27",
  123 + "ws": "^8.17.0"
  124 + },
  125 + "engines": {
  126 + "node": ">=18.0.0"
  127 + },
  128 + "resolutions": {
  129 + "bin-wrapper": "npm:bin-wrapper-china",
  130 + "rollup": "^2.56.3",
  131 + "gifsicle": "5.2.0"
  132 + }
  133 +}
... ...
  1 +#!/bin/bash
  2 +# 定义参数
  3 +image_name="app-nginx"
  4 +container_name="app"
  5 +# 编译项目 yarn可替换为项目所用包管理器
  6 +yarn && yarn build
  7 +# 停止正在运行的容器并移除
  8 +docker stop ${container_name} && docker rm ${container_name}
  9 +# 以时间戳为tag
  10 +tag=${image_name}:$(date "+%Y%m%d%H%M%S")
  11 +# 编译docker镜像
  12 +docker build -t ${tag} .
  13 +# 启动容器
  14 +docker run -d --name ${container_name} --restart=always -p 800:80 ${tag}
\ No newline at end of file
... ...
  1 +<template>
  2 + <a-config-provider :locale="locale">
  3 + <router-view/>
  4 + <global-setting/>
  5 + </a-config-provider>
  6 +</template>
  7 +
  8 +<script lang="ts" setup>
  9 +import {computed, provide, ref} from 'vue';
  10 +import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
  11 +import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
  12 +import {useDark, useToggle} from '@vueuse/core'
  13 +import GlobalSetting from '@/components/global-setting/index.vue';
  14 +import useLocale from '@/hooks/locale';
  15 +const {currentLocale} = useLocale();
  16 +import {DeviceVarAlarmMessage, SocketMessage, useSocket, WebSocketBaseMessage} from '@/api/websocketService'
  17 +import {useAppStore} from "@/store";
  18 +
  19 +const locale = computed(() => {
  20 + switch (currentLocale.value) {
  21 + case 'zh-CN':
  22 + return zhCN
  23 + case 'en-US':
  24 + return enUS
  25 + default:
  26 + return enUS
  27 + }
  28 +})
  29 +const appStore = useAppStore();
  30 +const isDark = useDark({
  31 + selector: 'body',
  32 + attribute: 'arco-theme',
  33 + valueDark: 'dark',
  34 + valueLight: 'light',
  35 + storageKey: 'arco-theme',
  36 + onChanged(dark: boolean) {
  37 + // overridden default behavior
  38 + appStore.toggleTheme(dark)
  39 + },
  40 +})
  41 +useToggle(isDark);
  42 +
  43 +const webSocketData = ref<SocketMessage | DeviceVarAlarmMessage>({
  44 + value: 0
  45 +})
  46 +const {on, send} = useSocket(import.meta.env.VITE_WEBSOCKET_URL);
  47 +/**
  48 + * 收到服务端数据
  49 + */
  50 +on('message', (message: WebSocketBaseMessage) => {
  51 + webSocketData.value = message.bizData;
  52 +});
  53 +/**
  54 + * 像socket 发送订阅消息
  55 + * @param message
  56 + */
  57 +const sendData = (message: { action: string, bizSn: any}) => {
  58 + const params = {
  59 + action: message.action,
  60 + bizSn: message.bizSn
  61 + }
  62 + if(params.bizSn && params.bizSn.length > 0){
  63 + send(JSON.stringify(params))
  64 + }
  65 +}
  66 +
  67 +provide('webSocketData', {
  68 + data: webSocketData,
  69 + sendData:sendData
  70 +});
  71 +</script>
... ...
  1 +import { AxiosResponse } from 'axios';
  2 +
  3 +declare module 'axios' {
  4 + export interface AxiosResponse<T = any> {
  5 + code: number;
  6 + captchaEnabled: boolean;
  7 + img: string;
  8 + msg: string;
  9 + uuid: string;
  10 + token: string;
  11 + permissions: string[];
  12 + roles: string[];
  13 + user: UserInfo;
  14 + data: T;
  15 + }
  16 +}
... ...
  1 +export interface AxiosResult {
  2 + code:number,
  3 + msg:string,
  4 + data:object,
  5 + rows:object,
  6 + total:number
  7 +}
\ No newline at end of file
... ...
  1 +import { PaginationProps } from "@arco-design/web-vue";
  2 +import { reactive } from "vue";
  3 +
  4 +export const BasePagination = () => {
  5 + return {
  6 + current: 1,
  7 + pageSize: 20,
  8 + showPageSize: true,
  9 + showJumper: true,
  10 + size: "medium",
  11 + defaultPageSize: 20,
  12 + showTotal: true,
  13 + pageSizeOptions: [10, 20, 30, 50, 100],
  14 + };
  15 +};
  16 +
  17 +export const Pagination: PaginationProps = reactive({
  18 + ...BasePagination(),
  19 + showPageSize: true,
  20 + showJumper: true,
  21 + size: "medium",
  22 + defaultPageSize: 20,
  23 + showTotal: true,
  24 + pageSizeOptions: [10, 20, 30, 50, 100],
  25 +});
... ...
  1 +import axios from 'axios'
  2 +
  3 +export interface ContentDataRecord {
  4 + x: string
  5 + y: number
  6 +}
  7 +
  8 +export function queryContentData() {
  9 + return axios.get<ContentDataRecord[]>('/api/content-data')
  10 +}
  11 +
  12 +export interface PopularRecord {
  13 + key: number
  14 + clickNumber: string
  15 + title: string
  16 + increases: number
  17 +}
  18 +
  19 +export function queryPopularList(params: { type: string }) {
  20 + return axios.get<any[]>('/api/popular/list', { params })
  21 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +import {LocationQueryValue} from "vue-router";
  4 +
  5 +/**
  6 + * 获取卡片配置布局
  7 + * @param pageKey 查询参数
  8 + * @returns 结果
  9 + */
  10 +export function getCardConfig(pageKey: string) {
  11 + return axios.get(`/system/dashboard/config/${pageKey}`, {
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 新增卡片配置布局
  20 + * @param data 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function updateDashboardConfig(data: any) {
  24 + return axios.put("/system/dashboard/config", data);
  25 +}
  26 +
  27 +/**
  28 + * 获取卡片信息
  29 + * @param data 查询参数
  30 + * @returns 结果
  31 + */
  32 +export function getConfigCard(data: any) {
  33 + // let {dashboardConfigId, cardKey} =data
  34 + // console.log(dashboardConfigId, cardKey)
  35 + return axios.get(`/system/dashboard/card/config/${data.dashboardConfigId}/${data.cardKey}`);
  36 +}
  37 +
  38 +/**
  39 + * 保存卡片信息
  40 + * @param data 查询参数
  41 + * @returns 结果
  42 + */
  43 +export function updateConfigCard(data: any) {
  44 + return axios.put("/system/dashboard/card/config", data);
  45 +}
  46 +
  47 +/**
  48 + * 获取仪表盘配置详细信息
  49 + * @param id
  50 + */
  51 +export function getConfigInfo(id: string | null) {
  52 + return axios.get(`/system/dashboard/config/getInfo/${id}`);
  53 +}
  54 +
  55 +/**
  56 + * 获取图表详情
  57 + */
  58 +interface ChartInfo {
  59 + configId: number, //配置ID
  60 + cardKey: number | string, //卡片key
  61 + deviceSn?: string, //设备编号
  62 + dayTime?: string, //天日期
  63 + monthTime?: string, //月日期
  64 + yearTime?: string //年日期
  65 +}
  66 +
  67 +export function getChartInfo(params: ChartInfo) {
  68 + return axios.get('/datav/common/chart/getChart', {
  69 + params,
  70 + paramsSerializer: (params) => {
  71 + return qs.stringify(params);
  72 + }
  73 + });
  74 +}
... ...
  1 +import {blobValidate, tansParams} from '@/utils/ruoyi';
  2 +import {ElMapExportTable} from "table-excel";
  3 +import {Message} from '@arco-design/web-vue';
  4 +import {saveAs} from 'file-saver'
  5 +import axios from 'axios'
  6 +import errorCode from '@/utils/errorCode';
  7 +import dayjs from "dayjs";
  8 +
  9 +// 通用下载方法
  10 +export function download(url: any, params: any, filename: any) {
  11 + Message.loading({
  12 + content: "正在下载数据,请稍候",
  13 + duration: 6000 * 1000
  14 + });
  15 + return axios.post(url, params, {
  16 + transformRequest: [(params) => {
  17 + return tansParams(params)
  18 + }],
  19 + headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  20 + responseType: 'blob',
  21 + }).then(async (data: any) => {
  22 + const isBlob = await blobValidate(data);
  23 + if (isBlob) {
  24 + Message.clear();
  25 + Message.success("导出成功");
  26 + const blob = new Blob([data])
  27 + saveAs(blob, filename)
  28 + } else {
  29 + const resText = await data.text();
  30 + const rspObj: any = JSON.parse(resText);
  31 + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
  32 + Message.error(errMsg);
  33 + }
  34 +
  35 + }).catch((r) => {
  36 + Message.clear();
  37 + console.error(r)
  38 + Message.error('下载文件出现错误,请联系管理员!')
  39 + })
  40 +}
  41 +
  42 +interface ITable {
  43 + column: Array<any>,
  44 + data: Array<any>
  45 +}
  46 +
  47 +/**
  48 + * 表格文件下载-纯前端
  49 + * @param tableInfo 表格文件
  50 + * @param xlsxName 文件民名称
  51 + * @return Boolean
  52 + */
  53 +export async function tableExport(tableInfo: ITable, xlsxName: string) {
  54 + Message.loading({
  55 + content: "正在下载数据,请稍候",
  56 + duration: 6000 * 1000
  57 + });
  58 + try {
  59 + await new ElMapExportTable(tableInfo).download(`${xlsxName} ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`);
  60 + Message.clear();
  61 + Message.success("导出成功");
  62 + } catch (error) {
  63 + Message.clear();
  64 + Message.error("导出失败");
  65 + }
  66 +}
... ...
  1 +import {useUserStore} from '@/store';
  2 +import {getToken, getTokenHandler} from '@/utils/auth';
  3 +import {Message, Modal} from '@arco-design/web-vue';
  4 +import type {AxiosRequestConfig, AxiosResponse} from 'axios';
  5 +import cache from "@/utils/cache";
  6 +import axios from 'axios';
  7 +
  8 +// 是否显示重新登录
  9 +let isRelogin = {show: false};
  10 +
  11 +// 拦截器
  12 +export interface HttpResponse<T = unknown> {
  13 + status: number;
  14 + msg: string;
  15 + code: number;
  16 + data: T;
  17 +}
  18 +
  19 +if (import.meta.env.VITE_API_BASE_URL) {
  20 + axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL;
  21 +}
  22 +
  23 +axios.interceptors.request.use(
  24 + (config: AxiosRequestConfig) => {
  25 + // 在拦截器中添加Token信息
  26 + const tokenHandler = getTokenHandler();
  27 + const token = getToken();
  28 + if (token && tokenHandler) {
  29 + if (!config.headers) {
  30 + config.headers = {};
  31 + }
  32 + config.headers[tokenHandler] = `Bearer ${token}`;
  33 + }
  34 + //30秒超时
  35 + config.timeout = 30 * 1000;
  36 + config.timeoutErrorMessage = '接口超时';
  37 + if (config.method === 'post' || config.method === 'put'||config.method === 'delete') {
  38 + const requestObj = {
  39 + url: config.url,
  40 + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
  41 + time: new Date().getTime()
  42 + }
  43 + const sessionObj = cache.session.getJSON('sessionObj')
  44 + if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
  45 + cache.session.setJSON('sessionObj', requestObj)
  46 + } else {
  47 + const s_url = sessionObj.url; // 请求地址
  48 + const s_data = sessionObj.data; // 请求数据
  49 + const s_time = sessionObj.time; // 请求时间
  50 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
  51 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
  52 + const message = '数据正在处理,请勿重复提交';
  53 + console.error(`[${s_url}]: ` + message)
  54 + return Promise.reject(new Error(message))
  55 + } else {
  56 + cache.session.setJSON('sessionObj', requestObj)
  57 + }
  58 + }
  59 + }
  60 + return config;
  61 + },
  62 + (error) => {
  63 + // do something
  64 + return Promise.reject(error);
  65 + }
  66 +);
  67 +// add response interceptors
  68 +axios.interceptors.response.use(
  69 + (response: AxiosResponse<any>): Promise<AxiosResponse<any>> => {
  70 + const whiteUrlList = ['https://arco.design/themes/api/open/themes/list'];
  71 + if (['blob', 'arraybuffer'].includes(response.config.responseType as string) || whiteUrlList.includes(response.config.url as string)) {
  72 + return response.data;
  73 + }
  74 + const {code, msg} = response.data;
  75 + const codeNumber = Number(code);
  76 + if (codeNumber !== 200) {
  77 + if (codeNumber == 401) {
  78 + //检查是否已经弹出提示框
  79 + if (!isRelogin.show) {
  80 + isRelogin.show = true;
  81 + Modal.error({
  82 + title: '系统提示',
  83 + content: '登录状态已过期,您可以继续留在该页面,或者重新登录',
  84 + okText: '重新登录',
  85 + maskClosable: false,
  86 + async onOk() {
  87 + const userStore = useUserStore();
  88 + await userStore.logout();
  89 + window.location.reload();
  90 + },
  91 + });
  92 + }
  93 + }
  94 + }
  95 + return response.data;
  96 + },
  97 + (error) => {
  98 + Message.error({
  99 + content: error.msg || '后端接口异常',
  100 + duration: 5 * 1000,
  101 + });
  102 + return Promise.reject(error);
  103 + }
  104 +);
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取站点
  6 + * @param params 查询参数
  7 + * @returns 站点列表
  8 + */
  9 +export function listDept(params: any): any {
  10 + return axios.get("/system/dept/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +
  19 +/**
  20 + * 获取站点树
  21 + * @param params 查询参数
  22 + * @returns 站点列表树结构
  23 + */
  24 +export function deptTree(id:any){
  25 + if(id && id > 0){
  26 + return axios.get(`system/role/deptTree/${id}`);
  27 + }else{
  28 + return axios.get(`system/role/deptTree`);
  29 + }
  30 +}
  31 +
  32 +
  33 +/**
  34 + * 获取站点下的成员
  35 + * @param deptId
  36 + * @returns
  37 + */
  38 +export function getDeptMember(deptId:number) {
  39 + return axios.get(`/system/dept/list/exclude/${deptId}`)
  40 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取菜单列表
  6 + * @param params 搜索参数
  7 + * @returns
  8 + */
  9 +export function listMenu(params: any) {
  10 + return axios.get("/system/menu/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +// 查询菜单详细
  19 +export function getMenu(menuId:any) {
  20 + return axios.get('/system/menu/' + menuId);
  21 +}
  22 +
  23 +/**
  24 + * 新增菜单
  25 + * @param data
  26 + * @returns
  27 + */
  28 +export function addMenu(data:any) {
  29 + return axios.post("/system/menu",data);
  30 +}
  31 +
  32 +/**
  33 + * 修改菜单
  34 + * @param data 菜单数据
  35 + * @returns
  36 + */
  37 +export function updateMenu(data:any) {
  38 + return axios.put("/system/menu",data);
  39 +}
  40 +
  41 +/**
  42 + * 删除菜单
  43 + * @param menuId 菜单ID
  44 + * @returns
  45 + */
  46 +export function delMenu(menuId:any) {
  47 + return axios.delete('/system/menu/' + menuId);
  48 +}
  49 +
  50 +/**
  51 + * 修改菜单
  52 + * @param data 公司对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function changeMenuStatus(id: any,state:any) {
  56 + return axios.put(`/system/menu/changeStatus/${id}/${state}`);
  57 +}
  58 +
  59 +
  60 +/**
  61 + * 获取树形菜单
  62 + * @param params 搜索参数
  63 + * @returns
  64 + */
  65 +export function treeselect() {
  66 + return axios.get("/system/menu/treeselect");
  67 +}
  68 +
  69 +
  70 +/**
  71 + * 获取树形菜单
  72 + * @param params 搜索参数
  73 + * @returns
  74 + */
  75 +export function roleMenuTreeselect(id:any) {
  76 + return axios.get("/system/menu/roleMenuTreeselect/" + id);
  77 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询岗位列表
  6 + * @param params 查询参数
  7 + * @returns
  8 + */
  9 +export function listPost(params:any) {
  10 + return axios.get("/system/post/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询岗位列表
  20 + * @param params 查询参数
  21 + * @returns
  22 + */
  23 +export function listPostAll(params:any) {
  24 + return axios.get("/system/post/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + },
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询岗位详细
  34 + * @param postId 岗位ID
  35 + * @returns
  36 + */
  37 +export function getPost(postId:any) {
  38 + return axios.get('/system/post/' + postId);
  39 +}
  40 +
  41 +/**
  42 + * 新增岗位
  43 + * @param data 岗位信息
  44 + * @returns
  45 + */
  46 +export function addPost(data:any) {
  47 + return axios.post('/system/post',data);
  48 +}
  49 +
  50 +/**
  51 + * 修改岗位
  52 + * @param data 岗位信息
  53 + * @returns
  54 + */
  55 +export function updatePost(data:any) {
  56 + return axios.put('/system/post',data);
  57 +}
  58 +
  59 +/**
  60 + * 删除岗位
  61 + * @param postId 岗位ID
  62 + * @returns
  63 + */
  64 +export function delPost(postId:any) {
  65 + return axios.delete('/system/post/' + postId);
  66 +}
  67 +
  68 +
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取角色列表
  6 + * @param params 搜索参数
  7 + * @returns
  8 + */
  9 +export function listRole(params: any) {
  10 + return axios.get("/system/role/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 获取角色列表
  20 + * @param params 搜索参数
  21 + * @returns
  22 + */
  23 +export function listRoleAll(params: any) {
  24 + return axios.get("/system/role/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + },
  29 + });
  30 +}
  31 +
  32 +// 查询角色详细
  33 +export function getRole(roleId: any) {
  34 + return axios.get("/system/role/" + roleId);
  35 +}
  36 +
  37 +/**
  38 + * 新增角色
  39 + * @param data
  40 + * @returns
  41 + */
  42 +export function addRole(data: any) {
  43 + return axios.post("/system/role", data);
  44 +}
  45 +
  46 +/**
  47 + * 修改角色
  48 + * @param data 角色数据
  49 + * @returns
  50 + */
  51 +export function updateRole(data: any) {
  52 + return axios.put("/system/role", data);
  53 +}
  54 +
  55 +/**
  56 + * 删除角色
  57 + * @param roleId 角色ID
  58 + * @returns
  59 + */
  60 +export function delRole(roleId: any) {
  61 + return axios.delete("/system/role/" + roleId);
  62 +}
  63 +
  64 +/**
  65 + * 角色数据权限
  66 + * @param data
  67 + * @returns
  68 + */
  69 +export function dataScope(data: any) {
  70 + return axios.put("/system/role/dataScope", data);
  71 +}
  72 +
  73 +/**
  74 + * 角色状态修改
  75 + * @param roleId 角色ID
  76 + * @param status 状态
  77 + * @returns
  78 + */
  79 +export function changeRoleStatus(roleId: any, status: any) {
  80 + const data = {
  81 + roleId,
  82 + status,
  83 + };
  84 + return axios.put(`/system/role/changeStatus/${roleId}/${status}`);
  85 +}
  86 +
  87 +/**
  88 + * 查询角色已授权用户列表
  89 + * @param params 查询参数
  90 + * @returns
  91 + */
  92 +export function allocatedUserList(params: any) {
  93 + return axios.get("/system/role/authUser/allocatedList", {
  94 + params,
  95 + paramsSerializer: (obj) => {
  96 + return qs.stringify(obj);
  97 + },
  98 + });
  99 +}
  100 +
  101 +/**
  102 + * 查询角色未授权用户列表
  103 + * @param params 参数
  104 + * @returns
  105 + */
  106 +export function unallocatedUserList(params: any) {
  107 + return axios.get("/system/role/authUser/unallocatedList", {
  108 + params,
  109 + paramsSerializer: (obj) => {
  110 + return qs.stringify(obj);
  111 + },
  112 + });
  113 +}
  114 +
  115 +/**
  116 + * 取消用户授权角色
  117 + * @param data 参数
  118 + * @returns
  119 + */
  120 +export function authUserCancel(data: any) {
  121 + return axios.put("/system/role/authUser/cancel", data);
  122 +}
  123 +
  124 +/**
  125 + * 批量取消用户授权角色
  126 + * @param data 参数
  127 + * @returns
  128 + */
  129 +export function authUserCancelAll(data: any) {
  130 + return axios.put("/system/role/authUser/cancelAll", data);
  131 +}
  132 +
  133 +/**
  134 + * 授权用户选择
  135 + * @param data 参数
  136 + * @returns
  137 + */
  138 +export function authUserSelectAll(data: any) {
  139 + return axios.put("/system/role/authUser/selectAll", data);
  140 +}
  141 +
  142 +/**
  143 + * 根据角色ID查询部门树结构
  144 + * @param roleId 角色ID
  145 + * @returns
  146 + */
  147 +export function deptTreeSelect(roleId: any) {
  148 + return axios.get("/system/role/deptTree/" + roleId);
  149 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取用户列表-分页
  6 + * @param params
  7 + * @returns
  8 + */
  9 +export function listUser(params: any): any {
  10 + return axios.get("/system/user/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 获取用户列表-不分页
  20 + * @param params
  21 + * @returns
  22 + */
  23 +export function listUserAll(params: any): any {
  24 + return axios.get("/system/user/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + },
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询用户详细
  34 + * @param userId 用户ID
  35 + * @returns
  36 + */
  37 +export function getUser(userId: any) {
  38 + return axios.get("/system/user/" + userId);
  39 +}
  40 +
  41 +/**
  42 + * 新增用户
  43 + * @param data 操作日志对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addUser(data: any) {
  47 + return axios.post("/system/user", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改用户
  52 + * @param data 操作日志对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateUser(data: any) {
  56 + return axios.put("/system/user", data);
  57 +}
  58 +
  59 +/**
  60 + * 修改用户密码
  61 + * @param data 操作日志对象
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function resetPwd(data: any) {
  65 + return axios.put("/system/user/resetPwd", data);
  66 +}
  67 +
  68 +/**
  69 + * 修改用户状态
  70 + * @param id
  71 + * @param state
  72 + * @returns 0失败 1成功
  73 + */
  74 +export function changeUserStatus(id: any, state: any) {
  75 + return axios.put(`/system/user/changeStatus/${id}/${state}`);
  76 +}
  77 +
  78 +/**
  79 + * 删除用户
  80 + * @param id 操作日志ID
  81 + * @returns 0失败 1成功
  82 + */
  83 +export function delUser(id: any) {
  84 + return axios.delete("/system/user/" + id);
  85 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取申请列表
  6 + * @param params 搜索参数
  7 + * @returns
  8 + */
  9 +export function listApply(params: any) {
  10 + return axios.get("/system/apply/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +// 查询申请详细
  19 +export function getApply(id: any) {
  20 + return axios.get('/system/apply/' + id);
  21 +}
  22 +
  23 +/**
  24 + * 新建申请
  25 + * @param data
  26 + * @returns
  27 + */
  28 +export function addApply(data: any) {
  29 + return axios.post("/system/apply", data);
  30 +}
  31 +
  32 +/**
  33 + * 编辑申请
  34 + * @param data 申请数据
  35 + * @returns
  36 + */
  37 +export function updateApply(data: any) {
  38 + return axios.put("/system/apply", data);
  39 +}
  40 +
  41 +/**
  42 + * 删除申请
  43 + * @param id 申请ID
  44 + * @returns
  45 + */
  46 +export function delApply(id: any) {
  47 + return axios.delete('/system/apply/' + id);
  48 +}
  49 +
  50 +
  51 +/**
  52 + * 生成标识
  53 + * @param data 申请数据
  54 + * @returns
  55 + */
  56 +export function addToken(params: any) {
  57 + return axios.get("/system/public/genRandomKey?genType=3&len=16", {
  58 + params,
  59 + paramsSerializer: (obj) => {
  60 + return qs.stringify(obj);
  61 + },
  62 + });
  63 +}
  64 +/**
  65 + * 生成账号
  66 + * @param data 申请数据
  67 + * @returns
  68 + */
  69 +export function addAccount(params: any) {
  70 + return axios.get("/system/public/genRandomKey?genType=3&len=12", {
  71 + params,
  72 + paramsSerializer: (obj) => {
  73 + return qs.stringify(obj);
  74 + },
  75 + });
  76 +}
  77 +
  78 +/**
  79 + * 生成密钥
  80 + * @param data 申请数据
  81 + * @returns
  82 + */
  83 +export function addSecret(params: any) {
  84 + return axios.get("/system/public/genRandomKey?genType=3&len=18", {
  85 + params,
  86 + paramsSerializer: (obj) => {
  87 + return qs.stringify(obj);
  88 + },
  89 + });
  90 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取数据接口列表
  6 + * @param params 搜索参数
  7 + * @returns
  8 + */
  9 +export function listInterface(params: any) {
  10 + return axios.get("/system/apply-interface/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +// 查询数据接口详细
  19 +export function getInterface(menuId:any) {
  20 + return axios.get('/system/apply-interface/' + menuId);
  21 +}
  22 +
  23 +/**
  24 + * 新增数据接口
  25 + * @param data
  26 + * @returns
  27 + */
  28 +export function addInterface(data:any) {
  29 + return axios.post("/system/apply-interface",data);
  30 +}
  31 +
  32 +/**
  33 + * 修改数据接口
  34 + * @param data 数据接口数据
  35 + * @returns
  36 + */
  37 +export function updateInterface(data:any) {
  38 + return axios.put("/system/apply-interface",data);
  39 +}
  40 +
  41 +/**
  42 + * 删除数据接口
  43 + * @param menuId 数据接口ID
  44 + * @returns
  45 + */
  46 +export function delInterface(menuId:any) {
  47 + return axios.delete('/system/apply-interface/' + menuId);
  48 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取通知公告列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listNotice(params: any) {
  10 + return axios.get("/system/notice/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询公告详细
  20 + * @param id 公告ID
  21 + * @returns 结果
  22 + */
  23 +export function getNotice(id: any) {
  24 + return axios.get("/system/notice/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增公告
  29 + * @param data 公告对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addNotice(data: any) {
  33 + return axios.post("/system/notice", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改全国四级行政区
  38 + * @param data 公告对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateNotice(data: any) {
  42 + return axios.put("/system/notice", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除公告
  47 + * @param id 公告ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delNotice(id: any) {
  51 + return axios.delete("/system/notice/" + id);
  52 +}
  53 +
  54 +/**
  55 + * 修改公告状态
  56 + * @param id id
  57 + * @param state 状态
  58 + * @returns 0失败 1成功
  59 + */
  60 +export function changeNoticeStatus(id: any,state:any) {
  61 + return axios.put(`/system/notice/changeStatus/${id}/${state}`);
  62 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取卡片列表
  6 + * @param 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function getCardList(params: any) {
  10 + return axios.get(`/system/dashboard/card/config/list`,{
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 保存卡片信息
  20 + * @param data 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function updateConfigCard(data: any) {
  24 + return axios.put("/system/dashboard/card/config", data);
  25 +}
  26 +
  27 +/**
  28 + * 获取卡片信息
  29 + * @param data 查询参数
  30 + * @returns 结果
  31 + */
  32 +export function getConfigCard(data) {
  33 + return axios.get(`/system/dashboard/card/config/${data.dashboardConfigId}/${data.cardKey}`);
  34 +}
  35 +
  36 +/**
  37 + * 删除卡片
  38 + * @id 删除配置参数
  39 + * @returns 结果
  40 + */
  41 +export function deleteConfigList(id: any) {
  42 + return axios.delete("/system/dashboard/card/config/"+id);
  43 +}
  44 +
  45 +/**
  46 + * 修改配置状态
  47 + * @data 修改配置参数
  48 + * @returns 结果
  49 + */
  50 +export function updateConfigStatus(data:any) {
  51 + return axios.put(`/system/dashboard/card/config/changeStatus/${data.id}/${data.state}`);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 获取大屏配置详细信息-通过站点id查询
  6 + * @param params 查询参数
  7 + */
  8 +export function getBiInfo({stationId,isPre}: {stationId: string,isPre: string}) {
  9 + return axios.get(`/datav/common/special/getBiConfig/${stationId}/${isPre}`);
  10 +}
  11 +/**
  12 + * 获取大屏配置列表
  13 + * @returns 结果
  14 + * @param params 查询参数
  15 + */
  16 +export function getConfigList(params: any) {
  17 + return axios.get(`/system/dashboard/config/list`,{
  18 + params,
  19 + paramsSerializer: (obj) => {
  20 + return qs.stringify(obj);
  21 + }
  22 + });
  23 +}
  24 +
  25 +/**
  26 + * 新建大屏配置
  27 + * @param data 新增配置对象
  28 + * @returns 结果
  29 + */
  30 +export function addConfigList(data: any) {
  31 + return axios.post("/system/dashboard/config", data);
  32 +}
  33 +/**
  34 + * 修改大屏配置
  35 + * @data 新增配置对象
  36 + * @returns 结果
  37 + */
  38 +export function editConfigList(data: any) {
  39 + return axios.put("/system/dashboard/config", data);
  40 +}
  41 +/**
  42 + * 修改配置状态
  43 + * @data 修改配置参数
  44 + * @returns 结果
  45 + */
  46 +export function updateConfigStatus(data:any) {
  47 + return axios.put(`/system/dashboard/config/changeStatus/${data.id}/${data.state}`);
  48 +}
  49 +
  50 +/**
  51 + * 删除大屏配置
  52 + * @id 删除配置参数
  53 + * @returns 结果
  54 + */
  55 +export function deleteConfigList(id: any) {
  56 + return axios.delete("/system/dashboard/config/"+id);
  57 +}
  58 +
  59 +/**
  60 + * 获取大屏配置详情
  61 + * @param 查询配置参数
  62 + * @returns 结果
  63 + */
  64 +export function getConfigDetail(params: any) {
  65 + return axios.get(`/system/dashboard/config/${params.pageKey}`);
  66 +}
  67 +
  68 +/**
  69 + * 获取卡片列表
  70 + * @param 查询参数
  71 + * @returns 结果
  72 + */
  73 +export function getCardList(params: any) {
  74 + return axios.get(`/system/dashboard/card/config/listAll`,{
  75 + params,
  76 + paramsSerializer: (obj) => {
  77 + return qs.stringify(obj);
  78 + }
  79 + });
  80 +}
  81 +
  82 +
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +
  5 +/**
  6 + * 设备分组对象
  7 + */
  8 +export interface ArgumentEntity {
  9 + id: number;
  10 + name:string,
  11 + valueType:string,
  12 + value:string,
  13 + argumentExplain:string,
  14 + status:number,
  15 + operations:string,
  16 +}
  17 +
  18 +/**
  19 + * 用户查询对象
  20 + */
  21 +export interface ArgumentVarParams extends Partial<ArgumentEntity> {
  22 + current: number;
  23 + pageSize: number;
  24 +}
  25 +/**
  26 + * 用户分页对象
  27 + */
  28 +export interface ArgumentListPage {
  29 + list: ArgumentEntity[];
  30 + total: number;
  31 +}
  32 +
  33 +//获取用户列表
  34 +export function queryArgumentvarList(params: ArgumentVarParams): any {
  35 + return axios.get<ArgumentListPage>("/manage/system/argument", {
  36 + params,
  37 + paramsSerializer: (obj) => {
  38 + return qs.stringify(obj);
  39 + },
  40 + });
  41 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询字典标签列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listDictData(params: any) {
  10 + return axios.get("/system/dict/data/list", {
  11 + params,
  12 + paramsSerializer: (obj:any) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +/**
  18 + * 根据字典类型查询字典数据信息
  19 + * @param dictType
  20 + * @returns
  21 + */
  22 +export function listDictDataForDictType(dictType:string){
  23 + return axios.get(`/system/dict/data/type/${dictType}`)
  24 +}
  25 +/**
  26 + * 查询字典标签详细
  27 + * @param id 字典标签ID
  28 + * @returns 结果
  29 + */
  30 +export function getDictData(id: any) {
  31 + return axios.get("/system/dict/data/" + id);
  32 +}
  33 +
  34 +/**
  35 + * 新增字典标签
  36 + * @param data 字典标签对象
  37 + * @returns 0失败 1成功
  38 + */
  39 +export function addDictData(data: any) {
  40 + return axios.post("/system/dict/data", data);
  41 +}
  42 +
  43 +/**
  44 + * 修改字典标签
  45 + * @param data 字典标签对象
  46 + * @returns 0失败 1成功
  47 + */
  48 +export function updateDictData(data: any) {
  49 + return axios.put("/system/dict/data", data);
  50 +}
  51 +
  52 +/**
  53 + * 删除字典标签
  54 + * @param id 字典标签ID
  55 + * @returns 0失败 1成功
  56 + */
  57 +export function delDictData(id: any) {
  58 + return axios.delete("/system/dict/data/" + id);
  59 +}
  60 +
  61 +/**
  62 + * 修改字典参数
  63 + * @param id
  64 + * @param state
  65 + * @returns 0失败 1成功
  66 + */
  67 +export function changeDictDataStatus(id: any,state:any) {
  68 + return axios.put(`/system/dict/data/changeStatus/${id}/${state}`);
  69 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通用字典列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listDict(params: any) {
  10 + return axios.get("/system/dict/type/list", {
  11 + params,
  12 + paramsSerializer: (obj:any) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通用字典详细
  20 + * @param id 通用字典ID
  21 + * @returns 结果
  22 + */
  23 +export function getDict(id: any) {
  24 + return axios.get("/system/dict/type/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通用字典
  29 + * @param data 通用字典对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addDict(data: any) {
  33 + return axios.post("/system/dict/type", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通用字典
  38 + * @param data 通用字典对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateDict(data: any) {
  42 + return axios.put("/system/dict/type", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通用字典
  47 + * @param id 通用 字典ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delDict(id: any) {
  51 + return axios.delete("/system/dict/type/" + id);
  52 +}
  53 +/**
  54 + * 获取字典参数下拉项
  55 + * @returns {}
  56 + */
  57 +export function optionselect(){
  58 + return axios.get("/system/dict/type/optionselect")
  59 +}
  60 +
  61 +/**
  62 + * 修改字典参数
  63 + * @param id
  64 + * @param state
  65 + * @returns 0失败 1成功
  66 + */
  67 +export function changeDictStatus(id: any,state:any) {
  68 + return axios.put(`/system/dict/type/changeStatus/${id}/${state}`);
  69 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +
  5 +/**
  6 + * 设备分组对象
  7 + */
  8 +export interface EnterpriseEntity {
  9 + id: number;
  10 + name:string,
  11 + socialCreditCode:string,
  12 + enterpriseLegalPerson:string,
  13 + phoneNumber:string,
  14 + establishDate:string,
  15 + status:number,
  16 + operations:string,
  17 +}
  18 +
  19 +/**
  20 + * 用户查询对象
  21 + */
  22 +export interface EnterpriseVarParams extends Partial<EnterpriseEntity> {
  23 + current: number;
  24 + pageSize: number;
  25 +}
  26 +/**
  27 + * 用户分页对象
  28 + */
  29 +export interface EnterpriseListPage {
  30 + list: EnterpriseEntity[];
  31 + total: number;
  32 +}
  33 +
  34 +//获取用户列表
  35 +export function queryEnterprisevarList(params: EnterpriseVarParams): any {
  36 + return axios.get<EnterpriseListPage>("/manage/system/enterprise", {
  37 + params,
  38 + paramsSerializer: (obj) => {
  39 + return qs.stringify(obj);
  40 + },
  41 + });
  42 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询参数列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listConfig(params: any) {
  10 + return axios.get("/system/config/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询参数详细
  20 + * @param id 参数ID
  21 + * @returns 结果
  22 + */
  23 +export function getConfig(id: any) {
  24 + return axios.get("/system/config/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增参数
  29 + * @param data 参数对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addConfig(data: any) {
  33 + return axios.post("/system/config", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改参数
  38 + * @param data 参数对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateConfig(data: any) {
  42 + return axios.put("/system/config", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除参数
  47 + * @param id 参数ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delConfig(id: any) {
  51 + return axios.delete("/system/config/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +
  5 +/**
  6 + * 设备分组对象
  7 + */
  8 +export interface SiteEntity {
  9 + key: number;
  10 + groupName: string,
  11 + isGroup:string,
  12 + children:{
  13 + key:number,
  14 + enterpriseName:string,
  15 + isDeviceGroup:string,
  16 + children:{
  17 + key:number,
  18 + id:number,
  19 + name:string,
  20 + siteCode:string,
  21 + siteType:string,
  22 + contactPerson:string,
  23 + contactNum:string,
  24 + commissionDate:string,
  25 + status:number,
  26 + operations:string,}[]
  27 + },
  28 +}
  29 +
  30 +/**
  31 + * 用户查询对象
  32 + */
  33 +export interface SiteVarParams extends Partial<SiteEntity> {
  34 + current: number;
  35 + pageSize: number;
  36 +}
  37 +/**
  38 + * 用户分页对象
  39 + */
  40 +export interface SiteListPage {
  41 + list: SiteEntity[];
  42 + total: number;
  43 +}
  44 +
  45 +//获取用户列表
  46 +export function querySitevarList(params: SiteVarParams): any {
  47 + return axios.get<SiteListPage>("/manage/system/site", {
  48 + params,
  49 + paramsSerializer: (obj) => {
  50 + return qs.stringify(obj);
  51 + },
  52 + });
  53 +}
... ...
  1 +import axios from 'axios'
  2 +
  3 +export interface MessageRecord {
  4 + id: number
  5 + type: string
  6 + title: string
  7 + subTitle: string
  8 + avatar?: string
  9 + content: string
  10 + time: string
  11 + status: 0 | 1
  12 + messageType?: number
  13 +}
  14 +export type MessageListType = MessageRecord[]
  15 +
  16 +export function queryMessageList() {
  17 + return axios.post<MessageListType>('/api/message/list')
  18 +}
  19 +
  20 +interface MessageStatus {
  21 + ids: number[]
  22 +}
  23 +
  24 +export function setMessageStatus(data: MessageStatus) {
  25 + return axios.post<MessageListType>('/api/message/read', data)
  26 +}
  27 +
  28 +export interface ChatRecord {
  29 + id: number
  30 + username: string
  31 + content: string
  32 + time: string
  33 + isCollect: boolean
  34 +}
  35 +
  36 +export function queryChatList() {
  37 + return axios.post<ChatRecord[]>('/api/chat/list')
  38 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 设备分组对象
  6 + */
  7 +export interface DeviceVarEntity {
  8 + id: number;
  9 + status:number,
  10 + name:string,
  11 + variableCoding:string,
  12 + variableAttribute:string,
  13 + monitoringEquipmentus:string,
  14 + owningChannel:string,
  15 + dataSource:string,
  16 + dataAddress:string,
  17 + dataType:string,
  18 + coefficient:string,
  19 + storageCycle:string,
  20 + operations:string,
  21 +}
  22 +
  23 +/**
  24 + * 用户查询对象
  25 + */
  26 +export interface DeviceVarParams extends Partial<DeviceVarEntity> {
  27 + current: number;
  28 + pageSize: number;
  29 +}
  30 +/**
  31 + * 用户分页对象
  32 + */
  33 +export interface DeviceGroupListPage {
  34 + list: DeviceVarEntity[];
  35 + total: number;
  36 +}
  37 +
  38 +//获取用户列表
  39 +export function queryDeviceGroupvarList(params: DeviceVarParams): any {
  40 + return axios.get<DeviceGroupListPage>("/power/energy/device/var", {
  41 + params,
  42 + paramsSerializer: (obj) => {
  43 + return qs.stringify(obj);
  44 + },
  45 + });
  46 +}
  47 +
  48 +export function queryDeviceGroupvarList2(params: DeviceVarParams): any {
  49 + return axios.get<DeviceGroupListPage>("/power/energy/device/var2", {
  50 + params,
  51 + paramsSerializer: (obj) => {
  52 + return qs.stringify(obj);
  53 + },
  54 + });
  55 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +// 设备组
  5 +export interface DeviceGroupEntity {
  6 + // 主键
  7 + key: string;
  8 + // 设备组名称
  9 + groupName: string;
  10 + // 是否设备组
  11 + isDeviceGroup: boolean;
  12 + // 设备组下的设备
  13 + children:DeviceEntity[];
  14 + }
  15 +
  16 +
  17 +// 设备
  18 +export interface DeviceEntity {
  19 + // 设备主键
  20 + key: string;
  21 + // 设备名称
  22 + deviceName:string;
  23 + // 设备组主键
  24 + parentKey:string;
  25 + // 设备名称
  26 + groupName:string;
  27 + // 设备编码
  28 + deviceSn:string;
  29 + // 设备状态
  30 + deleteFlag:string;
  31 + // 所属通道
  32 + channelId:string;
  33 + // 设备类型
  34 + proType:string;
  35 + // 额定电压
  36 + ratedVol:string;
  37 + // 额定电流
  38 + ratedEle:string;
  39 + // 额定功率
  40 + ratedPower:string;
  41 + // 通讯设备
  42 + communicationDevice:string;
  43 + // 生产厂家
  44 + proFactory:string;
  45 + // 产品型号
  46 + proModel:string;
  47 + // 产品版本
  48 + proVer:string;
  49 + // 产品SN码
  50 + proSn:string;
  51 + // 安规国家
  52 + agStandard:string;
  53 + // 组件容量
  54 + ratedVolume:string;
  55 + // 电流负载率
  56 + eleLoadRate:string;
  57 + // 是否关口表
  58 + isPass:boolean;
  59 + // 电能质量分析
  60 + isAnalysisEnergy:boolean;
  61 + // 监控画面
  62 + monitor:string;
  63 + // 备注内容
  64 + remark:string;
  65 + // 计费信息
  66 + chargingInformation:{
  67 + // DTU端口
  68 + dtuCmd:string;
  69 + // 绑定用户
  70 + bindUserId:string;
  71 + // 付费模式
  72 + chargingType:string;
  73 + // 付费规则
  74 + ruleId:string;
  75 + // 付费周期
  76 + checkoutType:string;
  77 + };
  78 + // 关联设备
  79 + associatedDevices:{
  80 + // 设备主键
  81 + key:string[]
  82 + };
  83 + }
  84 +
  85 +
  86 +// 报警信息
  87 +export interface AlarmEntity {
  88 +// 主键
  89 + key: string;
  90 + // 报警名称
  91 + name: string;
  92 + // 报警状态
  93 + state: string;
  94 + // 报警等级
  95 + level:string;
  96 + // 报警设备
  97 + device:string;
  98 + // 报警变量
  99 + variable:string;
  100 + // 报警内容
  101 + content:string;
  102 + // 创建时间
  103 + alarmTime:Date;
  104 + // 更新时间
  105 + recoveryTime:Date;
  106 +}
  107 +/**
  108 + * 查询对象
  109 + */
  110 +export interface DeviceListParams {
  111 + current: number;
  112 + pageSize: number;
  113 +}
  114 +
  115 +export interface AlarmQueryParams {
  116 + current: number;
  117 + pageSize: number;
  118 +}
  119 +/**
  120 + * 分页对象
  121 + */
  122 +export interface DeviceListPage {
  123 + list: DeviceEntity[];
  124 + total: number;
  125 +}
  126 +
  127 +/*
  128 +* 查询设备组参数
  129 +*/
  130 +export interface groupQueryParams{
  131 + groupKey: number;
  132 +}
  133 +
  134 +/*
  135 +* 添加设备参数
  136 +*/
  137 +export interface addDeviceParams{
  138 + deviceIndexs: string[];
  139 + total: number;
  140 +}
  141 +
  142 +//获取设备列表
  143 +export function queryDeviceList(params: DeviceListParams): any {
  144 + return axios.get("/power/energy/device/list/devicelist", {
  145 + params,
  146 + paramsSerializer: (obj) => {
  147 + return qs.stringify(obj);
  148 + },
  149 + });
  150 +}
  151 +
  152 +//获取警告列表
  153 +export function queryAlarmList(params: AlarmQueryParams): any {
  154 + return axios.get("/power/energy/device/list/alarm", {
  155 + params,
  156 + paramsSerializer: (obj) => {
  157 + return qs.stringify(obj);
  158 + },
  159 + });
  160 +}
  161 +
  162 +//设备编码、关联设备中设备组
  163 +export function queryDeviceCode(): any {
  164 + return axios.get("/power/energy/device/list/create/init", {
  165 + paramsSerializer: (obj) => {
  166 + return qs.stringify(obj);
  167 + },
  168 + });
  169 +}
  170 +
  171 + //选择设备分组后自动加载表格
  172 +export function queryDeviceByGroup(params: groupQueryParams): any {
  173 + return axios.get("/power/energy/device/list/create/select", {
  174 + params,
  175 + paramsSerializer: (obj) => {
  176 + return qs.stringify(obj);
  177 + },
  178 + });
  179 +}
  180 +
  181 +// 通过设备key添加设备
  182 +export function addDevice(params: addDeviceParams): any {
  183 + return axios.get("/power/energy/device/list/create/add", {
  184 + params,
  185 + paramsSerializer: (obj) => {
  186 + return qs.stringify(obj);
  187 + },
  188 + });
  189 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 基础报表对象
  6 + */
  7 +export interface SearchBasicEntity {
  8 + device: string,
  9 + parameter: string,
  10 + status:number,
  11 + min: number,
  12 + max: number,
  13 + average: number,
  14 + sum: number
  15 +}
  16 +
  17 +/**
  18 + * 用户查询对象
  19 + */
  20 +export interface SearchBasicParams extends Partial<SearchBasicEntity> {
  21 + current: number;
  22 + pageSize: number;
  23 +}
  24 +/**
  25 + * 用户分页对象
  26 + */
  27 +export interface SearchBasicListPage {
  28 + list: SearchBasicEntity[];
  29 + total: number;
  30 +}
  31 +
  32 +//获取用户列表
  33 +export function querySearchBasicvarList(params: SearchBasicParams): any {
  34 + return axios.get<SearchBasicListPage>("/power/energy/search/basic", {
  35 + params,
  36 + paramsSerializer: (obj) => {
  37 + return qs.stringify(obj);
  38 + },
  39 + });
  40 +}
  41 +
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 基础报表列表
  6 + */
  7 +export function getBasicTable(params?:any): any {
  8 + return axios.get("/datav/common/table/getBasicTable",{
  9 + params,
  10 + paramsSerializer: (obj) => {
  11 + return qs.stringify(obj);
  12 + },
  13 + })
  14 +}
  15 +
  16 +/**
  17 + * @desc 查询报表模版列表
  18 + */
  19 +export function getTemplateData(params?:any): any {
  20 + return axios.get("/system/report-templates/listAll",{
  21 + params,
  22 + paramsSerializer: (obj) => {
  23 + return qs.stringify(obj);
  24 + },
  25 + })
  26 +}
  27 +/**
  28 + * 新增报表模版
  29 + * @param data
  30 + */
  31 +export function addReportTemplates(data:any): any {
  32 + return axios.post("/system/report-templates", data)
  33 +}
  34 +
  35 +/**
  36 + * @param data
  37 + */
  38 +export function editReportTemplates(data:any): any {
  39 + return axios.put('/system/report-templates',data)
  40 +}
  41 +/**
  42 + * 修改报表模版状态
  43 + * @param id
  44 + * @param state
  45 + */
  46 +export function editReportTemplatesStatus({id,state}:any): any {
  47 + return axios.put(`/system/report-templates/changeStatus/${id}/${state}`)
  48 +}
  49 +/**
  50 + * 获取报表模版详细信息
  51 + * @param id
  52 + */
  53 +export function getReportTemplateDetail(id:number): any {
  54 + return axios.get(`/system/report-templates/${id}`)
  55 +}
  56 +/**
  57 + * 删除
  58 + * @param ids
  59 + */
  60 +export function deleteReportTemplates(ids:number|string): any {
  61 + return axios.delete(`/system/report-templates/${ids}`)
  62 +}
... ...
  1 +import axios, { AxiosRequestConfig } from "axios";
  2 +import qs from "qs";
  3 +
  4 +export interface JsonCommonVo {
  5 + name: string;
  6 + value: string;
  7 +}
  8 +
  9 +/**
  10 + * 获取字典
  11 + * @param dictType 字典类型
  12 + * @returns
  13 + */
  14 +export function getDict(dictType: string) {
  15 + return axios.get<any>(`/system/dict/data/type/${dictType}`);
  16 +}
  17 +
  18 +/**
  19 + * 获取字典-list
  20 + * @param dictType 字典类型
  21 + * @returns
  22 + */
  23 +export function getDictList(dictType: string) {
  24 + return axios.get<any>(`/system/dict/data/list?dictSn=${dictType}`);
  25 +}
  26 +
  27 +/**
  28 + * 根据字典类型、字典值查询多级信息
  29 + * @param dictType 字典类型
  30 + * @returns
  31 + */
  32 +export function dictDataMultiLevel(dictType: string, dictValue: number) {
  33 + return axios.get<any>(
  34 + `/system/dict/data/dictDataMultiLevel?dictType=${dictType}&dictValue=${dictValue}`
  35 + );
  36 +}
  37 +
  38 +/**
  39 + * 获取站点列表
  40 + * @param params 搜索参数
  41 + * @returns
  42 + */
  43 +export function getStationList(params: any) {
  44 + return axios.get("/system/public/getStationlist", {
  45 + params,
  46 + paramsSerializer: (obj) => {
  47 + return qs.stringify(obj);
  48 + },
  49 + });
  50 +}
  51 +
  52 +/**
  53 + * 获取用户当前企业
  54 + * @returns
  55 + */
  56 +export function getEnterprise() {
  57 + return axios.get<any>("/system/public/getEnterprise");
  58 +}
  59 +
  60 +/**
  61 + * 获取用户当前站点
  62 + * @returns
  63 + */
  64 +export function getStation() {
  65 + return axios.get<any>("/system/public/getStation");
  66 +}
  67 +
  68 +/**
  69 + * 保存用户选择的站点
  70 + * @returns
  71 + */
  72 +export function setStation(deptId: any) {
  73 + const formData = new FormData();
  74 + formData.append("deptId", deptId);
  75 + return axios.post<any>("/system/public/setStation", formData, {
  76 + headers: {
  77 + "Content-Type": "multipart/form-data",
  78 + },
  79 + });
  80 +}
  81 +
  82 +/**
  83 + * 保存用户选择的站点
  84 + * @returns
  85 + */
  86 +export function getWeather(location: String) {
  87 + let params: any = {
  88 + location: location,
  89 + key: "ede0270be04c4adf9834d7b92cb312c2",
  90 + };
  91 + return axios.get<any>("/system/public/getWeather")
  92 + // return axios.get(`https://devapi.qweather.com/v7/weather/now?location=${params.location}&key=${params.key}`);
  93 +}
  94 +
  95 +/**
  96 + * 保存用户选择的站点
  97 + * @returns
  98 + */
  99 +export function getNetwork(deptId: Number) {
  100 + return axios.get<any>(
  101 + `/system/channel-device/status/all/${deptId}`
  102 + );
  103 +}
\ No newline at end of file
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 设备分组对象
  6 + */
  7 +export interface AlarmTypeEntity {
  8 + //编号
  9 + id: number;
  10 + // 报警类型名称
  11 + name:string;
  12 + // 类型代码
  13 + code:string;
  14 + // 报警级别
  15 + level:number;
  16 + // 触发类型
  17 + trigger:string;
  18 + // 报警方式
  19 + methods:string[];
  20 + // 状态
  21 + status:number;
  22 +}
  23 +
  24 +/**
  25 + * 用户查询对象
  26 + */
  27 +export interface AlarmTypeParams extends Partial<AlarmTypeEntity> {
  28 + current: number;
  29 + pageSize: number;
  30 +}
  31 +
  32 +export interface AlarmIdParams {
  33 + id:number
  34 +}
  35 +/**
  36 + * 用户分页对象
  37 + */
  38 +export interface AlarmTypeListPage {
  39 + list: AlarmTypeEntity[];
  40 + total: number;
  41 +}
  42 +
  43 +//获取用户列表
  44 +export function queryAlarmTypeList(params: AlarmTypeParams): any {
  45 + return axios.get<AlarmTypeListPage>("/pv/alarm/category/", {
  46 + params,
  47 + paramsSerializer: (obj) => {
  48 + return qs.stringify(obj);
  49 + },
  50 + });
  51 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询报警管理列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listTrigger(params: any) {
  10 + return axios.get("/system/trigger/list", {
  11 + params,
  12 + paramsSerializer: (obj: any) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询报警管理详细
  20 + * @param id 报警管理ID
  21 + * @returns 结果
  22 + */
  23 +export function getTrigger(id: any) {
  24 + return axios.get("/system/trigger/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增报警管理
  29 + * @param data 报警管理对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addTrigger(data: any) {
  33 + return axios.post("/system/trigger", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改报警管理
  38 + * @param data 报警管理对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateTrigger(data: any) {
  42 + return axios.put("/system/trigger", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除报警管理
  47 + * @param id 报警管理ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delTrigger(id: any) {
  51 + return axios.delete("/system/trigger/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 设备分组对象
  6 + */
  7 +export interface AlarmSettingEntity {
  8 + //变量编号
  9 + varId: number;
  10 + //变量名称
  11 + varName:string;
  12 + //变量编码
  13 + code:string;
  14 + //变量类型
  15 + varType:string;
  16 + //设备编号
  17 + deviceId:number;
  18 + //所属设备
  19 + deviceName:string;
  20 + //报警类型
  21 + type: string;
  22 + //报警级别
  23 + level: string;
  24 + //触发条件
  25 + trigger: string;
  26 + //启用状态
  27 + status:string;
  28 + // 短信发送
  29 + isSendMessage:boolean;
  30 + // 接收人员类型
  31 + receiverType:string;
  32 + // 接收人员
  33 + receiver:string[];
  34 + // 阈值A
  35 + thresholdA:number;
  36 +}
  37 +
  38 +/*
  39 +* 查询设备组参数
  40 +*/
  41 +export interface deviceQueryParams{
  42 + deviceId: number;
  43 +}
  44 +
  45 +/*
  46 +* 添加变量参数
  47 +*/
  48 +export interface addVarParams{
  49 + varIndexs: string[];
  50 + total: number;
  51 +}
  52 +
  53 +/**
  54 + * 用户查询对象
  55 + */
  56 +export interface AlarmSettingParams extends Partial<AlarmSettingEntity> {
  57 + current: number;
  58 + pageSize: number;
  59 +}
  60 +/**
  61 + * 用户分页对象
  62 + */
  63 +export interface AlarmSettingListPage {
  64 + list: AlarmSettingEntity[];
  65 + total: number;
  66 +}
  67 +
  68 + //选择设备分组后自动加载表格
  69 + export function queryVarByDevice(params: deviceQueryParams): any {
  70 + return axios.get("/pv/alarm/setting/select", {
  71 + params,
  72 + paramsSerializer: (obj) => {
  73 + return qs.stringify(obj);
  74 + },
  75 + });
  76 +}
  77 +
  78 +//获取用户列表
  79 +export function queryAlarmSettingList(params: AlarmSettingParams): any {
  80 + return axios.get<AlarmSettingListPage>("/pv/alarm/setting/init", {
  81 + params,
  82 + paramsSerializer: (obj) => {
  83 + return qs.stringify(obj);
  84 + },
  85 + });
  86 +}
  87 +
  88 +// 通过变量id添加变量
  89 +export function addVar(params: addVarParams): any {
  90 + return axios.get("/pv/alarm/setting/add", {
  91 + params,
  92 + paramsSerializer: (obj) => {
  93 + return qs.stringify(obj);
  94 + },
  95 + });
  96 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 设备分组对象
  6 + */
  7 +export interface AlarmStatisticEntity {
  8 + //编号
  9 + id: number;
  10 + //所属站点
  11 + station:string;
  12 + //设备名称
  13 + device: string;
  14 + //一级报警
  15 + levelOne:number;
  16 + //二级报警
  17 + levelTwo:number;
  18 + //三级报警
  19 + levelThree:number;
  20 + // 总计
  21 + total:number;
  22 +}
  23 +
  24 +/**
  25 + * 用户查询对象
  26 + */
  27 +export interface AlarmStatisticParams extends Partial<AlarmStatisticEntity> {
  28 + current: number;
  29 + pageSize: number;
  30 +}
  31 +/**
  32 + * 用户分页对象
  33 + */
  34 +export interface AlarmStatisticListPage {
  35 + list: AlarmStatisticEntity[];
  36 + total: number;
  37 +}
  38 +
  39 +//获取用户列表
  40 +export function queryAlarmStatisticList(params: AlarmStatisticParams): any {
  41 + return axios.get<AlarmStatisticListPage>("/pv/alarm/statistic/", {
  42 + params,
  43 + paramsSerializer: (obj) => {
  44 + return qs.stringify(obj);
  45 + },
  46 + });
  47 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +
  5 +export interface AlarmeventEntity {
  6 + // 主键
  7 + key: string;
  8 + // 报警名称
  9 + alarmName: string;
  10 + //状态
  11 + state: string;
  12 + // 等级
  13 + level: string;
  14 + // 电站
  15 + powerStation: string;
  16 + // 设备
  17 + equipment: {
  18 + name: string;
  19 + serialNumber: string;
  20 + };
  21 + // 报警开始时间
  22 + startTime: {
  23 + time: string;
  24 + date: string;
  25 + timezone: string;
  26 + };
  27 + // 报警结束时间
  28 + recoveryTime: {
  29 + time: string;
  30 + date: string;
  31 + timezone: string;
  32 + };
  33 +}
  34 +
  35 +/**
  36 + * 查询对象
  37 + */
  38 +export interface AlarmeventQueryParams extends Partial<AlarmeventEntity> {
  39 + current: number;
  40 + pageSize: number;
  41 +}
  42 +/**
  43 + * 分页对象
  44 + */
  45 +export interface AlarmeventListPage {
  46 + list: AlarmeventEntity[];
  47 + total: number;
  48 +}
  49 +
  50 +//获取用户列表
  51 +export function queryAlarmeventList(params: AlarmeventQueryParams): any {
  52 + return axios.get<AlarmeventListPage>("/manage/alarmevent", {
  53 + params,
  54 + paramsSerializer: (obj) => {
  55 + return qs.stringify(obj);
  56 + },
  57 + });
  58 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯设备列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listChannelDevice(params: any) {
  10 + return axios.get("/system/channel-device/list", {
  11 + params,
  12 + paramsSerializer: (obj:any) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯设备列表-所有数据
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listChannelDeviceAll(params: any) {
  24 + return axios.get("/system/channel-device/listAll", {
  25 + params,
  26 + paramsSerializer: (obj:any) => {
  27 + return qs.stringify(obj);
  28 + }
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询通讯设备详细
  34 + * @param id 通讯设备ID
  35 + * @returns 结果
  36 + */
  37 +export function getChannelDevice(id: any) {
  38 + return axios.get("/system/channel-device/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 新增通讯设备
  43 + * @param data 通讯设备对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addChannelDevice(data: any) {
  47 + return axios.post("/system/channel-device", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改通讯设备
  52 + * @param data 通讯设备对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateChannelDevice(data: any) {
  56 + return axios.put("/system/channel-device", data);
  57 +}
  58 +
  59 +/**
  60 + * 删除通讯设备
  61 + * @param id 通讯设备ID
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function delChannelDevice(id: any) {
  65 + return axios.delete("/system/channel-device/" + id);
  66 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯通道列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listChannel(params: any) {
  10 + return axios.get("/system/channel/list", {
  11 + params,
  12 + paramsSerializer: (obj:any) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯通道详细
  20 + * @param id 通讯通道ID
  21 + * @returns 结果
  22 + */
  23 +export function getChannel(id: any) {
  24 + return axios.get("/system/channel/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通讯通道
  29 + * @param data 通讯通道对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addChannel(data: any) {
  33 + return axios.post("/system/channel", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通讯通道
  38 + * @param data 通讯通道对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateChannel(data: any) {
  42 + return axios.put("/system/channel", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通讯通道
  47 + * @param id 通讯通道ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delChannel(id: any) {
  51 + return axios.delete("/system/channel/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 用户对象
  6 + */
  7 +export interface UserEntity {
  8 + //主键
  9 + id: number;
  10 + //昵称
  11 + nickName: string;
  12 + //姓名
  13 + trueName: string;
  14 + //电话
  15 + phone: string;
  16 + //注册时间
  17 + registerTime: string;
  18 + //用户状态
  19 + status: number;
  20 + //地址
  21 + address: string;
  22 +}
  23 +
  24 +/**
  25 + * 用户查询对象
  26 + */
  27 +export interface UserQueryParams extends Partial<UserEntity> {
  28 + current: number;
  29 + pageSize: number;
  30 +}
  31 +/**
  32 + * 用户分页对象
  33 + */
  34 +export interface UserListPage {
  35 + list: UserEntity[];
  36 + total: number;
  37 +}
  38 +
  39 +//获取用户列表
  40 +export function queryUserList(params: UserQueryParams): any {
  41 + return axios.get<UserListPage>("/manage/user/", {
  42 + params,
  43 + paramsSerializer: (obj) => {
  44 + return qs.stringify(obj);
  45 + },
  46 + });
  47 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 设备分组对象
  6 + */
  7 +export interface DeviceGroupEntity {
  8 + //编号
  9 + id: number;
  10 + //父编号
  11 + parentId:number;
  12 + //分类名称
  13 + categoryName: string;
  14 + //逻辑代码
  15 + logicCode: string;
  16 + //状态
  17 + status: string;
  18 + //备注
  19 + remark:string;
  20 +}
  21 +
  22 +/**
  23 + * 用户查询对象
  24 + */
  25 +export interface DeviceGroupParams extends Partial<DeviceGroupEntity> {
  26 + current: number;
  27 + pageSize: number;
  28 +}
  29 +/**
  30 + * 用户分页对象
  31 + */
  32 +export interface DeviceGroupListPage {
  33 + list: DeviceGroupEntity[];
  34 + total: number;
  35 +}
  36 +
  37 +//获取用户列表
  38 +export function queryDeviceGroupList(params: DeviceGroupParams): any {
  39 + return axios.get<DeviceGroupListPage>("/manage/device/group/", {
  40 + params,
  41 + paramsSerializer: (obj) => {
  42 + return qs.stringify(obj);
  43 + },
  44 + });
  45 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 维保记录
  6 + */
  7 +export interface MaintenanceEntity {
  8 + //维保名称
  9 + maintenanceName: string;
  10 + //站点
  11 + site: Number;
  12 + //设备
  13 + device: string;
  14 + //维保人
  15 + maintenancePerson: string;
  16 + //维保时间
  17 + maintenanceTime: string;
  18 + //维保内容
  19 + maintenanceContent: string;
  20 + //图片描述
  21 + image: string;
  22 +}
  23 +
  24 +/**
  25 + * 用户查询工单
  26 + */
  27 +export interface MaintenanceQueryParams extends Partial<MaintenanceEntity> {
  28 + current: number;
  29 + pageSize: number;
  30 +}
  31 +/**
  32 + * 用户分页工单
  33 + */
  34 +export interface MaintenanceListPage {
  35 + list: MaintenanceEntity[];
  36 + total: number;
  37 +}
  38 +
  39 +//获取用户列表
  40 +export function queryMaintenanceList(params: MaintenanceQueryParams): any {
  41 + return axios.get<MaintenanceListPage>("/manage/maintenance/", {
  42 + params,
  43 + paramsSerializer: (obj) => {
  44 + return qs.stringify(obj);
  45 + },
  46 + });
  47 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询维保记录列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listMaintenance(params: any) {
  10 + return axios.get("/system/maintenance/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询维保记录详细
  20 + * @param id 维保记录ID
  21 + * @returns 结果
  22 + */
  23 +export function getMaintenance(id: any) {
  24 + return axios.get("/system/maintenance/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增维保记录
  29 + * @param data 维保记录对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addMaintenance(data: any) {
  33 + return axios.post("/system/maintenance", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改维保记录
  38 + * @param data 维保记录对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateMaintenance(data: any) {
  42 + return axios.put("/system/maintenance", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除维保记录
  47 + * @param id 维保记录ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delMaintenance(id: any) {
  51 + return axios.delete("/system/maintenance/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询工单管理列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listOrder(params: any) {
  10 + return axios.get("/system/order/list", {
  11 + params,
  12 + paramsSerializer: (obj:any) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询工单管理详细
  20 + * @param id 工单管理ID
  21 + * @returns 结果
  22 + */
  23 +export function getOrder(id: any) {
  24 + return axios.get("/system/order/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增工单管理
  29 + * @param data 工单管理对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addOrder(data: any) {
  33 + return axios.post("/system/order", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改工单管理
  38 + * @param data 工单管理对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateOrder(data: any) {
  42 + return axios.put("/system/order", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除工单管理
  47 + * @param id 工单管理ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delOrder(id: any) {
  51 + return axios.delete("/system/order/" + id);
  52 +}
  53 +/**
  54 + * 获取用户站点列表信息
  55 + * @returns
  56 + */
  57 +export function getStation(params:any) {
  58 + return axios.get("/system/station/list",params);
  59 +}
  60 +/**
  61 + * 获取报警下拉信息
  62 + * @param params
  63 + * @returns
  64 + */
  65 +export function getTrigger() {
  66 + return axios.get("/system/trigger/list");
  67 +}
  68 +/**
  69 + * 获取个人信息
  70 + * @returns
  71 + */
  72 +export function profile() {
  73 + return axios.get("/system/user/profile");
  74 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询全国四级行政区列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listAddress(params: any) {
  10 + return axios.get("/system/address/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询全国四级行政区列表
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listAddressAll(params: any) {
  24 + return axios.get("/system/address/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + }
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询全国四级行政区详细
  34 + * @param id 全国四级行政区ID
  35 + * @returns 结果
  36 + */
  37 +export function getAddress(id: any) {
  38 + return axios.get("/system/address/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 查询全国四级行政区详细
  43 + * @param id 全国四级行政区ID
  44 + * @returns 结果
  45 + */
  46 +export function getAddressNameByIds(ids: any) {
  47 + return axios.get(`/system/address/getNames/${ids.join(',')}`);
  48 +}
  49 +
  50 +/**
  51 + * 新增全国四级行政区
  52 + * @param data 全国四级行政区对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function addAddress(data: any) {
  56 + return axios.post("/system/address", data);
  57 +}
  58 +
  59 +/**
  60 + * 修改全国四级行政区
  61 + * @param data 全国四级行政区对象
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function updateAddress(data: any) {
  65 + return axios.put("/system/address", data);
  66 +}
  67 +
  68 +/**
  69 + * 删除全国四级行政区
  70 + * @param id 全国四级行政区ID
  71 + * @returns 0失败 1成功
  72 + */
  73 +export function delAddress(id: any) {
  74 + return axios.delete("/system/address/" + id);
  75 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询数据接口列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listApplyInterface(params: any) {
  10 + return axios.get("/system/apply-interface/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询数据接口详细
  20 + * @param id 数据接口ID
  21 + * @returns 结果
  22 + */
  23 +export function getApplyInterface(id: any) {
  24 + return axios.get("/system/apply-interface/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增数据接口
  29 + * @param data 数据接口对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addApplyInterface(data: any) {
  33 + return axios.post("/system/apply-interface", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改数据接口
  38 + * @param data 数据接口对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateApplyInterface(data: any) {
  42 + return axios.put("/system/apply-interface", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除数据接口
  47 + * @param id 数据接口ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delApplyInterface(id: any) {
  51 + return axios.delete("/system/apply-interface/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询第三方接入申请列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listApply(params: any) {
  10 + return axios.get("/system/apply/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询第三方接入申请详细
  20 + * @param id 第三方接入申请ID
  21 + * @returns 结果
  22 + */
  23 +export function getApply(id: any) {
  24 + return axios.get("/system/apply/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增第三方接入申请
  29 + * @param data 第三方接入申请对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addApply(data: any) {
  33 + return axios.post("/system/apply", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改第三方接入申请
  38 + * @param data 第三方接入申请对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateApply(data: any) {
  42 + return axios.put("/system/apply", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除第三方接入申请
  47 + * @param id 第三方接入申请ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delApply(id: any) {
  51 + return axios.delete("/system/apply/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯设备数据区域类型(公共)列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listAreaMap(params: any) {
  10 + return axios.get("/system/area-map/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯设备数据区域类型(公共)列表-所有的
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listAreaMapAll(params: any) {
  24 + return axios.get("/system/area-map/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + }
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询通讯设备数据区域类型(公共)详细
  34 + * @param id 通讯设备数据区域类型(公共)ID
  35 + * @returns 结果
  36 + */
  37 +export function getAreaMap(id: any) {
  38 + return axios.get("/system/area-map/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 新增通讯设备数据区域类型(公共)
  43 + * @param data 通讯设备数据区域类型(公共)对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addAreaMap(data: any) {
  47 + return axios.post("/system/area-map", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改通讯设备数据区域类型(公共)
  52 + * @param data 通讯设备数据区域类型(公共)对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateAreaMap(data: any) {
  56 + return axios.put("/system/area-map", data);
  57 +}
  58 +
  59 +/**
  60 + * 删除通讯设备数据区域类型(公共)
  61 + * @param id 通讯设备数据区域类型(公共)ID
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function delAreaMap(id: any) {
  65 + return axios.delete("/system/area-map/" + id);
  66 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询能源监控设备关联列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listAssociation(params: any) {
  10 + return axios.get("/system/association/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询能源监控设备关联详细
  20 + * @param id 能源监控设备关联ID
  21 + * @returns 结果
  22 + */
  23 +export function getAssociation(id: any) {
  24 + return axios.get("/system/association/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增能源监控设备关联
  29 + * @param data 能源监控设备关联对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addAssociation(data: any) {
  33 + return axios.post("/system/association", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改能源监控设备关联
  38 + * @param data 能源监控设备关联对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateAssociation(data: any) {
  42 + return axios.put("/system/association", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除能源监控设备关联
  47 + * @param id 能源监控设备关联ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delAssociation(id: any) {
  51 + return axios.delete("/system/association/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯设备数据区域列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listChannelDeviceArea(params: any) {
  10 + return axios.get("/system/channel-device-area/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯设备数据区域详细
  20 + * @param id 通讯设备数据区域ID
  21 + * @returns 结果
  22 + */
  23 +export function getChannelDeviceArea(id: any) {
  24 + return axios.get("/system/channel-device-area/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通讯设备数据区域
  29 + * @param data 通讯设备数据区域对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addChannelDeviceArea(data: any) {
  33 + return axios.post("/system/channel-device-area", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通讯设备数据区域
  38 + * @param data 通讯设备数据区域对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateChannelDeviceArea(data: any) {
  42 + return axios.put("/system/channel-device-area", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通讯设备数据区域
  47 + * @param id 通讯设备数据区域ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delChannelDeviceArea(id: any) {
  51 + return axios.delete("/system/channel-device-area/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯设备列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listChannelDevice(params: any) {
  10 + return axios.get("/system/channel-device/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯设备详细
  20 + * @param id 通讯设备ID
  21 + * @returns 结果
  22 + */
  23 +export function getChannelDevice(id: any) {
  24 + return axios.get("/system/channel-device/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通讯设备
  29 + * @param data 通讯设备对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addChannelDevice(data: any) {
  33 + return axios.post("/system/channel-device", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通讯设备
  38 + * @param data 通讯设备对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateChannelDevice(data: any) {
  42 + return axios.put("/system/channel-device", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通讯设备
  47 + * @param id 通讯设备ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delChannelDevice(id: any) {
  51 + return axios.delete("/system/channel-device/" + id);
  52 +}
  53 +
  54 +/**
  55 + * 修改通讯设备状态
  56 + * @param data 通讯设备对象
  57 + * @returns 0失败 1成功
  58 + */
  59 +export function changeChannelDeviceStatus(id: any,state:any) {
  60 + return axios.put(`/system/channel-device/changeStatus/${id}/${state}`);
  61 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通讯通道列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listChannel(params: any) {
  10 + return axios.get("/system/channel/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通讯通道列表-所有的
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listChannelAll(params: any) {
  24 + return axios.get("/system/channel/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + }
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询通讯通道详细
  34 + * @param id 通讯通道ID
  35 + * @returns 结果
  36 + */
  37 +export function getChannel(id: any) {
  38 + return axios.get("/system/channel/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 新增通讯通道
  43 + * @param data 通讯通道对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addChannel(data: any) {
  47 + return axios.post("/system/channel", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改通讯通道
  52 + * @param data 通讯通道对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateChannel(data: any) {
  56 + return axios.put("/system/channel", data);
  57 +}
  58 +
  59 +/**
  60 + * 修改通讯通道状态
  61 + * @param data 通讯通道对象
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function changeChannelStatus(id: any,state:any) {
  65 + return axios.put(`/system/channel/changeStatus/${id}/${state}`);
  66 +}
  67 +/**
  68 + * 删除通讯通道
  69 + * @param id 通讯通道ID
  70 + * @returns 0失败 1成功
  71 + */
  72 +export function delChannel(id: any) {
  73 + return axios.delete("/system/channel/" + id);
  74 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询公司列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listCompany(params: any) {
  10 + return axios.get("/system/company/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询公司列表
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listCompanyAll(params: any) {
  24 + return axios.get("/system/company/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + }
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询公司详细
  34 + * @param id 公司ID
  35 + * @returns 结果
  36 + */
  37 +export function getCompany(id: any) {
  38 + return axios.get("/system/company/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 新增公司
  43 + * @param data 公司对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addCompany(data: any) {
  47 + return axios.post("/system/company", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改公司
  52 + * @param data 公司对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateCompany(data: any) {
  56 + return axios.put("/system/company", data);
  57 +}
  58 +
  59 +/**
  60 + * 删除公司
  61 + * @param id 公司ID
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function delCompany(id: any) {
  65 + return axios.delete("/system/company/" + id);
  66 +}
  67 +
  68 +/**
  69 + * 修改公司状态
  70 + * @param data 公司对象
  71 + * @returns 0失败 1成功
  72 + */
  73 +export function changeCompanyStatus(id: any,state:any) {
  74 + return axios.put(`/system/company/changeStatus/${id}/${state}`);
  75 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通用字典-数据列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listData(params: any) {
  10 + return axios.get("/system/data/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通用字典-数据详细
  20 + * @param id 通用字典-数据ID
  21 + * @returns 结果
  22 + */
  23 +export function getData(id: any) {
  24 + return axios.get("/system/data/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通用字典-数据
  29 + * @param data 通用字典-数据对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addData(data: any) {
  33 + return axios.post("/system/data", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通用字典-数据
  38 + * @param data 通用字典-数据对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateData(data: any) {
  42 + return axios.put("/system/data", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通用字典-数据
  47 + * @param id 通用字典-数据ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delData(id: any) {
  51 + return axios.delete("/system/data/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +
  3 +/**
  4 + * 根据部门编号获取详细信息
  5 + * @param id 部门ID
  6 + * @returns 结果
  7 + */
  8 +export function getDept(id: any) {
  9 + return axios.get("/system/dept/" + id);
  10 +}
\ No newline at end of file
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询监控设备变量列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listDeviceVar(params: any) {
  10 + return axios.get("/system/device-var/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + },
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询监控设备变量列表-不分页
  20 + * @param params 查询参数
  21 + * @returns 结果
  22 + */
  23 +export function listDeviceVarAll(params: any) {
  24 + return axios.get("/system/device-var/listAll", {
  25 + params,
  26 + paramsSerializer: (obj) => {
  27 + return qs.stringify(obj);
  28 + },
  29 + });
  30 +}
  31 +
  32 +/**
  33 + * 查询监控设备变量详细
  34 + * @param id 监控设备变量ID
  35 + * @returns 结果
  36 + */
  37 +export function getDeviceVar(id: any) {
  38 + return axios.get("/system/device-var/" + id);
  39 +}
  40 +
  41 +/**
  42 + * 新增监控设备变量
  43 + * @param data 监控设备变量对象
  44 + * @returns 0失败 1成功
  45 + */
  46 +export function addDeviceVar(data: any) {
  47 + return axios.post("/system/device-var", data);
  48 +}
  49 +
  50 +/**
  51 + * 修改监控设备变量
  52 + * @param data 监控设备变量对象
  53 + * @returns 0失败 1成功
  54 + */
  55 +export function updateDeviceVar(data: any) {
  56 + return axios.put("/system/device-var", data);
  57 +}
  58 +
  59 +/**
  60 + * 修改监控设备变量状态
  61 + * @param data 监控设备变量对象
  62 + * @returns 0失败 1成功
  63 + */
  64 +export function changeDeviceVarStatus(id: any, state: any) {
  65 + return axios.put(`/system/device-var/changeStatus/${id}/${state}`);
  66 +}
  67 +
  68 +/**
  69 + * 删除监控设备变量
  70 + * @param id 监控设备变量ID
  71 + * @returns 0失败 1成功
  72 + */
  73 +export function delDeviceVar(id: any) {
  74 + return axios.delete("/system/device-var/" + id);
  75 +}
  76 +
  77 +/**
  78 + * 修改监控设备变量【监控状态】
  79 + * @param id 监控设备变量ID
  80 + * @returns 0失败 1成功
  81 + */
  82 +export function changeMonitorStatus(id: any, state: any) {
  83 + return axios.put(`/system/device-var/changeMonitorStatus/${id}/${state}`);
  84 +}
  85 +
  86 +/**
  87 + * 实时数据
  88 + * @param params 查询参数
  89 + * @returns 结果
  90 + */
  91 +export function getConfigRunTimeList(deviceSn: string, stationType: any) {
  92 + let params = {
  93 + deviceSn: deviceSn,
  94 + stationType: stationType,
  95 + };
  96 + return axios.get("/system/device-var/configRunTimeList", {
  97 + params,
  98 + paramsSerializer: (obj) => {
  99 + return qs.stringify(obj);
  100 + },
  101 + });
  102 +}
  103 +
  104 +/**
  105 + * 实时数据
  106 + * @param params 查询参数
  107 + * @returns 结果
  108 + */
  109 +export function getRunTimeList(deviceSn: string) {
  110 + let params = {
  111 + deviceSn: deviceSn,
  112 + };
  113 + return axios.get("/system/device-var/runTimeList", {
  114 + params,
  115 + paramsSerializer: (obj) => {
  116 + return qs.stringify(obj);
  117 + },
  118 + });
  119 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 站点类型 (1配电 2光伏)
  6 + */
  7 +export enum StationTypeEnum {
  8 + /**
  9 + * 配电
  10 + */
  11 + power = 1,
  12 + /**
  13 + * 光伏
  14 + */
  15 + pv = 2,
  16 + /**
  17 + * 用水
  18 + */
  19 + water = 3,
  20 +}
  21 +
  22 +/**
  23 + * 报表类型 (1普通 2峰谷)
  24 + */
  25 +export enum ReportTypeEnum {
  26 + /**
  27 + * 普通
  28 + */
  29 + basic = 1,
  30 + /**
  31 + * 峰谷
  32 + */
  33 + pv = 2,
  34 +}
  35 +
  36 +/**
  37 + * 查询能源监控设备列表
  38 + * @param params 查询参数
  39 + * @returns 结果
  40 + */
  41 +export function listDevice(params: any) {
  42 + return axios.get("/system/device/list", {
  43 + params,
  44 + paramsSerializer: (obj) => {
  45 + return qs.stringify(obj);
  46 + },
  47 + });
  48 +}
  49 +
  50 +/**
  51 + * 查询能源监控设备列表
  52 + * @param params 查询参数
  53 + * @returns 结果
  54 + */
  55 +export function listDeviceAll(params: any) {
  56 + return axios.get("/system/device/listAll", {
  57 + params,
  58 + paramsSerializer: (obj) => {
  59 + return qs.stringify(obj);
  60 + },
  61 + });
  62 +}
  63 +
  64 +/**
  65 + * 查询能源监控设备详细
  66 + * @param id 能源监控设备ID
  67 + * @returns 结果
  68 + */
  69 +export function getDevice(id: any) {
  70 + return axios.get("/system/device/" + id);
  71 +}
  72 +
  73 +/**
  74 + * 新增能源监控设备
  75 + * @param data 能源监控设备对象
  76 + * @returns 0失败 1成功
  77 + */
  78 +export function addDevice(data: any) {
  79 + return axios.post("/system/device", data);
  80 +}
  81 +
  82 +/**
  83 + * 修改能源监控设备
  84 + * @param data 能源监控设备对象
  85 + * @returns 0失败 1成功
  86 + */
  87 +export function updateDevice(data: any) {
  88 + return axios.put("/system/device", data);
  89 +}
  90 +
  91 +/**
  92 + * 修改能源监控设备状态
  93 + * @param data 能源监控设备对象
  94 + * @returns 0失败 1成功
  95 + */
  96 +export function changeDeviceStatus(id: any, state: any) {
  97 + return axios.put(`/system/device/changeStatus/${id}/${state}`);
  98 +}
  99 +
  100 +/**
  101 + * 删除能源监控设备
  102 + * @param id 能源监控设备ID
  103 + * @returns 0失败 1成功
  104 + */
  105 +export function delDevice(id: any) {
  106 + return axios.delete("/system/device/" + id);
  107 +}
  108 +
  109 +/**
  110 + * 设备树
  111 + * @param params 查询参数
  112 + * @returns 结果
  113 + */
  114 +export function listFusionGroup(params: any) {
  115 + return axios.get("/system/device/listFusionGroup", {
  116 + params,
  117 + paramsSerializer: (obj) => {
  118 + return qs.stringify(obj);
  119 + },
  120 + });
  121 +}
  122 +
  123 +/**
  124 + * 光伏设备列表页动态Tab
  125 + * @param params 查询参数
  126 + * @returns 结果
  127 + */
  128 +export function getPVTab() {
  129 + return axios.get("/system/device/getPVTab");
  130 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询通用字典列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listDict(params: any) {
  10 + return axios.get("/system/dict/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询通用字典详细
  20 + * @param id 通用字典ID
  21 + * @returns 结果
  22 + */
  23 +export function getDict(id: any) {
  24 + return axios.get("/system/dict/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增通用字典
  29 + * @param data 通用字典对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addDict(data: any) {
  33 + return axios.post("/system/dict", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改通用字典
  38 + * @param data 通用字典对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateDict(data: any) {
  42 + return axios.put("/system/dict", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除通用字典
  47 + * @param id 通用字典ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delDict(id: any) {
  51 + return axios.delete("/system/dict/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询企业专属菜单列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listEntMenu(params: any) {
  10 + return axios.get("/system/ent-menu/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +/**
  19 + * 查询企业专属菜单详细
  20 + * @param id 企业专属菜单ID
  21 + * @returns 结果
  22 + */
  23 +export function getEntMenu(id: any) {
  24 + return axios.get("/system/ent-menu/" + id);
  25 +}
  26 +
  27 +/**
  28 + * 新增企业专属菜单
  29 + * @param data 企业专属菜单对象
  30 + * @returns 0失败 1成功
  31 + */
  32 +export function addEntMenu(data: any) {
  33 + return axios.post("/system/ent-menu", data);
  34 +}
  35 +
  36 +/**
  37 + * 修改企业专属菜单
  38 + * @param data 企业专属菜单对象
  39 + * @returns 0失败 1成功
  40 + */
  41 +export function updateEntMenu(data: any) {
  42 + return axios.put("/system/ent-menu", data);
  43 +}
  44 +
  45 +/**
  46 + * 删除企业专属菜单
  47 + * @param id 企业专属菜单ID
  48 + * @returns 0失败 1成功
  49 + */
  50 +export function delEntMenu(id: any) {
  51 + return axios.delete("/system/ent-menu/" + id);
  52 +}
... ...
  1 +import axios from "axios";
  2 +import qs from "qs";
  3 +
  4 +/**
  5 + * 查询企业信息列表
  6 + * @param params 查询参数
  7 + * @returns 结果
  8 + */
  9 +export function listEnterprise(params: any) {
  10 + return axios.get("/system/enterprise/list", {
  11 + params,
  12 + paramsSerializer: (obj) => {
  13 + return qs.stringify(obj);
  14 + }
  15 + });
  16 +}
  17 +
  18 +
  19 +/**
  20 + * 查询企业信息列表
  21 + * @param params 查询参数
  22 + * @returns 结果
  23 + */
  24 +export function listEnterpriseAll() {
  25 + return axios.get("/system/enterprise/listAll");
  26 +}
  27 +
  28 +/**
  29 + * 查询企业信息详细
  30 + * @param id 企业信息ID
  31 + * @returns 结果
  32 + */
  33 +export function getEnterprise(id: any) {
  34 + return axios.get("/system/enterprise/" + id);
  35 +}
  36 +
  37 +/**
  38 + * 新增企业信息
  39 + * @param data 企业信息对象
  40 + * @returns 0失败 1成功
  41 + */
  42 +export function addEnterprise(data: any) {
  43 + return axios.post("/system/enterprise", data);
  44 +}
  45 +
  46 +/**
  47 + * 修改企业信息
  48 + * @param data 企业信息对象
  49 + * @returns 0失败 1成功
  50 + */
  51 +export function updateEnterprise(data: any) {
  52 + return axios.put("/system/enterprise", data);
  53 +}
  54 +
  55 +/**
  56 + * 删除企业信息
  57 + * @param id 企业信息ID
  58 + * @returns 0失败 1成功
  59 + */
  60 +export function delEnterprise(id: any) {
  61 + return axios.delete("/system/enterprise/" + id);
  62 +}
... ...