数据相关修改

dev
yujialong 3 years ago
parent ec6a9332b4
commit 76b55f786a
  1. 6
      src/store/index.js
  2. 5
      src/utils/api.js
  3. 2
      src/utils/http.js
  4. 19
      src/views/customer/AddCustomer.vue
  5. 52
      src/views/data/Framework.vue
  6. 20
      src/views/data/Introduce.vue
  7. 22
      src/views/data/Product.vue
  8. 60
      src/views/user/AddUser.vue

@ -15,7 +15,8 @@ const store = new Vuex.Store({
userLoginId: '', userLoginId: '',
userName: '', userName: '',
roleId: '', roleId: '',
loginToken: '' loginToken: '',
schoolId: ''
}, },
mutations:{ mutations:{
userAvatar(state,payload){ userAvatar(state,payload){
@ -48,6 +49,9 @@ const store = new Vuex.Store({
tokenData (state, payload) { tokenData (state, payload) {
state.loginToken = payload.loginToken state.loginToken = payload.loginToken
}, },
schoolIdData (state, payload) {
state.schoolId = payload.schoolId
},
} }
}); });

@ -25,10 +25,11 @@ export default {
delCustomers: `${host}/nakadai/nakadai/customer/delCustomers`, delCustomers: `${host}/nakadai/nakadai/customer/delCustomers`,
updateCustomer: `${host}/nakadai/nakadai/customer/updateCustomer`, updateCustomer: `${host}/nakadai/nakadai/customer/updateCustomer`,
addCustomer: `${host}/nakadai/nakadai/customer/addCustomer`, addCustomer: `${host}/nakadai/nakadai/customer/addCustomer`,
// /nakadai/nakadai/customer/queryCustomerDetails
queryCustomer: `${host}/nakadai/nakadai/customer/queryCustomer`, queryCustomer: `${host}/nakadai/nakadai/customer/queryCustomer`,
queryCustomerDetails: `${host}/nakadai/nakadai/customer/queryCustomerDetails`, queryCustomerDetails: `${host}/nakadai/nakadai/customer/queryCustomerDetails`,
saveOrUpdate:`${host}/data/data/role/saveOrUpdate`,
doAssign:`${host}/data/data/permission/doAssign`,
updateCustomerByRoleId:`${host}/nakadai/nakadai/customer/updateCustomerByRoleId`,
resetPwdCustomer: `${host}/nakadai/nakadai/customer/resetPwd`, resetPwdCustomer: `${host}/nakadai/nakadai/customer/resetPwd`,
queryCustomerIsExists: `${host}/nakadai/nakadai/customer/queryCustomerIsExists`, queryCustomerIsExists: `${host}/nakadai/nakadai/customer/queryCustomerIsExists`,

@ -25,6 +25,8 @@ axios.interceptors.request.use(config => {
if(token){ if(token){
config.headers.token = token config.headers.token = token
} }
let schoolId = store.state.schoolId
if(schoolId) config.headers.schoolId = store.state.schoolId
return config; return config;
}, err => { }, err => {
Message.error({ Message.error({

@ -511,6 +511,25 @@ export default {
}).catch((res) => {}) }).catch((res) => {})
}else{ }else{
this.$post(this.api.addCustomer,data).then((res) => { this.$post(this.api.addCustomer,data).then((res) => {
let customerId = res.customerId
this.$store.commit('schoolIdData',{schoolId: this.form.schoolId})
this.$post(this.api.saveOrUpdate,{
clientId: 0,
id: '',
roleName: '超级管理员',
remark: '拥有一切权限',
isPort: 2
}).then(res => {
let roleId = res.roleId
let perData = {
roleId,
permissionId: ["1408370117262635009","1409351488911056897","1409351867862228993","1408370186435096578","1409352518310699009","1409352550615228418","1409352584240963585","1409352623344459778","1409352647054860289","1409352682471563266","1409352720786530305","1409352742290726913","1408370244584927233","1409352872662278146","1409352903574298626","1409352923509825538","1409352940068937730","1409353018443702273"],
isPort: 2
}
this.$post(this.api.doAssign,perData).then(res => {}).catch(res => {})
this.$post(`${this.api.updateCustomerByRoleId}?customerId=${customerId}&roleId=${roleId}`).then(res => {}).catch(res => {})
}).catch(res => {})
this.$message.success('添加成功') this.$message.success('添加成功')
this.goback() this.goback()
}).catch((res) => {}) }).catch((res) => {})

@ -22,7 +22,7 @@
<el-form label-width="80px" class="flex-between mgb20"> <el-form label-width="80px" class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<el-form-item label="更新时间" style="margin: 0 20px 0 0"> <el-form-item label="更新时间" style="margin: 0 20px 0 0">
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initData"></el-date-picker> <el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="searchData"></el-date-picker>
</el-form-item> </el-form-item>
<el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input> <el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input>
</div> </div>
@ -41,7 +41,7 @@
{{scope.row.dataSize}}M {{scope.row.dataSize}}M
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="更新时间" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="220" align="center"> <el-table-column label="操作" width="220" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览</el-button> <el-button type="text" @click="preview(scope.row)">预览</el-button>
@ -118,6 +118,8 @@ export default {
defaultTypeActive: [], defaultTypeActive: [],
defaultTypeChecked: [], defaultTypeChecked: [],
listData: [], listData: [],
listDataAll: [],
searchListData: [],
keyword: '', keyword: '',
page: 1, page: 1,
pageSize: 10, pageSize: 10,
@ -140,7 +142,7 @@ export default {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.searchData()
},500) },500)
} }
}, },
@ -179,10 +181,36 @@ export default {
}, },
getData(){ getData(){
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => { this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => {
this.listData = res.list let list = JSON.parse(res.getIdQueryTable)
this.total = res.totalCount list.map(n => {
n.updateTime = n.updateTime ? this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n.updateTime)) : ''
})
this.listDataAll = list
this.total = list.length
this.handlePage()
}).catch(res => {}) }).catch(res => {})
}, },
handlePage(){
let list = this.keyword ? this.searchListData : this.listDataAll
let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.listData = result
},
searchData(){
let list = this.listDataAll
let result = []
let updateTime = this.updateTime
list.map(n => {
if(updateTime){
if(n.updateTime && updateTime == this.formatDate('yyyy-MM-dd',new Date(n.updateTime)) && n.showName.includes(this.keyword)) result.push(n)
}else{
n.showName.includes(this.keyword) && result.push(n)
}
})
this.searchListData = result
this.listData = result.slice(0,10)
this.total = result.length
},
initData(){ initData(){
this.page = 1 this.page = 1
this.getData() this.getData()
@ -272,7 +300,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getData() this.handlePage()
}, },
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length != ''){ if(this.multipleSelection.length != ''){
@ -294,8 +322,9 @@ export default {
} }
}, },
getTable(n,i){ getTable(n,i){
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&showName=&pageNum=1&pageSize=10000`).then(res => { this.$post(`${this.api.originalListById}?categoryId=${n.realId}`).then(res => {
res.list.map(n => { let list = JSON.parse(res.originalListById)
list.map(n => {
n.label = n.showName n.label = n.showName
n.id = String(n.id) n.id = String(n.id)
if(this.defaultTypeChecked.includes(n.id)){ if(this.defaultTypeChecked.includes(n.id)){
@ -303,7 +332,7 @@ export default {
} }
}) })
n.children = res.list n.children = list
// if(!i && !this.tableName){ // if(!i && !this.tableName){
// this.tableName = res.list[0].name // this.tableName = res.list[0].name
// this.curId = res.list[0].id // this.curId = res.list[0].id
@ -332,8 +361,8 @@ export default {
}) })
}) })
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => { this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => {
this.defaultTypeChecked = res1.list.map(n => n.copyId) let list = JSON.parse(res1.getIdQueryTable)
this.defaultTypeChecked = list.map(n => n.copyId)
res.map((n,i) => { res.map((n,i) => {
if(n.children.length){ if(n.children.length){
n.children.map(n => { n.children.map(n => {
@ -398,7 +427,6 @@ export default {
showNames.push(n.showName) showNames.push(n.showName)
} }
}) })
console.log(11,names,showNames)
if(!names.length) return this.$message.warning('请选择数据') if(!names.length) return this.$message.warning('请选择数据')
this.submited = true this.submited = true

@ -10,21 +10,19 @@
<el-card shadow="hover" class="mgb20 teacher_tab"> <el-card shadow="hover" class="mgb20 teacher_tab">
<div class="flex-between" style="margin-bottom: 10px;"> <div class="flex-between" style="margin-bottom: 10px;">
<p>数据简介</p> <p>数据简介</p>
<el-button v-if="edited && !editing" type="primary" size="small" @click="editing = !editing">编辑</el-button> <el-button v-if="introduceText && !editing" type="primary" size="small" @click="editing = !editing">编辑</el-button>
</div> </div>
<div class="intro" v-if="!edited"> <div class="intro" v-if="!introduceText && !editing">
<p class="text">{{introduceText}}</p> <p class="text">请添加简介</p>
<div class="btn"> <div class="btn">
<el-button type="primary" size="small" @click="edit">{{introduceText ? '编辑简介' : '添加简介'}}</el-button> <el-button type="primary" size="small" @click="edit">添加</el-button>
</div> </div>
</div> </div>
<div v-else> <el-input v-if="introduceText || editing" placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<div class="btns" v-if="editing"> <div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button> <el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmEdit"> </el-button> <el-button type="primary" @click="confirmEdit"> </el-button>
</div> </div>
</div>
</el-card> </el-card>
</el-col> </el-col>
</el-main> </el-main>
@ -41,7 +39,6 @@ export default {
label: 'label' label: 'label'
}, },
defaultActive: [], defaultActive: [],
edited: false,
editing: false, editing: false,
introduce: '', introduce: '',
introduceText: '', introduceText: '',
@ -80,21 +77,22 @@ export default {
this.categoryId = item.id this.categoryId = item.id
this.defaultActive = [item.id] this.defaultActive = [item.id]
this.introduceText = item.introduce this.introduceText = item.introduce
this.introduce = item.introduce
}else{ }else{
this.categoryId = res[0].id this.categoryId = res[0].id
this.defaultActive = [res[0].id] this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce this.introduceText = res[0].introduce
this.introduce = res[0].introduce
} }
}).catch(res => {}) }).catch(res => {})
}, },
typeClick(data,node){ typeClick(data,node){
this.edited = false
this.editing = false this.editing = false
this.categoryId = data.id this.categoryId = data.id
this.introduceText = data.introduce this.introduceText = data.introduce
this.introduce = data.introduce
}, },
edit(){ edit(){
this.edited = true
this.editing = true this.editing = true
this.introduce = this.introduceText this.introduce = this.introduceText
}, },
@ -104,7 +102,7 @@ export default {
introduce: this.introduce introduce: this.introduce
}).then(res => { }).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功') this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.getData() this.introduceText = this.introduce
this.editing = false this.editing = false
}).catch(res => {}) }).catch(res => {})
} }

@ -201,6 +201,7 @@ export default {
pageSizeConfig: 10, pageSizeConfig: 10,
totalConfig: 0, totalConfig: 0,
listConfigData: [], listConfigData: [],
listConfigAll: [],
previewVisible: false, previewVisible: false,
previewHead: [], previewHead: [],
previewData: [] previewData: []
@ -253,11 +254,12 @@ export default {
}, },
getTable(n,i){ getTable(n,i){
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => { this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => {
res.list.map(n => { let list = JSON.parse(res.getIdQueryTable)
list.map(n => {
n.label = n.showName n.label = n.showName
n.id = String(n.id) n.id = String(n.id)
}) })
n.children = res.list n.children = list
}).catch(res => {}) }).catch(res => {})
}, },
getType(){ getType(){
@ -476,17 +478,27 @@ export default {
}, },
getConfigTable(){ getConfigTable(){
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => { this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => {
this.listConfigData = res.list let list = JSON.parse(res.getIdQueryTable)
this.totalConfig = res.totalCount list.map(n => {
n.updateTime = n.updateTime ? this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n.updateTime)) : ''
})
this.listConfigAll = list
this.totalConfig = list.length
this.handlePage()
}).catch(res => {}) }).catch(res => {})
}, },
handlePage(){
let list = this.listConfigAll
let result = list.slice((this.pageConfig - 1) * this.pageSize,this.pageConfig * this.pageSizeConfig)
this.listConfigData = result
},
initConfigData(){ initConfigData(){
this.pageConfig = 1 this.pageConfig = 1
this.getConfigTable() this.getConfigTable()
}, },
handleCurrentConfigChange(){ handleCurrentConfigChange(){
this.pageConfig = val this.pageConfig = val
this.getConfigTable() this.handlePage()
}, },
previewConfig(row){ previewConfig(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {

@ -209,7 +209,7 @@
</div> </div>
<div> <div>
<div class="flex-center" v-for="(item,index) in archivesList" :key="index"> <div class="flex-center" v-for="(item,index) in archivesList" :key="index" v-show="index == 0 || index == 1 || showArch">
<el-col :span="16" :offset="4"> <el-col :span="16" :offset="4">
<el-card shadow="hover" class="from_card"> <el-card shadow="hover" class="from_card">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail"> <el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail">
@ -297,6 +297,10 @@
</el-col> </el-col>
</div> </div>
</div> </div>
<div class="fold" v-if="archivesList.length > 1">
<img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="../../assets/img/person/open.png" alt="" @click="foldArch">
</div>
</div> </div>
</el-card> </el-card>
@ -308,7 +312,7 @@
<span>已绑定系统</span> <span>已绑定系统</span>
</div> </div>
<div> <div>
<el-dialog title="查看系统" :visible.sync="dialogFormVisible" :center="!isIE()" :close-on-click-modal="false"> <el-dialog :title="isShow ? '查看系统' : '编辑系统'" :visible.sync="dialogFormVisible" :center="!isIE()" :close-on-click-modal="false">
<el-form :class="{region: !isIE()}" ref="chooseList" :rules="rules" :disabled="isDetail"> <el-form :class="{region: !isIE()}" ref="chooseList" :rules="rules" :disabled="isDetail">
<el-form-item label="系统选择" label-width="100px"> <el-form-item label="系统选择" label-width="100px">
<el-select <el-select
@ -330,7 +334,6 @@
<el-radio v-model="radio" label="2" disabled>不绑定组织关系</el-radio> <el-radio v-model="radio" label="2" disabled>不绑定组织关系</el-radio>
</div> </div>
<div>
<el-card shadow="hover" v-for="(item,index) in chooseList" :key="index" class="school-item"> <el-card shadow="hover" v-for="(item,index) in chooseList" :key="index" class="school-item">
<p class="school-name">{{index}}</p> <p class="school-name">{{index}}</p>
<div class="card" :class="{isie: isIE()}"> <div class="card" :class="{isie: isIE()}">
@ -348,7 +351,7 @@
<p class="val">{{item1.account}}</p> <p class="val">{{item1.account}}</p>
</li> </li>
<li> <li>
<el-switch v-model="item1.isEnable" :active-value="1" :inactive-value="0" :active-text="item1.isEnable ? '启用' : '禁用'" @change="switchOff($event,item1)"></el-switch> <el-switch v-model="item1.isEnable" :active-value="1" :inactive-value="0" :active-text="item1.isEnable ? '启用' : '禁用'" :disabled="isShow" @change="switchOff($event,item1)"></el-switch>
</li> </li>
</div> </div>
<div class="line"> <div class="line">
@ -362,7 +365,16 @@
</div> </div>
</div> </div>
</el-card> </el-card>
</div>
<span slot="footer" class="dialog-footer">
<template v-if="isShow">
<el-button type="primary" @click="dialogFormVisible = false">返回</el-button>
</template>
<template v-else>
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="dialogFormVisible = false">确定</el-button>
</template>
</span>
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
@ -380,7 +392,8 @@
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-button type="text" @click="show(scope.row,true)">查看</el-button>
<el-button type="text" @click="show(scope.row,false)">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -576,7 +589,9 @@ export default {
}, },
clickFlag: true, clickFlag: true,
searchTimer: null searchTimer: null,
showArch: false,
isShow: false
}; };
}, },
mounted() { mounted() {
@ -800,7 +815,7 @@ export default {
}) })
} }
}, },
show(row){ show(row,isShow){
let obj = {} let obj = {}
Object.assign(obj,{ Object.assign(obj,{
regionName: row.platformName, regionName: row.platformName,
@ -812,6 +827,7 @@ export default {
this.choosecusArr = '' this.choosecusArr = ''
this.chooseCusList = [] this.chooseCusList = []
this.chooseList = [] this.chooseList = []
this.isShow = isShow
this.$get(this.api.selectUserSysBind, { userId: this.userId, platformId: row.platformId}).then(res => { this.$get(this.api.selectUserSysBind, { userId: this.userId, platformId: row.platformId}).then(res => {
let list = res.result.map let list = res.result.map
@ -820,10 +836,7 @@ export default {
list[i] = list[i][n] list[i] = list[i][n]
} }
} }
console.log(333,list)
this.chooseList = list this.chooseList = list
console.log(11,list)
}).catch(res => {}) }).catch(res => {})
}, },
switchOff(val,row){ switchOff(val,row){
@ -833,13 +846,36 @@ export default {
}).then(res => { }).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功') this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => {}) }).catch(res => {})
} },
foldArch() {
this.showArch = !this.showArch
},
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fold{
margin-top: 20px;
text-align: center;
img{
cursor: pointer;
&:hover{
opacity: .8;
}
}
}
.arrowTransform{
transition: 0.5s;
transform-origin: center;
transform: rotateZ(180deg);
}
.arrowTransformReturn{
transition: 0.5s;
transform-origin: center;
transform: rotateZ(0deg);
}
// //
.card ::v-deep .el-card { .card ::v-deep .el-card {
border-radius: 15px; border-radius: 15px;

Loading…
Cancel
Save