|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="d-flex flex-column bg-base">
|
|
|
+ <view class="d-flex flex-column bg-base p-3">
|
|
|
<u-loading-page :loading="loading" />
|
|
|
<SimpleDynamicFormUni
|
|
|
ref="formRef"
|
|
@@ -17,9 +17,8 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import ContributeApi, { ContributeItem } from '@/api/user/ContributeApi';
|
|
|
-import CheckUtils from '@/common/utils/CheckUtils';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
-import { ref } from 'vue';
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
import type { FormDefine, FormExport } from '@/common/components/form';
|
|
|
import type { DynamicSelectProps } from '@/common/components/form/components/DynamicSelect.vue';
|
|
|
import SimpleDynamicFormUni from '@/common/components/form/SimpleDynamicFormUni.vue';
|
|
@@ -39,86 +38,58 @@ const formDefine : FormDefine = {
|
|
|
propNestType: 'nest',
|
|
|
items: [
|
|
|
{
|
|
|
- label: '认领村庄',
|
|
|
- name: 'village_id',
|
|
|
+ label: '栏目',
|
|
|
+ name: 'mainBodyColumnId',
|
|
|
type: 'dynamic-select',
|
|
|
params: {
|
|
|
- loadData: async () =>
|
|
|
- (await ContributeApi.getCanClaimVallageList())
|
|
|
- .map((p) => ({
|
|
|
- value: p.id,
|
|
|
- text: p.villageName,
|
|
|
- }))
|
|
|
- ,
|
|
|
+ loadData: async () => {
|
|
|
+ /* (await ContributeApi.getCanClaimVallageList())
|
|
|
+ .map((p) => ({
|
|
|
+ value: p.id,
|
|
|
+ text: p.villageName,
|
|
|
+ })) */
|
|
|
+ return []
|
|
|
+ },
|
|
|
} as DynamicSelectProps,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- errorMessage: '请选择要认领的村庄',
|
|
|
+ errorMessage: '请选择投稿栏目',
|
|
|
}],
|
|
|
+ onChange: (_, value, model) => {
|
|
|
+ //model.
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- label: '姓名',
|
|
|
- name: 'name',
|
|
|
+ label: '文章标题',
|
|
|
+ name: 'title',
|
|
|
type: 'text',
|
|
|
defaultValue: '',
|
|
|
params: {
|
|
|
- placeholder: '请输入姓名',
|
|
|
+ placeholder: '请输入文章标题',
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- errorMessage: '请输入姓名',
|
|
|
+ errorMessage: '请输入文章标题',
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: '性别',
|
|
|
- name: 'sex',
|
|
|
+ label: '内容类型',
|
|
|
+ name: 'type',
|
|
|
type: 'select',
|
|
|
params: {
|
|
|
+ disabled: true,
|
|
|
localdata: [
|
|
|
- { value: 1, text: "男" },
|
|
|
- { value: 2, text: "女" },
|
|
|
- { value: 3, text: "不透露" },
|
|
|
+ { value: 1, text: "文章" },
|
|
|
+ { value: 2, text: "音频" },
|
|
|
+ { value: 3, text: "视频" },
|
|
|
+ { value: 4, text: "相册" },
|
|
|
],
|
|
|
clear: false,
|
|
|
},
|
|
|
+ defaultValue: 1,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- errorMessage: '请选择性别',
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '联系方式',
|
|
|
- name: 'mobile',
|
|
|
- type: 'text',
|
|
|
- defaultValue: '',
|
|
|
- params: {
|
|
|
- placeholder: '请输入联系方式',
|
|
|
- },
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请输入手机号',
|
|
|
- },{
|
|
|
- required: true,
|
|
|
- validateFunction: (rule: any, value: any,data: any,callback: (e: any) => void) => {
|
|
|
- if (!CheckUtils.checkIsChinesePhoneNumber(value)) {
|
|
|
- callback('手机号格式不正确')
|
|
|
- return false
|
|
|
- }
|
|
|
- return true
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '地址',
|
|
|
- name: 'address',
|
|
|
- type: 'text',
|
|
|
- defaultValue: '',
|
|
|
- params: {
|
|
|
- placeholder: '请输入地址',
|
|
|
- },
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请输入地址',
|
|
|
+ errorMessage: '请选择类型',
|
|
|
}]
|
|
|
},
|
|
|
]
|
|
@@ -134,16 +105,17 @@ const formDefine : FormDefine = {
|
|
|
propNestType: 'nest',
|
|
|
items: [
|
|
|
{
|
|
|
- label: '申请理由',
|
|
|
- name: 'claim_reason',
|
|
|
- type: 'textarea',
|
|
|
+ label: '内容',
|
|
|
+ name: 'intro',
|
|
|
+ type: 'richtext',
|
|
|
defaultValue: '',
|
|
|
params: {
|
|
|
- placeholder: '请输入申请理由',
|
|
|
+ placeholder: '请输入内容',
|
|
|
+ saveTempKey: 'contribute',
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- errorMessage: '请输入申请理由',
|
|
|
+ errorMessage: '请输入内容',
|
|
|
}]
|
|
|
}
|
|
|
]
|
|
@@ -175,6 +147,11 @@ async function submit() {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|