pic
This commit is contained in:
@@ -11,9 +11,31 @@
|
||||
height="800"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="照片" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
v-if="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
|
||||
placement="top-start"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<el-button type="text" style="float:right" @click="deletePhoto(scope.row)">删除</el-button>
|
||||
<el-image :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"/>
|
||||
</div>
|
||||
</el-image>
|
||||
<el-image slot="reference" :src="scope.row.文件标识 && scope.row.文件标识 !== 'null' ? (readFile + scope.row.文件标识 + '.' + scope.row.文件后缀) : readFile + '123.jpg'" style="width:30px;">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"/>
|
||||
</div>
|
||||
</el-image>
|
||||
</el-popover>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text">{{ scope.row.工位号 }}</el-button>
|
||||
<el-button type="text" @click="openNew(scope.row.工位号)">{{ scope.row.工位号 }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="登陆人">
|
||||
@@ -31,6 +53,7 @@
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-picture"
|
||||
@@ -93,9 +116,13 @@
|
||||
<script>
|
||||
import { ANDON_countselect } from '@/api/ManufacturingCenter/AntonMonitoring'
|
||||
import { wsuri, name1, uploadOP } from '@/utils/request'
|
||||
import { readFile } from '@/utils/request'
|
||||
import request from '@/utils/request'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
readFile: readFile,
|
||||
limit: 9999,
|
||||
tableData: [],
|
||||
timer_ANDON: '',
|
||||
andonMsg: '',
|
||||
@@ -117,6 +144,37 @@ export default {
|
||||
this.initWebpack()
|
||||
},
|
||||
methods: {
|
||||
deletePhoto(row) {
|
||||
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '4',
|
||||
name: `delete from 设备管理_设备监控_图片 where 工位 = '${row.工位号}'`
|
||||
}
|
||||
}).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.ANDON_countselect()
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
openNew(val) {
|
||||
window.open(`http://192.168.1.231:8008/#/EquipmentConditionAnalysis?opname=${val}`, '_blank')
|
||||
},
|
||||
ANDON_countselect() {
|
||||
ANDON_countselect().then(response => {
|
||||
this.tableData = response.data
|
||||
@@ -156,6 +214,7 @@ export default {
|
||||
if (res[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogFormVisible = false
|
||||
this.ANDON_countselect()
|
||||
this.$refs.upload.clearFiles()
|
||||
} else {
|
||||
this.$message.error('增加失败')
|
||||
|
||||
Reference in New Issue
Block a user