提交 8470ee73 编写于 作者: huangwensu's avatar huangwensu

可编辑范围修改

上级 6b7a6563
...@@ -51,9 +51,7 @@ export default { ...@@ -51,9 +51,7 @@ export default {
vm.getToken() vm.getToken()
}, },
mounted() { mounted() {
// setInterval(function(){
// vm.pushMessage()
// },60000)
}, },
methods: { methods: {
// 解密token // 解密token
...@@ -64,8 +62,9 @@ export default { ...@@ -64,8 +62,9 @@ export default {
let paramStr = href.substring(offset + 1, href.length) let paramStr = href.substring(offset + 1, href.length)
let pars = base64decode(paramStr) let pars = base64decode(paramStr)
let paramMap = getUrlParamsMap(pars, "&") let paramMap = getUrlParamsMap(pars, "&")
if (isNotEmptyUtils(paramMap["token"]) || localStorage.getItem('storageToken')) { if (isNotEmptyUtils(paramMap["token"])) {
vm.token = paramMap["token"] vm.token = paramMap["token"]
localStorage.setItem('storageToken', vm.token)
} else { } else {
window.location.href = getLoginUrl() // 没有token返回登录页面 window.location.href = getLoginUrl() // 没有token返回登录页面
return return
...@@ -79,14 +78,6 @@ export default { ...@@ -79,14 +78,6 @@ export default {
vm.changeToken(vm.token) vm.changeToken(vm.token)
vm.getUserAuth(vm.token) vm.getUserAuth(vm.token)
}, },
// 实时消息推送
pushMessage() {
vm.$notify({
title: '警告',
message: '这是一条警告的提示消息',
type: 'warning'
});
},
// 修改token // 修改token
...mapActions([ ...mapActions([
'changeToken', 'changeToken',
......
...@@ -11,12 +11,11 @@ const service = axios.create({ ...@@ -11,12 +11,11 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
if(config.data && config.data.token) { // if(config.data && config.data.token) {
localStorage.setItem('storageToken',config.data.token) // localStorage.setItem('storageToken',config.data.token)
} // }
config.headers['sysCode'] = 12 config.headers['sysCode'] = 12
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
//config.headers['token'] = 'AB14D7D7675E4D09B4B1566170076122'
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' }) config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// if (config.data && config.data.setEntry) { // if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10 // config.headers['sysCode'] = config.data.sysCode || 10
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<div class="btn-container"> <div class="btn-container">
<el-button v-if="stepNum == 1 && (componentStatus == 1 || !componentStatus)" @click="storageAndNext(1)" type="default" size="small">暂存</el-button> <el-button v-if="stepNum == 1 && (componentStatus == 1 || !componentStatus)" @click="storageAndNext(1)" type="default" size="small">暂存</el-button>
<el-button v-if="stepNum == 1" @click="storageAndNext(2)" type="primary" size="small" style="margin-left:0;">下一步</el-button> <el-button v-if="stepNum == 1" @click="storageAndNext(2)" type="primary" size="small" style="margin-left:0;">下一步</el-button>
<el-button v-if="stepNum == 2 && (componentStatus == 1 || !componentStatus)" @click="finishConponent(1)" :disabled="resultFlag == 2" type="default" size="small">暂存</el-button> <el-button v-if="stepNum == 2 && (componentStatus == 1 || !componentStatus)" @click="finishConponent(1)" type="default" size="small">暂存</el-button>
<el-button v-if="stepNum == 2" @click="finishConponent(2)" :disabled="resultFlag == 2" type="primary" size="small" style="margin-left:0;">完成</el-button> <el-button v-if="stepNum == 2" @click="finishConponent(2)" type="primary" size="small" style="margin-left:0;">完成</el-button>
</div> </div>
</div> </div>
<div class="first-step" v-if="stepNum == 1"> <div class="first-step" v-if="stepNum == 1">
...@@ -456,7 +456,7 @@ export default { ...@@ -456,7 +456,7 @@ export default {
vm = this vm = this
vm.componentId = vm.$route.query.id vm.componentId = vm.$route.query.id
vm.componentStatus = vm.$route.query.status vm.componentStatus = vm.$route.query.status
vm.resultFlag = vm.$route.query.resultFlag // 判断可编辑基础信息还是全部信息 1 为全部 2 为基础 vm.resultFlag = vm.$route.query.resultFlag // 判断可编辑范围是基础信息还是全部信息 1 为全部 2 为基础
vm.getCertificateList() // 获取证书列表 vm.getCertificateList() // 获取证书列表
vm.componentBasicInfo() // 根据ID查询组件基本信息 vm.componentBasicInfo() // 根据ID查询组件基本信息
}, },
...@@ -679,6 +679,10 @@ export default { ...@@ -679,6 +679,10 @@ export default {
for(let i = 0;i<vm.componentList.moduleModelList.length;i++) { for(let i = 0;i<vm.componentList.moduleModelList.length;i++) {
if((targetName - 1) == i) { if((targetName - 1) == i) {
if(vm.componentList.moduleModelList[i].id) { if(vm.componentList.moduleModelList[i].id) {
if(vm.resultFlag == 2) {
vm.$message.info("已关联项目只能编辑组件基础信息")
return
}
if(vm.componentList.moduleModelList[i].templetModelList) { if(vm.componentList.moduleModelList[i].templetModelList) {
vm.$confirm('删除模块会将改模块下已有模板同时删除,确认需要删除吗?', '提示', { vm.$confirm('删除模块会将改模块下已有模板同时删除,确认需要删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -781,6 +785,10 @@ export default { ...@@ -781,6 +785,10 @@ export default {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
if(vm.componentList.moduleModelList[i].templetModelList[index1].id) { if(vm.componentList.moduleModelList[i].templetModelList[index1].id) {
if(vm.resultFlag == 2) {
vm.$message.info("已关联项目只能编辑组件基础信息")
return
}
vm.GET('portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => { vm.GET('portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模板!') vm.$message.info('成功删除模板!')
...@@ -827,6 +835,10 @@ export default { ...@@ -827,6 +835,10 @@ export default {
for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){ for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){
if(index2 == q) { if(index2 == q) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id) { if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id) {
if(vm.resultFlag == 2) {
vm.$message.info("已关联项目只能编辑组件基础信息")
return
}
vm.GET('portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => { vm.GET('portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模板元件内容!') vm.$message.info('成功删除模板元件内容!')
...@@ -873,6 +885,10 @@ export default { ...@@ -873,6 +885,10 @@ export default {
}, },
// 完成(暂存) // 完成(暂存)
finishConponent(flag) { finishConponent(flag) {
if(vm.resultFlag == 2) {
vm.$message.info("已关联项目只能编辑组件基础信息")
return
}
let req = null let req = null
if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) { if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
...@@ -891,7 +907,7 @@ export default { ...@@ -891,7 +907,7 @@ export default {
} }
for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) { for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) {
for(let k = 0; k < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length; k++) { for(let k = 0; k < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length; k++) {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1 || !vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content2) { if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中名称为空,请添加内容后保存") vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中名称为空,请添加内容后保存")
return return
} }
...@@ -941,6 +957,15 @@ export default { ...@@ -941,6 +957,15 @@ export default {
vm.GET('portalComponent/ModuleList',{openFlag: 2}).then((res) => { vm.GET('portalComponent/ModuleList',{openFlag: 2}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.resourceArray = res.data.moduleModelList vm.resourceArray = res.data.moduleModelList
// for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
// if(vm.componentList.moduleModelList[i].moduleType == 2 ) {
// for(let j = 0; j < vm.resourceArray.length; j++) {
// if( vm.componentList.moduleModelList[i].id == vm.resourceArray[j].id) {
// vm.resourceArray.splice(j,1)
// }
// }
// }
// }
} }
}) })
}, },
...@@ -950,6 +975,7 @@ export default { ...@@ -950,6 +975,7 @@ export default {
for(let i = 0; i < vm.resourceArray.length; i++) { for(let i = 0; i < vm.resourceArray.length; i++) {
if(val == vm.resourceArray[i].id) { if(val == vm.resourceArray[i].id) {
vm.dialogData = vm.resourceArray[i] vm.dialogData = vm.resourceArray[i]
vm.resourceArray.splice(i,1)
break break
} }
} }
...@@ -988,6 +1014,8 @@ export default { ...@@ -988,6 +1014,8 @@ export default {
vm.componentList.moduleModelList.push(vm.dialogData) vm.componentList.moduleModelList.push(vm.dialogData)
vm.firstTab = vm.componentList.moduleModelList.length + '' vm.firstTab = vm.componentList.moduleModelList.length + ''
} }
vm.dialogData = []
vm.selectResource.resourceModuleSelect = ''
} }
} }
} }
......
...@@ -216,6 +216,11 @@ export default { ...@@ -216,6 +216,11 @@ export default {
}, },
// 删除 // 删除
deleteComponent(row) { deleteComponent(row) {
vm.$confirm('确定要删除该组件吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portalComponent/deleteComponentById',{id: row.id}).then((res) => { vm.GET('portalComponent/deleteComponentById',{id: row.id}).then((res) => {
if(res.code == "000000") { if(res.code == "000000") {
vm.$message({ vm.$message({
...@@ -227,6 +232,12 @@ export default { ...@@ -227,6 +232,12 @@ export default {
}).catch(function (error) { }).catch(function (error) {
vm.$message.error(error); vm.$message.error(error);
}); });
}).catch(() => {
vm.$message({
type: 'info',
message: '已取消'
})
})
}, },
handleSizeChange(value) { handleSizeChange(value) {
vm.searchParam.pageSize = value vm.searchParam.pageSize = value
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册