后台挂载 新增必填字段校验,列表按必填进行展示
This commit is contained in:
parent
3675a618bf
commit
b7fd109210
|
@ -2,7 +2,7 @@ import Cookies from 'js-cookie'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
import { deepClone } from '@/utils/form-generator/index'
|
import { deepClone } from '@/utils/form-generator/index'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data () {
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
return {
|
return {
|
||||||
// 设置属性
|
// 设置属性
|
||||||
|
@ -38,19 +38,19 @@ export default {
|
||||||
}
|
}
|
||||||
/* eslint-enable */
|
/* eslint-enable */
|
||||||
},
|
},
|
||||||
created() {
|
created () {
|
||||||
if (this.mixinViewModuleOptions.createdIsNeed) {
|
if (this.mixinViewModuleOptions.createdIsNeed) {
|
||||||
this.query()
|
this.query()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activated() {
|
activated () {
|
||||||
if (this.mixinViewModuleOptions.activatedIsNeed) {
|
if (this.mixinViewModuleOptions.activatedIsNeed) {
|
||||||
this.query()
|
this.query()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
query() {
|
query () {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
this.$http.get(
|
this.$http.get(
|
||||||
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
|
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
|
||||||
|
@ -109,11 +109,15 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
|
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
|
||||||
// if (this.dataList[0].type === '组件服务') {
|
if (this.dataList[0].type === '组件服务') {
|
||||||
// this.dataList.map(val => {
|
this.dataList.map(val => {
|
||||||
// val.infoList = val.infoList.filter(item => item.attrType === '部署位置' || item.attrType === '组件类型' || item.attrType === '应用领域')
|
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域' || item.attrType === '组件类型')
|
||||||
// })
|
})
|
||||||
// }
|
} else if (this.dataList[0].type === '应用资源') {
|
||||||
|
this.dataList.map(val => {
|
||||||
|
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域')
|
||||||
|
})
|
||||||
|
}
|
||||||
if (this.mixinViewModuleOptions.requestCallback) {
|
if (this.mixinViewModuleOptions.requestCallback) {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data)
|
||||||
}
|
}
|
||||||
|
@ -123,11 +127,11 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
dataListSelectionChangeHandle(val) {
|
dataListSelectionChangeHandle (val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
// 排序
|
// 排序
|
||||||
dataListSortChangeHandle(data) {
|
dataListSortChangeHandle (data) {
|
||||||
if (!data.order || !data.prop) {
|
if (!data.order || !data.prop) {
|
||||||
this.order = ''
|
this.order = ''
|
||||||
this.orderField = ''
|
this.orderField = ''
|
||||||
|
@ -138,13 +142,13 @@ export default {
|
||||||
this.query()
|
this.query()
|
||||||
},
|
},
|
||||||
// 分页, 每页条数
|
// 分页, 每页条数
|
||||||
pageSizeChangeHandle(val) {
|
pageSizeChangeHandle (val) {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.limit = val
|
this.limit = val
|
||||||
this.query()
|
this.query()
|
||||||
},
|
},
|
||||||
// 分页, 当前页
|
// 分页, 当前页
|
||||||
pageCurrentChangeHandle(val) {
|
pageCurrentChangeHandle (val) {
|
||||||
this.page = val
|
this.page = val
|
||||||
this.query()
|
this.query()
|
||||||
},
|
},
|
||||||
|
@ -153,7 +157,7 @@ export default {
|
||||||
this.query()
|
this.query()
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
addOrUpdateHandle(id) {
|
addOrUpdateHandle (id) {
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -164,7 +168,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 组件服务新增
|
// 组件服务新增
|
||||||
addOrUpdateHandleAI(id) {
|
addOrUpdateHandleAI (id) {
|
||||||
// const infoList = []
|
// const infoList = []
|
||||||
let showList = []
|
let showList = []
|
||||||
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
|
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
|
||||||
|
@ -222,7 +226,7 @@ export default {
|
||||||
}, 100)
|
}, 100)
|
||||||
},
|
},
|
||||||
// 应用资源新增
|
// 应用资源新增
|
||||||
addOrUpdateHandleServe(id) {
|
addOrUpdateHandleServe (id) {
|
||||||
// const infoList = []
|
// const infoList = []
|
||||||
let showList = []
|
let showList = []
|
||||||
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
|
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
|
||||||
|
@ -280,7 +284,7 @@ export default {
|
||||||
}, 100)
|
}, 100)
|
||||||
},
|
},
|
||||||
// 修改
|
// 修改
|
||||||
UpdateHandle(val) {
|
UpdateHandle (val) {
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
const cloneVal = deepClone(val)
|
const cloneVal = deepClone(val)
|
||||||
|
@ -305,7 +309,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 关闭当前窗口
|
// 关闭当前窗口
|
||||||
closeCurrentTab(data) {
|
closeCurrentTab (data) {
|
||||||
var tabName = this.$store.state.contentTabsActiveName
|
var tabName = this.$store.state.contentTabsActiveName
|
||||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
|
||||||
if (this.$store.state.contentTabs.length <= 0) {
|
if (this.$store.state.contentTabs.length <= 0) {
|
||||||
|
@ -317,7 +321,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle(id) {
|
deleteHandle (id) {
|
||||||
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
|
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
|
||||||
return this.$message({
|
return this.$message({
|
||||||
message: this.$t('prompt.deleteBatch'),
|
message: this.$t('prompt.deleteBatch'),
|
||||||
|
@ -351,7 +355,7 @@ export default {
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteHandle2(id) {
|
deleteHandle2 (id) {
|
||||||
console.log('删除========================》', id, this.dataListSelections)
|
console.log('删除========================》', id, this.dataListSelections)
|
||||||
const ids = []
|
const ids = []
|
||||||
if (id) {
|
if (id) {
|
||||||
|
@ -369,7 +373,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 导出
|
// 导出
|
||||||
exportHandle() {
|
exportHandle () {
|
||||||
var params = qs.stringify({
|
var params = qs.stringify({
|
||||||
token: Cookies.get('ucsToken'),
|
token: Cookies.get('ucsToken'),
|
||||||
...this.dataForm
|
...this.dataForm
|
||||||
|
|
|
@ -66,6 +66,38 @@
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
></af-table-column>
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="description"
|
||||||
|
label="组件描述"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptName"
|
||||||
|
label="归属部门"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptContacts"
|
||||||
|
label="部门联系人"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptPhone"
|
||||||
|
label="部门联系人电话"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
<af-table-column
|
<af-table-column
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
width="280"
|
width="280"
|
||||||
|
@ -74,18 +106,18 @@
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
></af-table-column>
|
></af-table-column>
|
||||||
<template v-if="dataList[0] && dataList[0].infoList">
|
<template v-if="dataList[0] && dataList[0].infoList2">
|
||||||
<af-table-column
|
<af-table-column
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
width="300"
|
width="300"
|
||||||
v-for="(item, index) in dataList[0].infoList"
|
v-for="(item, index) in dataList[0].infoList2"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.attrType"
|
:label="item.attrType"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ findValue(scope.row.infoList, item.attrType) }}
|
{{ findValue(scope.row.infoList2, item.attrType) }}
|
||||||
</template>
|
</template>
|
||||||
</af-table-column>
|
</af-table-column>
|
||||||
</template>
|
</template>
|
||||||
|
@ -187,10 +219,14 @@
|
||||||
width="50%"
|
width="50%"
|
||||||
>
|
>
|
||||||
<putOnTheShelf
|
<putOnTheShelf
|
||||||
|
ref="putOnTheShelf"
|
||||||
:putOnTheShelfList="putOnTheShelfList"
|
:putOnTheShelfList="putOnTheShelfList"
|
||||||
@changeInfoList="changeInfoList"
|
@changeInfoList="changeInfoList"
|
||||||
:type="radio"
|
:type="radio"
|
||||||
:typeInput="typeInput"
|
:typeInput="typeInput"
|
||||||
|
:required="required"
|
||||||
|
:notFilled="notFilled"
|
||||||
|
@submitData="submitData"
|
||||||
></putOnTheShelf>
|
></putOnTheShelf>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="clear">取 消</el-button>
|
<el-button @click="clear">取 消</el-button>
|
||||||
|
@ -211,6 +247,8 @@ export default {
|
||||||
mixins: [mixinViewModule],
|
mixins: [mixinViewModule],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '算法名称', '算法描述', '图层名称', '图层描述', '组件名称', '组件描述', '组件地址', '服务地址', '服务接口', '接口请求方式', '算法类别'],
|
||||||
|
notFilled: [],
|
||||||
insertList: [],
|
insertList: [],
|
||||||
putOnTheShelfList: [],
|
putOnTheShelfList: [],
|
||||||
radio: '',
|
radio: '',
|
||||||
|
@ -300,19 +338,18 @@ export default {
|
||||||
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
|
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
? res.data.list
|
? res.data.list
|
||||||
: res.data
|
: res.data
|
||||||
// this.dataList.map((item, index) => {
|
this.dataList.map((item, index) => {
|
||||||
// const dataListSinforList = []
|
const dataListSinforList = []
|
||||||
// item.infoList.map((itemson, indexson) => {
|
item.infoList.map((itemson, indexson) => {
|
||||||
// if (
|
if (
|
||||||
// itemson.attrType === '部署位置' ||
|
itemson.attrType === '应用领域' ||
|
||||||
// itemson.attrType === '组件类型' ||
|
itemson.attrType === '组件类型'
|
||||||
// itemson.attrType === '应用领域'
|
) {
|
||||||
// ) {
|
dataListSinforList.push(itemson)
|
||||||
// dataListSinforList.push(itemson)
|
}
|
||||||
// }
|
})
|
||||||
// })
|
this.dataList[index].infoList2 = dataListSinforList
|
||||||
// this.dataList[index].infoList = dataListSinforList
|
})
|
||||||
// })
|
|
||||||
console.log('this.dataList', this.dataList)
|
console.log('this.dataList', this.dataList)
|
||||||
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
? res.data.total
|
? res.data.total
|
||||||
|
@ -387,19 +424,18 @@ export default {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data)
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false
|
||||||
// this.dataList.map((item, index) => {
|
this.dataList.map((item, index) => {
|
||||||
// const dataListSinforList = []
|
const dataListSinforList = []
|
||||||
// item.infoList.map((itemson, indexson) => {
|
item.infoList.map((itemson, indexson) => {
|
||||||
// if (
|
if (
|
||||||
// itemson.attrType === '部署位置' ||
|
itemson.attrType === '应用领域' ||
|
||||||
// itemson.attrType === '组件类型' ||
|
itemson.attrType === '组件类型'
|
||||||
// itemson.attrType === '应用领域'
|
) {
|
||||||
// ) {
|
dataListSinforList.push(itemson)
|
||||||
// dataListSinforList.push(itemson)
|
}
|
||||||
// }
|
})
|
||||||
// })
|
this.dataList[index].infoList2 = dataListSinforList
|
||||||
// this.dataList[index].infoList = dataListSinforList
|
})
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('未查询到相关信息')
|
this.$message.error('未查询到相关信息')
|
||||||
this.reset()
|
this.reset()
|
||||||
|
@ -448,6 +484,7 @@ export default {
|
||||||
// 新上架
|
// 新上架
|
||||||
clear () {
|
clear () {
|
||||||
console.log('清空----------------------------------------')
|
console.log('清空----------------------------------------')
|
||||||
|
this.notFilled = []
|
||||||
this.showPutOnTheShelfFlag = false
|
this.showPutOnTheShelfFlag = false
|
||||||
this.showPutOnTheShelfFlag2 = false
|
this.showPutOnTheShelfFlag2 = false
|
||||||
this.insertList = []
|
this.insertList = []
|
||||||
|
@ -490,8 +527,24 @@ export default {
|
||||||
)
|
)
|
||||||
this.submitFrom.infoList.push(obj)
|
this.submitFrom.infoList.push(obj)
|
||||||
},
|
},
|
||||||
|
changeAdd () {
|
||||||
|
const arr = []
|
||||||
|
switch (this.radio) {
|
||||||
|
case '智能算法':
|
||||||
|
arr.push('算法优势')
|
||||||
|
arr.push('计费标准信息')
|
||||||
|
break
|
||||||
|
case '开发组件':
|
||||||
|
case '业务组件':
|
||||||
|
arr.push('功能介绍')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
arr.push('应用场景')
|
||||||
|
arr.push('常见问题')
|
||||||
|
this.$refs.putOnTheShelf.submit(arr)
|
||||||
|
},
|
||||||
submitData () {
|
submitData () {
|
||||||
console.log('提交11111111111===============>', this.putOnTheShelfList)
|
console.log('提交11111111111===============>', this.putOnTheShelfList, this.submitFrom)
|
||||||
const arr = []
|
const arr = []
|
||||||
this.putOnTheShelfList.map((item) => {
|
this.putOnTheShelfList.map((item) => {
|
||||||
item.children.map((child) => {
|
item.children.map((child) => {
|
||||||
|
@ -527,7 +580,7 @@ export default {
|
||||||
(item) => item.attrType !== val.name
|
(item) => item.attrType !== val.name
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (val.note1) {
|
if (val.note1 == '' || val.note1) {
|
||||||
switch (val.name) {
|
switch (val.name) {
|
||||||
case '算法名称':
|
case '算法名称':
|
||||||
case '应用名称':
|
case '应用名称':
|
||||||
|
@ -603,51 +656,94 @@ export default {
|
||||||
this.submitFrom.infoList = this.submitFrom.infoList.sort(
|
this.submitFrom.infoList = this.submitFrom.infoList.sort(
|
||||||
(a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
|
(a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
|
||||||
)
|
)
|
||||||
if (this.submitFrom.id) {
|
this.notFilled = []
|
||||||
// 解决编辑无组件类型
|
if (!this.submitFrom.name) {
|
||||||
this.submitFrom.infoList.map((val) => {
|
this.notFilled.push('算法名称')
|
||||||
if (val.attrType === '组件类型') {
|
this.notFilled.push('图层名称')
|
||||||
val.attrValue = this.radio
|
this.notFilled.push('组件名称')
|
||||||
}
|
}
|
||||||
|
if (!this.submitFrom.description) {
|
||||||
|
this.notFilled.push('算法描述')
|
||||||
|
this.notFilled.push('图层描述')
|
||||||
|
this.notFilled.push('组件描述')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.shareCondition) {
|
||||||
|
this.notFilled.push('共享条件')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.deptContacts) {
|
||||||
|
this.notFilled.push('部门联系人')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.deptPhone) {
|
||||||
|
this.notFilled.push('部门联系人电话')
|
||||||
|
}
|
||||||
|
if (this.radio === '智能算法' && !this.submitFrom.apiUrl) {
|
||||||
|
this.notFilled.push('服务接口')
|
||||||
|
}
|
||||||
|
if (this.radio === '智能算法' && !this.submitFrom.apiMethodType) {
|
||||||
|
this.notFilled.push('接口请求方式')
|
||||||
|
}
|
||||||
|
if (this.radio === '智能算法' && (!this.submitFrom.infoList.filter(val => val.attrType === '算法类别')[0] || !this.submitFrom.infoList.filter(val => val.attrType === '算法类别')[0].attrValue)) {
|
||||||
|
this.notFilled.push('算法类别')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.infoList.filter(val => val.attrType === '应用领域')[0] || !this.submitFrom.infoList.filter(val => val.attrType === '应用领域')[0].attrValue) {
|
||||||
|
this.notFilled.push('应用领域')
|
||||||
|
}
|
||||||
|
if (this.radio === '图层服务' && (!this.submitFrom.infoList.filter(val => val.attrType === '服务地址')[0] || !this.submitFrom.infoList.filter(val => val.attrType === '服务地址')[0].attrValue)) {
|
||||||
|
this.notFilled.push('服务地址')
|
||||||
|
}
|
||||||
|
if ((this.radio === '业务组件' || this.radio === '开发组件') && (!this.submitFrom.infoList.filter(val => val.attrType === '组件地址')[0] || !this.submitFrom.infoList.filter(val => val.attrType === '组件地址')[0].attrValue)) {
|
||||||
|
this.notFilled.push('组件地址')
|
||||||
|
}
|
||||||
|
console.log(this.submitFrom, this.notFilled, '表单验证')
|
||||||
|
if (this.notFilled.length > 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '请填写必填字段!',
|
||||||
|
type: 'warning'
|
||||||
})
|
})
|
||||||
console.log('编辑===============>', this.submitFrom)
|
|
||||||
console.log(this.submitFrom.infoList, '===============abc')
|
|
||||||
// 去重
|
|
||||||
const newArr = this.submitFrom.infoList.filter(
|
|
||||||
(element, index, self) => {
|
|
||||||
return (
|
|
||||||
self.findIndex((x) => x.attrType === element.attrType) === index
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.submitFrom.infoList = newArr
|
|
||||||
console.log(
|
|
||||||
this.submitFrom.infoList,
|
|
||||||
'====================================wpwpwp'
|
|
||||||
)
|
|
||||||
this.$http
|
|
||||||
.put('/resource/update', this.submitFrom)
|
|
||||||
.then(({ data: res }) => {
|
|
||||||
if (res.code !== 0) {
|
|
||||||
this.$message.error('修改失败!')
|
|
||||||
} else {
|
|
||||||
this.$message.success('修改成功!')
|
|
||||||
this.clear()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
} else {
|
} else {
|
||||||
this.$http
|
if (this.submitFrom.id) {
|
||||||
.post('/resource/insert?source= b', this.submitFrom)
|
// 解决编辑无组件类型
|
||||||
.then(({ data: res }) => {
|
this.submitFrom.infoList.map((val) => {
|
||||||
if (res.code !== 0) {
|
if (val.attrType === '组件类型') {
|
||||||
this.$message.error('上架失败!')
|
val.attrValue = this.radio
|
||||||
} else {
|
|
||||||
this.$message.success('上架成功!')
|
|
||||||
this.clear()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
console.log('编辑===============>', this.submitFrom)
|
||||||
|
console.log(this.submitFrom.infoList, '===============abc')
|
||||||
|
// 去重
|
||||||
|
const newArr = this.submitFrom.infoList.filter(
|
||||||
|
(element, index, self) => {
|
||||||
|
return (
|
||||||
|
self.findIndex((x) => x.attrType === element.attrType) === index
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
this.submitFrom.infoList = newArr
|
||||||
|
this.$http
|
||||||
|
.put('/resource/update', this.submitFrom)
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
this.$message.error('修改失败!')
|
||||||
|
} else {
|
||||||
|
this.$message.success('修改成功!')
|
||||||
|
this.clear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
} else {
|
||||||
|
console.log('提交11111111111===============>', this.putOnTheShelfList, this.submitFrom)
|
||||||
|
this.$http
|
||||||
|
.post('/resource/insert?source= b', this.submitFrom)
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
this.$message.error('上架失败!')
|
||||||
|
} else {
|
||||||
|
this.$message.success('上架成功!')
|
||||||
|
this.clear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 新修改
|
// 新修改
|
||||||
|
|
|
@ -66,9 +66,49 @@
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<template v-if="dataList[0] && dataList[0].infoList">
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="description"
|
||||||
|
label="应用描述"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptName"
|
||||||
|
label="归属部门"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptContacts"
|
||||||
|
label="部门联系人"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="deptPhone"
|
||||||
|
label="部门联系人电话"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<af-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
width="280"
|
||||||
|
prop="shareCondition"
|
||||||
|
label="共享条件"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></af-table-column>
|
||||||
|
<template v-if="dataList[0] && dataList[0].infoList2">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="(item, index) in dataList[0].infoList"
|
v-for="(item, index) in dataList[0].infoList2"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.attrType"
|
:label="item.attrType"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
|
@ -76,7 +116,7 @@
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ findValue(scope.row.infoList, item.attrType) }}
|
{{ findValue(scope.row.infoList2, item.attrType) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
|
@ -169,7 +209,7 @@
|
||||||
:destroy-on-close='true'
|
:destroy-on-close='true'
|
||||||
:before-close='clear'
|
:before-close='clear'
|
||||||
width="50%">
|
width="50%">
|
||||||
<putOnTheShelf :putOnTheShelfList='putOnTheShelfList' @changeInfoList='changeInfoList' :type='radio' :typeInput='typeInput'></putOnTheShelf>
|
<putOnTheShelf :required="required" :notFilled="notFilled":putOnTheShelfList='putOnTheShelfList' @changeInfoList='changeInfoList' :type='radio' :typeInput='typeInput'></putOnTheShelf>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="clear">取 消</el-button>
|
<el-button @click="clear">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitData">确 定</el-button>
|
<el-button type="primary" @click="submitData">确 定</el-button>
|
||||||
|
@ -191,6 +231,8 @@ export default {
|
||||||
mixins: [mixinViewModule],
|
mixins: [mixinViewModule],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '应用名称', '应用描述', '应用状态', '应用类型'],
|
||||||
|
notFilled: [],
|
||||||
mixinViewModuleOptions: {
|
mixinViewModuleOptions: {
|
||||||
getDataListURL: '/resource/page',
|
getDataListURL: '/resource/page',
|
||||||
getDataListIsPage: true,
|
getDataListIsPage: true,
|
||||||
|
@ -282,6 +324,17 @@ export default {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data)
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false
|
||||||
|
this.dataList.map((item, index) => {
|
||||||
|
const dataListSinforList = []
|
||||||
|
item.infoList.map((itemson, indexson) => {
|
||||||
|
if (
|
||||||
|
itemson.attrType === '应用领域'
|
||||||
|
) {
|
||||||
|
dataListSinforList.push(itemson)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.dataList[index].infoList2 = dataListSinforList
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false
|
||||||
|
@ -347,6 +400,17 @@ export default {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data)
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false
|
||||||
|
this.dataList.map((item, index) => {
|
||||||
|
const dataListSinforList = []
|
||||||
|
item.infoList.map((itemson, indexson) => {
|
||||||
|
if (
|
||||||
|
itemson.attrType === '应用领域'
|
||||||
|
) {
|
||||||
|
dataListSinforList.push(itemson)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.dataList[index].infoList2 = dataListSinforList
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('未查询到相关信息')
|
this.$message.error('未查询到相关信息')
|
||||||
this.reset()
|
this.reset()
|
||||||
|
@ -485,6 +549,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 新上架
|
// 新上架
|
||||||
clear () {
|
clear () {
|
||||||
|
this.notFilled = []
|
||||||
this.showPutOnTheShelfFlag2 = false
|
this.showPutOnTheShelfFlag2 = false
|
||||||
this.insertList = []
|
this.insertList = []
|
||||||
this.putOnTheShelfList = []
|
this.putOnTheShelfList = []
|
||||||
|
@ -517,7 +582,6 @@ export default {
|
||||||
this.submitFrom.infoList.push(obj)
|
this.submitFrom.infoList.push(obj)
|
||||||
},
|
},
|
||||||
submitData () {
|
submitData () {
|
||||||
this.showPutOnTheShelfFlag2 = false
|
|
||||||
const arr = []
|
const arr = []
|
||||||
this.putOnTheShelfList.map(item => {
|
this.putOnTheShelfList.map(item => {
|
||||||
item.children.map(child => {
|
item.children.map(child => {
|
||||||
|
@ -537,7 +601,7 @@ export default {
|
||||||
if (val.type === 'input' || val.type === 'textArea' || val.type === 'select' || val.type === 'checkBox' || val.type === 'radio') {
|
if (val.type === 'input' || val.type === 'textArea' || val.type === 'select' || val.type === 'checkBox' || val.type === 'radio') {
|
||||||
this.submitFrom.infoList = this.submitFrom.infoList.filter((item) => item.attrType !== val.name)
|
this.submitFrom.infoList = this.submitFrom.infoList.filter((item) => item.attrType !== val.name)
|
||||||
}
|
}
|
||||||
if (val.note1) {
|
if (val.note1 || val.note1) {
|
||||||
switch (val.name) {
|
switch (val.name) {
|
||||||
case '算法名称':
|
case '算法名称':
|
||||||
case '应用名称':
|
case '应用名称':
|
||||||
|
@ -603,37 +667,74 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.submitFrom.infoList = this.submitFrom.infoList.sort((a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType))
|
this.submitFrom.infoList = this.submitFrom.infoList.sort((a, b) => arr.indexOf(a.attrType) - arr.indexOf(b.attrType))
|
||||||
if (this.submitFrom.id) {
|
this.notFilled = []
|
||||||
// 解决编辑无组件类型
|
console.log(this.submitFrom, '表单验证')
|
||||||
this.submitFrom.infoList.map(val => {
|
if (!this.submitFrom.name) {
|
||||||
if (val.attrType === '组件类型') {
|
this.notFilled.push('应用名称')
|
||||||
val.attrValue = this.radio
|
}
|
||||||
}
|
if (!this.submitFrom.description) {
|
||||||
|
this.notFilled.push('应用描述')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.shareCondition) {
|
||||||
|
this.notFilled.push('共享条件')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.deptContacts) {
|
||||||
|
this.notFilled.push('部门联系人')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.deptPhone) {
|
||||||
|
this.notFilled.push('部门联系人电话')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.infoList.filter(val => val.attrType == '应用领域')[0] || !this.submitFrom.infoList.filter(val => val.attrType == '应用领域')[0].attrValue) {
|
||||||
|
this.notFilled.push('应用领域')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.infoList.filter(val => val.attrType == '应用状态')[0] || !this.submitFrom.infoList.filter(val => val.attrType == '应用状态')[0].attrValue) {
|
||||||
|
this.notFilled.push('应用状态')
|
||||||
|
}
|
||||||
|
if (!this.submitFrom.infoList.filter(val => val.attrType == '应用类型')[0] || !this.submitFrom.infoList.filter(val => val.attrType == '应用类型')[0].attrValue) {
|
||||||
|
this.notFilled.push('应用类型')
|
||||||
|
}
|
||||||
|
if (this.notFilled.length > 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '请填写必填字段!',
|
||||||
|
type: 'warning'
|
||||||
})
|
})
|
||||||
console.log('编辑===============>', this.submitFrom)
|
|
||||||
this.$http
|
|
||||||
.put('/resource/update', this.submitFrom)
|
|
||||||
.then(({ data: res }) => {
|
|
||||||
if (res.code !== 0) {
|
|
||||||
this.$message.error('修改失败!')
|
|
||||||
} else {
|
|
||||||
this.$message.success('修改成功!')
|
|
||||||
this.clear()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
} else {
|
} else {
|
||||||
this.$http
|
if (this.submitFrom.id) {
|
||||||
.post('/resource/insert?source= b', this.submitFrom)
|
// 解决编辑无组件类型
|
||||||
.then(({ data: res }) => {
|
this.submitFrom.infoList.map(val => {
|
||||||
if (res.code !== 0) {
|
if (val.attrType === '组件类型') {
|
||||||
this.$message.error('上架失败!')
|
val.attrValue = this.radio
|
||||||
} else {
|
|
||||||
this.$message.success('上架成功!')
|
|
||||||
this.clear()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
console.log('编辑===============>', this.submitFrom)
|
||||||
|
this.$http
|
||||||
|
.put('/resource/update', this.submitFrom)
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
this.$message.error('修改失败!')
|
||||||
|
this.showPutOnTheShelfFlag2 = false
|
||||||
|
} else {
|
||||||
|
this.$message.success('修改成功!')
|
||||||
|
this.showPutOnTheShelfFlag2 = false
|
||||||
|
this.clear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
} else {
|
||||||
|
this.$http
|
||||||
|
.post('/resource/insert?source= b', this.submitFrom)
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
this.$message.error('上架失败!')
|
||||||
|
this.showPutOnTheShelfFlag2 = false
|
||||||
|
} else {
|
||||||
|
this.$message.success('上架成功!')
|
||||||
|
this.showPutOnTheShelfFlag2 = false
|
||||||
|
this.clear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 新修改
|
// 新修改
|
||||||
|
|
|
@ -16,12 +16,13 @@ js:
|
||||||
<template>
|
<template>
|
||||||
<div id="inputSelectCheckbox">
|
<div id="inputSelectCheckbox">
|
||||||
<!-- input框 -->
|
<!-- input框 -->
|
||||||
<a-input v-if="type == 'input'" v-model:value="data.note1" :placeholder="'请输入' + name" />
|
<a-input v-if="type == 'input'" v-model:value="data.note1" :placeholder="'请输入' + name" @change="changeIiem(name,data.note1)"/>
|
||||||
<!-- 下拉框 -->
|
<!-- 下拉框 -->
|
||||||
<el-select
|
<el-select
|
||||||
v-else-if="(type === 'select' && name !== '归属部门' && name !== '使用方式') || type == 'radio'"
|
v-else-if="(type === 'select' && name !== '归属部门' && name !== '使用方式') || type == 'radio'"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
v-model:value="data.note1"
|
v-model:value="data.note1"
|
||||||
|
@change="changeIiem(name,data.note1)"
|
||||||
:placeholder="'请选择' + name">
|
:placeholder="'请选择' + name">
|
||||||
<el-option
|
<el-option
|
||||||
:value="itemSelect.dictLabel"
|
:value="itemSelect.dictLabel"
|
||||||
|
@ -36,6 +37,7 @@ js:
|
||||||
v-model:value="data.note1"
|
v-model:value="data.note1"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请输入关键词"
|
placeholder="请输入关键词"
|
||||||
|
@change="changeIiem(name,data.note1)"
|
||||||
:loading="loading">
|
:loading="loading">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(itemSelect) in options"
|
v-for="(itemSelect) in options"
|
||||||
|
@ -73,12 +75,13 @@ js:
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:placeholder="'请输入' + name"
|
:placeholder="'请输入' + name"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
|
@change="changeIiem(name,data.note1)"
|
||||||
/>
|
/>
|
||||||
<!-- 单选 -->
|
<!-- 单选 -->
|
||||||
<!-- <el-radio-group v-model:value="data.note1" v-else-if="type == 'radio'">
|
<!-- <el-radio-group v-model:value="data.note1" v-else-if="type == 'radio'">
|
||||||
<el-radio v-for="item in options" :label="item.dictLabel" :key="item.dictLabel">{{item.dictLabel}}</el-radio>
|
<el-radio v-for="item in options" :label="item.dictLabel" :key="item.dictLabel">{{item.dictLabel}}</el-radio>
|
||||||
</el-radio-group> -->
|
</el-radio-group> -->
|
||||||
<a-textarea v-else-if="type == 'textArea'" v-model:value="data.note1" :showCount="true" :maxlength="200" :placeholder="'请填写' + name" />
|
<a-textarea v-else-if="type == 'textArea'" @change="changeIiem(name,data.note1)" v-model:value="data.note1" :showCount="true" :maxlength="200" :placeholder="'请填写' + name" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -92,6 +95,7 @@ export default {
|
||||||
data: Array,
|
data: Array,
|
||||||
name: String,
|
name: String,
|
||||||
value: String,
|
value: String,
|
||||||
|
changeField: Array,
|
||||||
options: {
|
options: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null
|
default: null
|
||||||
|
@ -108,6 +112,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeIiem (name, value) {
|
||||||
|
if (value && value !== '' && this.changeField.indexOf(name) == -1) {
|
||||||
|
this.changeField.push(name)
|
||||||
|
} else if (!value || value == '') {
|
||||||
|
if (this.changeField.indexOf(name) > -1) {
|
||||||
|
this.changeField.splice(this.changeField.indexOf(name), 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
selectOptions () {
|
selectOptions () {
|
||||||
if (this.data.isLinkToDic === 'true' && this.data.linkValue) {
|
if (this.data.isLinkToDic === 'true' && this.data.linkValue) {
|
||||||
this.$http
|
this.$http
|
||||||
|
@ -140,7 +153,7 @@ export default {
|
||||||
// dataList.push(element)
|
// dataList.push(element)
|
||||||
// })
|
// })
|
||||||
// this.options = dataList
|
// this.options = dataList
|
||||||
if (!this.data.note1) {
|
if (this.data.note1 == null) {
|
||||||
this.$http.get('/sys/user/info').then(({ data: res }) => {
|
this.$http.get('/sys/user/info').then(({ data: res }) => {
|
||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
this.data.note1 = res.data.realName || ''
|
this.data.note1 = res.data.realName || ''
|
||||||
|
@ -154,7 +167,7 @@ export default {
|
||||||
// dataList.push(element)
|
// dataList.push(element)
|
||||||
// })
|
// })
|
||||||
// this.options = dataList
|
// this.options = dataList
|
||||||
if (!this.data.note1) {
|
if (this.data.note1 == null) {
|
||||||
this.$http.get('/sys/user/info').then(({ data: res }) => {
|
this.$http.get('/sys/user/info').then(({ data: res }) => {
|
||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
this.data.note1 = res.data.mobile || ''
|
this.data.note1 = res.data.mobile || ''
|
||||||
|
@ -172,6 +185,13 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.data.note1 = str
|
this.data.note1 = str
|
||||||
|
if (str !== '' && this.changeField.indexOf('应用领域') == -1) {
|
||||||
|
this.changeField.push('应用领域')
|
||||||
|
} else if (str == '') {
|
||||||
|
if (this.changeField.indexOf('应用领域') > -1) {
|
||||||
|
this.changeField.splice(this.changeField.indexOf('应用领域'), 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
showTypeClick (e) {
|
showTypeClick (e) {
|
||||||
this.showType = e
|
this.showType = e
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: hisense.liangjunhua
|
* @Author: hisense.liangjunhua
|
||||||
* @Date: 2022-07-08 09:54:50
|
* @Date: 2022-07-08 09:54:50
|
||||||
* @LastEditors: hisense.liangjunhua
|
* @LastEditors: hisense.liangjunhua
|
||||||
* @LastEditTime: 2022-07-11 16:18:00
|
* @LastEditTime: 2022-07-25 11:20:25
|
||||||
* @Description: 多条数据特殊处理
|
* @Description: 多条数据特殊处理
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="add">添加更多{{ configure.name }}</div>
|
<!-- <div class="add">添加更多{{ configure.name }}</div> -->
|
||||||
<div class="form" v-for="(val, index) in configure.list" :key="'key3' + val.name + index">
|
<div class="form" v-for="(val, index) in configure.list" :key="'key3' + val.name + index">
|
||||||
<span>{{ val.name }}</span>
|
<span>{{ val.name }}</span>
|
||||||
<a-input v-model:value="val.note1" ::maxlength="24" :placeholder="'请填写' + val.name + ',不超过24个字符'"
|
<a-input v-model:value="val.note1" ::maxlength="24" :placeholder="'请填写' + val.name + ',不超过24个字符'"
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="val.note1"
|
v-model:value="val.note1"
|
||||||
:placeholder="'请填写' + val.name"
|
:placeholder="'请填写' + val.name"
|
||||||
style="width: calc(100% - 150px);"
|
style="width: 570px;"
|
||||||
/>
|
/>
|
||||||
<span style="width: 2.5rem; padding-left: 0.1rem">
|
<span style="width: 2.5rem; padding-left: 0.1rem">
|
||||||
{{
|
{{
|
||||||
|
@ -93,7 +93,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add (title) {
|
add (title, addFlag, submitFlag) {
|
||||||
|
console.log(title, addFlag, submitFlag)
|
||||||
const list = this.configure.list
|
const list = this.configure.list
|
||||||
let flag = true
|
let flag = true
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
|
@ -142,10 +143,23 @@ export default {
|
||||||
})
|
})
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
item.note1 = ''
|
item.note1 = ''
|
||||||
|
this.showKey++
|
||||||
})
|
})
|
||||||
this.showKey++
|
if (addFlag && submitFlag) {
|
||||||
|
this.$emit('submitData')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请填写完整')
|
if (!addFlag) {
|
||||||
|
this.$message.warning('请填写完整')
|
||||||
|
} else {
|
||||||
|
list.forEach((item) => {
|
||||||
|
item.note1 = ''
|
||||||
|
this.showKey++
|
||||||
|
})
|
||||||
|
if (submitFlag) {
|
||||||
|
this.$emit('submitData')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
del (title, index) {
|
del (title, index) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: hisense.liangjunhua
|
* @Author: hisense.liangjunhua
|
||||||
* @Date: 2022-07-08 09:48:52
|
* @Date: 2022-07-08 09:48:52
|
||||||
* @LastEditors: hisense.liangjunhua
|
* @LastEditors: hisense.liangjunhua
|
||||||
* @LastEditTime: 2022-07-11 15:11:10
|
* @LastEditTime: 2022-07-25 15:57:25
|
||||||
* @Description: 告诉大家这是什么
|
* @Description: 告诉大家这是什么
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
|
@ -21,7 +21,11 @@
|
||||||
(showTypeName == 'SDK' && item.name == '接口请求方式') ||
|
(showTypeName == 'SDK' && item.name == '接口请求方式') ||
|
||||||
(showTypeName == 'SDK' && item.name == '服务接口')
|
(showTypeName == 'SDK' && item.name == '服务接口')
|
||||||
)">
|
)">
|
||||||
<span >{{ item.name }}</span>
|
<div class="box">
|
||||||
|
<div>
|
||||||
|
<span class="required" v-if="required.indexOf(item.name) > -1">*</span>
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
<!-- <upload :list="[]" v-if="item.type == 'image'" type="图片" btnName="上传图片" :maxCount="1" :data="item"
|
<!-- <upload :list="[]" v-if="item.type == 'image'" type="图片" btnName="上传图片" :maxCount="1" :data="item"
|
||||||
tip="支持图片类型,大小不超过100M"></upload> -->
|
tip="支持图片类型,大小不超过100M"></upload> -->
|
||||||
<upload @changeInfoList='changeInfoList' :title='item.name' accept='.jpg,.jpeg,.png' :list="item" v-if="item.type == 'image'" type="图片" btnName="上传图片" :maxCount="1"
|
<upload @changeInfoList='changeInfoList' :title='item.name' accept='.jpg,.jpeg,.png' :list="item" v-if="item.type == 'image'" type="图片" btnName="上传图片" :maxCount="1"
|
||||||
|
@ -34,17 +38,20 @@
|
||||||
tip="支持视频类型,大小不超过100M"></upload>
|
tip="支持视频类型,大小不超过100M"></upload>
|
||||||
<upload @changeInfoList='changeInfoList' :title='item.name' accept='.zip' :list="item" v-else-if="item.type == 'package'" type="安装包" btnName="上传安装包" :maxCount="1" :dataList="item"
|
<upload @changeInfoList='changeInfoList' :title='item.name' accept='.zip' :list="item" v-else-if="item.type == 'package'" type="安装包" btnName="上传安装包" :maxCount="1" :dataList="item"
|
||||||
tip="支持.zip类型,大小不超过100M"></upload>
|
tip="支持.zip类型,大小不超过100M"></upload>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'AbilityType'" type="disabled" :data="item" :name="item.name" :value="typeInput"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'AbilityType'" type="disabled" :data="item" :name="item.name" :value="typeInput"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'ComponentType'" type="disabled" :data="item" :name="item.name" :value="type"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'ComponentType'" type="disabled" :data="item" :name="item.name" :value="type"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'input'" type="input" :data="item" :name="item.name"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'input'" type="input" :data="item" :name="item.name"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'select'" type="select" :data="item" :name="item.name" :options="item.options" @show-type="showType"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'select'" type="select" :data="item" :name="item.name" :options="item.options" @show-type="showType"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'checkBox'" type="checkBox" :data="item" :name="item.name" :options="item.options"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'checkBox'" type="checkBox" :data="item" :name="item.name" :options="item.options"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'radio'" type="radio" :data="item" :name="item.name" :options="item.options"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'radio'" type="radio" :data="item" :name="item.name" :options="item.options"></input-select-checkbox>
|
||||||
<input-select-checkbox :list="[]" v-else-if="item.type == 'textArea'" type="textArea" :data="item" :name="item.name"></input-select-checkbox>
|
<input-select-checkbox :changeField='changeField' :list="[]" v-else-if="item.type == 'textArea'" type="textArea" :data="item" :name="item.name"></input-select-checkbox>
|
||||||
|
</div>
|
||||||
|
<div class="requiredTips" v-show="notFilled.indexOf(item.name) > -1 && (item.type=='input' || item.type=='textArea') && changeField.indexOf(item.name) == -1">请填写{{item.name}}!</div>
|
||||||
|
<div class="requiredTips" v-show="notFilled.indexOf(item.name) > -1 && (item.type=='select' || item.type=='checkBox' || item.type=='radio') && changeField.indexOf(item.name) == -1">请选择{{item.name}}!</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<special :configure='judgmentType.filter(item => item.name==child.name)[0]' :showData='child' @changeInfoList='changeInfoList'></special>
|
<special @submitData="submitData" ref="specialRef" :configure='judgmentType.filter(item => item.name==child.name)[0]' :showData='child' @changeInfoList='changeInfoList'></special>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,10 +71,13 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
type: String,
|
type: String,
|
||||||
putOnTheShelfList: Array,
|
putOnTheShelfList: Array,
|
||||||
typeInput: String
|
typeInput: String,
|
||||||
|
required: Array,
|
||||||
|
notFilled: Array
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
changeField: [],
|
||||||
judgmentType: [
|
judgmentType: [
|
||||||
{
|
{
|
||||||
name: '算法优势',
|
name: '算法优势',
|
||||||
|
@ -182,6 +192,21 @@ export default {
|
||||||
this.defaultContent()
|
this.defaultContent()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 提交
|
||||||
|
submit (arr) {
|
||||||
|
console.log('提交', arr.length, this.$refs.specialRef)
|
||||||
|
arr.map((val, index) => {
|
||||||
|
if (index === arr.length - 1) {
|
||||||
|
this.$refs.specialRef[index].add(val, true, true)
|
||||||
|
} else {
|
||||||
|
this.$refs.specialRef[index].add(val, true, false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitData () {
|
||||||
|
// console.log('触发提交')
|
||||||
|
this.$emit('submitData')
|
||||||
|
},
|
||||||
changeInfoList (obj) {
|
changeInfoList (obj) {
|
||||||
this.$emit('changeInfoList', obj)
|
this.$emit('changeInfoList', obj)
|
||||||
},
|
},
|
||||||
|
@ -241,11 +266,27 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
position: relative;
|
||||||
align-items: center;
|
.box{
|
||||||
margin: 25px 0;
|
display: flex;
|
||||||
& > span:nth-of-type(1) {
|
align-items: center;
|
||||||
width: 105px;
|
margin: 25px 0;
|
||||||
|
& > div:nth-of-type(1) {
|
||||||
|
width: 105px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.required{
|
||||||
|
color: #f56c6c;
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.requiredTips{
|
||||||
|
font-size: 14px;
|
||||||
|
color: #f56c6c;
|
||||||
|
position: absolute;
|
||||||
|
bottom:-20px;
|
||||||
|
left:110px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue