style: 格式化代码

develop
时启龙 2024-08-21 09:17:14 +08:00
parent bc7bf0381a
commit 6e8f5d8159
4101 changed files with 92284 additions and 96328 deletions

View File

@ -1,17 +1,23 @@
# 下载依赖
pnpm install
# 开发环境启动
pnpm start:app
# 生产环境构建
pnpm build:app
# 代码检测
pnpm lint
# 代码检测并自动修复
pnpm fix
# 解决内存溢出问题
pnpm fix-memory-limit

View File

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

View File

@ -3,17 +3,17 @@
* @Date: 2022-11-09 11:26:04
* @LastEditTime: 2022-11-15 15:55:34
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\build\utils.js
*/
const path = require('path')
const webpack = require('webpack')
exports.getDllPlugins = function(){
exports.getDllPlugins = function () {
return ['vendor', 'element'].map(item => {
return new webpack.DllReferencePlugin({
context: path.resolve(__dirname, '../'),
manifest: require(path.resolve(__dirname, `../dll/${item}-manifest.json`))
})
});
}
})
}

View File

@ -3,28 +3,28 @@
* @Date: 2022-11-08 15:34:47
* @LastEditTime: 2022-11-15 17:51:22
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\build\webpack.dll.config.js
*/
// webpack.dll.conf.js
// 引入依赖
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // 清空文件用的
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // 压缩代码用的
const path = require('path')
const webpack = require('webpack')
const { CleanWebpackPlugin } = require('clean-webpack-plugin') // 清空文件用的
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin // 压缩代码用的
module.exports = {
mode: 'production',
mode: 'production',
entry: {
vendor: ['vue-router', 'vuex', '@vue/composition-api', 'axios', 'qs', 'js-cookie', 'dayjs', 'crypto-js', 'cmp-socket', 'vuedraggable'],
element: ['cmp-element', 'cmp-echarts'],
element: ['cmp-element', 'cmp-echarts']
},
// 出口
output: {
filename: 'dll.[name].js', // 其中[name]就是entry中的dll模块名字因此filename就是dll.vue.js
path: path.resolve(__dirname, '../dll'), // 输出打包的依赖文件到dll/js文件夹中
library: '[name]_library'// 暴露出的全局变量名,用于给 manifest 映射
library: '[name]_library' // 暴露出的全局变量名,用于给 manifest 映射
},
plugins: [
// 重新打包时清除之前打包的dll文件
@ -38,8 +38,8 @@ module.exports = {
name: '[name]_library',
context: path.resolve(__dirname, '../'),
// path 指定manifest.json文件的输出路径
path: path.resolve(__dirname, '../dll/[name]-manifest.json'), // DllReferencePlugin使用该json文件来做映射依赖。这个文件会告诉我们的哪些文件已经提取打包好了
path: path.resolve(__dirname, '../dll/[name]-manifest.json') // DllReferencePlugin使用该json文件来做映射依赖。这个文件会告诉我们的哪些文件已经提取打包好了
}),
new BundleAnalyzerPlugin(),// 压缩
new BundleAnalyzerPlugin() // 压缩
]
}

View File

@ -1,4 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
}

View File

@ -1,115 +1,115 @@
{
"name": "cmc-web-feature",
"private": true,
"version": "6.5.0",
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"start:main": "pnpm -r --filter=@cmc/main-web run serve",
"build:main": "pnpm -r --filter=@cmc/main-web run build",
"start:cmp": "pnpm -r --filter=@cmc/cmp-web run serve",
"build:cmp": "pnpm -r --filter=@cmc/cmp-web run build",
"start:ams": "pnpm -r --filter=@cmc/ams-web run serve",
"build:ams": "pnpm -r --filter=@cmc/ams-web run build",
"start:cop": "pnpm -r --filter=@cmc/cop-web run serve",
"build:cop": "pnpm -r --filter=@cmc/cop-web run build",
"start:cop-console": "pnpm -r --filter=@csc/cop-console run serve",
"build:cop-console": "pnpm -r --filter=@csc/cop-console run build",
"start:cms": "pnpm -r --filter=@cmc/cms-web run serve",
"build:cms": "pnpm -r --filter=@cmc/cms-web run build",
"start:sms": "pnpm -r --filter=@cmc/sms-web run serve",
"build:sms": "pnpm -r --filter=@cmc/sms-web run build",
"start:cos": "pnpm -r --filter=@cmc/cos-web run serve",
"build:cos": "pnpm -r --filter=@cmc/cos-web run build",
"start:aos": "pnpm -r --filter=@cmc/aos-web run serve",
"build:aos": "pnpm -r --filter=@cmc/aos-web run build",
"start:log": "pnpm -r --filter=@cmc/log-web run serve",
"build:log": "pnpm -r --filter=@cmc/log-web run build",
"start:oms": "pnpm -r --filter=@cmc/oms-web run serve",
"build:oms": "pnpm -r --filter=@cmc/oms-web run build",
"start:scr": "pnpm -r --filter=@cmc/scr-web run serve",
"build:scr": "pnpm -r --filter=@cmc/scr-web run build",
"build:all": "pnpm -r --filter=./webs/** run build",
"build:dll": "webpack --config ./build/webpack.dll.config.js",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
},
"repository": {
"type": "git",
"url": "http://58.210.154.140:8888/web/cmc-web.git"
},
"dependencies": {
"@cmp/cmp-api": "workspace:^6.0.0",
"@cmp/cmp-common": "workspace:^6.0.0",
"@cmp/cmp-core": "1.0.1-6.6-1",
"@cmp/cmp-echarts": "1.0.0-6.5-release",
"@cmp/cmp-element": "1.0.1-6.6-1",
"@cmp/cmp-graph-editor": "1.0.0-6.5-release",
"@sentry/rrweb": "^0.3.3",
"@sentry/tracing": "^7.34.0",
"@sentry/vue": "^7.34.0",
"axios": "^0.18.0",
"clipboard": "^2.0.6",
"cmp-graph": "1.0.0",
"cmp-socket": "1.0.0",
"core-js": "^3.1.2",
"cronstrue": "^2.11.0",
"crypto-js": "^3.1.9-1",
"dayjs": "^1.10.4",
"element-ui": "2.13.0",
"jquery.json-viewer": "^1.1.0",
"mavon-editor": "^2.9.1",
"nprogress": "^0.2.0",
"qs": "^6.7.0",
"rrweb": "1.1.3",
"v-viewer": "1.4.2",
"vue": "~2.7.0",
"vue-class-component": "^7.0.2",
"vue-grid-layout": "^2.1.9",
"vue-property-decorator": "^8.1.0",
"vue-router": "~3.5.1",
"vue2-animate": "^1.0.4",
"vuedraggable": "^2.15.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"@types/lodash-es": "^4.17.4",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"@vue/cli-plugin-babel": "~4.5.18",
"@vue/cli-plugin-eslint": "~4.5.18",
"@vue/cli-plugin-router": "~4.5.18",
"@vue/cli-plugin-typescript": "~4.5.18",
"@vue/cli-plugin-vuex": "~4.5.18",
"@vue/cli-service": "~4.5.18",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^5.0.2",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-vite-meta-glob": "^1.0.3",
"clean-webpack-plugin": "^4.0.0",
"compress-webpack-plugin": "^1.0.6",
"cross-env": "^5.2.0",
"css-unicode-loader": "^1.0.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^9.10.0",
"increase-memory-limit": "^1.0.6",
"sass": "~1.32.6",
"sass-loader": "^8.0.0",
"svg-sprite-loader": "^6.0.6",
"typescript": "4.4.4"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"name": "cmc-web-feature",
"private": true,
"version": "6.5.0",
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"start:main": "pnpm -r --filter=@cmc/main-web run serve",
"build:main": "pnpm -r --filter=@cmc/main-web run build",
"start:cmp": "pnpm -r --filter=@cmc/cmp-web run serve",
"build:cmp": "pnpm -r --filter=@cmc/cmp-web run build",
"start:ams": "pnpm -r --filter=@cmc/ams-web run serve",
"build:ams": "pnpm -r --filter=@cmc/ams-web run build",
"start:cop": "pnpm -r --filter=@cmc/cop-web run serve",
"build:cop": "pnpm -r --filter=@cmc/cop-web run build",
"start:cop-console": "pnpm -r --filter=@csc/cop-console run serve",
"build:cop-console": "pnpm -r --filter=@csc/cop-console run build",
"start:cms": "pnpm -r --filter=@cmc/cms-web run serve",
"build:cms": "pnpm -r --filter=@cmc/cms-web run build",
"start:sms": "pnpm -r --filter=@cmc/sms-web run serve",
"build:sms": "pnpm -r --filter=@cmc/sms-web run build",
"start:cos": "pnpm -r --filter=@cmc/cos-web run serve",
"build:cos": "pnpm -r --filter=@cmc/cos-web run build",
"start:aos": "pnpm -r --filter=@cmc/aos-web run serve",
"build:aos": "pnpm -r --filter=@cmc/aos-web run build",
"start:log": "pnpm -r --filter=@cmc/log-web run serve",
"build:log": "pnpm -r --filter=@cmc/log-web run build",
"start:oms": "pnpm -r --filter=@cmc/oms-web run serve",
"build:oms": "pnpm -r --filter=@cmc/oms-web run build",
"start:scr": "pnpm -r --filter=@cmc/scr-web run serve",
"build:scr": "pnpm -r --filter=@cmc/scr-web run build",
"build:all": "pnpm -r --filter=./webs/** run build",
"build:dll": "webpack --config ./build/webpack.dll.config.js",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
},
"repository": {
"type": "git",
"url": "http://58.210.154.140:8888/web/cmc-web.git"
},
"dependencies": {
"@cmp/cmp-api": "workspace:^6.0.0",
"@cmp/cmp-common": "workspace:^6.0.0",
"@cmp/cmp-core": "1.0.1-6.6-1",
"@cmp/cmp-echarts": "1.0.0-6.5-release",
"@cmp/cmp-element": "1.0.1-6.6-1",
"@cmp/cmp-graph-editor": "1.0.0-6.5-release",
"@sentry/rrweb": "^0.3.3",
"@sentry/tracing": "^7.34.0",
"@sentry/vue": "^7.34.0",
"axios": "^0.18.0",
"clipboard": "^2.0.6",
"cmp-graph": "1.0.0",
"cmp-socket": "1.0.0",
"core-js": "^3.1.2",
"cronstrue": "^2.11.0",
"crypto-js": "^3.1.9-1",
"dayjs": "^1.10.4",
"element-ui": "2.13.0",
"jquery.json-viewer": "^1.1.0",
"mavon-editor": "^2.9.1",
"nprogress": "^0.2.0",
"qs": "^6.7.0",
"rrweb": "1.1.3",
"v-viewer": "1.4.2",
"vue": "~2.7.0",
"vue-class-component": "^7.0.2",
"vue-grid-layout": "^2.1.9",
"vue-property-decorator": "^8.1.0",
"vue-router": "~3.5.1",
"vue2-animate": "^1.0.4",
"vuedraggable": "^2.15.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"@types/lodash-es": "^4.17.4",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"@vue/cli-plugin-babel": "~4.5.18",
"@vue/cli-plugin-eslint": "~4.5.18",
"@vue/cli-plugin-router": "~4.5.18",
"@vue/cli-plugin-typescript": "~4.5.18",
"@vue/cli-plugin-vuex": "~4.5.18",
"@vue/cli-service": "~4.5.18",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^5.0.2",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-vite-meta-glob": "^1.0.3",
"clean-webpack-plugin": "^4.0.0",
"compress-webpack-plugin": "^1.0.6",
"cross-env": "^5.2.0",
"css-unicode-loader": "^1.0.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^9.10.0",
"increase-memory-limit": "^1.0.6",
"sass": "~1.32.6",
"sass-loader": "^8.0.0",
"svg-sprite-loader": "^6.0.6",
"typescript": "4.4.4"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
}

View File

@ -1,19 +1,19 @@
{
"name": "@cmp/cmp-api",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"name": "@cmp/cmp-api",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
}

View File

