提交 e3d01697 作者: wk

企业级新闻接口接入

应用按钮操作权限接口接入
父级 8f082e36
......@@ -156,6 +156,10 @@ const params = {
url: "/ydt/aArticleLibrary/getAArticleLibraryForm",
method: "get"
},
getCompanyNews: {
url: "/ydt/aArticleLibrary/getWithCompany",
method: "get"
},
getHomeComp: {
url: "/ydt/api/v1/pageTemplate/getByTemplateKey",
method: "get"
......@@ -304,6 +308,10 @@ const params = {
switchJob: {
url: "/api/v2/user/user_v2/switch_job",
method: "put"
},
getAppOperateAuth: {
url: "/proxy/adminc/v1/system_manage/p_operation/queryAppOperations",
method: "get"
}
}
......
......@@ -37,7 +37,9 @@
projectId: "",
checkItemId: "",
inputValue: "",
check_tpl_id: ""
check_tpl_id: "",
appId: "",
auths: ['1', '2', '3', '4'] //操作权限对应增改查删
}
},
onShow() {
......@@ -51,6 +53,7 @@
this.check_tpl_id = option.check_tpl_id
this.checkItemId = option.check_item_id
this.projectId = option.project_id
this.appId = option.appId
},
onPullDownRefresh() {
......@@ -67,6 +70,18 @@
this.loadMore()
},
methods: {
getOperateAuth() {
Api.getAppOperateAuth({
data: {
appId: this.appId
}
}).then((result) => {
console.log("按钮权限", result);
if (result.code == 0) {
this.auths = result.data
}
})
},
initData() {
this.loadData(true)
},
......@@ -80,6 +95,20 @@
this.getCheckList(refresh, 1)
},
add() {
var isAuth = this.auths.find(item => item == '1')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有新增权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
uni.navigateTo({
url: `/pages/gallery/app/createCheck/createCheck?check_item_id=${this.checkItemId}&title=${this.title}&check_tpl_id=${this.check_tpl_id}`,
})
......@@ -93,6 +122,20 @@
this.getCheckList(true, 0)
},
itemClick(index) {
var isAuth = this.auths.find(item => item == '3')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有查看权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
let obj_no = this.objList[index].obj_no
let check_obj_id = this.objList[index].check_obj_id
uni.navigateTo({
......
......@@ -331,6 +331,7 @@
</template>
<script>
import Api from "../../../../api/api.js"
export default {
data() {
return {
......@@ -374,7 +375,8 @@
"align_type": "left" //对齐方式,可选参数:【'left','middle','right'】=》【'左对齐', '居中对齐', '右对齐'】
},
isSelectState: false, //是否选择状态
selectItems: [] //选中记录的recordId
selectItems: [], //选中记录的recordId
auths: ['1', '2', '3', '4'] //操作权限对应增改查删
}
},
onLoad: function(option) {
......@@ -383,6 +385,8 @@
this.businessType = option.business_type
this.checkModuleId = option.check_module_id
this.appId = option.check_tpl_id
//真正的appId
var appId1 = option.appId
this.isModelEdit = option.is_edit
this.loadProject()
if (this.businessType == 3) {
......@@ -392,6 +396,7 @@
uni.setNavigationBarTitle({
title: option.title
})
this.getOperateAuth(appId1)
},
onShow: function() {
uni.$once("refresh", res => {
......@@ -418,7 +423,33 @@
}
},
methods: {
getOperateAuth(appId) {
Api.getAppOperateAuth({
data: {
appId: appId
}
}).then((result) => {
console.log("按钮权限", result);
if (result.code == 0) {
this.auths = result.data
}
})
},
onDelete() {
var isAuth = this.auths.find(item => item == '4')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有删除权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
if (this.selectItems.length == 0) {
this.$toast.showToast("请选择需删除的记录")
return
......@@ -511,6 +542,20 @@
this.getFormList()
},
add: function() {
var isAuth = this.auths.find(item => item == '1')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有新增权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
if (this.businessType == 4) {
uni.navigateTo({
url: `/pages/gallery/app/addBusinessData/addBusinessData?check_tpl_id=${this.appId}&check_module_id=${this.checkModuleId}&bussness_type=${this.businessType}&project_id=${this.projectId}&title=${this.title}`
......@@ -542,6 +587,20 @@
this.getFormList()
},
toEdit: function(type, index) {
var isAuth = this.auths.find(item => item == '2')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有编辑权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
let form = {}
if (type == "left") {
form = this.leftList[index]
......@@ -561,6 +620,20 @@
}
},
toEditDetail: function(type, index) {
var isAuth = this.auths.find(item => item == '3')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有编辑权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
let form = {}
if (type == "left") {
form = this.leftList[index]
......@@ -574,6 +647,20 @@
})
},
toDelete: function(type, index) {
var isAuth = this.auths.find(item => item == '4')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有删除权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
uni.showModal({
title: '提示',
content: '确定删除该内容?',
......@@ -613,6 +700,20 @@
})
},
toDetail: function(type, index) {
var isAuth = this.auths.find(item => item == '3')
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有查看权限,如需要请联系管理人员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
success: res => {
}
})
return
}
let form = {}
if (type == "left") {
form = this.leftList[index]
......
......@@ -15,11 +15,13 @@
return {
appId: "",
models: [],
appInfo: {}
appInfo: {},
appId1: ""
}
},
onLoad(option) {
this.appId = option.check_tpl_id
this.appId1 = option.appId
uni.setNavigationBarTitle({
title: option.title
})
......@@ -43,7 +45,7 @@
},
itemClick(index) {
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=${this.appInfo.business_type}&check_tpl_id=${this.appId}&check_module_id=${this.models[index].check_module_id}&title=${this.models[index].module_name}&is_edit=${this.models[index].is_edit}&showCfg=${JSON.stringify(this.models[index].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=${this.appInfo.business_type}&check_tpl_id=${this.appId}&check_module_id=${this.models[index].check_module_id}&title=${this.models[index].module_name}&is_edit=${this.models[index].is_edit}&showCfg=${JSON.stringify(this.models[index].show_cfg)}&appId=${this.appId1}`
})
}
}
......
......@@ -45,12 +45,14 @@
},
menu: [],
appId: "",
projectName: ""
projectName: "",
appId1: ""
}
},
onLoad(option) {
this.appId = option.check_tpl_id
this.title = option.title
this.appId1 = option.appId
uni.setNavigationBarTitle({
title: this.title
})
......@@ -78,26 +80,6 @@
} else {
this.projectSelect = this.projectList[0]
}
// for (var i = 0; i < this.projectList.length; i++) {
// this.projectNames[i] = this.projectList[i].project_name
// }
// if (this.projectList.length > 0) {
// console.log("项目ID:", );
// let curId = uni.getStorageSync("project_id")
// if (curId.length == 0) {
// this.projectSelect = this.projectList[0].project_name
// uni.setStorageSync("project_id", this.projectList[0].project_id)
// uni.setStorageSync("project_name", this.projectList[0].project_name)
// } else {
// let project = this.projectList.find(item => item.project_id == curId)
// if (project) {
// this.projectSelect = uni.getStorageSync("project_name")
// } else {
// this.projectSelect = this.projectList[0].project_name
// }
// }
// }
} else {
if (result.code === -1) {
uni.showToast({
......@@ -155,7 +137,7 @@
} = e.detail
let item = this.list[index]
uni.navigateTo({
url: `/pages/gallery/app/checkObjList/checkObjList?check_item_name=${item.check_item_name}&check_item_id=${item.check_item_id}&check_tpl_id=${this.appId}&project_id=${this.projectSelect.project_id}`,
url: `/pages/gallery/app/checkObjList/checkObjList?check_item_name=${item.check_item_name}&check_item_id=${item.check_item_id}&check_tpl_id=${this.appId}&project_id=${this.projectSelect.project_id}&appId=${this.appId1}`,
})
},
itemSelect(e) {
......
......@@ -208,14 +208,14 @@
if (result.code == 0) {
if (!result.data.business_type) {
uni.navigateTo({
url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}`
url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}&appId=${model.app_id}`
})
} else if (result.data.business_type == 2) { //独立模式 需要获取模块数量 如果只有一个模块 自动跳转表单页面 "体验嘛 呵呵"
this.toAlone(model, result.data)
} else if (result.data.business_type == 3 || result.data.business_type == 4) { //流程模式
this.models = result.data.tpl_config
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}&appId=${model.app_id}`
})
} else if (result.data.business_type == 5) {
var source = "1"
......@@ -295,11 +295,11 @@
if (this.models.length == 1) {
let is_model_edit = this.models[0].is_edit
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=${model.source_id}&check_module_id=${this.models[0].check_module_id}&title=${this.models[0].module_name}&is_edit=${is_model_edit}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=${model.source_id}&check_module_id=${this.models[0].check_module_id}&title=${this.models[0].module_name}&is_edit=${is_model_edit}&showCfg=${JSON.stringify(this.models[0].show_cfg)}&appId=${model.app_id}`
})
} else {
uni.navigateTo({
url: `/pages/gallery/app/modeList/modeList?check_tpl_id=${model.source_id}&title=${info.tpl_name}`
url: `/pages/gallery/app/modeList/modeList?check_tpl_id=${model.source_id}&title=${info.tpl_name}&appId=${model.app_id}`
})
}
},
......
......@@ -286,8 +286,8 @@
uni.setStorageSync("project_id", this.project.project_id)
}
}
this.initData()
}
this.initData()
}, (err) => {
this.$toast.showToast(err.msg)
})
......@@ -431,7 +431,7 @@
Api.getNews({
data: {
pageNum: 1,
pageSize: 20,
pageSize: 10,
clientId: 2,
projectId: this.project_id,
}
......@@ -445,6 +445,63 @@
this.$toast.showToast(err.msg)
})
},
getCompanyNews() {
Api.getNews({
data: {
pageNum: 1,
pageSize: 10,
clientId: 2,
orgId: uni.getStorageSync("org_id")
}
}).then((result) => {
if (result.code == 0) {
this.news = result.data.list
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
getCompanyBanners() {
Api.getNews({
data: {
pageNum: 1,
pageSize: 5,
clientId: 1,
orgId: uni.getStorageSync("org_id")
}
}).then((result) => {
if (result.code == 0) {
this.banners = []
if (result.data.list.length > 0) {
result.data.list.forEach((item) => {
if (!item.coverImg || item.coverImg == 'null') {
item.coverImg = "../../static/banner-content.png"
}
this.banners.push(item)
})
console.log("banner", this.banners);
} else {
if (this.role == 'VISITOR') {
this.banners.push({
"coverImg": "../../static/banner-authority.png"
})
} else {
this.banners.push({
"coverImg": "../../static/banner-content.png"
})
}
}
} else {
this.$toast.showToast(result.msg)
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
//获取常用应用
getCommonApp() {
Api.getNormalApp().then((result) => {
......@@ -644,8 +701,14 @@
this.city = currentProject.city || '杭州市'
this.address = currentProject.province + currentProject.city + currentProject.area
}
this.getNews()
this.getBanners()
this.project_id = uni.getStorageSync("project_id")
if (!this.project_id) {
this.getCompanyBanners()
this.getCompanyNews()
} else {
this.getNews()
this.getBanners()
}
this.getWeather()
this.getAuthMenu()
},
......@@ -803,7 +866,7 @@
} else if (result.data.business_type == 3 || result.data.business_type == 4) { //流程模式
this.models = result.data.tpl_config
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}&appId=${model.app_id}`
})
} else if (result.data.business_type == 5) {
var source = "1"
......@@ -877,11 +940,11 @@
if (this.models.length == 1) {
let is_model_edit = this.models[0].is_edit
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=${model.source_id}&check_module_id=${this.models[0].check_module_id}&title=${this.models[0].module_name}&is_edit=${is_model_edit}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=${model.source_id}&check_module_id=${this.models[0].check_module_id}&title=${this.models[0].module_name}&is_edit=${is_model_edit}&showCfg=${JSON.stringify(this.models[0].show_cfg)}&appId=${model.app_id}`
})
} else {
uni.navigateTo({
url: `/pages/gallery/app/modeList/modeList?check_tpl_id=${model.source_id}&title=${info.tpl_name}`
url: `/pages/gallery/app/modeList/modeList?check_tpl_id=${model.source_id}&title=${info.tpl_name}&appId=${model.app_id}`
})
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment