qushaowei
2023-11-11 80989ae609bb5dc01191a583a30f8d08ca4f31f3
中心  工区  工段修改
已添加5个文件
已修改6个文件
1209 ■■■■■ 文件已修改
src/views/eam/SiteAreaLineManagerNew.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/EquipmentModal.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/AreaModel.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/ProductionLineModel.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/site/SiteModel.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/SiteAreaLineManagerNew.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
<template>
  <a-row
    type="flex"
    :gutter="16"
  >
    <a-col
      :md="6"
      :sm="24"
    >
      <site-area-line-left />
    </a-col>
    <a-col
      :md="24-6"
      :sm="24"
    >
      <site-area-line-right />
    </a-col>
  </a-row>
</template>
<script>
import SiteAreaLineLeft from './modules/siteAreaLine/SiteAreaLineLeft'
import SiteAreaLineRight from './modules/siteAreaLine/SiteAreaLineRight'
export default {
  name: 'SiteAreaLineManagerNew',
  components: {
    SiteAreaLineLeft,
    SiteAreaLineRight
  },
  data() {
    return {
      description: '故障原因'
    }
  },
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue
@@ -42,7 +42,7 @@
                @search="onDepartList()"
                :read-only="true"
                v-decorator="['useDepartName', validatorRules.useDepartName]"
              /> -->
              />
              <a-tree-select
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
@@ -50,6 +50,15 @@
                placeholder="请选择使用部门"
                tree-default-expand-all
                v-decorator="['useId', validatorRules.useId ]"
              />-->
              <j-dict-select-tag
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请选择使用部门'"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-decorator="['useId', {}]"
              />
            </a-form-item>
          </a-col>
src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
@@ -40,7 +40,7 @@
                @search="onDepartList()"
                :read-only="true"
                v-decorator="['useDepartName', validatorRules.useDepartName]"
              /> -->
              />
              <a-tree-select
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
@@ -48,6 +48,15 @@
                placeholder="请选择部门"
                tree-default-expand-all
                v-decorator="['departId', validatorRules.useId ]"
              />-->
              <j-dict-select-tag
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请选择使用部门'"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-decorator="['departId', {}]"
              />
            </a-form-item>
          </a-col>
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -117,13 +117,21 @@
              :wrapperCol="wrapperCol"
              prop="useId"
            >
              <a-tree-select
              <!-- <a-tree-select
                style="width: 100%"
                :disabled="formDisabled"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择使用部门"
                tree-default-expand-all
                v-model="model.useId"
              /> -->
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择使用部门"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model="model.useId"
              />
            </a-form-model-item>
@@ -173,13 +181,21 @@
              :wrapperCol="wrapperCol"
              prop="manageId"
            >
              <a-tree-select
              <!-- <a-tree-select
                :disabled="formDisabled"
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择维护部门"
                tree-default-expand-all
                v-model="model.manageId"
              /> -->
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择维护部门"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model="model.manageId"
              />
            </a-form-model-item>
@@ -319,7 +335,10 @@
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="model.operatingSystem=='yes'">
          <a-col
            :span="6"
            v-if="model.operatingSystem=='yes'"
          >
            <a-form-model-item
              label="系统"
              :labelCol="labelCol"
@@ -348,12 +367,12 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
              <a-form-model-item
                label="坐标数量"
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                prop="coordinateNum"
              >
            <a-form-model-item
              label="坐标数量"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="coordinateNum"
            >
              <a-input-number
                v-model="model.coordinateNum"
                :disabled="formDisabled"
@@ -691,8 +710,8 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
          </a-row>
          <a-row hidden>
        </a-row>
        <a-row hidden>
          <a-col :span="6">
            <a-form-model-item
              label="平均使用率"
@@ -902,8 +921,8 @@
      default: false,
      required: false
    },
    caytegoryParam:{
      type:String,
    caytegoryParam: {
      type: String,
      default: '',
      required: false
    }
@@ -990,7 +1009,7 @@
        propertyStatus: [
          { required: true, message: '请选择资产状态!' },
        ],
        system:[
        system: [
          { required: true, message: '请输入系统!' },
        ]
      },
@@ -998,7 +1017,7 @@
        add: "/eam/equipment/add",
        edit: "/eam/equipment/edit",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getCategoryFlag:"/eam/equipmentCategory/queryById"
        getCategoryFlag: "/eam/equipmentCategory/queryById"
      },
      treeData: [],
      needSpecific: false,
