Browse Source

feat:事件-条件-值-changeType

ananzhusen 1 year ago
parent
commit
3161f57fa6
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/views/components/Conditions.vue

+ 6 - 2
src/views/components/Conditions.vue

@@ -90,7 +90,7 @@
           </div>
           <div v-if="!c.valueType" class="form-item mt-8 form-item-valueType">
             <label>值</label>
-            <t-input v-model="c.value" class="shrink-0" style="width: 320px" />
+            <t-input v-model="c.value" @change="valueChange($event,c)" class="shrink-0" style="width: 320px" />
           </div>
           <template v-else>
             <div class="form-item mt-8">
@@ -153,7 +153,7 @@
 import { onBeforeMount, ref } from 'vue';
 
 import CodeEditor from '@/views/components/common/CodeEditor.vue';
-import { getPenTree, typeOptions } from '@/services/common';
+import { getPenTree, typeOptions, changeType} from '@/services/common';
 
 const penTree: any = ref([]);
 const { data } = defineProps<{
@@ -288,6 +288,10 @@ const operatorOptions = [
   { label: '包含', value: '[)' },
   { label: '不包含', value: '![)' },
 ];
+
+const valueChange = (e,c:any)=>{
+  c.value= changeType(e);
+}
 </script>
 <style lang="postcss" scoped>
 .props {