Showcase sample source added
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": ["env", "stage-2"],
|
||||
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
|
@ -0,0 +1,4 @@
|
|||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
|
@ -0,0 +1,30 @@
|
|||
// https://eslint.org/docs/user-guide/configuring
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
extends: [
|
||||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
||||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
||||
'plugin:vue/essential',
|
||||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
||||
'standard'
|
||||
],
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'vue'
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
'indent': 0,
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
/test/unit/coverage/
|
||||
/test/e2e/reports/
|
||||
selenium-debug.log
|
||||
package-lock.json
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
|
@ -0,0 +1,10 @@
|
|||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
"postcss-import": {},
|
||||
"postcss-url": {},
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#!groovy
|
||||
|
||||
node('CloudEJ2') {
|
||||
try {
|
||||
deleteDir()
|
||||
|
||||
stage('Import') {
|
||||
git url: 'https://gitlab.syncfusion.com/essential-studio/ej2-groovy-scripts.git', branch: 'master', credentialsId: env.JENKINS_CREDENTIAL_ID
|
||||
shared = load 'src/shared.groovy'
|
||||
}
|
||||
|
||||
stage('Checkout') {
|
||||
checkout scm
|
||||
shared.getProjectDetails()
|
||||
shared.gitlabCommitStatus('running')
|
||||
}
|
||||
|
||||
stage('Install') {
|
||||
shared.install()
|
||||
}
|
||||
|
||||
// stage('Test') {
|
||||
// shared.test()
|
||||
// }
|
||||
|
||||
stage('Build') {
|
||||
shared.runShell('npm run build')
|
||||
shared.runShell('gulp change-path')
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
shared.publish()
|
||||
}
|
||||
|
||||
shared.gitlabCommitStatus('success')
|
||||
deleteDir()
|
||||
}
|
||||
catch(Exception e) {
|
||||
println(e)
|
||||
shared.gitlabCommitStatus('failed')
|
||||
deleteDir()
|
||||
error('Build Failed')
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config/index')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
|
@ -0,0 +1,54 @@
|
|||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
После Ширина: | Высота: | Размер: 6.7 KiB |
|
@ -0,0 +1,101 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config/index')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config/index')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config/index')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|PNG)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config/index')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
|
@ -0,0 +1,149 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config/index')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = process.env.NODE_ENV === 'testing'
|
||||
? require('../config/test.env')
|
||||
: require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: process.env.NODE_ENV === 'testing'
|
||||
? 'index.html'
|
||||
: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"htmllint": ["./src/**/*.html"],
|
||||
"json": ["./**/*.json"],
|
||||
"dedupe": ["./src/**/*.js"],
|
||||
"watchSample": ["./src/**/*.js"],
|
||||
"jshint": ["./src/**/*.js", "!./src/**/*.min.js"],
|
||||
"github": ["./src/**/*.{html,ts,json}", "./styles{,/**}", "./src/**/images{,/**}", "./src/common/lib{,/**}", "./src/common/cldr-data{,/**}", "./src/showcase{,/**}", "!./src/showcase/**/!(webpack.config)*.{js,json}", "!./styles/**/!(index)*.css", "./spec/**/*.ts", "./*.html", "./favicon.ico", "karma.conf.js", "package.json", "test-main.js", "tsconfig.json", "webpack.config.js", "!./googlec03dd4bc003151bc.html", "license"],
|
||||
"isShowCase":true,
|
||||
"publishSamples": ["./dist/**/*"]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
|
@ -0,0 +1,76 @@
|
|||
'use strict'
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const devEnv = require('./dev.env')
|
||||
|
||||
module.exports = merge(devEnv, {
|
||||
NODE_ENV: '"testing"'
|
||||
})
|
|
@ -0,0 +1,42 @@
|
|||
var webpackGulp = require('webpack-stream');
|
||||
var webpack = require('webpack');
|
||||
var build = require("@syncfusion/ej2-sample-helpers");
|
||||
|
||||
/**
|
||||
* Bundle all module using webpack
|
||||
*/
|
||||
gulp.task('bundle', function() {
|
||||
var webpackConfig = require(fs.realpathSync('./webpack.config.js'));
|
||||
return gulp.src('')
|
||||
.pipe(webpackGulp(webpackConfig, webpack))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Compile SampleBrowser Samples.
|
||||
*/
|
||||
gulp.task('build', ['ship-deps'], function(done) {
|
||||
if (!fs.existsSync('./styles')) {
|
||||
fs.mkdirSync('./styles');
|
||||
}
|
||||
runSequence('bundle', done);
|
||||
});
|
||||
|
||||
|
||||
gulp.task('ship-deps', function(done) {
|
||||
gulp.src(['./node_modules/@syncfusion/ej2/*.css', './node_modules/@syncfusion/ej2/dist/*{.js,.map}', './node_modules/fuse.js/dist/fuse.min.js'])
|
||||
.pipe(gulp.dest('./dist/'))
|
||||
.on('end', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('change-path', function() {
|
||||
var fs = require('fs');
|
||||
var indexPath = './dist/index.html';
|
||||
if (fs.existsSync(indexPath)) {
|
||||
var content = fs.readFileSync(indexPath, 'utf8');
|
||||
content = content.replace(/\/static\//g, './static/');
|
||||
fs.writeFileSync(indexPath, content);
|
||||
}
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
.bounce1,
|
||||
.bounce2 {
|
||||
-webkit-animation-delay: -0.32s;
|
||||
animation-delay: -0.32s;
|
||||
}
|
||||
|
||||
.loader > div {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #00BCD4;
|
||||
border-radius: 100%;
|
||||
display: inline-block;
|
||||
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
|
||||
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
|
||||
}
|
||||
.splash {
|
||||
color: #00BCD4;
|
||||
text-align: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -90px;
|
||||
margin-left: -100px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html> <!--style="overflow: hidden;" -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>IT Asset Management - Essential JS 2 for Vue - Syncfusion</title>
|
||||
<meta name="description" content="IT Asset Management - Essential JS 2 for Vue" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<link rel="shortcut icon" href="static/favicon.ico" />
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
"name": "@syncfusion/ej2-vue-asset-management",
|
||||
"version": "1.0.0",
|
||||
"description": "A Vue.js project",
|
||||
"author": "Syncfusion Inc.",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"unit": "jest --config test/unit/jest.conf.js --coverage",
|
||||
"e2e": "node test/e2e/runner.js",
|
||||
"test": "npm run unit && npm run e2e",
|
||||
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
|
||||
"build": "node build/build.js",
|
||||
"ci-publish": "gulp publish-samples"
|
||||
},
|
||||
"dependencies": {
|
||||
"@syncfusion/ej2-vue-base": "*",
|
||||
"@syncfusion/ej2-vue-buttons": "*",
|
||||
"@syncfusion/ej2-vue-calendars": "*",
|
||||
"@syncfusion/ej2-vue-charts": "*",
|
||||
"@syncfusion/ej2-vue-dropdowns": "*",
|
||||
"@syncfusion/ej2-vue-grids": "*",
|
||||
"@syncfusion/ej2-vue-inputs": "*",
|
||||
"@syncfusion/ej2-vue-lists": "*",
|
||||
"@syncfusion/ej2-vue-navigations": "*",
|
||||
"@syncfusion/ej2-vue-notifications": "*",
|
||||
"@syncfusion/ej2-vue-popups": "*",
|
||||
"@syncfusion/ej2-vue-treemap": "*",
|
||||
"es6-promise": "^4.2.4",
|
||||
"vue": "^2.5.2",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@syncfusion/ej2-sample-helpers": "*",
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-eslint": "~8.2.3",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "^21.0.2",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-dynamic-import-node": "^1.2.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"babel-register": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"chromedriver": "^2.27.2",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"cross-spawn": "^5.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-friendly-formatter": "^3.0.0",
|
||||
"eslint-loader": "^1.7.1",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"eslint-plugin-node": "^5.2.0",
|
||||
"eslint-plugin-promise": "^3.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"eslint-plugin-vue": "^4.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"jest": "^22.0.4",
|
||||
"jest-serializer-vue": "^0.3.0",
|
||||
"nightwatch": "^0.9.12",
|
||||
"node-notifier": "^5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.0",
|
||||
"selenium-server": "^3.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-jest": "^1.0.2",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Shape</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Asset-View" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Asset-View_4-Copy-5" transform="translate(-1105.000000, -287.000000)" fill="#0BB60E">
|
||||
<path d="M1113,287 C1108.584,287 1105,290.584 1105,295 C1105,299.416 1108.584,303 1113,303 C1117.416,303 1121,299.416 1121,295 C1121,290.584 1117.416,287 1113,287 L1113,287 Z M1111.4,299 L1107.4,295 L1108.528,293.872 L1111.4,296.736 L1117.472,290.664 L1118.6,291.8 L1111.4,299 L1111.4,299 Z" id="Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 887 B |
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
||||
<g transform="matrix(1,0,0,1,-130,0)">
|
||||
<g id="Artboard1" transform="matrix(1.0049,0,0,1.0049,1000.6,78.5181)">
|
||||
<rect x="-866.353" y="-78.135" width="99.512" height="99.512" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="-866.353" y="-78.135" width="99.512" height="99.512"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(0.995123,0,0,0.995123,-868.828,-78.3849)">
|
||||
<rect x="-0.794" y="-2.767" width="108.671" height="108.647" style="fill:rgb(235,231,245);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.166474,0,0,0.166474,-896.049,-88.135)">
|
||||
<path d="M254.302,549.362C254.302,549.362 316.971,559.441 303.513,506.757C303.513,506.757 270.153,334.489 326.678,212.097C326.678,212.097 374.905,123.734 500.187,131.96C500.187,131.96 625.664,132.723 654.812,270.482C654.812,270.482 678.236,360.081 655.984,508.148C655.984,508.148 641.87,553.489 704.202,550.072C704.202,550.072 710.95,604.133 628.415,626.107C628.415,626.107 428.033,661.159 315.569,622.112C315.569,622.112 255.407,605.566 254.302,549.362Z" style="fill:rgb(81,54,42);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.165474,0,0,0.172795,-736.617,183.585)">
|
||||
<rect x="-518.041" y="-1090.29" width="78.996" height="88.618" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.166474,0,0,0.166474,-896.049,-88.135)">
|
||||
<path d="M536.186,292.194C536.186,292.194 472.071,328.131 408.541,315.706C408.541,315.706 373.97,314.539 354.72,358.13C354.72,358.13 314.732,475.351 424.263,522.139C424.263,522.139 542.372,563.426 595.656,473.342C595.656,473.342 618.424,441.331 609.657,390.51C603.459,354.577 596.646,320.728 536.186,292.194Z" style="fill:rgb(253,204,154);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.166474,0,0,0.166474,-895.272,-88.0923)">
|
||||
<ellipse cx="551.296" cy="383.071" rx="14.582" ry="15.994" style="fill:rgb(59,37,25);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.166474,0,0,0.166474,-918.519,-87.9776)">
|
||||
<ellipse cx="551.296" cy="383.071" rx="14.582" ry="15.994" style="fill:rgb(59,37,25);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.20877,0,0,0.190688,-715.369,200.05)">
|
||||
<path d="M-660.79,-937.651C-660.79,-937.651 -646.839,-1013.27 -481.054,-1033.48C-481.054,-1033.48 -322.59,-1023.88 -290.574,-936.918L-660.79,-937.651Z" style="fill:rgb(87,67,166);"/>
|
||||
<clipPath id="_clip2">
|
||||
<path d="M-660.79,-937.651C-660.79,-937.651 -646.839,-1013.27 -481.054,-1033.48C-481.054,-1033.48 -322.59,-1023.88 -290.574,-936.918L-660.79,-937.651Z"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip2)">
|
||||
<g transform="matrix(1,0,0,1,-5.19525,0.760608)">
|
||||
<path d="M-533.459,-1026.54C-533.459,-1026.54 -480.384,-965.303 -418.39,-1025.48L-439.309,-1030.25C-439.309,-1030.25 -472.854,-997.266 -515.475,-1030.82L-533.459,-1026.54Z" style="fill:rgb(244,108,32);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-5.91366,-16.1724)">
|
||||
<path d="M-533.459,-1026.54C-533.459,-1026.54 -478.44,-959.351 -418.39,-1025.48L-439.309,-1030.25C-439.309,-1030.25 -469.645,-1004.64 -515.475,-1030.82L-533.459,-1026.54Z" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(0.172795,0,0,0.172795,-733.043,182.911)">
|
||||
<path d="M-516.7,-1117.73C-516.7,-1117.73 -505.309,-1112.65 -495.293,-1110.87C-495.293,-1110.87 -476.744,-1106.99 -459.636,-1110.59C-459.636,-1110.59 -443.693,-1114.19 -437.312,-1118.25C-437.312,-1118.25 -438.692,-1108.61 -460.159,-1105.79C-460.159,-1105.79 -496.085,-1098.01 -516.7,-1117.73Z" style="fill:rgb(247,148,94);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 4.5 KiB |
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
||||
<g id="Artboard1" transform="matrix(1.0049,0,0,1.0049,870.599,78.5181)">
|
||||
<rect x="-866.353" y="-78.135" width="99.512" height="99.512" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="-866.353" y="-78.135" width="99.512" height="99.512"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(0.995123,0,0,0.995123,-866.353,-78.1351)">
|
||||
<rect x="-0.794" y="-2.767" width="108.671" height="108.647" style="fill:rgb(235,231,245);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.172795,0,0,0.172795,-757.49,104.713)">
|
||||
<g transform="matrix(1,0,0,1,144.361,458.451)">
|
||||
<ellipse cx="-624.73" cy="-1203.65" rx="34.422" ry="40.273" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,445.558,457.821)">
|
||||
<ellipse cx="-624.73" cy="-1203.65" rx="34.422" ry="40.273" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.957635,0,0,1,129.494,462.081)">
|
||||
<rect x="-518.041" y="-1090.29" width="78.996" height="88.618" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
<g transform="matrix(1.06198,0,0,1.17243,184.902,695.246)">
|
||||
<circle cx="-484.628" cy="-1235.94" r="135.778" style="fill:rgb(253,204,154);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,147.24,452.549)">
|
||||
<path d="M-627.757,-1189.41C-627.757,-1189.41 -641.002,-1202.47 -641.517,-1311.06C-641.517,-1311.06 -653.95,-1404.69 -550.946,-1435.93C-550.946,-1435.93 -433.033,-1482.51 -354.806,-1399.98C-354.806,-1399.98 -261.635,-1370.17 -331.729,-1188.38C-331.729,-1188.38 -338.647,-1172.11 -343.678,-1231.58C-343.678,-1231.58 -346.728,-1268.8 -368.958,-1275.1C-368.958,-1275.1 -393.606,-1289.01 -404.168,-1309.56C-404.168,-1309.56 -455.08,-1281.42 -541.193,-1291.69C-541.193,-1291.69 -603.411,-1295.7 -611.958,-1245.84C-614.948,-1233.09 -606.166,-1162.12 -627.757,-1189.41Z" style="fill:rgb(81,54,42);"/>
|
||||
</g>
|
||||
<g transform="matrix(1.11994,0,0,1,201.581,454.34)">
|
||||
<ellipse cx="-408.225" cy="-1209.76" rx="13.873" ry="18.102" style="fill:rgb(59,37,25);"/>
|
||||
</g>
|
||||
<g transform="matrix(1.11994,0,0,1,56.7485,452.915)">
|
||||
<ellipse cx="-408.225" cy="-1209.76" rx="13.873" ry="18.102" style="fill:rgb(59,37,25);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,147.24,452.549)">
|
||||
<path d="M-516.7,-1117.73C-516.7,-1117.73 -505.309,-1112.65 -495.293,-1110.87C-495.293,-1110.87 -476.744,-1106.99 -459.636,-1110.59C-459.636,-1110.59 -443.693,-1114.19 -437.312,-1118.25C-437.312,-1118.25 -438.692,-1108.61 -460.159,-1105.79C-460.159,-1105.79 -496.085,-1098.01 -516.7,-1117.73Z" style="fill:rgb(247,148,94);"/>
|
||||
</g>
|
||||
<g transform="matrix(1.2082,0,0,1.10355,250.722,557.805)">
|
||||
<path d="M-660.79,-937.651C-660.79,-937.651 -646.839,-1013.27 -481.054,-1033.48C-481.054,-1033.48 -322.59,-1023.88 -290.574,-936.918L-660.79,-937.651Z" style="fill:rgb(87,67,166);"/>
|
||||
<clipPath id="_clip2">
|
||||
<path d="M-660.79,-937.651C-660.79,-937.651 -646.839,-1013.27 -481.054,-1033.48C-481.054,-1033.48 -322.59,-1023.88 -290.574,-936.918L-660.79,-937.651Z"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip2)">
|
||||
<g transform="matrix(1,0,0,1,-5.19525,0.760608)">
|
||||
<path d="M-533.459,-1026.54C-533.459,-1026.54 -480.384,-965.303 -418.39,-1025.48L-439.309,-1030.25C-439.309,-1030.25 -472.854,-997.266 -515.475,-1030.82L-533.459,-1026.54Z" style="fill:rgb(244,108,32);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-5.91366,-16.1724)">
|
||||
<path d="M-533.459,-1026.54C-533.459,-1026.54 -478.44,-959.351 -418.39,-1025.48L-439.309,-1030.25C-439.309,-1030.25 -469.645,-1004.64 -515.475,-1030.82L-533.459,-1026.54Z" style="fill:rgb(252,188,133);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 4.6 KiB |
После Ширина: | Высота: | Размер: 137 B |
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
||||
<g transform="matrix(1,0,0,1,-179.717,-148.495)">
|
||||
<g id="Page-57" serif:id="Page 57" transform="matrix(0.8,0,0,0.8,179.717,148.495)">
|
||||
<rect x="0" y="0" width="20" height="20" style="fill:none;"/>
|
||||
<g transform="matrix(0.972238,0,0,0.972238,-174.45,-144.095)">
|
||||
<path d="M194.895,151.133L193.743,152.768C195.605,154.08 196.717,156.221 196.717,158.495C196.717,162.355 193.577,165.495 189.717,165.495C185.857,165.495 182.717,162.355 182.717,158.495C182.717,156.225 183.826,154.086 185.683,152.774L184.529,151.141C182.142,152.826 180.717,155.575 180.717,158.495C180.717,163.458 184.755,167.495 189.717,167.495C194.68,167.495 198.717,163.458 198.717,158.495C198.717,155.571 197.288,152.82 194.895,151.133ZM190.717,155.495L188.717,155.495L188.717,149.495L190.717,149.495L190.717,155.495Z" style="fill:rgb(153,153,153);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 1.3 KiB |
После Ширина: | Высота: | Размер: 564 B |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
||||
<g transform="matrix(1,0,0,1,-199.463,-148.64)">
|
||||
<g id="Page-32" serif:id="Page 32" transform="matrix(0.8,0,0,0.8,199.463,148.64)">
|
||||
<rect x="0" y="0" width="20" height="20" style="fill:none;"/>
|
||||
<g transform="matrix(1.07279,0,0,1.07279,13.8139,18.5551)">
|
||||
<path d="M0,-7.019C-1.034,-6.239 -2.319,-5.776 -3.71,-5.776C-5.103,-5.776 -6.387,-6.239 -7.421,-7.019C-9.84,-6.714 -11.711,-4.646 -11.711,-2.14L-11.711,0L4.289,0L4.289,-2.14C4.289,-4.646 2.418,-6.714 0,-7.019" style="fill:rgb(153,153,153);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.07279,0,0,1.07279,9.98537,1.05512)">
|
||||
<path d="M0,8.983C2.48,8.983 4.491,6.972 4.491,4.491C4.491,2.011 2.48,0 0,0C-2.481,0 -4.491,2.011 -4.491,4.491C-4.491,6.972 -2.481,8.983 0,8.983" style="fill:rgb(153,153,153);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 1.3 KiB |
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Shape</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Asset-View" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Asset-View_4-Copy-5" transform="translate(-1105.000000, -336.000000)" fill="#F64F4C">
|
||||
<path d="M1113,336 C1108.576,336 1105,339.576 1105,344 C1105,348.424 1108.576,352 1113,352 C1117.424,352 1121,348.424 1121,344 C1121,339.576 1117.424,336 1113,336 L1113,336 Z M1117,346.872 L1115.872,348 L1113,345.128 L1110.128,348 L1109,346.872 L1111.872,344 L1109,341.128 L1110.128,340 L1113,342.872 L1115.872,340 L1117,341.128 L1114.128,344 L1117,346.872 L1117,346.872 Z" id="Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 969 B |
После Ширина: | Высота: | Размер: 1.9 KiB |
После Ширина: | Высота: | Размер: 16 KiB |
После Ширина: | Высота: | Размер: 337 KiB |
|
@ -0,0 +1,55 @@
|
|||
<style>
|
||||
#list-engineer {
|
||||
font-size: 14px;
|
||||
color: #262628;
|
||||
font-weight: 600;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#list-timeStamp {
|
||||
float: right;
|
||||
color: #696868;
|
||||
opacity: 40%;
|
||||
font-size: 11px;
|
||||
font-family: Roboto, Helvetica, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
/* background-repeat: no-repeat;
|
||||
background-image: url('../assets/Timer.png');
|
||||
background-position: left center; */
|
||||
padding-left: 18px;
|
||||
/* margin-top: 15px; */
|
||||
}
|
||||
.list-temp {
|
||||
height: 65px;
|
||||
line-height: 15px !important;
|
||||
font-family: helvetica;
|
||||
}
|
||||
/* .e-listview .e-list-item { */
|
||||
#list-message {
|
||||
font-size: 13px;
|
||||
color: #868686;
|
||||
margin-left: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="list-temp" >
|
||||
<div class="e-avatar e-avatar-small e-avatar-circle list-img" :style="{ background: 'url(' + image + ') no-repeat center', backgroundSize: bgSize, 'vertical-align': 'middle'}"></div>
|
||||
<span id= "list-engineer">{{data.Employee}}</span>
|
||||
<span id="list-timeStamp" class="sf-icon-timer" >{{data.TimeStamp}}</span>
|
||||
<p id="list-message">{{data.Message}}</p>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
data: {},
|
||||
bgSize: 'cover'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
image: function () {
|
||||
return require('@/' + this.data.ImgSrc)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,406 @@
|
|||
<template>
|
||||
<ejs-dialog ref="dialogObj" id="dialog" :isModal='isModal' v-bind:visible="isShowing" :header='header' :animationSettings='animationSettings' :allowDragging='true' :showCloseIcon='showCloseIcon' :target='target' :width='width' :open="dialogOpen" :close="dialogClose">
|
||||
<!-- <form id="formId" class="form-horizontal" novalidate=""> -->
|
||||
<div class="e-sample-resize-container">
|
||||
<ejs-toast ref='toastRef' id='toast_type' :position='position' :created='created'>
|
||||
</ejs-toast>
|
||||
</div>
|
||||
<form id="formId" class="dlg-form" novalidate="">
|
||||
<div class="col-lg-12 e-input-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row" v-show="isEdit">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Task ID</label>
|
||||
<input id="taskID" class="e-input" type="text" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<label class="e-text">Hardware Name</label>
|
||||
<input id="name" name="Name" class="e-input" type="text" required>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Category</label>
|
||||
<ejs-dropdownlist id="category" name="Category" class="e-input" :dataSource ="categoryList"></ejs-dropdownlist>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Serial No</label>
|
||||
<input id="serial" name="Serial" class="e-input" type="text" required>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Invoice ID</label>
|
||||
<input id="invoice" name="Invoice" class="e-input" type="text" required>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Date Of Purchase</label>
|
||||
<ejs-datepicker id="dop" name="DOP" data-msg-containerid="errorID" type="text" class="e-input" :max="maxDate"></ejs-datepicker>
|
||||
<div id="errorID"></div>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Warranty Ends On</label>
|
||||
<ejs-datepicker id="weo" class="e-input" :min="maxDate"></ejs-datepicker>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Status</label>
|
||||
<ejs-dropdownlist id="status" name="Status" class="e-input" :dataSource ="statusList" :change='onChange'></ejs-dropdownlist>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12" v-show="showAssignee">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Assigned To</label>
|
||||
<ejs-autocomplete id="assignee" :dataSource='this.$store.getters.empData' :fields='fields'></ejs-autocomplete>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-show="showUploader" >
|
||||
<div class="col-xs-12 col-sm-12 col-lg-8 col-md-12 upload-box">
|
||||
<ejs-uploader class="e-input" ref="uploadObj" id='defaultfileupload' name="UploadFiles" :asyncSettings= "path"
|
||||
:dropArea = "dropElement" :removing= "onFileRemove"></ejs-uploader>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-12 col-md-12">
|
||||
<!-- <div class="e-float-input"> -->
|
||||
<label class="e-text">Note</label> <br>
|
||||
<textarea id="note" class="e-input" rows="4"></textarea>
|
||||
<!-- <span class="e-float-line"></span> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pull-right">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
|
||||
<ejs-button id="primarybtn" :isPrimary="true" @click.native="addRecord">{{btnName}}</ejs-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</ejs-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListPlugin } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import { DialogPlugin } from '@syncfusion/ej2-vue-popups'
|
||||
import { UploaderPlugin, FormValidator } from '@syncfusion/ej2-vue-inputs'
|
||||
import { ToastPlugin } from '@syncfusion/ej2-vue-notifications'
|
||||
import { employeeData } from '../datasource.js'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(ToastPlugin)
|
||||
Vue.use(DialogPlugin)
|
||||
Vue.use(DropDownListPlugin)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
Vue.use(UploaderPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
categoryList: [
|
||||
{ id: 'cat-1', text: 'Laptop' },
|
||||
{ id: 'cat-2', text: 'Monitor' },
|
||||
{ id: 'cat-3', text: 'Keyboard' },
|
||||
{ id: 'cat-4', text: 'Mouse' },
|
||||
{ id: 'cat-5', text: 'Tablet' },
|
||||
{ id: 'cat-6', text: 'Mobile' },
|
||||
{ id: 'cat-7', text: 'Headset' },
|
||||
{ id: 'cat-8', text: 'Miscellaneous' }
|
||||
],
|
||||
statusList: [
|
||||
{ id: 'stat-1', text: 'Ordered' },
|
||||
{ id: 'stat-2', text: 'Pending' },
|
||||
{ id: 'stat-3', text: 'Assigned' },
|
||||
{ id: 'stat-4', text: 'In-repair' }
|
||||
],
|
||||
header: 'Add New Hardware',
|
||||
target: document.body,
|
||||
showCloseIcon: true,
|
||||
width: '500px',
|
||||
btnName: 'Submit',
|
||||
animationSettings: { effect: 'None' },
|
||||
isModal: true,
|
||||
maxDate: new Date(),
|
||||
fields: {value: 'Employee'},
|
||||
options: {
|
||||
// Initialize the CustomPlacement.
|
||||
customPlacement: function (inputElement, errorElement) {
|
||||
inputElement.parentNode.appendChild(errorElement)
|
||||
},
|
||||
rules: {
|
||||
Name: { required: true },
|
||||
Serial: { required: true },
|
||||
Invoice: { required: true },
|
||||
DOP: { required: true, date: true }
|
||||
}
|
||||
},
|
||||
frmObj: undefined,
|
||||
position: {
|
||||
X: 'Right'
|
||||
},
|
||||
showUploader: false,
|
||||
showAssignee: false,
|
||||
path: {
|
||||
saveUrl: 'https://aspnetmvc.syncfusion.com/services/api/uploadbox/Save',
|
||||
removeUrl: 'https://aspnetmvc.syncfusion.com/services/api/uploadbox/Remove'
|
||||
},
|
||||
dropElement: '.content-wrapper'
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.frmObj = new FormValidator('#formId', this.options)
|
||||
},
|
||||
methods: {
|
||||
onChange: function () {
|
||||
if (document.getElementById('status').value === 'In-repair') {
|
||||
this.showAssignee = false
|
||||
this.showUploader = true
|
||||
document.querySelector('.e-file-drop').innerHTML = ' Or Drop files here'
|
||||
} else if (document.getElementById('status').value === 'Assigned') {
|
||||
this.showUploader = false
|
||||
this.showAssignee = true
|
||||
} else {
|
||||
this.showUploader = false
|
||||
this.showAssignee = false
|
||||
}
|
||||
},
|
||||
onFileRemove: function (args) {
|
||||
args.postRawFile = false
|
||||
},
|
||||
created: function (args) {
|
||||
},
|
||||
dialogClose: function () {
|
||||
this.$emit('close')
|
||||
},
|
||||
dialogOpen: function () {
|
||||
this.frmObj.reset()
|
||||
if (!this.isEdit) {
|
||||
this.header = 'Add New Hardware'
|
||||
this.btnName = 'Submit'
|
||||
document.getElementById('name').value = ''
|
||||
document.getElementById('category').value = 'Laptop'
|
||||
document.getElementById('serial').value = ''
|
||||
document.getElementById('invoice').value = ''
|
||||
document.getElementById('dop').value = new Date().toLocaleDateString()
|
||||
document.getElementById('weo').value = ''
|
||||
document.getElementById('status').value = 'Ordered'
|
||||
document.getElementById('assignee').value = ''
|
||||
document.getElementById('note').value = ''
|
||||
} else {
|
||||
this.header = 'Edit Hardware'
|
||||
this.btnName = 'Save'
|
||||
var row = this.rowData
|
||||
document.getElementById('taskID').value = row['TaskID']
|
||||
document.getElementById('name').value = row['Name']
|
||||
document.getElementById('category').value = row['Category']
|
||||
document.getElementById('serial').value = row['SerialNo']
|
||||
document.getElementById('invoice').value = row['InvoiceNo']
|
||||
document.getElementById('dop').value = row['DOP'].toLocaleDateString()
|
||||
document.getElementById('weo').value = row['WEO'] !== '' ? row['WEO'].toLocaleDateString() : ''
|
||||
document.getElementById('status').value = row['Status']
|
||||
document.getElementById('assignee').value = row['AssignedTo']
|
||||
document.getElementById('note').value = row['Note']
|
||||
}
|
||||
if (document.getElementById('status').value === 'In-repair') {
|
||||
this.showAssignee = false
|
||||
this.showUploader = true
|
||||
document.querySelector('.e-file-drop').innerHTML = ' Or Drop files here'
|
||||
} else if (document.getElementById('status').value === 'Assigned') {
|
||||
this.showUploader = false
|
||||
this.showAssignee = true
|
||||
} else {
|
||||
this.showUploader = false
|
||||
this.showAssignee = false
|
||||
}
|
||||
this.$refs.dialogObj.show()
|
||||
},
|
||||
addRecord: function () {
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
if (this.frmObj.validate()) {
|
||||
var id = this.$store.state.activityData.length
|
||||
if (!this.isEdit) {
|
||||
grid.addRecord({
|
||||
'TaskID': grid.dataSource.length + 1,
|
||||
'Name': document.getElementById('name').value,
|
||||
'Category': document.getElementById('category').value,
|
||||
'SerialNo': document.getElementById('serial').value,
|
||||
'InvoiceNo': document.getElementById('invoice').value,
|
||||
'DOP': document.getElementById('dop').value,
|
||||
'WEO': document.getElementById('weo').value,
|
||||
'Status': document.getElementById('status').value,
|
||||
'AssignedTo': document.getElementById('assignee').value,
|
||||
'Note': document.getElementById('note').value
|
||||
})
|
||||
var activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new hardware ' + document.getElementById('name').value + ' has been added'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Hardware added successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
} else {
|
||||
var data = {'TaskID': +document.getElementById('taskID').value,
|
||||
'Name': document.getElementById('name').value,
|
||||
'Category': document.getElementById('category').value,
|
||||
'SerialNo': document.getElementById('serial').value,
|
||||
'InvoiceNo': document.getElementById('invoice').value,
|
||||
'DOP': document.getElementById('dop').value,
|
||||
'WEO': document.getElementById('weo').value,
|
||||
'Status': document.getElementById('status').value,
|
||||
'AssignedTo': document.getElementById('assignee').value,
|
||||
'Note': document.getElementById('note').value
|
||||
}
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, data)
|
||||
activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'The hardware ' + document.getElementById('name').value + ' has been edited'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Hardware updated successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
}
|
||||
this.frmObj.reset()
|
||||
this.$refs.dialogObj.hide()
|
||||
this.$emit('close')
|
||||
// } else {
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
/** Whether the dialog is currently showing */
|
||||
showing: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
rowData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowing () {
|
||||
return this.showing
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
|
||||
.content-wrapper div.row {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.control-label {
|
||||
padding: 24px 0px 0px 0px;
|
||||
font-size: 12px;
|
||||
opacity: 0.54;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
.e-input-section .col-xs-6,
|
||||
.e-input-section .col-xs-4,
|
||||
.e-input-section .col-xs-12 {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.content-wrapper div.row {
|
||||
padding: 0px;
|
||||
}
|
||||
#dialog {
|
||||
top: 10px;
|
||||
/* height: 100%; */
|
||||
}
|
||||
}
|
||||
.upload-box {
|
||||
padding-top: 15px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Toast_icons';
|
||||
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj0gSRkAAAEoAAAAVmNtYXDnM+eRAAABsAAAAEpnbHlmzVnmlwAAAhgAAAZAaGVhZBEYIl8AAADQAAAANmhoZWEHlgN3AAAArAAAACRobXR4LvgAAAAAAYAAAAAwbG9jYQnUCGIAAAH8AAAAGm1heHABHQBcAAABCAAAACBuYW1lfUUTYwAACFgAAAKpcG9zdAxfTDgAAAsEAAAAggABAAADUv9qAFoEAAAAAAAD6AABAAAAAAAAAAAAAAAAAAAADAABAAAAAQAACcU5MF8PPPUACwPoAAAAANcI7skAAAAA1wjuyQAAAAAD6APoAAAACAACAAAAAAAAAAEAAAAMAFAABwAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQPqAZAABQAAAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5wDnCgNS/2oAWgPoAJYAAAABAAAAAAAABAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAAAAAAgAAAAMAAAAUAAMAAQAAABQABAA2AAAABAAEAAEAAOcK//8AAOcA//8AAAABAAQAAAABAAIAAwAEAAUABgAHAAgACQAKAAsAAAAAAAAAQgB8AMIA4gEcAZQCBgJwAo4DAAMgAAAAAwAAAAADlAOUAAsAFwAjAAABFwcXNxc3JzcnBycFDgEHLgEnPgE3HgEFHgEXPgE3LgEnDgEBTXh4L3h4L3h4L3h4AbwDt4qKtwMDt4qKt/0eBeuxsesFBeuxsesCbHh4L3h4L3h4L3h4p4q3AwO3ioq3AwO3irHrBQXrsbHrBQXrAAAAAwAAAAADlAOUAAUAEQAdAAABJwcXAScXDgEHLgEnPgE3HgEFHgEXPgE3LgEnDgEBr2UylwEbMqADt4qKtwMDt4qKt/0eBeuxsesFBeuxsesBrGQylgEcMqKKtwMDt4qKtwMDt4qx6wUF67Gx6wUF6wAAAAAFAAAAAAOUA5cABQARAB0AIQAlAAABFzcnNSMFDgEHLgEnPgE3HgEFHgEXPgE3LgEnDgElFzcnBRc3JwHKxiCnPwFOA6V8fKUDA6V8fKX9aATToJ/UBATUn5/UAh7ANsD9fja/NQGedzNj29F8pAMDpHx8pQMDpXyf1AQE1J+g0wQE0/GhQKGhQKFAAAQAAAAAA74DfgADAAcACgANAAAlMzUjNTM1IwEhCQEhAQHLUlJSUgFj/YwBOv42A5T+NuZUUqf+igIc/ZADFgAEAAAAAAOUA5QAAwAHABMAHwAAATM1IzUzNSMFDgEHLgEnPgE3HgEFHgEXPgE3LgEnDgEBylRUVFQBbgO3ioq3AwO3ioq3/R4F67Gx6wUF67Gx6wEk+lNT0Iq3AwO3ioq3AwO3irHrBQXrsbHrBQXrAAAAAAcAAAAAA+gDMQALABUAJQAuADcAQQBLAAABFhcVITUmJz4BMxYFFhcVITU+ATcWJQYHFSE1LgEjIgYHLgEjIgEWFAYiJjQ2MgUWFAYiJjQ2MiUGFBYXPgE0JiIFBhQWFz4BNCYiA1xEBP6sAxUeRiRX/qxEBP45BIlXV/7xZQsD6AvKUypvMzNvKlMCKxozTTMzTP6CGTNMNDRMAQItWUREWlqI/jstWkREWVmIAWMbFjc3IBgKDwQcGxY3NxY3BAQjJUt7e0tKFxgYFwEMGU01NU0zGhlNNTVNMxYthloCAlqGWy4thloCAlqGWwAAAAQAAAAAA5wCxwAIABQANABFAAABFBYyNjQmIgYXDgEHLgEnPgE3HgEfAQcOAQ8BNz4BNS4BJw4BBxQWHwEnLgEvATc+ATc2FiUOAQ8BFx4BNz4BPwEnJiciAb8fLR4eLR+wAkU0NEUBAUU0NEX8BgEemG0FBB8kAlZBQFcBKyUCCkeVTAYBH76RVMP+3bDPBwcKZclcu/AGCwrM2AoBxxYfHy0eHhc0RQEBRTQ1RQEBRSgEARpWGAECFUIoQVcCAldBLEYUAQEIQkAGASJsBwFCoRbFFAoJW0sBCo8LCgztAQAAAAIAAAAAA4ADbAA4AEEAAAEEJCcmDgEWFx4BHwEVFAYHDgEnJg4BFhcWNjc2Fx4BBx4BFzc+ASc2JicmJzUzPgE3PgEnJicjIiUUFjI2NCYiBgNM/tz+pwwMGxEDDAaMfAcSETKEQw8WBg8Og80hNSg4JwICEw0FDhECAjFJEBICPYhKDQgGChQCB/5dMUgxMUgxAuB/ZRcIAxgbCQdHEQGTGi8TOVgKAw8dFwMNuDUFHTGDCA0QAQECFQ8Mnz8LCasJKiUHGg0SATMkMDBJMDAAAAAAAgAAAAAC/QMkAAMADQAAAQchJxMeATMhMjY3EyEC2x3+bB0kBCQZAQQZJARH/ewDBuDg/fcZICAZAicAAwAAAAACzwPoACwAQwBPAAABERQfARYfAzMVHgE7ATI2NRE0JisBNTEWOwEyNjQmJyMiJi8BLgErAQ4BAxUzNTQ2NzMeARcVMzUuAScjIgcjESM1HgEXPgE3LgEnDgEBVQEBAwQCCAjXARENOg0REQ2zDROVExoaE2UQGAQfAxAKYg0RPR8RDZcNEQEeASIalxANAR8CTTo6TQEBTTo6TQJ8/nYEBQIGBAIFArYNERENARENEUoNGicZARMPfQoNARH98Hl5DREBARENeXkaIgEIAe3FOk0CAk06Ok0BAU0AAAAAAgAAAAAC5gMyAAkAEQAAJRQWMyEyNjURITcjFSE1IycjASApHgEaHin+WFBuAeR+JLD8HigoHgGfeT09HgAAAAAAEgDeAAEAAAAAAAAAAQAAAAEAAAAAAAEAEgABAAEAAAAAAAIABwATAAEAAAAAAAMAEgAaAAEAAAAAAAQAEgAsAAEAAAAAAAUACwA+AAEAAAAAAAYAEgBJAAEAAAAAAAoALABbAAEAAAAAAAsAEgCHAAMAAQQJAAAAAgCZAAMAAQQJAAEAJACbAAMAAQQJAAIADgC/AAMAAQQJAAMAJADNAAMAAQQJAAQAJADxAAMAAQQJAAUAFgEVAAMAAQQJAAYAJAErAAMAAQQJAAoAWAFPAAMAAQQJAAsAJAGnIEZpbmFsIFRvYXN0IE1ldHJvcFJlZ3VsYXJGaW5hbCBUb2FzdCBNZXRyb3BGaW5hbCBUb2FzdCBNZXRyb3BWZXJzaW9uIDEuMEZpbmFsIFRvYXN0IE1ldHJvcEZvbnQgZ2VuZXJhdGVkIHVzaW5nIFN5bmNmdXNpb24gTWV0cm8gU3R1ZGlvd3d3LnN5bmNmdXNpb24uY29tACAARgBpAG4AYQBsACAAVABvAGEAcwB0ACAATQBlAHQAcgBvAHAAUgBlAGcAdQBsAGEAcgBGAGkAbgBhAGwAIABUAG8AYQBzAHQAIABNAGUAdAByAG8AcABGAGkAbgBhAGwAIABUAG8AYQBzAHQAIABNAGUAdAByAG8AcABWAGUAcgBzAGkAbwBuACAAMQAuADAARgBpAG4AYQBsACAAVABvAGEAcwB0ACAATQBlAHQAcgBvAHAARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAdQBzAGkAbgBnACAAUwB5AG4AYwBmAHUAcwBpAG8AbgAgAE0AZQB0AHIAbwAgAFMAdAB1AGQAaQBvAHcAdwB3AC4AcwB5AG4AYwBmAHUAcwBpAG8AbgAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAECAQMBBAEFAQYBBwEIAQkBCgELAQwBDQAFRXJyb3IHU3VjY2VzcwVBbGFybQdXYXJuaW5nBEluZm8HTWVldGluZwVCbGluawdTdHJldGNoA1NpcANTaXQFVHJhc2gAAAAA) format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
#toast_type .toast-icons.e-success::before {
|
||||
content: "\e701";
|
||||
}
|
||||
.toast-icons {
|
||||
font-family: 'Toast_icons' !important;
|
||||
font-size: 55px;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
#toast_type {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -0,0 +1,307 @@
|
|||
<template>
|
||||
<ejs-dialog ref="dialogObj" id="dialog" :isModal='isModal' v-bind:visible="isShowing" :header='header' :animationSettings='animationSettings' :allowDragging='true' :showCloseIcon='showCloseIcon' :target='target' :width='width' :open="dialogOpen" :close="dialogClose">
|
||||
<form id="formId" class="dlg-form" novalidate="">
|
||||
<div class="col-lg-12 e-input-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row" v-show="isEdit">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Task ID</label>
|
||||
<input id="taskID" class="e-input" type="text" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Software Name</label>
|
||||
<input id="name" name="Name" class="e-input" type="text" required>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Edition</label>
|
||||
<input id="edition" class="e-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Version</label>
|
||||
<input id="version" class="e-input" type="text">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Vendor</label>
|
||||
<input id="vendor" class="e-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">License Type</label>
|
||||
<ejs-dropdownlist id="license-type" name="Type" :dataSource ="LicenseList"></ejs-dropdownlist>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">No. of Licenses</label>
|
||||
<ejs-numerictextbox id="license-count" format="n" :min="0"></ejs-numerictextbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Date Of Purchase</label>
|
||||
<ejs-datepicker class="e-input" data-msg-containerid="errorID" :max="maxDate" id="dop" name="DOP" ></ejs-datepicker>
|
||||
<div id="errorID"></div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Expired On</label>
|
||||
<ejs-datepicker class="e-input" :min="maxDate" id="expired-on"></ejs-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Category</label>
|
||||
<ejs-dropdownlist :dataSource ="categoryList" id="category" name="Category"></ejs-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-12 col-md-12">
|
||||
<label class="e-text">Note</label>
|
||||
<textarea id="note" class="e-input" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pull-right">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
|
||||
<ejs-button id="primarybtn" :isPrimary="true" @click.native="addRecord">{{btnName}}</ejs-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</ejs-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ButtonComponent, ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import { NumericTextBoxPlugin, FormValidator } from '@syncfusion/ej2-vue-inputs'
|
||||
import { DialogPlugin } from '@syncfusion/ej2-vue-popups'
|
||||
import { employeeData } from '../datasource.js'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(DialogPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(NumericTextBoxPlugin)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.component(ButtonPlugin.name, ButtonComponent)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
categoryList: [
|
||||
{ id: 'cat-1', text: 'Development' },
|
||||
{ id: 'cat-2', text: 'Graphics' },
|
||||
{ id: 'cat-3', text: 'Accounting' },
|
||||
{ id: 'cat-4', text: 'HR' },
|
||||
{ id: 'cat-5', text: 'Common' },
|
||||
{ id: 'cat-6', text: 'Miscellaneous' }
|
||||
],
|
||||
LicenseList: [
|
||||
{ id: 'Lic-1', text: 'Free' },
|
||||
{ id: 'Lic-2', text: 'Yearly (User basis)' },
|
||||
{ id: 'Lic-3', text: 'Lifetime' }
|
||||
],
|
||||
header: 'Add New Software',
|
||||
target: document.body,
|
||||
showCloseIcon: true,
|
||||
btnName: 'Submit',
|
||||
width: '500px',
|
||||
isModal: true,
|
||||
options: {
|
||||
// Initialize the CustomPlacement.
|
||||
customPlacement: function (inputElement, errorElement) {
|
||||
inputElement.parentNode.appendChild(errorElement)
|
||||
},
|
||||
rules: {
|
||||
Name: { required: true },
|
||||
DOP: { required: true, date: true }
|
||||
}
|
||||
},
|
||||
frmObj: undefined,
|
||||
maxDate: new Date(),
|
||||
animationSettings: { effect: 'None' }
|
||||
}
|
||||
},
|
||||
components: {
|
||||
ButtonComponent,
|
||||
DropDownListComponent
|
||||
},
|
||||
mounted: function () {
|
||||
this.frmObj = new FormValidator('#formId', this.options)
|
||||
},
|
||||
methods: {
|
||||
dialogClose: function () {
|
||||
this.$emit('close')
|
||||
},
|
||||
dialogOpen: function () {
|
||||
this.frmObj.reset()
|
||||
if (!this.isEdit) {
|
||||
this.header = 'Add New Software'
|
||||
this.btnName = 'Submit'
|
||||
document.getElementById('name').value = ''
|
||||
document.getElementById('edition').value = ''
|
||||
document.getElementById('version').value = ''
|
||||
document.getElementById('vendor').value = ''
|
||||
document.getElementById('license-type').value = 'Free'
|
||||
document.getElementById('license-count').value = 0
|
||||
document.getElementById('dop').value = new Date().toLocaleDateString()
|
||||
document.getElementById('expired-on').value = ''
|
||||
document.getElementById('category').value = 'Development'
|
||||
document.getElementById('note').value = ''
|
||||
} else {
|
||||
this.header = 'Edit Software'
|
||||
this.btnName = 'Save'
|
||||
var row = this.rowData
|
||||
document.getElementById('taskID').value = row['TaskID']
|
||||
document.getElementById('name').value = row['Name']
|
||||
document.getElementById('edition').value = row['Edition']
|
||||
document.getElementById('version').value = row['Version']
|
||||
document.getElementById('vendor').value = row['Vendor']
|
||||
document.getElementById('license-type').value = row['LicenseType']
|
||||
document.getElementById('license-count').value = row['LicenseCount']
|
||||
document.getElementById('dop').value = row['DOP'].toLocaleDateString()
|
||||
document.getElementById('expired-on').value = row['ExpiredOn'] !== '' ? row['ExpiredOn'].toLocaleDateString() : ''
|
||||
document.getElementById('category').value = row['Category']
|
||||
document.getElementById('note').value = row['Note']
|
||||
}
|
||||
this.$refs.dialogObj.show()
|
||||
},
|
||||
addRecord: function () {
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
if (this.frmObj.validate()) {
|
||||
var id = this.$store.state.activityData.length
|
||||
if (!this.isEdit) {
|
||||
grid.addRecord({
|
||||
'TaskID': grid.dataSource.length + 1,
|
||||
'Name': document.getElementById('name').value,
|
||||
'Edition': document.getElementById('edition').value,
|
||||
'Version': document.getElementById('version').value,
|
||||
'Vendor': document.getElementById('vendor').value,
|
||||
'LicenseType': document.getElementById('license-type').value,
|
||||
'LicenseCount': document.getElementById('license-count').value,
|
||||
'DOP': document.getElementById('dop').value,
|
||||
'ExpiredOn': document.getElementById('expired-on').value,
|
||||
'Category': document.getElementById('category').value,
|
||||
'Note': document.getElementById('note').value
|
||||
})
|
||||
var activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new software ' + document.getElementById('name').value + ' has been added'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Software added successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
} else {
|
||||
var data = {'TaskID': +document.getElementById('taskID').value,
|
||||
'Name': document.getElementById('name').value,
|
||||
'Edition': document.getElementById('edition').value,
|
||||
'Version': document.getElementById('version').value,
|
||||
'Vendor': document.getElementById('vendor').value,
|
||||
'LicenseType': document.getElementById('license-type').value,
|
||||
'LicenseCount': document.getElementById('license-count').value,
|
||||
'DOP': document.getElementById('dop').value,
|
||||
'ExpiredOn': document.getElementById('expired-on').value,
|
||||
'Category': document.getElementById('category').value,
|
||||
'Note': document.getElementById('note').value
|
||||
}
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, data)
|
||||
activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'The Software ' + document.getElementById('name').value + ' has been updated'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Software updated successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
}
|
||||
this.frmObj.reset()
|
||||
this.$refs.dialogObj.hide()
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
/** Whether the dialog is currently showing */
|
||||
showing: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
rowData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowing () {
|
||||
return this.showing
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
|
||||
.content-wrapper div.row {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.control-label {
|
||||
padding: 24px 0px 0px 0px;
|
||||
font-size: 12px;
|
||||
opacity: 0.54;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
.e-input-section .col-xs-6,
|
||||
.e-input-section .col-xs-4,
|
||||
.e-input-section .col-xs-12 {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.content-wrapper div.row {
|
||||
padding: 0px;
|
||||
}
|
||||
#dialog {
|
||||
top: 10px;
|
||||
/* height: 100%; */
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,180 @@
|
|||
<template id="view-hardware">
|
||||
<div class="container-fluid">
|
||||
<div id="dialog" style="padding:10px;position:absolute;">
|
||||
<add-hardware :showing="dlgShow" :isEdit="isEditing" :rowData="rowData" @close="onDlgClose">
|
||||
</add-hardware>
|
||||
</div>
|
||||
<div class="row top-row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-7 col-md-12"><h3>View Hardware</h3></div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-2 col-md-6">
|
||||
<ejs-button id="primarybtn" class="asset-btn" :isPrimary="true" v-on:click.native="AddBtnClick"> <span class="e-add-icon"></span> Add New Hardware</ejs-button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 col-md-6 daterange overview-range-picker">
|
||||
<ejs-daterangepicker ref='dateRangePickerObject' class="e-input-group e-input-custom-tag e-control-wrapper e-date-range-wrapper" id='date-wrapper' :placeholder="waterMark" :change="dateRangeChanged">
|
||||
</ejs-daterangepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-12 col-md-12">
|
||||
<ejs-grid ref="gridObj" class="r-space" :load="onGridLoad" :toolbarClick="editToolClicked" :actionBegin='onActionBegin' :actionComplete='onload' :toolbar="toolbar" :dataSource='gridData' :query='query' :allowSorting='true' :allowSelection='true' :selectionSettings='selectionSettings' :allowFiltering='true' :allowPaging='true' :allowGrouping='false' :pageSettings='pageSettings' :editSettings='editSettings' :filterSettings='filterSettings'>
|
||||
<e-columns>
|
||||
<e-column field='TaskID' headerText='Task ID' textAlign='Right' width=90 :isPrimaryKey='true'></e-column>
|
||||
<e-column field='Name' headerText='Hardware' :filter='filter' width=90 :required='true'></e-column>
|
||||
<e-column field='Category' headerText='Category' :filter='filter' width=90 :required='true'></e-column>
|
||||
<e-column field='SerialNo' headerText='Serial No' width=80 required=true></e-column>
|
||||
<e-column field='InvoiceNo' headerText='Invoice' width=70 required=true></e-column>
|
||||
<e-column field='DOP' headerText='Purchase Date' textAlign='Right' type='date' editType='datepickeredit' format='yMd' width=110 required=true></e-column>
|
||||
<e-column field='WEO' headerText='Warranty Ends on' textAlign='Right' type='date' seditType='datepickeredit' format='yMd' width=120 required=true></e-column>
|
||||
<e-column field='Status' headerText='Status' :filter='filter' width=70 required=true></e-column>
|
||||
<e-column field='AssignedTo' headerText='Assigned To' width=90></e-column>
|
||||
<e-column field='Note' headerText='Notes' :visible='false'></e-column>
|
||||
<e-column headerText='' width='100' :commands='commands'></e-column>
|
||||
</e-columns>
|
||||
</ejs-grid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { GridPlugin, Edit, Filter, Group, Page, Selection, CommandColumn, Toolbar } from '@syncfusion/ej2-vue-grids'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin, DateRangePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import AddHardware from '@/components/AddHardware'
|
||||
import { hardwareData } from '../datasource.js'
|
||||
import { TooltipPlugin, Tooltip } from '@syncfusion/ej2-vue-popups'
|
||||
import { Predicate } from '@syncfusion/ej2-data'
|
||||
import { Browser } from '@syncfusion/ej2-base'
|
||||
|
||||
Vue.use(DateRangePickerPlugin)
|
||||
Vue.use(GridPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
Vue.use(TooltipPlugin)
|
||||
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
dlgShow: false,
|
||||
isEditing: false,
|
||||
rowData: null,
|
||||
waterMark: 'Select a range',
|
||||
gridData: hardwareData,
|
||||
tooltip: '',
|
||||
editSettings: { showDeleteConfirmDialog: true, allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' },
|
||||
toolbar: undefined,
|
||||
editparams: { params: { popupHeight: '300px' } },
|
||||
pageSettings: { pageCount: 5, pageSize: 10 },
|
||||
filterSettings: { type: 'Menu', columns: [] },
|
||||
filter: { type: 'CheckBox' },
|
||||
selectionSettings: { persistSelection: true },
|
||||
query: '',
|
||||
commands: [{ type: 'edit', buttonOption: { iconCss: 'e-icons e-edit', cssClass: 'e-flat e-noback', click: this.editBtnClick } },
|
||||
{ type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat e-noback' } }]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onGridLoad: function () {
|
||||
if (Browser.isDevice) {
|
||||
this.toolbar = [{ text: 'Edit', tooltipText: 'Edit', prefixIcon: 'e-edit', id: 'editTool' }, 'Delete']
|
||||
this.$refs.gridObj.ej2Instances.columns[10].visible = false
|
||||
}
|
||||
},
|
||||
onload: function () {
|
||||
},
|
||||
onActionBegin: function (args) {
|
||||
if (args.requestType === 'beginEdit') {
|
||||
this.editBtnClick(args)
|
||||
args.cancel = true
|
||||
}
|
||||
},
|
||||
dateRangeChanged: function (args) {
|
||||
// check wheather the value is empty or not
|
||||
if (args.startDate && args.endDate) {
|
||||
var predicatesStart = new Predicate('DOP', 'greaterthanorequal', args.startDate)
|
||||
var predicatesEnd = new Predicate('DOP', 'lessthanorequal', args.endDate)
|
||||
this.filterSettings = {type: 'Menu', columns: [predicatesStart, predicatesEnd]}
|
||||
} else {
|
||||
this.filterSettings = {type: 'Menu', columns: []}
|
||||
}
|
||||
},
|
||||
AddBtnClick: function () {
|
||||
this.dlgShow = !this.dlgShow
|
||||
this.isEditing = false
|
||||
},
|
||||
editToolClicked: function (args) {
|
||||
if (args.item.id === 'editTool') {
|
||||
this.isEditing = true
|
||||
var rows = this.$refs.gridObj.ej2Instances.getSelectedRows()[0]
|
||||
if (!rows) {
|
||||
this.$refs.gridObj.ej2Instances.editModule.showDialog('EditOperationAlert', this.$refs.gridObj.ej2Instances.editModule.alertDObj)
|
||||
return
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(rows.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
this.dlgShow = !this.dlgShow
|
||||
}
|
||||
},
|
||||
editBtnClick: function (args) {
|
||||
this.isEditing = true
|
||||
this.dlgShow = !this.dlgShow
|
||||
if (args.type === 'actionBegin') {
|
||||
this.rowData = args.rowData
|
||||
return
|
||||
}
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-edit')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.parentElement.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
},
|
||||
onDlgClose () {
|
||||
this.dlgShow = false
|
||||
},
|
||||
showTooltip: function (args) {
|
||||
this.tooltip = new Tooltip({
|
||||
beforeOpen: (e) => {
|
||||
if (e.target.classList.contains('e-unboundcell') || e.target.lastChild.classList.contains('e-unboundcell')) {
|
||||
// e.cancel = true
|
||||
}
|
||||
},
|
||||
content: args.data['Note'].toString() }, args.row)
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
grid: [Edit, Group, Filter, Page, Selection, CommandColumn, Toolbar]
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent,
|
||||
AddHardware
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.datepicker-panel{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel-group{
|
||||
display: flex;
|
||||
}
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 15px auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
}
|
||||
.e-add-icon {
|
||||
background-repeat: no-repeat;
|
||||
/* background-image: url('../assets/Plus.png'); */
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,163 @@
|
|||
<template id="view-hardware">
|
||||
<div class="container-fluid">
|
||||
<div id="dialog" style="padding:10px;position:absolute;">
|
||||
<issue-license :showing="dlgShow" :isEdit="isEditing" :rowData="rowData" @close="onDlgClose">
|
||||
</issue-license>
|
||||
</div>
|
||||
<div class="row top-row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-7 col-md-12"><h3>View Issued Licenses</h3></div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-2 col-md-6">
|
||||
<ejs-button id="primarybtn" class="asset-btn" :isPrimary="true" v-on:click.native="AddBtnClick"> <span class="e-add-icon"></span> Issue License</ejs-button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 col-md-6 daterange overview-range-picker">
|
||||
<ejs-daterangepicker ref='dateRangePickerObject' class="e-input-group e-input-custom-tag e-control-wrapper e-date-range-wrapper" id='date-wrapper' :placeholder="waterMark" :change="dateRangeChanged">
|
||||
</ejs-daterangepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-12 col-md-12">
|
||||
<ejs-grid ref="gridObj" class="r-space" :dataSource='gridData' :load="onGridLoad" :actionBegin='onActionBegin' :toolbarClick="editToolClicked" :toolbar="toolbar" :allowSorting='true' :allowSelection='true' :selectionSettings='selectionSettings' :allowFiltering='true' :allowPaging='true' :allowGrouping='false' :pageSettings='pageSettings' :editSettings='editSettings' :filterSettings='filterSettings'>
|
||||
<e-columns>
|
||||
<e-column field='TaskID' headerText='Task ID' textAlign='Right' width=60 :isPrimaryKey='true'></e-column>
|
||||
<e-column field='Employee' headerText='Employee' width=90></e-column>
|
||||
<e-column field='Email' headerText='Email' width=120></e-column>
|
||||
<e-column field='Software' headerText='Software' :filter='filter' width=100></e-column>
|
||||
<e-column field='LicenseKey' headerText='License Key' :filter='filter' width=100></e-column>
|
||||
<e-column field='IssuedOn' headerText='Issued On' textAlign='Right' type='date' editType='datepickeredit' format='yMd' width=80></e-column>
|
||||
<e-column field='Note' headerText='Notes' :visible='false'></e-column>
|
||||
<e-column headerText='' width='60' :commands='commands'></e-column>
|
||||
</e-columns>
|
||||
</ejs-grid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { GridPlugin, Edit, Filter, Group, Page, Selection, CommandColumn, Toolbar } from '@syncfusion/ej2-vue-grids'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin, DateRangePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import IssueLicense from '@/components/IssueLicense'
|
||||
import { licenseData } from '../datasource.js'
|
||||
import { Browser } from '@syncfusion/ej2-base'
|
||||
import { Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(DateRangePickerPlugin)
|
||||
Vue.use(GridPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
dlgShow: false,
|
||||
isEditing: false,
|
||||
rowData: null,
|
||||
waterMark: 'Select a range',
|
||||
gridData: licenseData,
|
||||
editSettings: { showDeleteConfirmDialog: true, allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' },
|
||||
toolbar: undefined,
|
||||
editparams: { params: { popupHeight: '300px' } },
|
||||
pageSettings: { pageCount: 5, pageSize: 10 },
|
||||
filterSettings: { type: 'Menu', columns: [] },
|
||||
filter: { type: 'CheckBox' },
|
||||
selectionSettings: { persistSelection: true },
|
||||
commands: [{ type: 'edit', buttonOption: { iconCss: 'e-icons e-edit', cssClass: 'e-flat e-noback', click: this.editBtnClick } },
|
||||
{ type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat e-noback' } }]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onGridLoad: function () {
|
||||
if (Browser.isDevice) {
|
||||
this.toolbar = [{ text: 'Edit', tooltipText: 'Edit', prefixIcon: 'e-edit', id: 'editTool' }, 'Delete']
|
||||
this.$refs.gridObj.ej2Instances.columns[7].visible = false
|
||||
}
|
||||
},
|
||||
onload: function () {
|
||||
},
|
||||
onActionBegin: function (args) {
|
||||
if (args.requestType === 'beginEdit') {
|
||||
this.editBtnClick(args)
|
||||
args.cancel = true
|
||||
}
|
||||
},
|
||||
dateRangeChanged: function (args) {
|
||||
// check wheather the value is empty or not
|
||||
if (args.startDate && args.endDate) {
|
||||
var predicatesStart = new Predicate('IssuedOn', 'greaterthanorequal', args.startDate)
|
||||
var predicatesEnd = new Predicate('IssuedOn', 'lessthanorequal', args.endDate)
|
||||
this.filterSettings = {type: 'Menu', columns: [predicatesStart, predicatesEnd]}
|
||||
} else {
|
||||
this.filterSettings = {type: 'Menu', columns: []}
|
||||
}
|
||||
},
|
||||
AddBtnClick: function () {
|
||||
this.dlgShow = !this.dlgShow
|
||||
this.isEditing = false
|
||||
},
|
||||
editToolClicked: function (args) {
|
||||
if (args.item.id === 'editTool') {
|
||||
this.isEditing = true
|
||||
var rows = this.$refs.gridObj.ej2Instances.getSelectedRows()[0]
|
||||
if (!rows) {
|
||||
this.$refs.gridObj.ej2Instances.editModule.showDialog('EditOperationAlert', this.$refs.gridObj.ej2Instances.editModule.alertDObj)
|
||||
return
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(rows.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
this.dlgShow = !this.dlgShow
|
||||
}
|
||||
},
|
||||
editBtnClick: function (args) {
|
||||
this.isEditing = true
|
||||
this.dlgShow = !this.dlgShow
|
||||
if (args.type === 'actionBegin') {
|
||||
this.rowData = args.rowData
|
||||
return
|
||||
}
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-edit')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.parentElement.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
},
|
||||
onDlgClose () {
|
||||
this.dlgShow = false
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
grid: [Edit, Group, Filter, Page, Selection, CommandColumn, Toolbar]
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent,
|
||||
IssueLicense
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#primarybtn{
|
||||
/* display: block !important; */
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel-group{
|
||||
display: flex;
|
||||
}
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 15px auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,291 @@
|
|||
<template id="view-hardware">
|
||||
<div class="container-fluid">
|
||||
<div id="dialog" style="padding:10px;position:absolute;">
|
||||
<request-form :showing="dlgShow" :isEdit="isEditing" :rowData="rowData" @close="onDlgClose">
|
||||
</request-form>
|
||||
</div>
|
||||
<div class="row top-row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-7 col-md-12"><h3>View Request</h3></div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-2 col-md-6">
|
||||
<ejs-button id="primarybtn" class="asset-btn" :isPrimary="true" v-on:click.native="AddBtnClick"> <span class="e-add-icon"></span> Create Request</ejs-button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 col-md-6 daterange overview-range-picker">
|
||||
<ejs-daterangepicker ref='dateRangePickerObject' class="e-input-group e-input-custom-tag e-control-wrapper e-date-range-wrapper" id='date-wrapper' :placeholder="waterMark" :change="dateRangeChanged">
|
||||
</ejs-daterangepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-12 col-md-12">
|
||||
<ejs-grid class="r-space" ref="gridObj" :rowDataBound="setStyle" :load="onGridLoad" :actionBegin='onActionBegin' :toolbarClick="editToolClicked" :toolbar="toolbar" :actionComplete='onload' :dataSource='gridData' :allowSorting='true' :allowSelection='true' :selectionSettings='selectionSettings' :allowFiltering='true' :allowPaging='true' :allowGrouping='false' :pageSettings='pageSettings' :editSettings='editSettings' :filterSettings='filterSettings'>
|
||||
<e-columns>
|
||||
<e-column field='TaskID' headerText='Task ID' textAlign='Right' width=60 :isPrimaryKey='true'></e-column>
|
||||
<e-column field='Employee' headerText='Employee' width=120></e-column>
|
||||
<e-column field='RequestType' headerText='Request Type' :filter='filter' width=90></e-column>
|
||||
<e-column field='RequestedItem' headerText='Requested Item' :filter='filter' width=120></e-column>
|
||||
<e-column field='RequestedOn' headerText='RequestedOn' textAlign='Right' type='date' editType='datepickeredit' format='yMd' width=90></e-column>
|
||||
<e-column field='Priority' headerText='Priority' :filter='filter' width=70></e-column>
|
||||
<e-column field='Status' headerText='Status' width=70 :visible='false'></e-column>
|
||||
<e-column field='Note' headerText='Notes' :visible='false'></e-column>
|
||||
<e-column headerText='' width='60' :commands='commands' textAlign='left'></e-column>
|
||||
<e-column headerText='' width='150' :commands='labelCommands' textAlign='left' ></e-column>
|
||||
</e-columns>
|
||||
</ejs-grid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { GridPlugin, Edit, Filter, Group, Page, Selection, CommandColumn, Toolbar } from '@syncfusion/ej2-vue-grids'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin, DateRangePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import RequestForm from '@/components/RequestForm'
|
||||
import { requestData, employeeData } from '../datasource.js'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
import { Browser } from '@syncfusion/ej2-base'
|
||||
|
||||
Vue.use(DateRangePickerPlugin)
|
||||
Vue.use(GridPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
dlgShow: false,
|
||||
isEditing: false,
|
||||
rowData: null,
|
||||
waterMark: 'Select a range',
|
||||
gridData: requestData,
|
||||
editSettings: { showDeleteConfirmDialog: true, allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' },
|
||||
toolbar: undefined,
|
||||
editparams: { params: { popupHeight: '300px' } },
|
||||
pageSettings: { pageCount: 5, pageSize: 10 },
|
||||
filterSettings: { type: 'Menu', columns: [] },
|
||||
filter: { type: 'CheckBox' },
|
||||
selectionSettings: { persistSelection: true },
|
||||
commands: [{ type: 'edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat e-noback', click: this.editBtnClick } },
|
||||
{ type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat e-noback' } }],
|
||||
labelCommands: [{ buttonOption: { content: 'Approve', iconCss: '', cssClass: 'e-flat e-approve', click: this.approveClick } },
|
||||
{ buttonOption: { content: 'Reject', iconCss: '', cssClass: 'e-flat e-reject', click: this.rejectClick } }]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onGridLoad: function () {
|
||||
if (Browser.isDevice) {
|
||||
this.toolbar = [{ text: 'Edit', tooltipText: 'Edit', prefixIcon: 'e-edit', id: 'editTool' }, 'Delete']
|
||||
this.$refs.gridObj.ej2Instances.columns[8].visible = false
|
||||
}
|
||||
},
|
||||
onload: function () {
|
||||
},
|
||||
onActionBegin: function (args) {
|
||||
if (args.requestType === 'beginEdit') {
|
||||
this.editBtnClick(args)
|
||||
args.cancel = true
|
||||
}
|
||||
},
|
||||
dateRangeChanged: function (args) {
|
||||
// check wheather the value is empty or not
|
||||
if (args.startDate && args.endDate) {
|
||||
var predicatesStart = new Predicate('RequestedOn', 'greaterthanorequal', args.startDate)
|
||||
var predicatesEnd = new Predicate('RequestedOn', 'lessthanorequal', args.endDate)
|
||||
this.filterSettings = {type: 'Menu', columns: [predicatesStart, predicatesEnd]}
|
||||
} else {
|
||||
this.filterSettings = {type: 'Menu', columns: []}
|
||||
}
|
||||
},
|
||||
AddBtnClick: function () {
|
||||
this.dlgShow = !this.dlgShow
|
||||
this.isEditing = false
|
||||
// this.$refs.dialogObj.show()
|
||||
},
|
||||
editToolClicked: function (args) {
|
||||
if (args.item.id === 'editTool') {
|
||||
this.isEditing = true
|
||||
var rows = this.$refs.gridObj.ej2Instances.getSelectedRows()[0]
|
||||
if (!rows) {
|
||||
this.$refs.gridObj.ej2Instances.editModule.showDialog('EditOperationAlert', this.$refs.gridObj.ej2Instances.editModule.alertDObj)
|
||||
return
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(rows.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
this.dlgShow = !this.dlgShow
|
||||
}
|
||||
},
|
||||
editBtnClick: function (args) {
|
||||
this.isEditing = true
|
||||
this.dlgShow = !this.dlgShow
|
||||
if (args.type === 'actionBegin') {
|
||||
this.rowData = args.rowData
|
||||
return
|
||||
}
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-edit')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.parentElement.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
},
|
||||
setStyle: function (args) {
|
||||
var status = args.data['Status'].toString()
|
||||
if (status === 'Approved') {
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.remove('row-reject')
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.add('row-approve')
|
||||
args.row.querySelector('.e-approve').classList.add('e-hide')
|
||||
args.row.querySelector('.e-reject').classList.add('e-hide')
|
||||
} else if (status === 'Rejected') {
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.remove('row-approve')
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.add('row-reject')
|
||||
args.row.querySelector('.e-approve').classList.add('e-hide')
|
||||
args.row.querySelector('.e-reject').classList.add('e-hide')
|
||||
} else {
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.remove('row-approve')
|
||||
args.row.querySelectorAll('.e-unboundcell')[1].classList.remove('row-reject')
|
||||
args.row.querySelector('.e-approve').classList.remove('e-hide')
|
||||
args.row.querySelector('.e-reject').classList.remove('e-hide')
|
||||
}
|
||||
},
|
||||
onDlgClose () {
|
||||
this.dlgShow = false
|
||||
},
|
||||
approveClick: function (args) {
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-approve')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.getAttribute('data-uid'))
|
||||
var row = rowObj.data
|
||||
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, {'TaskID': row['TaskID'], 'Status': 'Approved'})
|
||||
|
||||
var activity = {
|
||||
'id': this.$store.state.activityData.length,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new request for ' + row['RequestedItem'] + ' has been approved'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Request approved successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
this.$root.$children[0].updatePendingRequests()
|
||||
},
|
||||
rejectClick: function (args) {
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-reject')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.getAttribute('data-uid'))
|
||||
var row = rowObj.data
|
||||
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, {'TaskID': row['TaskID'], 'Status': 'Rejected'})
|
||||
var activity = {
|
||||
'id': this.$store.state.activityData.length,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new request for ' + row['RequestedItem'] + ' has been rejected'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Request rejected successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
this.$root.$children[0].updatePendingRequests()
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
grid: [Edit, Group, Filter, Page, Selection, CommandColumn, Toolbar]
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent,
|
||||
RequestForm
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#primarybtn{
|
||||
/* display: block !important; */
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel-group{
|
||||
display: flex;
|
||||
}
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 15px auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
}
|
||||
.e-flat .e-approve {
|
||||
padding: 2px 10px !important;
|
||||
}
|
||||
.e-approve, .e-reject {
|
||||
background-color: #E2E4E8 !important;
|
||||
font-size: 13px !important;
|
||||
color: #4C4C4C !important;
|
||||
}
|
||||
.e-approve:hover, .e-reject:hover {
|
||||
background-color: #D1D4DB !important;
|
||||
}
|
||||
.e-approve:focus, .e-reject:focus {
|
||||
background-color: #B4B8C0 !important;
|
||||
}
|
||||
|
||||
.e-grid .e-rowcell.e-unboundcell.row-approve {
|
||||
background-image: url('../assets/Approve.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: center;
|
||||
}
|
||||
.row-approve::after {
|
||||
padding-left: 20px;
|
||||
content: 'Approved';
|
||||
color: #0BB60E;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
}
|
||||
.e-grid .e-rowcell.e-unboundcell.row-reject {
|
||||
background-image: url('../assets/Reject.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: center;
|
||||
}
|
||||
.row-reject::after {
|
||||
padding-left: 20px;
|
||||
content: 'Rejected';
|
||||
color: #F64F4C;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,167 @@
|
|||
<template id="view-hardware">
|
||||
<div class="container-fluid">
|
||||
<div id="dialog" style="padding:10px;position:absolute;">
|
||||
<add-software :showing="dlgShow" :isEdit="isEditing" :rowData="rowData" @close="onDlgClose">
|
||||
</add-software>
|
||||
</div>
|
||||
<div class="row top-row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-7 col-md-12"><h3>View Software</h3></div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-2 col-md-6">
|
||||
<ejs-button id="primarybtn" class="asset-btn" :isPrimary="true" v-on:click.native="AddBtnClick"> <span class="e-add-icon"></span> Add New Software</ejs-button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 col-md-6 daterange overview-range-picker">
|
||||
<ejs-daterangepicker ref='dateRangePickerObject' class="e-input-group e-input-custom-tag e-control-wrapper e-date-range-wrapper" id='date-wrapper' :placeholder="waterMark" :change="dateRangeChanged">
|
||||
</ejs-daterangepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-12 col-md-12">
|
||||
<ejs-grid class="r-space" ref="gridObj" :dataSource='gridData' :load="onGridLoad" :actionBegin='onActionBegin' :toolbarClick="editToolClicked" :toolbar="toolbar" :actionComplete='onload' :allowSorting='true' :allowSelection='true' :selectionSettings='selectionSettings' :allowFiltering='true' :allowPaging='true' :allowGrouping='false' :pageSettings='pageSettings' :editSettings='editSettings' :filterSettings='filterSettings'>
|
||||
<e-columns>
|
||||
<e-column field='TaskID' headerText='Task ID' textAlign='Right' width=90 :isPrimaryKey='true'></e-column>
|
||||
<e-column field='Name' headerText='Software Name' :filter='filter' width=120></e-column>
|
||||
<e-column field='Edition' headerText='Edition' width=90></e-column>
|
||||
<e-column field='Version' headerText='Version' width=70></e-column>
|
||||
<e-column field='Vendor' headerText='Vendor' width=100></e-column>
|
||||
<e-column field='LicenseType' headerText='Type' :filter='filter' width=70></e-column>
|
||||
<e-column field='LicenseCount' headerText='Licenses' textAlign='Right' editType='numericedit' format='N' width=90></e-column>
|
||||
<e-column field='DOP' headerText='Purchase Date' textAlign='Right' type='date' editType='datepickeredit' format='yMd' width=110></e-column>
|
||||
<e-column field='ExpiredOn' headerText='Expiry' textAlign='Right' type='date' editType='datepickeredit' format='yMd' width=90></e-column>
|
||||
<e-column field='Category' headerText='Category' :filter='filter' width=90></e-column>
|
||||
<e-column field='Note' headerText='Notes' :visible='false'></e-column>
|
||||
<e-column headerText='' width='70' :commands='commands'></e-column>
|
||||
</e-columns>
|
||||
</ejs-grid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { GridPlugin, Edit, Filter, Group, Page, Selection, CommandColumn, Toolbar } from '@syncfusion/ej2-vue-grids'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin, DateRangePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import AddSoftware from '@/components/AddSoftware'
|
||||
import { softwareData } from '../datasource.js'
|
||||
import { Predicate } from '@syncfusion/ej2-data'
|
||||
import { Browser } from '@syncfusion/ej2-base'
|
||||
|
||||
Vue.use(DateRangePickerPlugin)
|
||||
Vue.use(GridPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
dlgShow: false,
|
||||
isEditing: false,
|
||||
rowData: null,
|
||||
waterMark: 'Select a range',
|
||||
gridData: softwareData,
|
||||
editSettings: { showDeleteConfirmDialog: true, allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' },
|
||||
toolbar: undefined,
|
||||
editparams: { params: { popupHeight: '300px' } },
|
||||
pageSettings: { pageCount: 5, pageSize: 10 },
|
||||
filterSettings: { type: 'Menu', columns: [] },
|
||||
filter: { type: 'CheckBox' },
|
||||
selectionSettings: { persistSelection: true },
|
||||
commands: [{ type: 'edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat e-noback', click: this.editBtnClick } },
|
||||
{ type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat e-noback' } }]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onGridLoad: function () {
|
||||
if (Browser.isDevice) {
|
||||
this.toolbar = [{ text: 'Edit', tooltipText: 'Edit', prefixIcon: 'e-edit', id: 'editTool' }, 'Delete']
|
||||
this.$refs.gridObj.ej2Instances.columns[11].visible = false
|
||||
}
|
||||
},
|
||||
onload: function () {
|
||||
},
|
||||
onActionBegin: function (args) {
|
||||
if (args.requestType === 'beginEdit') {
|
||||
this.editBtnClick(args)
|
||||
args.cancel = true
|
||||
}
|
||||
},
|
||||
dateRangeChanged: function (args) {
|
||||
// check wheather the value is empty or not
|
||||
if (args.startDate && args.endDate) {
|
||||
var predicatesStart = new Predicate('DOP', 'greaterthanorequal', args.startDate)
|
||||
var predicatesEnd = new Predicate('DOP', 'lessthanorequal', args.endDate)
|
||||
this.filterSettings = {type: 'Menu', columns: [predicatesStart, predicatesEnd]}
|
||||
} else {
|
||||
this.filterSettings = {type: 'Menu', columns: []}
|
||||
}
|
||||
},
|
||||
AddBtnClick: function () {
|
||||
this.dlgShow = !this.dlgShow
|
||||
this.isEditing = false
|
||||
},
|
||||
editToolClicked: function (args) {
|
||||
if (args.item.id === 'editTool') {
|
||||
this.isEditing = true
|
||||
var rows = this.$refs.gridObj.ej2Instances.getSelectedRows()[0]
|
||||
if (!rows) {
|
||||
this.$refs.gridObj.ej2Instances.editModule.showDialog('EditOperationAlert', this.$refs.gridObj.ej2Instances.editModule.alertDObj)
|
||||
return
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(rows.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
this.dlgShow = !this.dlgShow
|
||||
}
|
||||
},
|
||||
editBtnClick: function (args) {
|
||||
this.isEditing = true
|
||||
this.dlgShow = !this.dlgShow
|
||||
if (args.type === 'actionBegin') {
|
||||
this.rowData = args.rowData
|
||||
return
|
||||
}
|
||||
var target = args.target
|
||||
if (target.classList.contains('e-edit')) {
|
||||
target = target.parentElement
|
||||
}
|
||||
let rowObj = this.$refs.gridObj.ej2Instances.getRowObjectFromUID(target.parentElement.parentElement.parentElement.getAttribute('data-uid'))
|
||||
this.rowData = rowObj.data
|
||||
},
|
||||
onDlgClose () {
|
||||
this.dlgShow = false
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
grid: [Edit, Group, Filter, Page, Selection, CommandColumn, Toolbar]
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent,
|
||||
AddSoftware
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#primarybtn{
|
||||
/* display: block !important; */
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
.datepicker-panel-group{
|
||||
display: flex;
|
||||
}
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 15px auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,317 @@
|
|||
<template>
|
||||
<div class="container-fluid">
|
||||
<div class="row top-row">
|
||||
<div class="col-lg-8 col-md-8">
|
||||
<h3>Dashboard</h3>
|
||||
</div>
|
||||
<!-- </div>
|
||||
<div class="row"> -->
|
||||
<div class="col-lg-2 col-md-2 dashboard-card">
|
||||
<div tabindex="0" class="e-card" id="card-request" @click="requestClick($event)">
|
||||
<div class="e-card-header">
|
||||
<div class="e-card-header-caption">
|
||||
<div class="e-card-header-title">{{this.$store.getters.requests}}</div>
|
||||
<div class="e-card-sub-title">Requests Processed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 dashboard-card">
|
||||
<div tabindex="0" class="e-card" id="card-license" @click="licenseClick($event)">
|
||||
<div class="e-card-header">
|
||||
<div class="e-card-header-caption">
|
||||
<div class="e-card-header-title">{{this.$store.getters.licenses}}</div>
|
||||
<div class="e-card-sub-title">Licenses Issued</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- <div class="col-lg-12 "> -->
|
||||
<div class="col-lg-8">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 chart-area">
|
||||
<div id='chart01'>
|
||||
<div class='innerChart'>
|
||||
<hardware-status-chart id='chart1'></hardware-status-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="empty-col"></div>
|
||||
<div class="col-lg-6 chart-area">
|
||||
<div id='chart02'>
|
||||
<div class='innerChart'>
|
||||
<hardware-category-chart id='chart2'></hardware-category-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-lg-8 empty-row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 chart-area">
|
||||
<div id='chart03'>
|
||||
<div class='innerChart'>
|
||||
<software-license-chart id='chart3'></software-license-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="empty-col"></div>
|
||||
<div class="col-lg-6 chart-area">
|
||||
<div id='chart04'>
|
||||
<div class='innerChart'>
|
||||
<software-category-chart id='chart4'></software-category-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 list-surface">
|
||||
<div class="list-area">
|
||||
<ejs-listview id='listview_template' ref='list_template' :fields='fields' :dataSource='data' :showHeader='header' :headerTitle='listTitle' :actionComplete='onComplete' :template='ltemplate'></ejs-listview>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ListViewPlugin } from '@syncfusion/ej2-vue-lists'
|
||||
import ActivityTemplate from './ActivityTemplate.vue'
|
||||
import SoftwareLicenseChart from '@/components/dashboard/SoftwareLicenseChart'
|
||||
import HardwareStatusChart from '@/components/dashboard/HardwareStatusChart'
|
||||
import HardwareCategoryChart from '@/components/dashboard/HardwareCategoryChart'
|
||||
import SoftwareCategoryChart from '@/components/dashboard/SoftwareCategoryChart'
|
||||
|
||||
Vue.use(ListViewPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
header: true,
|
||||
data: this.$store.state.activityData,
|
||||
// eslint-disable-next-line
|
||||
ltemplate: function () {
|
||||
return {template: ActivityTemplate}
|
||||
},
|
||||
listTitle: 'Recent Activities',
|
||||
fields: { 'id': 'Employee' }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
requestClick: function (event) {
|
||||
this.$router.push({ path: '/Requests' })
|
||||
this.$root.$children[0].$refs.sidebarListObj.selectItem({id: '05'})
|
||||
},
|
||||
licenseClick: function (event) {
|
||||
this.$router.push({ path: '/IssuedLicenses' })
|
||||
this.$root.$children[0].$refs.sidebarListObj.selectItem({id: '04'})
|
||||
},
|
||||
onComplete: function () {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SoftwareLicenseChart,
|
||||
HardwareStatusChart,
|
||||
HardwareCategoryChart,
|
||||
SoftwareCategoryChart
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dashboard-card {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#card-request,
|
||||
#card-license {
|
||||
height: 80px;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
#card-request {
|
||||
background-color: #B991DA;
|
||||
}
|
||||
#card-request:hover {
|
||||
background-color: #946DB4;
|
||||
}
|
||||
#card-license {
|
||||
background-color: #60D6A2;
|
||||
}
|
||||
#card-license:hover {
|
||||
background-color: #4DAE83;
|
||||
}
|
||||
.e-card-header-title {
|
||||
color: #FFFFFF !important;
|
||||
font-size: 26px !important;
|
||||
font-family: Roboto;
|
||||
font-weight: '1000';
|
||||
}
|
||||
.e-card-sub-title {
|
||||
color: #FFFFFF !important;
|
||||
font-family: Roboto;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
.chart-area {
|
||||
height: 296px;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
#chart01,
|
||||
#chart02,
|
||||
#chart03,
|
||||
#chart04 {
|
||||
height: 296px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
background: #fff;
|
||||
}
|
||||
#chart001,
|
||||
#chart002,
|
||||
#chart003,
|
||||
#chart004 {
|
||||
height: 250px !important;
|
||||
}
|
||||
.list-area {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
height: 612px;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.row.col-lg-8.empty-row {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1366px){
|
||||
.chart-area {
|
||||
height: 296px;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
#chart01,
|
||||
#chart02,
|
||||
#chart03,
|
||||
#chart04 {
|
||||
height: 296px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
background: #fff;
|
||||
}
|
||||
#chart001,
|
||||
#chart002,
|
||||
#chart003,
|
||||
#chart004 {
|
||||
height: 250px !important;
|
||||
}
|
||||
.list-area {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
height: 612px;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 1600px){
|
||||
.chart-area {
|
||||
height: 350px;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
#chart01,
|
||||
#chart02,
|
||||
#chart03,
|
||||
#chart04 {
|
||||
height: 350px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
background: #fff;
|
||||
}
|
||||
#chart001,
|
||||
#chart002,
|
||||
#chart003,
|
||||
#chart004 {
|
||||
height: 300px !important;
|
||||
}
|
||||
.list-area {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
height: 720px;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 1900px){
|
||||
.chart-area {
|
||||
height: 370px;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
#chart01,
|
||||
#chart02,
|
||||
#chart03,
|
||||
#chart04 {
|
||||
height: 370px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
background: #fff;
|
||||
}
|
||||
#chart001,
|
||||
#chart002,
|
||||
#chart003,
|
||||
#chart004 {
|
||||
height: 320px !important;
|
||||
}
|
||||
.list-area {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 2px 8px #7b77885e;
|
||||
height: 760px;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px){
|
||||
.chart-area{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.empty-row{
|
||||
padding: 0px !important;
|
||||
}
|
||||
}
|
||||
|
||||
#chart-title {
|
||||
font-size: 14px;
|
||||
font-family: Helvetica, 'Segoe UI', Tahoma, Geneva, Verdana, Arial;
|
||||
color: #323C47;
|
||||
padding-top: 16px;
|
||||
padding-left: 10px;
|
||||
margin: 0 0 5px !important;
|
||||
}
|
||||
|
||||
.list-surface {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#listview_template.e-listview .e-list-item {
|
||||
padding: 10px;
|
||||
/* height: 65px; */
|
||||
line-height: 15px !important;
|
||||
}
|
||||
#listview_template.e-listview .e-list-header {
|
||||
margin-bottom: 15px;
|
||||
color: #323C47;
|
||||
font-family: helvetica;
|
||||
font-weight: 600 !important;
|
||||
height: 50px !important;
|
||||
}
|
||||
#listview_template.e-listview .e-list-item {
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,257 @@
|
|||
<template>
|
||||
<ejs-dialog ref="dialogObj" :isModal='isModal' id="dialog" v-bind:visible="isShowing" :header='header' :animationSettings='animationSettings' :allowDragging='true' :showCloseIcon='showCloseIcon' :target='target' :width='width' :open="dialogOpen" :close="dialogClose">
|
||||
<form id="formId" class="dlg-form" novalidate="">
|
||||
<div class="col-lg-12 e-input-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row" v-show="isEdit">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Task ID</label>
|
||||
<input id="taskID" class="e-input" type="text" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
|
||||
<label class="e-text">Employee Name</label>
|
||||
<ejs-autocomplete id="employee" name="Emp" data-msg-containerid="errorEmp" :dataSource='this.$store.getters.empData' :fields='fields'></ejs-autocomplete>
|
||||
<div id="errorEmp"></div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
|
||||
<label class="e-text">Software</label>
|
||||
<ejs-dropdownlist id="software" name="Name" :dataSource ="this.$store.getters.softwareNames" :fields='softwareFields'></ejs-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
|
||||
<label class="e-text">No. Of Available Licenses</label>
|
||||
<input id="license-count" class="e-input" type="text" disabled>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
|
||||
<label class="e-text">License Key</label>
|
||||
<input id="license-key" name="License" class="e-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
|
||||
<label class="e-text">Issued On</label>
|
||||
<ejs-datepicker class="e-input" id="issue-date" data-msg-containerid="errorID" name="DOI" :max="maxDate"></ejs-datepicker>
|
||||
<div id="errorID"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-12 col-md-12">
|
||||
<label class="e-text">Note</label>
|
||||
<textarea class="e-input" rows="4" id="note"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pull-right">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
|
||||
<ejs-button id="primarybtn" :isPrimary="true" @click.native="addRecord">{{btnName}}</ejs-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</ejs-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import { FormValidator } from '@syncfusion/ej2-vue-inputs'
|
||||
import { employeeData } from '../datasource.js'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.use(ButtonPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
fields: {value: 'Employee'},
|
||||
softwareFields: { text: 'Name', value: 'TaskID' },
|
||||
header: 'Issue License',
|
||||
target: document.body,
|
||||
showCloseIcon: true,
|
||||
width: '500px',
|
||||
btnName: 'Submit',
|
||||
isModal: true,
|
||||
maxDate: new Date(),
|
||||
options: {
|
||||
// Initialize the CustomPlacement.
|
||||
customPlacement: function (inputElement, errorElement) {
|
||||
inputElement.parentElement.nextElementSibling.appendChild(errorElement)
|
||||
},
|
||||
rules: {
|
||||
Emp: { required: true },
|
||||
DOI: { required: true, date: true }
|
||||
}
|
||||
},
|
||||
frmObj: undefined,
|
||||
animationSettings: { effect: 'None' }
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.frmObj = new FormValidator('#formId', this.options)
|
||||
},
|
||||
methods: {
|
||||
dialogClose: function () {
|
||||
this.$emit('close')
|
||||
},
|
||||
dialogOpen: function () {
|
||||
this.frmObj.reset()
|
||||
if (!this.isEdit) {
|
||||
this.header = 'Issue License'
|
||||
this.btnName = 'Submit'
|
||||
document.getElementById('employee').value = ''
|
||||
document.getElementById('software').value = ''
|
||||
document.getElementById('license-count').value = '0'
|
||||
document.getElementById('license-key').value = ''
|
||||
document.getElementById('issue-date').value = new Date().toLocaleDateString()
|
||||
document.getElementById('note').value = ''
|
||||
} else {
|
||||
this.header = 'Edit Issued license'
|
||||
this.btnName = 'Save'
|
||||
var row = this.rowData
|
||||
document.getElementById('taskID').value = row['TaskID']
|
||||
document.getElementById('employee').value = row['Employee']
|
||||
document.getElementById('software').value = row['Software']
|
||||
document.getElementById('license-count').value = '10' // row['InvoiceNo']
|
||||
document.getElementById('license-key').value = row['LicenseKey']
|
||||
document.getElementById('issue-date').value = row['IssuedOn'].toLocaleDateString()
|
||||
document.getElementById('note').value = row['Note']
|
||||
}
|
||||
this.$refs.dialogObj.show()
|
||||
},
|
||||
addRecord: function () {
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
if (this.frmObj.validate()) {
|
||||
if (!this.isEdit) {
|
||||
var id = this.$store.state.activityData.length
|
||||
grid.addRecord({
|
||||
'TaskID': grid.dataSource.length + 1,
|
||||
'Employee': document.getElementById('employee').value,
|
||||
'Email': 'paul.henriot@sample.com',
|
||||
'Software': document.getElementById('software').value,
|
||||
'LicenseKey': document.getElementById('license-key').value,
|
||||
'IssuedOn': document.getElementById('issue-date').value,
|
||||
'Note': document.getElementById('note').value
|
||||
})
|
||||
var activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new License for software' + document.getElementById('software').value + ' has been issued'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'License Issued successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
} else {
|
||||
var data = {'TaskID': +document.getElementById('taskID').value,
|
||||
'Employee': document.getElementById('employee').value,
|
||||
'Email': 'paul.henriot@sample.com',
|
||||
'Software': document.getElementById('software').value,
|
||||
'LicenseKey': document.getElementById('license-key').value,
|
||||
'IssuedOn': document.getElementById('issue-date').value,
|
||||
'Note': document.getElementById('note').value
|
||||
}
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, data)
|
||||
activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'The License for software ' + document.getElementById('software').value + ' has been edited'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'License updated successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
}
|
||||
this.frmObj.reset()
|
||||
this.$refs.dialogObj.hide()
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent
|
||||
},
|
||||
props: {
|
||||
/** Whether the dialog is currently showing */
|
||||
showing: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
rowData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowing () {
|
||||
return this.showing
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
|
||||
.content-wrapper div.row {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.control-label {
|
||||
padding: 24px 0px 0px 0px;
|
||||
font-size: 12px;
|
||||
opacity: 0.54;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
.e-input-section .col-xs-6,
|
||||
.e-input-section .col-xs-4,
|
||||
.e-input-section .col-xs-12 {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.content-wrapper div.row {
|
||||
padding: 0px;
|
||||
}
|
||||
#dialog {
|
||||
top: 10px;
|
||||
/* height: 100%; */
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,58 @@
|
|||
<template>
|
||||
<ejs-sidebar id="sidebar-notification" :type='type' ref="notifybarInstance" :showBackdrop='showBackdrop' :enableDock='enableDock' :width='width' :position="position" :target="sidebarTarget">
|
||||
<ejs-listview id='listview_notification' :fields='fields' ref='list_notification' :dataSource='data' :showHeader='header' :headerTitle='listTitle' :template='ltemplate' :select='onComplete'></ejs-listview>
|
||||
</ejs-sidebar>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ListViewPlugin } from '@syncfusion/ej2-vue-lists'
|
||||
import ActivityTemplate from './ActivityTemplate.vue'
|
||||
|
||||
Vue.use(ListViewPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
header: true,
|
||||
data: this.$store.state.activityData,
|
||||
// eslint-disable-next-line
|
||||
ltemplate: function () {
|
||||
return {template: ActivityTemplate}
|
||||
},
|
||||
fields: { 'id': 'Employee' },
|
||||
listTitle: 'Notifications',
|
||||
type: 'Over',
|
||||
width: '300px',
|
||||
enableDock: false,
|
||||
closeOnDocumentClick: true,
|
||||
showBackdrop: false,
|
||||
sidebarTarget: navigator.userAgent.indexOf('Firefox') !== -1 ? 'body' : '.content',
|
||||
position: 'Right'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggle: function () {
|
||||
this.$refs.list_notification.ej2Instances.reRender()
|
||||
this.$refs.notifybarInstance.toggle()
|
||||
},
|
||||
hide: function () {
|
||||
this.$refs.notifybarInstance.hide()
|
||||
},
|
||||
onComplete: function () {
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#listview_notification.e-listview .e-list-item {
|
||||
padding: 10px;
|
||||
line-height: 15px !important;
|
||||
}
|
||||
#listview_notification.e-listview .e-list-header {
|
||||
margin-bottom: 15px;
|
||||
height: 50px !important;
|
||||
}
|
||||
#listview_notification.e-listview .e-list-item {
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,300 @@
|
|||
<template>
|
||||
<ejs-dialog ref="dialogObj" id="dialog" :isModal='isModal' v-bind:visible="isShowing" :header='header' :animationSettings='animationSettings' :allowDragging='true' :showCloseIcon='showCloseIcon' :target='target' :width='width' :open="dialogOpen" :close="dialogClose">
|
||||
<form id="formId" class="dlg-form" novalidate="">
|
||||
<div class="col-lg-12 e-input-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row" v-show="isEdit">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Task ID</label>
|
||||
<input id="taskID" class="e-input" type="text" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Employee Name</label>
|
||||
<ejs-autocomplete id="employee" name="Emp" data-msg-containerid="errorEmp" :dataSource='this.$store.getters.empData' :fields='fields' required></ejs-autocomplete>
|
||||
<div id="errorEmp"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Request Type</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<ejs-radiobutton label="Hardware" id="HardwareRB" name="type" value="Hardware" checked="true" @change="getType" ></ejs-radiobutton>
|
||||
<ejs-radiobutton label="Software" id="SoftwareRB" name="type" value="Software" @change="getType"></ejs-radiobutton>
|
||||
</div>
|
||||
<div v-show="isHardware">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Hardware</label>
|
||||
<ejs-dropdownlist id="Hardware" name="Hardware" :dataSource ="this.$store.getters.hardwareNames" :fields='hardwareFields'></ejs-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="!isHardware">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Software</label>
|
||||
<ejs-dropdownlist id="Software" name="Software" :dataSource ="this.$store.getters.softwareNames" :fields='softwareFields'></ejs-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Requested On</label>
|
||||
<ejs-datepicker id="requested-on" name="DOR" data-msg-containerid="errorID" class="e-input" :max="maxDate" required></ejs-datepicker>
|
||||
<div id="errorID"></div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-12">
|
||||
<label class="e-text">Priority</label>
|
||||
<ejs-dropdownlist id="priority" name="Priority" :dataSource ="priortyList"></ejs-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-lg-12 col-md-12">
|
||||
<label class="e-text">Note</label>
|
||||
<textarea id="note" class="e-input" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pull-right">
|
||||
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
|
||||
<ejs-button id="primarybtn" :isPrimary="true" @click.native="addRecord">{{btnName}}</ejs-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</ejs-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ButtonPlugin, RadioButtonPlugin } from '@syncfusion/ej2-vue-buttons'
|
||||
import { DatePickerPlugin } from '@syncfusion/ej2-vue-calendars'
|
||||
import { DropDownListComponent, AutoCompletePlugin } from '@syncfusion/ej2-vue-dropdowns'
|
||||
import { DialogPlugin } from '@syncfusion/ej2-vue-popups'
|
||||
import { employeeData } from '../datasource.js'
|
||||
import { FormValidator } from '@syncfusion/ej2-vue-inputs'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(DialogPlugin)
|
||||
Vue.use(RadioButtonPlugin)
|
||||
Vue.component(DropDownListComponent)
|
||||
Vue.use(DatePickerPlugin)
|
||||
Vue.component(ButtonPlugin)
|
||||
Vue.use(AutoCompletePlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
priortyList: [
|
||||
{ id: 'stat-1', text: 'Low' },
|
||||
{ id: 'stat-2', text: 'Normal' },
|
||||
{ id: 'stat-3', text: 'High' },
|
||||
{ id: 'stat-4', text: 'Critical' }
|
||||
],
|
||||
softwareFields: { text: 'Name', value: 'TaskID' },
|
||||
hardwareFields: { text: 'Name', value: 'TaskID' },
|
||||
selectedType: 'Hardware',
|
||||
isHardware: true,
|
||||
header: 'Request Form',
|
||||
target: document.body,
|
||||
showCloseIcon: true,
|
||||
btnName: 'Submit Request',
|
||||
width: '500px',
|
||||
isModal: true,
|
||||
fields: {value: 'Employee'},
|
||||
query: new Query().select(['id', 'Employee']),
|
||||
enableDate: true,
|
||||
maxDate: new Date(),
|
||||
options: {
|
||||
// Initialize the CustomPlacement.
|
||||
customPlacement: function (inputElement, errorElement) {
|
||||
inputElement.parentElement.nextElementSibling.appendChild(errorElement)
|
||||
},
|
||||
rules: {
|
||||
Emp: { required: true },
|
||||
DOR: { required: true, date: true }
|
||||
}
|
||||
},
|
||||
frmObj: undefined,
|
||||
animationSettings: { effect: 'None' }
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selectedType: function (newType) {
|
||||
this.$dispatch('selectedType', newType)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
DropDownListComponent
|
||||
},
|
||||
mounted: function () {
|
||||
this.frmObj = new FormValidator('#formId', this.options)
|
||||
},
|
||||
methods: {
|
||||
getType: function () {
|
||||
this.isHardware = document.getElementById('HardwareRB').checked
|
||||
},
|
||||
dialogClose: function () {
|
||||
this.$emit('close')
|
||||
},
|
||||
dialogOpen: function () {
|
||||
this.frmObj.reset()
|
||||
this.enableDate = true
|
||||
if (!this.isEdit) {
|
||||
this.header = 'Request Form'
|
||||
this.btnName = 'Submit Request'
|
||||
document.getElementById('employee').value = ''
|
||||
document.getElementById('HardwareRB').checked = true
|
||||
document.getElementById('Hardware').value = ''
|
||||
document.getElementById('requested-on').value = new Date().toLocaleDateString()
|
||||
document.getElementById('priority').value = 'Normal'
|
||||
document.getElementById('note').value = ''
|
||||
} else {
|
||||
this.header = 'Edit Request'
|
||||
this.btnName = 'Save'
|
||||
var row = this.rowData
|
||||
var type = row['RequestType']
|
||||
document.getElementById('taskID').value = row['TaskID']
|
||||
document.getElementById('employee').value = row['Employee']
|
||||
document.getElementById(type + 'RB').checked = true
|
||||
this.getType()
|
||||
document.getElementById('requested-on').value = row['RequestedOn'].toLocaleDateString()
|
||||
document.getElementById(type).value = row['RequestedItem']
|
||||
document.getElementById('priority').value = row['Priority']
|
||||
document.getElementById('note').value = row['Note']
|
||||
}
|
||||
this.$refs.dialogObj.show()
|
||||
},
|
||||
addRecord: function () {
|
||||
var grid = document.querySelector('.e-grid')['ej2_instances'][0]
|
||||
var userName = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['Employee']
|
||||
var userImg = new DataManager(employeeData).executeLocal(new Query().where(new Predicate('id', 'equal', this.$store.state.currentUserID)))[0]['ImgSrc']
|
||||
if (this.frmObj.validate()) {
|
||||
var id = this.$store.state.activityData.length
|
||||
var type = document.querySelector('input[name=type]:checked').value
|
||||
if (!this.isEdit) {
|
||||
grid.addRecord({
|
||||
'TaskID': grid.dataSource.length + 1,
|
||||
'Employee': document.getElementById('employee').value,
|
||||
'RequestType': type,
|
||||
'RequestedItem': document.getElementById(type).value,
|
||||
'Priority': document.getElementById('priority').value,
|
||||
'Status': 'Pending',
|
||||
'Note': document.getElementById('note').value,
|
||||
'RequestedOn': document.getElementById('requested-on').value
|
||||
})
|
||||
var activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'A new request for ' + document.getElementById(type).value + ' has been generated'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Request generated successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
} else {
|
||||
var data = {'TaskID': +document.getElementById('taskID').value,
|
||||
'Employee': document.getElementById('employee').value,
|
||||
'RequestType': type,
|
||||
'RequestedItem': document.getElementById(type).value,
|
||||
'Priority': document.getElementById('priority').value,
|
||||
'Note': document.getElementById('note').value,
|
||||
'RequestedOn': document.getElementById('requested-on').value,
|
||||
'Status': this.rowData['Status']
|
||||
}
|
||||
var index = grid.selectedRowIndex
|
||||
grid.editModule.updateRow(index, data)
|
||||
activity = {
|
||||
'id': id,
|
||||
'Employee': userName,
|
||||
'ImgSrc': userImg,
|
||||
'TimeStamp': new Date().toLocaleDateString(),
|
||||
'Message': 'The request for ' + document.getElementById(type).value + ' has been updated'
|
||||
}
|
||||
this.$store.dispatch('addActivity', Object.assign({}, activity)).then(() => {
|
||||
this.$root.$children[0].$refs.toastRef.show({
|
||||
title: 'Successs!',
|
||||
content: 'Request updated successfully',
|
||||
cssClass: 'e-toast-success',
|
||||
icon: 'e-success toast-icons'
|
||||
})
|
||||
}).catch((reason) => {
|
||||
alert(reason)
|
||||
})
|
||||
}
|
||||
this.frmObj.reset()
|
||||
this.$refs.dialogObj.hide()
|
||||
this.$emit('close')
|
||||
} else {
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
/** Whether the dialog is currently showing */
|
||||
showing: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
rowData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowing () {
|
||||
return this.showing
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-wrapper {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-width: 185px;
|
||||
}
|
||||
|
||||
.content-wrapper div.row {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.control-label {
|
||||
padding: 24px 0px 0px 0px;
|
||||
font-size: 12px;
|
||||
opacity: 0.54;
|
||||
}
|
||||
@media only screen and (max-width: 480px) {
|
||||
.content-wrapper {
|
||||
width: 92%;
|
||||
}
|
||||
.e-input-section .col-xs-6,
|
||||
.e-input-section .col-xs-4,
|
||||
.e-input-section .col-xs-12 {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.content-wrapper div.row {
|
||||
padding: 0px;
|
||||
}
|
||||
#dialog {
|
||||
top: 10px;
|
||||
/* height: 100%; */
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,66 @@
|
|||
<template>
|
||||
<div>
|
||||
<p id="chart-title">Statistics by Hardware Category</p>
|
||||
<ejs-chart style='display:block' align='center' id='chart002' :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis'
|
||||
:chartArea='chartArea' :tooltip='tooltip'>
|
||||
<e-series-collection>
|
||||
<e-series :dataSource='this.$store.getters.laptopData' :query='laptopQuery' type='Column' xName='key' yName='count' name='Laptop' :marker='marker' fill='#A6DC7E'> </e-series>
|
||||
<e-series :dataSource='this.$store.getters.monitorData' :query='monitorQuery' type='Column' xName='key' yName='count' name='Monitor' :marker='marker' fill='#6EB5D0'> </e-series>
|
||||
<e-series :dataSource='this.$store.getters.tabletData' :query='tabletQuery' type='Column' xName='key' yName='count' name='Tablet' :marker='marker' fill='#7E7EDC'> </e-series>
|
||||
<e-series :dataSource='this.$store.getters.miscData' :query='miscQuery' type='Column' xName='key' yName='count' name='Miscellaneous' :marker='marker' fill='#D075C6'> </e-series>
|
||||
</e-series-collection>
|
||||
</ejs-chart>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ChartPlugin, ColumnSeries, Category, DataLabel, Tooltip, Legend } from '@syncfusion/ej2-vue-charts'
|
||||
import { Query } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(ChartPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
laptopQuery: new Query().take(this.$store.getters.laptopData.length),
|
||||
monitorQuery: new Query().take(this.$store.getters.monitorData.length),
|
||||
tabletQuery: new Query().take(this.$store.getters.tabletData.length),
|
||||
miscQuery: new Query().take(this.$store.getters.miscData.length),
|
||||
// Initializing Primary X Axis
|
||||
primaryXAxis: {
|
||||
valueType: 'Category', interval: 0, majorGridLines: { width: 0 }
|
||||
},
|
||||
chartArea: { border: { width: 0 } },
|
||||
|
||||
// Initializing Primary Y Axis
|
||||
primaryYAxis:
|
||||
{
|
||||
minimum: 0,
|
||||
maximum: 8,
|
||||
interval: 10,
|
||||
majorGridLines: { width: 0 },
|
||||
majorTickLines: { width: 0 },
|
||||
lineStyle: { width: 0 },
|
||||
labelStyle: { color: 'transparent' }
|
||||
},
|
||||
theme: 'Fabric',
|
||||
width: '100%',
|
||||
marker:
|
||||
{ dataLabel:
|
||||
{ visible: true, position: 'Top', font: { fontWeight: '600' }
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
enable: true
|
||||
},
|
||||
title: 'Statistics by Hardware Category',
|
||||
enableSmartLabels: true
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
chart: [ColumnSeries, Legend, DataLabel, Category, Tooltip]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<div>
|
||||
<p id="chart-title">Statistics by Hardware Status</p>
|
||||
<ejs-accumulationchart ref='hardware-pie' :theme='theme' style='display:block' align='center' id='chart001'
|
||||
:legendSettings='legendSettings' :tooltip='tooltip' enableSmartLables='true'>
|
||||
<e-accumulation-series-collection>
|
||||
<e-accumulation-series :dataSource='this.$store.getters.hardwareStatus' :query='queries' xName='key' yName='count' :dataLabel='dataLabel' :startAngle='startAngle' :endAngle='endAngle' :explodeOffset='explodeOffset' :explodeIndex='explodeIndex' :radius='radius' name='Hardware' innerRadius='0%' explode='true' width=2 :palettes="colors"> </e-accumulation-series>
|
||||
</e-accumulation-series-collection>
|
||||
</ejs-accumulationchart>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { AccumulationChartPlugin, AccumulationTooltip, PieSeries, AccumulationDataLabel, AccumulationLegend } from '@syncfusion/ej2-vue-charts'
|
||||
import { Query } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(AccumulationChartPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
theme: 'Fabric',
|
||||
queries: new Query().take(this.$store.getters.hardwareStatus.length),
|
||||
title: 'Statistics by Hardware Status',
|
||||
enableSmartLabels: true,
|
||||
legendSettings: {
|
||||
visible: true,
|
||||
position: 'Bottom'
|
||||
},
|
||||
tooltip: { enable: true },
|
||||
startAngle: '0',
|
||||
endAngle: '360',
|
||||
radius: '90%',
|
||||
explodeOffset: '5%',
|
||||
explodeIndex: 0,
|
||||
colors: ['#7F9FD2', '#81B8B3', '#7FD29F', '#AEEB8E'],
|
||||
dataLabel: {
|
||||
visible: true,
|
||||
position: 'Inside',
|
||||
name: 'text',
|
||||
font: {
|
||||
fontWeight: '600'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
accumulationchart: [AccumulationLegend, PieSeries, AccumulationTooltip, AccumulationDataLabel]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,9 @@
|
|||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<div>
|
||||
<p id="chart-title">Statistics by Software Category</p>
|
||||
<ejs-treemap id='chart004' :leafItemSettings='leafItemSettings'
|
||||
format='n' :useGroupingSeparator='useGroupingSeparator'
|
||||
:dataSource='dataSource' :legendSettings='legendSettings' :palette='palette' :tooltipSettings='tooltipSettings'
|
||||
:weightValuePath='weightValuePath' :levels='levels'>
|
||||
</ejs-treemap>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { TreeMapPlugin, TreeMapTooltip, TreeMapLegend } from '@syncfusion/ej2-vue-treemap'
|
||||
|
||||
Vue.use(TreeMapPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
useGroupingSeparator: true,
|
||||
dataSource: this.$store.state.softwareInput,
|
||||
legendSettings: {
|
||||
visible: true,
|
||||
position: 'Bottom',
|
||||
shape: 'Rectangle',
|
||||
shapeHeight: 7,
|
||||
shapeWidth: 7
|
||||
},
|
||||
palette: ['#AEEB8E', '#D075C6', '#7E7EDC', '#7EC9DC', '#D6DC7E'],
|
||||
tooltipSettings: {
|
||||
visible: true,
|
||||
// eslint-disable-next-line
|
||||
format: '${Name}<br>License Count : ${LicenseCount}'
|
||||
},
|
||||
leafItemSettings: {
|
||||
labelPath: 'Name',
|
||||
border: { color: '#000000', width: 0.5 }
|
||||
},
|
||||
weightValuePath: 'LicenseCount',
|
||||
levels: [
|
||||
{
|
||||
groupPath: 'Category', border: 'none' // { color: 'white', width: 0.5 }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
treemap: [TreeMapTooltip, TreeMapLegend]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<div>
|
||||
<p id="chart-title">Statistics by Software License Type</p>
|
||||
<ejs-accumulationchart ref='software-pie' :theme='theme' style='display:block' align='center' id='chart003'
|
||||
:legendSettings='legendSettings' :tooltip='tooltip' enableSmartLables='true'>
|
||||
<e-accumulation-series-collection>
|
||||
<e-accumulation-series :dataSource='this.$store.getters.softwareLicense' :query='queries' xName='key' yName='count' :dataLabel='dataLabel' :startAngle='startAngle' :endAngle='endAngle' :explodeOffset='explodeOffset' :explodeIndex='explodeIndex' :radius='radius' name='Software License' innerRadius='0%' explode='true' width=2 :palettes="colors"> </e-accumulation-series>
|
||||
</e-accumulation-series-collection>
|
||||
</ejs-accumulationchart>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { AccumulationChartPlugin, AccumulationTooltip, PieSeries, AccumulationDataLabel, AccumulationLegend } from '@syncfusion/ej2-vue-charts'
|
||||
import { Query } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(AccumulationChartPlugin)
|
||||
export default Vue.extend({
|
||||
data: function () {
|
||||
return {
|
||||
theme: 'Fabric',
|
||||
queries: new Query().take(this.$store.getters.softwareLicense.length),
|
||||
title: 'Statistics by Software License Type',
|
||||
enableSmartLabels: true,
|
||||
legendSettings: {
|
||||
visible: true,
|
||||
position: 'Bottom'
|
||||
},
|
||||
tooltip: { enable: true },
|
||||
startAngle: '0',
|
||||
endAngle: '360',
|
||||
radius: '90%',
|
||||
explodeOffset: '5%',
|
||||
explodeIndex: 0,
|
||||
colors: ['#FDC288', '#A483D5', '#CB85AA'],
|
||||
dataLabel: {
|
||||
visible: true,
|
||||
position: 'Inside',
|
||||
name: 'text',
|
||||
font: {
|
||||
fontWeight: '600'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
provide: {
|
||||
accumulationchart: [AccumulationLegend, PieSeries, AccumulationTooltip, AccumulationDataLabel]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,18 @@
|
|||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.config.devtools = true
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
store,
|
||||
components: { App },
|
||||
template: '<App/>',
|
||||
data: {}
|
||||
})
|
|
@ -0,0 +1,70 @@
|
|||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
import AddHardware from '@/components/AddHardware'
|
||||
import AddSoftware from '@/components/AddSoftware'
|
||||
import RequestForm from '@/components/RequestForm'
|
||||
import IssueLicense from '@/components/IssueLicense'
|
||||
import AllHardware from '@/components/AllHardware'
|
||||
import dashboard from '@/components/Dashboard'
|
||||
import AllSoftware from '@/components/AllSoftware'
|
||||
import AllRequests from '@/components/AllRequests'
|
||||
import AllIssuedLicenses from '@/components/AllIssuedLicenses'
|
||||
import About from '@/components/About'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Dashboard',
|
||||
component: dashboard
|
||||
},
|
||||
{
|
||||
path: '/About',
|
||||
name: 'About',
|
||||
component: About
|
||||
},
|
||||
{
|
||||
path: '/Software',
|
||||
name: 'Software',
|
||||
component: AllSoftware
|
||||
},
|
||||
{
|
||||
path: '/Hardware',
|
||||
name: 'Hardware',
|
||||
component: AllHardware
|
||||
},
|
||||
{
|
||||
path: '/AddHardware',
|
||||
name: 'AddHardware',
|
||||
component: AddHardware
|
||||
},
|
||||
{
|
||||
path: '/AddSoftware',
|
||||
name: 'AddSoftware',
|
||||
component: AddSoftware
|
||||
},
|
||||
{
|
||||
path: '/RequestForm',
|
||||
name: 'RequestForm',
|
||||
component: RequestForm
|
||||
},
|
||||
{
|
||||
path: '/Requests',
|
||||
name: 'Requests',
|
||||
component: AllRequests
|
||||
},
|
||||
{
|
||||
path: '/IssuedLicenses',
|
||||
name: 'Issued Licenses',
|
||||
component: AllIssuedLicenses
|
||||
},
|
||||
{
|
||||
path: '/IssueLicense',
|
||||
name: 'IssueLicense',
|
||||
component: IssueLicense
|
||||
}
|
||||
]
|
||||
})
|
|
@ -0,0 +1,82 @@
|
|||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
import { requestData, licenseData, hardwareData, softwareData, listData, employeeData } from '../datasource.js'
|
||||
import { DataManager, Query, Predicate } from '@syncfusion/ej2-data'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
requestInput: requestData,
|
||||
licensesInput: licenseData,
|
||||
hardwareInput: hardwareData,
|
||||
softwareInput: softwareData,
|
||||
activityData: listData,
|
||||
empInput: employeeData,
|
||||
currentUserID: 2
|
||||
},
|
||||
getters: {
|
||||
requests: state => {
|
||||
return new DataManager(state.requestInput).executeLocal(new Query().where(new Predicate('Status', 'notequal', 'Pending'))).length
|
||||
},
|
||||
pendingRequests: state => {
|
||||
return new DataManager(state.requestInput).executeLocal(new Query().where(new Predicate('Status', 'equal', 'Pending'))).length
|
||||
},
|
||||
licenses: state => {
|
||||
return state.licensesInput.length
|
||||
},
|
||||
hardwareNames: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().select(['Name', 'TaskID']))
|
||||
},
|
||||
hardwareStatus: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().group('Status'))
|
||||
},
|
||||
laptopData: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().where(new Predicate('Category', 'equal', 'Laptop')).group('Status'))
|
||||
},
|
||||
monitorData: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().where(new Predicate('Category', 'equal', 'Monitor')).group('Status'))
|
||||
},
|
||||
tabletData: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().where(new Predicate('Category', 'equal', 'Tablet')).group('Status'))
|
||||
},
|
||||
miscData: state => {
|
||||
return new DataManager(state.hardwareInput).executeLocal(new Query().where(new Predicate('Category', 'equal', 'Miscellaneous')).group('Status'))
|
||||
},
|
||||
softwareNames: state => {
|
||||
return new DataManager(state.softwareInput).executeLocal(new Query().select(['Name', 'TaskID']))
|
||||
},
|
||||
softwareLicense: state => {
|
||||
return new DataManager(state.softwareInput).executeLocal(new Query().group('LicenseType'))
|
||||
},
|
||||
softwareCategory: state => {
|
||||
return new DataManager(state.softwareInput).executeLocal(new Query().group('Category'))
|
||||
},
|
||||
empData: state => {
|
||||
return new DataManager(state.empInput).executeLocal(new Query().select(['id', 'Employee']))
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
addActivity (state, activity) {
|
||||
state.activityData.push(activity)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
addActivity (context, activity) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var userExist = context.state.empInput.find((user) => {
|
||||
return user.Employee === activity.Employee
|
||||
})
|
||||
if (!userExist) {
|
||||
reject(new Error('No such user found!'))
|
||||
} else if (activity.Employee === '') {
|
||||
reject(new Error('User name cannot be empty!'))
|
||||
} else {
|
||||
context.commit('addActivity', activity)
|
||||
resolve(Object.assign({}, userExist))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
После Ширина: | Высота: | Размер: 6.4 KiB |
|
@ -0,0 +1,27 @@
|
|||
// A custom Nightwatch assertion.
|
||||
// The assertion name is the filename.
|
||||
// Example usage:
|
||||
//
|
||||
// browser.assert.elementCount(selector, count)
|
||||
//
|
||||
// For more information on custom assertions see:
|
||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||
|
||||
exports.assertion = function (selector, count) {
|
||||
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
||||
this.expected = count
|
||||
this.pass = function (val) {
|
||||
return val === this.expected
|
||||
}
|
||||
this.value = function (res) {
|
||||
return res.value
|
||||
}
|
||||
this.command = function (cb) {
|
||||
var self = this
|
||||
return this.api.execute(function (selector) {
|
||||
return document.querySelectorAll(selector).length
|
||||
}, [selector], function (res) {
|
||||
cb.call(self, res)
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
require('babel-register')
|
||||
var config = require('../../config')
|
||||
|
||||
// http://nightwatchjs.org/gettingstarted#settings-file
|
||||
module.exports = {
|
||||
src_folders: ['test/e2e/specs'],
|
||||
output_folder: 'test/e2e/reports',
|
||||
custom_assertions_path: ['test/e2e/custom-assertions'],
|
||||
|
||||
selenium: {
|
||||
start_process: true,
|
||||
server_path: require('selenium-server').path,
|
||||
host: '127.0.0.1',
|
||||
port: 4444,
|
||||
cli_args: {
|
||||
'webdriver.chrome.driver': require('chromedriver').path
|
||||
}
|
||||
},
|
||||
|
||||
test_settings: {
|
||||
default: {
|
||||
selenium_port: 4444,
|
||||
selenium_host: 'localhost',
|
||||
silent: true,
|
||||
globals: {
|
||||
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
|
||||
}
|
||||
},
|
||||
|
||||
chrome: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
},
|
||||
|
||||
firefox: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'firefox',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
// 1. start the dev server using production config
|
||||
process.env.NODE_ENV = 'testing'
|
||||
|
||||
const webpack = require('webpack')
|
||||
const DevServer = require('webpack-dev-server')
|
||||
|
||||
const webpackConfig = require('../../build/webpack.prod.conf')
|
||||
const devConfigPromise = require('../../build/webpack.dev.conf')
|
||||
|
||||
let server
|
||||
|
||||
devConfigPromise.then(devConfig => {
|
||||
const devServerOptions = devConfig.devServer
|
||||
const compiler = webpack(webpackConfig)
|
||||
server = new DevServer(compiler, devServerOptions)
|
||||
const port = devServerOptions.port
|
||||
const host = devServerOptions.host
|
||||
return server.listen(port, host)
|
||||
})
|
||||
.then(() => {
|
||||
// 2. run the nightwatch test suite against it
|
||||
// to run in additional browsers:
|
||||
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
||||
// 2. add it to the --env flag below
|
||||
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
||||
// For more information on Nightwatch's config file, see
|
||||
// http://nightwatchjs.org/guide#settings-file
|
||||
let opts = process.argv.slice(2)
|
||||
if (opts.indexOf('--config') === -1) {
|
||||
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
||||
}
|
||||
if (opts.indexOf('--env') === -1) {
|
||||
opts = opts.concat(['--env', 'chrome'])
|
||||
}
|
||||
|
||||
const spawn = require('cross-spawn')
|
||||
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||
|
||||
runner.on('exit', function (code) {
|
||||
server.close()
|
||||
process.exit(code)
|
||||
})
|
||||
|
||||
runner.on('error', function (err) {
|
||||
server.close()
|
||||
throw err
|
||||
})
|
||||
})
|
|
@ -0,0 +1,19 @@
|
|||
// For authoring Nightwatch tests, see
|
||||
// http://nightwatchjs.org/guide#usage
|
||||
|
||||
module.exports = {
|
||||
'default e2e tests': function (browser) {
|
||||
// automatically uses dev Server port from /config.index.js
|
||||
// default: http://localhost:8080
|
||||
// see nightwatch.conf.js
|
||||
const devServer = browser.globals.devServerURL
|
||||
|
||||
browser
|
||||
.url(devServer)
|
||||
.waitForElementVisible('#app', 5000)
|
||||
.assert.elementPresent('.hello')
|
||||
.assert.containsText('h1', 'Welcome to Your Vue.js App')
|
||||
.assert.elementCount('img', 1)
|
||||
.end()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"globals": {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
rootDir: path.resolve(__dirname, '../../'),
|
||||
moduleFileExtensions: [
|
||||
'js',
|
||||
'json',
|
||||
'vue'
|
||||
],
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1'
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||
},
|
||||
testPathIgnorePatterns: [
|
||||
'<rootDir>/test/e2e'
|
||||
],
|
||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||
setupFiles: ['<rootDir>/test/unit/setup'],
|
||||
mapCoverage: true,
|
||||
coverageDirectory: '<rootDir>/test/unit/coverage',
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{js,vue}',
|
||||
'!src/main.js',
|
||||
'!src/router/index.js',
|
||||
'!**/node_modules/**'
|
||||
]
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import Vue from 'vue'
|
||||
|
||||
Vue.config.productionTip = false
|
|
@ -0,0 +1,11 @@
|
|||
import Vue from 'vue'
|
||||
import HelloWorld from '@/components/HelloWorld'
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('should render correct contents', () => {
|
||||
const Constructor = Vue.extend(HelloWorld)
|
||||
const vm = new Constructor().$mount()
|
||||
expect(vm.$el.querySelector('.hello h1').textContent)
|
||||
.toEqual('Welcome to Your Vue.js App')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,14 @@
|
|||
var webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
entry: "./src/common/index.js",
|
||||
entry: { 'src/common/index.min': './src/common/index' },
|
||||
output: {
|
||||
path: __dirname + '/',
|
||||
filename: '[name].js',
|
||||
libraryTarget: 'this'
|
||||
},
|
||||
plugins: [
|
||||
|
||||
]
|
||||
}
|