@@ -1018,8 +1037,8 @@
    edit(record) {
      console.log(this.disabled)
      this.model = Object.assign({}, record);
      if(!this.model.id){
          this.model.equipmentStatus = '1'
      if (!this.model.id) {
        this.model.equipmentStatus = '1'
      }
      this.visible = true;
    },
@@ -1167,9 +1186,9 @@
    },
    onSearchPrecisionParametersTemplate() {
      if(this.model.num ==''||this.model.num==undefined||this.model.num==null){
           this.$message.warn("请先填写统一编码")
           return false;
      if (this.model.num == '' || this.model.num == undefined || this.model.num == null) {
        this.$message.warn("请先填写统一编码")
        return false;
      }
      this.$refs.PrecisionParametersTemplateList.list();
      this.$refs.PrecisionParametersTemplateList.title = "选择设备精度模板";
@@ -1220,32 +1239,32 @@
        })
      }
      //改变技术状态鉴定周期
      if(this.model.equipmentCategoryId!==null&&this.model.equipmentCategoryId!=''){
      if (this.model.equipmentCategoryId !== null && this.model.equipmentCategoryId != '') {
        var value = this.model.equipmentCategoryId;
        getAction(this.url.getCategoryFlag,{id:value}).then(res=>{
             if(res.result.equipmentCategoryUda1!=='weldingMachine'&&res.result.equipmentCategoryUda11!=='filesCarousel'&&res.result.equipmentCategoryUda1!=='tester'){
                if(val==='A'){
                  this.model.checkPeriod=365*3+'';
                }
                if(val==='B'||val==='C'||val==='D'){
                  this.model.checkPeriod=365*4+'';
                }
             }
             this.model = Object.assign({},this.model);
        getAction(this.url.getCategoryFlag, { id: value }).then(res => {
          if (res.result.equipmentCategoryUda1 !== 'weldingMachine' && res.result.equipmentCategoryUda11 !== 'filesCarousel' && res.result.equipmentCategoryUda1 !== 'tester') {
            if (val === 'A') {
              this.model.checkPeriod = 365 * 3 + '';
            }
            if (val === 'B' || val === 'C' || val === 'D') {
              this.model.checkPeriod = 365 * 4 + '';
            }
          }
          this.model = Object.assign({}, this.model);
        })
      }
    },
    categoryChange(value){
       getAction(this.url.getCategoryFlag,{id:value}).then(res=>{
             if(res.result.equipmentCategoryUda1==='weldingMachine'){
                this.model.checkPeriod=365*3+'';
             }else if(res.result.equipmentCategoryUda1==='filesCarousel'){
                this.model.checkPeriod=365*4+'';
             }else if(res.result.equipmentCategoryUda1==='tester'){
                this.model.checkPeriod=365*1+'';
             }
             this.model = Object.assign({},this.model);
       })
    categoryChange(value) {
      getAction(this.url.getCategoryFlag, { id: value }).then(res => {
        if (res.result.equipmentCategoryUda1 === 'weldingMachine') {
          this.model.checkPeriod = 365 * 3 + '';
        } else if (res.result.equipmentCategoryUda1 === 'filesCarousel') {
          this.model.checkPeriod = 365 * 4 + '';
        } else if (res.result.equipmentCategoryUda1 === 'tester') {
          this.model.checkPeriod = 365 * 1 + '';
        }
        this.model = Object.assign({}, this.model);
      })
    }
  },
  computed: {
src/views/eam/modules/site/AreaModel.vue
@@ -21,7 +21,7 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="true"
                :readOnly="codeDisable"
                allow-clear
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
@@ -105,7 +105,7 @@
<script>
import pick from 'lodash.pick'
import { getAction,postAction, requestPut } from '@/api/manage'
import { getAction, postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
@@ -163,6 +163,7 @@
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      codeDisable: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
    }
@@ -189,6 +190,9 @@
            }
          })
        });
        this.codeDisable = false;
      } else {
        this.codeDisable = true;
      }
    },
    close() {
src/views/eam/modules/site/ProductionLineModel.vue
@@ -21,7 +21,7 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="true"
                :readOnly="codeDisable"
                allow-clear
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
@@ -89,7 +89,7 @@
<script>
import pick from 'lodash.pick'
import { getAction,postAction, requestPut } from '@/api/manage'
import { getAction, postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
@@ -142,6 +142,7 @@
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      codeDisable: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
    }
@@ -168,6 +169,9 @@
            }
          })
        });
        this.codeDisable = false;
      } else {
        this.codeDisable = true;
      }
    },
    close() {
src/views/eam/modules/site/SiteModel.vue
@@ -21,7 +21,7 @@
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="true"
                :readOnly="codeDisable"
                allow-clear
                placeholder="将由系统自动生成"
                v-decorator="['num', validatorRules.num ]"
@@ -71,7 +71,7 @@
<script>
import pick from 'lodash.pick'
import { getAction,postAction, requestPut } from '@/api/manage'
import { getAction, postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
@@ -118,6 +118,7 @@
        getNum: '/eam/sysIdentity/getNumNew',
      },
      disableSubmit: false,
      codeDisable: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
    }
