communityCode

dev
bibi 3 years ago
parent 18083f5080
commit 28c9dab751

@ -12,6 +12,7 @@
"core-js": "^3.6.5", "core-js": "^3.6.5",
"less": "^4.1.2", "less": "^4.1.2",
"less-loader": "5.0.0", "less-loader": "5.0.0",
"momen": "^0.0.1-security",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.5.3", "vue-router": "^3.5.3",

@ -28,7 +28,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1300 }" :scroll="{ x: 1400 }"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed, onChange: selectionChoosed,

@ -1,16 +1,9 @@
/*
* @Author: your name
* @Date: 2021-11-18 17:15:53
* @LastEditTime: 2021-11-22 15:40:15
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /ansu-business/src/main.js
*/
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import './styles/index.less'; import './styles/index.less';
import mixins from "@/mixins" import mixins from "@/mixins"
import Antd from 'ant-design-vue'; import Antd from 'ant-design-vue';
// import moment from 'moment';
import util from '@/utils/util.js' import util from '@/utils/util.js'
import 'ant-design-vue/dist/antd.css'; import 'ant-design-vue/dist/antd.css';
@ -19,7 +12,10 @@ Vue.use(Antd);
Vue.use(mixins); Vue.use(mixins);
import store from "@/store"; import store from "@/store";
import router from "@/permission"; import router from "@/permission";
Vue.prototype.$baseUrl = process.env.VUE_APP_URL + '123456/manage'
// Vue.prototype.$moment = moment
const communityCode = store.getters.getCommunityCode;
Vue.prototype.$baseUrl = process.env.VUE_APP_URL + communityCode + '/manage'
Vue.config.productionTip = false Vue.config.productionTip = false
import commonTable from './components/table' import commonTable from './components/table'

@ -24,8 +24,9 @@ function filterRequestData(obj) {
return o; return o;
} }
//创建axios的实例 //创建axios的实例
const communityCode = store.getters.getCommunityCode;
const httpService = axios.create({ const httpService = axios.create({
baseURL: process.env.VUE_APP_URL+'123456/manage',// TODO:具体的配置可以根据项目情况而来 baseURL: process.env.VUE_APP_URL+ communityCode +'/manage',// TODO:具体的配置可以根据项目情况而来
timeout: 5000 timeout: 5000
}) })

@ -10,6 +10,9 @@ const actions = {
setToken: ({commit}, log) => { setToken: ({commit}, log) => {
commit('setToken', log) commit('setToken', log)
}, },
setCommunityCode: ({commit}, log) => {
commit('communityCode', log)
},
setSelectedKeys: ({commit}, log) => { setSelectedKeys: ({commit}, log) => {
commit('setSelectedKeys', log) commit('setSelectedKeys', log)
}, },

@ -16,6 +16,9 @@ const getters = {
getToken(state) { getToken(state) {
return state.token return state.token
}, },
getCommunityCode(state) {
return state.communityCode
},
} }
export default getters export default getters

@ -21,6 +21,10 @@ const mutations = {
state.token = log; state.token = log;
sessionStorage.setItem('token', log); sessionStorage.setItem('token', log);
}, },
setCommunityCode: (state, log) => {
state.token = log;
sessionStorage.setItem('communityCode', log);
},
} }
export default mutations export default mutations

@ -9,6 +9,7 @@
const state = { const state = {
selectedKeys: JSON.parse(sessionStorage.getItem('selectedKeys')) || ['/'], selectedKeys: JSON.parse(sessionStorage.getItem('selectedKeys')) || ['/'],
openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [], openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [],
token: sessionStorage.getItem('token') || "" token: sessionStorage.getItem('token') || "",
communityCode: sessionStorage.getItem('communityCode') || "123456",
} }
export default state export default state

