zhuzhuanzhuan
2023-10-17 bed4e60f46a75823d7314311e3d5fafe71c1a2fa
src/views/system/WorkshopSignageManagement.vue
@@ -12,7 +12,7 @@
                  <a-input placeholder="" v-model="queryParam.workshopName"></a-input>
                </a-form-item>
              </a-col>
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
            <a-col :md="12" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
@@ -26,9 +26,11 @@
          <a-button @click="handleAdd" type="primary" icon="plus">新建车间</a-button>
        </div>
        <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
          <i class="anticon anticon-info-circle ant-alert-icon">
          </i> 已选择 <a><b>{{ selectedRowKeys1.length }}</b></a>项
        <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
          <i class="anticon anticon-info-circle ant-alert-icon"> </i> 已选择
          <a
            ><b>{{ selectedRowKeys1.length }}</b></a
          >项
          <a style="margin-left: 24px" @click="onClearSelected1">清空</a>
        </div>
@@ -44,17 +46,16 @@
            :pagination="ipagination"
            :loading="loading"
            :rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
            @change="handleTableChange">
            @change="handleTableChange"
          >
            <template slot="backgroundImage" slot-scope="text,record">
              <img :src="getImgView(record.backgroundImage)" width="50" height="50">
              <img :src="getImgView(record.backgroundImage)" width="50" height="50" />
            </template>
            <span slot="action" slot-scope="text, record">
            <a @click="handleOpen(record)">车间</a>
              <a @click="handleOpen(record)">设备</a>
            <a-divider type="vertical"/>
            <a-dropdown>
              <a class="ant-dropdown-link">
                更多 <a-icon type="down"/>
              </a>
                <a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
              <a-menu slot="overlay">
                <a-menu-item>
                  <a @click="handleEdit(record)">编辑</a>
@@ -73,24 +74,22 @@
    </a-col>
    <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1">
      <a-card :bordered="false">
        <div style="text-align: right;">
        <div style="text-align: right">
          <a-icon type="close-circle" @click="hideUserList"/>
        </div>
        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
          <a-form layout="inline">
            <a-row :gutter="24">
              <a-col :md="12" :sm="12">
                <a-form-item label="设备编码">
                  <a-input placeholder="" v-model="queryParam2.equipmentId"></a-input>
                </a-form-item>
              </a-col>
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
            <a-col :md="9" :sm="24">
             <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
              <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
            </a-col>
          </span>
            </a-row>
@@ -98,7 +97,8 @@
        </div>
        <!-- 操作按钮区域 -->
        <div class="table-operator" :md="24" :sm="24">
          <a-button @click="handleAddDeviceInWorkshop" type="primary" icon="plus" style="margin-top: 16px">已有设备
          <a-button @click="handleAddDeviceInWorkshop" type="primary" icon="plus" style="margin-top: 16px"
            >已有设备
          </a-button>
          <a-dropdown v-if="selectedRowKeys2.length > 0">
@@ -108,16 +108,18 @@
                删除
              </a-menu-item>
            </a-menu>
            <a-button style="margin-left: 8px"> 批量操作
            <a-button style="margin-left: 8px">
              批量操作
              <a-icon type="down"/>
            </a-button>
          </a-dropdown>
        </div>
        <!-- table区域-begin -->
        <div>
          <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
            <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
            selectedRowKeys2.length }}</a>项
          <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
            <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
            <a style="font-weight: 600">{{ selectedRowKeys2.length }}</a
            >项
            <a style="margin-left: 24px" @click="onClearSelected2">清空</a>
          </div>
          <a-table
@@ -131,7 +133,8 @@
            :pagination="ipagination2"
            :loading="loading2"
            :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
            @change="handleTableChange2">
            @change="handleTableChange2"
          >
            <span slot="action" slot-scope="text, record">
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete2(record.equipmentId)">
                  <a>删除</a>
@@ -142,8 +145,10 @@
      </a-card>
    </a-col>
    <!-- 表单区域 -->
    <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal> <!--新增车间-->
    <select-device-modal ref="selectUserModal" @selectFinished="selectOK"></select-device-modal> <!--已有设备-->
    <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal>
    <!--新增车间-->
    <select-device-modal ref="selectUserModal" @selectFinished="selectOK"></select-device-modal>
    <!--已有设备-->
  </a-row>
</template>
<script>
@@ -160,7 +165,7 @@
    components: {
      SelectDeviceModal,
      WorkshopModal,
      moment
    moment,
    },
    data() {
      return {
@@ -181,7 +186,7 @@
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        total: 0,
        },
        ipagination2: {
          current: 1,
@@ -192,15 +197,15 @@
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        total: 0,
        },
        isorter1: {
          column: 'createTime',
          order: 'desc'
        order: 'desc',
        },
        isorter2: {
          column: 'createTime',
          order: 'desc'
        order: 'desc',
        },
        filters1: {},
        filters2: {},
@@ -216,39 +221,39 @@
          {
            title: '车间名称',
            align: 'center',
            dataIndex: 'workshopName'
          dataIndex: 'workshopName',
          },
          {
            title: '车间背景图',
            dataIndex: 'backgroundImage',
            align: 'center',
            scopedSlots: { customRender: 'backgroundImage' }
          scopedSlots: { customRender: 'backgroundImage' },
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            scopedSlots: { customRender: 'action' }
          }
          scopedSlots: { customRender: 'action' },
        },
        ],
        columns2: [
          {
            title: '设备编码',
            align: 'center',
            dataIndex: 'equipmentId',
            width: 120
          width: 120,
          },
          {
            title: '设备名称',
            align: 'center',
            width: 100,
            dataIndex: 'equipmentName'
          dataIndex: 'equipmentName',
          },
          {
            title: '设备类型',
            align: 'center',
            width: 80,
            dataIndex: 'equipmentType'
          dataIndex: 'equipmentType',
          },
          {
@@ -256,8 +261,9 @@
            dataIndex: 'action',
            scopedSlots: { customRender: 'action' },
            align: 'center',
            width: 120
          }],
          width: 120,
        },
      ],
        // 高级查询参数
        superQueryParams2: '',
        // 高级查询拼接条件
@@ -268,8 +274,8 @@
          list2: '/mdc/mdcWorkshopInfo/workshopEquipmentList',
          addDeviceInWorkshop: '/mdc/mdcWorkshopInfo/addWorkshopEquipment',
          delete2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipment',
          deleteBatch2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch'
        }
        deleteBatch2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch',
      },
      }
    },
    computed: {
@@ -278,7 +284,7 @@
      },
      rightColMd() {
        return this.selectedRowKeys1.length === 0 ? 0 : 12
      }
    },
    },
    methods: {
      onSelectChange2(selectedRowKeys, selectionRows) {
@@ -385,7 +391,7 @@
          // this.$message.warning('请选择一条记录!')
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          description: '请选择一条记录',
          })
          return
        } else {
@@ -400,7 +406,7 @@
            onOk: function() {
              deleteAction(that.url.deleteBatch2, {
                workshopId: that.currentWorkshopId,
                equipmentIds: ids
              equipmentIds: ids,
              }).then((res) => {
                if (res.success) {
                  that.$message.success(res.message)
@@ -410,7 +416,7 @@
                  that.$message.warning(res.message)
                }
              })
            }
          },
          })
        }
      },
@@ -483,13 +489,13 @@
      hideUserList() {
        //this.rightcolval = 0
        this.selectedRowKeys1 = []
      }
    }
    },
  },
  }
</script>
<style scoped>
  /** Button按钮间距 */
  .ant-btn {
    margin-left: 8px
  margin-left: 8px;
  }
</style>