@@ -133,6 +134,7 @@
      this.model = Object.assign({}, record);
      this.visible = true;
      this.disableSubmit = false;
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark'))
      });
@@ -144,7 +146,10 @@
            }
          })
        });
      }
        this.codeDisable = false;
      } else {
        this.codeDisable = true;
      } 4
    },
    close() {
      this.$emit('close');
src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,391 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <template slot="title">
      <i
        class="action-jeecg actionsite2"
        style="font-size: 18px;"
      />
      ä¸­å¿ƒ/工区/工段明细
    </template>
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <!-- æœç´¢åŒºåŸŸ -->
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <a-col
            :md="8"
            :sm="8"
          >
            <a-form-item label="编号">
              <a-input
                placeholder="请输入编号查询"
                v-model="queryParam.num"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
            :md="8"
            :sm="8"
          >
            <a-form-item label="名称">
              <a-input
                placeholder="请输入名称查询"
                v-model="queryParam.name"
              ></a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div
      class="table-operator"
      style="margin-top: 5px"
    >
      <a-button
        type="primary"
        @click="searchQuery"
        icon="search"
      >查询</a-button>
      <a-button
        @click="searchReset"
        icon="reload"
      >重置</a-button>
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
      >新增</a-button>
      <!-- <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('原因')"
      >导出</a-button> -->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-button style="margin-left: 8px">
          æ‰¹é‡æ“ä½œ
          <a-icon type="down" />
        </a-button>
        <a-menu slot="overlay">
          <a-menu-item @click="batchDel">
            <a-icon type="delete" />删除
          </a-menu-item>
        </a-menu>
      </a-dropdown>
    </div>
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps:getCheckboxProps}"
      @change="handleTableChange"
      :scroll="{ x: true}"
    >
      <template
        slot="num"
        slot-scope="text"
      >
        <a-tooltip
          placement="top"
          :title="text"
          trigger="hover"
        >
          <div>
            <template slot="title"> </template>
            <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p>
          </div>
        </a-tooltip>
      </template>
      <template
        slot="name"
        slot-scope="text"
      >
        <a-tooltip
          placement="top"
          :title="text"
          trigger="hover"
        >
          <div>
            <template slot="title"> </template>
            <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p>
          </div>
        </a-tooltip>
      </template>
      <span
        slot="action"
        slot-scope="text, record"
      >
        <a
          href="javascript:;"
          @click="handleDetail(record)"
        >详情</a>
        <a-divider type="vertical" />
        <a-dropdown>
          <a class="ant-dropdown-link">
            æ›´å¤š
            <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
            <a-menu-item>
              <a @click="handleEdit(record)">编辑</a>
            </a-menu-item>
            <a-menu-item v-if="record.nextAreas.length==0">
              <a-popconfirm
                title="确定删除吗?"
                @confirm="() => handleDelete(record.id)"
              >
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item>
            <a-menu-item v-else>
              <a-popconfirm title="当前信息已被引用,请先删除关联信息后再执行删除操作">
                <a class="frozenRowClass">删除</a>
              </a-popconfirm>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </span>
    </a-table>
    <site-area-line-model
      ref="modalForm"
      @ok="modalFormOk"
    ></site-area-line-model>
  </a-card>
