Initial commit all
parent
fea3c566a1
commit
a16d77e149
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"printWidth": 200,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none",
|
||||
"arrowParens": "avoid"
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
# 下载依赖
|
||||
pnpm install
|
||||
|
||||
# 开发环境启动
|
||||
pnpm start:app
|
||||
|
||||
# 生产环境构建
|
||||
pnpm build:app
|
||||
|
||||
# 代码检测
|
||||
pnpm lint
|
||||
|
||||
# 代码检测并自动修复
|
||||
pnpm fix
|
||||
|
||||
# 解决内存溢出问题
|
||||
pnpm fix-memory-limit
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2018/7/24.
|
||||
*/
|
||||
const CompressPlugin = require('compress-webpack-plugin')
|
||||
const { getDllPlugins } = require('./utils')
|
||||
|
||||
const httpType = 'http://'
|
||||
const proxyUrl = 'yw.iaserver.online:60006/' // 代理地址设置
|
||||
exports.getCommonConifg = function ({ devServer, ...other }) {
|
||||
return {
|
||||
transpileDependencies: ['@cmp/cmp-core'],
|
||||
publicPath: process.env.BASE_URL,
|
||||
assetsDir: 'static',
|
||||
// 构建时不进行eslint校验
|
||||
lintOnSave: process.env.NODE_ENV !== 'production',
|
||||
// 生产环境禁止source map
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
// https: true,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
overlay: {
|
||||
warnings: true,
|
||||
errors: true
|
||||
},
|
||||
proxy: {
|
||||
'/api/sms/messageService': {
|
||||
target: 'ws://' + proxyUrl,
|
||||
changeOrigin: true,
|
||||
ws: false
|
||||
},
|
||||
'/api': {
|
||||
target: httpType + proxyUrl,
|
||||
changeOrigin: true,
|
||||
secure: false
|
||||
},
|
||||
'/config-files': {
|
||||
target: httpType + proxyUrl
|
||||
},
|
||||
'/web-common-resource': {
|
||||
target: httpType + proxyUrl
|
||||
},
|
||||
'/config': {
|
||||
target: httpType + proxyUrl
|
||||
},
|
||||
'/cof-web': {
|
||||
target: httpType + proxyUrl
|
||||
}
|
||||
},
|
||||
...devServer
|
||||
},
|
||||
css: {
|
||||
loaderOptions: {
|
||||
sass: {
|
||||
prependData: '@import "~@cmp/cmp-common/css/common-var.scss";'
|
||||
}
|
||||
}
|
||||
},
|
||||
...other
|
||||
}
|
||||
}
|
||||
exports.commonConfigureWebpack = function (name) {
|
||||
// const plugins = []
|
||||
const plugins = []
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
plugins.push(
|
||||
new CompressPlugin({
|
||||
test: /\.js$|\.html$|\.css$/,
|
||||
threshold: 10240,
|
||||
deleteOriginalAssets: false
|
||||
})
|
||||
)
|
||||
}
|
||||
return {
|
||||
plugins,
|
||||
// externals: {
|
||||
// vue: 'Vue',
|
||||
// 'element-ui': 'ELEMENT'
|
||||
// },
|
||||
output: {
|
||||
// 把子应用打包成 umd 库格式
|
||||
library: `${name}-[name]`,
|
||||
libraryTarget: 'umd',
|
||||
jsonpFunction: `webpackJsonp_${name}`
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.commonChainWebpack = function (config, resolve) {
|
||||
// set svg-sprite-loader
|
||||
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
|
||||
config.module
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
.include.add(resolve('src/icons'))
|
||||
.end()
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: 'icon-[name]'
|
||||
})
|
||||
.end()
|
||||
config.resolve.alias
|
||||
.set('@', resolve('src'))
|
||||
.set('assets', resolve('src/assets'))
|
||||
.set('services', resolve('src/services'))
|
||||
.set('utils', '@cmp/cmp-common/utils')
|
||||
.set('interface', '@cmp/cmp-common/interface')
|
||||
.set('components', '@cmp/cmp-common/components')
|
||||
.set('hooks', '@cmp/cmp-common/hooks')
|
||||
.set('filters', resolve('src/filters'))
|
||||
.set('views', resolve('src/views'))
|
||||
config.module
|
||||
.rule('fonts')
|
||||
.use('url-loader')
|
||||
.loader('url-loader')
|
||||
.options({
|
||||
limit: 4096, // 小于4kb将会被打包成 base64
|
||||
fallback: {
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: 'fonts/[name].[ext]',
|
||||
publicPath: '/web-common-resource'
|
||||
}
|
||||
}
|
||||
})
|
||||
.end()
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
###
|
||||
# @Author: Haijun Zhang
|
||||
# @Date: 2022-11-03 09:46:32
|
||||
# @LastEditTime: 2023-05-26 11:38:09
|
||||
# @LastEditors: Haijun Zhang
|
||||
# @Description:
|
||||
# @FilePath: \cmc-web\build\deploy.sh
|
||||
###
|
||||
|
||||
apps=(cop ams sms cop-console)
|
||||
host=${1:-trunk}
|
||||
app=${2:-all}
|
||||
pnpm build:"${app}"
|
||||
|
||||
buildConsole() {
|
||||
ssh root@"${host}" /usr/bin/rm -rf /opt/cmp/consoles/csc-web/sub-app/"$1"
|
||||
scp -r ./webs/"${1}"/"${1}" root@"${host}":/opt/cmp/consoles/csc-web/sub-app/"${1}"
|
||||
}
|
||||
|
||||
if [ "${app}" == 'all' ]; then
|
||||
scp_command=''
|
||||
for console in ${apps[@]}; do
|
||||
if [[ $console == *'-console' ]]; then
|
||||
buildConsole "$console"
|
||||
else
|
||||
scp_command="${scp_command} ./webs/${console}-web/${console}-web"
|
||||
fi
|
||||
done
|
||||
ssh root@"${host}" rm -rf /opt/cmp/consoles/cmc-web/sub-app/*
|
||||
scp -r "${scp_command}" root@"${host}":/opt/cmp/consoles/cmc-web/sub-app
|
||||
elif [[ "${app}" == *"-console" ]]; then
|
||||
buildConsole "$app"
|
||||
elif [ "${app}" != 'main' ]; then
|
||||
ssh root@"${host}" /usr/bin/rm -rf /opt/cmp/consoles/cmc-web/sub-app/"${app}"-web
|
||||
scp -r ./webs/"${app}"-web/"${app}"-web root@"${host}":/opt/cmp/consoles/cmc-web/sub-app/${app}-web
|
||||
fi
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-09 11:26:04
|
||||
* @LastEditTime: 2022-11-15 15:55:34
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\build\utils.js
|
||||
*/
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
|
||||
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`))
|
||||
})
|
||||
});
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-08 15:34:47
|
||||
* @LastEditTime: 2022-11-15 17:51:22
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @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; // 压缩代码用的
|
||||
|
||||
module.exports = {
|
||||
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'],
|
||||
},
|
||||
// 出口
|
||||
output: {
|
||||
filename: 'dll.[name].js', // 其中[name]就是entry中的dll模块名字,因此filename就是dll.vue.js
|
||||
path: path.resolve(__dirname, '../dll'), // 输出打包的依赖文件到dll/js文件夹中
|
||||
library: '[name]_library'// 暴露出的全局变量名,用于给 manifest 映射
|
||||
},
|
||||
plugins: [
|
||||
// 重新打包时,清除之前打包的dll文件
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns: [path.resolve(__dirname, '../dll/*')] // ** 代表文件夹, * 代表文件
|
||||
}),
|
||||
// 生成 manifest.json 描述动态链接库包含了哪些内容
|
||||
new webpack.DllPlugin({
|
||||
// 暴露出的dll的函数名;此处需要和 output.library 的值一致
|
||||
// 输出的manifest.json中的name值
|
||||
name: '[name]_library',
|
||||
context: path.resolve(__dirname, '../'),
|
||||
// path 指定manifest.json文件的输出路径
|
||||
path: path.resolve(__dirname, '../dll/[name]-manifest.json'), // DllReferencePlugin使用该json文件来做映射依赖。(这个文件会告诉我们的哪些文件已经提取打包好了)
|
||||
}),
|
||||
new BundleAnalyzerPlugin(),// 压缩
|
||||
]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional']
|
||||
};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"name":"element_library","content":{"./node_modules/.pnpm/@vue+composition-api@1.7.1_vue@2.6.14/node_modules/@vue/composition-api/dist/vue-composition-api.mjs":{"id":6,"buildMeta":{"exportsType":"namespace","strictHarmonyModule":true,"providedExports":["EffectScope","computed","createApp","createRef","customRef","default","defineAsyncComponent","defineComponent","del","effectScope","getCurrentInstance","getCurrentScope","h","inject","isRaw","isReactive","isReadonly","isRef","markRaw","nextTick","onActivated","onBeforeMount","onBeforeUnmount","onBeforeUpdate","onDeactivated","onErrorCaptured","onMounted","onScopeDispose","onServerPrefetch","onUnmounted","onUpdated","provide","proxyRefs","reactive","readonly","ref","set","shallowReactive","shallowReadonly","shallowRef","toRaw","toRef","toRefs","triggerRef","unref","useAttrs","useCSSModule","useCssModule","useSlots","version","warn","watch","watchEffect","watchPostEffect","watchSyncEffect"]}},"./node_modules/.pnpm/cmp-element@1.0.0-6.0-release_3o4eqgixchatiuc3do5gjhspdq/node_modules/cmp-element/lib/cmp-element.umd.min.js":{"id":87,"buildMeta":{"providedExports":true}},"./node_modules/.pnpm/cmp-echarts@2.0.0-6.0-release_3o4eqgixchatiuc3do5gjhspdq/node_modules/cmp-echarts/lib/cmp-echarts.umd.min.js":{"id":88,"buildMeta":{"providedExports":true}}}}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/accounts'
|
||||
export function getAccount(params) {
|
||||
return request.get(`${baseUrl}/page`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getUserDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createUser(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyUser(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeUser(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
/*
|
||||
* action取值为:
|
||||
* lock active reset accredit change
|
||||
*/
|
||||
export function operateUser(id, action, params) {
|
||||
return request.patch(`${baseUrl}/${id}`, {
|
||||
action,
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function checkUser(id) {
|
||||
return request.get(`${baseUrl}/${id}/status`)
|
||||
}
|
||||
export function getRolesByUser(id) {
|
||||
return request.get(`${baseUrl}/${id}/roles`)
|
||||
}
|
||||
export function getTrack(params) {
|
||||
return request.get(`${baseUrl}/track`, {
|
||||
params: params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
export function getAuth(params) {
|
||||
return request.get('/sms/v1/permissions/tree', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getAuthByCategory(params) {
|
||||
return request.get('/sms/v1/permissions', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getAuthDetail(id) {
|
||||
return request.get(`/sms/v1/permissions/${id}`)
|
||||
}
|
||||
export function createAuth(params) {
|
||||
return request.post('/sms/v1/permissions', wrapperParams(params))
|
||||
}
|
||||
export function modifyAuth(params) {
|
||||
return request.put(`/sms/v1/permissions/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeAuth(id) {
|
||||
return request.delete(`/sms/v1/permissions/${id}`)
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams, downloadFile } from 'utils/index'
|
||||
|
||||
const baseUrl = '/sms/v1/bizs'
|
||||
export function getBizs(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getBizsDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createBizs(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyBizs(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeBizs(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function removeBizList(params) {
|
||||
return request.delete(`${baseUrl}`, { data: params })
|
||||
}
|
||||
|
||||
export function getPoolByBiz(id, params) {
|
||||
return request.get(`${baseUrl}/${id}/pools`, {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function configBizPool(id, params) {
|
||||
return request.post(`${baseUrl}/${id}/pools`, wrapperParams(params))
|
||||
}
|
||||
|
||||
// 获取单个业务的关联项目
|
||||
export function getProjectByBiz(id) {
|
||||
return request.get(`${baseUrl}/${id}/projects`)
|
||||
}
|
||||
|
||||
export function pacthRelatioonBiz(id, params) {
|
||||
return request.patch(`${baseUrl}/${id}`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function operateBiz(id, action, params) {
|
||||
return request.patch(`${baseUrl}/${id}`, {
|
||||
action,
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
|
||||
// 导出业务列表
|
||||
export function exportBizsList() {
|
||||
downloadFile('/sms/v1/bizs/export')
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/cos/v1/promotions'
|
||||
export function getPromotions(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getPromotionsDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createPromotions(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyPromotions(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removePromotions(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function assignPromotionsTenant(id, params) {
|
||||
return request.post(`${baseUrl}/${id}/coupons`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function conditionPromotions(params) {
|
||||
return request.get(baseUrl, { params })
|
||||
}
|
||||
|
||||
export function patchPromotions(action, id) {
|
||||
return request.patch(`${baseUrl}/${id}`, {
|
||||
action: action
|
||||
})
|
||||
}
|
||||
|
||||
export function getHistoryPromotions(params, id) {
|
||||
return request.get(`/cos/v1/promotions/${id}/auditrecords`, {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
const couponsUrl = '/cos/v1/coupons'
|
||||
export function getCoupons(params) {
|
||||
return request.get(couponsUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getCouponsDetail(id) {
|
||||
return request.get(`${couponsUrl}/${id}`)
|
||||
}
|
||||
export function createCoupons(params) {
|
||||
return request.post(couponsUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyCoupons(params) {
|
||||
return request.put(`${couponsUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeCoupons(id) {
|
||||
return request.delete(`${couponsUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function conditionCoupons(params) {
|
||||
return request.get(couponsUrl, { params })
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils/index'
|
||||
|
||||
export function login(params) {
|
||||
return request.post('/sms/v1/users/login', params)
|
||||
}
|
||||
export function loginByTenant(params) {
|
||||
return request.post('/sms/v1/tenants/login', params)
|
||||
}
|
||||
export function logout() {
|
||||
return request.post('/sms/v1/users/logout')
|
||||
}
|
||||
export function logoutByTenant(params) {
|
||||
return request.post('/sms/v1/tenants/logout', params)
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils/index'
|
||||
import { IDepart } from '@/models/depart'
|
||||
|
||||
const baseUrl = '/sms/v1/departments'
|
||||
|
||||
export function getDepart(params: any) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getDepartDetail(id: number) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createDepart(params:IDepart) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyDepart(params:IDepart) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeDepart(id:number) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/dictionaries'
|
||||
export function getDict(params) {
|
||||
return request.get(baseUrl, { params })
|
||||
}
|
||||
|
||||
export function createDict(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function modifyDict(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function removeDict(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function detailDict(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function getDictChildren(params) {
|
||||
return request.get(`${baseUrl}/children`, { params })
|
||||
}
|
||||
|
||||
export function getDictChildrenTree(params) {
|
||||
return request.get(`${baseUrl}/children/tree`, {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/cos/v1/documents'
|
||||
export function getDocument(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getDocumentSearch(params) {
|
||||
return request.get(`${baseUrl}/search`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getDocumentDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createDocument(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyDocument(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeDocument(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
const categoryUrl = '/cos/v1/documents/category'
|
||||
export function getCategory(params) {
|
||||
return request.get(categoryUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getCategoryDetail(id) {
|
||||
return request.get(`${categoryUrl}/${id}`)
|
||||
}
|
||||
export function createCategory(params) {
|
||||
return request.post(categoryUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyCategory(params) {
|
||||
return request.put(`${categoryUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeCategory(id) {
|
||||
return request.delete(`${categoryUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function uploadImage(params) {
|
||||
return request.post('/cos/v1/documents/pictures', params, {
|
||||
headers: { 'Content-Type': 'multipart/form-data', BsmAjaxHeader: true, options: { noSeri: true } }
|
||||
})
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils/index'
|
||||
|
||||
// 判断用户租户路径
|
||||
function getUrl(accountCategory) {
|
||||
return accountCategory === 'Tenant' ? 'tenants' : 'users'
|
||||
}
|
||||
export function getService(accountCategory) {
|
||||
return request.get(`/sms/v1/${getUrl(accountCategory)}/services`)
|
||||
}
|
||||
export function getFavorite(accountCategory) {
|
||||
return request.get(`/sms/v1/${getUrl(accountCategory)}/favorites`)
|
||||
}
|
||||
export function createFavorite(id, accountCategory) {
|
||||
return request.post(`/sms/v1/${getUrl(accountCategory)}/favorites/${id}`)
|
||||
}
|
||||
export function removeFavorite(id, accountCategory) {
|
||||
return request.delete(`/sms/v1/${getUrl(accountCategory)}/favorites/${id}`)
|
||||
}
|
||||
export function orderFavorite(params, accountCategory) {
|
||||
return request.post(`/sms/v1/${getUrl(accountCategory)}/favorites/order`, params)
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
export function login(params) {
|
||||
return request.post('/sms/v1/users/login', params)
|
||||
}
|
||||
export function loginByTenant(params) {
|
||||
return request.post('/sms/v1/tenants/login', params)
|
||||
}
|
||||
export function getTokenInfo(params) {
|
||||
return request.post('/sms/v1/sso/token/info', params)
|
||||
}
|
||||
export function getToken() {
|
||||
return request.post('/sms/v1/sso/check')
|
||||
}
|
||||
export function getUserInfo() {
|
||||
return request.get('/sms/v1/login/detail')
|
||||
}
|
||||
export function logout() {
|
||||
return request.post('/sms/v1/users/logout')
|
||||
}
|
||||
export function logoutByTenant(params) {
|
||||
return request.post('/sms/v1/tenants/logout', params)
|
||||
}
|
||||
export function getConfig(params) {
|
||||
return request.get('/sms/v1/logo', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getDict(data) {
|
||||
return request.get('/dict/children', {
|
||||
params: wrapperParams(data)
|
||||
})
|
||||
}
|
||||
export function getSysconf() {
|
||||
return request.get('/sms/v1/configs')
|
||||
}
|
||||
export function getSysconfCode(params) {
|
||||
return request.get('/sms/v1/configs', { params })
|
||||
}
|
||||
export function modifySysconf(data) {
|
||||
return request.put('/sms/v1/configs', wrapperParams(data))
|
||||
}
|
||||
|
||||
export function goSync() {
|
||||
return request.post('/sms/v1/configs/syncLdap')
|
||||
}
|
||||
// 获取首页概览信息
|
||||
export function getPortal(params) {
|
||||
return request.get('/cmp/v1/portal/platform/stats', { params: wrapperParams(params) })
|
||||
}
|
||||
export function getServiceQuota(tenantId, data) {
|
||||
return request.get(`/cos/v1/tenants/${tenantId}/quotas`, {
|
||||
params: wrapperParams(data)
|
||||
})
|
||||
}
|
||||
export function replaceToken(params) {
|
||||
return request.get('/sms/v1/token', { params })
|
||||
}
|
||||
// 获取用户权限
|
||||
export function getUserPermissions() {
|
||||
return request.get('/sms/v1/users/permissions')
|
||||
}
|
||||
// 获取系统配置信息
|
||||
export function getSystemConfigs(params) {
|
||||
return request.get('/sms/v1/configs', { params })
|
||||
}
|
||||
// 获取树状系统配置信息
|
||||
export function getSystemTreeConfigs(params) {
|
||||
return request.get('/sms/v1/configs/tree', { params })
|
||||
}
|
||||
// 更新系统配置信息
|
||||
export function updateSystemConfigs(params) {
|
||||
return request.put('/sms/v1/system-configs', params, {
|
||||
headers: { 'Content-Type': 'multipart/form-data', BsmAjaxHeader: true, options: { noSeri: true } }
|
||||
})
|
||||
}
|
||||
// 测试连接
|
||||
export function testLinkApi(category) {
|
||||
return request.get('/sms/v1/configs/test', { params: { category } })
|
||||
}
|
||||
|
||||
export function getDocumentStatus() {
|
||||
return request.get('/cos/v1/documents/display')
|
||||
}
|
||||
|
||||
export function getPermissionButtons() {
|
||||
return request.get('/sms/v1/users/button/permissions')
|
||||
}
|
||||
export function syncLdapApi() {
|
||||
return request.post('/sms/v1/configs/syncLdap')
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/admissions'
|
||||
|
||||
export function getIpAccess(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getIpAccessDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createIpAccess(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function removeIpAccess(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function batchRemoveIpAccess(params) {
|
||||
return request.delete(`${baseUrl}`, {
|
||||
data: params
|
||||
})
|
||||
}
|
||||
export function getStrategies(params) {
|
||||
return request.get('/sms/v1/access/strategies', {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function modifyStrategies(params) {
|
||||
return request.put(`/sms/v1/access/strategies/${params.id}`, wrapperParams(params))
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
const baseUrl = '/sms/v1/config'
|
||||
|
||||
export function getStatus(params) {
|
||||
return request.get(`${baseUrl}/status`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getSid() {
|
||||
return request.get('/sms/v1/status/sids')
|
||||
}
|
||||
export function getServer(params) {
|
||||
return request.get(`${baseUrl}/servers`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getLicense() {
|
||||
return request.get(`${baseUrl}/license`)
|
||||
}
|
||||
export function installCaptcha(params) {
|
||||
return request.post('/sms/v1/config/captcha/install', params)
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams, downloadFile } from '@csc/common/utils'
|
||||
|
||||
const baseUrl = '/sms/v1/logs'
|
||||
|
||||
export function getLog(params:Base.IListParams) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getLogStats() {
|
||||
return request.get(`${baseUrl}/stats`)
|
||||
}
|
||||
export function getLogView() {
|
||||
return request.get('/cos/v1/logview')
|
||||
}
|
||||
export function exportLog() {
|
||||
downloadFile('/cos/v1/logfile')
|
||||
}
|
||||
export function accessLog(params: any) {
|
||||
downloadFile('/sms/v1/logs/archive', params)
|
||||
}
|
||||
export function getRecords(params: any) {
|
||||
return request.get('/sms/v1/archives', {
|
||||
params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams, downloadFile } from 'utils/index'
|
||||
|
||||
const baseUrl = '/sms/v1/users'
|
||||
export function getUser(params: Base.IListParams) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getUserDetail(id: number) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createUser(params: any) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyUser(params: any) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeUser(id: number) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function accreditManager(id:number, roleIds:number[]) {
|
||||
return request.patch(`${baseUrl}/${id}/accredit`, roleIds)
|
||||
}
|
||||
export function resetManager(id:number, password:string) {
|
||||
return request.patch(`${baseUrl}/${id}/reset`, { password })
|
||||
}
|
||||
export function operateManager(id: number, action: string) {
|
||||
return request.patch(`${baseUrl}/${id}`, { action })
|
||||
}
|
||||
export function batchOperateManager(ids: number[], action: string) {
|
||||
return request.patch(`${baseUrl}`, { action, ids })
|
||||
}
|
||||
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) {
|
||||
return request.get(`${baseUrl}/${id}/roles`)
|
||||
}
|
||||
export function getTrack(params:Base.IListParams) {
|
||||
return request.get(`${baseUrl}/track`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function exportUser(params:Base.IListParams) {
|
||||
downloadFile(`${baseUrl}/export`, params)
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
|
||||
const baseUrl = '/sms/v1/messages'
|
||||
export function getMessage(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getMessageStats() {
|
||||
return request.get(`${baseUrl}/stats`)
|
||||
}
|
||||
export function getMessageDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function removeMessage(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function readAllMessage(params) {
|
||||
return request.patch(`${baseUrl}`, params)
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/1/26.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'util'
|
||||
|
||||
const orderUrl = '/cos/v1/orders'
|
||||
|
||||
export function getOrder(params) {
|
||||
return request.get(orderUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function createOrder(params) {
|
||||
return request.post(orderUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyOrder(params) {
|
||||
return request.put(`${orderUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeOrder(id) {
|
||||
return request.delete(`${orderUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function getOrderDetail(id) {
|
||||
return request.get(`${orderUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function getOrderItems(params) {
|
||||
return request.get(`${orderUrl}/items`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function conditionOrder(params) {
|
||||
return request.get(orderUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function operateOrder(action, params) {
|
||||
return request.patch(`${orderUrl}`, {
|
||||
action,
|
||||
...params
|
||||
})
|
||||
}
|
||||
export function getOrderCount() {
|
||||
return request.get('/cos/v1/orders/count')
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/cos/v1/services/providers'
|
||||
// 服务平台
|
||||
export function getProvider(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getProviderDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createProvider(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyProvider(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeProvider(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
const operateUrl = '/cos/v1/services/operations'
|
||||
export function getOperate(params) {
|
||||
return request.get(operateUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
// 服务操作
|
||||
export function getOperateDetail(id) {
|
||||
return request.get(`${operateUrl}/${id}`)
|
||||
}
|
||||
export function createOperate(params) {
|
||||
return request.post(operateUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyOperate(params) {
|
||||
return request.put(`${operateUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeOperate(id) {
|
||||
return request.delete(`${operateUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/system/tasks'
|
||||
|
||||
export function getTasks(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getTasksDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createTasks(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyTasks(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeTasks(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/portal'
|
||||
export function getPanel() {
|
||||
return request.get(`${baseUrl}/panels`, {
|
||||
params: { module: 'COP' }
|
||||
})
|
||||
}
|
||||
export function savePanel(params) {
|
||||
return request.patch(`${baseUrl}/panels`, wrapperParams(params))
|
||||
}
|
||||
export function resetPanel(module = 'cop') {
|
||||
return request.put(`${baseUrl}/panels/${module}/reset`)
|
||||
}
|
||||
export function getPool() {
|
||||
return request.get(`${baseUrl}/elementpools`, {
|
||||
params: { module: 'COP' }
|
||||
})
|
||||
}
|
||||
export function getConfig(params) {
|
||||
return request.get(`${baseUrl}/elements`, {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getPlatformStats(params) {
|
||||
return request.get('/cmp/v1/portal/platform/stats', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getVendorStats(params) {
|
||||
return request.get('/cmp/v1/portal/vendor/stats', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getTaskStats(params) {
|
||||
return request.get('/cop/v1/tasks/stats', {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getVmServiceTrend(params) {
|
||||
return request.get('/cos/v1/portal/platform/statisticsOfComputer', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getCharge(params) {
|
||||
return request.get('/cmc/portal/charge/stats', {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
|
||||
export function getAlarmCount(params) {
|
||||
return request.get('/cms/v1/alarms/chart', {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function conditionBill(params) {
|
||||
return request.get('/cos/v1/bills/condition', {
|
||||
params: {
|
||||
condition: JSON.stringify(params)
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getOrderCount() {
|
||||
return request.get('/cos/v1/soa/orders/count')
|
||||
}
|
||||
|
||||
export function getOrderDashboard(params) {
|
||||
return request.get('/cos/v1/soa/orders/dashboard', {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getResourceCountByDc(dcId) {
|
||||
return request.get('/cmp/v1/dcs/resource/count', {
|
||||
params: { dcId }
|
||||
})
|
||||
}
|
||||
export function getSystemCount() {
|
||||
return request.get('/sms/v1/system/count')
|
||||
}
|
||||
export function getTodoCount() {
|
||||
return request.get('/cos/v1/soa/todo/count')
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams, downloadFile } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/projects'
|
||||
export function getProject(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getProjectUser(params) {
|
||||
return request.get(`${baseUrl}/${params.id}/users`, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getProjectDetailInfo(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function getProjectDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}/quotas`)
|
||||
}
|
||||
export function createProject(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyProject(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function switchProject(id, params) {
|
||||
return request.patch(`${baseUrl}/${id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeProject(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function removeProjectList(params) {
|
||||
return request.delete(`${baseUrl}`, { data: params })
|
||||
}
|
||||
|
||||
export function exportProject(params) {
|
||||
downloadFile(`${baseUrl}/export`, { params })
|
||||
}
|
||||
export function getProjectByTenant(id, params) {
|
||||
return request.get(`/sms/v1/tenants/${id}/projects`, {
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
|
||||
export function getProjectMemberList(id) {
|
||||
return request.get(`${baseUrl}/${id}/users`)
|
||||
}
|
||||
|
||||
export function settingProjectUser(id, params) {
|
||||
return request.post(`${baseUrl}/${id}/users`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function exportProjects(params) {
|
||||
downloadFile('/sms/v1/projects/export', params)
|
||||
}
|
||||
|
||||
export function conditionProject(params) {
|
||||
return request.get(`${baseUrl}/condition`, {
|
||||
params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const recyclesUrl = '/cos/v1/recycles'
|
||||
export function getRecycle(params) {
|
||||
return request.get(recyclesUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function patchRecycle(params) {
|
||||
return request.patch(`${recyclesUrl}/${params.id}/restore`, {
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRecycle(params) {
|
||||
return request.post('/cos/v1/resource/cancelation/all', params)
|
||||
}
|
||||
|
||||
export function patchToRecycle(params) {
|
||||
return request.patch(`/cmp/plugins/v1/${params.url}/${params.id}/recycle`)
|
||||
}
|
||||
|
||||
export function checkUnderway(params) {
|
||||
return request.get('/cos/v1/orders/underway/check', { params })
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const roleUrl = '/sms/v1/roles'
|
||||
|
||||
export function getRole(params) {
|
||||
return request.get(roleUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getRoleDetail(id) {
|
||||
return request.get(`${roleUrl}/${id}`)
|
||||
}
|
||||
export function createRole(params) {
|
||||
return request.post(roleUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyRole(params) {
|
||||
return request.put(`${roleUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeRole(id) {
|
||||
return request.delete(`${roleUrl}/${id}`)
|
||||
}
|
||||
export function getRoleAuth(id, params) {
|
||||
return request.get(`${roleUrl}/${id}/permissions`, {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
export function accreditRole(id, params) {
|
||||
return request.patch(`${roleUrl}/${id}`, params)
|
||||
}
|
||||
export function getModules() {
|
||||
return request.get('/sms/v1/permissions/modules')
|
||||
}
|
||||
export function getModulesByName(name) {
|
||||
return request.get(`/sms/v1/permissions/modules/${name}`)
|
||||
}
|
||||
export function getApiById(roleId, params) {
|
||||
return request.get(`/sms/v1/roles/${roleId}/apis`, {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
export function updateApi(roleId, params) {
|
||||
return request.patch(`/sms/v1/roles/${roleId}/apis`, params)
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/cms/v1/system'
|
||||
export function getServers(params) {
|
||||
return request.get(`${baseUrl}/servers`)
|
||||
}
|
||||
export function getServersDetail(params) {
|
||||
return request.get(`${baseUrl}/charts`, {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getServices(params) {
|
||||
return request.get(`${baseUrl}/services`)
|
||||
}
|
||||
export function getPlugs(params) {
|
||||
return request.get(`${baseUrl}/plugins`)
|
||||
}
|
||||
export function getComponents(params) {
|
||||
return request.get(`${baseUrl}/components`)
|
||||
}
|
||||
export function getStatus(params) {
|
||||
return request.get(`${baseUrl}/status`, {
|
||||
params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
const shoppingUrl = '/cos/v1/shopping/cart'
|
||||
|
||||
export function getShoppingCart(params) {
|
||||
return request.get(shoppingUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function removeShoppingCart(id) {
|
||||
return request.delete(`${shoppingUrl}/${id}`)
|
||||
}
|
||||
export function getShoppingCartDetail(id) {
|
||||
return request.get(`${shoppingUrl}/${id}`)
|
||||
}
|
||||
export function emptyShoppingCart(params) {
|
||||
return request.put(shoppingUrl, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function putShoppingCart(id, params) {
|
||||
return request.put(`${shoppingUrl}/${id}`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function shoppingOkCloudServices(params) {
|
||||
return request.post(`${shoppingUrl}/apply`, wrapperParams(params))
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/sms/v1/systems'
|
||||
export function getSystems(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getSystemsDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createSystems(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifySystems(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeSystems(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
|
||||
const baseUrl = 'sms/v1/tags'
|
||||
|
||||
export function getTags(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getTagsDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function createTag(params) {
|
||||
return request.post(baseUrl, {
|
||||
...params
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyTag(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, {
|
||||
...params
|
||||
})
|
||||
}
|
||||
|
||||
export function removeTag(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams, downloadFile } from 'utils/index'
|
||||
|
||||
const baseUrl = '/sms/v1/tenants'
|
||||
export function getTenant(params:any) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function checkedTenant(account:string) {
|
||||
return request.get(`${baseUrl}/${account}/exist`)
|
||||
}
|
||||
|
||||
export function getTenantTree(params:any) {
|
||||
return request.get(`${baseUrl}`, {
|
||||
params: {
|
||||
condition: JSON.stringify({ condition: 'children' }),
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getTenantDetail(id:number) {
|
||||
return request.get(`${baseUrl}/${id}/quotas`)
|
||||
}
|
||||
// 租户信息
|
||||
export function getTenantInfo(id:number) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
// 租户下用户列表
|
||||
export function getTenantUserTrans(id:number, params: any) {
|
||||
return request.get(`${baseUrl}/${id}/users`, { params })
|
||||
}
|
||||
// 租户下服务列表
|
||||
export function getTenantService(id:number) {
|
||||
return request.get(`/cos/v1/services/tenants/${id}/services`)
|
||||
}
|
||||
export function createTenant(params:any) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyTenant(params:any) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeTenant(id:number) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function getTenantStats(params:any) {
|
||||
return request.get(`${baseUrl}/stats`, {
|
||||
params: wrapperParams(params)
|
||||
})
|
||||
}
|
||||
export function getTenantPool(id:number) {
|
||||
return request.get(`${baseUrl}/${id}/pools`)
|
||||
}
|
||||
export function assignTenantPools(params:any) {
|
||||
return request.post(`${baseUrl}/${params.id}/pools`, JSON.stringify(params.poolIds))
|
||||
}
|
||||
|
||||
export function resetTenantPsw(id:number, params:any) {
|
||||
return request.patch(`${baseUrl}/${id}/reset`, {
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
* action取值为:
|
||||
* lock active reset accredit change
|
||||
*/
|
||||
export function operateTenant(id:number, action:string, params:any) {
|
||||
return request.patch(`${baseUrl}/${id}`, {
|
||||
action,
|
||||
...wrapperParams(params)
|
||||
})
|
||||
}
|
||||
// 租户配额
|
||||
export function getQuotaTenant(id:number, params:any) {
|
||||
return request.get(`/cos/v1/tenants/${id}/quotas`, { params })
|
||||
}
|
||||
|
||||
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) {
|
||||
return request.post(`/cos/v1/tenants/${id}/quotas`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function getTenantBus(id:number, params:any) {
|
||||
return request.get(`/sms/v1/tenants/${id}/businesses`, { params })
|
||||
}
|
||||
export function createTenantBus(id:number, params:any) {
|
||||
return request.post(`/sms/v1/tenants/${id}/businesses`, params)
|
||||
}
|
||||
export function createTenantPool(id:number, params:any) {
|
||||
return request.post(`/sms/v1/tenants/${id}/pools`, params)
|
||||
}
|
||||
export function getOsTenant(params:any) {
|
||||
return request.get('/cmp/v1/ostenants', {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function createOsTenantt(params:any) {
|
||||
return request.post('/cmp/v1/ostenants', wrapperParams(params))
|
||||
}
|
||||
export function modifyOsTenant(params:any) {
|
||||
return request.put(`/cmp/v1/ostenants/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
|
||||
export function removeOsTenant(id:number) {
|
||||
return request.delete(`/cmp/v1/ostenants/${id}`)
|
||||
}
|
||||
export function getTrack(params:any) {
|
||||
return request.get(`${baseUrl}/track`, {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
export function getUser(params:any) {
|
||||
return request.get('/sms/v1/users', { params })
|
||||
}
|
||||
// 获取授信
|
||||
export function getTenantAccount(id:number) {
|
||||
return request.get(`/cos/v1/tenants/${id}/account`)
|
||||
}
|
||||
// 授信修改
|
||||
export function createTenantAccount(params:any) {
|
||||
return request.post('/cos/v1/tenants/account', wrapperParams(params))
|
||||
}
|
||||
export function getApiById(id:number, params:any) {
|
||||
return request.get(`/sms/v1/tenants/${id}/apis`, {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
export function updateApi(id:number, params:any) {
|
||||
return request.patch(`/sms/v1/tenants/${id}/apis`, params)
|
||||
}
|
||||
// 配额
|
||||
export function getBaseQuotas() {
|
||||
return request.get('/cos/v1/quotas/metas')
|
||||
}
|
||||
|
||||
export function getTenantBaseQuotas(id:number) {
|
||||
return request.get(`/cos/v1/tenants/${id}/quotas/metas`)
|
||||
}
|
||||
|
||||
// 租户配置用户
|
||||
export function tenantCongigUser(params:any) {
|
||||
return request.post(`/sms/v1/tenants/${params.id}/users`, params.ids)
|
||||
}
|
||||
|
||||
// 租户移除用户
|
||||
export function tenantRemoveUser(id:number) {
|
||||
return request.patch(`/sms/v1/users/${id}/tenants`)
|
||||
}
|
||||
|
||||
// /sms/v1/tenants
|
||||
// 租户移除用户
|
||||
export function lockTenant(params: any) {
|
||||
return request.patch('/sms/v1/tenants', params)
|
||||
}
|
||||
|
||||
// 导出租户列表
|
||||
export function exportTenantList() {
|
||||
downloadFile('/sms/v1/tenants/export')
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2019/7/23.
|
||||
*/
|
||||
import { request } from '@cmp/cmp-element'
|
||||
|
||||
const baseUrl = '/sms/v1/users'
|
||||
export function getUser(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getGroup(params) {
|
||||
return request.get('/sms/v1/users/groups', {
|
||||
params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
import { request } from '@cmp/cmp-element'
|
||||
import { wrapperParams } from 'utils'
|
||||
|
||||
const baseUrl = '/cos/v1/workorders'
|
||||
export function getworkOrder(params) {
|
||||
return request.get(baseUrl, {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getworkOrderDetail(id) {
|
||||
return request.get(`${baseUrl}/${id}`)
|
||||
}
|
||||
export function createworkOrder(params) {
|
||||
return request.post(baseUrl, wrapperParams(params))
|
||||
}
|
||||
export function modifyworkOrder(params) {
|
||||
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
||||
}
|
||||
export function removeworkOrder(id) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
||||
|
||||
export function recordWorkOrder(id) {
|
||||
return request.get(`${baseUrl}/${id}/records`)
|
||||
}
|
||||
|
||||
export function createRecordsWorkOrder(params) {
|
||||
return request.post(`${baseUrl}/${params.orderId}/records`, wrapperParams(params))
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2017/8/31.
|
||||
*/
|
||||
import { isConsole } from '@/config'
|
||||
export const taskExeOptions = {
|
||||
RUNNING: ' 正在执行',
|
||||
SUCCESS: '执行成功',
|
||||
FAILED: '执行失败',
|
||||
EXCEPTION: ' 执行异常',
|
||||
CANCELED: '手动结束',
|
||||
SUSPENDED: '已暂停',
|
||||
CREATED: '未执行'
|
||||
}
|
||||
export const authenModeOptions = isConsole ? {
|
||||
TRUST: '互信认证',
|
||||
SINGLE: '单一认证',
|
||||
} : {
|
||||
BATCH: '批量认证',
|
||||
TRUST: '互信认证',
|
||||
SINGLE: '单一认证',
|
||||
ACCOUNT: '认证账号'
|
||||
}
|
||||
export const environmentData = {
|
||||
DEVELOP: '开发环境',
|
||||
TEST: '测试环境',
|
||||
PRODUCTION: '生产环境',
|
||||
READY: '预发环境',
|
||||
UAT: 'UAT环境'
|
||||
}
|
||||
export const networkType = {
|
||||
0: '容器镜像',
|
||||
1: '虚拟机镜像',
|
||||
2: 'rpm安装',
|
||||
3: '应用程序包',
|
||||
4: '其他'
|
||||
}
|
||||
export const httpMethod = ['GET', 'POST', 'PUT', 'DELETE']
|
||||
export const httpFormat = ['RAW', 'FORM_DATA', 'FORM_URLENCODED', 'BINARY']
|
||||
export const scriptTypeData = [
|
||||
{ name: 'shell', value: 'SHELL' },
|
||||
{ name: 'bat', value: 'BAT' },
|
||||
{ name: 'perl', value: 'PERL' },
|
||||
{ name: 'python', value: 'PYTHON' },
|
||||
{ name: 'playbook', value: 'PLAYBOOK' },
|
||||
{ name: 'powershell', value: 'POWERSHELL' }
|
||||
]
|
||||
|
||||
export const hostType = {
|
||||
MAINFRAME: '大型机',
|
||||
MINICOMPUTER: '小型机',
|
||||
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 processLevel = [
|
||||
{ name: '一般', value: 'COMMON' },
|
||||
{ name: '紧急', value: 'EMERGENCY' }
|
||||
]
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-radio-group v-model="params.time" @change="selectTime">
|
||||
<el-radio-button v-for="item in timeList" :key="item.value" :label="item.value">{{ item.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<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>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click.native="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click.native="submit">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
timeList: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return [
|
||||
{ label: '天', value: 'Days' },
|
||||
{ label: '周', value: 'Weeks' },
|
||||
{ label: '月', value: 'Months' },
|
||||
{ label: '季度', value: 'QuarterYears' },
|
||||
{ label: '半年', value: 'HalfYears' },
|
||||
{ label: '一年', value: 'Years' }
|
||||
]
|
||||
}
|
||||
},
|
||||
getData: {
|
||||
type: Function
|
||||
},
|
||||
defaultTime: {
|
||||
type: String,
|
||||
default: 'Months'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}
|
||||
],
|
||||
disabledDate(time) {
|
||||
return time.getTime() > new Date().getTime()
|
||||
}
|
||||
},
|
||||
dialogVisible: false,
|
||||
time: '',
|
||||
params: {
|
||||
time: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.params.time = this.defaultTime
|
||||
},
|
||||
methods: {
|
||||
selectTime(value) {
|
||||
// 自定义
|
||||
if (!value) {
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true
|
||||
return
|
||||
}
|
||||
this.time = ''
|
||||
this.params.startTime = ''
|
||||
this.params.endTime = ''
|
||||
this.getData(this.params)
|
||||
},
|
||||
submit() {
|
||||
if (!this.time) return this.$message.error('请选择时间范围')
|
||||
const [startTime, endTime] = this.time
|
||||
if (new Date(endTime).getTime() - new Date(startTime) < 1000 * 60 * 60) {
|
||||
return this.$message.error('时间间隔必须大于一小时')
|
||||
}
|
||||
this.params.time = ''
|
||||
this.params.startTime = startTime
|
||||
this.params.endTime = endTime
|
||||
this.dialogVisible = false
|
||||
this.getData(this.params)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
</style>
|
|
@ -0,0 +1,72 @@
|
|||
<template>
|
||||
<el-input v-bind="$attrs"></el-input>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed } from 'vue'
|
||||
const colorMap = {
|
||||
normal: {
|
||||
bg: '#2E8CF0',
|
||||
bc: '#CBE3FB'
|
||||
},
|
||||
primary: {
|
||||
bg: '#5D59B4',
|
||||
bc: '#B3B0B4'
|
||||
},
|
||||
success: {
|
||||
bg: '#54C54E',
|
||||
bc: '#D5F1D3'
|
||||
},
|
||||
warning: {
|
||||
bg: '#FF9900',
|
||||
bc: '#D8EEDD'
|
||||
},
|
||||
danger: {
|
||||
bg: '#DC1A1A',
|
||||
bc: '#F6C6C6'
|
||||
},
|
||||
disabled: {
|
||||
bg: '#808490',
|
||||
bc: '#E0E1E4'
|
||||
}
|
||||
}
|
||||
export default {
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'normal'
|
||||
},
|
||||
bgColor: {
|
||||
type: String
|
||||
},
|
||||
borderColor: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
const colorObj = computed(() => (colorMap[props.type] || {}))
|
||||
return { colorObj }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.icon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 8px;
|
||||
background: #2e8cf0;
|
||||
border: 4px solid #cbe3fb;
|
||||
}
|
||||
.icon-text {
|
||||
margin: 3px 0 0 5px;
|
||||
display: inline-block;
|
||||
width: calc(100% - 21px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,5 @@
|
|||
import BasicInput from './BasicInput.vue'
|
||||
BasicInput.install = function (Vue) {
|
||||
Vue.component('BasicInput', BasicInput)
|
||||
}
|
||||
export default BasicInput
|
|
@ -0,0 +1,191 @@
|
|||
|
||||
<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">移入
|
||||
<i class="el-icon-right"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<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;">
|
||||
<el-row v-for="(item, key) in target" :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}${item.name}`">
|
||||
<el-checkbox v-model="cell.checked">{{cell[label]}}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
model: {
|
||||
prop: 'checkedIds',
|
||||
event: 'change'
|
||||
},
|
||||
props: {
|
||||
titles: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return ['列表1', '列表2']
|
||||
}
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: 'name'
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
groupKey: {
|
||||
type: String,
|
||||
default: 'group'
|
||||
},
|
||||
prefix: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
checkedIds: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
selectList: [],
|
||||
sourceList: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.init()
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
handler (newVal, oldVal) {
|
||||
this.selectList = [];
|
||||
this.sourceList = [];
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
source () {
|
||||
return this.formatData(this.sourceList)
|
||||
},
|
||||
target () {
|
||||
return this.formatData(this.selectList)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
[...this.data].forEach((item, key) => {
|
||||
const result = {
|
||||
...item,
|
||||
checked: false,
|
||||
orderKey: key
|
||||
}
|
||||
if (this.checkedIds.includes(item[this.value])) {
|
||||
this.selectList.push(result)
|
||||
} else {
|
||||
this.sourceList.push(result)
|
||||
}
|
||||
})
|
||||
},
|
||||
formatData (data) {
|
||||
const source = {}
|
||||
data.forEach(item => {
|
||||
const key = item[this.groupKey]
|
||||
if (source[key]) {
|
||||
source[key].push(item)
|
||||
} else {
|
||||
source[key] = [item]
|
||||
}
|
||||
})
|
||||
return source
|
||||
},
|
||||
addItems () {
|
||||
const list = [];
|
||||
this.sourceList.forEach(item => {
|
||||
if (item.checked) {
|
||||
this.selectList.push({
|
||||
...item,
|
||||
checked: false
|
||||
})
|
||||
} else {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.sourceList = [...list].sort((a, b) => {
|
||||
return a.orderKey - b.orderKey
|
||||
});
|
||||
this.getChekckIds()
|
||||
},
|
||||
removeItems () {
|
||||
const list = [];
|
||||
this.selectList.forEach(item => {
|
||||
if (item.checked) {
|
||||
this.sourceList.push({
|
||||
...item,
|
||||
checked: false
|
||||
})
|
||||
} else {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.selectList = [...list];
|
||||
this.getChekckIds()
|
||||
},
|
||||
getChekckIds () {
|
||||
const checkedIds = this.selectList.map(item => item[this.value])
|
||||
this.$emit('change', checkedIds)
|
||||
}
|
||||
}
|
||||
}
|
||||
</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;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-03 15:41:09
|
||||
* @LastEditTime: 2022-11-07 10:52:35
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\packages\common\components\icon-select\elementIcons.ts
|
||||
*/
|
||||
export default []
|
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<el-select clearable :value="iconName" placeholder="请选择图标" filterable="" @change="change">
|
||||
<el-option v-for="item in iconData" :key="item" :label="item" :value="item">
|
||||
<cb-svg-icon :icon-name="item"></cb-svg-icon>
|
||||
{{ item }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import elementIcons from './elementIcons'
|
||||
import svgIcons from './svgIcons'
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
model: {
|
||||
prop: 'iconName',
|
||||
event: 'change'
|
||||
},
|
||||
props: {
|
||||
iconName: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const iconData = [...svgIcons, ...elementIcons.map((item: any) => `el-icon-${item}`)]
|
||||
const change = (val: string) => {
|
||||
context.emit('change', val)
|
||||
}
|
||||
return {
|
||||
iconData,
|
||||
change
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-03 15:41:09
|
||||
* @LastEditTime: 2022-11-07 10:39:26
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\node_modules\@cmc\common\components\icon-select\svgIcons.ts
|
||||
*/
|
||||
|
||||
// webpack
|
||||
const req = require.context('@/icons/svg', false, /\.svg$/)
|
||||
const requireAll = (requireContext: any) => requireContext.keys()
|
||||
|
||||
const re = /\.\/(.*)\.svg/;
|
||||
|
||||
const svgIcons = requireAll(req).map((i: any) => {
|
||||
return i.match(re)[1]
|
||||
})
|
||||
// vite
|
||||
// const req = import.meta.globEager('/src/icons/svg/*.svg')
|
||||
// const re = /\/svg\/(.*)\.svg/
|
||||
// const svgIcons = Object.keys(req).map(i => {
|
||||
// return i.match(re)[1]
|
||||
// })
|
||||
|
||||
export default svgIcons
|
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-08 14:33:14
|
||||
* @LastEditTime: 2022-11-08 14:33:38
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\packages\common\components\if-tooltip\index.vue
|
||||
-->
|
||||
<template>
|
||||
<el-tooltip v-if="disabled" class="item" effect="dark" :content="content" placement="top-start">
|
||||
<span><slot></slot></span>
|
||||
</el-tooltip>
|
||||
<span v-else> <slot></slot></span>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
content: {
|
||||
type: String
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* database64文件格式转换为2进制
|
||||
*
|
||||
* @param {[String]} data dataURL 的格式为 “data:image/png;base64,****”,逗号之前都是一些说明性的文字,我们只需要逗号之后的就行了
|
||||
* @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);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
ia[i] = data.charCodeAt(i);
|
||||
};
|
||||
// canvas.toDataURL 返回的默认格式就是 image/png
|
||||
return new Blob([ia], {
|
||||
type: mime
|
||||
});
|
||||
};
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* 点击波纹效果
|
||||
*
|
||||
* @param {[event]} e [description]
|
||||
* @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;
|
||||
if (target) {
|
||||
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);
|
||||
} else {
|
||||
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;
|
||||
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.backgroundColor = opts.bgc;
|
||||
ripple.className = 'e-ripple z-active';
|
||||
return false;
|
||||
}
|
||||
};
|
|
@ -0,0 +1,365 @@
|
|||
export default {
|
||||
zh: {
|
||||
hint: '点击,或拖动图片至此处',
|
||||
loading: '正在上传……',
|
||||
noSupported: '浏览器不支持该功能,请使用IE10以上或其他现在浏览器!',
|
||||
success: '上传成功',
|
||||
fail: '图片上传失败',
|
||||
preview: '预览',
|
||||
btn: {
|
||||
off: '取消',
|
||||
close: '关闭',
|
||||
back: '上一步',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '仅限图片格式',
|
||||
outOfSize: '单文件大小不能超过 ',
|
||||
lowestPx: '图片最低像素为(宽*高):'
|
||||
}
|
||||
},
|
||||
'zh-tw': {
|
||||
hint: '點擊,或拖動圖片至此處',
|
||||
loading: '正在上傳……',
|
||||
noSupported: '瀏覽器不支持該功能,請使用IE10以上或其他現代瀏覽器!',
|
||||
success: '上傳成功',
|
||||
fail: '圖片上傳失敗',
|
||||
preview: '頭像預覽',
|
||||
btn: {
|
||||
off: '取消',
|
||||
close: '關閉',
|
||||
back: '上一步',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '僅限圖片格式',
|
||||
outOfSize: '單文件大小不能超過 ',
|
||||
lowestPx: '圖片最低像素為(寬*高):'
|
||||
}
|
||||
},
|
||||
en: {
|
||||
hint: 'Click or drag the file here to upload',
|
||||
loading: 'Uploading…',
|
||||
noSupported: 'Browser is not supported, please use IE10+ or other browsers',
|
||||
success: 'Upload success',
|
||||
fail: 'Upload failed',
|
||||
preview: 'Preview',
|
||||
btn: {
|
||||
off: 'Cancel',
|
||||
close: 'Close',
|
||||
back: 'Back',
|
||||
save: 'Save'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Image only',
|
||||
outOfSize: 'Image exceeds size limit: ',
|
||||
lowestPx: 'Image\'s size is too low. Expected at least: '
|
||||
}
|
||||
},
|
||||
ro: {
|
||||
hint: 'Atinge sau trage fișierul aici',
|
||||
loading: 'Se încarcă',
|
||||
noSupported: 'Browser-ul tău nu suportă acest feature. Te rugăm încearcă cu alt browser.',
|
||||
success: 'S-a încărcat cu succes',
|
||||
fail: 'A apărut o problemă la încărcare',
|
||||
preview: 'Previzualizează',
|
||||
|
||||
btn: {
|
||||
off: 'Anulează',
|
||||
close: 'Închide',
|
||||
back: 'Înapoi',
|
||||
save: 'Salvează'
|
||||
},
|
||||
|
||||
error: {
|
||||
onlyImg: 'Doar imagini',
|
||||
outOfSize: 'Imaginea depășește limita de: ',
|
||||
loewstPx: 'Imaginea este prea mică; Minim: '
|
||||
}
|
||||
},
|
||||
ru: {
|
||||
hint: 'Нажмите, или перетащите файл в это окно',
|
||||
loading: 'Загружаю……',
|
||||
noSupported: 'Ваш браузер не поддерживается, пожалуйста, используйте IE10 + или другие браузеры',
|
||||
success: 'Загрузка выполнена успешно',
|
||||
fail: 'Ошибка загрузки',
|
||||
preview: 'Предпросмотр',
|
||||
btn: {
|
||||
off: 'Отменить',
|
||||
close: 'Закрыть',
|
||||
back: 'Назад',
|
||||
save: 'Сохранить'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Только изображения',
|
||||
outOfSize: 'Изображение превышает предельный размер: ',
|
||||
lowestPx: 'Минимальный размер изображения: '
|
||||
}
|
||||
},
|
||||
'pt-br': {
|
||||
hint: 'Clique ou arraste o arquivo aqui para carregar',
|
||||
loading: 'Carregando…',
|
||||
noSupported: 'Browser não suportado, use o IE10+ ou outro browser',
|
||||
success: 'Sucesso ao carregar imagem',
|
||||
fail: 'Falha ao carregar imagem',
|
||||
preview: 'Pré-visualizar',
|
||||
btn: {
|
||||
off: 'Cancelar',
|
||||
close: 'Fechar',
|
||||
back: 'Voltar',
|
||||
save: 'Salvar'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Apenas imagens',
|
||||
outOfSize: 'A imagem excede o limite de tamanho: ',
|
||||
lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: '
|
||||
}
|
||||
},
|
||||
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.',
|
||||
success: 'Téléchargement réussit',
|
||||
fail: 'Téléchargement echoué',
|
||||
preview: 'Aperçu',
|
||||
btn: {
|
||||
off: 'Annuler',
|
||||
close: 'Fermer',
|
||||
back: 'Retour',
|
||||
save: 'Enregistrer'
|
||||
},
|
||||
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: '
|
||||
}
|
||||
},
|
||||
nl: {
|
||||
hint: 'Klik hier of sleep een afbeelding in dit vlak',
|
||||
loading: 'Uploaden…',
|
||||
noSupported: 'Je browser wordt helaas niet ondersteund. Gebruik IE10+ of een andere browser.',
|
||||
success: 'Upload succesvol',
|
||||
fail: 'Upload mislukt',
|
||||
preview: 'Voorbeeld',
|
||||
btn: {
|
||||
off: 'Annuleren',
|
||||
close: 'Sluiten',
|
||||
back: 'Terug',
|
||||
save: 'Opslaan'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Alleen afbeeldingen',
|
||||
outOfSize: 'De afbeelding is groter dan: ',
|
||||
lowestPx: 'De afbeelding is te klein! Minimale afmetingen: '
|
||||
}
|
||||
},
|
||||
tr: {
|
||||
hint: 'Tıkla veya yüklemek istediğini buraya sürükle',
|
||||
loading: 'Yükleniyor…',
|
||||
noSupported: 'Tarayıcı desteklenmiyor, lütfen IE10+ veya farklı tarayıcı kullanın',
|
||||
success: 'Yükleme başarılı',
|
||||
fail: 'Yüklemede hata oluştu',
|
||||
preview: 'Önizle',
|
||||
btn: {
|
||||
off: 'İptal',
|
||||
close: 'Kapat',
|
||||
back: 'Geri',
|
||||
save: 'Kaydet'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Sadece resim',
|
||||
outOfSize: 'Resim yükleme limitini aşıyor: ',
|
||||
lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: '
|
||||
}
|
||||
},
|
||||
'es-MX': {
|
||||
hint: 'Selecciona o arrastra una imagen',
|
||||
loading: 'Subiendo...',
|
||||
noSupported: 'Tu navegador no es soportado, por favor usa IE10+ u otros navegadores más recientes',
|
||||
success: 'Subido exitosamente',
|
||||
fail: 'Sucedió un error',
|
||||
preview: 'Vista previa',
|
||||
btn: {
|
||||
off: 'Cancelar',
|
||||
close: 'Cerrar',
|
||||
back: 'Atrás',
|
||||
save: 'Guardar'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Únicamente imágenes',
|
||||
outOfSize: 'La imagen excede el tamaño maximo:',
|
||||
lowestPx: 'La imagen es demasiado pequeña. Se espera por lo menos:'
|
||||
}
|
||||
},
|
||||
de: {
|
||||
hint: 'Klick hier oder zieh eine Datei hier rein zum Hochladen',
|
||||
loading: 'Hochladen…',
|
||||
noSupported: 'Browser wird nicht unterstützt, bitte verwende IE10+ oder andere Browser',
|
||||
success: 'Upload erfolgreich',
|
||||
fail: 'Upload fehlgeschlagen',
|
||||
preview: 'Vorschau',
|
||||
btn: {
|
||||
off: 'Abbrechen',
|
||||
close: 'Schließen',
|
||||
back: 'Zurück',
|
||||
save: 'Speichern'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Nur Bilder',
|
||||
outOfSize: 'Das Bild ist zu groß: ',
|
||||
lowestPx: 'Das Bild ist zu klein. Mindestens: '
|
||||
}
|
||||
},
|
||||
ja: {
|
||||
hint: 'クリック・ドラッグしてファイルをアップロード',
|
||||
loading: 'アップロード中...',
|
||||
noSupported: 'このブラウザは対応されていません。IE10+かその他の主要ブラウザをお使いください。',
|
||||
success: 'アップロード成功',
|
||||
fail: 'アップロード失敗',
|
||||
preview: 'プレビュー',
|
||||
btn: {
|
||||
off: 'キャンセル',
|
||||
close: '閉じる',
|
||||
back: '戻る',
|
||||
save: '保存'
|
||||
},
|
||||
error: {
|
||||
onlyImg: '画像のみ',
|
||||
outOfSize: '画像サイズが上限を超えています。上限: ',
|
||||
lowestPx: '画像が小さすぎます。最小サイズ: '
|
||||
}
|
||||
},
|
||||
ua: {
|
||||
hint: 'Натисніть, або перетягніть файл в це вікно',
|
||||
loading: 'Завантажую……',
|
||||
noSupported: 'Ваш браузер не підтримується, будь ласка скористайтесь IE10 + або іншими браузерами',
|
||||
success: 'Завантаження виконано успішно',
|
||||
fail: 'Помилка завантаження',
|
||||
preview: 'Попередній перегляд',
|
||||
btn: {
|
||||
off: 'Відмінити',
|
||||
close: 'Закрити',
|
||||
back: 'Назад',
|
||||
save: 'Зберегти'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Тільки зображення',
|
||||
outOfSize: 'Зображення перевищує граничний розмір: ',
|
||||
lowestPx: 'Мінімальний розмір зображення: '
|
||||
}
|
||||
},
|
||||
it: {
|
||||
hint: 'Clicca o trascina qui il file per caricarlo',
|
||||
loading: 'Caricamento del file…',
|
||||
noSupported: 'Browser non supportato, per favore usa IE10+ o un altro browser',
|
||||
success: 'Caricamento completato',
|
||||
fail: 'Caricamento fallito',
|
||||
preview: 'Anteprima',
|
||||
btn: {
|
||||
off: 'Annulla',
|
||||
close: 'Chiudi',
|
||||
back: 'Indietro',
|
||||
save: 'Salva'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Sono accettate solo immagini',
|
||||
outOfSize: 'L\'immagine eccede i limiti di dimensione: ',
|
||||
lowestPx: 'L\'immagine è troppo piccola. Il requisito minimo è: '
|
||||
}
|
||||
},
|
||||
ar: {
|
||||
hint: 'اضغط أو اسحب الملف هنا للتحميل',
|
||||
loading: 'جاري التحميل...',
|
||||
noSupported: 'المتصفح غير مدعوم ، يرجى استخدام IE10 + أو متصفح أخر',
|
||||
success: 'تم التحميل بنجاح',
|
||||
fail: 'فشل التحميل',
|
||||
preview: 'معاينه',
|
||||
btn: {
|
||||
off: 'إلغاء',
|
||||
close: 'إغلاق',
|
||||
back: 'رجوع',
|
||||
save: 'حفظ'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'صور فقط',
|
||||
outOfSize: 'تتجاوز الصوره الحجم المحدد: ',
|
||||
lowestPx: 'حجم الصورة صغير جدا. من المتوقع على الأقل: '
|
||||
}
|
||||
},
|
||||
ug: {
|
||||
hint: 'مەزكۇر دائىرىنى چىكىپ رەسىم تاللاڭ ياكى رەسىمنى سۆرەپ ئەكىرىڭ',
|
||||
loading: 'يوللىنىۋاتىدۇ...',
|
||||
noSupported: 'تور كۆرگۈچ بۇ ئىقتىدارنى قوللىمايدۇ ، يۇقىرى نەشىردىكى تور كۆرگۈچنى ئىشلىتىڭ',
|
||||
success: 'غەلبىلىك بولدى',
|
||||
fail: 'مەغلۇب بولدى',
|
||||
preview: 'ئۈنۈم رەسىم',
|
||||
btn: {
|
||||
off: 'بولدى قىلىش',
|
||||
close: 'تاقاش',
|
||||
back: 'ئالدىنقى قەدەم',
|
||||
save: 'ساقلاش'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'پەقەت رەسىم فورماتىنىلا قوللايدۇ',
|
||||
outOfSize: 'رەسىم چوڭ - كىچىكلىكى چەكتىن ئىشىپ كەتتى',
|
||||
lowestPx: 'رەسىمنىڭ ئەڭ كىچىك ئۆلچىمى :'
|
||||
}
|
||||
},
|
||||
th: {
|
||||
hint: 'คลิ๊กหรือลากรูปมาที่นี่',
|
||||
loading: 'กำลังอัพโหลด…',
|
||||
noSupported: 'เบราเซอร์ไม่รองรับ, กรุณาใช้ IE เวอร์ชั่น 10 ขึ้นไป หรือใช้เบราเซอร์ตัวอื่น',
|
||||
success: 'อัพโหลดสำเร็จ',
|
||||
fail: 'อัพโหลดล้มเหลว',
|
||||
preview: 'ตัวอย่าง',
|
||||
btn: {
|
||||
off: 'ยกเลิก',
|
||||
close: 'ปิด',
|
||||
back: 'กลับ',
|
||||
save: 'บันทึก'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'ไฟล์ภาพเท่านั้น',
|
||||
outOfSize: 'ไฟล์ใหญ่เกินกำหนด: ',
|
||||
lowestPx: 'ไฟล์เล็กเกินไป. อย่างน้อยต้องมีขนาด: '
|
||||
}
|
||||
},
|
||||
mm: {
|
||||
hint: 'ဖိုင်ကို ဤနေရာတွင် နှိပ်၍ (သို့) ဆွဲထည့်၍ တင်ပါ',
|
||||
loading: 'တင်နေသည်…',
|
||||
noSupported: 'ဤဘရောက်ဇာကို အထောက်အပံ့ မပေးပါ၊ ကျေးဇူးပြု၍ IE10+ သို့မဟုတ် အခြား ဘရောက်ဇာ ကို အသုံးပြုပါ',
|
||||
success: 'ဖိုင်တင်နေမှု မပြီးမြောက်ပါ',
|
||||
fail: 'ဖိုင်တင်နေမှု မအောင်မြင်ပါ',
|
||||
preview: 'အစမ်းကြည့်',
|
||||
btn: {
|
||||
off: 'မလုပ်တော့ပါ',
|
||||
close: 'ပိတ်မည်',
|
||||
back: 'နောက်သို့',
|
||||
save: 'သိမ်းမည်'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'ဓာတ်ပုံ သီးသန့်သာ',
|
||||
outOfSize: 'ဓာတ်ပုံဆိုဒ် ကြီးလွန်းသည် ။ အများဆုံး ဆိုဒ် : ',
|
||||
lowestPx: 'ဓာတ်ပုံဆိုဒ် သေးလွန်းသည်။ အနည်းဆုံး ဆိုဒ် : '
|
||||
}
|
||||
},
|
||||
se: {
|
||||
hint: 'Klicka eller dra en fil hit för att ladda upp den',
|
||||
loading: 'Laddar upp…',
|
||||
noSupported: 'Din webbläsare stöds inte, vänligen använd IE10+ eller andra webbläsare',
|
||||
success: 'Uppladdning lyckades',
|
||||
fail: 'Uppladdning misslyckades',
|
||||
preview: 'Förhandsgranska',
|
||||
btn: {
|
||||
off: 'Avbryt',
|
||||
close: 'Stäng',
|
||||
back: 'Tillbaka',
|
||||
save: 'Spara'
|
||||
},
|
||||
error: {
|
||||
onlyImg: 'Endast bilder',
|
||||
outOfSize: 'Bilden är större än max-gränsen: ',
|
||||
lowestPx: 'Bilden är för liten. Minimum är: '
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
export default {
|
||||
jpg: 'image/jpeg',
|
||||
png: 'image/png',
|
||||
gif: 'image/gif',
|
||||
svg: 'image/svg+xml',
|
||||
psd: 'image/photoshop'
|
||||
};
|
|
@ -0,0 +1,91 @@
|
|||
<template>
|
||||
<span>
|
||||
<el-button class="m-l-sm m-r-sm" @click.stop="openDialog" icon="el-icon-upload2" :disabled="disabled">导入 </el-button>
|
||||
<el-dialog title="导入Excel新增数据" :close-on-click-modal="false" :visible.sync="dialogVisible" width="480px" append-to-body>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-alert title="" type="warning" :closable="false">
|
||||
<template slot="">
|
||||
<div class="text-center">
|
||||
<p>您是否有标准的Excel模版,需要依照模版导入,否则会失败。</p>
|
||||
<a class="text-info cur-point" @click="exportData()">还没有Excel模版?请下载模版</a>
|
||||
</div>
|
||||
</template>
|
||||
</el-alert>
|
||||
</el-col>
|
||||
<el-col :span="24" class="text-center m-t">
|
||||
<el-upload ref="uploadRef" class="upload-demo" drag accept=".xlsx" :on-success="handleSuccess" :action="url" :headers="headers" :data="params">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传excel文件</div>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</span>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { downloadFile } from 'utils/index'
|
||||
import { getToken } from 'utils/auth'
|
||||
import { reactive, toRefs, ref, defineComponent } from 'vue'
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
templateUrl: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
params: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props: any, context: any) {
|
||||
const state = reactive({
|
||||
dialogVisible: false,
|
||||
headers: { token: getToken() }
|
||||
})
|
||||
const uploadRef = ref(null)
|
||||
function openDialog() {
|
||||
uploadRef.value && (uploadRef.value as any).clearFiles()
|
||||
state.dialogVisible = true
|
||||
state.headers.token = getToken()
|
||||
}
|
||||
// 导出数据
|
||||
function exportData() {
|
||||
downloadFile(props.templateUrl, props.params)
|
||||
}
|
||||
// 数据导入成功回调
|
||||
function handleSuccess(res: Base.IResponseData) {
|
||||
if (res.success) {
|
||||
Message.success(res.message)
|
||||
state.dialogVisible = false
|
||||
context.emit('getData')
|
||||
} else {
|
||||
Message.error(res.message)
|
||||
}
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
uploadRef,
|
||||
openDialog,
|
||||
exportData,
|
||||
handleSuccess
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-03 15:41:09
|
||||
* @LastEditTime: 2022-11-08 14:34:03
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\packages\common\components\index.js
|
||||
*/
|
||||
import Vue from 'vue'
|
||||
import TimeSelect from './TimeSelect.vue'
|
||||
import RichCharts from './rich-chart/index.vue'
|
||||
import SkuTable from './sku-table/index.vue'
|
||||
import WsUploadFile from './upload-file/index.vue'
|
||||
import IfTooltip from './if-tooltip/index.vue'
|
||||
const components = {
|
||||
TimeSelect,
|
||||
RichCharts,
|
||||
SkuTable,
|
||||
WsUploadFile,
|
||||
IfTooltip
|
||||
}
|
||||
Object.keys(components).forEach(key => {
|
||||
Vue.component(key, components[key]);
|
||||
})
|
|
@ -0,0 +1,140 @@
|
|||
<template>
|
||||
<el-card class="chart-card">
|
||||
<div slot="header" class="chart-header">
|
||||
<div>{{ title }}</div>
|
||||
<div class="operate">
|
||||
<el-radio-group v-model="chartType" size="mini" class="m-r-sm">
|
||||
<template v-if="defaultChart === 'loop-charts'">
|
||||
<el-radio-button label="loop-charts">环状</el-radio-button>
|
||||
<el-radio-button label="bar-charts">柱状</el-radio-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-radio-button label="line-charts">折线</el-radio-button>
|
||||
<el-radio-button label="bar-charts">柱状</el-radio-button>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
<el-button type="ghost" class="operate-btn" @click="enlarge">放大</el-button>
|
||||
<!-- <el-button type="ghost" class="operate-btn" @click="download">下载</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<slot></slot>
|
||||
<component ref="charts" :is="chartMap[chartType]" :setting="chartSetting" :data="getResData()" v-if="data" :theme="title" :id="chartId" :height="height" width="100%"></component>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" v-if="dialogVisible" fullscreen class="chart-dialog">
|
||||
<component :is="chartMap[chartType]" :setting="chartSetting" :data="getResData()" :theme="title" :id="`${chartId}dialog`" height="100%" width="100%"></component>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { downloadFile } from './tools'
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String
|
||||
},
|
||||
defaultChart: {
|
||||
type: String,
|
||||
default: 'loop-charts'
|
||||
},
|
||||
data: {
|
||||
type: [Object, Array]
|
||||
},
|
||||
setting: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '260px'
|
||||
},
|
||||
// 图片下载配置
|
||||
downloadOpt: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chartId: Math.random().toString(),
|
||||
chartType: '',
|
||||
dialogVisible: false,
|
||||
chartMap: {
|
||||
'pie-charts': 'cg-pie-charts',
|
||||
'bar-charts': 'cg-bar-charts',
|
||||
'line-charts': 'cg-line-charts',
|
||||
'loop-charts': 'cg-pie-charts'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
chartSetting() {
|
||||
const setting = {}
|
||||
if (this.chartType === 'pie-charts') setting.radius = '75%'
|
||||
return {
|
||||
...this.setting,
|
||||
...setting
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.chartType = this.defaultChart
|
||||
},
|
||||
methods: {
|
||||
// 处理环状图切换为柱状图
|
||||
getResData() {
|
||||
if (this.defaultChart === 'loop-charts' && this.chartType === 'bar-charts') {
|
||||
const keys = []
|
||||
const values = [
|
||||
{
|
||||
name: '统计数据',
|
||||
data: []
|
||||
}
|
||||
]
|
||||
this.data.forEach(item => {
|
||||
const { name, value } = item
|
||||
keys.push(name)
|
||||
values[0].data.push(value)
|
||||
})
|
||||
return {
|
||||
keys,
|
||||
values
|
||||
}
|
||||
}
|
||||
return this.data
|
||||
},
|
||||
enlarge() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
download() {
|
||||
const image = this.$refs.charts.chart.getDataURL(this.downloadOpt)
|
||||
downloadFile(this.downloadOpt.name || this.title, image)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.chart-card {
|
||||
.chart-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.operate {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
.operate-btn {
|
||||
padding: 7px 15px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-card__body {
|
||||
padding: 10px !important;
|
||||
}
|
||||
.chart-dialog {
|
||||
::v-deep .el-dialog__body {
|
||||
height: calc(100vh - 130px);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,25 @@
|
|||
function base64ToBlob(code) {
|
||||
const parts = code.split(';base64,')
|
||||
const contentType = parts[0].split(':')[1]
|
||||
const raw = window.atob(parts[1])
|
||||
const rawLength = raw.length
|
||||
|
||||
const uInt8Array = new Uint8Array(rawLength)
|
||||
|
||||
for (let i = 0; i < rawLength; ++i) {
|
||||
uInt8Array[i] = raw.charCodeAt(i)
|
||||
}
|
||||
return new Blob([uInt8Array], { type: contentType })
|
||||
}
|
||||
export const downloadFile = (fileName, content) => {
|
||||
const aLink = document.createElement('a')
|
||||
const blob = base64ToBlob(content) // new Blob([content]);
|
||||
|
||||
const evt = document.createEvent('HTMLEvents')
|
||||
evt.initEvent('click', true, true) // initEvent 不加后两个参数在FF下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为
|
||||
aLink.download = fileName
|
||||
aLink.href = URL.createObjectURL(blob)
|
||||
// aLink.dispatchEvent(evt);
|
||||
aLink.click()
|
||||
aLink.remove()
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<template>
|
||||
<div ref='editor' class="rich-editor"></div>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import WangEditor from 'wangeditor';
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
watch(() => props.value, () => {
|
||||
console.log(props.value)
|
||||
if (instance) {
|
||||
instance.txt.html(props.value);
|
||||
}
|
||||
});
|
||||
const editor = ref();
|
||||
let instance;
|
||||
onMounted(() => {
|
||||
instance = new WangEditor(editor.value);
|
||||
// Object.assign(instance.config, {
|
||||
// onchange(val) {
|
||||
// context.emit('change', val)
|
||||
// }
|
||||
// });
|
||||
instance.create();
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
instance.destroy();
|
||||
instance = null;
|
||||
});
|
||||
function getContent () {
|
||||
return editor.value.innerText
|
||||
}
|
||||
return {
|
||||
editor,
|
||||
getContent
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.rich-editor{
|
||||
position: relative;
|
||||
white-space: pre-line;
|
||||
z-index: 1 !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,334 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2017/11/25.
|
||||
*/
|
||||
<template>
|
||||
<el-form ref="crontForm" label-width="100px">
|
||||
<el-form-item label="定时规则:" class="m-b">
|
||||
<el-radio-group v-model="cronRule" @change="selectCustom">
|
||||
<el-radio-button label="check">勾选</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="appoint" v-model="minute.rule" @change="getMinuteCron">指定:</el-radio>
|
||||
</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-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="小时" name="hour">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="loop" @change="getCron('hour')" v-model="hour.rule">每小时</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="appoint" v-model="hour.rule" @change="getCron('hour')">指定:</el-radio>
|
||||
</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-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="天" name="day">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="loop" @change="getCron('day')" v-model="day.rule">每天</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="appoint" v-model="day.rule" @change="getCron('day')">指定:</el-radio>
|
||||
</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-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="月" name="month">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="loop" v-model="month.rule" @change="getCron('month')">每月</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-radio label="appoint" v-model="month.rule" @change="getCron('month')">指定:</el-radio>
|
||||
</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-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="星期" name="week">
|
||||
<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-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-col>
|
||||
<el-col :span="24">
|
||||
<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>
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form-item label="表达式:">
|
||||
<el-input readonly v-model="checkCron"></el-input>
|
||||
</el-form-item>
|
||||
<basic-form-item>
|
||||
{{ cronRemark }}
|
||||
</basic-form-item>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="cronRule=='custom'">
|
||||
<el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24" class="custom-cron">
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="表达式:">
|
||||
<el-input v-model="customCron"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<basic-form-item>
|
||||
{{ cronRemark }}
|
||||
</basic-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cronstrue from 'cronstrue/i18n'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
data: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
customCron: '',
|
||||
cronRule: 'check',
|
||||
activeName: 'minute',
|
||||
minute: {
|
||||
rule: 'loop',
|
||||
start: 1,
|
||||
end: 5,
|
||||
cron: '*',
|
||||
list: [],
|
||||
select: []
|
||||
},
|
||||
hour: {
|
||||
cron: '*',
|
||||
list: [],
|
||||
rule: 'loop',
|
||||
select: []
|
||||
},
|
||||
day: {
|
||||
list: [],
|
||||
cron: '*',
|
||||
rule: 'loop',
|
||||
select: []
|
||||
},
|
||||
month: {
|
||||
list: [],
|
||||
rule: 'loop',
|
||||
cron: '*',
|
||||
select: []
|
||||
},
|
||||
week: {
|
||||
isUsed: false,
|
||||
list: [],
|
||||
cron: '?',
|
||||
rule: 'loop',
|
||||
select: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
checkCron: function () {
|
||||
return '0 ' + this.minute.cron + ' ' + this.hour.cron + ' ' + this.day.cron + ' ' + this.month.cron + ' ' + this.week.cron
|
||||
},
|
||||
cron: function () {
|
||||
return this.cronRule == 'check' ? this.checkCron : this.customCron
|
||||
},
|
||||
cronRemark() {
|
||||
let result = ''
|
||||
try {
|
||||
result = `${cronstrue.toString(this.cron, { locale: 'zh_CN' })}执行`
|
||||
} catch (e) {
|
||||
}
|
||||
return result
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initData()
|
||||
this.getMinuteCron()
|
||||
if (this.data) this.displayData(this.data)
|
||||
},
|
||||
methods: {
|
||||
displayData (value) { // 数据回现
|
||||
const arr = value.split(' ')
|
||||
this.minute.cron = arr[1]
|
||||
this.hour.cron = arr[2]
|
||||
this.day.cron = arr[3]
|
||||
this.month.cron = arr[4]
|
||||
this.week.cron = arr[5]
|
||||
// 分钟
|
||||
if (arr[1].indexOf('/') > -1) {
|
||||
this.minute.rule = 'loop'
|
||||
const item = arr[1].split('/')
|
||||
this.minute.start = item[0]
|
||||
this.minute.end = item[1]
|
||||
} else {
|
||||
this.minute.rule = 'appoint'
|
||||
this.minute.select = arr[1].split(',')
|
||||
}
|
||||
|
||||
const obj = ['hour', 'day', 'month', 'week']
|
||||
obj.forEach((item, key) => {
|
||||
const data = this[item]
|
||||
if (data.cron === '*') {
|
||||
data.rule = 'loop'
|
||||
} else {
|
||||
data.rule = 'appoint'
|
||||
data.select = arr[key + 2].split(',')
|
||||
}
|
||||
})
|
||||
console.log(this.week)
|
||||
if (this.week.cron !== '?') {
|
||||
this.week.isUsed = true
|
||||
}
|
||||
},
|
||||
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())
|
||||
for (let i = 1; i <= 12; i++) this.month.list.push(i.toString())
|
||||
for (let i = 1; i <= 7; i++) this.week.list.push(i.toString())
|
||||
},
|
||||
// 处理分钟输入数据
|
||||
handleInputValue () {
|
||||
const start = parseInt(Math.abs(this.minute.start))
|
||||
let end = parseInt(Math.abs(this.minute.end))
|
||||
this.minute.start = start > 59 ? 59 : start
|
||||
end = end > 59 ? 59 : end
|
||||
if (end === 0) end = 5
|
||||
this.minute.end = end
|
||||
},
|
||||
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) { // 小时、天、月
|
||||
const item = this[type]
|
||||
if (item.rule == 'loop') {
|
||||
item.cron = '*'
|
||||
} else item.cron = item.select.sort().join(',') || '*'
|
||||
if (type == 'day') { // 选择天时重置星期
|
||||
this.week.isUsed = false
|
||||
this.week.cron = '?'
|
||||
}
|
||||
},
|
||||
switchWeek () {
|
||||
if (this.week.isUsed) {
|
||||
this.day.cron = '?'
|
||||
this.week.cron = '*'
|
||||
this.week.select = []
|
||||
console.log(this.week)
|
||||
} else {
|
||||
this.week.cron = '?'
|
||||
this.getCron('day')
|
||||
}
|
||||
},
|
||||
makeCron () {
|
||||
|
||||
},
|
||||
selectCustom () {
|
||||
this.customCron = this.checkCron
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
weekFilter (value) {
|
||||
const obj = ['', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
|
||||
return obj[value]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.border {
|
||||
border: 1px solid #eee;
|
||||
padding: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.w-label {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.custom-cron {
|
||||
background: url('../../assets/rule.png') center center no-repeat;
|
||||
width: 100%;
|
||||
height: 253px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.minute-input {
|
||||
width: 130px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,222 @@
|
|||
/**
|
||||
* 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="">
|
||||
</cb-form-item>
|
||||
<el-dialog title="选择图标" :close-on-click-modal="false" v-if="dialogVisible" :visible.sync="dialogVisible" width="50%" append-to-body>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-alert title="提示" type="success" :closable="false">
|
||||
<template slot="">
|
||||
<span>没有您喜欢的图标,可以尝试上传一个新的图标。</span>
|
||||
<el-button type="primary" size="mini" class="cur-point" @click="uploadVisible = true">上传</el-button>
|
||||
</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>
|
||||
<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="">
|
||||
<i class="remove" v-show="!item.reserved" @click.stop="handleDelete(item)">×</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>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click.native="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click.native="save">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, ref } from 'vue'
|
||||
import useTable from 'hooks/useTable'
|
||||
import { getIcon, removeIcon, baseUrl } from './services'
|
||||
import ImageCropper from 'components/image-cropper/index.vue'
|
||||
import { getToken } from 'utils/auth'
|
||||
import { Message } from 'element-ui'
|
||||
import { useSet } from '@cmp/cmp-core'
|
||||
export default {
|
||||
components: {
|
||||
ImageCropper
|
||||
},
|
||||
props: {
|
||||
addData: {
|
||||
type: Object
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 65
|
||||
},
|
||||
param: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
category: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const { total, params, list, getList, handleDelete } = useTable({
|
||||
getService: getIcon,
|
||||
removeService: removeIcon,
|
||||
rows: 20,
|
||||
initParams: {
|
||||
category: props.category
|
||||
}
|
||||
})
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const set = useSet()
|
||||
const currentSelectIcon = reactive({
|
||||
id: '',
|
||||
icon: ''
|
||||
})
|
||||
|
||||
function selectIcon() {
|
||||
if (props.disabled) return
|
||||
dialogVisible.value = true
|
||||
const { iconId, icon } = props.addData
|
||||
currentSelectIcon.id = iconId
|
||||
currentSelectIcon.icon = icon
|
||||
getList()
|
||||
}
|
||||
|
||||
// 选择图标
|
||||
function selectItem(item) {
|
||||
if (item.checked) return
|
||||
list.value.forEach((row) => {
|
||||
set(row, 'checked', false)
|
||||
})
|
||||
item.checked = true
|
||||
const { id, icon } = item
|
||||
currentSelectIcon.id = id
|
||||
currentSelectIcon.icon = icon
|
||||
}
|
||||
|
||||
function save() {
|
||||
const { id, icon } = currentSelectIcon
|
||||
if (!id) return Message.error('请选择图标')
|
||||
set(props.addData, 'iconId', id)
|
||||
set(props.addData, 'icon', icon)
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
const uploadVisible = ref(false)
|
||||
|
||||
function imageUploaded(res) {
|
||||
if (res.success) {
|
||||
uploadVisible.value = false
|
||||
getList()
|
||||
} else {
|
||||
Message.error(res.message)
|
||||
}
|
||||
}
|
||||
return {
|
||||
baseUrl,
|
||||
params,
|
||||
list,
|
||||
total,
|
||||
getList,
|
||||
handleDelete,
|
||||
selectIcon,
|
||||
dialogVisible,
|
||||
selectItem,
|
||||
save,
|
||||
uploadVisible,
|
||||
imageUploaded,
|
||||
getToken
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.model-icon {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
&.disabled{
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
div.icon-cell {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
border-radius: 10px;
|
||||
margin: 10px 10px 0 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.icon-cell > span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.icon-cell.selected > span {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
border: 1px dashed #8e7070;
|
||||
border-radius: 10px;
|
||||
line-height: 65px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.icon-cell.selected i.icon-ok {
|
||||
position: relative;
|
||||
left: 20px;
|
||||
top: 20px;
|
||||
color: #27c24c;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
i.remove {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.icon-cell:hover > i.remove {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: -11px;
|
||||
right: -8px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: rgba(0, 0, 0, 0.64);
|
||||
border-radius: 8px;
|
||||
font-size: 20px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
padding: -2px;
|
||||
}
|
||||
|
||||
div.icon-cell img {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,2 @@
|
|||
import SelectIcon from './SelectIcon.vue'
|
||||
export default SelectIcon
|
|
@ -0,0 +1,10 @@
|
|||
import request from 'utils/request'
|
||||
|
||||
export const baseUrl = '/sms/v1/icon'
|
||||
export function getIcon(params: Base.IListParams) {
|
||||
return request.get(baseUrl, { params })
|
||||
}
|
||||
|
||||
export function removeIcon(id: number) {
|
||||
return request.delete(`${baseUrl}/${id}`)
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
<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 show-overflow-tooltip label="参考价格" v-if="showPrice">
|
||||
<template v-slot="scope">
|
||||
{{getPrice(scope.row, mode)}} 元/ {{modeUnitFilter(mode)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<slot name="append"></slot>
|
||||
<div slot="pagination"></div>
|
||||
</basic-table>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { getPrice, modeUnitFilter } from './utils'
|
||||
interface IColumnProps {
|
||||
label: string,
|
||||
value: string
|
||||
}
|
||||
type IProps = {
|
||||
skus: any[],
|
||||
mode: string,
|
||||
columnProps: IColumnProps[]
|
||||
}
|
||||
export default defineComponent({
|
||||
props: {
|
||||
skus: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'Hour'
|
||||
},
|
||||
showPrice: {
|
||||
default: false
|
||||
},
|
||||
columnProps: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return [
|
||||
{
|
||||
label: 'CPU(核)',
|
||||
value: 'cpu'
|
||||
},
|
||||
{
|
||||
label: '内存(GB)',
|
||||
value: 'memory'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
setup(props:IProps, context:any) {
|
||||
const specList = computed(() => {
|
||||
return props.skus.map((item:any) => {
|
||||
const result:any = {}
|
||||
item.spec.forEach((cell:any) => {
|
||||
result[cell.specName] = Number(cell.specValue)
|
||||
})
|
||||
return { ...item, ...result }
|
||||
})
|
||||
})
|
||||
// 规格高度的计算
|
||||
const tableProps = computed(() => {
|
||||
const [{ value } = { value: '' }] = props.columnProps;
|
||||
const prop: any = {
|
||||
defaultSort: {
|
||||
prop: value
|
||||
}
|
||||
}
|
||||
const length = props.skus.length
|
||||
if (length >= 6) {
|
||||
prop.height = '260'
|
||||
}
|
||||
return prop
|
||||
})
|
||||
return {
|
||||
specList,
|
||||
tableProps,
|
||||
getPrice,
|
||||
modeUnitFilter
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
export function modeUnitFilter(value:string) {
|
||||
const map: any = {
|
||||
HOUR: '小时',
|
||||
MONTH: '月',
|
||||
YEAR: '年'
|
||||
}
|
||||
return map[value]
|
||||
}
|
||||
export function getPrice(sku:any, mode:string) {
|
||||
const { spec, billPolicy, billable } = sku;
|
||||
// 不开启计费
|
||||
if (!billable) return 0;
|
||||
const key = `${mode.toLowerCase()}Price`
|
||||
// 规格计费
|
||||
if (billPolicy !== 'agility') return sku[key];
|
||||
const basicPrice = JSON.parse(sku.basicPrice);
|
||||
// 没有specName说明没有规格设置
|
||||
const flag = spec.every((item:any) => !item.specName || item.specValue);
|
||||
// 无值直接返回
|
||||
if (!flag) return '/';
|
||||
// 获取数值map
|
||||
const countMap:any = {};
|
||||
spec.forEach((item:any) => {
|
||||
countMap[item.specName] = item.specValue;
|
||||
})
|
||||
let totalPrice = 0;
|
||||
basicPrice.forEach((item:any) => {
|
||||
const { specName } = item;
|
||||
totalPrice += item[key] * (countMap[specName] || 1)
|
||||
});
|
||||
return totalPrice;
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<template>
|
||||
<div class="top-container">
|
||||
<div class="top-cell" v-for="(item, index) in data" :key="`item.name${index}`">
|
||||
<div class="cell-icon" :class="`icon-${index}`">{{ index + 1 }}</div>
|
||||
<el-tooltip :content="item.name">
|
||||
<div class="cell-title">{{ item.name }}</div>
|
||||
</el-tooltip>
|
||||
<div class="cell-progress">
|
||||
<div :style="{ width: `${item.percent}%` }"></div>
|
||||
</div>
|
||||
<div class="cell-number">{{ item.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.top-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
height: 100%;
|
||||
.top-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.cell-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 8px;
|
||||
background: #cacaca;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 15px;
|
||||
&.icon-0 {
|
||||
background: #e03b3b;
|
||||
}
|
||||
&.icon-1 {
|
||||
background: #f09c2b;
|
||||
}
|
||||
&.icon-2 {
|
||||
background: #4076e2;
|
||||
}
|
||||
}
|
||||
.cell-title {
|
||||
color: #393b3e;
|
||||
width: 95px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.cell-progress {
|
||||
height: 15px;
|
||||
background: #f2f4f8;
|
||||
border-radius: 8px;
|
||||
flex: 1;
|
||||
margin: 0 12px;
|
||||
position: relative;
|
||||
div {
|
||||
height: 100%;
|
||||
border-radius: 8px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #3e74f8;
|
||||
}
|
||||
}
|
||||
.cell-number {
|
||||
color: #707274;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,108 @@
|
|||
<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%">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from 'utils/uploadFile';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
fileType: {
|
||||
type: String
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default: 'btnFileUpload'
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: '文件上传:'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
file: null,
|
||||
isShowUploadFile: true,
|
||||
uploadSuccess: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
},
|
||||
mounted () {
|
||||
const self = this;
|
||||
document.getElementById(this.id).addEventListener('change', function (event) {
|
||||
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,
|
||||
name: file.name,
|
||||
isUploading: false,
|
||||
isCancel: false,
|
||||
isReady: false,
|
||||
isSuccess: false,
|
||||
progress: 0
|
||||
};
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
submitUpload (file) {
|
||||
if (file == undefined || file == null) {
|
||||
return this.$message.error('请选择上传文件');
|
||||
}
|
||||
if (/[\u4e00-\u9fa5\s]/.test(file.name)) {
|
||||
return this.$message.error('文件名不允许存在中文和空格');
|
||||
}
|
||||
if (this.fileType == 'EXCEL') {
|
||||
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'
|
||||
) {
|
||||
flag = true
|
||||
} else {
|
||||
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);
|
||||
},
|
||||
message (item) {
|
||||
this.$message({
|
||||
message: '上传成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.uploadSuccess = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,220 @@
|
|||
/* eslint-disable */
|
||||
import { saveAs } from 'file-saver'
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
function generateArray(table) {
|
||||
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');
|
||||
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;
|
||||
|
||||
//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);
|
||||
}
|
||||
});
|
||||
|
||||
//Handle Row Span
|
||||
if (rowspan || colspan) {
|
||||
rowspan = rowspan || 1;
|
||||
colspan = colspan || 1;
|
||||
ranges.push({
|
||||
s: {
|
||||
r: R,
|
||||
c: outRow.length
|
||||
},
|
||||
e: {
|
||||
r: R + rowspan - 1,
|
||||
c: outRow.length + colspan - 1
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//Handle Value
|
||||
outRow.push(cellValue !== "" ? cellValue : null);
|
||||
|
||||
//Handle Colspan
|
||||
if (colspan)
|
||||
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
||||
}
|
||||
out.push(outRow);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
function sheet_from_array_of_arrays(data, opts) {
|
||||
var ws = {};
|
||||
var range = {
|
||||
s: {
|
||||
c: 10000000,
|
||||
r: 10000000
|
||||
},
|
||||
e: {
|
||||
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;
|
||||
var cell = {
|
||||
v: data[R][C]
|
||||
};
|
||||
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';
|
||||
else if (cell.v instanceof Date) {
|
||||
cell.t = 'n';
|
||||
cell.z = XLSX.SSF._table[14];
|
||||
cell.v = datenum(cell.v);
|
||||
} else cell.t = 's';
|
||||
|
||||
ws[cell_ref] = cell;
|
||||
}
|
||||
}
|
||||
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 = {};
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
export function export_table_to_excel(id) {
|
||||
var theTable = document.getElementById(id);
|
||||
var oo = generateArray(theTable);
|
||||
var ranges = oo[1];
|
||||
|
||||
/* original data */
|
||||
var data = oo[0];
|
||||
var ws_name = "SheetJS";
|
||||
|
||||
var wb = new Workbook(),
|
||||
ws = sheet_from_array_of_arrays(data);
|
||||
|
||||
/* add ranges to worksheet */
|
||||
// ws['!cols'] = ['apple', 'banan'];
|
||||
ws['!merges'] = ranges;
|
||||
|
||||
/* add worksheet to workbook */
|
||||
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")
|
||||
}
|
||||
|
||||
export function exportJsonToExcel({
|
||||
multiHeader = [],
|
||||
header,
|
||||
data,
|
||||
filename,
|
||||
merges = [],
|
||||
autoWidth = true,
|
||||
bookType = 'xlsx'
|
||||
} = {}) {
|
||||
/* original data */
|
||||
filename = filename || 'excel-list'
|
||||
data = [...data]
|
||||
data.unshift(header);
|
||||
|
||||
for (let i = multiHeader.length - 1; i > -1; i--) {
|
||||
data.unshift(multiHeader[i])
|
||||
}
|
||||
|
||||
var ws_name = "SheetJS";
|
||||
var wb = new Workbook(),
|
||||
ws = sheet_from_array_of_arrays(data);
|
||||
|
||||
if (merges.length > 0) {
|
||||
if (!ws['!merges']) ws['!merges'] = [];
|
||||
merges.forEach(item => {
|
||||
ws['!merges'].push(XLSX.utils.decode_range(item))
|
||||
})
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
}
|
||||
}))
|
||||
/*以第一行为初始值*/
|
||||
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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
/* add worksheet to workbook */
|
||||
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}`);
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2017/8/24.
|
||||
* axios#request(config)
|
||||
* axios#get(url[, config])
|
||||
* axios#delete(url[, config])
|
||||
* axios#head(url[, config])
|
||||
* axios#options(url[, config])
|
||||
* axios#post(url[, data[, config]])
|
||||
* axios#put(url[, data[, config]])
|
||||
* axios#patch(url[, data[, config]])
|
||||
*/
|
||||
import axios from 'axios'
|
||||
import qs from 'qs'
|
||||
|
||||
const codeMessage = {
|
||||
200: '服务器成功返回请求的数据。',
|
||||
201: '新建或修改数据成功。',
|
||||
202: '一个请求已经进入后台排队(异步任务)。',
|
||||
204: '删除数据成功。',
|
||||
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
||||
401: '用户没有权限(令牌、用户名、密码错误)。',
|
||||
403: '用户得到授权,但是访问是被禁止的。',
|
||||
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
||||
406: '请求的格式不可得。',
|
||||
410: '请求的资源被永久删除,且不会再得到的。',
|
||||
422: '当创建一个对象时,发生一个验证错误。',
|
||||
500: '服务器发生错误,请检查服务器。',
|
||||
502: '网关错误。',
|
||||
503: '服务不可用,服务器暂时过载或维护。',
|
||||
504: '网关超时。'
|
||||
}
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: '/api',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded', BsmAjaxHeader: true },
|
||||
timeout: 20000,
|
||||
paramsSerializer: params => {
|
||||
return qs.stringify(params, { arrayFormat: 'indices' })
|
||||
}
|
||||
})
|
||||
// 请求完成回调
|
||||
const finishCallback = function () {
|
||||
}
|
||||
// 报错处理
|
||||
const handleError = function (response) {
|
||||
if (!response) return // 容错处理
|
||||
const errorText = codeMessage[response.status] || response.statusText
|
||||
// Notification({
|
||||
// type: 'error',
|
||||
// title: `请求错误 ${response.status}: ${response.config.url}`,
|
||||
// message: errorText
|
||||
// })
|
||||
const error = new Error(errorText)
|
||||
error.name = response.status
|
||||
error.response = response
|
||||
throw error
|
||||
}
|
||||
axiosInstance.interceptors.request.use(
|
||||
config => {
|
||||
const {
|
||||
headers: { options = {} }
|
||||
} = config
|
||||
if (config.method === 'get') {
|
||||
// 清除get缓存
|
||||
config.url = `${config.url}?t=${new Date().getTime()}`
|
||||
}
|
||||
config.headers.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlLZXkiOiIxMjE0NTQ2NzgyIiwiY2F0YWxvZyI6Ik1hbmFnZXIiLCJuYW1lIjoi6LaF57qn566h55CG5ZGYIiwiZXhwIjoxNjIzODI5OTA1LCJ1dWlkIjoxLCJhY2NvdW50IjoiYWRtaW4ifQ.H1TLrKni0z4xp3M55SUbUyLImgELqrZhCYrPXoKmucY'
|
||||
delete config.headers.options
|
||||
config.options = options
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
axiosInstance.interceptors.response.use(
|
||||
data => {
|
||||
// const requestKey = getRequestIdentify(data.config);
|
||||
// removePending(requestKey);
|
||||
finishCallback()
|
||||
const responseData = data.data
|
||||
const { options } = data.config
|
||||
if (!responseData.success) {
|
||||
switch (responseData.status) {
|
||||
case '402':
|
||||
location.href = '/#/license'
|
||||
break
|
||||
case '401':
|
||||
case '509':
|
||||
break
|
||||
default:
|
||||
}
|
||||
if (!options.ignoreError) {
|
||||
}
|
||||
}
|
||||
return responseData
|
||||
},
|
||||
error => {
|
||||
finishCallback()
|
||||
handleError(error.response)
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
export default axiosInstance
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* Created by HaijunZhang on 2018/12/10.
|
||||
*/
|
||||
import path from 'path';
|
||||
export function isExternalLink (path) {
|
||||
return /^(http:|https:|mailto:|tel:)\/\//.test(path);
|
||||
}
|
||||
export function resolvePath (basePath, routePath) {
|
||||
if (isExternalLink(routePath)) {
|
||||
return routePath;
|
||||
}
|
||||
return path.resolve(basePath, routePath);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2021/2/2.
|
||||
*/
|
||||
// 查询参数封装优化
|
||||
export function handleSearchParam (params) {
|
||||
// 设置参数
|
||||
const objParams = {}
|
||||
function setParams (sign, key, value) {
|
||||
if (objParams[sign]) {
|
||||
objParams[sign][key] = value
|
||||
} else {
|
||||
objParams[sign] = {
|
||||
[key]: value
|
||||
}
|
||||
}
|
||||
}
|
||||
// 将参数处理为对象
|
||||
for (const a in params) {
|
||||
const value = params[a]
|
||||
// 对参数进行处理,去除空参数
|
||||
if (value === '' || value === undefined || value === null) continue
|
||||
// 对key值进行处理
|
||||
const [key, sign = 'EQ'] = a.split(':')
|
||||
// 将sign全部转换为大写
|
||||
const signs = sign.toLocaleUpperCase()
|
||||
if (signs === 'RANGE') {
|
||||
const [first, second] = value
|
||||
setParams('GET', key, first)
|
||||
setParams('LET', key, second)
|
||||
continue
|
||||
}
|
||||
setParams(signs, key, value)
|
||||
}
|
||||
const result = []
|
||||
for (const a in objParams) {
|
||||
result.push({ param: objParams[a], sign: a })
|
||||
}
|
||||
return JSON.stringify(result)
|
||||
}
|
||||
/**
|
||||
* 判断字符类型
|
||||
* @param {*} word 字符
|
||||
* @returns 0:中文, 1: 英文, 2:数字, 3: 其他类型
|
||||
*/
|
||||
export const getWordType = (word) => {
|
||||
// 验证是否是中文
|
||||
const pattern0 = new RegExp('[\u4E00-\u9FA5]+');
|
||||
// 验证是否是英文
|
||||
const pattern1 = new RegExp('[A-Za-z]+');
|
||||
// 验证是否是数字
|
||||
const pattern2 = new RegExp('[0-9]+');
|
||||
|
||||
if (pattern0.test(word)) {
|
||||
return 0
|
||||
} else if (pattern1.test(word)) {
|
||||
return 1
|
||||
} else if (pattern2.test(word)) {
|
||||
return 2
|
||||
} else {
|
||||
return 3
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/* Color
|
||||
-------------------------- */
|
||||
|
||||
$--color-primary: #1E54D5;
|
|
@ -0,0 +1,61 @@
|
|||
.buy-btn {
|
||||
position: fixed;
|
||||
top: 58px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.el-message-box__message {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.viewer-container.viewer-backdrop {
|
||||
z-index: 99999999999999 !important;
|
||||
}
|
||||
|
||||
.w {
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.el-drawer.rtl {
|
||||
overflow: auto
|
||||
}
|
||||
|
||||
.tab-label-padding {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.target-table .el-form-item.is-error {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.full-height {
|
||||
height: 100%;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
/* 改变主题色变量 */
|
||||
|
||||
@import './common-var';
|
||||
|
||||
/* 改变 icon 字体路径变量,必需 */
|
||||
|
||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||
@import"~element-ui/packages/theme-chalk/src/index"
|
|
@ -0,0 +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;
|
||||
.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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
@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;
|
||||
} */
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--color-primary: #{$--color-primary}
|
||||
}
|
||||
|
||||
@import './lib/index';
|
||||
@import './hack.scss';
|
||||
@import './font.scss';
|
||||
@import './common.scss';
|
|
@ -0,0 +1,29 @@
|
|||
.el-button--text {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.el-button.el-button--text [class*=el-icon-]+span {
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.el-button--ghost {
|
||||
color: #666;
|
||||
background-color: #fff;
|
||||
border-color: #d9d9d9;
|
||||
}
|
||||
|
||||
.el-button--ghost:focus,
|
||||
.el-button--ghost:hover {
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,818 @@
|
|||
html,
|
||||
body,
|
||||
#app {
|
||||
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%;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.wrapper>.el-card__body {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.wrapper-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.wrapper-sm {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
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-content>.search-item {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
margin-top: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background-color: #fff;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #dee5e7;
|
||||
}
|
||||
|
||||
.panel .panel-heading {
|
||||
background-color: #edf1f2;
|
||||
padding: 10px 15px;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.panel .panel-body {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
|
||||
/*边距共有样式*/
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.pull-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.p-none {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.m-xxs {
|
||||
margin: 2px 4px;
|
||||
}
|
||||
|
||||
.m-xs {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.m-sm {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.m {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.m-md {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.m-lg {
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.m-xl {
|
||||
margin: 50px;
|
||||
}
|
||||
|
||||
.m-n {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.m-l-none {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.m-l-xs {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.m-l-sm {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.m-l {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.m-l-md {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.m-l-lg {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.m-l-xl {
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.m-l-xxl {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.m-l-n-xxs {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
.m-l-n-xs {
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.m-l-n-sm {
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
.m-l-n {
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
.m-l-n-md {
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
||||
.m-l-n-lg {
|
||||
margin-left: -30px;
|
||||
}
|
||||
|
||||
.m-l-n-xl {
|
||||
margin-left: -40px;
|
||||
}
|
||||
|
||||
.m-l-n-xxl {
|
||||
margin-left: -50px;
|
||||
}
|
||||
|
||||
.m-t-none {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.m-t-xxs {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.m-t-xs {
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
|
||||
.m-t-sm {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.m-t {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.m-t-md {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.m-t-lg {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.m-t-xl {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.m-t-xxl {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.m-t-n-xxs {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.m-t-n-xs {
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.m-t-n-7 {
|
||||
margin-top: -7px;
|
||||
}
|
||||
|
||||
.m-t-n-sm {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
.m-t-n {
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.m-t-n-md {
|
||||
margin-top: -20px;
|
||||
}
|
||||
|
||||
.m-t-n-lg {
|
||||
margin-top: -30px;
|
||||
}
|
||||
|
||||
.m-t-n-xl {
|
||||
margin-top: -40px;
|
||||
}
|
||||
|
||||
.m-t-n-xxl {
|
||||
margin-top: -50px;
|
||||
}
|
||||
|
||||
.m-t-n-xxxl {
|
||||
margin-top: -60px;
|
||||
}
|
||||
|
||||
.m-r-none {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.m-r-xxs {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.m-r-xs {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.m-r-sm {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.m-r {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
|
||||
.m-r-md {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.m-r-lg {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.m-r-xl {
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.m-r-xxl {
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
.m-r-n-xxs {
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
.m-r-n-xs {
|
||||
margin-right: -5px;
|
||||
}
|
||||
|
||||
.m-r-n-sm {
|
||||
margin-right: -10px;
|
||||
}
|
||||
|
||||
.m-r-n {
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
.m-r-n-md {
|
||||
margin-right: -20px;
|
||||
}
|
||||
|
||||
.m-r-n-lg {
|
||||
margin-right: -30px;
|
||||
}
|
||||
|
||||
.m-r-n-xl {
|
||||
margin-right: -40px;
|
||||
}
|
||||
|
||||
.m-r-n-xxl {
|
||||
margin-right: -50px;
|
||||
}
|
||||
|
||||
.m-b-none {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.m-b-xxs {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.m-b-xs {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.m-b-sm {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.m-b {
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
|
||||
.m-b-md {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.m-b-lg {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.m-b-xl {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.m-b-xxl {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.m-b-n-xxs {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.m-b-n-xs {
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
|
||||
.m-b-n-sm {
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
.m-b-n {
|
||||
margin-bottom: -15px;
|
||||
}
|
||||
|
||||
.m-b-n-md {
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
.m-b-n-lg {
|
||||
margin-bottom: -30px;
|
||||
}
|
||||
|
||||
.m-b-n-xl {
|
||||
margin-bottom: -40px;
|
||||
}
|
||||
|
||||
.m-b-n-xxl {
|
||||
margin-bottom: -50px;
|
||||
}
|
||||
|
||||
|
||||
/*颜色共有样式*/
|
||||
|
||||
.btn-info {
|
||||
color: #ffffff !important;
|
||||
background-color: #497edf;
|
||||
border-color: #497edf;
|
||||
}
|
||||
|
||||
.btn-info:hover,
|
||||
.btn-info:focus,
|
||||
.btn-info:active,
|
||||
.btn-info.active,
|
||||
.open .dropdown-toggle.btn-info {
|
||||
color: #ffffff !important;
|
||||
background-color: #2059c1;
|
||||
border-color: #2059c1;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
color: #ffffff !important;
|
||||
background-color: #27c24c;
|
||||
border-color: #27c24c;
|
||||
}
|
||||
|
||||
.btn-success:hover,
|
||||
.btn-success:focus,
|
||||
.btn-success:active,
|
||||
.btn-success.active,
|
||||
.open .dropdown-toggle.btn-success {
|
||||
color: #ffffff !important;
|
||||
background-color: #23ad44;
|
||||
border-color: #20a03f;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
color: #ffffff !important;
|
||||
background-color: #f05050;
|
||||
border-color: #f05050;
|
||||
}
|
||||
|
||||
.btn-danger:hover,
|
||||
.btn-danger:focus,
|
||||
.btn-danger:active,
|
||||
.btn-danger.active,
|
||||
.open .dropdown-toggle.btn-danger {
|
||||
color: #ffffff !important;
|
||||
background-color: #ee3939;
|
||||
border-color: #ed2a2a;
|
||||
}
|
||||
|
||||
.text-info {
|
||||
color: #00aeef !important;
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: #27c24c !important;
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: #fad733 !important;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: #f05050 !important;
|
||||
}
|
||||
|
||||
.text-white {
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
|
||||
/*宽度样式*/
|
||||
|
||||
.w-xxs {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.w-xs {
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.w-110 {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.w-ss {
|
||||
width: 120px !important;
|
||||
}
|
||||
|
||||
.w-sm {
|
||||
width: 150px !important;
|
||||
}
|
||||
|
||||
.w {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.w-md {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.w-lg {
|
||||
width: 280px !important;
|
||||
}
|
||||
|
||||
.w-xl {
|
||||
width: 320px !important;
|
||||
}
|
||||
|
||||
.w-xxl {
|
||||
width: 360px;
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.w-auto {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.upload-file-btn {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/*详情表格*/
|
||||
|
||||
.detail-box {
|
||||
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;
|
||||
}
|
||||
|
||||
.detail-href {
|
||||
color: $--color-primary !important;
|
||||
cursor: pointer;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.detail-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.detail-table td.title {
|
||||
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;*/
|
||||
}
|
||||
|
||||
.border-top-none {
|
||||
border-top: none !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bounce-enter-active,
|
||||
.bounce-leave-active,
|
||||
.bounceDown-enter-active,
|
||||
.bounceDown-leave-active,
|
||||
.bounceIn,
|
||||
.bounceInDown,
|
||||
.bounceInLeft,
|
||||
.bounceInRight,
|
||||
.bounceInUp,
|
||||
.bounceLeft-enter-active,
|
||||
.bounceLeft-leave-active,
|
||||
.bounceOut,
|
||||
.bounceOutDown,
|
||||
.bounceOutLeft,
|
||||
.bounceOutRight,
|
||||
.bounceOutUp,
|
||||
.bounceRight-enter-active,
|
||||
.bounceRight-leave-active,
|
||||
.bounceUp-enter-active,
|
||||
.bounceUp-leave-active,
|
||||
.fade-enter-active,
|
||||
.fade-leave-active,
|
||||
.fadeDown-enter-active,
|
||||
.fadeDown-leave-active,
|
||||
.fadeDownBig-enter-active,
|
||||
.fadeDownBig-leave-active,
|
||||
.fadeIn,
|
||||
.fadeInDown,
|
||||
.fadeInDownBig,
|
||||
.fadeInLeft,
|
||||
.fadeInLeftBig,
|
||||
.fadeInRight,
|
||||
.fadeInRightBig,
|
||||
.fadeInUp,
|
||||
.fadeInUpBig,
|
||||
.fadeLeft-enter-active,
|
||||
.fadeLeft-leave-active,
|
||||
.fadeLeftBig-enter-active,
|
||||
.fadeLeftBig-leave-active,
|
||||
.fadeOut,
|
||||
.fadeOutDown,
|
||||
.fadeOutDownBig,
|
||||
.fadeOutLeft,
|
||||
.fadeOutLeftBig,
|
||||
.fadeOutRight,
|
||||
.fadeOutRightBig,
|
||||
.fadeOutUp,
|
||||
.fadeOutUpBig,
|
||||
.fadeRight-enter-active,
|
||||
.fadeRight-leave-active,
|
||||
.fadeRightBig-enter-active,
|
||||
.fadeRightBig-leave-active,
|
||||
.fadeUp-enter-active,
|
||||
.fadeUp-leave-active,
|
||||
.fadeUpBig-enter-active,
|
||||
.fadeUpBig-leave-active,
|
||||
.rotateDownLeft-enter-active,
|
||||
.rotateDownLeft-leave-active,
|
||||
.rotateDownRight-enter-active,
|
||||
.rotateDownRight-leave-active,
|
||||
.rotateInDownLeft,
|
||||
.rotateInDownRight,
|
||||
.rotateInUpLeft,
|
||||
.rotateInUpRight,
|
||||
.rotateOutDownLeft,
|
||||
.rotateOutDownRight,
|
||||
.rotateOutUpLeft,
|
||||
.rotateOutUpRight,
|
||||
.rotateUpLeft-enter-active,
|
||||
.rotateUpLeft-leave-active,
|
||||
.rotateUpRight-enter-active,
|
||||
.rotateUpRight-leave-active,
|
||||
.slide-enter-active,
|
||||
.slide-leave-active,
|
||||
.slideDown-enter-active,
|
||||
.slideDown-leave-active,
|
||||
.slideIn,
|
||||
.slideInDown,
|
||||
.slideInLeft,
|
||||
.slideInRight,
|
||||
.slideInUp,
|
||||
.slideLeft-enter-active,
|
||||
.slideLeft-leave-active,
|
||||
.slideOut,
|
||||
.slideOutDown,
|
||||
.slideOutLeft,
|
||||
.slideOutRight,
|
||||
.slideOutUp,
|
||||
.slideRight-enter-active,
|
||||
.slideRight-leave-active,
|
||||
.slideUp-enter-active,
|
||||
.slideUp-leave-active,
|
||||
.zoom-enter-active,
|
||||
.zoom-leave-active,
|
||||
.zoomDown-enter-active,
|
||||
.zoomDown-leave-active,
|
||||
.zoomIn,
|
||||
.zoomInDown,
|
||||
.zoomInLeft,
|
||||
.zoomInRight,
|
||||
.zoomInUp,
|
||||
.zoomLeft-enter-active,
|
||||
.zoomLeft-leave-active,
|
||||
.zoomOut,
|
||||
.zoomOutDown,
|
||||
.zoomOutLeft,
|
||||
.zoomOutRight,
|
||||
.zoomOutUp,
|
||||
.zoomRight-enter-active,
|
||||
.zoomRight-leave-active,
|
||||
.zoomUp-enter-active,
|
||||
.zoomUp-leave-active {
|
||||
animation-duration: 0.6s !important;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
.cur-point {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
|
||||
/*无数据*/
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
min-height: 200px;
|
||||
line-height: 200px;
|
||||
}
|
||||
|
||||
.no-data .icon-zanwushuju {
|
||||
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;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: #98a6ad;
|
||||
}
|
||||
|
||||
.custom-scrollbar .el-scrollbar__wrap {
|
||||
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;
|
||||
}
|
||||
|
||||
.dialog-sm {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.dialog-md {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.dialog-lg {
|
||||
width: 950px;
|
||||
}
|
||||
|
||||
:-ms-input-placeholder {
|
||||
/* Internet Explorer 10+ */
|
||||
color: #e9d6cf !important;
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
@import "./theme.scss";
|
||||
@import "./table.scss";
|
|
@ -0,0 +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;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
.table-container {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
.theme-container{
|
||||
width: 280px;
|
||||
padding: 0 !important;
|
||||
top: 30px !important;
|
||||
.popper__arrow {
|
||||
display: none !important;
|
||||
}
|
||||
.el-card__header{
|
||||
padding: 10px 20px;
|
||||
}
|
||||
}
|
||||
.theme-setting{
|
||||
.icon-huanfu{
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
@import "./button.scss";
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-notification__content {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.el-cascader {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.el-button--mini,
|
||||
.el-button--mini.is-round {
|
||||
padding: 4px 15px !important;
|
||||
}
|
||||
|
||||
.el-form-item--mini.el-form-item,
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.el-table .cell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
box-shadow: none;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.el-tabs--border-card {
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.el-card__header {
|
||||
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-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;
|
||||
}
|
||||
|
||||
.el-progress-bar__inner {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.el-progress__text {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: $--color-primary;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-pagination button,
|
||||
.el-pagination span:not([class*=suffix]) {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-pagination__sizes .el-input .el-input__inner {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-pager li {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-input--small {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.el-tabs__content {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
//menu
|
||||
.el-submenu .el-menu-item {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.el-dialog {
|
||||
.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__headerbtn {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
.el-dialog__footer {
|
||||
padding: 14px 20px;
|
||||
text-align: right;
|
||||
border-top: 1px solid #E0E0E0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
@import "./common.scss";
|
||||
@import "./element-ui.scss";
|
||||
@import "./components/index.scss";
|
|
@ -0,0 +1,89 @@
|
|||
.bsm_btn {
|
||||
height: 28px !important;
|
||||
line-height: 28px !important;
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
width: 100% !important;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
z-index: 99;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
font-weight: 550;
|
||||
padding-left: 5px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dialog-header .title{
|
||||
display: inline-block;
|
||||
color: #333;
|
||||
}
|
||||
.dialog-header .line,
|
||||
.dialog_header_dark .line{
|
||||
position: relative;
|
||||
top: 4px;
|
||||
margin: 0 10px;
|
||||
height: 20px;
|
||||
width: 1px;
|
||||
display: inline-block;
|
||||
background-color: #b5b5b5;
|
||||
}
|
||||
.dialog-header .dialog-back,
|
||||
.dialog_header_dark .dialog-back
|
||||
{
|
||||
color: #46ABf1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dialog_header_dark {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
z-index: 99;
|
||||
background: #21242e;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
font-weight: 550;
|
||||
padding-left: 5px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dialog_header_dark .title{
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bsm-content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.bsm-item {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.bsm-item .item-label {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
height: 16px;
|
||||
color: #999;
|
||||
width: 105px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.bsm-item .item-value {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
width: calc(100% - 145px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.bsm-item .heightClass {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.alert_bottom_10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* Created by Zhang Haijun on 2018/1/25.
|
||||
*/
|
||||
/* global $ */
|
||||
import Vue from 'vue'
|
||||
import store from '@cmp/cmp-core/store'
|
||||
export const permission = Vue.directive('permission', function (el, binding) {
|
||||
const buttons = store.state.permission.buttons
|
||||
if (!buttons.includes(binding.value)) {
|
||||
// el.parentNode && el.parentNode.removeChild(el)
|
||||
el.style.display = 'none'
|
||||
} else {
|
||||
el.style.display = ''
|
||||
}
|
||||
})
|
|
@ -0,0 +1,25 @@
|
|||
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);
|
||||
console.log(webSocket)
|
||||
if (unref(webSocket)) {
|
||||
webSocket.value.onmessage = onmessage
|
||||
} else {
|
||||
actions.setGlobalState({
|
||||
name: 'cop-web',
|
||||
onmessage
|
||||
})
|
||||
}
|
||||
onUnmounted(() => {
|
||||
if (unref(webSocket)) {
|
||||
webSocket.value.onmessage = null
|
||||
} else {
|
||||
actions.setGlobalState({
|
||||
name: 'cop-web',
|
||||
onmessage: null
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { Message } from 'element-ui'
|
||||
export default function() {
|
||||
// 添加值
|
||||
const addItem = function (data: any, initData = {}) {
|
||||
data.push(initData)
|
||||
}
|
||||
// 删除某组件的item值
|
||||
const removeItem = function (data: any, index: number, required: boolean = true) {
|
||||
if (required && data.length == 1) return Message({ message: '值不能少于一项', type: 'warning' })
|
||||
data.splice(index, 1)
|
||||
}
|
||||
return {
|
||||
addItem,
|
||||
removeItem
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* @Author: Haijun Zhang
|
||||
* @Date: 2022-11-03 15:41:09
|
||||
* @LastEditTime: 2022-12-08 15:37:40
|
||||
* @LastEditors: Haijun Zhang
|
||||
* @Description:
|
||||
* @FilePath: \cmc-web\packages\common\hooks\useSelection.js
|
||||
*/
|
||||
import { ref, computed } from 'vue'
|
||||
export default function() {
|
||||
const selections = ref([])
|
||||
function handleSelectionChange(selection) {
|
||||
selections.value = selection
|
||||
}
|
||||
const selectionIds = computed(() => selections.value.map((item) => item.id))
|
||||
return {
|
||||
selectionIds,
|
||||
selections,
|
||||
handleSelectionChange
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
import { ref, toRefs, reactive } from 'vue'
|
||||
import { MessageBox, Message } from 'element-ui'
|
||||
import { handleSearchParam } from '@cmp/cmp-element'
|
||||
|
||||
interface IRemoveService {
|
||||
(id: number, params?: any): Promise<Base.IResponseData>
|
||||
}
|
||||
interface IConfigs{
|
||||
getService: {
|
||||
(params: Base.IListParams): Promise<Base.IResponseList>
|
||||
},
|
||||
removeService?: IRemoveService,
|
||||
listFormat?: {
|
||||
(data: any): any[]
|
||||
},
|
||||
afterGetList?: {
|
||||
(): void
|
||||
},
|
||||
rows?: number,
|
||||
params?: any,
|
||||
initParams?: any,
|
||||
deleteTipKey?: string
|
||||
}
|
||||
interface IRecord{
|
||||
id: number,
|
||||
name: string
|
||||
}
|
||||
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 => {})
|
||||
}
|
||||
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);
|
||||
const state: Base.IListState<T> = reactive({
|
||||
list: [],
|
||||
total: 0,
|
||||
params: {
|
||||
page: 1,
|
||||
rows,
|
||||
...params
|
||||
}
|
||||
});
|
||||
// if (initParams) {
|
||||
// state.params.params = handleSearchParam(initParams)
|
||||
// }
|
||||
async function getList () {
|
||||
loading.value = true;
|
||||
try {
|
||||
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;
|
||||
afterGetList && afterGetList()
|
||||
}
|
||||
} catch (e) {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
const { handleDelete } = useDelete(removeService as IRemoveService, getList, deleteTipKey)
|
||||
return {
|
||||
loading,
|
||||
...toRefs(state),
|
||||
getList,
|
||||
handleDelete
|
||||
}
|
||||
}
|
||||
|
||||
export function useSelect() {
|
||||
const selectList = ref<object[]>([])
|
||||
function handleSelectItem(selection: object[], row: object) {
|
||||
selectList.value = selection
|
||||
}
|
||||
function handleSelectAll(selection: object[]) {
|
||||
selectList.value = selection
|
||||
}
|
||||
return {
|
||||
selectList, handleSelectItem, handleSelectAll
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import { onUnmounted, ref } from 'vue'
|
||||
import WebSocket from 'cmp-socket'
|
||||
import { getToken } from 'utils/auth'
|
||||
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`,
|
||||
pingMsg: 'HeartBeat',
|
||||
reConnectNum: 5,
|
||||
params: getToken()
|
||||
})
|
||||
if (onmessage && typeof onmessage === 'function') {
|
||||
webSocket.onmessage = onmessage
|
||||
}
|
||||
onUnmounted(() => {
|
||||
webSocket.Destroy()
|
||||
webSocket = null
|
||||
})
|
||||
return {
|
||||
webSocket
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
export interface IListParams {
|
||||
page: number,
|
||||
rows: number,
|
||||
simple?: boolean,
|
||||
params?:string
|
||||
}
|
||||
|
||||
export interface IAjaxData {
|
||||
success: boolean,
|
||||
failed: boolean,
|
||||
solution: string,
|
||||
message: string,
|
||||
errorMsg: string,
|
||||
data: any,
|
||||
status: string
|
||||
}
|
||||
|
||||
export interface IDialogConfig {
|
||||
visible: boolean,
|
||||
id?: number,
|
||||
vendorId?: number
|
||||
}
|
||||
|
||||
export interface looseObject {
|
||||
[key: string]: any
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
import actions from '@/shared/action'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
webSocket() {
|
||||
return this.$store.state.app.$webSocket
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.webSocket) {
|
||||
// 独立应用
|
||||
this.webSocket.onmessage = this.onmessage
|
||||
} else {
|
||||
// 子应用处理方式
|
||||
actions.setGlobalState({
|
||||
onmessage: this.onmessage
|
||||
})
|
||||
}
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
if (this.webSocket) {
|
||||
this.webSocket.onmessage = null
|
||||
} else {
|
||||
actions.setGlobalState({
|
||||
onmessage: null
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue