Commit 513dfaa1 by lishengfu

update

parent fb8d001f
# self-service # typescript
## Project setup ## Project setup
``` ```
npm install yarn install
``` ```
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
npm run serve yarn run serve
``` ```
### Compiles and minifies for production ### Compiles and minifies for production
``` ```
npm run build yarn run build
``` ```
### Run your tests ### Run your tests
``` ```
npm run test yarn run test
``` ```
### Lints and fixes files ### Lints and fixes files
``` ```
npm run lint yarn run lint
``` ```
### Customize configuration ### Customize configuration
......
module.exports = { module.exports = {
presets: [ presets: [
'@vue/app' '@vue/app'
],
plugins: [
['import', {
libraryName: 'vant',
libraryDirectory: 'es',
style: true
}, 'vant']
] ]
} }
This diff could not be displayed because it is too large.
{ {
"name": "self-service", "name": "typescript",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build" "build": "vue-cli-service build",
"lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@types/qs": "^6.9.3", "@types/qs": "^6.9.3",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.4", "core-js": "^2.6.11",
"oidc-client": "^1.10.1", "oidc-client": "^1.10.1",
"qs": "^6.9.4", "qs": "^6.9.4",
"qs.js": "^0.1.12", "vant": "^2.2.0",
"ts-loader": "^7.0.5", "vue": "^2.6.10",
"vant": "^2.8.3",
"vue": "^2.6.11",
"vue-axios": "^2.1.5",
"vue-class-component": "^7.2.3", "vue-class-component": "^7.2.3",
"vue-property-decorator": "^8.4.1", "vue-router": "^3.3.1",
"vue-router": "^3.1.6", "vuex": "^3.4.0"
"vuex": "^3.1.3"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.3.0", "@vue/cli-plugin-babel": "^3.8.0",
"@vue/cli-plugin-typescript": "^4.3.0", "@vue/cli-plugin-typescript": "^3.8.1",
"@vue/cli-service": "^4.3.0", "@vue/cli-service": "^3.8.3",
"babel-plugin-import": "^1.13.0", "less": "^3.9.0",
"less": "^3.0.4",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1", "postcss-pxtorem": "^5.1.1",
"ts-import-plugin": "^1.6.6", "ts-import-plugin": "^1.5.5",
"typescript": "~3.8.3", "typescript": "^3.5.1",
"vue-template-compiler": "^2.6.11" "vue-property-decorator": "^8.4.2",
"vue-template-compiler": "^2.6.10"
} }
} }
No preview for this file type
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title>typescript</title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but typescript doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
<template> <template>
<div>
<router-view /> <router-view />
</div>
</template> </template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
export default class App extends Vue {
}
</script>
<style lang="less">
</style>
// import "babel-polyfill"; //import "babel-polyfill";
import Oidc from "oidc-client"; import Oidc from "oidc-client";
var mgr = new Oidc.UserManager({ var mgr = new Oidc.UserManager({
...@@ -8,6 +8,7 @@ var mgr = new Oidc.UserManager({ ...@@ -8,6 +8,7 @@ var mgr = new Oidc.UserManager({
}); });
mgr.signinRedirectCallback().then(function (user: any) { mgr.signinRedirectCallback().then(function (user: any) {
let returnUrl = localStorage.getItem("returnUrl"); let returnUrl = localStorage.getItem("returnUrl");
if (returnUrl) { if (returnUrl) {
window.location.href = returnUrl; window.location.href = returnUrl;
......
import Vue from 'vue' import Vue from 'vue';
import App from './App.vue' import App from './App.vue';
import router from './router' import router from './router'
import store from './store' import store from './store'
import "./assets/css/index.less"
import 'amfe-flexible/index.js' import 'amfe-flexible/index.js'
import server from '@/services/install'; import server from '@/services/install';
Vue.config.productionTip = false;
Vue.use(server)
Vue.config.productionTip = false
Vue.use(server);
new Vue({ new Vue({
router, router,
store, store,
render: h => h(App) render: (h) => h(App),
}).$mount('#app') }).$mount('#app');
...@@ -59,6 +59,7 @@ router.beforeEach((to, from, next) => { ...@@ -59,6 +59,7 @@ router.beforeEach((to, from, next) => {
} }
const requiresAuth = to.matched.some(record => record.meta.requiresAuth); const requiresAuth = to.matched.some(record => record.meta.requiresAuth);
localStorage.setItem("returnUrl", to.path); localStorage.setItem("returnUrl", to.path);
//更改标题 //更改标题
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
*/ */
export interface EmployeeInterface { export interface EmployeeInterface {
getUserInfo(params: any): Promise<any>; getUserInfo(params: any): Promise<any>;
getWorkInfoDetail(params: any): Promise<any>; getWorkInfoList(params: any): Promise<any>; //获取工作信息列表
putEmail(params: any): Promise<any>; getWorkInfoDetail(params: any): Promise<any>; //获取工作信息详情
getPersonInfo(params: any): Promise<any>; //获取个人信息
savePersonInfo(params: any): Promise<any>; //保存个人信息
getContactInfo(params: any): Promise<any>; //获取联系信息
saveContactInfo(params: any): Promise<any>; //保存联系信息
getSocialInfo(params: any): Promise<any>; //获取社保信息
saveSocialInfo(params: any): Promise<any>; //保存社保信息
getWageCardInfo(params: any): Promise<any>; //获取工资卡信息
saveWageCardInfo(params:any):Promise<any>; //保存工资卡信息
getEduExperience(params:any):Promise<any>; //获取教育经历
getEduExperienceDetial(params:any):Promise<any>; //获取教育信息详情
addEduExperience(params:any):Promise<any>; //新增教育信息
updateEduExperience(params:any):Promise<any>; //修改教育信息
getTechnologyExperience(params:any):Promise<any>; //获取技术特长
updateTechnologyExperience(params:any):Promise<any>; //修改技术特长
} }
...@@ -52,7 +52,16 @@ class EmployeeService implements EmployeeInterface { ...@@ -52,7 +52,16 @@ class EmployeeService implements EmployeeInterface {
} }
/** /**
* 获取工作信息 * 获取工作信息列表
* @param params 请求参数
*/
public getWorkInfoList(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/work`;
return request.get(url, params, this.header)
}
/**
* 获取工作信息详情
* @param params 请求参数 * @param params 请求参数
*/ */
...@@ -62,17 +71,131 @@ class EmployeeService implements EmployeeInterface { ...@@ -62,17 +71,131 @@ class EmployeeService implements EmployeeInterface {
} }
/** /**
* 修改邮箱 * 获取个人信息
* @param params 请求参数
*/
public getPersonInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/info`;
return request.get(url, params, this.header)
}
/**
* 保存个人信息
* @param params 请求参数
*/
public savePersonInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/info`;
return request.post(url, params, this.header)
}
/**
* 获取联系信息
* @param params 请求参数
*/
public getContactInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/contact/info`;
return request.get(url, params, this.header)
}
/**
* 保存联系信息
* @param params 请求参数
*/
public saveContactInfo(params: any): Promise<any> {
let url = `/api/user/contact/${params.edId}/info`;
return request.post(url, params, this.header)
}
/**
* 获取社保信息
* @param params 请求参数
*/
public getSocialInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/unit/relation`;
return request.get(url, params, this.header)
}
/**
* 保存社保信息
* @param params 请求参数
*/
public saveSocialInfo(params: any): Promise<any> {
let url = `/api/user/employee/unit/relation/save`;
return request.post(url, params, this.header)
}
/**
* 获取工资卡信息
* @param params 请求参数
*/
public getWageCardInfo(params: any): Promise<any> {
let url = `/api/user/contact/${params.edId}/salary/card/info`;
return request.get(url, params, this.header)
}
/**
* 保存工资卡信息
* @params params
*/
public saveWageCardInfo(params: any): Promise<any> {
let url = `/api/user/contact/salary/card/info`;
return request.post(url, params, this.header)
}
/**
* 获取教育经历
* @param params 请求参数 * @param params 请求参数
*/ */
public putEmail(params: any): Promise<any> { public getEduExperience(params: any): Promise<any> {
// // /v2/internal/account/{userId}/download/{accountId}/summary let url = `/api/user/employee/${params.edId}/education`;
// let url3=aa('/v2/internal/account/{userId}/download/{accountId}/summary',params) return request.get(url, params, this.header)
// let url1 = `${urls.employeeUrl}/${this.version}/internal/account/${params.userId}/download/${params.accountId}/summary`; }
let url = `${urls.employeeUrl}/${this.version}/users/${this.sub}/email`;
return request.put(url, params, this.header);
/**
* 获取教育信息详细
* @param params
*/
public getEduExperienceDetial(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/education/detial`;
return request.get(url, params, this.header)
}
/**
* 新增教育信息
* @param params
*/
public addEduExperience(params: any): Promise<any> {
let url = `/api/user/employee/edu/info`;
return request.post(url, params, this.header)
}
/**
* 修改教育信息
* @param params
*/
public updateEduExperience(params: any): Promise<any> {
let url = `/api/user/employee/edu/info`;
return request.put(url, params, this.header)
} }
/**
* 获取技术特长
* @param params
*/
public getTechnologyExperience(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/expertise/info`;
return request.get(url, params, this.header)
}
/**
* 修改技术特长
* @param params
*/
public updateTechnologyExperience(params: any): Promise<any> {
let url = `/api/user/employee/expertise/info`;
return request.put(url, params, this.header)
}
} }
......
import Vue, { VNode } from 'vue' import Vue, { VNode } from 'vue';
declare global { declare global {
namespace JSX { namespace JSX {
...@@ -7,7 +7,7 @@ declare global { ...@@ -7,7 +7,7 @@ declare global {
// tslint:disable no-empty-interface // tslint:disable no-empty-interface
interface ElementClass extends Vue {} interface ElementClass extends Vue {}
interface IntrinsicElements { interface IntrinsicElements {
[elem: string]: any [elem: string]: any;
} }
} }
} }
declare module '*.vue' { declare module '*.vue' {
import Vue from 'vue' import Vue from 'vue';
export default Vue export default Vue;
} }
<template> <template>
<div class="home"> <div class="home">
<van-button type="primary" ></van-button> <van-button type="primary" >普通按钮</van-button>
</div> </div>
</template> </template>
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
"jsx": "preserve", "jsx": "preserve",
"importHelpers": true, "importHelpers": true,
"moduleResolution": "node", "moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"experimentalDecorators":true,
"sourceMap": true, "sourceMap": true,
"baseUrl": ".", "baseUrl": ".",
"types": [ "types": [
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"src/**/*.tsx", "src/**/*.tsx",
"src/**/*.vue", "src/**/*.vue",
"tests/**/*.ts", "tests/**/*.ts",
"tests/**/*.tsx", "src/api/index.js" "tests/**/*.tsx"
], ],
"exclude": [ "exclude": [
"node_modules" "node_modules"
......
const path = require("path");
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const tsImportPluginFactory = require('ts-import-plugin'); const tsImportPluginFactory = require('ts-import-plugin');
module.exports = { module.exports = {
// 基本路径
publicPath: "/",
// 输出文件目录
outputDir: "dist", outputDir: "dist",
publicPath: process.env.NODE_ENV === 'production' ? '/selfservice/' : '/',
pages: { pages: {
app: { app: {
...@@ -38,17 +37,16 @@ module.exports = { ...@@ -38,17 +37,16 @@ module.exports = {
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: config => { chainWebpack: config => {
config.module config.module
.rule('tsx') .rule('ts')
.use('ts-loader') .use('ts-loader')
.loader('ts-loader')
.tap(options => { .tap(options => {
options = merge(options, { options = merge(options, {
transpileOnly: true, transpileOnly: true,
getCustomTransformers: () => ({ getCustomTransformers: () => ({
before: [ before: [
tsImportPluginFactory({ tsImportPluginFactory({
libraryName: "vant", libraryName: 'vant',
libraryDirectory: "es", libraryDirectory: 'es',
style: true style: true
}) })
] ]
...@@ -58,7 +56,6 @@ module.exports = { ...@@ -58,7 +56,6 @@ module.exports = {
} }
}); });
return options; return options;
//return Object.assign(options || {}, { allowTsInNodeModules: true });
}); });
}, },
configureWebpack: config => { configureWebpack: config => {
...@@ -92,23 +89,23 @@ module.exports = { ...@@ -92,23 +89,23 @@ module.exports = {
pwa: {}, pwa: {},
// webpack-dev-server 相关配置 // webpack-dev-server 相关配置
devServer: { devServer: {
open: true,//process.platform === "darwin", open: false,//process.platform === "darwin",
host: "0.0.0.0", host: "0.0.0.0",
port: 8080, port: 8080,
https: false, https: false,
hotOnly: false, hotOnly: false,
proxy: { // proxy: {
"/api": { // "/api": {
target: "http://192.168.1.101:8080", // target: "http://192.168.1.101:8080",
// target: "http://192.168.1.46:8001", // // target: "http://192.168.1.46:8001",
// target: "http://106.120.107.150:8001", // // target: "http://106.120.107.150:8001",
ws: true, // ws: true,
changeOrigin: true, // changeOrigin: true,
pathRewrite: { // pathRewrite: {
"^/api": "/" // "^/api": "/"
} // }
}, // },
}, // },
// historyApiFallback: { // historyApiFallback: {
// rewrites: [ // rewrites: [
// { from: /^\/single/, to: '/single.html' }, // { from: /^\/single/, to: '/single.html' },
...@@ -123,4 +120,5 @@ module.exports = { ...@@ -123,4 +120,5 @@ module.exports = {
patterns: [] patterns: []
} }
} }
}; };
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 sign in to comment