Commit f9a403bb authored by sixiaofeng's avatar sixiaofeng

1

parent c9ceaf42
VUE_APP_OSS_TEMPLATE=https://ccccchy-test.obs.cn-east-3.myhuaweicloud.com/oa/员工导入模板.xlsx
VUE_APP_DOWNLOADPAGE=https://3syxin.com/
VUE_APP_QRCODE_URL=http://121.40.18.70:8886
\ No newline at end of file
VUE_APP_QRCODE_URL=http://121.40.18.70:8886
VUE_APP_ENV=test
\ No newline at end of file
......@@ -8,10 +8,10 @@ module.exports = {
'browser': true,
'node': true,
'es6': true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
}
// "parser": "vue-eslint-parser",
// "parserOptions": {
// "parser": "babel-eslint",
// "sourceType": "module"
// }
}
......@@ -5,8 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:txga": "vue-cli-service build --mode txga",
"build:txmz": "vue-cli-service build --mode txmz",
"build:police": "vue-cli-service build --mode police",
"build:people": "vue-cli-service build --mode people",
"deploy": "npm run build && bash deploy.sh",
"lint": "vue-cli-service lint --fix"
},
......
File added
No preview for this file type
......@@ -10,7 +10,7 @@ import service from './service'
import { global } from '@/const/Global'
import dsbridge from 'dsbridge'
import { Dialog, Toast, Notify } from 'vant'
// import VConsole from 'vconsole'
import VConsole from 'vconsole'
Vue.config.productionTip = false
Vue.use(Dialog).use(Toast).use(Notify)
......@@ -20,7 +20,9 @@ Vue.use(utils).use(service)
Vue.prototype.$dsbridge = dsbridge
Vue.prototype.$global = global
// new VConsole()
if (['police', 'people'].indexOf(process.env.VUE_APP_ENV as string) < 0) {
new VConsole()
}
new Vue({
router,
......
......@@ -52,19 +52,19 @@ export const teamRoutes: Array<RouteConfig> = [
title: '添加成员'
}
},
{
path: 'team-frame/:id',
name: 'TeamDetail',
component: () => import('@/views/team/team-frame.vue'),
meta: {
title: '团队架构'
}
},
{
path: 'member/:id',
name: 'TeamMember',
component: () => import('@/views/team/member-info.vue')
},
// {
// path: 'team-frame/:id',
// name: 'TeamDetail',
// component: () => import('@/views/team/team-frame.vue'),
// meta: {
// title: '团队架构'
// }
// },
// {
// path: 'member/:id',
// name: 'TeamMember',
// component: () => import('@/views/team/member-info.vue')
// },
{
path: 'create-team',
name: 'CreateTeam',
......@@ -81,14 +81,14 @@ export const teamRoutes: Array<RouteConfig> = [
title: '团队二维码'
}
},
{
path: 'edit-member/:id',
name: 'EditMember',
component: () => import('@/views/team/edit-member.vue'),
meta: {
title: '编辑成员'
}
},
// {
// path: 'edit-member/:id',
// name: 'EditMember',
// component: () => import('@/views/team/edit-member.vue'),
// meta: {
// title: '编辑成员'
// }
// },
{
path: 'department-management/:id',
name: 'DepartmentManagement',
......@@ -134,22 +134,22 @@ export const teamRoutes: Array<RouteConfig> = [
title: '申请管理'
}
},
{
path: 'select-team',
name: 'SelectTeam',
component: () => import('@/views/team/select-team.vue'),
meta: {
title: '选择部门'
}
},
{
path: 'select-team/:id',
name: 'SelectTeamDetail',
component: () => import('@/views/team/select-team.vue'),
meta: {
title: '选择部门'
}
},
// {
// path: 'select-team',
// name: 'SelectTeam',
// component: () => import('@/views/team/select-team.vue'),
// meta: {
// title: '选择部门'
// }
// },
// {
// path: 'select-team/:id',
// name: 'SelectTeamDetail',
// component: () => import('@/views/team/select-team.vue'),
// meta: {
// title: '选择部门'
// }
// },
{
path: 'search-team',
name: 'SearchTeam',
......@@ -187,38 +187,38 @@ export const teamRoutes: Array<RouteConfig> = [
title: '完善团队信息'
}
},
{
path: 'team-name',
name: 'TeamName',
component: () => import('@/views/team/team-info/team-name.vue'),
meta: {
title: '团队名称'
}
},
{
path: 'team-description',
name: 'TeamDescription',
component: () => import('@/views/team/team-info/team-description.vue'),
meta: {
title: '团队描述'
}
},
{
path: 'team-avator',
name: 'TeamAvator',
component: () => import('@/views/team/team-info/team-avator.vue'),
meta: {
title: '团队头像'
}
},
{
path: 'my-info',
name: 'Myinfo',
component: () => import('@/views/team/team-info/my-info.vue'),
meta: {
title: '我的信息'
}
},
// {
// path: 'team-name',
// name: 'TeamName',
// component: () => import('@/views/team/team-info/team-name.vue'),
// meta: {
// title: '团队名称'
// }
// },
// {
// path: 'team-description',
// name: 'TeamDescription',
// component: () => import('@/views/team/team-info/team-description.vue'),
// meta: {
// title: '团队描述'
// }
// },
// {
// path: 'team-avator',
// name: 'TeamAvator',
// component: () => import('@/views/team/team-info/team-avator.vue'),
// meta: {
// title: '团队头像'
// }
// },
// {
// path: 'my-info',
// name: 'Myinfo',
// component: () => import('@/views/team/team-info/my-info.vue'),
// meta: {
// title: '我的信息'
// }
// },
{
path: 'join-create',
name: 'JoinCreate',
......
......@@ -90,7 +90,7 @@ export default class Staff extends BaseService {
* @param {AddStaffDTO} data {AddStaffDTO}
* @returns
*/
async addMember(data:AddStaffDTO) {
async addMember(data:AddStaffDTO) {
return await this.useService(this.router.addMember, data)
}
}
......
......@@ -89,7 +89,7 @@ export function signAuth() {
* 获取用户手机
* @returns
*/
export function getPhone() {
export function getPhone() {
const data = dsbridge.call(BridgeMethods.GET_PHONE, {}, (res) => {
return res
})
......@@ -133,7 +133,7 @@ export function close() {
* 获取oaserver
* @returns
*/
export function getOAServer() {
export function getOAServer() {
const data = dsbridge.call(BridgeMethods.GetOAServer, {}, (res) => {
return res
})
......@@ -154,7 +154,7 @@ export function openCompanyUserInfo(address: string) {
}
export function refreshCompanyState(obj: Object) {
const data = dsbridge.call(BridgeMethods.REFRESH_COMPANY_STATE, {...obj}, res => {
const data = dsbridge.call(BridgeMethods.REFRESH_COMPANY_STATE, { ...obj }, res => {
return res
})
return data
......@@ -189,7 +189,7 @@ export function selectGroupMembers(arr: string[]) {
}
export function getGroupMembers(obj:Object) {
const data = dsbridge.call(BridgeMethods.GET_GROUP_MEMBERS, {...obj}, res => {
const data = dsbridge.call(BridgeMethods.GET_GROUP_MEMBERS, { ...obj }, res => {
return res
})
return data
......
......@@ -12,3 +12,8 @@ export function formatFileSize(size: number) {
return kb.toFixed(3) + 'KB'
}
}
export function isIOSMobile() {
const userAgent = window.navigator.userAgent || navigator.userAgent
return /(iPhone|iPad)/i.test(userAgent)
}
\ No newline at end of file
import html2canvas from 'html2canvas'
import { transferFile } from '../TransferFile'
import { getImgUrl } from '../GetImgUrl'
import { isIOSMobile } from '../Common'
function dpr() {
if (window.devicePixelRatio && window.devicePixelRatio > 1) {
......@@ -8,6 +9,7 @@ function dpr() {
}
return 1
}
import { fromASM } from 'bitcoinjs-lib/types/script'
export async function downloadQrCode(selector: string, downloadName: string = '邀请码', entId?: string) {
// 获取节点
......@@ -24,18 +26,23 @@ export async function downloadQrCode(selector: string, downloadName: string = '
// canvas.style.height = `${height}px`
// const context = canvas.getContext('2d')
// context?.scale(1, 1)
return await html2canvas(dom, {canvas}).then(async () => {
return await html2canvas(dom, {canvas, allowTaint: true}).then(async () => {
const dataUrl = canvas.toDataURL('image/png')
// console.log(dataUrl, 'qw')
// const urlObj = await getImgUrl(dataUrl, entId as string)
// const img = urlObj.url
// const file = transferFile(dataUrl, 'file')
// const imgUrl = URL.createObjectURL(file)
// return urlObj
// console.log(urlObj, 'urlO')
const a =document.createElement('a')
const event = new MouseEvent('click')
a.target = "_self"
a.download = downloadName
a.href = dataUrl
a.dispatchEvent(event)
}).catch(err => {
console.log(err, 'html2canvas err')
})
}
......@@ -17,4 +17,4 @@ export function postMessage(method: string, body?: any): Promise<any> {
}
}
})
}
\ No newline at end of file
}
......@@ -6,4 +6,4 @@ export function validatePhone(val: string) {
export function validateMail(val: string) {
const reg = /^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/
return reg.test(val)
}
\ No newline at end of file
}
<template>
<div class="pt-14">
<!-- <div v-if="dataUrl" class="qrcode mt-2 mb-4 relative w-80 h-113.5 mx-auto">
<!-- <div v-if="dataUrl" class="qrcode mt-2 mb-4 relative w-72 h-113.5 mx-auto">
<img :src="dataUrl" alt="">
</div> -->
<div id="qrCodeWrapper" class="qrcode mt-2 relative w-72 h-113.5 mx-auto">
<p class=" text-white absolute top-24 text-base left-0 right-0 mx-auto text-center">{{entInfo.name}}</p>
<p class=" text-white absolute top-32 text-sm left-0 right-0 mx-auto text-center">团队号:{{entInfo.id}}</p>
<p class=" text-white absolute top-24 text-base left-0 right-0 mx-auto text-center">{{ entInfo.name }}</p>
<p class=" text-white absolute top-32 text-sm left-0 right-0 mx-auto text-center">团队号:{{ entInfo.id }}</p>
<img ref="wrapper" src="@/assets/qrbackground.png" alt="" class="">
<div class=" absolute w-36 top-40 left-0 right-0 mx-auto ">
<div class="absolute w-36 mt-2 top-40 left-0 right-0 mx-auto ">
<vue-qr
background-color="#fff"
:logo-src="require('@/assets/icons/txga.png')"
:logo-margin="4"
:logo-scale="0.15"
:text="text"
:margin="8"
:size="400"
background-color="#fff"
/>
</div>
<p class=" text-white absolute top-82 left-0 right-0 mx-auto text-center text-sm"> 扫描二维码加入我们{{entInfo.name}}的团队</p>
<p class=" text-white absolute top-82 left-0 right-0 mx-auto text-center text-sm"> 扫描二维码加入我们{{ entInfo.name }}的团队</p>
</div>
<div class="px-4 flex items-center justify-center">
<div class="btn flex flex-col items-center justify-center" @click.stop="saveQrCode">
<div v-show="!dataUrl" class="px-4 flex items-center justify-center">
<div @click.stop="saveQrCode" class="btn flex flex-col items-center justify-center">
<app-icon
icon-name="y-download"
class-name="w-9 h-9"
......@@ -30,7 +30,7 @@
</div>
</div>
<div v-if="showBottom" class="mx-4 pb-6">
<c-button round type="secondary" class=" mt-4" @click="$router.push('/team/team-frame')">进入团队组织架构</c-button>
<c-button @click="$router.push('/team/team-frame')" round type="secondary" class=" mt-4">进入团队组织架构</c-button>
</div>
</div>
</template>
......@@ -40,30 +40,21 @@ import { downloadQrCode } from '@/util/DownloadQrcode'
import VueQr from 'vue-qr'
export default Vue.extend({
props: {
entInfo: Object,
text: String,
showBottom: Boolean
},
components: {
VueQr,
'c-button': () => import('@/components/common/c-button.vue'),
'app-icon': () => import('@/components/common/Icon.vue')
},
props: {
entInfo: Object,
text: String,
showBottom: Boolean
},
data() {
return {
dataUrl: ''
}
},
mounted() {
},
computed: {
isIOS() {
const userAgent = window.navigator.userAgent || navigator.userAgent
return /(iPhone|iPad)/i.test(userAgent)
}
},
methods: {
async saveQrCode() {
await downloadQrCode('qrCodeWrapper', '团队二维码', this.entInfo.id)
......
......@@ -31,13 +31,14 @@
icon-name="radio-checked"
class-name="h-4 w-4"
/>
<!-- <div class="bg bg-radio w-4 h-4"></div> -->
</template>
<template v-else>
<app-icon
type="png"
icon-name="radio"
class-name="h-4 w-4"
/>
/>
</template>
</div>
</template>
......
<template>
<main-page
left-arrow
@click-left="handleClickLeft"
left-arrow
>
<div class="mx-4 pt-14 pb-2">
<div class="text-sm text-color-primary bg-color-primary-light px-4 py-3 rounded">
......@@ -10,16 +10,16 @@
<div class="mt-4">
<input-cell
v-model="name"
required
:limit="20"
required
label="企业/组织/团队名称"
placeholder="请输入团队名称"
error-msg="团队名称不能为空"
/>
<input-cell
v-model="leaderName"
required
:limit="20"
required
label="负责人真实姓名"
placeholder="请输入真实姓名"
error-msg="姓名不能为空"
......@@ -49,10 +49,10 @@
</div>
</c-cell>
</div>
<div class="bg-white flex items-center justify-center py-3" @click="showServer">
<div @click="showServer" class="bg-white flex items-center justify-center py-3">
<app-icon
icon-name="right-arrow"
:class-name="getClass"
icon-name="right-arrow"
/>
</div>
</group-cell>
......@@ -162,7 +162,7 @@ export default Vue.extend({
postMessage(PostMsg.RELOAD)
return
}
await refreshCompanyState({goHome: false})
await refreshCompanyState({ goHome: false })
this.$router.replace({
path: '/team/team-qrcode',
query: {
......
......@@ -26,6 +26,7 @@
:leader="leader"
></contact-selector>
<dep-selector
:ent-id="entId"
:show.sync="showDepSelector"
:selected.sync="selectedDepId"
></dep-selector>
......
<template>
<!-- 编辑员工 -->
<main-page
left-arrow
@click-left="$router.go(-1)"
left-arrow
>
<div class="pt-14 px-4">
<input-cell
......
......@@ -2,10 +2,10 @@
<!-- 加入/创建团队 -->
<div class="team-frame">
<main-page
@click-left="$router.go(-1)"
main-bg="bg-white"
header-bg="bg-white"
left-arrow
@click-left="$router.go(-1)"
>
<div class="px-4 pt-14 pb-4">
<!-- banner -->
......@@ -13,9 +13,9 @@
<img class="w-full" src="@/assets/images/team.png">
</div>
<card
@click="$router.push('/team/choose-join')"
class="mt-11"
content="如果你的团队或企业已经在使用Chat33 Pro,可通过搜索团队号或二维码加入团队,与成员一起沟通协作,高效作业。"
@click="$router.push('/team/choose-join')"
>
<div slot="title" class="font-semibold">
<span class=" text-tag-yellow">加入</span>团队
......@@ -40,7 +40,6 @@ export default Vue.extend({
name: 'JoinCreate',
components: {
'main-page': () => import('@/layout/main-page.vue'),
'app-icon': () => import('@/components/common/Icon.vue'),
'card': () => import('@/views/team/components/card.vue')
},
data() {
......
......@@ -23,13 +23,13 @@
/>
</div>
</template>
<van-overlay :show="showQrcode" :z-index="2000" @click="showQrcode = false">
<van-overlay :show="showQrcode" :z-index="2000" @click="hideCode">
<div class="bg-white w-full h-full relative">
<div class="absolute left-0 top-0 w-full h-12 px-4 flex items-center">
<app-icon
icon-name="left-arrow"
class-name="w-6.5 h-6.5"
@click="showQrcode = false"
@click="hideCode"
/>
</div>
<qrcode
......@@ -84,8 +84,8 @@
<template v-if="isLeader">
<c-cell dot title="团队管理权限" :content="`共${managerNum}人`" @click="$router.push('/team/auth-management')" />
<c-cell dot title="转让负责人" @click="transferManagement" />
<c-cell dot title="申请管理" @click="$router.push('/team/apply-list')" />
</template>
<c-cell v-if="isAdmin || isLeader" dot title="申请管理" @click="$router.push('/team/apply-list')" />
</div>
<c-button v-if="isLeader" round type="secondary" class="mt-16" @click="deleteTeam">
解散团队
......@@ -98,7 +98,7 @@
import { Role } from '@/service/moudles/service.dto'
import {LocalStoreEnt, PostMsg, Staff} from '@/Interface'
import {close, getUserInfo, isAppEnv, refreshCompanyState} from '@/util/Bridge'
import Vue from 'vue'
import Vue, { Component } from 'vue'
import { postMessage } from '@/util/PostMessage'
import { Overlay } from 'vant'
......@@ -172,13 +172,24 @@ export default Vue.extend({
computed: {
isLeader(): boolean {
return this.role === Role.LEADER
},
isAdmin():boolean {
return this.role === Role.SUPER_ADMIN
}
},
methods: {
showCode() {
// console.log(this.$refs.cccc, 'scc')
// setTimeout(async () => {
// const qrcode = this.$refs.cccc as any
// await qrcode.saveQrCode()
// })
this.showQrcode = true
},
hideCode() {
// const qrcode = this.$refs.cccc as any
// qrcode.dataUrl = ''
this.showQrcode = false
},
getStaff(id: string) {
this.loading = true
return this.$service.staff.getInfo({
......
......@@ -7,7 +7,8 @@ const env = process.env.VUE_APP_ENV
if (env === 'police') {
primaryColor = '#4F62C1'
} else if (env === 'people') {
primaryColor = '#32b2f7'
// primaryColor = '#32b2f7'
primaryColor = '#4F62C1'
} else {
primaryColor = '#4F62C1'
}
......
......@@ -41,24 +41,24 @@ module.exports = {
}
}
},
// configureWebpack: {
// optimization: {
// minimize: true,
// minimizer: [
// new TerserPlugin({
// parallel: true,
// terserOptions: {
// compress: {
// drop_console: false, // 默认false -- 移除console.*(console.log、console.error等等)
// },
// },
// }),
// ],
// },
// plugins: [
// new CompressionWebpackPlugin(),
// ],
// },
configureWebpack: {
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
compress: {
drop_console: false, // 默认false -- 移除console.*(console.log、console.error等等)
},
},
}),
],
}
// plugins: [
// new CompressionWebpackPlugin(),
// ],
},
// pwa: {
// name: 'My App',
......
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