From 57c746aa1c682d96465b3fe5d2f95eeb1ed2c4c1 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 09 七月 2025 19:54:01 +0800
Subject: [PATCH] art: 技术状态鉴定-基础代码生成

---
 src/components/jeecgbiz/JSelectBaseFactory.vue |  183 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/src/components/jeecgbiz/JSelectBaseFactory.vue b/src/components/jeecgbiz/JSelectBaseFactory.vue
new file mode 100644
index 0000000..22df2a6
--- /dev/null
+++ b/src/components/jeecgbiz/JSelectBaseFactory.vue
@@ -0,0 +1,183 @@
+<template>
+  <div class="components-input-demo-presuffix">
+    <!---->
+    <a-input @click="openModal" placeholder="璇风偣鍑婚�夋嫨EAM涓績" v-model="textVals" readOnly :disabled="disabled">
+      <a-icon slot="prefix" type="cluster" title="EAM涓績閫夋嫨鎺т欢"/>
+      <a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="娓呯┖"/>
+    </a-input>
+    <JSelectBaseFactoryModal
+      ref="innerBaseFactorySelectModal"
+      :modal-width="modalWidth"
+      :multi="multi"
+      :rootOpened="rootOpened"
+      :BaseFactoryId="value"
+      :store="storeField"
+      :text="textField"
+      :treeBaseFactory="treeBaseFactory"
+      @ok="handleOK"
+      @initComp="initComp">
+
+    </JSelectBaseFactoryModal>
+  </div>
+</template>
+
+<script>
+  import JSelectBaseFactoryModal from './modal/JSelectBaseFactoryModal'
+  import { underLinetoHump } from '@/components/_util/StringUtil'
+  export default {
+    name: 'JSelectBaseFactory',
+    components:{
+      JSelectBaseFactoryModal
+    },
+    props:{
+      modalWidth:{
+        type:Number,
+        default:500,
+        required:false
+      },
+      multi:{
+        type:Boolean,
+        default:false,
+        required:false
+      },
+      rootOpened:{
+        type:Boolean,
+        default:true,
+        required:false
+      },
+      value:{
+        type:String,
+        required:false
+      },
+      disabled:{
+        type: Boolean,
+        required: false,
+        default: false
+      },
+      // 鑷畾涔夎繑鍥炲瓧娈碉紝榛樿杩斿洖 id
+      customReturnField: {
+        type: String,
+        default: ''
+      },
+      backBaseFactory: {
+        type: Boolean,
+        default: false,
+        required: false
+      },
+      // 瀛樺偍瀛楁 [key field]
+      store: {
+        type: String,
+        default: 'id',
+        required: false
+      },
+      // 鏄剧ず瀛楁 [label field]
+      text: {
+        type: String,
+        default: 'factoryName',
+        required: false
+      },
+      treeBaseFactory: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+
+    },
+    data(){
+      return {
+        visible:false,
+        confirmLoading:false,
+        storeVals: '', //[key values]
+        textVals: '' //[label values]
+      }
+    },
+    computed:{
+      storeField(){
+        let field = this.customReturnField
+        if(!field){
+          field = this.store;
+        }
+        return underLinetoHump(field)
+      },
+      textField(){
+        return underLinetoHump(this.text)
+      }
+    },
+    mounted(){
+      this.storeVals = this.value
+    },
+    watch:{
+      value(val){
+        this.storeVals = val
+      }
+    },
+    methods:{
+      initComp(textVals){
+        this.textVals = textVals
+      },
+      //杩斿洖閫変腑鐨勮溅闂翠俊鎭�
+      backBaseFactoryInfo(){
+        if(this.backBaseFactory===true){
+          //LOWCOD-2147 銆愮敤鎴风鐞嗐�戦�夋嫨閮ㄩ棬鍜屼笂绾т互鍚庯紝璐熻矗閮ㄩ棬娌℃湁鏁版嵁鍙�� (闄剁値鏀归�犺嚜瀹氫箟杩斿洖瀛楁瀵艰嚧)
+          if(this.storeVals && this.storeVals.length>0){
+            let arr1 = this.storeVals.split(',')
+            let arr2 = this.textVals.split(',')
+            let info = []
+            for(let i=0;i<arr1.length;i++){
+              info.push({
+                value: arr1[i],
+                text: arr2[i]
+              })
+            }
+            this.$emit('back', info)
+          }
+        }
+      },
+      openModal(){
+        this.$refs.innerBaseFactorySelectModal.show()
+      },
+      handleOK(rows) {
+        if (!rows && rows.length <= 0) {
+          this.textVals = ''
+          this.storeVals = ''
+        } else {
+          let arr1 = []
+          let arr2 = []
+          for(let dep of rows){
+            arr1.push(dep[this.storeField])
+            arr2.push(dep[this.textField])
+          }
+          this.storeVals = arr1.join(',')
+          this.textVals = arr2.join(',')
+        }
+        this.$emit("change", this.storeVals)
+        this.backBaseFactoryInfo()
+      },
+      getBaseFactoryNames(){
+        return this.departNames
+      },
+      handleEmpty(){
+        this.handleOK('')
+      }
+    },
+    model: {
+      prop: 'value',
+      event: 'change'
+    }
+  }
+</script>
+
+<style scoped>
+  .components-input-demo-presuffix .anticon-close-circle {
+    cursor: pointer;
+    color: #ccc;
+    transition: color 0.3s;
+    font-size: 12px;
+  }
+  .components-input-demo-presuffix .anticon-close-circle:hover {
+    color: #f5222d;
+  }
+  .components-input-demo-presuffix .anticon-close-circle:active {
+    color: #666;
+  }
+</style>
\ No newline at end of file

--
Gitblit v1.9.3