@ -1,6 +1,6 @@
export default { export default {
install: function (Vue) { install: function (Vue) {
Vue.prototype.$upload = process.env.VUE_APP_URL + 'user/upload/uploadTestMinioImg' Vue.prototype.$upload = process.env.VUE_APP_URL + '123456/manage/user/upload/uploadTestMinioImg'
Vue.prototype.ImgUrl = (src) => { Vue.prototype.ImgUrl = (src) => {
return process.env.VUE_APP_STATIC + src return process.env.VUE_APP_STATIC + src
} }

@ -4,7 +4,7 @@
<script> <script>
export default { export default {
name:'application' name:'application'
} }
</script> </script>

@ -45,7 +45,7 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="出生日期" prop="birthday"> <a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday" /> <a-date-picker v-model="form.birthday" value-format="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">

@ -45,7 +45,7 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="出生日期" prop="birthday"> <a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday" /> <a-date-picker v-model="form.birthday" value-format="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -72,15 +72,19 @@
:action="`${$upload}`" :action="`${$upload}`"
:headers="uploadHeaders" :headers="uploadHeaders"
list-type="picture-card" list-type="picture-card"
:file-list="fileList" :file-list="idcardfileList"
@preview="handlePreview" @preview="handlePreview"
@change="handleChange" @change="idcardhandleChange"
> >
<div v-if="fileList.length < 2"> <div v-if="idcardfileList.length < 2">
<a-icon type="plus" /> <!-- <a-icon type="plus" /> -->
<a-icon :type="imgLoading ? 'loading' : 'plus'" />
<div class="ant-upload-text">点击上传</div> <div class="ant-upload-text">点击上传</div>
</div> </div>
</a-upload> </a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
<span style="color: #00000073" <span style="color: #00000073"
>单张最多不超过4M最多上传2张支持JPG,PNG格式</span >单张最多不超过4M最多上传2张支持JPG,PNG格式</span
> >
@ -162,7 +166,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<div @click="u1pload"></div> <div>其他信</div>
<a-divider></a-divider> <a-divider></a-divider>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
@ -205,7 +209,7 @@
</template> </template>
<script> <script>
import { insertManageUser,departmentList,uploadManageUserIdCard,manageUserInfo,EditManageUser } from "@/api/basic/department"; import { insertManageUser,departmentList,manageUserInfo,EditManageUser } from "@/api/basic/department";
import store from "@/store"; import store from "@/store";
function getBase64(file) { function getBase64(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -238,12 +242,12 @@ export default {
this.form.idCard = data.idCard this.form.idCard = data.idCard
this.form.tel = data.tel this.form.tel = data.tel
this.telephoneNum = data.tel this.telephoneNum = data.tel
// this.form.birthday = this.formatDate(data.birthday/1000,'yyyy-MM-dd hh:mm:ss') this.form.birthday = data.birthday
this.form.password = data.password this.form.password = data.password
this.form.email = data.email this.form.email = data.email
this.form.address = data.address this.form.address = data.address
this.form.idCardImgUrls = data.idCardImgUrls this.form.idCardImgUrls = data.idCardImgUrls
// this.form.entryDate = this.formatDate(data.entryDate/1000,'yyyy-MM-dd hh:mm:ss') this.form.entryDate = data.entryDate
this.form.salary = data.salary this.form.salary = data.salary
this.form.emergencyContact = data.emergencyContact this.form.emergencyContact = data.emergencyContact
this.form.emergencyContactNumber = data.emergencyContactNumber this.form.emergencyContactNumber = data.emergencyContactNumber
@ -272,12 +276,12 @@ export default {
return { return {
previewVisible: false, previewVisible: false,
previewImage: "", previewImage: "",
imgLoading: false,
treeData:[], treeData:[],
cascVal:[], cascVal:[],
telephoneNum:"", telephoneNum:"",
uploadHeaders: { uploadHeaders: {
"manage-login-token": store.getters.getToken, "manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
}, },
sexOption: [ sexOption: [
{ {
@ -303,7 +307,7 @@ export default {
password: "", password: "",
email: "", email: "",
address: "", address: "",
idCardImgUrls: "", idCardImgUrls: [],
departmentId: "", departmentId: "",
departmentIdPath: "", departmentIdPath: "",
positionId: "", positionId: "",
@ -335,7 +339,8 @@ export default {
{ required: true, message: "请选择入职时间", trigger: "change" }, { required: true, message: "请选择入职时间", trigger: "change" },
], ],
}, },
fileList: [], idcardfileList: [],
fileList:[]
}; };
}, },
created() { created() {
@ -378,7 +383,7 @@ export default {
// //
close() { close() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.cascVal=[] this.cascVal = []
}, },
success(){ success(){
this.$emit('success') this.$emit('success')
@ -407,12 +412,12 @@ export default {
handleCancel() { handleCancel() {
this.previewVisible = false; this.previewVisible = false;
}, },
handleChange({ fileList }) { idcardhandleChange(info) {
this.fileList = fileList; this.idcardfileList = info.fileList
if(info.file.status === 'done'){
this.form.idCardImgUrls.push(info.file.response.data)
}
}, },
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
}, },
}; };
</script> </script>

@ -54,7 +54,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1300 }" :scroll="{ x: 1400 }"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed, onChange: selectionChoosed,

@ -48,7 +48,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1300 }" :scroll="{ x: 1400 }"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed, onChange: selectionChoosed,

@ -45,7 +45,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1300 }" :scroll="{ x: 1400 }"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, onChange: onSelectChange,

@ -73,7 +73,7 @@
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1300 }" :scroll="{ x: 1400 }"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed, onChange: selectionChoosed,

@ -18,7 +18,7 @@
<div v-for="(item,index) in menuTags" :key="index" :class="tagActive === index ? 'h-d1-item h-d1-item-active' : 'h-d1-item'" @click="handlerTags(index)"><span class="s1">{{item.label}}</span></div> <div v-for="(item,index) in menuTags" :key="index" :class="tagActive === index ? 'h-d1-item h-d1-item-active' : 'h-d1-item'" @click="handlerTags(index)"><span class="s1">{{item.label}}</span></div>
</div> </div>
<div class="h-d2"> <div class="h-d2">
<a-icon class="h-d2-c" style="color: #e27473" type="logout" /> <a-icon class="h-d2-c" style="color: #e27473" type="logout" @click="logout"/>
<a-icon class="h-d2-c" style="color: #b7b7b7" type="question-circle" /> <a-icon class="h-d2-c" style="color: #b7b7b7" type="question-circle" />
<a-icon class="h-d2-c" type="alert" /> <a-icon class="h-d2-c" type="alert" />
<a-icon class="h-d2-c" style="color: #979a96;margin-right: 7px;" type="user" /> <a-icon class="h-d2-c" style="color: #979a96;margin-right: 7px;" type="user" />
@ -99,6 +99,10 @@ export default {
handlerTags(n) { handlerTags(n) {
this.tagActive = n; this.tagActive = n;
sessionStorage.setItem('index',n) sessionStorage.setItem('index',n)
},
logout(){
this.$router.push({name:'Login'})
this.setToken(null);
} }
}, },
}; };

@ -245,7 +245,11 @@ export default {
loginTel(this.form).then(res=>{ loginTel(this.form).then(res=>{
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
// token
this.setToken(res.data); this.setToken(res.data);
//
this.setCommunityCode(123456)
// this.setCommunityCode(res.communityCode)
this.$router.push("/"); this.$router.push("/");
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);

15924
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save