Browse Source

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 9 months ago
parent
commit
4c8dcba4a9

+ 24 - 1
src/components/FormUI/TextInput/index.vue

@@ -44,12 +44,35 @@ const emit = defineEmits(['update:modelValue', 'change', 'appendClick', 'appendI
 const item = props.item
 const item = props.item
 const value = ref(props.modelValue)
 const value = ref(props.modelValue)
 const searchDebouncedTime = item?.searchDebouncedTime === 0 ? ref(0) : ref(500)
 const searchDebouncedTime = item?.searchDebouncedTime === 0 ? ref(0) : ref(500)
+if (item.type === 'number' && item.integer) searchDebouncedTime.value = 0
+
+const valueDeal = (val) => {
+  let dealData = val
+  if (item.type === 'number') {
+    // if (item.max && val > item.max) {
+    //   dealData = (item.max - 0)
+    //   Snackbar.warning(`最大可输入${item.max}`)
+    // }
+    // if (item.min && val < item.min) {
+    //   dealData = (item.min - 0)
+    //   Snackbar.warning(`最小可输入${item.max}`)
+    // }
+    if (item.integer) { // 为true时只能输入整型
+      dealData = val.replace(/\D/g,'') - 0
+    }
+  }
+  return dealData
+}
 
 
 watch(() => props.modelValue, (newVal) => {
 watch(() => props.modelValue, (newVal) => {
-  value.value = newVal
+  const dealData = valueDeal(newVal)
+  value.value = dealData
 })
 })
+
 const modelValueUpDate = (val) => {
 const modelValueUpDate = (val) => {
   value.value = val
   value.value = val
+  console.log('1', value.value)
+  console.log('modelValueUpDate val', val)
   emit('update:modelValue', value.value)
   emit('update:modelValue', value.value)
   debouncedCallbackUpDate(value.value) // emit('change', value.value)
   debouncedCallbackUpDate(value.value) // emit('change', value.value)
 }
 }

+ 2 - 3
src/components/FormUI/nestedListGroup/components/listGroup.vue

@@ -28,7 +28,6 @@
           :option="option"
           :option="option"
           :selectValue="propsData.selectValue"
           :selectValue="propsData.selectValue"
           :levelUI="propsData.levelUI + 1"
           :levelUI="propsData.levelUI + 1"
-          @labelUpdate="labelTxt => emit('labelUpdate', labelTxt)"
           @clickUpdate="child => clickUpdate(val, child)"
           @clickUpdate="child => clickUpdate(val, child)"
         ></listGroup>
         ></listGroup>
       </v-list-group>
       </v-list-group>
@@ -40,7 +39,7 @@
 // import listGroup from './listGroup'
 // import listGroup from './listGroup'
 // import { ref } from 'vue'
 // import { ref } from 'vue'
 defineOptions({ name:'nestedListGroup-listGroup'})
 defineOptions({ name:'nestedListGroup-listGroup'})
-const emit = defineEmits(['clickUpdate', 'parentActUpdate', 'labelUpdate'])
+const emit = defineEmits(['clickUpdate', 'parentActUpdate'])
 const propsData = defineProps({
 const propsData = defineProps({
   list: Array,
   list: Array,
   levelUI: {
   levelUI: {
@@ -78,7 +77,7 @@ const activeCalc = (val) => {
   else {
   else {
     const bool = (val[option.itemValue] - 0) === (propsData.selectValue -0)
     const bool = (val[option.itemValue] - 0) === (propsData.selectValue -0)
     if (bool) {
     if (bool) {
-      emit('labelUpdate', val[option.itemText]) // 回显
+      // emit('labelUpdate', val[option.itemText]) // 回显
     }
     }
     return bool
     return bool
   }
   }

+ 16 - 11
src/components/FormUI/nestedListGroup/index.vue

@@ -28,7 +28,7 @@
       @update:modelValue="modelValueUpDate"
       @update:modelValue="modelValueUpDate"
     >
     >
     </v-text-field>
     </v-text-field>
-    <v-menu activator="#menu-activator" :close-on-content-click="closeOnContentClick" >
+    <v-menu activator="#menu-activator" :close-on-content-click="closeOnContentClick">
       <listGroup
       <listGroup
         :list="item.items"
         :list="item.items"
         :option="option"
         :option="option"
@@ -64,22 +64,27 @@ const modelValueUpDate = () => {
 let static_selectLabel = ''; const model_selectLabel = ref('')
 let static_selectLabel = ''; const model_selectLabel = ref('')
 const value = ref(propsData.modelValue) // selectValue // modelValue
 const value = ref(propsData.modelValue) // selectValue // modelValue
 const clickUpdate = (val) => {
 const clickUpdate = (val) => {
-  static_selectLabel = model_selectLabel.value = val[option.itemText]
-  value.value = val[option.itemValue]
+  static_selectLabel = model_selectLabel.value = val[option.itemText || 'label']
+  value.value = val[option.itemValue || 'value']
   emit('update:modelValue', value.value)
   emit('update:modelValue', value.value)
   emit('change', value.value)
   emit('change', value.value)
 }
 }
 const closeOnContentClick = ref(false) // multiple
 const closeOnContentClick = ref(false) // multiple
 
 
-const labelUpdateDeal = (txt) => {
-  static_selectLabel = model_selectLabel.value = txt
+// 回显label
+const chosen = ref(null)
+const traverse = (nodes) => {
+  for (const node of nodes) {
+    if (node[option.itemValue || value] === value.value) {
+      chosen.value = node
+    }
+    if (node.children) {
+      traverse(node.children)
+    }
+  }
 }
 }
-
-// // 回显label
-// if (item?.items?.length) {
-//   const options = item.items
-
-// }
+if (item?.items?.length && value.value) traverse(item.items)
+if (chosen.value) clickUpdate(chosen.value)
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .showOnTop {
 .showOnTop {

+ 1 - 1
src/utils/position.js

@@ -93,6 +93,6 @@ getRation()
 export const commissionCalculation = (count, type) => {
 export const commissionCalculation = (count, type) => {
   if (!data || !Object.keys(data).length) return
   if (!data || !Object.keys(data).length) return
   const ratio = parseFloat(data[list[type]]) / 100
   const ratio = parseFloat(data[list[type]]) / 100
-  const value = count * ratio
+  const value = (count * ratio)/100 // 后端需要除100
   return value % 1 === 0 ? Math.floor(value) : value.toFixed(2)
   return value % 1 === 0 ? Math.floor(value) : value.toFixed(2)
 }
 }

+ 2 - 0
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -134,6 +134,7 @@ const items = ref({
       value: null,
       value: null,
       label: '请填写众聘赏金',
       label: '请填写众聘赏金',
       suffix: '元',
       suffix: '元',
+      integer: true,
       hide: true,
       hide: true,
       show: true,
       show: true,
       disabled: false,
       disabled: false,
@@ -286,6 +287,7 @@ const getQuery = async () => {
     // obj.hirePoint = 0
     // obj.hirePoint = 0
     obj.hirePrice = 0
     obj.hirePrice = 0
   }
   }
+  obj.hirePrice = (obj.hirePrice - 0)*100 // 后端需要
   query = Object.assign(query, obj)
   query = Object.assign(query, obj)
   return query
   return query
 }
 }