ludc
2024-11-15 2a225d84f5a14caddb853d3c07b26907d1cb1428
Merge remote-tracking branch 'origin/master'
已修改17个文件
已添加2个文件
429 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/test/DataTestController.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/EditAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/RevisionAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/StartWorkflowAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/ViewAction.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/ViewDialogAction.js 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/downloadFileAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/upRevisionAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/base/uploadFileAction.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/actions/handlers.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/router/views/index.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/store/index.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/base/ViewTab.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/custom-ui/product.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/option.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/test/DataTestController.java
@@ -46,7 +46,9 @@
    /**
     * èŽ·å–ebom信息
     * @param parentOid ä¸Šçº§ä¿¡æ¯
     * @param productNo äº§å“ç¼–号
     * @param productOid äº§å“ä¸»é”®
     * @param parentOid ä¸Šçº§é›¶ä»¶ä¸»é”®
     * @return
     */
    @VciUnCheckRight
@@ -123,4 +125,75 @@
        baseResult.setCode(200);
        return baseResult;
    }
    /**
     * èŽ·å–ä¸‹çº§é›¶ä»¶ä¿¡æ¯
     * @param productOid äº§å“ä¸»é”®
     * @param parentOid ä¸Šçº§é›¶ä»¶ä¸»é”®
     * @return
     */
    @VciUnCheckRight
    @GetMapping("/getChildInfo")
    public BaseResult getChildInfo(String productOid, String parentOid){
        if(StringUtils.isBlank(productOid)){
            return BaseResult.fail("产品主键为空!");
        }
        if(StringUtils.isBlank(parentOid)){
            return BaseResult.fail("零件上级主键为空!");
        }
        String sql = "select p.*,e.oid as eoid from platformbtm_part p left join platformlt_ebom e on p.oid = e.t_oid \n" +
                "where e.f_oid = '"+parentOid+"' and e.workcontextoid = '"+productOid+"' \n" +
                "and p.islastr = '1' and p.islastv = '1' order by p.code asc";
        List<Map> ebomList = boServiceI.queryByOnlySqlForMap(sql);
        BaseResult baseResult = new BaseResult();
        baseResult.setData(ebomList);
        baseResult.setSuccess(true);
        return baseResult;
    }
    /**
     * èŽ·å–é›¶ä»¶å®žä¾‹ä¿¡æ¯
     * @param productOid äº§å“ä¸»é”®
     * @param partOid é›¶ä»¶ä¸»é”®
     * @param eoid æ ‘节点上的扩展属性eoid的值
     * @return
     */
    @VciUnCheckRight
    @GetMapping("/getPartInstance")
    public BaseResult getPartInstance(String productOid, String partOid, String eoid){
        if(StringUtils.isBlank(productOid)){
            return BaseResult.fail("产品主键为空!");
        }
        if(StringUtils.isBlank(partOid)){
            return BaseResult.fail("零件主键为空!");
        }
        if(StringUtils.isBlank(eoid)){
            return BaseResult.fail("EBOM关系主键为空!");
        }
        String sql = "select t.* from platformbtm_partinstance t where t.partoid = '"+partOid+"' \n" +
                "and t.workcontextoid = '"+productOid+"' and t.ebomoid = '"+eoid+"'";
        List<Map> mapList = boServiceI.queryByOnlySqlForMap(sql);
        BaseResult baseResult = new BaseResult();
        baseResult.setData(mapList);
        baseResult.setSuccess(true);
        return baseResult;
    }
    /**
     * èŽ·å–é›¶ä»¶åŸºæœ¬ä¿¡æ¯
     * @param partOid é›¶ä»¶ä¸»é”®
     * @return
     */
    @GetMapping("/getPartInfo")
    public BaseResult getPartInfo(String partOid){
        if(StringUtils.isBlank(partOid)){
            return BaseResult.fail("零件主键为空!");
        }
        String sql = "select * from platformbtm_part where oid = '"+partOid+"'";
        List<Map> mapList = boServiceI.queryByOnlySqlForMap(sql);
        BaseResult baseResult = new BaseResult();
        baseResult.setData(mapList);
        baseResult.setSuccess(true);
        return baseResult;
    }
}
Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js
@@ -303,3 +303,13 @@
  });
}
// äº§å“æ ‘
export function getEbomInfo(params) {
  return request({
    url: "/api/dataTestController/getEbomInfo",
    method: "get",
    params
  });
}
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -239,20 +239,20 @@
          col.display=false
        }
      }
      if (col.type === "select") {
        if(col.data && col.data.length>0){
      if (col.type === "select" || col.type==='radio' || col.type==='checkbox') {
        if (col.data && col.data.length > 0) {
          col.dicData = col.data.map((d) => {
            return {
              label: d.key,
              key: d.value,
              value: d.value,
              attributes:d.attributes
              attributes: d.attributes
            };
          });
        }else if(!validatenull(col.dictCode)) {
        } else if (!validatenull(col.dictCode)) {
          getDicts(col.dictCode).then((res) => {
            if (res.data.success){
              if(res.data.data && res.data.obj == null){
            if (res.data.success) {
              if (res.data.data && res.data.obj == null) {
                res.data.obj = res.data.data
              }
              const dic = res.data.obj;
@@ -261,11 +261,13 @@
                  label: d.value,
                  key: d.key,
                  value: d.key,
                  attributes:d.attributes
                  attributes: d.attributes
                };
              });
            }
          });
        } else {
          col.dicData = [];
        }
      }
      if (col.type==='refer') {
Source/plt-web/plt-web-ui/src/components/actions/base/EditAction.js
@@ -43,7 +43,7 @@
  }
  callPreEvent(options, doBefore, function (options) {
    doEdit(options, function (type,formData) {
      callPostEvent(options, doAfter,type, callback);
      callPostEvent(options, doAfter,callback,type);
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/base/RevisionAction.js
@@ -43,7 +43,7 @@
  }
  callPreEvent(options, doBefore, function (options) {
    doRev(options, function (formData) {
      callPostEvent(options, doAfter,'rev', callback);
      callPostEvent(options, doAfter,callback,'rev');
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/base/StartWorkflowAction.js
@@ -42,7 +42,7 @@
  callPreEvent(options, doBefore, function (options) {
    showStartWindow(options, function () {
      callPostEvent(options, doAfter, callback,type);
      callPostEvent(options, doAfter, callback,'startwork');
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/base/ViewAction.js
@@ -1,10 +1,12 @@
/**
 * æŒ‰é’®å¤„理 é¡µé¢å±•示为tab选项卡
 * æŒ‰é’®å¤„理 å¼¹çª—展示详情
 */
import {paramLow,callPreEvent,callPostEvent,replaceFreeMarker} from '../BaseAction';
import {validatenull} from "@/util/validate";
import Vue from "vue";
import ViewDialog from "@/components/actions/base/ViewDialog";
import ViewTab from "@/views/base/ViewTab";
import router from "@/router/router"
import store from "@/store/index"
export const doAction = (options,callback) => {
  const paramVOS = Object.assign({
@@ -26,7 +28,6 @@
    Vue.prototype.$message.error("仅能选择一条数据来操作");
    return false;
  }
  callPreEvent(options, doBefore, function (options) {
    doView(options, function (type,formData) {
      callPostEvent(options, doAfter,type, callback);
@@ -57,25 +58,19 @@
    name="查看【"+replaceFreeMarker(paramVOS.showname,options.dataStore,options.sourceData)+"】"
  }
  paramVOS.title=name;
  const dialogConstructor = Vue.extend(ViewDialog);
  let instance = new dialogConstructor();
  instance.sourceData = options.sourceData;
  instance.dataStore = options.dataStore;
  instance.paramVOS = paramVOS
  instance.dialogClose = function () {
    vm.visible = false;
    document.body.removeChild(vm.$el);
    instance.$destroy();
    instance = null;
  };
  if (callback) {
    instance.saveCallback = callback;
  const params= {
    options:options,
    paramVOS:paramVOS,
    saveCallback:callback
  }
  let vm = instance.$mount();
  document.body.appendChild(vm.$el);
  instance.visible = true;
  store.dispatch("setViewtabparams", params);
  router.push({
    name: "查看详情",
    params:params,
  });
}
/**
 * å‰ç½®äº‹ä»¶
 * @param options æŒ‰é’®çš„配置信息
Source/plt-web/plt-web-ui/src/components/actions/base/ViewDialogAction.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
/**
 * æŒ‰é’®å¤„理 å¼¹çª—展示详情
 */
import {paramLow,callPreEvent,callPostEvent,replaceFreeMarker} from '../BaseAction';
import {validatenull} from "@/util/validate";
import Vue from "vue";
import ViewDialog from "@/components/actions/base/ViewDialog";
export const doAction = (options,callback) => {
  const paramVOS = Object.assign({
    getdataurl: '/api/uiDataController/dataFormQuery',
    getdatamethod: 'post',
    url: '/api/uiDataController/editSave',
    method: 'put',
    uploadfileurl: 'vciFileUploadController/uploadFile'
  }, options.paramVOS)
  options.paramVOS = paramVOS;
  options.sourceData = options.sourceData || {};
  options.dataStore = options.dataStore || [];
  if (!options.dataStore || options.dataStore.length < 1) {
    Vue.prototype.$message.error("请选择需要浏览的数据");
    return false;
  }
  if (!paramVOS.multi && options.dataStore.length > 1) {
    Vue.prototype.$message.error("仅能选择一条数据来操作");
    return false;
  }
  callPreEvent(options, doBefore, function (options) {
    doView(options, function (type,formData) {
      callPostEvent(options, doAfter,type, callback);
    });
  });
};
/**
 * æ‰§è¡Œ
 * @param options æŒ‰é’®çš„配置信息
 * @param callback å›žè°ƒ
 */
export const doView = (options,callback)=> {
  const paramVOS = options.paramVOS;
  let component = 'base/UIContentViewerInDialog';
  if (!validatenull(paramVOS.customurl)) {
    //自定义js
    component = `custom-ui/` + paramVOS.customurl;
  }else{
    if (!paramVOS['type'] || !paramVOS['context']) {
      Vue.prototype.$message.error("按钮配置不正确");
      return false;
    }
  }
  paramVOS.component=component;
  let name="查看详情"
  if(paramVOS.showname){
    name="查看【"+replaceFreeMarker(paramVOS.showname,options.dataStore,options.sourceData)+"】"
  }
  paramVOS.title=name;
  const dialogConstructor = Vue.extend(ViewDialog);
  let instance = new dialogConstructor();
  instance.sourceData = options.sourceData;
  instance.dataStore = options.dataStore;
  instance.paramVOS = paramVOS
  instance.dialogClose = function () {
    vm.visible = false;
    document.body.removeChild(vm.$el);
    instance.$destroy();
    instance = null;
  };
  if (callback) {
    instance.saveCallback = callback;
  }
  let vm = instance.$mount();
  document.body.appendChild(vm.$el);
  instance.visible = true;
}
/**
 * å‰ç½®äº‹ä»¶
 * @param options æŒ‰é’®çš„配置信息
 * @param callback å›žè°ƒ
 */
export const doBefore = (options,callback)=> {
  console.log('执行查看前置事件');
  if(callback){
    callback(options);
  }
}
/**
 * åŽç½®äº‹ä»¶
 * @param options æŒ‰é’®çš„配置信息
 * @param callback å›žè°ƒ
 */
export const doAfter = (options,callback,actionType)=> {
  console.log('执行查看后置事件');
  if(callback){
    callback(actionType);
  }
}
Source/plt-web/plt-web-ui/src/components/actions/base/downloadFileAction.js
@@ -23,7 +23,7 @@
  callPreEvent(options, doBefore, function (options) {
    showStartWindow(options, function () {
      callPostEvent(options, doAfter, callback,type);
      callPostEvent(options, doAfter, callback,'downloadfile');
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/base/upRevisionAction.js
@@ -18,7 +18,7 @@
  callPreEvent(options, doBefore, function (options) {
    showStartWindow(options, function () {
      callPostEvent(options, doAfter, callback,type);
      callPostEvent(options, doAfter, callback,'uprevision');
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/base/uploadFileAction.js
@@ -17,7 +17,7 @@
  }
  callPreEvent(options, doBefore, function (options) {
    showStartWindow(options, function () {
      callPostEvent(options, doAfter, callback,type);
      callPostEvent(options, doAfter, callback,'uploadfile');
    });
  });
};
Source/plt-web/plt-web-ui/src/components/actions/handlers.js
@@ -3,10 +3,14 @@
export const handlerAction=function (type,options, callback) {
  const handlers = {
    //查看
    //查看,tab展示详情
    view: () => {import("@/components/actions/base/ViewAction").then(module => {
      module.doAction(options,callback);
    })},
    //查看,弹窗展示详情
    viewdialog: () => {import("@/components/actions/base/ViewDialogAction").then(module => {
      module.doAction(options,callback);
    })},
    //创建
    add: () => {import("@/components/actions/base/AddAction").then(module => {
      module.doAction(options,callback);
Source/plt-web/plt-web-ui/src/router/views/index.js
@@ -103,4 +103,17 @@
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
  }]
}]
},{
  path: '/viewTab',
  component: Layout,
  redirect: '/viewTab/index',
  children: [{
    path: 'index',
    name: '查看详情',
    meta: {
      i18n: 'viewTab'
    },
    component: () =>
      import('@/views/base/ViewTab')
  }]
} ]
Source/plt-web/plt-web-ui/src/store/index.js
@@ -7,6 +7,7 @@
import dict from './modules/dict'
import getters from './getters'
import flow from './modules/LifeFlow'
import { setStore } from "@/util/store.js";
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -19,6 +20,25 @@
    flow
  },
  getters,
  state: {
    viewtabparams:undefined, //查看tab Action参数
  },
  mutations: {
    // è§„程详情参数
    getViewtabparams(state, obj) {
      state.viewtabparams = obj;
    },
  },
  actions: {
    setViewtabparams({ commit }, obj){
      commit("getViewtabparams", obj);
      setStore({
        name:'viewtabparams',
        content:obj,
        type:'session'
      });
    }
  }
})
export default store
Source/plt-web/plt-web-ui/src/views/base/ViewTab.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
<template>
  <!--Action æŸ¥çœ‹Tab的实现-->
  <component :is="currentComponent"
             ref="uiViewRef"
             key="ViewTab"
             :btmType="paramVOS.type"
             :context="paramVOS.context"
             :inDialog="false"
             :canEdit="false"
             actionType="view"
             :sourceData="sourceData"
             :dataStore="dataStore"
             :paramVOS="paramVOS"></component>
</template>
<script>
import {validatenull} from "@/util/validate";
import { getStore } from "@/util/store.js";
export default {
  name: "ViewTab",
  components:{},
  data(){
    return {
      sourceData:{},
      dataStore:[],
      paramVOS:{},
      currentComponent: null,
    }
  },
  computed:{
    title(){
      return this.paramVOS.title || "查看详情"
    }
  },
  created() {
    let config = {};
    if (!validatenull(this.$store.state.viewtabparams)) {
      config = this.$store.state.viewtabparams;
    } else {
      config = getStore('viewtabparams');
    }
    this.sourceData = config.options.sourceData;
    this.dataStore = config.options.dataStore;
    this.paramVOS = config.paramVOS;
  },
  mounted() {
    this.loadCompoent();
  },
  methods: {
    loadCompoent(){
      // åŠ¨æ€å¯¼å…¥ç»„ä»¶
      import(`@/views/${this.paramVOS.component}.vue`).then((module) => {
        // æˆåŠŸå¯¼å…¥åŽï¼Œå°†ç»„ä»¶æ³¨å†Œåˆ°Vue实例中
        this.currentComponent = module.default;
      }).catch((error) => {
        // å¤„理导入失败的情况
        console.log('组件加载失败:', error);
      });
    }
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/custom-ui/product.vue
@@ -1,10 +1,68 @@
<template>
  <p>产品自定义页面</p>
  <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
  </avue-tree>
</template>
<script>
import {getEbomInfo} from "@/api/UI/uiDefine";
export default {
  name: "product"
  name: "product",
  props: {
    sourceData: {
      type: Array,
      default: {}
    },
    dataStore: {
      type: Array,
      default: []
    },
    paramVOS: {
      type: Array,
      default: {}
    }
  },
  data() {
    return {
      treeLoading: false,
      treeData: [],
      treeOption: {
        height: 'auto',
        menu: false,
        addBtn: false,
        defaultExpandAll: false,
        props: {
          label: 'text',
          value: 'oid',
          children: 'children',
        },
        lazy: true,
        treeLoad: (node, resolve) => {
          console.log(node);
          const params = {
            productNo: this.dataStore[0].productnumber,
            productOid: this.dataStore[0].oid,
            parentOid: node.level === 0 ? '' : node.data.oid
          }
          getEbomInfo(params).then(res => {
            console.log(res);
            resolve(res.data.data.map(item => {
              return {
                ...item,
                leaf: item.leaf
              }
            }))
          })
        }
      },
    }
  },
  created() {
    // console.log(this.sourceData);
    console.log(this.dataStore);
    // console.log(this.paramVOS);
  },
  methods: {}
}
</script>
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -672,8 +672,8 @@
          this.$message.success('分类创建成功');
          this.getTreeList();
        }
        done();
      })
      done();
      loading();
    },
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -1112,7 +1112,8 @@
        text: data.text,
        oid: data.oid,
        itemType: 'text',
        itemName: data.data.name
        itemName: data.data.name,
        itemCols :"1"
      }
      console.log(data);
      const isDuplicate = this.formList.some(item => item.text === data.text);
@@ -1129,6 +1130,7 @@
      this.activeItem = item;
      this.activeItemIndex = index;
      this.form = {...item};
      // this.form.itemCols = "1";
      console.log(item);
      // console.log(item,index);
Source/plt-web/plt-web-ui/src/views/system/user/option.js
@@ -143,7 +143,7 @@
  },
  {
    label: '所属密级',
    prop: 'secretGradeText',
    prop: 'secretGrade',
    width: 100,
    sortable:true,
    type: 'select',
@@ -153,5 +153,8 @@
      value: 'key',
      res: "obj",
    },
    // formatter:(row,value,label)=>{
    //   return row.secretGrade === 0 ? '' : label;
    // }
  },
];