1、首页公司级和分厂级看板中的问题列表接口完成与后端数据联调
2、问题反馈页面完成所有布局及相关功能
已添加2个文件
已修改3个文件
379 ■■■■■ 文件已修改
src/api/signage.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/BranchFactorySignage.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/IndexSignage.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/ProblemFeedbackList.vue 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/ProblemFeedbackList/ProblemFeedbackModal.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/signage.js
@@ -25,6 +25,8 @@
  getEquipmentOEEStatistics: productionCode => getAction('/mdc/home/equipmentOEEStatistics', { productionCode }),
  // è®¾å¤‡OEE和利用率对比
  getEquipmentMonthStatisticsApi: productionCode => getAction('/mdc/home/equipmentMonthStatistics', { productionCode }),
  // é—®é¢˜åˆ—表
  getWorkshopProblemListApi: productionCode => getAction('/mdc/home/feedbackList', { productionCode }),
  // å·¥æ®µçº§å‰7天利用率折线图
  getEquipmentDayUtilizationStatisticsApi: productionCode => getAction('/mdc/home/equipmentDayUtilizationStatistics', { productionCode }),
  // ä¸Šä¸ªæœˆå„设备OEE统计
src/views/dashboard/BranchFactorySignage.vue
@@ -108,11 +108,12 @@
        thisMonthMaintenanceRealNum: 0,
        nextMonthMaintenancePlanNum: 0,
        nextNextMonthMaintenancePlanNum: 0,
        twoMaintenanceChartData: [['-', '-', '-']],
        twoMaintenanceChartData: [],
        barChart: '',
        barChartData: [],
        doubleBarChart: '',
        doubleBarChartData: {},
        workshopProblemChartData: [],
        maintenanceConfig: {},
        problemConfig: {}
      }
@@ -120,7 +121,6 @@
    mounted() {
      window.addEventListener('resize', this.handleWindowResize)
      this.getChartDataByApi()
      this.drawProblemChart()
    },
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWindowResize)
@@ -136,6 +136,7 @@
        this.getTwoMaintenanceChartDataByApi()
        this.getBarChartDataByApi()
        this.getDoubleBarChartDataByApi()
        this.getWorkshopProblemChartDataByApi()
      },
      /* è°ƒç”¨æŽ¥å£èŽ·å–è®¾å¤‡è¿è¡ŒçŠ¶æ€ */
@@ -238,7 +239,7 @@
      getTwoMaintenanceChartDataByApi() {
        signageApi.getTwoMaintenancePlanListApi(this.productionCode)
          .then(res => {
            if (res.success && res.result) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content])
            if (res.success && res.result.length > 0) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content])
            this.drawMaintenanceChart()
          })
      },
@@ -274,6 +275,16 @@
            this.drawDoubleBarChart()
          })
      },
      /* è°ƒç”¨æŽ¥å£èŽ·å–è½¦é—´é—®é¢˜åˆ—è¡¨*/
      getWorkshopProblemChartDataByApi() {
        signageApi.getWorkshopProblemListApi(this.productionCode)
          .then(res => {
            if (res.success && res.result.length > 0) this.workshopProblemChartData = res.result.map(item => [item.content, item.createTime])
            this.drawWorkshopProblemChart()
          })
      },
      /* ç»˜åˆ¶è®¾å¤‡è¿è¡ŒçŠ¶æ€çŽ«ç‘°é¥¼å›¾ */
      drawRunningStateChart(productionId) {
@@ -1055,27 +1066,16 @@
      },
      /* ç»˜åˆ¶é—®é¢˜æ»šåŠ¨è¡¨ */
      drawProblemChart() {
      drawWorkshopProblemChart() {
        this.problemConfig = {
          indexHeader: '序号',
          header: ['时间', '问题内容'],
          header: ['问题内容', '时间'],
          headerBGC: '#86D186',
          oddRowBGC: '#7CBF7C',
          evenRowBGC: '#7CBF7C',
          data: [
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题']
          ],
          data: this.workshopProblemChartData,
          index: true,
          columnWidth: [100, 300, 300],
          columnWidth: [100, 300, 150],
          align: ['center']
        }
      },
src/views/dashboard/IndexSignage.vue
@@ -109,6 +109,7 @@
        barChartData: [],
        doubleBarChart: '',
        doubleBarChartData: {},
        workshopProblemChartData: [['-', '-', '-']],
        efficiencyChartConfig: {},
        maintenanceConfig: {},
        problemConfig: {},
@@ -121,7 +122,6 @@
    mounted() {
      window.addEventListener('resize', this.handleWindowResize)
      this.getChartDataByApi()
      this.drawProblemChart()
    },
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWindowResize)
@@ -137,6 +137,7 @@
        this.getTwoMaintenanceChartDataByApi()
        this.getBarChartDataByApi()
        this.getDoubleBarChartDataByApi()
        this.getWorkshopProblemChartDataByApi()
      },
      /* è°ƒç”¨æŽ¥å£èŽ·å–è®¾å¤‡è¿è¡ŒçŠ¶æ€ */
@@ -239,7 +240,7 @@
      getTwoMaintenanceChartDataByApi() {
        signageApi.getTwoMaintenancePlanListApi()
          .then(res => {
            if (res.success && res.result) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content])
            if (res.success && res.result.length > 0) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content])
            this.drawMaintenanceChart()
          })
      },
@@ -273,6 +274,16 @@
          .then(res => {
            if (res.success) this.doubleBarChartData = res.result
            this.drawDoubleBarChart()
          })
      },
      /* è°ƒç”¨æŽ¥å£èŽ·å–è½¦é—´é—®é¢˜åˆ—è¡¨*/
      getWorkshopProblemChartDataByApi() {
        signageApi.getWorkshopProblemListApi()
          .then(res => {
            console.log('res', res.result)
            if (res.success && res.result.length > 0) this.workshopProblemChartData = res.result.map(item => [item.content, item.createTime])
            this.drawWorkshopProblemChart()
          })
      },
