|
@@ -77,7 +77,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
-import { formValidate, getObjValue } from 'js-fast-way'
|
|
|
+import { formValidate, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -183,8 +183,35 @@ const typeObj = {
|
|
|
echart: 'echart',
|
|
|
}
|
|
|
const setDomData = (item) => {
|
|
|
- //formModel.value.name = key
|
|
|
console.log(item)
|
|
|
+ const type = typeObj[item.type]
|
|
|
+ formModel.value = {
|
|
|
+ name: item.text,
|
|
|
+ key: item.key,
|
|
|
+ type: type,
|
|
|
+ }
|
|
|
+ let newArr = []
|
|
|
+ if (type === 'selectBox' || type === 'select' || type === 'radio') {
|
|
|
+ //获取多选相关的数据
|
|
|
+ const dom = item?.zdom?.target
|
|
|
+ const child = dom.querySelectorAll('.hc-table-form-components-box')
|
|
|
+ for (let i = 0; i < child.length; i++) {
|
|
|
+ const val = child[i]?.getAttribute('data-label')
|
|
|
+ newArr.push({ dictValue: val })
|
|
|
+ }
|
|
|
+ } else if (type === 'checkbox') {
|
|
|
+ //获取多选框数据
|
|
|
+ const objs = isNullES(item.objs) ? [] : JSON.parse(item.objs)
|
|
|
+ for (let i = 0; i < objs.length; i++) {
|
|
|
+ newArr.push({ dictValue: objs[i].name })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tableData.value = newArr
|
|
|
+ if (type === 'date') {
|
|
|
+ //日期类型 YYYY年MM月DD日 YYYY-MM-DD HH:mm:ss
|
|
|
+ const format = item.format
|
|
|
+ console.log(format)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//导出函数
|