Commit 6545fded authored by ztf's avatar ztf

新增科研计划app

parent 207768f4
...@@ -40,5 +40,6 @@ const subMicroModules = [ ...@@ -40,5 +40,6 @@ const subMicroModules = [
'dee-production', 'dee-production',
'dee-quality', 'dee-quality',
'dee-equipment', 'dee-equipment',
'dee-performance' 'dee-performance',
'dee-plan'
] ]
\ No newline at end of file
...@@ -40,5 +40,6 @@ export const microModules = [ ...@@ -40,5 +40,6 @@ export const microModules = [
'dee-production', 'dee-production',
'dee-quality', 'dee-quality',
'dee-equipment', 'dee-equipment',
'dee-performance' 'dee-performance',
'dee-plan'
] ]
...@@ -46,8 +46,8 @@ export default { ...@@ -46,8 +46,8 @@ export default {
}, },
data() { data() {
return { return {
linksName: 'ApplyDoc', linksName: 'ExtApplyDoc',
replayLinksName: 'ReplyDoc', replayLinksName: 'EXtReplyDoc',
loading: false, loading: false,
tableData: [], tableData: [],
selection: [], selection: [],
......
build/*.js
src/assets/*.js
public
dist
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
# app-javascript
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn run serve
```
### Compiles and minifies for production
```
yarn run build
```
### Run your tests
```
yarn run test
```
### Lints and fixes files
```
yarn run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/app'
]
}
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true,
'coverageReporters': [
'lcov',
'text-summary'
],
testURL: 'http://localhost/'
}
{
"name": "dee-plan",
"devPort": 10303,
"version": "0.1.0",
"scripts": {
"serve": "vue-cli-service serve",
"lint": "vue-cli-service lint",
"build": "vue-cli-service build --report"
},
"dependencies": {
"axios": "^0.19.2",
"lodash.foreach": "^4.5.0",
"moment": "^2.26.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuedraggable": "2.23.0",
"vuex": "^3.1.2",
"xlsx": "^0.18.5",
"xlsx-js-style": "^1.2.0"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/register": "7.0.0",
"@vue/cli-plugin-babel": "3.6.0",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.6.3",
"@vue/cli-service": "^4.1.0",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^8.0.1",
"babel-jest": "23.6.0",
"chalk": "2.4.2",
"connect": "3.6.6",
"css-loader": "^1.0.1",
"eslint": "5.15.3",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"lint-staged": "^10.2.9",
"mockjs": "1.0.1-beta3",
"node-sass": "^4.14.1",
"runjs": "^4.3.2",
"sass-loader": "^7.3.1",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"style-loader": "^1.1.3",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.2",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.4.1"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/prettier"
],
"rules": {
"no-console": "off",
"no-unused-vars": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"lint-staged": {
"*.{js,vue}": [
"vue-cli-service lint",
"git add"
]
},
"license": "MIT"
}
<template>
<div class="app">
<router-view />
</div>
</template>
<script>
import './base'
export default {}
</script>
<style scoped>
.app {
height: 100%;
}
</style>
import {
get,
del,
post,
put
} from '../utils/http'
import $store from '@/store'
// 获取我的收藏数据
export function getCollectData(params) {
return get('/ObjectFavoriteLog/findLogPage', params)
}
// 获取最近访问数据和经常访问
export function getRecentlyVisitData(params) {
return get('/ObjectVisitedLog/findLogPage', params)
}
// 清除最近访问和经常访问
export function delRecentlyAndCommonVisitData() {
return del('/ObjectVisitedLog/clear')
}
// 清除经常访问
export function delCommonVisitData() {
return del('/ObjectFavoriteLog/delSession')
}
// 取消收藏对象
export function cancelCollect(params) {
return post('/ObjectFavoriteLog/unCollect', params)
}
// 修改密码
export function revisePassword(params) {
return post('/DxUserAccount/password/revise', params)
}
// 用户定制APP
export function collectUserApp(params) {
return post(`/userApplication/collect?dxApplicationId=${params}`, true)
}
// 获取用户定制的APP
export function getUserAppList() {
// return get('/userApplication/findCollections')
return $store.dispatch('apiCache/getRequestCache', { url: '/userApplication/findCollections' })
}
// 用户取消定制APP
export function unCollectUserApp(params) {
return post(`/userApplication/unCollect?dxApplicationId=${params}`)
}
// 更新用户信息
export function updateUserInfo(params) {
return put('/DxUserInfo', params)
}
// 获取存储库id
export function getBucketByAppID(params) {
return get('/RepoBucket/getBucketByAppID', params)
}
// 用户上传头像时获取桶
export function getBucketIdByAppName(innerName) {
return post('/userPicture/findBucketId', innerName)
}
// 文件下载
export function downloadFileById(id) {
return get(`/dfs/fileManager/download?fileId=${id}`, null, true)
}
// 查询用户数据
export function getUserInfo(id) {
return get(`/DxUserInfo/${id}`)
}
// 查询用户模块
export function getUserModule() {
// return get('/userModel/findCollections')
return $store.dispatch('apiCache/getRequestCache', { url: '/userModel/findCollections' })
}
// 根据模块id查询模块信息
export function getModuleById(ids) {
// return get(`/DxAppModule/byIds?ids=${ids}`)
return $store.dispatch('apiCache/getRequestCache', { url: `/DxAppModule/byIds?ids=${ids}` })
}
// 用户添加模块
export function collectUserModel(params) {
// const ids = params.map(x => `modelCardIdS=${x}`).join('&')
// const str = ids ? ('?' + ids) : ''
// return post(`/userModel/collect${str}`)
return post(`/userModel/collect`, params)
}
// 用户删除模块
export function unCollectUserModel(id) {
return post(`/userModel/unCollect?modelCode=${id}`)
}
// 根据工作空间id获取首页排序后的数据
export function getPageByWorkspaceId(params) {
return get('/DxWorkspace/findWorkspaceListById', params)
}
export function getUserByScope(params) {
return post('/workflow/inst/participants/scope', params)
}
export function userSearch(params) {
return post('/DxUserInfo/search', params)
}
import Vue from 'vue'
import store from './store'
// 子项目异步注册 store module
// Vue.__share_pool__.store.registerModule(process.env.VUE_APP_NAME, store)
Vue.__share_pool__.store.registerModule('config', store)
export default null
// import Vue from 'vue'
// import routes from './routes'
// import '@/styles/index.scss' // global css
// const sharePool = (Vue.__share_pool__ = Vue.__share_pool__ || {})
// const store = (sharePool.store = sharePool.store || {})
import privateComponents from './privateComponents/index'
function loadComponent(comName, type) {
let resolveComponent
if (type === 'privateComponents') {
resolveComponent = resolve => { require([`@/privateComponents/${'components' + comName}`], resolve) }
} else if (type === 'view') {
resolveComponent = resolve => { require([`@/views/${comName}`], resolve) }
}
return resolveComponent
}
export default {
name: 'dee-plan',
privateComponents,
loadComponent,
beforeEach(from, to, next) {
next()
},
init() {}
}
<!-- -->
<template>
<div />
</template>
<script>
export default {
name: 'Demo',
componentName: '测试',
props: {
},
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang='scss' scoped>
</style>
const requireComponent = require.context(
'./components', // 在当前目录下查找
true, // 遍历子文件夹
/\.vue$/ // 正则匹配 以 .vue结尾的文件
)
const privateComponents = []
requireComponent.keys().forEach(fileName => {
const comp = requireComponent(fileName)
if (comp.default.componentName) {
let layoutConfigData = comp.default.layoutConfigData
if (!layoutConfigData && comp.default.mixins) {
const hasLayoutConfigData = comp.default.mixins.find(el => {
return el.layoutConfigData
})
if (hasLayoutConfigData) {
layoutConfigData = hasLayoutConfigData.layoutConfigData
}
}
privateComponents.push(
{
componentName: comp.default.componentName,
name: comp.default.name,
path: fileName.slice(1),
layoutConfigData: layoutConfigData || []
}
)
}
})
export default privateComponents
const containerComponents = [
'AppendDoc'
]
const formListComponents = [
'AppendDoc'
]
const tabComponents = [
'AppendDoc'
]
const tableListComponents = [
'AppendDoc'
]
export default {
containerComponents,
formListComponents,
tabComponents,
tableListComponents
}
/* routes-list */
// const APP_NAME = process.env.VUE_APP_NAME;
// import Vue from 'vue'
// const sharePool = (Vue.__share_pool__ = Vue.__share_pool__ || {})
// const store = (sharePool.store = sharePool.store || {})
const App = () => import('./App.vue')
export default [
{
path: '/docCenter',
name: 'docCenter',
component: () => import('@/views/doc/center'),
meta: { title: '文档中心', alive: true }
},
{
path: '/doc',
component: App,
name: 'doc',
meta: { title: '文档中心', icon: 'xitong' },
redirect: '/doc/add',
children: [
{
hidden: true,
path: 'add',
name: 'docAdd',
component: () => import('@/views/doc/add'),
meta: { title: '新建文档', alive: false }
},
{
hidden: true,
path: 'edit',
name: 'docEdit',
component: () => import('@/views/doc/edit'),
meta: { title: '编辑文档' }
}
]
}
]
/* store module */
import { actionInit } from '@/utils/store.js'
export default {
namespaced: true, // namespaced must be true in module app.
state: {
name: process.env.VUE_APP_NAME
},
mutations: {},
actions: actionInit()
}
import Vue from 'vue'
export default new Vue()
This diff is collapsed.
import Vue from 'vue'
const sharePool = (Vue.__share_pool__ = Vue.__share_pool__ || {})
const http = (sharePool.http = sharePool.http || {})
function get(url, params) {
return http.get(url, params)
}
function post(url, params) {
return http.post(url, params)
}
function put(url, params) {
return http.put(url, params)
}
function patch(url, params) {
return http.patch(url, params)
}
function del(url, params) {
return http.del(url, params)
}
function downloadFile(url, type) {
return http.downloadFile(url, type)
}
function downloadFileWithParams(url, type, params) {
return http.downloadFile(url, type, params)
}
function downloadZip(url, type) {
return http.downloadZip(url, type)
}
export { get, post, put, del, patch, downloadFile, downloadZip, downloadFileWithParams }
/**
* Created by CXG on 19/7/3.
*/
/**
* @param {Object} sapproval
* @param {Object} selfAction
* @returns {Object}
*/
export function actionInit(sapproval, selfAction) {
const resOBj = {}
if (sapproval) {
Object.keys(sapproval).forEach(function(key) {
resOBj[key] = ({ commit }, params) => {
return new Promise((resolve, reject) => {
sapproval[key](params).then(res => {
resolve(res)
}).catch(error => {
reject(error)
})
})
}
})
}
if (selfAction) {
return Object.assign(resOBj, selfAction)
} else {
return resOBj
}
}
const webpack = require('webpack')
const APP_NAME = require('./package.json').name
const PORT = require('./package.json').devPort
const NODE_ENV = process.env.NODE_ENV || 'development'
const path = require('path')
log('APP_NAME: ', APP_NAME)
log('NODE_ENV: ', NODE_ENV)
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: `${NODE_ENV === 'development' ? '' : '.'}/${APP_NAME}/`,
css: {
extract: false
},
productionSourceMap: false,
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack: (config) => {
config.externals({
'vue': 'Vue'
})
config.output
.filename('main.js')
.chunkFilename('[name].[chunkhash:8].js')
.jsonpFunction(`webpackJsonp-${APP_NAME}`)
.library(`app-${APP_NAME}`)
.libraryExport('default')
.libraryTarget('umd')
config.optimization.splitChunks(false)
config.plugin('define').use(webpack.DefinePlugin, [{
'process.env.VUE_APP_NAME': JSON.stringify(APP_NAME)
}])
config.plugins
.delete('html')
.delete('preload')
.delete('prefetch')
},
devServer: {
port: PORT
}
}
function log(label, content, options) {
console.log('\x1b[1m%s\x1b[31m%s\x1b[0m', label, content)
}
...@@ -22,6 +22,7 @@ const apps = [ ...@@ -22,6 +22,7 @@ const apps = [
'dee-production', 'dee-production',
'dee-quality', 'dee-quality',
'dee-equipment', 'dee-equipment',
'dee-performance' 'dee-performance',
'dee-plan'
] ]
module.exports = apps; module.exports = apps;
\ No newline at end of file
...@@ -22,5 +22,6 @@ export const modules = [ ...@@ -22,5 +22,6 @@ export const modules = [
'dee-production', 'dee-production',
'dee-quality', 'dee-quality',
'dee-equipment', 'dee-equipment',
'dee-performance' 'dee-performance',
'dee-plan'
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment