|
@@ -22,17 +22,17 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="item.label" v-if="item.type === 'dict'" :prop="item.prop">
|
|
|
<el-select v-model="formInline[item.prop]" :placeholder="'请选择' + item.label" clearable>
|
|
|
- <el-option v-for="dict in item.dict" :key="dict.value"
|
|
|
- :label="dict.label" :value="dict.value"></el-option>
|
|
|
+ <el-option v-for="dict in item.dict" :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<!-- 联动选择框 -->
|
|
|
- <el-form-item :label="item.label" v-if="item.type === 'cascader' " :prop="item.prop">
|
|
|
+ <el-form-item :label="item.label" v-if="item.type === 'cascader'" :prop="item.prop">
|
|
|
<el-cascader v-model="formInline[item.prop]" :options="item.options || []" style="width: 100%;"
|
|
|
:props="item.props" />
|
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
+
|
|
|
</template>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
@@ -41,9 +41,8 @@
|
|
|
</el-form>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5" v-for="item in searchBtns" :key="item.key">
|
|
|
- <el-button :type="item.type || 'primary'" plain :icon="item.icon" @click="()=>item.func(formInline)"
|
|
|
- v-if="item.show?item.show() :true"
|
|
|
- >{{ item.label }}</el-button>
|
|
|
+ <el-button :type="item.type || 'primary'" plain :icon="item.icon" @click="() => item.func(formInline)"
|
|
|
+ v-if="item.show ? item.show() : true">{{ item.label }}</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -78,28 +77,33 @@ const searchRef = ref(null);
|
|
|
const dictionaryOptions = reactive({})
|
|
|
|
|
|
const handlerFormData = () => {
|
|
|
- const array = props.column;
|
|
|
- const parmas = {}
|
|
|
- for (let i = 0; i < array.length; i++) {
|
|
|
- const element = array[i];
|
|
|
- if (element.type === 'date' && formInline[element.prop].length>0) {
|
|
|
- parmas[element.keys[0]] = formInline[element.prop][0];
|
|
|
- parmas[element.keys[1]] = formInline[element.prop][1];
|
|
|
- } else if (formInline[element.prop]) {
|
|
|
- if(element.prop === 'businessManagementId'){
|
|
|
- console.log('formInline[element.prop]',formInline[element.prop]);
|
|
|
- parmas[element.prop] = formInline[element.prop][formInline[element.prop].length-1];
|
|
|
- }else{
|
|
|
- parmas[element.prop] = formInline[element.prop];
|
|
|
- }
|
|
|
+ try {
|
|
|
+ const array = props.column;
|
|
|
+ const parmas = {}
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
+ const element = array[i];
|
|
|
+ if (element.type === 'date' && formInline[element.prop].length > 0) {
|
|
|
+ parmas[element.keys[0]] = formInline[element.prop][0];
|
|
|
+ parmas[element.keys[1]] = formInline[element.prop][1];
|
|
|
+ } else if (formInline[element.prop]) {
|
|
|
+ if (element.prop === 'businessManagementId') {
|
|
|
+ console.log('formInline[element.prop]', formInline[element.prop]);
|
|
|
+ parmas[element.prop] = formInline[element.prop][formInline[element.prop].length - 1];
|
|
|
+ } else {
|
|
|
+ parmas[element.prop] = formInline[element.prop];
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+ return parmas
|
|
|
+ } catch (error) {
|
|
|
+ console.log("TCL: handlerFormData -> error", error)
|
|
|
+
|
|
|
}
|
|
|
- return parmas
|
|
|
}
|
|
|
const handleQuery = () => {
|
|
|
const parmas = handlerFormData();
|
|
|
- console.log('parmas',parmas);
|
|
|
+ console.log('parmas', parmas);
|
|
|
emit('submit', parmas)
|
|
|
}
|
|
|
const resetForm = () => {
|
|
@@ -116,9 +120,9 @@ const handleInit = () => {
|
|
|
return item.dictionary;
|
|
|
}
|
|
|
}).filter(Boolean);
|
|
|
-
|
|
|
-
|
|
|
- if(keys && keys.length > 0){
|
|
|
+
|
|
|
+
|
|
|
+ if (keys && keys.length > 0) {
|
|
|
const res = proxy.useDict(keys);
|
|
|
Object.assign(dictionaryOptions, res)
|
|
|
}
|
|
@@ -147,5 +151,4 @@ onMounted(() => {
|
|
|
.demo-form-inline .el-select {
|
|
|
--el-select-width: 220px;
|
|
|
}
|
|
|
-
|
|
|
</style>
|