应用系统上架

This commit is contained in:
a0049873 2022-11-04 10:02:57 +08:00
parent f25e57e9b1
commit 42bba89d54
3 changed files with 386 additions and 378 deletions

View File

@ -2,7 +2,7 @@ import Cookies from 'js-cookie'
import qs from 'qs'
import { deepClone } from '@/utils/form-generator/index'
export default {
data() {
data () {
/* eslint-disable */
return {
// 设置属性
@ -35,19 +35,19 @@ export default {
}
/* eslint-enable */
},
created() {
created () {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.query()
}
},
activated() {
activated () {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query()
}
},
methods: {
// 获取数据列表
query() {
query () {
this.dataListLoading = true
this.$http.get(
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
@ -71,16 +71,16 @@ export default {
if (this.dataList[index].type != null) {
switch (item.type) {
case 1:
this.dataList[index].type = '省';
this.dataList[index].type = '省'
break
case 2:
this.dataList[index].type = '市';
this.dataList[index].type = '市'
break
case 3:
this.dataList[index].type = '区';
this.dataList[index].type = '区'
break
case 4:
this.dataList[index].type = '企业';
this.dataList[index].type = '企业'
break
}
}
@ -88,38 +88,23 @@ export default {
item.children.map((item2, index2) => {
switch (item2.type) {
case 1:
this.dataList[index].children[index2].type = '省';
this.dataList[index].children[index2].type = '省'
break
case 2:
this.dataList[index].children[index2].type = '市';
this.dataList[index].children[index2].type = '市'
break
case 3:
this.dataList[index].children[index2].type = '区';
this.dataList[index].children[index2].type = '区'
break
case 4:
this.dataList[index].children[index2].type = '企业';
this.dataList[index].children[index2].type = '企业'
break
}
})
}
})
// 我的代办特殊处理
if (this.mixinViewModuleOptions.getDataListURL === '/act/task/myToDoTaskPage') {
this.$http.get('/sys/user/info').then(userRes => {
console.log('当前用户信息===========>', userRes.data.data.id)
const userId = userRes.data.data.id
this.dataList = this.dataList.filter(item => {
// userId creator
console.log(item.params.creator)
if (!(item.params.creator === userId) && !(item.params.userId === userId)) {
return item
}
})
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
})
} else {
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
}
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
if (this.dataList[0].type === '组件服务') {
this.dataList.map(val => {
@ -131,9 +116,9 @@ export default {
})
} else if (this.dataList[0].type === '应用系统') {
this.dataList.forEach((item) => {
item.belongProject = "城市信息模型";
item.belongSystem = "信息模型技术平台";
});
item.belongProject = '城市信息模型'
item.belongSystem = '信息模型技术平台'
})
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域')
})
@ -147,11 +132,11 @@ export default {
})
},
// 多选
dataListSelectionChangeHandle(val) {
dataListSelectionChangeHandle (val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle(data) {
dataListSortChangeHandle (data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
@ -162,22 +147,22 @@ export default {
this.query()
},
// 分页, 每页条数
pageSizeChangeHandle(val) {
pageSizeChangeHandle (val) {
this.page = 1
this.limit = val
this.query()
},
// 分页, 当前页
pageCurrentChangeHandle(val) {
pageCurrentChangeHandle (val) {
this.page = val
this.query()
},
getDataList: function() {
getDataList: function () {
this.page = 1
this.query()
},
// 新增
addOrUpdateHandle(id) {
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
@ -188,7 +173,7 @@ export default {
},
// 组件服务新增
addOrUpdateHandleAI(id) {
addOrUpdateHandleAI (id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
@ -246,7 +231,7 @@ export default {
}, 100)
},
// 应用资源新增
addOrUpdateHandleServe(id) {
addOrUpdateHandleServe (id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
@ -304,7 +289,7 @@ export default {
}, 100)
},
// 修改
UpdateHandle(val) {
UpdateHandle (val) {
this.addOrUpdateVisible = true
this.disabled = false
const cloneVal = deepClone(val)
@ -329,7 +314,7 @@ export default {
})
},
// 关闭当前窗口
closeCurrentTab(data) {
closeCurrentTab (data) {
var tabName = this.$store.state.contentTabsActiveName
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
if (this.$store.state.contentTabs.length <= 0) {
@ -341,7 +326,7 @@ export default {
}
},
// 删除
deleteHandle(id) {
deleteHandle (id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
@ -375,7 +360,7 @@ export default {
}).catch(() => {})
},
deleteHandle2(id) {
deleteHandle2 (id) {
console.log('删除========================》', id, this.dataListSelections)
const ids = []
if (id) {
@ -393,7 +378,7 @@ export default {
})
},
// 导出
exportHandle() {
exportHandle () {
var params = qs.stringify({
token: Cookies.get('ucsToken'),
...this.dataForm

View File

@ -292,12 +292,12 @@ export default {
: res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0;
if(this.dataList.length>0){
this.dataList.forEach((item)=>{
item.belongProject = "城市信息模型";
item.belongSystem = "信息模型技术平台";
});
: 0
if (this.dataList.length > 0) {
this.dataList.forEach((item) => {
item.belongProject = '城市信息模型'
item.belongSystem = '信息模型技术平台'
})
}
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data)
@ -707,15 +707,38 @@ export default {
.catch(() => {})
} else {
this.$http
.post('/resource/insert?source= b', this.submitFrom)
.post('/resource/insert?source= f', this.submitFrom)
.then(({ data: res }) => {
if (res.code !== 0) {
this.$message.error('上架失败!')
this.showPutOnTheShelfFlag2 = false
} else {
const instanceId = res.data
this.submitFrom.id = res.data
this.$http.get('/sys/user/info').then(info => {
this.$http.get('sys/user/' + info.data.data.id).then(user => {
const insertDeptId = this.submitFrom.deptId
const userId = user.data.data.id
const userName = user.data.data.realName
const params = {
instanceId: instanceId,
deptId: insertDeptId,
userId: userId,
userName: userName,
resourceDTO: [this.submitFrom]
}
this.$http.post('/resource/center/apply', params).then(res3 => {
if (res3.data.code == 0) {
this.$message.success('上架成功!')
this.showPutOnTheShelfFlag2 = false
this.clear()
} else {
this.$message.error('上架失败!')
this.showPutOnTheShelfFlag2 = false
}
})
})
})
}
})
.catch(() => {})

View File

@ -156,7 +156,7 @@ export default {
type: Array
}
},
data() {
data () {
return {
dataList: [],
dataView: [],
@ -171,16 +171,16 @@ export default {
}
},
watch: {
dataList(item) {
dataList (item) {
if (item) {
this.dataList = item
}
},
insertList(val) {
insertList (val) {
if (val) {
if (this.dataForm.type === '应用资源') {
if (this.dataForm.type === '应用系统') {
this.dataView = val.filter(
(item) => item.name === this.dataForm.type + '一'
(item) => item.name === '应用资源一'
)[0]
this.dataForm.infoList.map((item, index) => {
this.dataView.children.map((itemView, indexView) => {
@ -366,7 +366,7 @@ export default {
},
computed: {},
methods: {
videoAndImg(link) {
videoAndImg (link) {
if (link) {
window.open(link)
} else {
@ -376,7 +376,7 @@ export default {
})
}
},
deptName() {
deptName () {
console.log(this.dataForm.deptId)
this.$http
.get(`/sys/dept/${this.dataForm.deptId}`)
@ -385,7 +385,7 @@ export default {
this.unit = res.data.name
})
},
queryPartAppByKeyIdFunction(index, indexSon, indexSonSon) {
queryPartAppByKeyIdFunction (index, indexSon, indexSonSon) {
if (this.dataForm.type === '组件服务') {
this.$http
.get(
@ -424,8 +424,8 @@ export default {
}
}
},
created() { },
mounted() {
created () { },
mounted () {
this.deptName()
}
}