</template>
<script>
import { requestPut, deleteAction, getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SiteAreaLineModel from './SiteAreaLineModel'
import JInput from '@/components/jeecg/JInput'
import JEllipsis from '@/components/jeecg/JEllipsis'
export default {
  name: 'SiteAreaLine2List',
  mixins: [JeecgListMixin],
  components: {
    SiteAreaLineModel,
    JInput,
    JEllipsis,
  },
  props: {
    nodeSelected: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      dataSource: [],
      //默认排序
      isorter: {
        column: 'num',
        order: 'asc',
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
          width: 50,
        },
        {
          title: '编码',
          align: "center",
          dataIndex: 'num',
        },
        {
          title: '名称',
          align: "center",
          dataIndex: 'name',
        },
        {
          title: '创建人',
          align: "center",
          dataIndex: 'createBy',
        },
        {
          title: '创建时间',
          align: "center",
          dataIndex: 'createTime',
        },
        {
          title: '操作',
          align: "center",
          dataIndex: 'action',
          scopedSlots: {
            customRender: 'action',
          },
          width: 150,
          fixed: 'right',
        },
      ],
      url: {
        list: "/base/area/getAlllist",
        delete: "/base/area/delete",
        deleteBatch: "/base/area/deleteBatch",
        exportXlsUrl: '/eam/faultCause/exportXls',
        // importExcelUrl: 'base/site/importExcel',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: "",
      parentNum: "-1",
      parentName: "中心/工区/工段",
    };
  },
  methods: {
    getCheckboxProps(record) {
      return ({
        props: {
          disabled: !(record.nextAreas.length == 0),
        }
      })
    },
    //禁用状态样式
    tableRowClass(record, index) {
      if (record.status != "1") {
        return "frozenRowClass";
      }
      return "";
    },
    handleActive(id) {
      let that = this;
      requestPut(that.url.active, {}, { id: id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message);
          that.loadData();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    handleAdd: function () {
      this.$refs.modalForm.add({ parentNum: this.parentNum, parentName: this.parentName });
      this.$refs.modalForm.title = "新增";
      this.$refs.modalForm.disableSubmit = false;
      // this.$refs.modalForm.parentId = this.nodeSelected.key;
      this.$refs.modalForm.parentId = !this.nodeSelected.key ? '-1' : this.nodeSelected.key;
    },
    handleDelete: function (id) {
      if (!this.url.delete) {
        this.$message.error("请设置url.delete属性!")
        return
      }
      var that = this;
      deleteAction(that.url.delete, { id: id }).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          that.$message.success(res.message);
          that.loadData();
          that.alterFlag = new Date();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    batchDel: function () {
      if (!this.url.deleteBatch) {
        this.$message.error("请设置url.deleteBatch属性!")
        return
      }
      if (this.selectedRowKeys.length <= 0) {
        this.$message.warning('请选择一条记录!');
        return;
      } else {
        var ids = "";
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ",";
        }
        var that = this;
        this.$confirm({
          title: "确认删除",
          content: "是否删除选中数据?",
          onOk: function () {
            that.loading = true;
            deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
              if (res.success) {
                //重新计算分页问题
                that.reCalculatePage(that.selectedRowKeys.length)
                that.$message.success(res.message);
                that.loadData();
                that.onClearSelected();
                that.alterFlag = new Date();
              } else {
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.loading = false;
            });
          }
        });
      }
    },
    searchReset() {
      this.queryParam = {};
      this.queryParam.parentId = this.nodeSelected.key;
      this.loadData(1);
    },
  },
  watch: {
    alterFlag() {
      this.$bus.$emit('queryTreeData');
    },
    nodeSelected() {
      this.queryParam = {};
      this.queryParam.parentId = this.nodeSelected.key;
      this.parentNum = !this.nodeSelected.rfield1 ? '-1' : this.nodeSelected.rfield1;
      this.parentName = !this.nodeSelected.rfield2 ? '中国航发' : this.nodeSelected.rfield2;
      this.loadData(1);
    },
  },
  created() {
    this.queryParam = {};
    this.queryParam.parentId = this.nodeSelected.key;
    this.loadData(1);
  }
}
</script>
<style>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
.fontweight {
  font-weight: bold;
}
</style>
src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,310 @@
<template>
  <a-card
    :loading="cardLoading"
    :bordered="false"
    title="中心/工区/工段"
    style="height: 100%;"
  >
    <a-spin :spinning="loading">
      <a-alert
        type="info"
        :showIcon="true"
        style="margin-right: 54px;"
      >
        <div slot="message">
          å½“前:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
          <a
            v-if="this.currSelected.title"
            style="margin-left: 10px"
            @click="onClearSelected"
          >取消</a>
        </div>
      </a-alert>
      <div class="drawer-bootom-button">
        <a-dropdown
          :trigger="['click']"
          placement="bottomCenter"
        >
          <a-menu slot="overlay">
            <a-menu-item
              key="1"
              @click="expandAll"
            >展开所有</a-menu-item>
            <a-menu-item
              key="2"
              @click="closeAll"
            >合并所有</a-menu-item>
            <a-menu-item
              key="3"
              @click="refreshTree"
            >刷新</a-menu-item>
          </a-menu>
          <a-button>
            <a-icon type="bars" />
          </a-button>
        </a-dropdown>
      </div>
      <a-input-search
        @search="handleSearch"
        style="width:100%;margin-top: 10px"
        placeholder="中心/工区/工段"
        allowClear
        v-model="searchInput"
        @change="handleChange"
      />
      <a-tree
        showLine
        ref="tree"
        :checkStrictly="checkStrictly"
        :expandedKeys.sync="expandedKeys"
        :selectedKeys="selectedKeys"
        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
        :treeData="treeDataSource"
        :autoExpandParent="autoExpandParent"
        @select="onSelect"
        @expand="onExpand"
      >
      </a-tree>
    </a-spin>
  </a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import JEllipsis from "@/components/jeecg/JEllipsis"
export default {
  name: 'SiteAreaLineLeft',
  components: {
    Tooltip,
    JEllipsis
  },
  props: ['value'],
  data() {
    return {
      searchInput: '',
      cardLoading: false,
      loading: false,
      treeDataSource: [],
      selectedKeys: [],
      expandedKeys: [],
      url: {
        treeList: '/base/area/loadTree'
      },
      searchValue: '',
      dataList: [],
      autoExpandParent: true,
      checkStrictly: true,
      allTreeKeys: [],
      currSelected: {},
      hiding: false,
    }
  },
  created() {
    this.queryTreeData();
    this.closeAll();
  },
  methods: {
    getCurrSelectedTitle() {
      return !this.currSelected.title ? '' : this.currSelected.title;
    },
    onClearSelected() {
      this.hiding = true;
      this.currSelected = {};
      this.selectedKeys = [];
    },
    onSelect(selectedKeys, e) {
      this.hiding = false;
      let record = e.node.dataRef;
      this.currSelected = Object.assign({}, record);
      this.selectedKeys = [record.key];
    },
    onExpand(expandedKeys) {
      this.expandedKeys = expandedKeys;
      this.autoExpandParent = false;
    },
    queryTreeData() {
      this.loading = true;
      this.cardLoading = true;
      getAction(this.url.treeList).then((res) => {
        if (res.success) {
          this.dataList = [];
          this.allTreeKeys = [];
          this.treeDataSource = res.result;
          this.generateList(res.result);
        } else {
          this.$message.warn(res.message);
        }
      }).finally(() => {
        this.loading = false;
        this.cardLoading = false;
      })
    },
    handleChange() {
      let search = this.searchInput;
      let expandedKeys = this.dataList
        .map(item => {
          if (item.title.indexOf(search) > -1) {
            return this.getParentKey(item.key, this.treeDataSource);
          }
          return null;
        })
        .filter((item, i, self) => item && self.indexOf(item) === i);
      Object.assign(this, {
        expandedKeys,
        searchValue: search,
        autoExpandParent: true,
      });
    },
    handleSearch(value) {
      let search = value;
      let expandedKeys = this.dataList
        .map(item => {
          if (item.title.indexOf(search) > -1) {
            return this.getParentKey(item.key, this.treeDataSource);
          }
          return null;
        })
        .filter((item, i, self) => item && self.indexOf(item) === i);
      Object.assign(this, {
        expandedKeys,
        searchValue: search,
        autoExpandParent: true,
      });
    },
    getParentKey(key, tree) {
      let parentKey;
      for (let i = 0; i < tree.length; i++) {
        const node = tree[i];
        if (node.children) {
          if (node.children.some(item => item.key === key)) {
            parentKey = node.key;
          } else if (
            this.getParentKey(key, node.children)) {
            parentKey = this.getParentKey(key, node.children);
          }
        }
      }
      return parentKey;
    },
    generateList(data) {
      for (let i = 0; i < data.length; i++) {
        const node = data[i];
        const key = node.key;
        const title = node.title;
        // const type = node.type;
        this.dataList.push({ key, title: title });
        this.allTreeKeys.push(key);
        if (node.children) {
          this.generateList(node.children);
        }
      }
    },
    expandAll() {
      this.expandedKeys = this.allTreeKeys;
    },
    closeAll() {
      this.expandedKeys = ['-1'];
    },
    refreshTree() {
      this.queryTreeData();
    }
  },
  mounted() {
    this.$bus.$on('queryTreeData', this.queryTreeData);
  },
  //监听
  watch: {
    currSelected(val) {//监听currSelected å˜åŒ–,将变化后的数值传递给 getCurrSelected äº‹ä»¶
      this.$bus.$emit('getCurrSelected', val);
    },
  }
}
</script>
<style>
.replaceSearch {
  color: #00090f;
  font-weight: bold;
  background-color: rgb(204, 204, 204);
}
/* .ant-select-disabled {
  color: rgba(241, 16, 16, 0.25);
}
.ant-select-disabled .ant-select-selection {
  background: #a76b6b;
} */
/*隐藏树的默认icon*/
.ant-tree-switcher-noop {
  display: none !important;
}
/*隐藏树的默认竖线*/
.ant-tree.ant-tree-show-line li:not(:last-child):before {
  border-left: 0px;
}
.ant-card-body .table-operator {
  margin: 15px;
}
.anty-form-btn {
  width: 100%;
  text-align: center;
}
.anty-form-btn button {
  margin: 0 5px;
}
.anty-node-layout .ant-layout-header {
  padding-right: 0;
}
.header {
  padding: 0 8px;
}
.header button {
  margin: 0 3px;
}
.ant-modal-cust-warp {
  height: 100%;
}
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
#app .desktop {
  height: auto !important;
}
/** Button按钮间距 */
.ant-btn {
  margin-left: 3px;
}
.ant-alert {
  padding: 5px 15px 5px 37px;
}
.drawer-bootom-button {
  position: absolute;
  top: 1px;
  /* padding: 10px 16px; */
  text-align: left;
  right: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>
src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,279 @@
<template>
  <a-modal
    :title="title"
    :width="650"
    :visible="visible"
    :maskClosable="false"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row
          hidden
          :gutter="24"
        >
          <a-col :span="24">
            <a-form-item
              label="上级故障原因编号:"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入上级故障原因编号'"
                v-decorator="['parentNum', validatorRules.parentNum ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row
          hidden
          :gutter="24"
        >
          <a-col :span="24">
            <a-form-item
              label="上级故障原因名称:"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入上级故障原因名称'"
                v-decorator="['parentName', validatorRules.parentName ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              label="编号:"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                :disabled="disableSubmit"
                allow-clear
                :placeholder="disableSubmit?'':'请输入编码'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              label="名称:"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请输入名称'"
                v-decorator="['name', validatorRules.name ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="备注"
            >
              <a-textarea
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请输入备注'"
                v-decorator="['remark', validatorRules.remark]"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <template slot="footer">
      <a-button
        :style="{marginRight: '8px'}"
        @click="handleCancel"
      >
        å…³é—­
      </a-button>
      <!-- <a-button
        v-if="!this.model.id"
        :disabled="disableSubmit || confirmLoading"
        :loading="confirmLoading"
        @click="handleOk"
        type="primary"
      >保存并继续新增</a-button> -->
      <a-button
        :disabled="disableSubmit || confirmLoading"
        :loading="confirmLoading"
        @click="handleOk"
        type="primary"
      >保存</a-button>
      <!-- icon="save" -->
    </template>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { getAction, postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
  name: 'SiteAreaLineModel',
  data() {
    return {
      title: "操作",
      visible: false,
      codeDisable: true,
      disableSubmit: false,
      parentId: '',
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入编号!' },
            // { min: 2, max: 30, message: '长度在 2 åˆ° 30 ä¸ªå­—符', trigger: 'blur' },
            // { validator: this.validateNum },
          ]
        },
        name: {
          rules: [
            { required: true, message: '请输入名称!' },
            // { min: 2, max: 30, message: '长度在 2 åˆ° 30 ä¸ªå­—符', trigger: 'blur' },
            // { validator: this.validateName },
          ]
        },
        remark: {
          rules: [
            { min: 0, max: 100, message: '长度不超过 100 ä¸ªå­—符', trigger: 'blur' },
          ]
        }
      },
      url: {
        add: "/base/area/add",
        edit: "/base/area/edit",
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
    }
  },
  created() {
  },
  methods: {
    add(record) {
      this.edit(record);
    },
    edit(record) {
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.visible = true;
      this.disableSubmit = false;
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'parentNum', 'parentName', 'num', 'name', 'remark'))
      });
      if (record.id) {
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
      }
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          if (!this.model.id) {
            formData.parentId = this.parentId
            obj = postAction(this.url.add, formData);
          } else {
            obj = requestPut(this.url.edit, formData, { id: this.model.id });
          }
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
              that.alterFlag = new Date();
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        }
      })
    },
    handleCancel() {
      this.close()
    },
  },
  watch: {
    alterFlag() {
      this.$bus.$emit('queryTreeData');
    },
  }
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>
src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
<template>
  <keep-alive>
    <site-area-line-2-list
      v-if="nodeType === 0"
      :nodeSelected="nodeSelected"
    ></site-area-line-2-list>
  </keep-alive>
</template>
<script>
import SiteAreaLine2List from "./SiteAreaLine2List";
export default {
  name: 'FaultCauseRight',
  components: {
    SiteAreaLine2List,
  },
  data() {
    return {
      description: '中心/工区/工段',
      currentOrgCode: '',
      nodeType: 0,
      nodeSelected: {}
    }
  },
  methods: {},
  mounted() {
    this.$bus.$on('getCurrSelected', (data) => {  //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      this.nodeType = (data.type == undefined ? 0 : data.type);
      this.nodeSelected = data;
    })
  },
}
</script>
<style scoped>
</style>