|
@@ -2,14 +2,19 @@
|
|
|
<div
|
|
|
:id="id" class="hc-table-form-components-box" :data-key="keyname" :data-index="`${trindex}_${tdindex}`"
|
|
|
:data-x1="x1" :data-x2="x2" :data-y1="y1" :data-y2="y2" :data-tr="trindex" :data-td="tdindex" :data-name="name"
|
|
|
- :data-text="placeholder" :data-type="type" :data-rows="rows" :data-format="valueFormat"
|
|
|
+ :data-text="placeholder" :data-type="type" :data-rows="rows" :data-format="valueFormat" :data-weighing="weighing"
|
|
|
+ :data-label="label" :data-value="value" :data-src="src" :data-val="val" :data-contractid="contractid" :data-pkeyid="pkeyid"
|
|
|
+ :data-objs="objsData"
|
|
|
>
|
|
|
- {{ name }}
|
|
|
+ {{ name || placeholder }}
|
|
|
+ <div v-if="isSlots" style="display: none">
|
|
|
+ <slot />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
+import { getCurrentInstance, onMounted, ref, useSlots } from 'vue'
|
|
|
import { isNullES } from 'js-fast-way'
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -26,10 +31,27 @@ const props = defineProps({
|
|
|
valueFormat: [String, Number],
|
|
|
keyname: [String, Number],
|
|
|
id: [String, Number],
|
|
|
+ label: [String, Number],
|
|
|
+ value: [String, Number],
|
|
|
+ weighing: [String, Number],
|
|
|
+ src: [String, Number],
|
|
|
+ val: [String, Number],
|
|
|
+ contractid: [String, Number],
|
|
|
+ pkeyid: [String, Number],
|
|
|
+ objs: Array,
|
|
|
})
|
|
|
|
|
|
+const instance = getCurrentInstance()
|
|
|
+const objsData = ref('')
|
|
|
+
|
|
|
//渲染完成
|
|
|
onMounted(()=> {
|
|
|
+ if (isNullES(props.type)) {
|
|
|
+ //console.log(instance)
|
|
|
+ }
|
|
|
+ if (!isNullES(props.objs)) {
|
|
|
+ objsData.value = JSON.stringify(props.objs)
|
|
|
+ }
|
|
|
matchingType()
|
|
|
})
|
|
|
|
|
@@ -39,11 +61,18 @@ const typeObj = {
|
|
|
text: '输入框',
|
|
|
textarea: '多行输入框',
|
|
|
date: '日期框',
|
|
|
+ datetimerange: '日期时间范围框',
|
|
|
+ dap_site_data: '远程搜索框',
|
|
|
+ strength_search: '设计强度搜索框',
|
|
|
}
|
|
|
const matchingType = () => {
|
|
|
if (isNullES(props.type)) return
|
|
|
name.value = typeObj[props.type]
|
|
|
}
|
|
|
+
|
|
|
+//判断插槽是否有内容
|
|
|
+const slots = useSlots()
|
|
|
+const isSlots = !!slots.default
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|