选择人员调整完毕

This commit is contained in:
aixianling
2021-11-23 16:07:39 +08:00
parent b5ba96c0f3
commit a03bebaf38
3 changed files with 356 additions and 312 deletions

View File

@@ -9,13 +9,17 @@
<header><em>*</em>起止时间</header> <header><em>*</em>起止时间</header>
<u-row justify="between"> <u-row justify="between">
<div class="time" @click="pick(0)"> <div class="time" @click="pick(0)">
<span>{{form.startTime.time}}</span> <span>{{ form.startTime.time }}</span>
<span>{{form.startTime.year}}{{form.startTime.month}}{{form.startTime.day}} {{form.startTime.weekday}}</span> <span>{{ form.startTime.year }}{{ form.startTime.month }}{{
form.startTime.day
}} {{ form.startTime.weekday }}</span>
</div> </div>
<div class="arrow"></div> <div class="arrow"></div>
<div class="time" @click="pick(1)"> <div class="time" @click="pick(1)">
<span>{{form.endTime.time}}</span> <span>{{ form.endTime.time }}</span>
<span>{{form.endTime.year}}{{form.endTime.month}}{{form.endTime.day}} {{form.endTime.weekday}}</span> <span>{{ form.endTime.year }}{{ form.endTime.month }}{{ form.endTime.day }} {{
form.endTime.weekday
}}</span>
</div> </div>
</u-row> </u-row>
</div> </div>
@@ -34,14 +38,16 @@
</div> </div>
<div class="card item-wrap" @click="select"> <div class="card item-wrap" @click="select">
<u-row justify="between" class="item" @click="userSelect=true"> <u-row justify="between" class="item" @click="handleSelectUser">
<header><em>*</em>参会人</header> <header><em>*</em>参会人</header>
<div class="right"> <div class="right">
<template v-if="!form.attendees.length"> <template v-if="!form.attendees.length">
<span>请选择</span> <span>请选择</span>
</template> </template>
<template v-else> <template v-else>
已选择<em>{{form.attendees.map(e=>e.name).slice(0,2).join("、")}}</em><em>{{form.attendees.length}}</em> 已选择<em>{{ form.attendees.map(e => e.name).slice(0, 2).join("、") }}</em><em>{{
form.attendees.length
}}</em>
</template> </template>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</div> </div>
@@ -52,7 +58,9 @@
<header>参会提醒</header> <header>参会提醒</header>
<picker class="right" @change="beforeNoticeChange" :value="form.noticeBefore" range-key="dictName" <picker class="right" @change="beforeNoticeChange" :value="form.noticeBefore" range-key="dictName"
:range="$dict.getDict('meetingNoticeBefore')"> :range="$dict.getDict('meetingNoticeBefore')">
<span>{{ form.noticeBefore !=null ? $dict.getDict('meetingNoticeBefore')[form.noticeBefore]["dictName"] : "请选择"}}</span> <span>{{
form.noticeBefore != null ? $dict.getDict('meetingNoticeBefore')[form.noticeBefore]["dictName"] : "请选择"
}}</span>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</picker> </picker>
</u-row> </u-row>
@@ -62,7 +70,9 @@
<header>确认提醒</header> <header>确认提醒</header>
<picker class="right" @change="afterNoticeChange" :value="form.noticeAfter" range-key="dictName" <picker class="right" @change="afterNoticeChange" :value="form.noticeAfter" range-key="dictName"
:range="$dict.getDict('meetingNoticeAfter')"> :range="$dict.getDict('meetingNoticeAfter')">
<span>{{form.noticeAfter !=null ? $dict.getDict('meetingNoticeAfter')[form.noticeAfter]["dictName"] : "请选择"}}</span> <span>{{
form.noticeAfter != null ? $dict.getDict('meetingNoticeAfter')[form.noticeAfter]["dictName"] : "请选择"
}}</span>
<div class="right-arrow"></div> <div class="right-arrow"></div>
</picker> </picker>
</u-row> </u-row>
@@ -80,321 +90,328 @@
</template> </template>
<script> <script>
import AiBack from "../../../components/AiBack"; import AiBack from "../../../components/AiBack";
import AiSelectEnterprise from "../../../components/AiSelectEnterprise"; import AiSelectEnterprise from "../../../components/AiSelectEnterprise";
import AiUploader from "../../../components/AiUploader"; import AiUploader from "../../../components/AiUploader";
import {mapActions} from "vuex";
export default { export default {
name: "addMeeting", name: "addMeeting",
components: {AiBack, AiSelectEnterprise, AiUploader}, components: {AiBack, AiSelectEnterprise, AiUploader},
data() { data() {
const initTime = { const initTime = {
time: "", time: "",
year: "", year: "",
month: "", month: "",
day: "", day: "",
weekday: "", weekday: "",
timestamp: "", timestamp: "",
} }
return {
show: false,
index: 0,
list: [],
form: {
id: null,
title: "",
startTime: {...initTime},
endTime: {...initTime},
address: "",
content: "",
attendees: [],
noticeBefore: 4,
noticeAfter: 0,
files: [],
},
userSelect: false,
value: Number(new Date())
}
},
onLoad(opt) {
if (opt.id) {
this.form.id = opt.id
this.getDetail()
}
this.$nextTick(() => {
let date = new Date();
this.form.startTime.time = date.getHours()?.toString()?.padStart(2, "0") + ":" + date.getMinutes()?.toString()?.padStart(2, "0")
this.form.startTime.year = date.getFullYear()
this.form.startTime.month = (date.getMonth() + 1)?.toString()?.padStart(2, "0")
this.form.startTime.day = date.getDate()
this.form.startTime.weekday = '日一二三四五六'.charAt(date.getDay())
this.form.endTime = {...this.form.startTime}
})
},
computed: {
params() {
return { return {
show: false, year: true,
index: 0, month: true,
list: [], day: true,
form: { hour: true,
id: null, minute: true,
title: "", timestamp: true,
startTime: {...initTime},
endTime: {...initTime},
address: "",
content: "",
attendees: [],
noticeBefore: 4,
noticeAfter: 0,
files: [],
},
userSelect: false,
value: Number(new Date())
} }
}, }
onLoad(opt) { },
if (opt.id) { methods: {
this.form.id = opt.id ...mapActions(['selectEnterpriseContact']),
this.getDetail() handleSelectUser() {
} this.selectEnterpriseContact().then(res => {
this.$nextTick(() => { this.change(res?.userList || [])
let date = new Date();
this.form.startTime.time = date.getHours()?.toString()?.padStart(2, "0") + ":" + date.getMinutes()?.toString()?.padStart(2, "0")
this.form.startTime.year = date.getFullYear()
this.form.startTime.month = (date.getMonth() + 1)?.toString()?.padStart(2, "0")
this.form.startTime.day = date.getDate()
this.form.startTime.weekday = '日一二三四五六'.charAt(date.getDay())
this.form.endTime = {...this.form.startTime}
}) })
}, },
computed: { fileList(e) {
params() { this.form.files = e
return { },
year: true, change(e) {
month: true, this.form.attendees = e
day: true, },
hour: true, beforeNoticeChange(e) {
minute: true, this.form.noticeBefore = e.detail.value
timestamp: true, },
afterNoticeChange(e) {
this.form.noticeAfter = e.detail.value
},
getDetail() {
this.$http.post("/app/appmeetinginfo/info-id", null, {
params: {
id: this.form.id
} }
}).then(res => {
if (res && res.data) {
this.form.title = res.data.title
this.form.address = res.data.address
this.form.content = res.data.content
this.form.attendees = res.data.attendees
this.form.noticeBefore = res.data.noticeBefore
this.form.noticeAfter = res.data.noticeAfter
this.form.files = res.data.files
this.form.startTime.time = res.data.startTime.split(" ")[1].substr(0, 5)
this.form.startTime.year = res.data.startTime.split(" ")[0].split("-")[0]
this.form.startTime.month = res.data.startTime.split(" ")[0].split("-")[1]
this.form.startTime.day = res.data.startTime.split(" ")[0].split("-")[2]
this.form.startTime.weekday = '日一二三四五六'.charAt(new Date(res.data.startTime.split(" ")[0]).getDay())
this.form.startTime.timestamp = new Date(res.data.startTime).getTime()
this.form.endTime.time = res.data.endTime.split(" ")[1].substr(0, 5)
this.form.endTime.year = res.data.endTime.split(" ")[0].split("-")[0]
this.form.endTime.month = res.data.endTime.split(" ")[0].split("-")[1]
this.form.endTime.day = res.data.endTime.split(" ")[0].split("-")[2]
this.form.endTime.weekday = '日一二三四五六'.charAt(new Date(res.data.endTime.split(" ")[0]).getDay())
this.form.endTime.timestamp = new Date(res.data.endTime).getTime()
}
})
},
confirm(e) {
if (new Date().getTime() / 1000 > e.timestamp) return this.$u.toast("选择时间不能小于当前时间")
if (this.index == 0) {
this.form.startTime = {...e}
this.form.startTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.startTime.weekday = '日一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
} else {
if (this.form.startTime.timestamp >= e.timestamp) {
return this.$u.toast("结束时间不能小于开始时间");
}
this.form.endTime = {...e}
this.form.endTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.endTime.weekday = '日一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
} }
}, },
methods: {
fileList(e) {
this.form.files = e
},
change(e) {
this.form.attendees = e
},
beforeNoticeChange(e) {
this.form.noticeBefore = e.detail.value
},
afterNoticeChange(e) {
this.form.noticeAfter = e.detail.value
},
getDetail() { add(status) {
this.$http.post("/app/appmeetinginfo/info-id", null, { if (status == 1) {
params: { if (!this.form.title) return this.$u.toast("请输入会议标题")
id: this.form.id
}
}).then(res => {
if (res && res.data) {
this.form.title = res.data.title
this.form.address = res.data.address
this.form.content = res.data.content
this.form.attendees = res.data.attendees
this.form.noticeBefore = res.data.noticeBefore
this.form.noticeAfter = res.data.noticeAfter
this.form.files = res.data.files
this.form.startTime.time = res.data.startTime.split(" ")[1].substr(0, 5)
this.form.startTime.year = res.data.startTime.split(" ")[0].split("-")[0]
this.form.startTime.month = res.data.startTime.split(" ")[0].split("-")[1]
this.form.startTime.day = res.data.startTime.split(" ")[0].split("-")[2]
this.form.startTime.weekday = '日一二三四五六'.charAt(new Date(res.data.startTime.split(" ")[0]).getDay())
this.form.startTime.timestamp = new Date(res.data.startTime).getTime()
this.form.endTime.time = res.data.endTime.split(" ")[1].substr(0, 5) if (this.form.startTime.timestamp >= this.form.endTime.timestamp) return this.$u.toast("结束时间不能小于开始时间")
this.form.endTime.year = res.data.endTime.split(" ")[0].split("-")[0]
this.form.endTime.month = res.data.endTime.split(" ")[0].split("-")[1]
this.form.endTime.day = res.data.endTime.split(" ")[0].split("-")[2]
this.form.endTime.weekday = '日一二三四五六'.charAt(new Date(res.data.endTime.split(" ")[0]).getDay())
this.form.endTime.timestamp = new Date(res.data.endTime).getTime()
}
})
},
confirm(e) {
if (new Date().getTime() / 1000 > e.timestamp) return this.$u.toast("选择时间不能小于当前时间")
if (this.index == 0) {
this.form.startTime = {...e}
this.form.startTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.startTime.weekday = '日一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
} else {
if (this.form.startTime.timestamp >= e.timestamp) {
return this.$u.toast("结束时间不能小于开始时间");
}
this.form.endTime = {...e}
this.form.endTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.endTime.weekday = '日一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
}
},
add(status) { if (!this.form.address) return this.$u.toast("请输入会议地点")
if (status == 1) {
if (!this.form.title) return this.$u.toast("请输入会议标题")
if (this.form.startTime.timestamp >= this.form.endTime.timestamp) return this.$u.toast("结束时间不能小于开始时间") if (!this.form.content) return this.$u.toast("请输入会议内容")
if (!this.form.address) return this.$u.toast("请输入会议地点") if (!this.form.attendees.length) return this.$u.toast("请选择参会人")
if (!this.form.content) return this.$u.toast("请输入会议内容")
if (!this.form.attendees.length) return this.$u.toast("请选择参会人")
}
this.$http.post("/app/appmeetinginfo/add-update", {
...this.form,
files: this.form.files.map(e => e.id),
status,
startTime: this.form.startTime.year + "-" + this.form.startTime.month + "-" + this.form.startTime.day + " " + this.form.startTime.time + ":00",
endTime: this.form.endTime.year + "-" + this.form.endTime.month + "-" + this.form.endTime.day + " " + this.form.endTime.time + ":00",
}).then(res => {
if (res.code == 0) {
this.$u.toast(status == 1 ? "发布成功" : "保存成功")
this.$refs["aiBack"].back()
}
})
},
pick(index) {
this.index = index
this.show = true
},
select() {
uni.navigateTo({
url: "/pages/meetingNotice/components/notice"
})
} }
this.$http.post("/app/appmeetinginfo/add-update", {
...this.form,
files: this.form.files.map(e => e.id),
status,
startTime: this.form.startTime.year + "-" + this.form.startTime.month + "-" + this.form.startTime.day + " " + this.form.startTime.time + ":00",
endTime: this.form.endTime.year + "-" + this.form.endTime.month + "-" + this.form.endTime.day + " " + this.form.endTime.time + ":00",
}).then(res => {
if (res.code == 0) {
this.$u.toast(status == 1 ? "发布成功" : "保存成功")
this.$refs["aiBack"].back()
}
})
}, },
}
pick(index) {
this.index = index
this.show = true
},
select() {
uni.navigateTo({
url: "/pages/meetingNotice/components/notice"
})
}
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-meeting { .add-meeting {
min-height: 100%; min-height: 100%;
background: #F5F5F5; background: #F5F5F5;
padding-bottom: 140px; padding-bottom: 140px;
.card { .card {
background-color: #FFFFFF; background-color: #FFFFFF;
box-sizing: border-box; box-sizing: border-box;
padding: 32px; padding: 32px;
margin-top: 16px; margin-top: 16px;
header { header {
font-size: 32px;
font-weight: 400;
color: #333333;
em {
font-style: normal;
font-size: 32px; font-size: 32px;
font-weight: 400; color: #FF4466;
color: #333333; margin-right: 8px;
vertical-align: middle;
}
}
input {
margin: 32px 0 16px;
box-sizing: border-box;
padding: 0 16px;
}
textarea {
width: 100%;
height: 160px;
margin: 32px 0 16px;
box-sizing: border-box;
padding: 0 16px;
}
.u-row {
margin-top: 34px;
.time {
display: flex;
flex-direction: column;
& > span:first-child {
font-size: 60px;
font-weight: 600;
color: #333333;
line-height: 84px;
}
& > span:last-child {
font-size: 22px;
color: #333333;
}
}
.arrow {
width: 28px;
height: 68px;
overflow: hidden;
position: relative;
transform: rotate(180deg);
&:before, &:after {
content: "";
width: 50px;
height: 50px;
position: absolute;
transform: scaleY(1.3) translate(30%, -40px) rotate(45deg);
}
&:before {
top: 59px;
background-color: #CCCCCC;
}
&:after {
left: 7px;
top: 59px;
background-color: #FFFFFF;
}
}
}
.item {
height: 112px;
box-shadow: 0px -1px 0px 0px #D8DDE6;
margin-top: 0;
.right {
font-size: 28px;
color: #999999;
display: flex;
align-items: center;
em { em {
font-style: normal; font-style: normal;
font-size: 32px; color: #1365DD;
color: #FF4466;
margin-right: 8px;
vertical-align: middle;
} }
} }
input { .right-arrow {
margin: 32px 0 16px; width: 16px;
box-sizing: border-box; height: 16px;
padding: 0 16px; display: inline-block;
} border-top: 5px solid #CCCCCC;
border-right: 5px solid #CCCCCC;
textarea { transform: rotate(45deg);
width: 100%;
height: 160px;
margin: 32px 0 16px;
box-sizing: border-box;
padding: 0 16px;
}
.u-row {
margin-top: 34px;
.time {
display: flex;
flex-direction: column;
& > span:first-child {
font-size: 60px;
font-weight: 600;
color: #333333;
line-height: 84px;
}
& > span:last-child {
font-size: 22px;
color: #333333;
}
}
.arrow {
width: 28px;
height: 68px;
overflow: hidden;
position: relative;
transform: rotate(180deg);
&:before, &:after {
content: "";
width: 50px;
height: 50px;
position: absolute;
transform: scaleY(1.3) translate(30%, -40px) rotate(45deg);
}
&:before {
top: 59px;
background-color: #CCCCCC;
}
&:after {
left: 7px;
top: 59px;
background-color: #FFFFFF;
}
}
}
.item {
height: 112px;
box-shadow: 0px -1px 0px 0px #D8DDE6;
margin-top: 0;
.right {
font-size: 28px;
color: #999999;
display: flex;
align-items: center;
em {
font-style: normal;
color: #1365DD;
}
}
.right-arrow {
width: 16px;
height: 16px;
display: inline-block;
border-top: 5px solid #CCCCCC;
border-right: 5px solid #CCCCCC;
transform: rotate(45deg);
}
}
}
.item-wrap {
padding: 0 32px;
}
.footer {
height: 112px;
width: 100%;
position: fixed;
left: 0;
bottom: 0;
background-color: #FFFFFF;
display: flex;
align-items: center;
& > div {
font-size: 36px;
color: #333333;
}
& > div:first-child {
width: 270px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
& > div:last-child {
width: calc(100% - 270px);
height: 100%;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
background-color: #1365DD;
} }
} }
} }
.item-wrap {
padding: 0 32px;
}
.footer {
height: 112px;
width: 100%;
position: fixed;
left: 0;
bottom: 0;
background-color: #FFFFFF;
display: flex;
align-items: center;
& > div {
font-size: 36px;
color: #333333;
}
& > div:first-child {
width: 270px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
& > div:last-child {
width: calc(100% - 270px);
height: 100%;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
background-color: #1365DD;
}
}
}
</style> </style>

View File

@@ -33,7 +33,7 @@ export default {
} }
}, },
methods: { methods: {
...mapActions(['getToken', 'getAccount', 'agentSign', 'getUserInfo', 'getCode', 'closeAgent']), ...mapActions(['agentSign']),
redirectTo(path) { redirectTo(path) {
let {query, hash} = this.$route let {query, hash} = this.$route
delete query.app delete query.app
@@ -60,6 +60,9 @@ export default {
}) })
} }
}, },
onLoad() {
this.agentSign(this.$route.query)
},
onShow() { onShow() {
this.getApps() this.getApps()
this.result = { this.result = {

View File

@@ -5,7 +5,7 @@ import http from '../common/axios'
import CryptoJS from '../utils/crypto-js' import CryptoJS from '../utils/crypto-js'
Vue.use(Vuex) Vue.use(Vuex)
let agentSignURL = "", apiList = [], agentConfig = {} let agentSignURL = "", apiList = []
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
token: "", token: "",
@@ -30,7 +30,7 @@ const store = new Vuex.Store({
state.openUser = user state.openUser = user
}, },
getConfig(state, params) { getConfig(state, params) {
Object.keys(params).map(e => state[e] = params[e]) state.config = params
}, },
bindAccount(state, params) { bindAccount(state, params) {
//具备解决二次登录,绑定手机,token等问题 //具备解决二次登录,绑定手机,token等问题
@@ -61,7 +61,7 @@ const store = new Vuex.Store({
}, },
redirectCode(state, url = location.href) { redirectCode(state, url = location.href) {
let REDIRECT_URI = encodeURIComponent(url), let REDIRECT_URI = encodeURIComponent(url),
corpid = state.corpId || agentConfig?.corpid corpid = state.corpId
const redirectTo = cid => { const redirectTo = cid => {
location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base#wechat_redirect' location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base#wechat_redirect'
.replace(/CORPID/g, cid) .replace(/CORPID/g, cid)
@@ -71,7 +71,7 @@ const store = new Vuex.Store({
redirectTo(corpid) redirectTo(corpid)
} else { } else {
store.dispatch("agentSign").then(() => { store.dispatch("agentSign").then(() => {
corpid = state.corpId || agentConfig?.corpid corpid = state.corpId
redirectTo(corpid) redirectTo(corpid)
}) })
} }
@@ -198,7 +198,7 @@ const store = new Vuex.Store({
}) })
}, },
getCode(store, url) { getCode(store, url) {
if (agentConfig?.corpid) { if (store.state.config?.corpid) {
store.commit('redirectCode', url) store.commit('redirectCode', url)
} else { } else {
store.dispatch('agentSign').then(() => { store.dispatch('agentSign').then(() => {
@@ -232,17 +232,20 @@ const store = new Vuex.Store({
}) })
} }
}, },
agentSign(state) { agentSign(state, params) {
let url = window.location.href let url = window.location.href,
{corpId, suiteId} = state.state.config
if (agentSignURL == url) { if (agentSignURL == url) {
return Promise.resolve() return Promise.resolve()
} else { } else {
agentSignURL = url agentSignURL = url
return http.post("/app/wxcp/portal/agentSign", null, { params = params || {corpId, suiteId}
params: {url} return http.post("/app/wxcptp/portal/agentSign", null, {
params: {...params, url}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
let params = { let config = {
...params,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来若要查看传入的参数可以在pc端打开参数信息会通过log打出仅在pc端时才会打印。 debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来若要查看传入的参数可以在pc端打开参数信息会通过log打出仅在pc端时才会打印。
beta: true,// 必须这么写否则wx.invoke调用形式的jsapi会有问题 beta: true,// 必须这么写否则wx.invoke调用形式的jsapi会有问题
corpid: res.data.corpid, // 必填企业微信的corpid必须与当前登录的企业一致 corpid: res.data.corpid, // 必填企业微信的corpid必须与当前登录的企业一致
@@ -252,8 +255,8 @@ const store = new Vuex.Store({
signature: res.data.signature,// 必填,签名,见 附录-JS-SDK使用权限签名算法 signature: res.data.signature,// 必填,签名,见 附录-JS-SDK使用权限签名算法
...res.data, ...res.data,
} }
agentConfig = params state.commit("getConfig", config)
state.commit("getConfig", {corpId: params.corpid}) return config
} }
}).catch(err => { }).catch(err => {
console.error(err) console.error(err)
@@ -261,11 +264,11 @@ const store = new Vuex.Store({
} }
}, },
injectJWeixin(state, ops) { injectJWeixin(state, ops) {
const inject = jsApiList => new Promise((resolve, reject) => { const inject = (jsApiList, config = state.state.config) => new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let sdk = wx?.agentConfig ? wx : jWeixin let sdk = wx?.agentConfig ? wx : jWeixin
sdk?.agentConfig({ sdk?.agentConfig({
...agentConfig, jsApiList, ...config, jsApiList,
success: res => resolve(res), success: res => resolve(res),
fail: err => { fail: err => {
console.error(err) console.error(err)
@@ -275,7 +278,7 @@ const store = new Vuex.Store({
}, 500) }, 500)
}) })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
state.dispatch("agentSign").then(() => { state.dispatch("agentSign").then(config => {
if (typeof ops == "object") { if (typeof ops == "object") {
ops?.map(api => { ops?.map(api => {
if (!apiList?.includes(api)) apiList.push(api) if (!apiList?.includes(api)) apiList.push(api)
@@ -283,7 +286,7 @@ const store = new Vuex.Store({
} else { } else {
if (!apiList?.includes(ops)) apiList.push(ops) if (!apiList?.includes(ops)) apiList.push(ops)
} }
inject(apiList).then(r => resolve(r)).catch(err => reject(err)) inject(apiList, config).then(r => resolve(r)).catch(err => reject(err))
}) })
}) })
}, },
@@ -318,6 +321,27 @@ const store = new Vuex.Store({
}, 500) }, 500)
}) })
}, },
selectEnterpriseContact(state) {
return new Promise(resolve => {
state.dispatch("injectJWeixin", "selectEnterpriseContact").then(() => {
setTimeout(() => {
let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin
sdk?.invoke("selectEnterpriseContact", {
fromDepartmentId: -1,
mode: "multi",
type: ["user"]
}, res => {
if (res.err_msg == "selectEnterpriseContact:ok") {
if (typeof res.result == 'string') {
res.result = JSON.parse(res.result)
}
resolve(res.result)
}
})
}, 500)
})
})
},
}, },
getters: { getters: {
getDict: state => key => { getDict: state => key => {