|
|
@ -1,8 +1,83 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
插单 |
|
|
|
1、OPC、开放协议两个页面不要,工艺添加配置opc通信规则和开放协议弹窗,要对应操作类型才要添加相应数据 |
|
|
|
2、工艺属性值和属性编码中文映射 |
|
|
|
3、零件关联关系 |
|
|
|
<div class="operation-type-wrap"> |
|
|
|
<el-table :data="tableData" border align="left"> |
|
|
|
<el-table-column prop="id" :label="getColumnName('id')" /> |
|
|
|
<el-table-column prop="date" :label="getColumnName('date')" /> |
|
|
|
<el-table-column prop="name" :label="getColumnName('name')" /> |
|
|
|
<el-table-column prop="address" :label="getColumnName('address')" /> |
|
|
|
<el-table-column label="操作" width="80" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" @click="setItem(scope.row)">拆单</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import Sortable from 'sortablejs' |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
tableData: [ |
|
|
|
{ |
|
|
|
id: '1', |
|
|
|
date: '2016-05-01', |
|
|
|
name: '王小虎1', |
|
|
|
address: '上海市普陀区金沙江路 101 弄' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '2', |
|
|
|
date: '2016-05-02', |
|
|
|
name: '王小虎2', |
|
|
|
address: '上海市普陀区金沙江路 102 弄' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '3', |
|
|
|
date: '2016-05-03', |
|
|
|
name: '王小虎3', |
|
|
|
address: '上海市普陀区金沙江路 103 弄' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '4', |
|
|
|
date: '2016-05-04', |
|
|
|
name: '王小虎4', |
|
|
|
address: '上海市普陀区金沙江路 104 弄' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.rowDrop() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 更新当前要操作的对象 |
|
|
|
setItem(item){ |
|
|
|
console.log(item); |
|
|
|
}, |
|
|
|
// 行拖拽 |
|
|
|
rowDrop () { |
|
|
|
const tbody = document.querySelector('.el-table__body-wrapper tbody') |
|
|
|
const _this = this |
|
|
|
Sortable.create(tbody, { |
|
|
|
onStart({ newIndex, oldIndex }){ |
|
|
|
console.log(newIndex, oldIndex); |
|
|
|
}, |
|
|
|
onEnd ({ newIndex, oldIndex }) { |
|
|
|
console.log(newIndex, oldIndex); |
|
|
|
// const currRow = _this.tableData.splice(oldIndex, 1)[0]; |
|
|
|
// _this.tableData.splice(newIndex, 0, currRow) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.operation-type-wrap { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
box-sizing: border-box; |
|
|
|
padding: 10px; |
|
|
|
padding-top: 36px; |
|
|
|
} |
|
|
|
</style> |