forked from mt-fe-group/mt-yd-ui
update 产品属性表
This commit is contained in:
parent
db5b5091e1
commit
3f2e8e8b9e
@ -7,7 +7,6 @@
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:productarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
@ -63,25 +62,14 @@ const tableConfigs = [
|
||||
{ prop: 'createTime', name: '添加时间' },
|
||||
{ prop: 'name', name: '属性名称' },
|
||||
{ prop: 'code', name: '属性编码' },
|
||||
{ prop: 'productId', name: '产品id,关联产品表' },
|
||||
{ prop: 'productId', name: '产品id' },
|
||||
{ prop: 'value', name: '属性值' },
|
||||
{ prop: 'description', name: '描述' },
|
||||
// { prop: 'id', name: 'ID' },
|
||||
// { prop: 'externalCode', name: '外部编码,用于对照外部系统的编码' },
|
||||
// { prop: 'enabled', name: '启用状态:0 、停用,1、启用' },
|
||||
// { prop: 'remark', name: '备注' },
|
||||
// { prop: 'valid', name: '删除标志,是否有效:1 可用 0不可用' },
|
||||
// { prop: 'creatorId', name: '创建人' },
|
||||
// { prop: 'creatorName', name: '创建人姓名' },
|
||||
// { prop: 'updaterId', name: '更新人' },
|
||||
// { prop: 'updaterName', name: '更新人姓名' },
|
||||
// { prop: 'updateTime', name: '更新时间' },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {
|
||||
type: 'dialog',
|
||||
type: 'dialog',
|
||||
infoUrl: '/monitoring/productArrt',
|
||||
fields: [
|
||||
{
|
||||
@ -112,9 +100,9 @@ const addOrUpdateConfigs = {
|
||||
}
|
||||
],
|
||||
operations: [
|
||||
{name: 'cancel', showAlways: true},
|
||||
{name: 'save', url: '/monitoring/productArrt', permission: '', showOnEdit: false},
|
||||
{name: 'update', url: '/monitoring/productArrt', permission: '', showOnEdit: true},
|
||||
{ name: 'cancel', showAlways: true },
|
||||
{ name: 'save', url: '/monitoring/productArrt', permission: '', showOnEdit: false },
|
||||
{ name: 'update', url: '/monitoring/productArrt', permission: '', showOnEdit: true }
|
||||
]
|
||||
}
|
||||
|
||||
@ -140,9 +128,32 @@ export default {
|
||||
BaseTable
|
||||
},
|
||||
activated() {
|
||||
this.getProductList()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取产品列表
|
||||
getProductList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/product/page'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
limit: 999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.addOrUpdateConfigs.fields.forEach(item => {
|
||||
if (item.name === 'productId') item.options = res.data.list.map(item => ({ label: item.name, value: item.id }))
|
||||
})
|
||||
} else {
|
||||
this.addOrUpdateConfigs.fields.forEach(item => {
|
||||
if (item.name === 'productId') item.options.splice(0)
|
||||
})
|
||||
// this.plList.splice(0)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true
|
||||
@ -180,7 +191,7 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({type, data : id }) {
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
|
Loading…
Reference in New Issue
Block a user