@@ -1144,27 +1155,16 @@
      },
      /* ç»˜åˆ¶é—®é¢˜æ»šåŠ¨è¡¨ */
      drawProblemChart() {
      drawWorkshopProblemChart() {
        this.problemConfig = {
          indexHeader: '序号',
          header: ['时间', '问题内容'],
          header: [ '问题内容', '时间'],
          headerBGC: '#86D186',
          oddRowBGC: '#7CBF7C',
          evenRowBGC: '#7CBF7C',
          data: [
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题'],
            // ['2024å¹´3月23号', '大家注意安全问题']
          ],
          data: this.workshopProblemChartData,
          index: true,
          columnWidth: [100, 300, 300],
          columnWidth: [100, 300, 150],
          align: ['center']
        }
      },
src/views/mdc/base/ProblemFeedbackList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="车间名称">
              <a-tree-select v-model="queryParam.productionId" :treeData="workshopTreeData" placeholder="请选择车间"
                             :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select>
            </a-form-item>
          </a-col>
          <a-col :md="2" :sm="2" :xs="2">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
            <a-icon type="delete"/>
            åˆ é™¤
          </a-menu-item>
        </a-menu>
        <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">
          {{selectedRowKeys.length }}
        </a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:465}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <ProblemFeedbackModal ref="modalRef" :visible="modalVisible" :title="modalTitle"
                          :workshopTreeData="workshopTreeData" :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
                          @handleCloseModal="handleCloseModal" @modalFormOk="modalFormOk"/>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { queryProductionTreeList } from '@/api/api'
  import ProblemFeedbackModal from './modules/ProblemFeedbackList/ProblemFeedbackModal'
  export default {
    name: 'ProblemFeedbackList',
    mixins: [JeecgListMixin],
    components: {
      ProblemFeedbackModal
    },
    data() {
      return {
        description: '问题反馈',
        /* åˆ†é¡µå‚æ•° */
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['30', '50', '100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' å…±' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '车间',
            align: 'center',
            dataIndex: 'productionId_dictText',
            width: 450
          },
          {
            title: '问题内容',
            align: 'center',
            dataIndex: 'content',
            width: 660,
            ellipsis: true,
          },
          {
            title: '时间',
            align: 'center',
            dataIndex: 'createTime',
            width: 450
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            width: 150,
            fixed: 'right',
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: '/mdc/mdcFeedback/list',
          delete: '/mdc/mdcFeedback/delete',
          deleteBatch: '/mdc/mdcFeedback/deleteBatch'
        },
        workshopTreeData: [],
        treeDefaultExpandedKeys: [],
        modalVisible: false,
        modalTitle: ''
      }
    },
    created() {
      this.getWorkshopListByApi()
    },
    methods: {
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŸ¥è¯¢åŒºåŸŸè½¦é—´æ ‘åˆ—è¡¨
       */
      getWorkshopListByApi() {
        queryProductionTreeList().then(res => {
          if (res.success) {
            this.workshopTreeData = res.result
            this.treeDefaultExpandedKeys = [...res.result].map(item => item.key)
          }
        })
      },
      handleAdd() {
        this.modalTitle = '新增'
        this.$refs.modalRef.model = {}
        this.modalVisible = true
      },
      /**
       * ç‚¹å‡»ç¼–辑按钮打开编辑窗口
       * @param record ç‚¹å‡»è¡¨æ ¼è¡Œä¿¡æ¯
       */
      handleEdit(record) {
        this.modalTitle = '编辑'
        this.$refs.modalRef.model = Object.assign({}, record)
        this.modalVisible = true
      },
      modalFormOk() {
        // æ–°å¢ž/修改 æˆåŠŸæ—¶ï¼Œé‡è½½åˆ—è¡¨
        this.loadData()
        //清空列表选中
        this.onClearSelected()
        this.handleCloseModal()
      },
      handleCloseModal() {
        this.modalVisible = false
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/mdc/base/modules/ProblemFeedbackList/ProblemFeedbackModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
<template>
  <a-modal :visible="visible" :title="title" @cancel="$emit('handleCloseModal')" @ok="handleSubmit">
    <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="车间" prop="productionId">
            <a-tree-select v-model="model.productionId" :treeData="workshopTreeData" placeholder="请选择车间"
                           :treeDefaultExpandedKeys="treeDefaultExpandedKeys"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="问题内容" prop="content">
            <a-input v-model="model.content" placeholder="请输入内容"/>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
  </a-modal>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  export default {
    name: 'ProblemFeedbackModal',
    components: {},
    props: {
      visible: {
        type: Boolean,
        default: false
      },
      title: {
        type: String
      },
      workshopTreeData: {
        type: Array
      },
      treeDefaultExpandedKeys: {
        type: Array
      }
    },
    data() {
      return {
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        validatorRules: {
          productionId: [
            { required: true, message: '请选择车间名称!' }
          ]
        },
        url: {
          add: '/mdc/mdcFeedback/add',
          edit: '/mdc/mdcFeedback/edit'
        }
      }
    },
    methods: {
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            let apiUrl = ''
            let method = ''
            if (!this.model.id) {
              apiUrl += this.url.add
              method = 'post'
            } else {
              apiUrl += this.url.edit
              method = 'put'
            }
            httpAction(apiUrl, this.model, method).then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.$emit('modalFormOk')
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            })
          }
        })
      }
    }
  }
</script>