Commit 11061c89 authored by sixiaofeng's avatar sixiaofeng

添加设置功能和发送名片

parent bd0b92ba
NODE_ENV=production
VUE_APP_ENV=people VUE_APP_ENV=people
\ No newline at end of file
NODE_ENV=production
VUE_APP_ENV=police VUE_APP_ENV=police
\ No newline at end of file
tar -czf oa.tar oa
scp oa.tar root@xzd.me:/home/test-chat33pro/oa.tar
rm -rf oa.tar
ssh root@xzd.me 'cd /home/test-chat33pro && rm -rf oa && tar -xzf oa.tar && rm -rf oa.tar'
echo '👉 http://121.40.18.70:8886/'
\ No newline at end of file
File added
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
"build:people": "vue-cli-service build --mode people", "build:people": "vue-cli-service build --mode people",
"build:orginone": "vue-cli-service build --mode orginone", "build:orginone": "vue-cli-service build --mode orginone",
"build:testorginone": "vue-cli-service build --mode testorginone", "build:testorginone": "vue-cli-service build --mode testorginone",
"build:testpeople": "vue-cli-service build --mode testpeople",
"deploy": "npm run build && bash deploy.sh", "deploy": "npm run build && bash deploy.sh",
"deploy:people": "vue-cli-service build --mode testpeople && bash deploy.sh", "deploy:people": "vue-cli-service build --mode testpeople && bash deploy.people.sh",
"deploy:police": "vue-cli-service build --mode testpolice && bash deploy.sh",
"lint": "vue-cli-service lint --fix" "lint": "vue-cli-service lint --fix"
}, },
"dependencies": { "dependencies": {
......
...@@ -26,7 +26,9 @@ export interface Staff { ...@@ -26,7 +26,9 @@ export interface Staff {
"entName": string, "entName": string,
"id": string, "id": string,
"workplace": string, "workplace": string,
"isActivated": boolean "isActivated": boolean,
cardViewable: number,
phoneViewable: number
} }
// 通讯录 // 通讯录
......
import BaseService from '../base' import BaseService from '../base'
import { ChangeDepDTO, ChangeRoleDTO, GetRroupDTO, GetStaffInfoDTO, ResignDTO, UpdateStaffDTO, AddStaffDTO } from './service.dto' import { ChangeDepDTO, ChangeRoleDTO, GetRroupDTO, GetStaffInfoDTO, ResignDTO, UpdateStaffDTO, AddStaffDTO, SetCartViewableDTO, SetPhoneViewableDTO } from './service.dto'
export default class Staff extends BaseService { export default class Staff extends BaseService {
static instance: Staff static instance: Staff
...@@ -19,7 +19,9 @@ export default class Staff extends BaseService { ...@@ -19,7 +19,9 @@ export default class Staff extends BaseService {
getInfo: { path: '/v1/staff/get-staff', crediential: true }, getInfo: { path: '/v1/staff/get-staff', crediential: true },
resign: { path: '/v1/staff/resign', crediential: true }, resign: { path: '/v1/staff/resign', crediential: true },
updateInfo: { path: '/v1/staff/update-staff-info', crediential: true }, updateInfo: { path: '/v1/staff/update-staff-info', crediential: true },
addMember: { path: '/v1/staff/add-staff', crediential: true } addMember: { path: '/v1/staff/add-staff', crediential: true },
setCardViewable: { path: '/v1/staff/set-card-viewable', crediential: true},
setPhoneViewable: { path: '/v1/staff/set-phone-viewable', crediential: true}
} }
// constructor() { // constructor() {
// super() // super()
...@@ -93,5 +95,23 @@ export default class Staff extends BaseService { ...@@ -93,5 +95,23 @@ export default class Staff extends BaseService {
async addMember(data:AddStaffDTO) { async addMember(data:AddStaffDTO) {
return await this.useService(this.router.addMember, data) return await this.useService(this.router.addMember, data)
} }
/**
* 设置团队名片可视范围
* @param {SetCartViewableDTO} data {SetCartViewableDTO}
* @returns
*/
async setCardViewable(data:SetCartViewableDTO) {
return await this.useService(this.router.setCardViewable, data)
}
/**
* 设置团队手机号可视范围
* @param {SetPhoneViewableDTO} data {SetPhoneViewableDTO}
* @returns
*/
async setPhoneViewable(data:SetPhoneViewableDTO) {
return await this.useService(this.router.setPhoneViewable, data)
}
} }
...@@ -188,3 +188,19 @@ export interface SubmitQuitApplyDTO { ...@@ -188,3 +188,19 @@ export interface SubmitQuitApplyDTO {
// export interface GetBindDTO { // export interface GetBindDTO {
// } // }
export enum Viewable {
TEAMVISIABLE = 0,
NOTVISIABLE = 1,
ALLVISIABLE = 2
}
export interface SetCartViewableDTO {
cardViewable: Viewable,
entId: string
}
export interface SetPhoneViewableDTO {
phoneViewable: Viewable,
entId: string
}
\ No newline at end of file
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
<van-popup <van-popup
v-model:show="show" v-model:show="show"
position="right" position="right"
:style="{height: '100%', width: '100%'}"> :style="{height: '100%', width: '100%'}"
@open="open">
<Options <Options
:show.sync="showOptions" :show.sync="showOptions"
:title="title" :title="title"
:info="info" :info="info"
:checked.sync="checked" :checked.sync="checked"
:type="type"
@change="radioChange" @change="radioChange"
></Options> ></Options>
<div class="border bg-common-bg h-full flex flex-col"> <div class="border bg-common-bg h-full flex flex-col">
...@@ -27,7 +29,7 @@ ...@@ -27,7 +29,7 @@
<div class="flex-1 overflow-y-scroll"> <div class="flex-1 overflow-y-scroll">
<div class="p-3"> <div class="p-3">
<van-cell-group> <van-cell-group>
<van-cell size="large" :value="getShowVal(card)" @click="clickCell(CellClick.CARD)"> <van-cell size="large" :value="getShowVal(card)" @click="clickCell(ViewableType.CARD)">
<div slot="title" class="">对外团队名片</div> <div slot="title" class="">对外团队名片</div>
<div slot="right-icon" class="flex items-center"> <div slot="right-icon" class="flex items-center">
<AppIcon <AppIcon
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
></AppIcon> ></AppIcon>
</div> </div>
</van-cell> </van-cell>
<van-cell size="large" :value="getShowVal(phone)" @click="clickCell(CellClick.PHONE)"> <van-cell size="large" :value="getShowVal(phone)" @click="clickCell(ViewableType.PHONE)">
<div slot="title" class="">对外团队手机号</div> <div slot="title" class="">对外团队手机号</div>
<div slot="right-icon" class="flex items-center"> <div slot="right-icon" class="flex items-center">
<AppIcon <AppIcon
...@@ -62,7 +64,7 @@ import { Overlay, Cell, CellGroup, Popup } from 'vant' ...@@ -62,7 +64,7 @@ import { Overlay, Cell, CellGroup, Popup } from 'vant'
Vue.use(Overlay).use(Cell).use(CellGroup).use(Popup) Vue.use(Overlay).use(Cell).use(CellGroup).use(Popup)
export enum CellClick { export enum ViewableType {
CARD = 'card', CARD = 'card',
PHONE = 'phone' PHONE = 'phone'
} }
...@@ -84,30 +86,32 @@ export default Vue.extend({ ...@@ -84,30 +86,32 @@ export default Vue.extend({
checked: 1, checked: 1,
phone: 1, phone: 1,
card: 2, card: 2,
type: CellClick.CARD, type: ViewableType.CARD,
CellClick ViewableType
} }
}, },
methods: { methods: {
clickCell(type: CellClick) { clickCell(type: ViewableType) {
if (type === CellClick.CARD) { if (type === ViewableType.CARD) {
this.title = '对外团队名片' this.title = '对外团队名片'
this.info = '谁可见我的团队名片' this.info = '谁可见我的团队名片'
this.type = CellClick.CARD this.type = ViewableType.CARD
this.checked = this.card this.checked = this.card
} else { } else {
this.title = '对外团队手机号' this.title = '对外团队手机号'
this.info = '谁可见我的团队手机号' this.info = '谁可见我的团队手机号'
this.type = CellClick.PHONE this.type = ViewableType.PHONE
this.checked = this.phone this.checked = this.phone
} }
console.log('打开选项')
this.showOptions = true this.showOptions = true
}, },
back() { back() {
this.$emit('update:show', false) this.$emit('update:show', false)
}, },
radioChange(val: number) { radioChange(val: number) {
if (this.type === CellClick.CARD) { console.log(val, this.type, '设置成功了')
if (this.type === ViewableType.CARD) {
this.card = val this.card = val
} else { } else {
this.phone = val this.phone = val
...@@ -115,13 +119,19 @@ export default Vue.extend({ ...@@ -115,13 +119,19 @@ export default Vue.extend({
}, },
getShowVal(val: number) { getShowVal(val: number) {
switch(val) { switch(val) {
case 1: case 0:
return '仅同团队组织可见' return '仅同团队组织可见'
case 2: case 1:
return '所有人可见' return '所有人可见'
case 3: case 2:
return '所有人不可见' return '所有人不可见'
} }
},
open() {
console.log('open setting')
const user = JSON.parse(localStorage.getItem('USR_INFO') as string)
this.phone = user.phoneViewable
this.card = user.cardViewable
} }
} }
}); });
......
...@@ -20,13 +20,14 @@ ...@@ -20,13 +20,14 @@
<div class="flex-1 overflow-y-scroll"> <div class="flex-1 overflow-y-scroll">
<!-- <div class="px-3"> --> <!-- <div class="px-3"> -->
<div class="info px-3.5 py-3 text-text-secondary text-sm">{{ info }}</div> <div class="info px-3.5 py-3 text-text-secondary text-sm">{{ info }}</div>
<van-radio-group v-model="check" @change="radioChange"> <van-radio-group v-model="check">
<van-cell-group inset> <van-cell-group inset>
<van-cell <van-cell
v-for="o in options" v-for="o in options"
size="large" size="large"
:title="o.title" :title="o.title"
clickable> clickable
@click="clickCell(o)">
<template #icon> <template #icon>
<van-radio :name="o.key"> <van-radio :name="o.key">
<template #icon="props"> <template #icon="props">
...@@ -42,38 +43,6 @@ ...@@ -42,38 +43,6 @@
</van-radio> </van-radio>
</template> </template>
</van-cell> </van-cell>
<!-- <van-cell size="large" title="单选框 1" clickable @click="checked = '1'">
<template #icon>
<van-radio name="1">
<template #icon="props">
<div class="mr-1.5">
<AppIcon
type="svg"
:name="props.checked?'icon-radio-checked':'icon-radio'"
:color="primaryInfo.color"
size="20px"
></AppIcon>
</div>
</template>
</van-radio>
</template>
</van-cell>
<van-cell size="large" title="单选框 2" clickable @click="checked = '2'">
<template #icon>
<van-radio name="2">
<template #icon="props">
<div class="mr-1.5">
<AppIcon
type="svg"
:name="props.checked?'icon-radio-checked':'icon-radio'"
:color="primaryInfo.color"
size="20px"
></AppIcon>
</div>
</template>
</van-radio>
</template>
</van-cell> -->
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
<!-- </div> --> <!-- </div> -->
...@@ -85,27 +54,30 @@ ...@@ -85,27 +54,30 @@
<script lang="ts"> <script lang="ts">
import Vue, { PropType } from 'vue' import Vue, { PropType } from 'vue'
import { Overlay, Cell, CellGroup, Popup, Radio, RadioGroup} from 'vant' import { Overlay, Cell, CellGroup, Popup, Radio, RadioGroup} from 'vant'
import { ViewableType } from './index.vue';
import { SetCartViewableDTO, SetPhoneViewableDTO } from '@/service/moudles/service.dto';
Vue.use(Overlay).use(Cell).use(CellGroup).use(Popup).use(Radio).use(RadioGroup) Vue.use(Overlay).use(Cell).use(CellGroup).use(Popup).use(Radio).use(RadioGroup)
const options = [{ const options = [{
title: '仅同团队组织可见', title: '仅同团队组织可见',
key: 1 key: 0
}, { }, {
title: '所有人可见', title: '所有人可见',
key: 2 key: 1
}, { }, {
title: '所有人不可见', title: '所有人不可见',
key: 3 key: 2
}] }]
export default Vue.extend({ export default Vue.extend({
name:'request', name:'SettingOptions',
props:{ props:{
show: Boolean, show: Boolean,
title: String, title: String,
info: String, info: String,
checked: Number checked: Number,
type: String as unknown as PropType<ViewableType>
}, },
components: { components: {
AppIcon: () => import('@/components/common/Icon.vue'), AppIcon: () => import('@/components/common/Icon.vue'),
...@@ -113,21 +85,74 @@ export default Vue.extend({ ...@@ -113,21 +85,74 @@ export default Vue.extend({
data(){ data(){
return{ return{
options, options,
check: 1 entId: ''
}
},
computed: {
check: {
get() {
return this.$props.checked
},
set(val) {
console.log('setting')
this.$emit('update:checked', val)
}
} }
}, },
methods: { methods: {
back() { back() {
this.$emit('update:show', false) this.$emit('update:show', false)
}, },
clickCell(o: any) {
console.log(o, this.check, 'oooo')
this.$emit('update:checked', o.key)
if (this.type === ViewableType.CARD) {
this.setCard()
} else {
this.setPhone()
}
},
radioChange(val: number) { radioChange(val: number) {
console.log(val, 'change') console.log(val, 'change')
this.$emit('change', val) this.$emit('change', val)
this.$emit('update:checked', val) // this.$emit('update:show', false)
this.$emit('update:show', false)
},
setCard() {
const params: SetCartViewableDTO= {
cardViewable: this.check,
entId: this.entId
}
this.$service.staff.setCardViewable(params).then((res: any) => {
const {data} = res
if (data.code === this.$global.success) {
this.$toast('设置成功')
this.$emit('change', this.check)
this.$emit('update:show', false)
} else {
this.$toast(data.msg)
}
})
},
setPhone() {
const params: SetPhoneViewableDTO= {
phoneViewable: this.check,
entId: this.entId
}
this.$service.staff.setPhoneViewable(params).then((res: any) => {
const {data} = res
if (data.code === this.$global.success) {
this.$toast('设置成功')
this.$emit('change', this.check)
this.$emit('update:show', false)
} else {
this.$toast(data.msg)
}
})
}, },
open() { open() {
this.check = this.$props.checked console.log('open options')
this.entId = JSON.parse(localStorage.getItem('ENT_INFO') as string).id
} }
} }
}); });
......
...@@ -126,15 +126,15 @@ export default Vue.extend({ ...@@ -126,15 +126,15 @@ export default Vue.extend({
isEdit: false, isEdit: false,
multiple: false, multiple: false,
pageTitle: '组织架构', pageTitle: '组织架构',
showSetting: true showSetting: false
} }
}, },
async created() { async created() {
const userInfoDev = { const userInfoDev = {
depId: '168398222891421697', depId: '168398222891421697',
entId: '168398222891421696', entId: '168398222891421696',
// id: '1K7cApKbEU9h5WySPVLNgdSd67i2XkSuoS', id: '1K7cApKbEU9h5WySPVLNgdSd67i2XkSuoS',
id: '1Gwr2QzfHF3CYCYdPKJoEAxfCUimg1cPup', // id: '1Gwr2QzfHF3CYCYdPKJoEAxfCUimg1cPup',
joinTime: 1631090065, joinTime: 1631090065,
name: '徐丹', name: '徐丹',
role: 3 role: 3
...@@ -185,7 +185,10 @@ export default Vue.extend({ ...@@ -185,7 +185,10 @@ export default Vue.extend({
{name: '管理团队', action: 'manage'} {name: '管理团队', action: 'manage'}
] ]
} }
return [{name: '退出团队', action: 'quit'}] return [
{name: '设置', action: 'setting'},
{name: '退出团队', action: 'quit'}
]
}, },
showHomeIcon(): boolean { showHomeIcon(): boolean {
return !this.isEdit return !this.isEdit
...@@ -193,11 +196,9 @@ export default Vue.extend({ ...@@ -193,11 +196,9 @@ export default Vue.extend({
}, },
methods: { methods: {
inviteMember() { inviteMember() {
const entId = JSON.parse(localStorage.getItem('ENT_INFO') as string).id const entInfo = JSON.parse(localStorage.getItem('ENT_INFO') as string)
this.$router.replace({ const {id, oaServer, avatar, name} = entInfo
path: '/team/team-qrCode', sendTeamCard({id, server: oaServer, avatar, name})
query: { entId }
})
}, },
handleCancel() { handleCancel() {
this.isEdit = false this.isEdit = false
......
...@@ -43,7 +43,7 @@ module.exports = { ...@@ -43,7 +43,7 @@ module.exports = {
}, },
configureWebpack: { configureWebpack: {
optimization: { optimization: {
minimize: process.env.NODE_ENV === 'production', minimize: true,
minimizer: [ minimizer: [
new TerserPlugin({ new TerserPlugin({
parallel: true, parallel: true,
......
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