@ -15,12 +15,12 @@ export function getDepart(params: any) {
export function getDepartDetail(id: number) {
return request.get(`${baseUrl}/${id}`)
}
export function createDepart(params:IDepart) {
export function createDepart(params: IDepart) {
return request.post(baseUrl, wrapperParams(params))
}
export function modifyDepart(params:IDepart) {
export function modifyDepart(params: IDepart) {
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
}
export function removeDepart(id:number) {
export function removeDepart(id: number) {
return request.delete(`${baseUrl}/${id}`)
}

View File

@ -6,7 +6,7 @@ import { wrapperParams, downloadFile } from '@csc/common/utils'
const baseUrl = '/sms/v1/logs'
export function getLog(params:Base.IListParams) {
export function getLog(params: Base.IListParams) {
return request.get(baseUrl, {
params
})

View File

@ -23,10 +23,10 @@ export function removeUser(id: number) {
return request.delete(`${baseUrl}/${id}`)
}
export function accreditManager(id:number, roleIds:number[]) {
export function accreditManager(id: number, roleIds: number[]) {
return request.patch(`${baseUrl}/${id}/accredit`, roleIds)
}
export function resetManager(id:number, password:string) {
export function resetManager(id: number, password: string) {
return request.patch(`${baseUrl}/${id}/reset`, { password })
}
export function operateManager(id: number, action: string) {
@ -35,20 +35,20 @@ export function operateManager(id: number, action: string) {
export function batchOperateManager(ids: number[], action: string) {
return request.patch(`${baseUrl}`, { action, ids })
}
export function changePassword(id: number, params: {oldPassword: string, password: string}) {
export function changePassword(id: number, params: { oldPassword: string; password: string }) {
return request.patch(`${baseUrl}/${id}/pwd`, params)
}
export function checkUser(id: number) {
return request.get(`${baseUrl}/${id}/status`)
}
export function getRolesByUser(id:number) {
export function getRolesByUser(id: number) {
return request.get(`${baseUrl}/${id}/roles`)
}
export function getTrack(params:Base.IListParams) {
export function getTrack(params: Base.IListParams) {
return request.get(`${baseUrl}/track`, {
params
})
}
export function exportUser(params:Base.IListParams) {
export function exportUser(params: Base.IListParams) {
downloadFile(`${baseUrl}/export`, params)
}

View File

@ -5,16 +5,16 @@ import { request } from '@cmp/cmp-element'
import { wrapperParams, downloadFile } from 'utils/index'
const baseUrl = '/sms/v1/tenants'
export function getTenant(params:any) {
export function getTenant(params: any) {
return request.get(baseUrl, {
params
})
}
export function checkedTenant(account:string) {
export function checkedTenant(account: string) {
return request.get(`${baseUrl}/${account}/exist`)
}
export function getTenantTree(params:any) {
export function getTenantTree(params: any) {
return request.get(`${baseUrl}`, {
params: {
condition: JSON.stringify({ condition: 'children' }),
@ -22,43 +22,43 @@ export function getTenantTree(params:any) {
}
})
}
export function getTenantDetail(id:number) {
export function getTenantDetail(id: number) {
return request.get(`${baseUrl}/${id}/quotas`)
}
// 租户信息
export function getTenantInfo(id:number) {
export function getTenantInfo(id: number) {
return request.get(`${baseUrl}/${id}`)
}
// 租户下用户列表
export function getTenantUserTrans(id:number, params: any) {
export function getTenantUserTrans(id: number, params: any) {
return request.get(`${baseUrl}/${id}/users`, { params })
}
// 租户下服务列表
export function getTenantService(id:number) {
export function getTenantService(id: number) {
return request.get(`/cos/v1/services/tenants/${id}/services`)
}
export function createTenant(params:any) {
export function createTenant(params: any) {
return request.post(baseUrl, wrapperParams(params))
}
export function modifyTenant(params:any) {
export function modifyTenant(params: any) {
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
}
export function removeTenant(id:number) {
export function removeTenant(id: number) {
return request.delete(`${baseUrl}/${id}`)
}
export function getTenantStats(params:any) {
export function getTenantStats(params: any) {
return request.get(`${baseUrl}/stats`, {
params: wrapperParams(params)
})
}
export function getTenantPool(id:number) {
export function getTenantPool(id: number) {
return request.get(`${baseUrl}/${id}/pools`)
}
export function assignTenantPools(params:any) {
export function assignTenantPools(params: any) {
return request.post(`${baseUrl}/${params.id}/pools`, JSON.stringify(params.poolIds))
}
export function resetTenantPsw(id:number, params:any) {
export function resetTenantPsw(id: number, params: any) {
return request.patch(`${baseUrl}/${id}/reset`, {
...wrapperParams(params)
})
@ -68,71 +68,71 @@ export function resetTenantPsw(id:number, params:any) {
* action
* lock active reset accredit change
*/
export function operateTenant(id:number, action:string, params:any) {
export function operateTenant(id: number, action: string, params: any) {
return request.patch(`${baseUrl}/${id}`, {
action,
...wrapperParams(params)
})
}
// 租户配额
export function getQuotaTenant(id:number, params:any) {
export function getQuotaTenant(id: number, params: any) {
return request.get(`/cos/v1/tenants/${id}/quotas`, { params })
}
export function getCscQuotaTenant(params:any) {
export function getCscQuotaTenant(params: any) {
return request.get(`/cos/v1/tenants/${params.tenantId ? params.tenantId : params.target}/quotas`, { params: wrapperParams(params) })
}
export function createQuotaTenant(id:number, params:any) {
export function createQuotaTenant(id: number, params: any) {
return request.post(`/cos/v1/tenants/${id}/quotas`, wrapperParams(params))
}
export function getTenantBus(id:number, params:any) {
export function getTenantBus(id: number, params: any) {
return request.get(`/sms/v1/tenants/${id}/businesses`, { params })
}
export function createTenantBus(id:number, params:any) {
export function createTenantBus(id: number, params: any) {
return request.post(`/sms/v1/tenants/${id}/businesses`, params)
}
export function createTenantPool(id:number, params:any) {
export function createTenantPool(id: number, params: any) {
return request.post(`/sms/v1/tenants/${id}/pools`, params)
}
export function getOsTenant(params:any) {
export function getOsTenant(params: any) {
return request.get('/cmp/v1/ostenants', {
params
})
}
export function createOsTenantt(params:any) {
export function createOsTenantt(params: any) {
return request.post('/cmp/v1/ostenants', wrapperParams(params))
}
export function modifyOsTenant(params:any) {
export function modifyOsTenant(params: any) {
return request.put(`/cmp/v1/ostenants/${params.id}`, wrapperParams(params))
}
export function removeOsTenant(id:number) {
export function removeOsTenant(id: number) {
return request.delete(`/cmp/v1/ostenants/${id}`)
}
export function getTrack(params:any) {
export function getTrack(params: any) {
return request.get(`${baseUrl}/track`, {
params: params
})
}
export function getUser(params:any) {
export function getUser(params: any) {
return request.get('/sms/v1/users', { params })
}
// 获取授信
export function getTenantAccount(id:number) {
export function getTenantAccount(id: number) {
return request.get(`/cos/v1/tenants/${id}/account`)
}
// 授信修改
export function createTenantAccount(params:any) {
export function createTenantAccount(params: any) {
return request.post('/cos/v1/tenants/account', wrapperParams(params))
}
export function getApiById(id:number, params:any) {
export function getApiById(id: number, params: any) {
return request.get(`/sms/v1/tenants/${id}/apis`, {
params: params
})
}
export function updateApi(id:number, params:any) {
export function updateApi(id: number, params: any) {
return request.patch(`/sms/v1/tenants/${id}/apis`, params)
}
// 配额
@ -140,17 +140,17 @@ export function getBaseQuotas() {
return request.get('/cos/v1/quotas/metas')
}
export function getTenantBaseQuotas(id:number) {
export function getTenantBaseQuotas(id: number) {
return request.get(`/cos/v1/tenants/${id}/quotas/metas`)
}
// 租户配置用户
export function tenantCongigUser(params:any) {
export function tenantCongigUser(params: any) {
return request.post(`/sms/v1/tenants/${params.id}/users`, params.ids)
}
// 租户移除用户
export function tenantRemoveUser(id:number) {
export function tenantRemoveUser(id: number) {
return request.patch(`/sms/v1/users/${id}/tenants`)
}

View File

@ -11,15 +11,17 @@ export const taskExeOptions = {
SUSPENDED: '已暂停',
CREATED: '未执行'
}
export const authenModeOptions = isConsole ? {
TRUST: '互信认证',
SINGLE: '单一认证',
} : {
BATCH: '批量认证',
TRUST: '互信认证',
SINGLE: '单一认证',
ACCOUNT: '认证账号'
}
export const authenModeOptions = isConsole
? {
TRUST: '互信认证',
SINGLE: '单一认证'
}
: {
BATCH: '批量认证',
TRUST: '互信认证',
SINGLE: '单一认证',
ACCOUNT: '认证账号'
}
export const environmentData = {
DEVELOP: '开发环境',
TEST: '测试环境',
@ -51,7 +53,18 @@ export const hostType = {
PC: 'PC',
X86: 'X86服务器'
}
export const funData = [{ name: 'mean' }, { name: 'median' }, { name: 'count' }, { name: 'min' }, { name: 'max' }, { name: 'sum' }, { name: 'first' }, { name: 'last' }, { name: 'spread' }, { name: 'stddev' }]
export const funData = [
{ name: 'mean' },
{ name: 'median' },
{ name: 'count' },
{ name: 'min' },
{ name: 'max' },
{ name: 'sum' },
{ name: 'first' },
{ name: 'last' },
{ name: 'spread' },
{ name: 'stddev' }
]
export const processLevel = [
{ name: '一般', value: 'COMMON' },

View File

@ -6,7 +6,17 @@
<el-button class="m-l-sm" :type="params.startTime ? 'primary' : 'ghost'" @click="selectTime()"></el-button>
<span class="tip m-l" v-if="params.startTime">{{ params.startTime }} - {{ params.endTime }}</span>
<el-dialog title="时间选择" :visible.sync="dialogVisible" width="500px" v-if="dialogVisible">
<el-date-picker v-model="time" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"> </el-date-picker>
<el-date-picker
v-model="time"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
>
</el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button @click.native="dialogVisible = false">取消</el-button>
<el-button type="primary" @click.native="submit">确定</el-button>
@ -114,5 +124,4 @@ export default {
}
}
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

View File

@ -1,5 +1,5 @@
<template>
<el-input v-bind="$attrs"></el-input>
<el-input v-bind="$attrs"></el-input>
</template>
<script>
@ -43,8 +43,8 @@ export default {
type: String
}
},
setup (props) {
const colorObj = computed(() => (colorMap[props.type] || {}))
setup(props) {
const colorObj = computed(() => colorMap[props.type] || {})
return { colorObj }
}
}

View File

@ -1,19 +1,19 @@
<template>
<el-row :gutter="10">
<el-col :span="12">
<el-card>
<div slot="header">
<span>{{titles[0]}}</span>
<el-button type="primary" class="pull-right" style="margin-top: 5px;" size="mini" @click="addItems">
<span>{{ titles[0] }}</span>
<el-button type="primary" class="pull-right" style="margin-top: 5px" size="mini" @click="addItems"
>移入
<i class="el-icon-right"></i>
</el-button>
</div>
<div style="height:360px;overflow-y: auto;">
<div style="height: 360px; overflow-y: auto">
<el-row v-for="(item, key) in source" :key="key">
<el-col :span="24" class="cell-title">{{prefix}}{{key}}</el-col>
<el-col class="cell" :span="24" v-for="(cell, key) in item" :key="key">
<el-checkbox v-model="cell.checked">{{cell[label]}}</el-checkbox>
<el-col :span="24" class="cell-title">{{ prefix }}{{ key }}</el-col>
<el-col class="cell" :span="24" v-for="(cell, key) in item" :key="key">
<el-checkbox v-model="cell.checked">{{ cell[label] }}</el-checkbox>
</el-col>
</el-row>
</div>
@ -22,17 +22,17 @@
<el-col :span="12">
<el-card>
<div slot="header">
<span class="pull-right">{{titles[1]}}</span>
<span class="pull-right">{{ titles[1] }}</span>
<el-button type="danger" size="mini" @click="removeItems">
<i class="el-icon-back"></i>
移除
</el-button>
</div>
<div style="height:360px;overflow-y: auto;">
<div style="height: 360px; overflow-y: auto">
<el-row v-for="(item, key) in target" :key="key">
<el-col :span="24" class="cell-title">{{prefix}}{{key}}</el-col>
<el-col :span="24" class="cell-title">{{ prefix }}{{ key }}</el-col>
<el-col class="cell" :span="24" v-for="(cell, key) in item" :key="`${key}${item.name}`">
<el-checkbox v-model="cell.checked">{{cell[label]}}</el-checkbox>
<el-checkbox v-model="cell.checked">{{ cell[label] }}</el-checkbox>
</el-col>
</el-row>
</div>
@ -81,35 +81,35 @@ export default {
}
}
},
data () {
data() {
return {
selectList: [],
sourceList: []
}
},
created () {
created() {
this.init()
},
watch: {
data: {
handler (newVal, oldVal) {
this.selectList = [];
this.sourceList = [];
handler(newVal, oldVal) {
this.selectList = []
this.sourceList = []
this.init()
}
}
},
computed: {
source () {
source() {
return this.formatData(this.sourceList)
},
target () {
target() {
return this.formatData(this.selectList)
}
},
methods: {
init () {
[...this.data].forEach((item, key) => {
init() {
;[...this.data].forEach((item, key) => {
const result = {
...item,
checked: false,
@ -122,7 +122,7 @@ export default {
}
})
},
formatData (data) {
formatData(data) {
const source = {}
data.forEach(item => {
const key = item[this.groupKey]
@ -134,8 +134,8 @@ export default {
})
return source
},
addItems () {
const list = [];
addItems() {
const list = []
this.sourceList.forEach(item => {
if (item.checked) {
this.selectList.push({
@ -148,11 +148,11 @@ export default {
})
this.sourceList = [...list].sort((a, b) => {
return a.orderKey - b.orderKey
});
})
this.getChekckIds()
},
removeItems () {
const list = [];
removeItems() {
const list = []
this.selectList.forEach(item => {
if (item.checked) {
this.sourceList.push({
@ -163,10 +163,10 @@ export default {
list.push(item)
}
})
this.selectList = [...list];
this.selectList = [...list]
this.getChekckIds()
},
getChekckIds () {
getChekckIds() {
const checkedIds = this.selectList.map(item => item[this.value])
this.$emit('change', checkedIds)
}
@ -175,17 +175,17 @@ export default {
</script>
<style scoped>
.cell-title{
font-size: 12px;
font-weight: bold;
}
.cell{
padding: 5px;
color: #606266;
font-weight: 500;
white-space: nowrap;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
}
.cell-title {
font-size: 12px;
font-weight: bold;
}
.cell {
padding: 5px;
color: #606266;
font-weight: 500;
white-space: nowrap;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -3,7 +3,7 @@
* @Date: 2022-11-03 15:41:09
* @LastEditTime: 2022-11-07 10:52:35
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\packages\common\components\icon-select\elementIcons.ts
*/
export default []
export default []

View File

@ -3,7 +3,7 @@
* @Date: 2022-11-03 15:41:09
* @LastEditTime: 2022-11-07 10:39:26
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\node_modules\@cmc\common\components\icon-select\svgIcons.ts
*/
@ -11,7 +11,7 @@
const req = require.context('@/icons/svg', false, /\.svg$/)
const requireAll = (requireContext: any) => requireContext.keys()
const re = /\.\/(.*)\.svg/;
const re = /\.\/(.*)\.svg/
const svgIcons = requireAll(req).map((i: any) => {
return i.match(re)[1]

View File

@ -13,11 +13,9 @@
</i>
<span class="vicp-hint" v-show="loading !== 1">{{ lang.hint }}</span>
<span class="vicp-no-supported-hint" v-show="!isSupported">{{ lang.noSupported }}</span>
<input type="file" v-show="false" v-if="step == 1" @change="handleChange" ref="fileinput">
</div>
<div class="vicp-error" v-show="hasError">
<i class="vicp-icon2"></i> {{ errorMsg }}
<input type="file" v-show="false" v-if="step == 1" @change="handleChange" ref="fileinput" />
</div>
<div class="vicp-error" v-show="hasError"><i class="vicp-icon2"></i> {{ errorMsg }}</div>
<div class="vicp-operate">
<a @click="off" @mousedown="ripple">{{ lang.btn.off }}</a>
</div>
@ -27,15 +25,34 @@
<div class="vicp-crop">
<div class="vicp-crop-left" v-show="true">
<div class="vicp-img-container">
<img :src="sourceImgUrl" :style="sourceImgStyle" class="vicp-img" draggable="false" @drag="preventDefault" @dragstart="preventDefault" @dragend="preventDefault"
@dragleave="preventDefault" @dragover="preventDefault" @dragenter="preventDefault" @drop="preventDefault" @touchstart="imgStartMove" @touchmove="imgMove" @touchend="createImg"
@touchcancel="createImg" @mousedown="imgStartMove" @mousemove="imgMove" @mouseup="createImg" @mouseout="createImg" ref="img">
<img
:src="sourceImgUrl"
:style="sourceImgStyle"
class="vicp-img"
draggable="false"
@drag="preventDefault"
@dragstart="preventDefault"
@dragend="preventDefault"
@dragleave="preventDefault"
@dragover="preventDefault"
@dragenter="preventDefault"
@drop="preventDefault"
@touchstart="imgStartMove"
@touchmove="imgMove"
@touchend="createImg"
@touchcancel="createImg"
@mousedown="imgStartMove"
@mousemove="imgMove"
@mouseup="createImg"
@mouseout="createImg"
ref="img"
/>
<div class="vicp-img-shade vicp-img-shade-1" :style="sourceImgShadeStyle"></div>
<div class="vicp-img-shade vicp-img-shade-2" :style="sourceImgShadeStyle"></div>
</div>
<div class="vicp-range">
<input type="range" :value="scale.range" step="1" min="0" max="100" @change="zoomChange">
<input type="range" :value="scale.range" step="1" min="0" max="100" @change="zoomChange" />
<i @mousedown="startZoomSub" @mouseout="endZoomSub" @mouseup="endZoomSub" class="vicp-icon5"></i>
<i @mousedown="startZoomAdd" @mouseout="endZoomAdd" @mouseup="endZoomAdd" class="vicp-icon6"></i>
</div>
@ -47,11 +64,11 @@
<div class="vicp-crop-right" v-show="true">
<div class="vicp-preview">
<div class="vicp-preview-item" v-if="!noSquare">
<img :src="createImgUrl" :style="previewStyle">
<img :src="createImgUrl" :style="previewStyle" />
<span>{{ lang.preview }}</span>
</div>
<div class="vicp-preview-item vicp-preview-item-circle" v-if="!noCircle">
<img :src="createImgUrl" :style="previewStyle">
<img :src="createImgUrl" :style="previewStyle" />
<span>{{ lang.preview }}</span>
</div>
</div>
@ -69,12 +86,8 @@
<div class="vicp-progress-wrap">
<span class="vicp-progress" v-show="loading === 1" :style="progressStyle"></span>
</div>
<div class="vicp-error" v-show="hasError">
<i class="vicp-icon2"></i> {{ errorMsg }}
</div>
<div class="vicp-success" v-show="loading === 2">
<i class="vicp-icon3"></i> {{ lang.success }}
</div>
<div class="vicp-error" v-show="hasError"><i class="vicp-icon2"></i> {{ errorMsg }}</div>
<div class="vicp-success" v-show="loading === 2"><i class="vicp-icon3"></i> {{ lang.success }}</div>
</div>
<div class="vicp-operate">
<a @click="setStep(2)" @mousedown="ripple">{{ lang.btn.back }}</a>
@ -701,7 +714,7 @@ export default {
//
if (typeof params == 'object' && params) {
Object.keys(params).forEach((k) => {
Object.keys(params).forEach(k => {
fmData.append(k, params[k])
})
}
@ -734,7 +747,7 @@ export default {
client.upload.addEventListener('progress', uploadProgress, false) //
// header
if (typeof headers == 'object' && headers) {
Object.keys(headers).forEach((k) => {
Object.keys(headers).forEach(k => {
client.setRequestHeader(k, headers[k])
})
}
@ -761,7 +774,7 @@ export default {
},
created() {
// esc
document.addEventListener('keyup', (e) => {
document.addEventListener('keyup', e => {
if (this.value && (e.key == 'Escape' || e.keyCode == 27)) {
this.off()
}
@ -1288,7 +1301,16 @@ export default {
box-shadow: 0 2px 6px 0 rgba(68, 170, 119, 0.3);
-webkit-transition: width 0.15s linear;
transition: width 0.15s linear;
background-image: -webkit-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-image: -webkit-linear-gradient(
135deg,
rgba(255, 255, 255, 0.2) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
transparent 75%,
transparent
);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
background-size: 40px 40px;
-webkit-animation: vicp_progress 0.5s linear infinite;

View File

@ -5,15 +5,15 @@
* @param {[String]} mime [description]
* @return {[blob]} [description]
*/
export default function(data, mime) {
data = data.split(',')[1];
data = window.atob(data);
const ia = new Uint8Array(data.length);
export default function (data, mime) {
data = data.split(',')[1]
data = window.atob(data)
const ia = new Uint8Array(data.length)
for (let i = 0; i < data.length; i++) {
ia[i] = data.charCodeAt(i);
};
ia[i] = data.charCodeAt(i)
}
// canvas.toDataURL 返回的默认格式就是 image/png
return new Blob([ia], {
type: mime
});
};
})
}

View File

@ -5,35 +5,38 @@
* @param {[Object]} arg_opts [description]
* @return {[bollean]} [description]
*/
export default function(e, arg_opts) {
const opts = Object.assign({
ele: e.target, // 波纹作用元素
type: 'hit', // hit点击位置扩散center中心点扩展
bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
}, arg_opts),
target = opts.ele;
export default function (e, arg_opts) {
const opts = Object.assign(
{
ele: e.target, // 波纹作用元素
type: 'hit', // hit点击位置扩散center中心点扩展
bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
},
arg_opts
),
target = opts.ele
if (target) {
const rect = target.getBoundingClientRect();
let ripple = target.querySelector('.e-ripple');
const rect = target.getBoundingClientRect()
let ripple = target.querySelector('.e-ripple')
if (!ripple) {
ripple = document.createElement('span');
ripple.className = 'e-ripple';
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
target.appendChild(ripple);
ripple = document.createElement('span')
ripple.className = 'e-ripple'
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
target.appendChild(ripple)
} else {
ripple.className = 'e-ripple';
ripple.className = 'e-ripple'
}
switch (opts.type) {
case 'center':
ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px';
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px';
break;
ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px'
ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px'
break
default:
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px';
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px';
ripple.style.top = e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop + 'px'
ripple.style.left = e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft + 'px'
}
ripple.style.backgroundColor = opts.bgc;
ripple.className = 'e-ripple z-active';
return false;
ripple.style.backgroundColor = opts.bgc
ripple.className = 'e-ripple z-active'
return false
}
};
}

View File

@ -53,7 +53,7 @@ export default {
error: {
onlyImg: 'Image only',
outOfSize: 'Image exceeds size limit: ',
lowestPx: 'Image\'s size is too low. Expected at least: '
lowestPx: "Image's size is too low. Expected at least: "
}
},
ro: {
@ -118,7 +118,7 @@ export default {
fr: {
hint: 'Cliquez ou glissez le fichier ici.',
loading: 'Téléchargement…',
noSupported: 'Votre navigateur n\'est pas supporté. Utilisez IE10 + ou un autre navigateur s\'il vous plaît.',
noSupported: "Votre navigateur n'est pas supporté. Utilisez IE10 + ou un autre navigateur s'il vous plaît.",
success: 'Téléchargement réussit',
fail: 'Téléchargement echoué',
preview: 'Aperçu',
@ -130,8 +130,8 @@ export default {
},
error: {
onlyImg: 'Image uniquement',
outOfSize: 'L\'image sélectionnée dépasse la taille maximum: ',
lowestPx: 'L\'image sélectionnée est trop petite. Dimensions attendues: '
outOfSize: "L'image sélectionnée dépasse la taille maximum: ",
lowestPx: "L'image sélectionnée est trop petite. Dimensions attendues: "
}
},
nl: {
@ -263,8 +263,8 @@ export default {
},
error: {
onlyImg: 'Sono accettate solo immagini',
outOfSize: 'L\'immagine eccede i limiti di dimensione: ',
lowestPx: 'L\'immagine è troppo piccola. Il requisito minimo è: '
outOfSize: "L'immagine eccede i limiti di dimensione: ",
lowestPx: "L'immagine è troppo piccola. Il requisito minimo è: "
}
},
ar: {
@ -362,4 +362,4 @@ export default {
lowestPx: 'Bilden är för liten. Minimum är: '
}
}
};
}

View File

@ -4,4 +4,4 @@ export default {
gif: 'image/gif',
svg: 'image/svg+xml',
psd: 'image/photoshop'
};
}

View File

@ -3,7 +3,7 @@
* @Date: 2022-11-03 15:41:09
* @LastEditTime: 2022-11-08 14:34:03
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\packages\common\components\index.js
*/
import Vue from 'vue'
@ -20,5 +20,5 @@ const components = {
IfTooltip
}
Object.keys(components).forEach(key => {
Vue.component(key, components[key]);
Vue.component(key, components[key])
})

View File

@ -1,9 +1,9 @@
<template>
<div ref='editor' class="rich-editor"></div>
<div ref="editor" class="rich-editor"></div>
</template>
<script>
import { onMounted, onBeforeUnmount, ref, watch } from 'vue';
import WangEditor from 'wangeditor';
import { onMounted, onBeforeUnmount, ref, watch } from 'vue'
import WangEditor from 'wangeditor'
export default {
props: {
value: {
@ -12,39 +12,42 @@ export default {
}
},
setup(props, context) {
watch(() => props.value, () => {
console.log(props.value)
if (instance) {
instance.txt.html(props.value);
watch(
() => props.value,
() => {
console.log(props.value)
if (instance) {
instance.txt.html(props.value)
}
}
});
const editor = ref();
let instance;
)
const editor = ref()
let instance
onMounted(() => {
instance = new WangEditor(editor.value);
instance = new WangEditor(editor.value)
// Object.assign(instance.config, {
// onchange(val) {
// context.emit('change', val)
// }
// });
instance.create();
});
instance.create()
})
onBeforeUnmount(() => {
instance.destroy();
instance = null;
});
function getContent () {
instance.destroy()
instance = null
})
function getContent() {
return editor.value.innerText
}
return {
editor,
getContent
};
}
}
};
}
</script>
<style lang="scss" scoped>
.rich-editor{
.rich-editor {
position: relative;
white-space: pre-line;
z-index: 1 !important;

View File

@ -1,6 +1,4 @@
/**
* Created by Zhang Haijun on 2017/11/25.
*/
/** * Created by Zhang Haijun on 2017/11/25. */
<template>
<el-form ref="crontForm" label-width="100px">
<el-form-item label="定时规则:" class="m-b">
@ -9,18 +7,17 @@
<el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group>
</el-form-item>
<div v-if="cronRule=='check'">
<div v-if="cronRule == 'check'">
<el-form-item>
<el-tabs v-model="activeName">
<el-tab-pane label="分钟" name="minute">
<el-row>
<el-col :span="24">
<el-radio label="loop" v-model="minute.rule" @change="getMinuteCron"></el-radio>
<span>从第 <el-input class="minute-input" v-model.number="minute.start" type="number"
:disabled="minute.rule!='loop'" @blur="getMinuteCron"></el-input>
分钟开始每隔 <el-input class="minute-input" v-model.number="minute.end" type="number"
:disabled="minute.rule!='loop'"
@blur="getMinuteCron"></el-input></span>
<span
>从第 <el-input class="minute-input" v-model.number="minute.start" type="number" :disabled="minute.rule != 'loop'" @blur="getMinuteCron"></el-input> 分钟开始每隔
<el-input class="minute-input" v-model.number="minute.end" type="number" :disabled="minute.rule != 'loop'" @blur="getMinuteCron"></el-input>分钟执行</span
>
</el-col>
</el-row>
<el-row>
@ -29,8 +26,7 @@
</el-col>
<el-col :span="24">
<el-checkbox-group v-model="minute.select" @change="getMinuteCron">
<el-checkbox v-for="(item,key) in minute.list" :label="item" :key="key" class="w-label"
:disabled="minute.rule=='loop'" ></el-checkbox>
<el-checkbox v-for="(item, key) in minute.list" :label="item" :key="key" class="w-label" :disabled="minute.rule == 'loop'"></el-checkbox>
</el-checkbox-group>
</el-col>
</el-row>
@ -47,8 +43,7 @@
</el-col>
<el-col :span="24">
<el-checkbox-group v-model="hour.select" @change="getCron('hour')">
<el-checkbox v-for="(item,key) in hour.list" :label="item" :key="key" class="w-label"
:disabled="hour.rule=='loop'" ></el-checkbox>
<el-checkbox v-for="(item, key) in hour.list" :label="item" :key="key" class="w-label" :disabled="hour.rule == 'loop'"></el-checkbox>
</el-checkbox-group>
</el-col>
</el-row>
@ -65,8 +60,7 @@
</el-col>
<el-col :span="24">
<el-checkbox-group v-model="day.select" @change="getCron('day')">
<el-checkbox v-for="(item,key) in day.list" :label="item" :key="key" class="w-label"
:disabled="day.rule=='loop'" ></el-checkbox>
<el-checkbox v-for="(item, key) in day.list" :label="item" :key="key" class="w-label" :disabled="day.rule == 'loop'"></el-checkbox>
</el-checkbox-group>
</el-col>
</el-row>
@ -83,8 +77,7 @@
</el-col>
<el-col :span="24">
<el-checkbox-group v-model="month.select" @change="getCron('month')">
<el-checkbox v-for="(item,key) in month.list" :label="item" :key="key" class="w-label"
:disabled="month.rule=='loop'" ></el-checkbox>
<el-checkbox v-for="(item, key) in month.list" :label="item" :key="key" class="w-label" :disabled="month.rule == 'loop'"></el-checkbox>
</el-checkbox-group>
</el-col>
</el-row>
@ -93,27 +86,20 @@
<el-row>
<el-col :span="24" class="m-b">
<span>是否使用星期</span>
<el-switch @change="switchWeek"
v-model="week.isUsed"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
<el-switch @change="switchWeek" v-model="week.isUsed" active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
</el-col>
</el-row>
<el-row class="border">
<el-col :span="24">
<el-radio label="loop" v-model="week.rule" @change="getCron('week')" :disabled="!week.isUsed">
</el-radio>
<el-radio label="loop" v-model="week.rule" @change="getCron('week')" :disabled="!week.isUsed"> </el-radio>
</el-col>
<el-col :span="24">
<el-radio label="appoint" v-model="week.rule" @change="getCron('week')" :disabled="!week.isUsed">
</el-radio>
<el-radio label="appoint" v-model="week.rule" @change="getCron('week')" :disabled="!week.isUsed"> </el-radio>
</el-col>
<el-col :span="24">
<el-checkbox-group v-model="week.select" @change="getCron('week')">
<el-checkbox v-for="(item,key) in week.list" :label="item" :key="key" class="w-label"
:disabled="week.rule=='loop'||!week.isUsed" >
{{item|weekFilter}}
<el-checkbox v-for="(item, key) in week.list" :label="item" :key="key" class="w-label" :disabled="week.rule == 'loop' || !week.isUsed">
{{ item | weekFilter }}
</el-checkbox>
</el-checkbox-group>
</el-col>
@ -128,12 +114,10 @@
</basic-form-item>
</el-form-item>
</div>
<div v-if="cronRule=='custom'">
<div v-if="cronRule == 'custom'">
<el-form-item>
<el-row>
<el-col :span="24" class="custom-cron">
</el-col>
<el-col :span="24" class="custom-cron"> </el-col>
</el-row>
<el-form-item label="表达式:">
<el-input v-model="customCron"></el-input>
@ -143,7 +127,6 @@
{{ cronRemark }}
</basic-form-item>
</div>
</el-form>
</template>
@ -157,7 +140,7 @@ export default {
default: ''
}
},
data () {
data() {
return {
customCron: '',
cronRule: 'check',
@ -208,18 +191,18 @@ export default {
let result = ''
try {
result = `${cronstrue.toString(this.cron, { locale: 'zh_CN' })}执行`
} catch (e) {
}
} catch (e) {}
return result
}
},
created () {
created() {
this.initData()
this.getMinuteCron()
if (this.data) this.displayData(this.data)
},
methods: {
displayData (value) { //
displayData(value) {
//
const arr = value.split(' ')
this.minute.cron = arr[1]
this.hour.cron = arr[2]
@ -252,7 +235,7 @@ export default {
this.week.isUsed = true
}
},
initData () {
initData() {
for (let i = 0; i < 60; i++) this.minute.list.push(i.toString())
for (let i = 0; i < 24; i++) this.hour.list.push(i.toString())
for (let i = 1; i <= 31; i++) this.day.list.push(i.toString())
@ -260,7 +243,7 @@ export default {
for (let i = 1; i <= 7; i++) this.week.list.push(i.toString())
},
//
handleInputValue () {
handleInputValue() {
const start = parseInt(Math.abs(this.minute.start))
let end = parseInt(Math.abs(this.minute.end))
this.minute.start = start > 59 ? 59 : start
@ -268,23 +251,25 @@ export default {
if (end === 0) end = 5
this.minute.end = end
},
getMinuteCron () {
getMinuteCron() {
if (this.minute.rule == 'loop') {
this.handleInputValue()
this.minute.cron = this.minute.start + '/' + this.minute.end
} else this.minute.cron = this.minute.select.sort().join(',') || '*'
},
getCron (type) { //
getCron(type) {
//
const item = this[type]
if (item.rule == 'loop') {
item.cron = '*'
} else item.cron = item.select.sort().join(',') || '*'
if (type == 'day') { //
if (type == 'day') {
//
this.week.isUsed = false
this.week.cron = '?'
}
},
switchWeek () {
switchWeek() {
if (this.week.isUsed) {
this.day.cron = '?'
this.week.cron = '*'
@ -295,15 +280,13 @@ export default {
this.getCron('day')
}
},
makeCron () {
},
selectCustom () {
makeCron() {},
selectCustom() {
this.customCron = this.checkCron
}
},
filters: {
weekFilter (value) {
weekFilter(value) {
const obj = ['', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
return obj[value]
}
@ -311,24 +294,24 @@ export default {
}
</script>
<style lang="scss">
.border {
border: 1px solid #eee;
padding: 5px;
margin-bottom: 5px;
}
.border {
border: 1px solid #eee;
padding: 5px;
margin-bottom: 5px;
}
.w-label {
width: 40px;
}
.w-label {
width: 40px;
}
.custom-cron {
background: url('../../assets/rule.png') center center no-repeat;
width: 100%;
height: 253px;
margin: 0 auto;
}
.custom-cron {
background: url('../../assets/rule.png') center center no-repeat;
width: 100%;
height: 253px;
margin: 0 auto;
}
.minute-input {
width: 130px;
}
.minute-input {
width: 130px;
}
</style>

View File

@ -1,11 +1,9 @@
/**
* Created by Zhang Haijun on 2017/06/13.
*/
/** * Created by Zhang Haijun on 2017/06/13. */
<template>
<div>
<cb-form-item label="选择图标:" prop="icon" validate="required">
<el-input v-model="addData.icon" v-show="false"></el-input>
<img @click="selectIcon()" class="model-icon" :class="disabled && 'disabled'" :src="addData.icon || '/web-common-resource/img/default_cmdb.png'" alt="">
<img @click="selectIcon()" class="model-icon" :class="disabled && 'disabled'" :src="addData.icon || '/web-common-resource/img/default_cmdb.png'" alt="" />
</cb-form-item>
<el-dialog title="选择图标" :close-on-click-modal="false" v-if="dialogVisible" :visible.sync="dialogVisible" width="50%" append-to-body>
<el-row>
@ -17,18 +15,35 @@
</template>
</el-alert>
</el-col>
<image-cropper field="files" :headers="{ token: getToken() }" @crop-upload-success="imageUploaded" v-if="uploadVisible" v-model="uploadVisible" :width="size" :params="{ category, ...param }" :height="size" :url="`/api${baseUrl}`"
img-format="png"></image-cropper>
<image-cropper
field="files"
:headers="{ token: getToken() }"
@crop-upload-success="imageUploaded"
v-if="uploadVisible"
v-model="uploadVisible"
:width="size"
:params="{ category, ...param }"
:height="size"
:url="`/api${baseUrl}`"
img-format="png"
></image-cropper>
<el-col :span="24">
<div class="icon-cell " v-for="item in list" :key="item.id" :class="{selected:item.checked}" @click="selectItem(item)">
<img :src="item.icon" alt="">
<div class="icon-cell" v-for="item in list" :key="item.id" :class="{ selected: item.checked }" @click="selectItem(item)">
<img :src="item.icon" alt="" />
<i class="remove" v-show="!item.reserved" @click.stop="handleDelete(item)">&times;</i>
<span><i class="el-icon-check"></i></span>
</div>
</el-col>
<el-col :span="24" class="m-t-sm">
<el-pagination @size-change="getList" @current-change="getList" :current-page.sync="params.page" :page-sizes="[5,10,20,30, 50]" :page-size.sync="params.rows"
layout="total, sizes, prev, pager, next, jumper" :total="total">
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page.sync="params.page"
:page-sizes="[5, 10, 20, 30, 50]"
:page-size.sync="params.rows"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</el-col>
</el-row>
@ -102,7 +117,7 @@ export default {
//
function selectItem(item) {
if (item.checked) return
list.value.forEach((row) => {
list.value.forEach(row => {
set(row, 'checked', false)
})
item.checked = true
@ -153,7 +168,7 @@ export default {
height: 50px;
cursor: pointer;
margin-top: 5px;
&.disabled{
&.disabled {
cursor: default;
}
}

View File

@ -1,12 +1,9 @@
<template>
<basic-table ref="table" :data="specList" v-bind="tableProps">
<slot></slot>
<el-table-column sortable v-for="item in columnProps" :prop="item.value" show-overflow-tooltip :label="item.label" :key="item.value" width="150px">
</el-table-column>
<el-table-column sortable v-for="item in columnProps" :prop="item.value" show-overflow-tooltip :label="item.label" :key="item.value" width="150px"> </el-table-column>
<el-table-column show-overflow-tooltip label="参考价格" v-if="showPrice">
<template v-slot="scope">
{{getPrice(scope.row, mode)}} / {{modeUnitFilter(mode)}}
</template>
<template v-slot="scope"> {{ getPrice(scope.row, mode) }} / {{ modeUnitFilter(mode) }} </template>
</el-table-column>
<slot name="append"></slot>
<div slot="pagination"></div>
@ -17,12 +14,12 @@
import { computed, defineComponent } from 'vue'
import { getPrice, modeUnitFilter } from './utils'
interface IColumnProps {
label: string,
label: string
value: string
}
type IProps = {
skus: any[],
mode: string,
skus: any[]
mode: string
columnProps: IColumnProps[]
}
export default defineComponent({
@ -56,11 +53,11 @@ export default defineComponent({
}
}
},
setup(props:IProps, context:any) {
setup(props: IProps, context: any) {
const specList = computed(() => {
return props.skus.map((item:any) => {
const result:any = {}
item.spec.forEach((cell:any) => {
return props.skus.map((item: any) => {
const result: any = {}
item.spec.forEach((cell: any) => {
result[cell.specName] = Number(cell.specValue)
})
return { ...item, ...result }
@ -68,7 +65,7 @@ export default defineComponent({
})
//
const tableProps = computed(() => {
const [{ value } = { value: '' }] = props.columnProps;
const [{ value } = { value: '' }] = props.columnProps
const prop: any = {
defaultSort: {
prop: value

View File

@ -1,4 +1,4 @@
export function modeUnitFilter(value:string) {
export function modeUnitFilter(value: string) {
const map: any = {
HOUR: '小时',
MONTH: '月',
@ -6,27 +6,27 @@ export function modeUnitFilter(value:string) {
}
return map[value]
}
export function getPrice(sku:any, mode:string) {
const { spec, billPolicy, billable } = sku;
export function getPrice(sku: any, mode: string) {
const { spec, billPolicy, billable } = sku
// 不开启计费
if (!billable) return 0;
if (!billable) return 0
const key = `${mode.toLowerCase()}Price`
// 规格计费
if (billPolicy !== 'agility') return sku[key];
const basicPrice = JSON.parse(sku.basicPrice);
if (billPolicy !== 'agility') return sku[key]
const basicPrice = JSON.parse(sku.basicPrice)
// 没有specName说明没有规格设置
const flag = spec.every((item:any) => !item.specName || item.specValue);
const flag = spec.every((item: any) => !item.specName || item.specValue)
// 无值直接返回
if (!flag) return '/';
if (!flag) return '/'
// 获取数值map
const countMap:any = {};
spec.forEach((item:any) => {
countMap[item.specName] = item.specValue;
const countMap: any = {}
spec.forEach((item: any) => {
countMap[item.specName] = item.specValue
})
let totalPrice = 0;
basicPrice.forEach((item:any) => {
const { specName } = item;
let totalPrice = 0
basicPrice.forEach((item: any) => {
const { specName } = item
totalPrice += item[key] * (countMap[specName] || 1)
});
return totalPrice;
})
return totalPrice
}

View File

@ -1,8 +1,7 @@
<template>
<div>
<el-form-item :label="label" required>
<input :id="id" type="file" name="file" v-if="isShowUploadFile"
style="border: 1px solid #d8dce5;border-radius: 4px;padding: 5px 10px; width: 80%">
<input :id="id" type="file" name="file" v-if="isShowUploadFile" style="border: 1px solid #d8dce5; border-radius: 4px; padding: 5px 10px; width: 80%" />
<el-button type="primary" v-if="isShowUploadFile" @click="submitUpload(file)"></el-button>
<el-progress :percentage="file.progress" v-if="!isShowUploadFile"></el-progress>
</el-form-item>
@ -10,7 +9,7 @@
</template>
<script>
import uploadFile from 'utils/uploadFile';
import uploadFile from 'utils/uploadFile'
export default {
props: {
@ -26,32 +25,31 @@ export default {
default: '文件上传:'
}
},
data () {
data() {
return {
file: null,
isShowUploadFile: true,
uploadSuccess: false
};
}
},
created () {
},
mounted () {
const self = this;
created() {},
mounted() {
const self = this
document.getElementById(this.id).addEventListener('change', function (event) {
const files = event.target.files;
const file = files[0];
const files = event.target.files
const file = files[0]
if (/[\u4e00-\u9fa5\s]/.test(file.name)) {
self.$message({
message: '文件名不允许存在中文和空格',
type: 'error'
});
})
}
if (file.name.length > 64) {
self.$message({
message: '文件名称过长',
type: 'error'
});
})
}
self.file = {
file: file,
@ -61,48 +59,49 @@ export default {
isReady: false,
isSuccess: false,
progress: 0
};
});
}
})
},
methods: {
submitUpload (file) {
submitUpload(file) {
if (file == undefined || file == null) {
return this.$message.error('请选择上传文件');
return this.$message.error('请选择上传文件')
}
if (/[\u4e00-\u9fa5\s]/.test(file.name)) {
return this.$message.error('文件名不允许存在中文和空格');
return this.$message.error('文件名不允许存在中文和空格')
}
if (this.fileType == 'EXCEL') {
const fileName = file.name.split('.');
const fileName = file.name.split('.')
let flag
if (fileName[fileName.length - 1] === 'xlsx' ||
fileName[fileName.length - 1] === 'xls' ||
fileName[fileName.length - 1] === 'xltx' ||
fileName[fileName.length - 1] === 'xlt' ||
fileName[fileName.length - 1] === 'xlsm' ||
fileName[fileName.length - 1] === 'xlsb' ||
fileName[fileName.length - 1] === 'xltm' ||
fileName[fileName.length - 1] === 'csv'
if (
fileName[fileName.length - 1] === 'xlsx' ||
fileName[fileName.length - 1] === 'xls' ||
fileName[fileName.length - 1] === 'xltx' ||
fileName[fileName.length - 1] === 'xlt' ||
fileName[fileName.length - 1] === 'xlsm' ||
fileName[fileName.length - 1] === 'xlsb' ||
fileName[fileName.length - 1] === 'xltm' ||
fileName[fileName.length - 1] === 'csv'
) {
flag = true
} else {
return this.$message.error('请上传EXCEL表格');
return this.$message.error('请上传EXCEL表格')
}
} else if (this.fileType == 'TXT') {
const fileName = file.name.split('.')
if (['xlsx', 'xls', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'exe', 'sys', 'mp4', 'avi', 'wmv', 'pdf', 'md'].includes(fileName[fileName.length - 1])) return this.$message.error('请上传文本类文件')
}
this.isShowUploadFile = false;
this.$emit('show', this.isShowUploadFile);
uploadFile(file, this.message);
this.isShowUploadFile = false
this.$emit('show', this.isShowUploadFile)
uploadFile(file, this.message)
},
message (item) {
message(item) {
this.$message({
message: '上传成功',
type: 'success'
});
this.uploadSuccess = true;
})
this.uploadSuccess = true
}
}
};
}
</script>

View File

@ -3,31 +3,31 @@ import { saveAs } from 'file-saver'
import XLSX from 'xlsx'
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
var out = []
var rows = table.querySelectorAll('tr')
var ranges = []
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
var outRow = []
var row = rows[R]
var columns = row.querySelectorAll('td')
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
var cell = columns[C]
var colspan = cell.getAttribute('colspan')
var rowspan = cell.getAttribute('rowspan')
var cellValue = cell.innerText
if (cellValue !== '' && cellValue == +cellValue) cellValue = +cellValue
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null)
}
});
})
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
rowspan = rowspan || 1
colspan = colspan || 1
ranges.push({
s: {
r: R,
@ -37,29 +37,28 @@ function generateArray(table) {
r: R + rowspan - 1,
c: outRow.length + colspan - 1
}
});
};
})
}
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
outRow.push(cellValue !== '' ? cellValue : null)
//Handle Colspan
if (colspan)
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null)
}
out.push(outRow);
out.push(outRow)
}
return [out, ranges];
};
return [out, ranges]
}
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
if (date1904) v += 1462
var epoch = Date.parse(v)
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000)
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var ws = {}
var range = {
s: {
c: 10000000,
@ -69,105 +68,100 @@ function sheet_from_array_of_arrays(data, opts) {
c: 0,
r: 0
}
};
}
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
if (range.s.r > R) range.s.r = R
if (range.s.c > C) range.s.c = C
if (range.e.r < R) range.e.r = R
if (range.e.c < C) range.e.c = C
var cell = {
v: data[R][C]
};
if (cell.v == null) continue;
}
if (cell.v == null) continue
var cell_ref = XLSX.utils.encode_cell({
c: C,
r: R
});
})
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
if (typeof cell.v === 'number') cell.t = 'n'
else if (typeof cell.v === 'boolean') cell.t = 'b'
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
cell.t = 'n'
cell.z = XLSX.SSF._table[14]
cell.v = datenum(cell.v)
} else cell.t = 's'
ws[cell_ref] = cell;
ws[cell_ref] = cell
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range)
return ws
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
if (!(this instanceof Workbook)) return new Workbook()
this.SheetNames = []
this.Sheets = {}
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
var buf = new ArrayBuffer(s.length)
var view = new Uint8Array(buf)
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
return buf
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
var oo = generateArray(theTable);
var ranges = oo[1];
var theTable = document.getElementById(id)
var oo = generateArray(theTable)
var ranges = oo[1]
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
var data = oo[0]
var ws_name = 'SheetJS'
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
ws = sheet_from_array_of_arrays(data)
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
ws['!merges'] = ranges
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
wb.SheetNames.push(ws_name)
wb.Sheets[ws_name] = ws
var wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'binary'
});
})
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), "test.xlsx")
saveAs(
new Blob([s2ab(wbout)], {
type: 'application/octet-stream'
}),
'test.xlsx'
)
}
export function exportJsonToExcel({
multiHeader = [],
header,
data,
filename,
merges = [],
autoWidth = true,
bookType = 'xlsx'
} = {}) {
export function exportJsonToExcel({ multiHeader = [], header, data, filename, merges = [], autoWidth = true, bookType = 'xlsx' } = {}) {
/* original data */
filename = filename || 'excel-list'
data = [...data]
data.unshift(header);
data.unshift(header)
for (let i = multiHeader.length - 1; i > -1; i--) {
data.unshift(multiHeader[i])
}
var ws_name = "SheetJS";
var ws_name = 'SheetJS'
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
ws = sheet_from_array_of_arrays(data)
if (merges.length > 0) {
if (!ws['!merges']) ws['!merges'] = [];
if (!ws['!merges']) ws['!merges'] = []
merges.forEach(item => {
ws['!merges'].push(XLSX.utils.decode_range(item))
})
@ -175,46 +169,50 @@ export function exportJsonToExcel({
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
const colWidth = data.map(row => row.map(val => {
/*先判断是否为null/undefined*/
if (val == null) {
return {
'wch': 10
};
}
/*再判断是否为中文*/
else if (val.toString().charCodeAt(0) > 255) {
return {
'wch': val.toString().length * 2
};
} else {
return {
'wch': val.toString().length
};
}
}))
const colWidth = data.map(row =>
row.map(val => {
/*先判断是否为null/undefined*/
if (val == null) {
return {
wch: 10
}
} else if (val.toString().charCodeAt(0) > 255) {
/*再判断是否为中文*/
return {
wch: val.toString().length * 2
}
} else {
return {
wch: val.toString().length
}
}
})
)
/*以第一行为初始值*/
let result = colWidth[0];
let result = colWidth[0]
for (let i = 1; i < colWidth.length; i++) {
for (let j = 0; j < colWidth[i].length; j++) {
if (result[j]['wch'] < colWidth[i][j]['wch']) {
result[j]['wch'] = colWidth[i][j]['wch'];
result[j]['wch'] = colWidth[i][j]['wch']
}
}
}
ws['!cols'] = result;
ws['!cols'] = result
}
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
wb.SheetNames.push(ws_name)
wb.Sheets[ws_name] = ws
var wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), `${filename}.${bookType}`);
})
saveAs(
new Blob([s2ab(wbout)], {
type: 'application/octet-stream'
}),
`${filename}.${bookType}`
)
}

View File

@ -38,8 +38,7 @@ const axiosInstance = axios.create({
}
})
// 请求完成回调
const finishCallback = function () {
}
const finishCallback = function () {}
// 报错处理
const handleError = function (response) {
if (!response) return // 容错处理
@ -63,7 +62,8 @@ axiosInstance.interceptors.request.use(
// 清除get缓存
config.url = `${config.url}?t=${new Date().getTime()}`
}
config.headers.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlLZXkiOiIxMjE0NTQ2NzgyIiwiY2F0YWxvZyI6Ik1hbmFnZXIiLCJuYW1lIjoi6LaF57qn566h55CG5ZGYIiwiZXhwIjoxNjIzODI5OTA1LCJ1dWlkIjoxLCJhY2NvdW50IjoiYWRtaW4ifQ.H1TLrKni0z4xp3M55SUbUyLImgELqrZhCYrPXoKmucY'
config.headers.token =
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlLZXkiOiIxMjE0NTQ2NzgyIiwiY2F0YWxvZyI6Ik1hbmFnZXIiLCJuYW1lIjoi6LaF57qn566h55CG5ZGYIiwiZXhwIjoxNjIzODI5OTA1LCJ1dWlkIjoxLCJhY2NvdW50IjoiYWRtaW4ifQ.H1TLrKni0z4xp3M55SUbUyLImgELqrZhCYrPXoKmucY'
delete config.headers.options
config.options = options
return config

View File

@ -1,13 +1,13 @@
/**
* Created by HaijunZhang on 2018/12/10.
*/
import path from 'path';
export function isExternalLink (path) {
return /^(http:|https:|mailto:|tel:)\/\//.test(path);
import path from 'path'
export function isExternalLink(path) {
return /^(http:|https:|mailto:|tel:)\/\//.test(path)
}
export function resolvePath (basePath, routePath) {
export function resolvePath(basePath, routePath) {
if (isExternalLink(routePath)) {
return routePath;
return routePath
}
return path.resolve(basePath, routePath);
return path.resolve(basePath, routePath)
}

View File

@ -1,11 +1,11 @@
/**
* Created by Zhang Haijun on 2021/2/2.
*/
* Created by Zhang Haijun on 2021/2/2.
*/
// 查询参数封装优化
export function handleSearchParam (params) {
export function handleSearchParam(params) {
// 设置参数
const objParams = {}
function setParams (sign, key, value) {
function setParams(sign, key, value) {
if (objParams[sign]) {
objParams[sign][key] = value
} else {
@ -42,13 +42,13 @@ export function handleSearchParam (params) {
* @param {*} word 字符
* @returns 0中文, 1: 英文, 2数字, 3: 其他类型
*/
export const getWordType = (word) => {
export const getWordType = word => {
// 验证是否是中文
const pattern0 = new RegExp('[\u4E00-\u9FA5]+');
const pattern0 = new RegExp('[\u4E00-\u9FA5]+')
// 验证是否是英文
const pattern1 = new RegExp('[A-Za-z]+');
const pattern1 = new RegExp('[A-Za-z]+')
// 验证是否是数字
const pattern2 = new RegExp('[0-9]+');
const pattern2 = new RegExp('[0-9]+')
if (pattern0.test(word)) {
return 0

View File

@ -1,4 +1,4 @@
/* Color
-------------------------- */
$--color-primary: #1E54D5;
$--color-primary: #1e54d5;

View File

@ -1,61 +1,61 @@
.buy-btn {
position: fixed;
top: 58px;
right: 20px;
position: fixed;
top: 58px;
right: 20px;
}
.tip {
font-size: 12px;
color: #999;
font-size: 12px;
color: #999;
}
.el-message-box__message {
word-break: break-all;
word-break: break-all;
}
.viewer-container.viewer-backdrop {
z-index: 99999999999999 !important;
z-index: 99999999999999 !important;
}
.w {
width: 200px !important;
width: 200px !important;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
color: #409EFF;
background-color: #D5E8FC;
border-color: #409EFF;
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
color: #409eff;
background-color: #d5e8fc;
border-color: #409eff;
}
.el-radio-button__inner {
min-width: 80px;
min-width: 80px;
}
.el-drawer.rtl {
overflow: auto
overflow: auto;
}
.tab-label-padding {
padding: 0 10px;
padding: 0 10px;
}
.target-table .el-form-item.is-error {
margin-bottom: 15px !important;
margin-bottom: 15px !important;
}
.step-simple {
.el-step {
padding-left: 10px;
}
.el-step__main {
position: absolute;
top: -6px;
width: 70px;
padding: 0 0px 0 30px;
background: #fff;
}
.el-step {
padding-left: 10px;
}
.el-step__main {
position: absolute;
top: -6px;
width: 70px;
padding: 0 0px 0 30px;
background: #fff;
}
}
.full-height {
height: 100%;
}
height: 100%;
}

View File

@ -5,4 +5,4 @@
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import"~element-ui/packages/theme-chalk/src/index"
@import '~element-ui/packages/theme-chalk/src/index';

View File

@ -1,23 +1,23 @@
$font-size: 16px;
$small-font-size: 14px;
.font-big {
font-size: $font-size;
.el-menu-item,
.el-submenu__title,
ul.header-menu li,
.el-tabs__item {
font-size: $font-size;
.el-menu-item,
.el-submenu__title,
ul.header-menu li,
.el-tabs__item {
font-size: $font-size;
.iconfont {
font-size: $font-size;
}
.iconfont {
font-size: $font-size;
}
.el-table--mini,
.el-table--small,
.el-table__expand-icon,
.app-levelbar,
.el-button--small,
.el-dropdown-link,
.common-detail .detail-body .basic-info .attr {
font-size: $font-size;
}
}
}
.el-table--mini,
.el-table--small,
.el-table__expand-icon,
.app-levelbar,
.el-button--small,
.el-dropdown-link,
.common-detail .detail-body .basic-info .attr {
font-size: $font-size;
}
}

View File

@ -1,10 +1,9 @@
@media screen and (-ms-high-contrast:active),
(-ms-high-contrast:none) {
.el-table__header,
.el-table__body {
width: 100% !important;
}
/* .basic-form-item{
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.el-table__header,
.el-table__body {
width: 100% !important;
}
/* .basic-form-item{
height: 32.76px;
} */
}
}

View File

@ -1,8 +1,8 @@
:root {
--color-primary: #{$--color-primary}
--color-primary: #{$--color-primary};
}
@import './lib/index';
@import './hack.scss';
@import './font.scss';
@import './common.scss';
@import './common.scss';

View File

@ -1,29 +1,29 @@
.el-button--text {
padding: 0 !important;
padding: 0 !important;
}
.el-button.el-button--text [class*=el-icon-]+span {
margin-left: 2px;
.el-button.el-button--text [class*='el-icon-'] + span {
margin-left: 2px;
}
.el-button--ghost {
color: #666;
background-color: #fff;
border-color: #d9d9d9;
color: #666;
background-color: #fff;
border-color: #d9d9d9;
}
.el-button--ghost:focus,
.el-button--ghost:hover {
color: #2b85e4;
background-color: transparent;
border-color: #2b85e4;
color: #2b85e4;
background-color: transparent;
border-color: #2b85e4;
}
.el-button--ghost.is-disabled,
.el-button--ghost.is-disabled:active,
.el-button--ghost.is-disabled:focus,
.el-button--ghost.is-disabled:hover {
color: #bbb;
background-color: #f7f7f7;
border-color: #d9d9d9;
}
color: #bbb;
background-color: #f7f7f7;
border-color: #d9d9d9;
}

View File

@ -1,418 +1,416 @@
html,
body,
#app {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-size: 14px;
overflow: hidden !important;
font-family: Microsoft YaHei, Hiragino Sans GB;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-size: 14px;
overflow: hidden !important;
font-family: Microsoft YaHei, Hiragino Sans GB;
}
.app-wrapper {
position: relative;
width: 100%;
height: 100%;
position: relative;
width: 100%;
height: 100%;
}
.wrapper {
box-shadow: none !important;
box-shadow: none !important;
}
.wrapper>.el-card__body {
padding: 15px;
.wrapper > .el-card__body {
padding: 15px;
}
.wrapper-container {
padding: 8px;
padding: 8px;
}
.wrapper-sm {
padding: 15px;
padding: 15px;
}
.search-container {
position: relative;
padding: 15px !important;
border: 1px solid #ddd;
margin-bottom: 15px;
position: relative;
padding: 15px !important;
border: 1px solid #ddd;
margin-bottom: 15px;
}
.search-container>.legend {
color: rgba(18, 19, 20, 0.69);
background: #fff;
position: absolute;
text-align: center;
width: 78px;
top: -10px;
left: 15px;
font-size: 14px;
.search-container > .legend {
color: rgba(18, 19, 20, 0.69);
background: #fff;
position: absolute;
text-align: center;
width: 78px;
top: -10px;
left: 15px;
font-size: 14px;
}
.search-content>.search-item {
width: 20%;
.search-content > .search-item {
width: 20%;
}
.pagination-container {
margin-top: 10px;
text-align: right;
margin-top: 10px;
text-align: right;
}
.iconfont {
font-size: 13px;
font-size: 13px;
}
.panel {
background-color: #fff;
margin-bottom: 15px;
border: 1px solid #dee5e7;
background-color: #fff;
margin-bottom: 15px;
border: 1px solid #dee5e7;
}
.panel .panel-heading {
background-color: #edf1f2;
padding: 10px 15px;
border-bottom: 1px solid transparent;
background-color: #edf1f2;
padding: 10px 15px;
border-bottom: 1px solid transparent;
}
.panel .panel-body {
padding: 15px;
padding: 15px;
}
/*边距共有样式*/
.text-center {
text-align: center;
text-align: center;
}
.pull-right {
float: right;
float: right;
}
.pull-left {
float: left;
float: left;
}
.p-none {
padding: 0 !important;
padding: 0 !important;
}
.m-xxs {
margin: 2px 4px;
margin: 2px 4px;
}
.m-xs {
margin: 5px;
margin: 5px;
}
.m-sm {
margin: 10px;
margin: 10px;
}
.m {
margin: 15px;
margin: 15px;
}
.m-md {
margin: 20px;
margin: 20px;
}
.m-lg {
margin: 30px;
margin: 30px;
}
.m-xl {
margin: 50px;
margin: 50px;
}
.m-n {
margin: 0 !important;
margin: 0 !important;
}
.m-l-none {
margin-left: 0 !important;
margin-left: 0 !important;
}
.m-l-xs {
margin-left: 5px;
margin-left: 5px;
}
.m-l-sm {
margin-left: 10px !important;
margin-left: 10px !important;
}
.m-l {
margin-left: 15px;
margin-left: 15px;
}
.m-l-md {
margin-left: 20px;
margin-left: 20px;
}
.m-l-lg {
margin-left: 30px;
margin-left: 30px;
}
.m-l-xl {
margin-left: 40px;
margin-left: 40px;
}
.m-l-xxl {
margin-left: 50px;
margin-left: 50px;
}
.m-l-n-xxs {
margin-left: -1px;
margin-left: -1px;
}
.m-l-n-xs {
margin-left: -5px;
margin-left: -5px;
}
.m-l-n-sm {
margin-left: -10px;
margin-left: -10px;
}
.m-l-n {
margin-left: -15px;
margin-left: -15px;
}
.m-l-n-md {
margin-left: -20px;
margin-left: -20px;
}
.m-l-n-lg {
margin-left: -30px;
margin-left: -30px;
}
.m-l-n-xl {
margin-left: -40px;
margin-left: -40px;
}
.m-l-n-xxl {
margin-left: -50px;
margin-left: -50px;
}
.m-t-none {
margin-top: 0 !important;
margin-top: 0 !important;
}
.m-t-xxs {
margin-top: 1px;
margin-top: 1px;
}
.m-t-xs {
margin-top: 5px !important;
margin-top: 5px !important;
}
.m-t-sm {
margin-top: 10px !important;
margin-top: 10px !important;
}
.m-t {
margin-top: 15px;
margin-top: 15px;
}
.m-t-md {
margin-top: 20px;
margin-top: 20px;
}
.m-t-lg {
margin-top: 30px;
margin-top: 30px;
}
.m-t-xl {
margin-top: 40px;
margin-top: 40px;
}
.m-t-xxl {
margin-top: 50px;
margin-top: 50px;
}
.m-t-n-xxs {
margin-top: -1px;
margin-top: -1px;
}
.m-t-n-xs {
margin-top: -5px;
margin-top: -5px;
}
.m-t-n-7 {
margin-top: -7px;
margin-top: -7px;
}
.m-t-n-sm {
margin-top: -10px;
margin-top: -10px;
}
.m-t-n {
margin-top: -15px;
margin-top: -15px;
}
.m-t-n-md {
margin-top: -20px;
margin-top: -20px;
}
.m-t-n-lg {
margin-top: -30px;
margin-top: -30px;
}
.m-t-n-xl {
margin-top: -40px;
margin-top: -40px;
}
.m-t-n-xxl {
margin-top: -50px;
margin-top: -50px;
}
.m-t-n-xxxl {
margin-top: -60px;
margin-top: -60px;
}
.m-r-none {
margin-right: 0 !important;
margin-right: 0 !important;
}
.m-r-xxs {
margin-right: 1px;
margin-right: 1px;
}
.m-r-xs {
margin-right: 5px;
margin-right: 5px;
}
.m-r-sm {
margin-right: 10px !important;
margin-right: 10px !important;
}
.m-r {
margin-right: 15px !important;
margin-right: 15px !important;
}
.m-r-md {
margin-right: 20px;
margin-right: 20px;
}
.m-r-lg {
margin-right: 30px;
margin-right: 30px;
}
.m-r-xl {
margin-right: 40px;
margin-right: 40px;
}
.m-r-xxl {
margin-right: 50px;
margin-right: 50px;
}
.m-r-n-xxs {
margin-right: -1px;
margin-right: -1px;
}
.m-r-n-xs {
margin-right: -5px;
margin-right: -5px;
}
.m-r-n-sm {
margin-right: -10px;
margin-right: -10px;
}
.m-r-n {
margin-right: -15px;
margin-right: -15px;
}
.m-r-n-md {
margin-right: -20px;
margin-right: -20px;
}
.m-r-n-lg {
margin-right: -30px;
margin-right: -30px;
}
.m-r-n-xl {
margin-right: -40px;
margin-right: -40px;
}
.m-r-n-xxl {
margin-right: -50px;
margin-right: -50px;
}
.m-b-none {
margin-bottom: 0 !important;
margin-bottom: 0 !important;
}
.m-b-xxs {
margin-bottom: 1px;
margin-bottom: 1px;
}
.m-b-xs {
margin-bottom: 5px;
margin-bottom: 5px;
}
.m-b-sm {
margin-bottom: 10px !important;
margin-bottom: 10px !important;
}
.m-b {
margin-bottom: 15px !important;
margin-bottom: 15px !important;
}
.m-b-md {
margin-bottom: 20px;
margin-bottom: 20px;
}
.m-b-lg {
margin-bottom: 30px;
margin-bottom: 30px;
}
.m-b-xl {
margin-bottom: 40px;
margin-bottom: 40px;
}
.m-b-xxl {
margin-bottom: 50px;
margin-bottom: 50px;
}
.m-b-n-xxs {
margin-bottom: -1px;
margin-bottom: -1px;
}
.m-b-n-xs {
margin-bottom: -5px;
margin-bottom: -5px;
}
.m-b-n-sm {
margin-bottom: -10px;
margin-bottom: -10px;
}
.m-b-n {
margin-bottom: -15px;
margin-bottom: -15px;
}
.m-b-n-md {
margin-bottom: -20px;
margin-bottom: -20px;
}
.m-b-n-lg {
margin-bottom: -30px;
margin-bottom: -30px;
}
.m-b-n-xl {
margin-bottom: -40px;
margin-bottom: -40px;
}
.m-b-n-xxl {
margin-bottom: -50px;
margin-bottom: -50px;
}
/*颜色共有样式*/
.btn-info {
color: #ffffff !important;
background-color: #497edf;
border-color: #497edf;
color: #ffffff !important;
background-color: #497edf;
border-color: #497edf;
}
.btn-info:hover,
@ -420,15 +418,15 @@ body,
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
color: #ffffff !important;
background-color: #2059c1;
border-color: #2059c1;
color: #ffffff !important;
background-color: #2059c1;
border-color: #2059c1;
}
.btn-success {
color: #ffffff !important;
background-color: #27c24c;
border-color: #27c24c;
color: #ffffff !important;
background-color: #27c24c;
border-color: #27c24c;
}
.btn-success:hover,
@ -436,15 +434,15 @@ body,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #ffffff !important;
background-color: #23ad44;
border-color: #20a03f;
color: #ffffff !important;
background-color: #23ad44;
border-color: #20a03f;
}
.btn-danger {
color: #ffffff !important;
background-color: #f05050;
border-color: #f05050;
color: #ffffff !important;
background-color: #f05050;
border-color: #f05050;
}
.btn-danger:hover,
@ -452,169 +450,167 @@ body,
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
color: #ffffff !important;
background-color: #ee3939;
border-color: #ed2a2a;
color: #ffffff !important;
background-color: #ee3939;
border-color: #ed2a2a;
}
.text-info {
color: #00aeef !important;
color: #00aeef !important;
}
.text-success {
color: #27c24c !important;
color: #27c24c !important;
}
.text-warning {
color: #fad733 !important;
color: #fad733 !important;
}
.text-danger {
color: #f05050 !important;
color: #f05050 !important;
}
.text-white {
color: #FFF !important;
color: #fff !important;
}
.text-left {
text-align: left !important;
text-align: left !important;
}
.text-center {
text-align: center !important;
text-align: center !important;
}
.text-right {
text-align: right !important;
text-align: right !important;
}
/*宽度样式*/
.w-xxs {
width: 60px;
width: 60px;
}
.w-xs {
width: 90px;
width: 90px;
}
.w-110 {
width: 110px;
width: 110px;
}
.w-ss {
width: 120px !important;
width: 120px !important;
}
.w-sm {
width: 150px !important;
width: 150px !important;
}
.w {
width: 200px;
width: 200px;
}
.w-md {
width: 240px;
width: 240px;
}
.w-lg {
width: 280px !important;
width: 280px !important;
}
.w-xl {
width: 320px !important;
width: 320px !important;
}
.w-xxl {
width: 360px;
width: 360px;
}
.w-full {
width: 100% !important;
width: 100% !important;
}
.w-auto {
width: auto;
width: auto;
}
.upload-file-btn {
position: relative;
cursor: pointer;
position: relative;
cursor: pointer;
}
.upload-file-btn input[type=file] {
width: 100%;
height: 100%;
font-size: 300px;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer;
left: 0;
right: 0;
bottom: 0;
top: 0;
position: absolute;
padding: 0px;
margin: 0px;
overflow: hidden;
.upload-file-btn input[type='file'] {
width: 100%;
height: 100%;
font-size: 300px;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer;
left: 0;
right: 0;
bottom: 0;
top: 0;
position: absolute;
padding: 0px;
margin: 0px;
overflow: hidden;
}
/*详情表格*/
.detail-box {
margin-top: 10px;
margin-bottom: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
.detail-title {
margin-bottom: 15px;
text-indent: 8px;
border-left: 3px solid #88B7E0;
font-size: 14px;
font-weight: 600;
margin-bottom: 15px;
text-indent: 8px;
border-left: 3px solid #88b7e0;
font-size: 14px;
font-weight: 600;
}
.detail-href {
color: $--color-primary !important;
cursor: pointer;
text-decoration: none !important;
color: $--color-primary !important;
cursor: pointer;
text-decoration: none !important;
}
.detail-table {
width: 100%;
border-collapse: collapse;
width: 100%;
border-collapse: collapse;
}
.detail-table td.title {
color: #000;
width: 85px;
font-size: 12px;
font-weight: bold;
color: #000;
width: 85px;
font-size: 12px;
font-weight: bold;
}
.detail-table td,
.detail-table th {
padding: 6px 8px;
border: 1px solid #ddd;
min-width: 85px;
width: 250px;
word-break: break-all;
white-space: pre-wrap;
/*border: none;*/
padding: 6px 8px;
border: 1px solid #ddd;
min-width: 85px;
width: 250px;
word-break: break-all;
white-space: pre-wrap;
/*border: none;*/
}
.border-top-none {
border-top: none !important;
border-top: none !important;
}
a {
color: inherit;
cursor: pointer;
text-decoration: none;
color: inherit;
cursor: pointer;
text-decoration: none;
}
.bounce-enter-active,
@ -729,90 +725,83 @@ a {
.zoomRight-leave-active,
.zoomUp-enter-active,
.zoomUp-leave-active {
animation-duration: 0.6s !important;
animation-fill-mode: both;
animation-duration: 0.6s !important;
animation-fill-mode: both;
}
.cur-point {
cursor: pointer !important;
cursor: pointer !important;
}
/*无数据*/
.no-data {
text-align: center;
min-height: 200px;
line-height: 200px;
text-align: center;
min-height: 200px;
line-height: 200px;
}
.no-data .icon-zanwushuju {
font-size: 26px;
color: #d2cccc;
font-size: 26px;
color: #d2cccc;
}
/*.custom-dialog .el-dialog{*/
/*width: 80%;*/
/*height: 100%;*/
/*position: absolute;*/
/*right: 0;*/
/*}*/
.text-ellipsis {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text-muted {
color: #98a6ad;
color: #98a6ad;
}
.custom-scrollbar .el-scrollbar__wrap {
overflow-x: hidden !important;
overflow-x: hidden !important;
}
.action-divider {
margin: 0 8px;
display: inline-block;
height: 1em;
width: 1px;
vertical-align: middle;
position: relative;
top: -.06em;
font-size: 14px;
line-height: 1.5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
background: #e8e8e8;
margin: 0 8px;
display: inline-block;
height: 1em;
width: 1px;
vertical-align: middle;
position: relative;
top: -0.06em;
font-size: 14px;
line-height: 1.5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
background: #e8e8e8;
}
.dialog-sm {
width: 300px;
width: 300px;
}
.dialog-md {
width: 800px;
width: 800px;
}
.dialog-lg {
width: 950px;
width: 950px;
}
:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #e9d6cf !important;
}
/* Internet Explorer 10+ */
color: #e9d6cf !important;
}

View File

@ -1,2 +1,2 @@
@import "./theme.scss";
@import "./table.scss";
@import './theme.scss';
@import './table.scss';

View File

@ -1,130 +1,130 @@
.sidebar-container {
z-index: 3;
width: 180px !important;
transition: width 0.18s;
.scrollbar-wrapper {
height: calc(100vh - 50px);
.el-scrollbar__wrap{
overflow-x: hidden;
}
z-index: 3;
width: 180px !important;
transition: width 0.18s;
.scrollbar-wrapper {
height: calc(100vh - 50px);
.el-scrollbar__wrap {
overflow-x: hidden;
}
.sidebar-menu {
width: 180px;
height: calc(100vh - 50px);
border: 0;
}
.sidebar-menu {
width: 180px;
height: calc(100vh - 50px);
border: 0;
}
.sidebar-menu::-webkit-scrollbar {
display: none;
}
.el-submenu__title > i,
.el-menu-item > i {
margin-right: 6px;
}
.el-submenu.is-opened .el-submenu__title {
color: #fff !important;
& > i {
color: #fff !important;
}
.sidebar-menu::-webkit-scrollbar {
display: none;
}
.el-menu-item.is-active i {
color: #fff !important;
}
.el-submenu .el-menu-item {
min-width: 180px !important;
background: #15171d !important;
&.is-active {
background: #1890ff !important;
}
.el-submenu__title > i,
.el-menu-item > i{
margin-right: 6px;
}
.menu-wrapper .el-menu-item {
&.is-active {
background: #1890ff !important;
}
.el-submenu.is-opened .el-submenu__title{
color: #fff !important;
& > i {
color: #fff !important;
}
}
.el-menu--collapse {
width: 64px;
overflow: inherit;
}
.logo {
height: 50px;
position: relative;
line-height: 50px;
transition: all 0.3s;
background: #21242e;
overflow: hidden;
text-align: center;
img {
display: inline-block;
vertical-align: middle;
height: 32px;
}
.el-menu-item.is-active i {
color: #fff !important;
.short-logo {
display: none;
}
.el-submenu .el-menu-item{
min-width: 180px !important;
background: #15171d !important;
&.is-active{
background: #1890ff !important;
}
}
.menu-wrapper .el-menu-item{
&.is-active{
background: #1890ff !important;
}
}
.el-menu--collapse {
width: 64px;
overflow: inherit;
}
.logo {
height: 50px;
position: relative;
line-height: 50px;
transition: all 0.3s;
background: #21242e;
overflow: hidden;
text-align: center;
img {
display: inline-block;
vertical-align: middle;
height: 32px;
}
.short-logo{
display: none;
}
h1 {
color: #fff;
display: inline-block;
vertical-align: middle;
font-size: 18px;
margin: 0 0 0 8px;
font-family: "Myriad Pro", "Helvetica Neue", Arial, Helvetica,
sans-serif;
font-weight: 600;
}
h1 {
color: #fff;
display: inline-block;
vertical-align: middle;
font-size: 18px;
margin: 0 0 0 8px;
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
}
}
}
.hideSidebar {
.sidebar-container {
width: 64px !important;
.el-menu--collapse {
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
.el-submenu__icon-arrow{
display: none;
}
}
}
}
.logo{
img{
display: none;
}
.short-logo{
display: inline-block;
}
.sidebar-container {
width: 64px !important;
.el-menu--collapse {
.el-submenu {
overflow: hidden;
& > .el-submenu__title {
& > span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
.el-submenu__icon-arrow {
display: none;
}
}
}
}
.logo {
img {
display: none;
}
.short-logo {
display: inline-block;
}
}
}
}
.top-menu{
float: left;
.top-menu {
float: left;
}
//
.el-menu--horizontal {
border: none !important;
&>.menu-wrapper{
float: left;
}
.el-menu-item>i, .el-submenu__title>i {
margin-right: 6px;
}
.el-menu-item {
float: left;
height: 60px;
line-height: 60px;
margin: 0;
//border-bottom: 2px solid transparent;
color: #909399;
&.is-active {
//border-bottom: 2px solid #409eff;
color: #303133;
}
border: none !important;
& > .menu-wrapper {
float: left;
}
.el-menu-item > i,
.el-submenu__title > i {
margin-right: 6px;
}
.el-menu-item {
float: left;
height: 60px;
line-height: 60px;
margin: 0;
//border-bottom: 2px solid transparent;
color: #909399;
&.is-active {
//border-bottom: 2px solid #409eff;
color: #303133;
}
}
}

View File

@ -1,22 +1,22 @@
.table-container {
.custom-header {
background: #F5F7FA !important;
color: #333;
border-bottom: 1px solid #DCDFE6 !important;
.custom-header {
background: #f5f7fa !important;
color: #333;
border-bottom: 1px solid #dcdfe6 !important;
}
.el-table--enable-row-hover .el-table__body tr:hover > td {
background-color: #eaf3fd;
}
.gutter {
background: #f5f7fa !important;
color: #333;
border-bottom: 1px solid #dcdfe6 !important;
}
.pagination-container {
margin-top: 10px;
text-align: right;
.el-pagination__jump {
margin-left: 0;
}
.el-table--enable-row-hover .el-table__body tr:hover>td {
background-color: #EAF3FD;
}
.gutter {
background: #f5f7fa !important;
color: #333;
border-bottom: 1px solid #dcdfe6 !important;
}
.pagination-container {
margin-top: 10px;
text-align: right;
.el-pagination__jump {
margin-left: 0;
}
}
}
}
}

View File

@ -1,49 +1,49 @@
.theme-container{
width: 280px;
padding: 0 !important;
top: 30px !important;
.popper__arrow {
display: none !important;
}
.el-card__header{
padding: 10px 20px;
}
.theme-container {
width: 280px;
padding: 0 !important;
top: 30px !important;
.popper__arrow {
display: none !important;
}
.theme-setting{
.icon-huanfu{
font-size: 18px;
cursor: pointer;
}
.el-card__header {
padding: 10px 20px;
}
.theme-cell{
height: 30px;
position: relative;
}
.theme-setting {
.icon-huanfu {
font-size: 18px;
cursor: pointer;
margin-bottom: 5px;
span {
height: 100%;
width: 100%;
position: absolute;
background-color: rgba(32, 43, 54, 0.5);
text-align: center;
display: inherit;
.icon-ok{
position: relative;
top: 6px;
display: inline-block;
font-weight: 400;
font-size: 17px;
line-height: 1;
color: #fff;
}
}
b {
}
}
.theme-cell {
height: 30px;
position: relative;
cursor: pointer;
margin-bottom: 5px;
span {
height: 100%;
width: 100%;
position: absolute;
background-color: rgba(32, 43, 54, 0.5);
text-align: center;
display: inherit;
.icon-ok {
position: relative;
top: 6px;
display: inline-block;
float: left;
width: 50%;
height: 20px;
}
b.t-header{
height: 10px;
font-weight: 400;
font-size: 17px;
line-height: 1;
color: #fff;
}
}
b {
display: inline-block;
float: left;
width: 50%;
height: 20px;
}
b.t-header {
height: 10px;
}
}

View File

@ -1,130 +1,130 @@
@import "./button.scss";
@import './button.scss';
.el-select {
width: 100%;
width: 100%;
}
.el-notification__content {
word-break: break-word;
word-break: break-word;
}
.el-cascader {
width: 100%;
width: 100%;
}
.el-form-item {
margin-bottom: 15px;
margin-bottom: 15px;
}
.el-button--mini,
.el-button--mini.is-round {
padding: 4px 15px !important;
padding: 4px 15px !important;
}
.el-form-item--mini.el-form-item,
.el-form-item--small.el-form-item {
margin-bottom: 18px;
margin-bottom: 18px;
}
.el-table .cell {
white-space: nowrap;
white-space: nowrap;
}
.el-card {
box-shadow: none;
border-radius: 0 !important;
box-shadow: none;
border-radius: 0 !important;
}
.el-tabs--border-card {
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.el-card__header {
padding: 10px 20px !important;
padding: 10px 20px !important;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: rgb(236 245 255) !important;
color: rgb(64 158 255);
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
background-color: rgb(236 245 255) !important;
color: rgb(64 158 255);
}
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
-webkit-transition: color .2s cubic-bezier(.645, .045, .355, 1);
transition: color .2s cubic-bezier(.645, .045, .355, 1);
color: #666 !important;
font-weight: normal !important;
-webkit-transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
color: #666 !important;
font-weight: normal !important;
}
.el-progress-bar__inner {
max-width: 100%;
max-width: 100%;
}
.el-progress__text {
font-size: 12px !important;
font-size: 12px !important;
}
.el-dropdown-link {
cursor: pointer;
color: $--color-primary;
font-size: 12px;
cursor: pointer;
color: $--color-primary;
font-size: 12px;
}
.el-pagination button,
.el-pagination span:not([class*=suffix]) {
font-size: 12px;
.el-pagination span:not([class*='suffix']) {
font-size: 12px;
}
.el-pagination__sizes .el-input .el-input__inner {
font-size: 12px;
font-size: 12px;
}
.el-pager li {
font-size: 12px;
font-size: 12px;
}
.el-input--small {
font-size: 13px;
font-size: 13px;
}
.el-tabs__content {
position: static !important;
position: static !important;
}
//menu
.el-submenu .el-menu-item {
height: 48px;
line-height: 48px;
height: 48px;
line-height: 48px;
}
.el-menu-item,
.el-submenu__title {
height: 48px;
line-height: 48px;
height: 48px;
line-height: 48px;
}
.el-dialog {
.el-dialog--middle {
width: 60%;
.el-dialog--middle {
width: 60%;
}
.el-dialog__header {
display: flex;
align-items: center;
padding: 14px 20px;
font-weight: bold;
border-bottom: 1px solid #e0e0e0;
.el-dialog__title {
flex: 1;
color: #010033;
font-size: 14px;
}
.el-dialog__header {
display: flex;
align-items: center;
padding: 14px 20px;
font-weight: bold;
border-bottom: 1px solid #E0E0E0;
.el-dialog__title {
flex: 1;
color: #010033;
font-size: 14px;
}
.el-dialog__headerbtn {
position: static;
}
.el-dialog__headerbtn {
position: static;
}
.el-dialog__footer {
padding: 14px 20px;
text-align: right;
border-top: 1px solid #E0E0E0;
}
}
}
.el-dialog__footer {
padding: 14px 20px;
text-align: right;
border-top: 1px solid #e0e0e0;
}
}

View File

@ -1,3 +1,3 @@
@import "./common.scss";
@import "./element-ui.scss";
@import "./components/index.scss";
@import './common.scss';
@import './element-ui.scss';
@import './components/index.scss';

View File

@ -15,12 +15,12 @@
margin-top: 0;
}
.dialog-header .title{
.dialog-header .title {
display: inline-block;
color: #333;
}
.dialog-header .line,
.dialog_header_dark .line{
.dialog_header_dark .line {
position: relative;
top: 4px;
margin: 0 10px;
@ -30,9 +30,8 @@
background-color: #b5b5b5;
}
.dialog-header .dialog-back,
.dialog_header_dark .dialog-back
{
color: #46ABf1;
.dialog_header_dark .dialog-back {
color: #46abf1;
cursor: pointer;
}
@ -48,7 +47,7 @@
margin-top: 0;
}
.dialog_header_dark .title{
.dialog_header_dark .title {
display: inline-block;
color: #fff;
}
@ -86,4 +85,4 @@
.alert_bottom_10 {
margin-bottom: 10px;
}
}

View File

@ -1,8 +1,8 @@
import { computed, onUnmounted, unref } from 'vue'
import actions from '@/shared/action'
export default function(onmessage: {(data: any):void}, store: any) {
const webSocket = computed(() => store.state.app.$webSocket);
export default function (onmessage: { (data: any): void }, store: any) {
const webSocket = computed(() => store.state.app.$webSocket)
console.log(webSocket)
if (unref(webSocket)) {
webSocket.value.onmessage = onmessage

View File

@ -1,6 +1,6 @@
import { Message } from 'element-ui'
export default function() {
// 添加值
export default function () {
// 添加值
const addItem = function (data: any, initData = {}) {
data.push(initData)
}

View File

@ -3,16 +3,16 @@
* @Date: 2022-11-03 15:41:09
* @LastEditTime: 2022-12-08 15:37:40
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\packages\common\hooks\useSelection.js
*/
import { ref, computed } from 'vue'
export default function() {
export default function () {
const selections = ref([])
function handleSelectionChange(selection) {
selections.value = selection
}
const selectionIds = computed(() => selections.value.map((item) => item.id))
const selectionIds = computed(() => selections.value.map(item => item.id))
return {
selectionIds,
selections,

View File

@ -5,46 +5,48 @@ import { handleSearchParam } from '@cmp/cmp-element'
interface IRemoveService {
(id: number, params?: any): Promise<Base.IResponseData>
}
interface IConfigs{
interface IConfigs {
getService: {
(params: Base.IListParams): Promise<Base.IResponseList>
},
removeService?: IRemoveService,
}
removeService?: IRemoveService
listFormat?: {
(data: any): any[]
},
}
afterGetList?: {
(): void
},
rows?: number,
params?: any,
initParams?: any,
}
rows?: number
params?: any
initParams?: any
deleteTipKey?: string
}
interface IRecord{
id: number,
interface IRecord {
id: number
name: string
}
export function useDelete(removeService: IRemoveService, getData: {(): void}, deleteTipKey = 'name') {
export function useDelete(removeService: IRemoveService, getData: { (): void }, deleteTipKey = 'name') {
function handleDelete(record: any, params: any) {
MessageBox.confirm(`您确定要删除【${record[deleteTipKey]}】吗?`, '提示', {
confirmButtonClass: 'el-button--danger',
type: 'warning'
}).then(async () => {
const res = await removeService(record.id, params);
if (res.success) {
Message.success(res.message)
getData()
}
}).catch(e => {})
})
.then(async () => {
const res = await removeService(record.id, params)
if (res.success) {
Message.success(res.message)
getData()
}
})
.catch(e => {})
}
return {
handleDelete
}
}
export default function<T = any>(configs: IConfigs) {
const { getService, removeService, listFormat, rows = 10, params = {}, afterGetList, initParams, deleteTipKey = 'name' } = configs;
const loading = ref(false);
export default function <T = any>(configs: IConfigs) {
const { getService, removeService, listFormat, rows = 10, params = {}, afterGetList, initParams, deleteTipKey = 'name' } = configs
const loading = ref(false)
const state: Base.IListState<T> = reactive({
list: [],
total: 0,
@ -53,26 +55,26 @@ export default function<T = any>(configs: IConfigs) {
rows,
...params
}
});
})
// if (initParams) {
// state.params.params = handleSearchParam(initParams)
// }
async function getList () {
loading.value = true;
async function getList() {
loading.value = true
try {
const data = await getService(state.params);
loading.value = false;
const data = await getService(state.params)
loading.value = false
if (data.success) {
if (listFormat) {
state.list = listFormat(data.data.rows)
} else {
state.list = data.data.rows
}
state.total = data.data.total;
state.total = data.data.total
afterGetList && afterGetList()
}
} catch (e) {
loading.value = false;
loading.value = false
}
}
const { handleDelete } = useDelete(removeService as IRemoveService, getList, deleteTipKey)
@ -93,6 +95,8 @@ export function useSelect() {
selectList.value = selection
}
return {
selectList, handleSelectItem, handleSelectAll
selectList,
handleSelectItem,
handleSelectAll
}
}

View File

@ -1,7 +1,7 @@
import { onUnmounted, ref } from 'vue'
import WebSocket from 'cmp-socket'
import { getToken } from 'utils/auth'
export default function(onmessage: {(data: any):void}) {
export default function (onmessage: { (data: any): void }) {
const protocol = location.protocol === 'http:' ? 'ws' : 'wss'
let webSocket = new WebSocket({
url: `${protocol}://${location.host}/api/sms/messageService`,

View File

@ -1,23 +1,23 @@
export interface IListParams {
page: number,
rows: number,
simple?: boolean,
params?:string
page: number
rows: number
simple?: boolean
params?: string
}
export interface IAjaxData {
success: boolean,
failed: boolean,
solution: string,
message: string,
errorMsg: string,
data: any,
success: boolean
failed: boolean
solution: string
message: string
errorMsg: string
data: any
status: string
}
export interface IDialogConfig {
visible: boolean,
id?: number,
visible: boolean
id?: number
vendorId?: number
}

View File

@ -6,7 +6,7 @@ export default {
},
methods: {
handleSelectionChange(selections) {
this.selectionIds = selections.map((item) => item.id)
this.selectionIds = selections.map(item => item.id)
}
}
}

View File

@ -1,27 +1,27 @@
{
"name": "@cmp/cmp-common",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"fix": "vue-cli-service lint --fix",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"precommit": "lint-staged"
},
"typings": "types/index.d.ts",
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"name": "@cmp/cmp-common",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"fix": "vue-cli-service lint --fix",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"precommit": "lint-staged"
},
"typings": "types/index.d.ts",
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
}

View File

@ -1,21 +1,21 @@
import {} from 'axios'
declare module 'axios' {
export interface AxiosInstance {
(config: AxiosRequestConfig): AxiosPromise;
(url: string, config?: AxiosRequestConfig): AxiosPromise;
defaults: AxiosRequestConfig;
(config: AxiosRequestConfig): AxiosPromise
(url: string, config?: AxiosRequestConfig): AxiosPromise
defaults: AxiosRequestConfig
interceptors: {
request: AxiosInterceptorManager<AxiosRequestConfig>;
response: AxiosInterceptorManager<AxiosResponse>;
};
getUri(config?: AxiosRequestConfig): string;
request<T = any, R = Base.IResponseData<T>> (config: AxiosRequestConfig): Promise<R>;
get<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
delete<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
head<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
options<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
post<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
put<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
patch<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
request: AxiosInterceptorManager<AxiosRequestConfig>
response: AxiosInterceptorManager<AxiosResponse>
}
getUri(config?: AxiosRequestConfig): string
request<T = any, R = Base.IResponseData<T>>(config: AxiosRequestConfig): Promise<R>
get<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>
delete<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>
head<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>
options<T = any, R = Base.IResponseData<T>>(url: string, config?: AxiosRequestConfig): Promise<R>
post<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>
put<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>
patch<T = any, R = Base.IResponseData<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>
}
}

View File

@ -3,7 +3,7 @@
* @Date: 2022-11-03 15:41:09
* @LastEditTime: 2022-11-07 11:16:51
* @LastEditors: Haijun Zhang
* @Description:
* @Description:
* @FilePath: \cmc-web\packages\common\types\shims-global.d.ts
*/
declare module Base {
@ -18,13 +18,13 @@ declare module Base {
status: string
}
// list接口返回数据格式
interface IListData<T = any>{
page: number,
pages: number,
total:number,
interface IListData<T = any> {
page: number
pages: number
total: number
rows: T[]
}
interface IResponseList<T = any> extends IResponseData{
interface IResponseList<T = any> extends IResponseData {
data: IListData<T>
}
// 列表查询传参
@ -32,7 +32,7 @@ declare module Base {
page?: number
rows?: number
simple?: boolean
params?: string,
params?: string
sorter?: string
}
// 模态框打开
@ -42,21 +42,21 @@ declare module Base {
}
// 搜索配置
interface ISearchConfig<T = any> {
label?: string,
value: string,
type: string,
initValue?: string | number,
sign?: string,
data?: T[],
props?: any,
label?: string
value: string
type: string
initValue?: string | number
sign?: string
data?: T[]
props?: any
onChange?: {
(val: string, listQuery: any): void
}
}
// 列表
type IListState<T = any> = {
list: T[],
total: number,
params: IListParams,
list: T[]
total: number
params: IListParams
}
}

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Vue from 'vue'
declare module '*.vue' {
export default Vue;
export default Vue
}
declare module 'vue/types/vue' {
interface Vue {

View File

@ -3,7 +3,7 @@ declare module 'cmp-echarts'
declare module '@cmp/cmp-element'
declare module 'cmp-socket'
declare module '@cmp/cmp-element/utils'
declare module 'vite-plugin-svg-icons';
declare module 'vite-plugin-svg-icons'
declare module 'services'
declare module 'v-viewer/src/component.vue'
declare module 'cmp-graph-editor'

View File

@ -3,24 +3,28 @@ export function getModules(files: any) {
// 当files为方法时为webapock,为对象时为vite
const isWebpack = typeof files === 'function'
// 路径包含compoennts的是内置组件不向外暴露
const modules = (isWebpack ? files.keys() : Object.keys(files)).filter((item: string) => !item.includes('components')).reduce((modules: any, modulePath: string) => {
// set './app.vue' => 'app'
const moduleName = modulePath.replace(/^\.\S*\/(.*)\.\w+$/, '$1')
const value = isWebpack ? files(modulePath) : files[modulePath]
modules[moduleName] = value.default
return modules
}, {});
return modules;
const modules = (isWebpack ? files.keys() : Object.keys(files))
.filter((item: string) => !item.includes('components'))
.reduce((modules: any, modulePath: string) => {
// set './app.vue' => 'app'
const moduleName = modulePath.replace(/^\.\S*\/(.*)\.\w+$/, '$1')
const value = isWebpack ? files(modulePath) : files[modulePath]
modules[moduleName] = value.default
return modules
}, {})
return modules
}
// 异步加载
export function getAsyncModules(files: any, asyncImport: any) {
// 当files为方法时为webapock,为对象时为vite
const isWebpack = typeof files === 'function'
const modules = (isWebpack ? files.keys() : Object.keys(files)).filter((item: string) => !item.includes('components')).reduce((modules: any, modulePath: string) => {
// set './app.vue' => 'app'
const moduleName = modulePath.replace(/^\.\S*\/(.*)\.\w+$/, '$1')
modules[moduleName] = isWebpack ? asyncImport(modulePath) : files[moduleName]
return modules
}, {});
return modules;
const modules = (isWebpack ? files.keys() : Object.keys(files))
.filter((item: string) => !item.includes('components'))
.reduce((modules: any, modulePath: string) => {
// set './app.vue' => 'app'
const moduleName = modulePath.replace(/^\.\S*\/(.*)\.\w+$/, '$1')
modules[moduleName] = isWebpack ? asyncImport(modulePath) : files[moduleName]
return modules
}, {})
return modules
}

View File

@ -12,7 +12,7 @@ const options = {
}
// 加密方法
export function encrypt (word, key = defaultKey) {
export function encrypt(word, key = defaultKey) {
if (typeof word === 'object') {
word = JSON.stringify(word)
}
@ -22,19 +22,19 @@ export function encrypt (word, key = defaultKey) {
}
// 解密方法
export function decrypt (word, key = defaultKey) {
export function decrypt(word, key = defaultKey) {
const decrypt = CryptoJS.AES.decrypt(word, key, options)
return decrypt.toString(CryptoJS.enc.Utf8)
}
// base64解码
function decryptByBase64 (word) {
function decryptByBase64(word) {
const base64string = CryptoJS.enc.Base64.parse(word)
return CryptoJS.enc.Utf8.stringify(base64string)
}
// base64编码
function encryptByBase64 (word) {
function encryptByBase64(word) {
const src = CryptoJS.enc.Utf8.parse(word)
const base64string = CryptoJS.enc.Base64.stringify(src)
return base64string

View File

@ -2,4 +2,4 @@ import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
export default dayjs;
export default dayjs

View File

@ -1,10 +1,10 @@
import { useStore } from '@cmp/cmp-core'
export function filterCosData(data: any[], filterKey = ['tenantId','tenantName'], ){
const store = useStore()
const hasCos = store.getters.hasCos;
if(hasCos) return data;
return data.filter(item => {
const field = item.prop || item.value;
return !filterKey.includes(field)
})
}
import { useStore } from '@cmp/cmp-core'
export function filterCosData(data: any[], filterKey = ['tenantId', 'tenantName']) {
const store = useStore()
const hasCos = store.getters.hasCos
if (hasCos) return data
return data.filter(item => {
const field = item.prop || item.value
return !filterKey.includes(field)
})
}

View File

@ -6,7 +6,7 @@ import { getToken } from 'utils/auth'
import dayjs from './day'
export function wrapperParams(data) {
return data;
return data
// return { params: JSON.stringify(data) }
}
export const formatEqParams = params => {
@ -58,44 +58,44 @@ export const downloadFile = (url, params = {}) => {
window.location.href = encodeURI(`/api${url}?token=${getToken()}${str}`)
}
export const getQuery = hash => {
const queryArr = hash.split('?');
const queryArr = hash.split('?')
if (queryArr.length === 1) {
return {}
}
const query = {}
queryArr[1].split('&').forEach(item => {
const [key, value] = item.split('=');
query[key] = value;
const [key, value] = item.split('=')
query[key] = value
})
return query
}
// ip比较大小
export const compareIp = (ip1, ip2) => {
const ip1Arr = ip1.split('.');
const ip2Arr = ip2.split('.');
let flag;
const ip1Arr = ip1.split('.')
const ip2Arr = ip2.split('.')
let flag
for (let i = 0; i < 4; i++) {
if (Number(ip1Arr[i]) > Number(ip2Arr[i])) {
flag = 0;
break;
flag = 0
break
} else if (Number(ip1Arr[i]) < Number(ip2Arr[i])) {
flag = 1
}
}
return flag;
return flag
}
export function makeTimeStamp() {
return dayjs().format('YYYYMMDDHHmmss')
}
function isObject(obj) {
return typeof obj === 'object' && obj != null;
return typeof obj === 'object' && obj != null
}
export function isObjectValueEqual(a, b) {
const aProps = Object.keys(a);
const bProps = Object.keys(b);
const aProps = Object.keys(a)
const bProps = Object.keys(b)
if (aProps.length != bProps.length) {
return false;
return false
}
for (let i = 0; i < aProps.length; i++) {
const propName = aProps[i]
@ -111,7 +111,7 @@ export function isObjectValueEqual(a, b) {
return true
}
export const getValueByPath = function(object, prop) {
export const getValueByPath = function (object, prop) {
prop = prop || ''
const paths = prop.split('.')
let current = object
@ -129,7 +129,7 @@ export const getValueByPath = function(object, prop) {
return result
}
export const jumpRouter = function(id, router) {
export const jumpRouter = function (id, router) {
// 默认根据name跳转
this.$router.push({
name: router,

View File

@ -44,11 +44,11 @@ const axiosInstance = axios.create({
}
})
// 请求完成回调
const finishCallback = function() {
const finishCallback = function () {
NProgress.done()
}
// 报错处理
const handleError = function(response) {
const handleError = function (response) {
if (!response) return // 容错处理
let title = `请求错误 ${response.status}: ${response.config.url}`
let errorText = codeMessage[response.status] || response.statusText
@ -82,7 +82,7 @@ axiosInstance.interceptors.request.use(
}
config.headers.token = getToken()
delete config.headers.options
config.options = options;
config.options = options
return config
},
error => {
@ -94,8 +94,12 @@ axiosInstance.interceptors.response.use(
// const requestKey = getRequestIdentify(data.config);
// removePending(requestKey);
finishCallback()
const { data: responseData, config: { options }, headers: { token }} = data
if(token) setToken(token)
const {
data: responseData,
config: { options },
headers: { token }
} = data
if (token) setToken(token)
if (!responseData.success) {
switch (responseData.status) {
case '402':

View File

@ -3,19 +3,19 @@
*/
// import path from 'path';
import { startsWith } from 'lodash-es'
export function isExternalLink (path) {
return /^(http:|https:|mailto:|tel:)\/\//.test(path);
export function isExternalLink(path) {
return /^(http:|https:|mailto:|tel:)\/\//.test(path)
}
export function resolvePath (basePath, routePath) {
export function resolvePath(basePath, routePath) {
if (isExternalLink(routePath)) {
return routePath;
return routePath
}
// return path.resolve(basePath, routePath);
const basePathArr = basePath.split('/');
const routePathArr = routePath.split('/');
const basePathArr = basePath.split('/')
const routePathArr = routePath.split('/')
if (startsWith(routePath, '/')) {
return routePath;
return routePath
}
const res = [...basePathArr, ...routePathArr].filter(item => item);
const res = [...basePathArr, ...routePathArr].filter(item => item)
return `/${res.join('/')}`
}

View File

@ -1,84 +1,91 @@
// websocket文件上传
import { getToken } from './auth'
export default function uploadFile (item, callback, errorCallBack) {
export default function uploadFile(item, callback, errorCallBack) {
const protocol = location.protocol === 'http:' ? 'ws' : 'wss'
item.isReady = true;
const socket = new WebSocket(`${protocol}://${location.host}/api/sms/uploadService`, getToken());
let i = 0;
let startSize = 0, endSize = 0;
const paragraph = 4 * 1024 * 1024; // 以4MB为一个分片
const count = parseInt(item.file.size / paragraph) + 1;
item.isReady = true
const socket = new WebSocket(`${protocol}://${location.host}/api/sms/uploadService`, getToken())
let i = 0
let startSize = 0,
endSize = 0
const paragraph = 4 * 1024 * 1024 // 以4MB为一个分片
const count = parseInt(item.file.size / paragraph) + 1
socket.onopen = function () {
item.isUploading = true;
socket.send(JSON.stringify({
filename: item.file.name,
upload: 'file'
}));
item.isUploading = true
socket.send(
JSON.stringify({
filename: item.file.name,
upload: 'file'
})
)
// 取消上传
item.cancel = function () {
item.progress = 0;
socket.send(JSON.stringify({
UPLOAD_CANCEL: 'UPLOAD_CANCEL'
}));
item.isUploading = false;
};
};
item.progress = 0
socket.send(
JSON.stringify({
UPLOAD_CANCEL: 'UPLOAD_CANCEL'
})
)
item.isUploading = false
}
}
socket.onmessage = function (event) {
const sendFile = function () {
if (startSize < item.file.size) {
let blob;
endSize += paragraph;
let blob
endSize += paragraph
if (item.file.webkitSlice) {
blob = item.file.webkitSlice(startSize, endSize);
blob = item.file.webkitSlice(startSize, endSize)
} else if (item.file.mozSlice) {
blob = item.file.mozSlice(startSize, endSize);
blob = item.file.mozSlice(startSize, endSize)
} else {
blob = item.file.slice(startSize, endSize);
blob = item.file.slice(startSize, endSize)
}
const reader = new FileReader();
reader.readAsArrayBuffer(blob);
const reader = new FileReader()
reader.readAsArrayBuffer(blob)
reader.onload = function loaded (evt) {
const result = evt.target.result;
reader.onload = function loaded(evt) {
const result = evt.target.result
// i++;
// const isok = (i / count) * 100;
// item.progress = parseInt(isok);
startSize = endSize;
socket.send(result);
};
startSize = endSize
socket.send(result)
}
} else {
item.progress = 100;
socket.send(JSON.stringify({
sendover: 'sendover'
}));
item.progress = 100
socket.send(
JSON.stringify({
sendover: 'sendover'
})
)
}
};
item.isUploading = true;
item.isCancel = false;
const obj = JSON.parse(event.data);
}
item.isUploading = true
item.isCancel = false
const obj = JSON.parse(event.data)
if (obj.category == 'UPLOAD_ACK') {
item.filePath = obj.content;
sendFile();
item.filePath = obj.content
sendFile()
} else if (obj.category == 'UPLOAD') {
if (obj.content == 'SAVE_FAILURE') {
item.isUploading = false;
errorCallBack(item);
item.isUploading = false
errorCallBack(item)
} else if (obj.content == 'SAVE_SUCCESS') {
sendFile();
i++;
const isok = (i / count) * 100;
item.progress = parseInt(isok);
sendFile()
i++
const isok = (i / count) * 100
item.progress = parseInt(isok)
} else if (obj.content == 'TRUE') {
callback(item);
item.isReady = true;
item.isSuccess = true;
item.isUploading = false;
socket.close();
callback(item)
item.isReady = true
item.isSuccess = true
item.isUploading = false
socket.close()
}
} else if (obj.category == 'UPLOAD_CANCEL') {
item.progress = 0;
item.isCancel = true;
socket.close();
item.progress = 0
item.isCancel = true
socket.close()
}
};
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
packages:
- 'packages/**'
- 'webs/**'
- 'webs/**'

View File

@ -1,5 +1,5 @@
module.exports = {
plugins: {
autoprefixer: { }
autoprefixer: {}
}
}

View File

@ -1,41 +1,28 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env"
],
"paths": {
"@/*": ["src/*"],
"services/*": ["src/services/*"],
"utils/*": ["src/common/utils/*"],
"filters/*": ["src/common/filters/*"],
"components/*": ["src/common/components/*"],
"hooks/*": ["src/common/hooks/*"],
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["webpack-env"],
"paths": {
"@/*": ["src/*"],
"services/*": ["src/services/*"],
"utils/*": ["src/common/utils/*"],
"filters/*": ["src/common/filters/*"],
"components/*": ["src/common/components/*"],
"hooks/*": ["src/common/hooks/*"]
},
"include": [
"webs/**/src/**/*.ts",
"webs/**/src/**/*.tsx",
"webs/**/src/**/*.vue"
],
"exclude": [
"node_modules"
]
}
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["webs/**/src/**/*.ts", "webs/**/src/**/*.tsx", "webs/**/src/**/*.vue"],
"exclude": ["node_modules"]
}

View File

@ -1,7 +1,7 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
extends: ['plugin:vue/essential', '@vue/standard', '@vue/typescript'],
rules: {
@ -11,8 +11,8 @@ module.exports = {
0,
{
vars: 'all',
args: 'none'
}
args: 'none',
},
],
semi: 0,
eqeqeq: 0,
@ -20,11 +20,11 @@ module.exports = {
camelcase: 0,
'no-case-declarations': 0,
'space-before-function-paren': 0,
'vue/no-parsing-error': [2, { "x-invalid-end-tag": false }],
'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }],
'@typescript-eslint/indent': ['error', 2],
'vue/no-mutating-props': 0
'vue/no-mutating-props': 0,
},
parserOptions: {
parser: '@typescript-eslint/parser'
}
};
parser: '@typescript-eslint/parser',
},
}

View File

@ -1,3 +1 @@
CMDB前端界面
CMDB 前端界面

View File

@ -1,6 +1,4 @@
module.exports = {
plugins: ['babel-plugin-transform-vite-meta-glob'],
presets: [
'@vue/cli-plugin-babel/preset'
]
presets: ['@vue/cli-plugin-babel/preset'],
}

View File

@ -1,36 +1,36 @@
{
"name": "@cmc/ams-web",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"dev": "vite",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"fix": "vue-cli-service lint --fix",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"precommit": "lint-staged"
},
"dependencies": {
"cmp-topology": "1.0.1",
"vue-json-tool": "^1.0.4",
"vue-splitpane": "^1.0.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.1",
"@vue/cli-plugin-typescript": "~4.4.1"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"name": "@cmc/ams-web",
"version": "6.0.0",
"private": true,
"author": "Haijun Zhang <zhanghaijun@beyondcent.com>",
"scripts": {
"dev": "vite",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"fix": "vue-cli-service lint --fix",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"precommit": "lint-staged"
},
"dependencies": {
"cmp-topology": "1.0.1",
"vue-json-tool": "^1.0.4",
"vue-splitpane": "^1.0.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.1",
"@vue/cli-plugin-typescript": "~4.4.1"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
}

View File

@ -1,5 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
autoprefixer: {},
},
}

View File

@ -1,28 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>多云集中纳管系统</title>
<link rel="stylesheet" href="/web-common-resource/css/loading.css">
</head>
<link rel="stylesheet" href="/web-common-resource/css/loading.css" />
</head>
<body id="cmp">
<body id="cmp">
<noscript>
<strong>We're sorry but cmc-web3.0 doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<strong>We're sorry but cmc-web3.0 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div class="loading">
<div class="loader-inner line-scale-pulse-out-rapid">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="loader-inner line-scale-pulse-out-rapid">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div id="app"></div>
<!-- <script src="/web-common-resource/dll/vue@2.6.14.min.js" exclude ignore></script>
@ -30,6 +28,5 @@
<script src="/web-common-resource/dll/dll.element.js" exclude ignore></script>
<script src="/web-common-resource/dll/element-ui@2.13.0/index.min.js" exclude ignore></script> -->
<!-- built files will be auto injected -->
</body>
</html>
</body>
</html>

View File

@ -1,12 +1,12 @@
const exec = require('child_process').exec;
const params = process.argv[2];
const exec = require('child_process').exec
const params = process.argv[2]
const str = `git subtree ${params || 'pull'} --prefix=src/common http://haijun@58.210.154.140:8888/web/cmp-common.git master --squash`
exec(str, function (err, stdout, stderr) {
if (err) {
console.log('======执行失败=======');
console.log('======执行失败=======')
console.log(err)
} else {
console.log('======执行成功=======');
console.log(stdout);
console.log('======执行成功=======')
console.log(stdout)
}
});
})

View File

@ -6,7 +6,7 @@ export function booleanFilter(value) {
1: '是',
0: '否',
YES: '是',
NO: '否'
NO: '否',
}
return obj[value] || value
}
@ -29,7 +29,7 @@ export function vmStatusFilter(status) {
UNKNOWN: '已断开',
UNKNOWNON: '已断开',
UNKNOWNOFF: '已断开',
UNKNOWNSUSPEND: '已断开'
UNKNOWNSUSPEND: '已断开',
}
return statusMap[status] || '未知'
}
@ -95,7 +95,7 @@ export function vmStatusColorFilter(status) {
DISABLED: 'danger',
DEALLOCATEING: 'warning',
PROTECTING: 'warning',
DOWN: 'info'
DOWN: 'info',
}
return statusMap[status] || 'danger'
}
@ -104,12 +104,12 @@ export function taskStatusFilter(value, type) {
const statusMap = {
DEVELOPING: '开发中',
APPROVING: '发布中',
APPROVED: ' 已发布'
APPROVED: ' 已发布',
}
const colorMap = {
DEVELOPING: 'normal',
APPROVING: 'warning',
APPROVED: 'success'
APPROVED: 'success',
}
return type === 'color' ? colorMap[value] : statusMap[value]
}
@ -123,7 +123,7 @@ export function taskTypeFilter(value) {
RECOVERY: '文件恢复',
HTTP: 'HTTP请求',
DATABASE: '数据库',
POINT: '聚合节点'
POINT: '聚合节点',
}
return obj[value]
}
@ -140,20 +140,20 @@ export function applyStatusFilter(value, type) {
// },
APPROVED: {
name: '已发布',
color: 'success'
color: 'success',
},
DEVELOPING: {
name: '开发中',
color: 'normal'
color: 'normal',
},
UNAPPLY: {
name: '未发布',
color: 'primary'
color: 'primary',
},
CREATED: {
name: '新创建',
color: 'normal'
}
color: 'normal',
},
}
return obj[value] && obj[value][type]
}
@ -162,56 +162,56 @@ export function taskExeStatusFilter(value, type = 'name') {
const obj = {
CREATED: {
name: '未执行',
color: 'normal'
color: 'normal',
},
NOREADY: {
name: '已跳过',
color: 'warning'
color: 'warning',
},
READY: {
name: '准备中',
color: 'normal'
color: 'normal',
},
WAITTING: {
name: '等待执行',
color: 'primary'
color: 'primary',
},
CANCELING: {
name: '取消中',
color: 'primary'
color: 'primary',
},
RUNNING: {
name: '正在执行',
color: 'normal'
color: 'normal',
},
SUCCESS: {
name: '执行成功',
color: 'success'
color: 'success',
},
SUSPENDED: {
name: '已暂停',
color: 'warning'
color: 'warning',
},
FAILED: {
name: '执行失败',
color: 'danger'
color: 'danger',
},
ERROR: {
name: '执行失败',
color: 'danger'
color: 'danger',
},
FAILAD: {
name: '执行失败',
color: 'danger'
color: 'danger',
},
CANCELED: {
name: '手动结束',
color: 'warning'
color: 'warning',
},
EXCEPTION: {
name: '执行异常',
color: 'danger'
}
color: 'danger',
},
}
return obj[value?.toUpperCase()] && obj[value?.toUpperCase()][type] // 容错处理(初始化值不存在)
}

View File

@ -1,3 +1,3 @@
const req = require.context('./svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const requireAll = (requireContext) => requireContext.keys().map(requireContext)
requireAll(req)

View File

@ -9,4 +9,4 @@
import { render } from '@cmp/cmp-core/render'
import qiankunRender from '@cmp/cmp-core/qiankunRender'
export const { bootstrap, mount, unmount } = qiankunRender(render);
export const { bootstrap, mount, unmount } = qiankunRender(render)

View File

@ -1,4 +1,4 @@
export default interface IDepart {
id?: number,
name?: string,
id?: number
name?: string
}

View File

@ -1,4 +1,4 @@
export interface IDepart {
id?: number,
parentId?: number,
id?: number
parentId?: number
}

View File

@ -1,19 +1,19 @@
export interface IService {
id?: number,
code?: string,
name?: string,
status?: string,
iconId?: number,
catalogId?: number,
checked?: boolean,
billable?: boolean,
billPolicy?: string,
basicPrice?:string,
vendorType?:string,
discount?:number,
templateId?:number|string,
templateName?:string,
icon?:string,
isPublic?: boolean,
id?: number
code?: string
name?: string
status?: string
iconId?: number
catalogId?: number
checked?: boolean
billable?: boolean
billPolicy?: string
basicPrice?: string
vendorType?: string
discount?: number
templateId?: number | string
templateName?: string
icon?: string
isPublic?: boolean
flowList?: any
}

View File

@ -1,6 +1,6 @@
export interface ISku {
id?: number,
name: string,
status: string,
id?: number
name: string
status: string
content: string
}

View File

@ -1,7 +1,7 @@
export interface ISla {
id?: number,
name?: string,
status?: string,
content?: string,
id?: number
name?: string
status?: string
content?: string
catalogId?: number
}

View File

@ -1,12 +1,12 @@
export interface ITenant {
id?: number,
account: string,
name: string,
status: string,
discount: number,
groupCode: string,
password: string,
remark: string,
departId: number | undefined,
departIds: number[] | string,
id?: number
account: string
name: string
status: string
discount: number
groupCode: string
password: string
remark: string
departId: number | undefined
departIds: number[] | string
}

View File

@ -1,19 +1,19 @@
export interface IUser {
id?: number,
account: string,
name: string,
status: string,
isManager: boolean,
sex: boolean,
password: string,
email: string,
mobile: string,
dingtalk: string,
wechat: string,
company: string,
jobNumber: string,
tenantId: number,
remark: string,
departId: number | undefined,
departIds: number[],
id?: number
account: string
name: string
status: string
isManager: boolean
sex: boolean
password: string
email: string
mobile: string
dingtalk: string
wechat: string
company: string
jobNumber: string
tenantId: number
remark: string
departId: number | undefined
departIds: number[]
}

View File

@ -12,5 +12,5 @@ export default {
BsmCmdbAutoHistory: () => import('views/data-collection/history/index.vue'),
CmdbLog: () => import('views/log/index.vue'),
CmdbConfigs: () => import('views/config/interface/index.vue'),
BsmCmdbAutoBackup: () => import('views/data-collection/backup/index.vue')
BsmCmdbAutoBackup: () => import('views/data-collection/backup/index.vue'),
}

View File

@ -5,7 +5,7 @@ export function getTopoCategory() {
return new Promise((resolve, reject) => {
request({
method: 'post',
url: '/ams/cmdb/module/topo/listAll'
url: '/ams/cmdb/module/topo/listAll',
})
.then((data) => {
if (data.success) {
@ -23,7 +23,7 @@ export function getModuleList() {
return new Promise((resolve, reject) => {
request({
method: 'post',
url: '/ams/cmdb/module/listAll'
url: '/ams/cmdb/module/listAll',
})
.then((res) => {
if (res.success) {
@ -33,7 +33,7 @@ export function getModuleList() {
})
resolve({
data: res.data,
map: map
map: map,
})
}
})
@ -49,7 +49,7 @@ export function getCategory() {
request({
method: 'post',
url: '/ams/cmdb/relation/type/group/listAll',
options: { noParam: true }
options: { noParam: true },
}).then((data) => {
if (data.success) {
resolve(data.data)
@ -64,12 +64,12 @@ export function getRelation(data) {
return new Promise((resolve, reject) => {
const params = {
moduleId: srcModuleId,
topoId
topoId,
}
request({
method: 'post',
url: '/ams/cmdb/module/relation/list',
data: params
data: params,
})
.then((data) => {
if (data.success) {
@ -87,8 +87,8 @@ export function getRelation(data) {
data: {
linksMap,
nodes,
links
}
links,
},
})
}
})
@ -104,12 +104,12 @@ export function getDetail(id) {
request({
method: 'get',
url: `/ams/cmdb/auto/relation/rule/${id}/detail`,
data: { id }
data: { id },
})
.then((res) => {
if (res.success) {
resolve({
data: res.data
data: res.data,
})
}
})
@ -124,20 +124,20 @@ export function getTaskDetail(id) {
return new Promise((resolve, reject) => {
const params = {}
params.params = {
id
id,
}
request({
method: 'get',
url: `/ams/cmdb/auto/relation/task/${id}/detail`,
options: {
noParam: true
noParam: true,
},
data: params
data: params,
})
.then((res) => {
if (res.success) {
resolve({
data: res.data
data: res.data,
})
}
})
@ -152,7 +152,7 @@ export function getRuleList() {
return new Promise((resolve, reject) => {
request({
method: 'post',
url: '/ams/cmdb/auto/relation/rule/list'
url: '/ams/cmdb/auto/relation/rule/list',
})
.then((data) => {
if (data.success) {

View File

@ -4,7 +4,7 @@ import { request } from '@cmp/cmp-element'
export function getTaskScence() {
const params = {
page: 1,
rows: 9999
rows: 9999,
}
return new Promise((resolve) => {
request({
@ -12,8 +12,8 @@ export function getTaskScence() {
url: '/cop/v1/tasks/scenes',
data: params,
options: {
noParam: true
}
noParam: true,
},
}).then((res) => {
if (res.success) {
for (const item of res.data.rows) {
@ -38,8 +38,8 @@ function getTemplateList(scenceId) {
url: '/cop//v1/tasks/templates',
params: {
simple: true,
params: JSON.stringify([{ param: { sceneId: _scenceId, internal: false }, sign: 'EQ' }])
}
params: JSON.stringify([{ param: { sceneId: _scenceId, internal: false }, sign: 'EQ' }]),
},
}).then((res) => {
if (res.success) {
resolve(res.data.rows)
@ -51,7 +51,7 @@ function getTemplateList(scenceId) {
// 获取采集插件
export function getPluginList() {
const params = {
simple: true
simple: true,
}
return new Promise((resolve) => {
request({
@ -59,8 +59,8 @@ export function getPluginList() {
url: '/ams/cmdb/collection/plugin/list',
data: params,
options: {
noParam: true
}
noParam: true,
},
}).then((res) => {
if (res.success) {
resolve(res.data.rows)
@ -72,10 +72,10 @@ export function getPluginList() {
// 获取采集链路插件
export function getChainPluginList() {
const params = {
simple: true
simple: true,
}
params.params = JSON.stringify({
businessType: 'chain'
businessType: 'chain',
})
return new Promise((resolve) => {
request({
@ -83,8 +83,8 @@ export function getChainPluginList() {
url: '/ams/cmdb/collection/plugin/listAllByBusinessType',
data: params,
options: {
noParam: true
}
noParam: true,
},
}).then((res) => {
if (res.success) {
resolve(res.data)

View File

@ -5,7 +5,7 @@ import { request } from '@cmp/cmp-element'
import { wrapperParams } from 'utils'
export function getPropertiesByCode(code) {
return request.get('/ims/v1/properties', {
params: wrapperParams({ code })
params: wrapperParams({ code }),
})
}

View File

@ -2,14 +2,14 @@ import { request } from '@cmp/cmp-element'
const baseUrl = '/ams/v1/cmdb/configs'
// 获取系统配置信息
export function getCmdbConfigs(params:any) {
export function getCmdbConfigs(params: any) {
return request.get(baseUrl, { params })
}
// 更新系统配置信息
export function updateCmdbConfigs(params:any) {
export function updateCmdbConfigs(params: any) {
return request.put(baseUrl, params)
}
// 获取树状系统配置信息
export function getCmdbTreeConfigs(params:any) {
export function getCmdbTreeConfigs(params: any) {
return request.get(`${baseUrl}/tree`, { params })
}

View File

@ -12,19 +12,19 @@ export function getCollectionBackupInstancesDetail(id: boolean, name: string) {
const historyUrl = '/ams/v1/collection/history'
export function getCollectionHistoryBackup(params: any): any {
return request.get(`${historyUrl}/backup`, {
params
params,
})
}
// 未采集
export function getCollectionInstancesBackup(params: any): any {
return request.get(`${historyUrl}/backup/instances`, {
params
params,
})
}
// 数据详情列表
export function getCollectionItemBackup(params: any): any {
return request.get(`${historyUrl}/item/backup`, {
params
params,
})
}

View File

@ -4,13 +4,13 @@ const baseUrl = '/ams/v1/collection/tasks/instances'
export function getCollectionTasksInstances(params: Base.IListParams) {
return request.get(baseUrl, { params })
}
export function getCollectionTasksInstancesDetail(id:boolean) {
export function getCollectionTasksInstancesDetail(id: boolean) {
return request.get(`${baseUrl}/${id}`)
}
export function getNodeLogs(id: number, params: { end: boolean; priority?: number }) {
return request.get(`/cop/v1/tasks/instances/nodes/${id}/logs`, {
params
params,
})
}
@ -21,7 +21,7 @@ export function getHosts(params: any) {
// simple修改
export function getIdentsBySimple(params: any): any {
return request.get('/cop/v1/identifications/simple', {
params
params,
})
}
@ -29,7 +29,7 @@ const scriptsUrl = '/cop/v1/scripts'
// simple修改
export function getScriptBySimple(params: any) {
return request.get(`${scriptsUrl}/simple`, {
params
params,
})
}
export function getScriptDetail(id) {
@ -39,7 +39,7 @@ export function getScriptDetail(id) {
const groupUrl = '/cop/v1/scripts/groups'
export function getGroup(params: any) {
return request.get(groupUrl, {
params
params,
})
}
@ -47,20 +47,20 @@ export function getGroup(params: any) {
const historyUrl = '/ams/v1/collection/history'
export function getCollectionhistory(params: any): any {
return request.get(historyUrl, {
params
params,
})
}
// 未采集
export function getCollectionInstances(params: any): any {
return request.get(`${historyUrl}/instances`, {
params
params,
})
}
// 数据详情列表
export function getCollectionItem(params: any): any {
return request.get(`${historyUrl}/item`, {
params
params,
})
}

View File

@ -23,6 +23,6 @@ export function removeCollectionPlugin(id: number) {
export function getUser(params: any) {
return request.get('/sms/v1/users', {
params
params,
})
}

View File

@ -2,7 +2,7 @@ import { request } from '@cmp/cmp-element'
export function getValidateRules(type: string) {
return request.get('/ams/v1/regexps', {
params: { type }
params: { type },
})
}
@ -10,9 +10,9 @@ export function getPropertyByModule(moduleId: number) {
return request.get(`/ams/v1/module/${moduleId}/properties`)
}
export function getModuleRelation(params: {sourceId: number, targetId: number, relationCategoryId: number}) {
export function getModuleRelation(params: { sourceId: number; targetId: number; relationCategoryId: number }) {
return request.get('/ams/v1/module/relation/relevancy', {
params
params,
})
}
@ -22,6 +22,6 @@ export function getCategoryByModuleId(moduleId: number) {
export function getRuleByModuleId(moduleId: number, relationCategoryId: number) {
return request.get(`/ams/v1/module/${moduleId}/relation/rule`, {
params: { relationCategoryId }
params: { relationCategoryId },
})
}

File diff suppressed because it is too large Load Diff

View File

@ -15,11 +15,11 @@ export function modifyAuth(params: any) {
}
export function removeAuth(id: number, params: any) {
return request.delete(`${baseUrl}/${id}`, {
params
params,
})
}
export function removeAuthByRole(params: any) {
return request.delete(`${baseUrl}/byrole`, {
data: params
data: params,
})
}

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