yangys
2024-01-14 d91893dbd49538d312e299c1cc507a7792abd7d7
src/container/deviceType/index.vue
@@ -39,7 +39,12 @@
                    label="名称"
                    width="180">
                </el-table-column>
                 <el-table-column align="center" label="操作" prop="editor">
                    <template slot-scope="scope">
                        <el-button size="mini" type="text" @click="editDeviceType(scope.row)">编辑</el-button>
                        <el-button size="mini" type="text" @click="deleteHandle(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </template>
         
        </List>
@@ -50,7 +55,7 @@
<script>
    import List from '../list/index.vue'
   import ManageAddUpdate from './Manage-add-update'
    import { getUrl } from '@/api/Api'
    import { getUrl,deviceTypeDelete } from '@/api/Api'
    export default {
        components: {
            List,
@@ -80,9 +85,13 @@
                this.$refs.list.pageQuery(this.queryInfo)
            },
         add() {
            this.row = {}
            this.row = {id:''}
            this.addOrUpdateVisible = true
            console.log(this.addOrUpdateVisible);
         },
         editDeviceType(row){
            this.row = row;
            this.addOrUpdateVisible = true;
         },
         close() {
            this.addOrUpdateVisible = false
@@ -94,6 +103,32 @@
         addOrUpdateHandle(row) {
            this.row = row
            this.addOrUpdateVisible = true
         },
         deleteHandle(row) {
            let ids = []
               ids.push(row.id)
              ids = ids.join(',')
              this.$confirm('确定要永久删除此项?', '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'
              }).then(() => {
               deviceTypeDelete(ids).then(res => {
                 // if(res.result == ""){}
                 this.$message({
                  type: 'success',
                  message: '删除成功!'
                 })
                 this.submitForm()
               })
              }).catch(() => {
               this.$message({
                 type: 'info',
                 message: '已取消删除'
               })
              })
         }
            
        },