fzq #31

Closed
fanzhiqin wants to merge 215 commits from fzq into test
Showing only changes of commit 37df2abcc5 - Show all commits

View File

@ -32,46 +32,42 @@
import AddOrUpdate from '@/components/base-dialog/addOrUpdate' import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
import BaseTable from '@/components/base-table' import BaseTable from '@/components/base-table'
import TableOperateComponent from '@/components/base-table/components/operationComponent' import TableOperateComponent from '@/components/base-table/components/operationComponent'
import axios from '@/utils/request'
const CategoryList = { const CategoryList = {
name: 'CategoryList', name: 'CategoryList',
props: { props: {
options: { injectData: {
type: Array, type: Object,
default: () => [] required: true,
default: () => ({})
} }
}, },
data() {
return {
pickedId: null
}
},
mounted() {
this.pickedId = this.injectData[this.injectData.head.prop]
console.log('picked id : ', this.pickedId)
},
methods: { methods: {
handleChange(id) { handleChange(id) {
this.pickedId = id
this.$emit('emit-data', { id }) this.$emit('emit-data', { id })
} }
}, },
render: function(h) { render: function(h) {
const childOptions = [] const childOptions = []
this.options.forEach(item => { this.injectData.head.options?.forEach(item => {
childOptions.push(h('el-option', { props: { label: item.label, value: item.value } }, null)) console.log('item', item)
childOptions.push(h('el-option', { props: { label: item.label, value: item.value } }, null)) // TODO<===
}) })
return h('el-select', { on: { change: this.handleChange } }, childOptions) return h('el-select', { on: { change: this.handleChange } }, childOptions)
} }
} }
const tableConfigs = [
{ type: 'index', name: '序号' },
{ prop: 'lineName', name: '产线' },
{ prop: 'sectionName', name: '工段' },
{ prop: 'equName', name: '设备' },
{ prop: 'equCode', name: '设备编码' },
{ prop: 'plcCode', name: 'PLC编码' },
{ prop: 'plcName', name: 'PLC名称' },
{ prop: 'plcIp', name: 'PLC IP' },
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
const UnitDictTypeId = '1557173812109242370'
const getUnitList = function() {
const dl = JSON.parse(localStorage.getItem('dictList'))[UnitDictTypeId] || []
return dl.map(item => ({ label: item.dictLabel, value: item.dictValue }))
}
const addOrUpdateConfigs = { const addOrUpdateConfigs = {
type: 'dialog', type: 'dialog',
infoUrl: '/monitoring/equipmentPlcConnect', infoUrl: '/monitoring/equipmentPlcConnect',
@ -135,7 +131,7 @@ export default {
data() { data() {
return { return {
addOrUpdateConfigs, addOrUpdateConfigs,
tableConfigs, tableConfigs: [],
dataForm: { dataForm: {
key: '' key: ''
}, },
@ -153,9 +149,27 @@ export default {
BaseTable BaseTable
}, },
activated() { activated() {
this.getAllCategories()
this.getDataList() this.getDataList()
}, },
computed: {
trueTableConfigs() {}
},
methods: { methods: {
getAllCategories() {
axios.get(axios.adornUrl('/monitoring/reportSheetCategory/page')).then(({ data: res }) => {
if (res.data && res.data.list) {
const categories = res.data.list.map(item => ({ label: item.name, value: item.id }))
console.log('categories', categories)
this.tableConfigs = [
{ type: 'index', name: '序号' },
{ prop: 'fileName', name: '报表名称' },
{ prop: 'category', name: '报表分类', subcomponent: CategoryList, options: categories },
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
}
})
},
handleOperations({ type, data: id }) { handleOperations({ type, data: id }) {
switch (type) { switch (type) {
case 'edit': case 'edit':