fix: 去除没有必要的v-model、处理部分双向绑定问题
This commit is contained in:
@@ -66,11 +66,7 @@ export default defineComponent({
|
|||||||
>
|
>
|
||||||
<Form ref={formRef} layout="vertical" model={formData} class={styles.form} requiredMark>
|
<Form ref={formRef} layout="vertical" model={formData} class={styles.form} requiredMark>
|
||||||
<Form.Item label="新密码" name="newPassword" rules={newPasswordRules}>
|
<Form.Item label="新密码" name="newPassword" rules={newPasswordRules}>
|
||||||
<Input.Password
|
<Input.Password placeholder="至少8位,含字母+数字" allowClear />
|
||||||
placeholder="至少8位,含字母+数字"
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.newPassword}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -78,11 +74,7 @@ export default defineComponent({
|
|||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
rules={confirmNewPasswordRules(() => formData.newPassword)}
|
rules={confirmNewPasswordRules(() => formData.newPassword)}
|
||||||
>
|
>
|
||||||
<Input.Password
|
<Input.Password placeholder="再次输入新密码" allowClear />
|
||||||
placeholder="再次输入新密码"
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.confirmPassword}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<div class={styles.tip}>{TIPS_TEXT}</div>
|
<div class={styles.tip}>{TIPS_TEXT}</div>
|
||||||
|
|||||||
@@ -479,12 +479,7 @@ export default defineComponent({
|
|||||||
>
|
>
|
||||||
{/* ===== Banner 标题 ===== */}
|
{/* ===== Banner 标题 ===== */}
|
||||||
<Form.Item label="Banner标题" name="title" rules={titleRules}>
|
<Form.Item label="Banner标题" name="title" rules={titleRules}>
|
||||||
<Input
|
<Input placeholder="请输入标题" maxlength={TITLE_MAX} allowClear />
|
||||||
placeholder="请输入标题"
|
|
||||||
maxlength={TITLE_MAX}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.title}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
{/* ===== 上传图片(必填,带裁剪) ===== */}
|
{/* ===== 上传图片(必填,带裁剪) ===== */}
|
||||||
@@ -540,18 +535,13 @@ export default defineComponent({
|
|||||||
|
|
||||||
{/* ===== 跳转类型 ===== */}
|
{/* ===== 跳转类型 ===== */}
|
||||||
<Form.Item label="跳转类型" name="type" rules={typeRules}>
|
<Form.Item label="跳转类型" name="type" rules={typeRules}>
|
||||||
<Select
|
<Select options={JUMP_TYPE_OPTIONS as any} placeholder="请选择" />
|
||||||
options={JUMP_TYPE_OPTIONS as any}
|
|
||||||
placeholder="请选择"
|
|
||||||
v-model:value={formData.type}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
{/* ===== 联动字段:赛事详情页 → 模糊搜索关联赛事 ===== */}
|
{/* ===== 联动字段:赛事详情页 → 模糊搜索关联赛事 ===== */}
|
||||||
{formData.type === '1' && (
|
{formData.type === '1' && (
|
||||||
<Form.Item label="关联赛事" name="relatedEventId">
|
<Form.Item label="关联赛事" name="relatedEventId">
|
||||||
<Select
|
<Select
|
||||||
v-model:value={formData.relatedEventId}
|
|
||||||
showSearch
|
showSearch
|
||||||
filterOption={false}
|
filterOption={false}
|
||||||
allowClear={!eventSearchLoading.value}
|
allowClear={!eventSearchLoading.value}
|
||||||
@@ -571,24 +561,14 @@ export default defineComponent({
|
|||||||
{/* ===== 联动字段:自定义链接 ===== */}
|
{/* ===== 联动字段:自定义链接 ===== */}
|
||||||
{formData.type === '2' && (
|
{formData.type === '2' && (
|
||||||
<Form.Item label="跳转地址" name="linkUrl" rules={linkUrlRules}>
|
<Form.Item label="跳转地址" name="linkUrl" rules={linkUrlRules}>
|
||||||
<Input
|
<Input placeholder="https://xxx" maxlength={URL_MAX} allowClear />
|
||||||
placeholder="https://xxx"
|
|
||||||
maxlength={URL_MAX}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.linkUrl}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* ===== 联动字段:小程序页面 ===== */}
|
{/* ===== 联动字段:小程序页面 ===== */}
|
||||||
{formData.type === '3' && (
|
{formData.type === '3' && (
|
||||||
<Form.Item label="小程序路径" name="linkUrl" rules={miniProgramPathRules}>
|
<Form.Item label="小程序路径" name="linkUrl" rules={miniProgramPathRules}>
|
||||||
<Input
|
<Input placeholder="/pages/index/index" maxlength={PATH_MAX} allowClear />
|
||||||
placeholder="/pages/index/index"
|
|
||||||
maxlength={PATH_MAX}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.linkUrl}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -672,7 +652,6 @@ export default defineComponent({
|
|||||||
max={999}
|
max={999}
|
||||||
precision={0}
|
precision={0}
|
||||||
style={{ width: '200px' }}
|
style={{ width: '200px' }}
|
||||||
v-model:value={formData.sort}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default defineComponent({
|
|||||||
{d.dropoutCount || '0'}
|
{d.dropoutCount || '0'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|
||||||
<Descriptions.Item label="最大人数">{d.dtotalLimit || '-'}</Descriptions.Item>
|
<Descriptions.Item label="最大人数">{d.totalLimit || '-'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="对岸数量">{d.matchTotalCount || '0'}</Descriptions.Item>
|
<Descriptions.Item label="对岸数量">{d.matchTotalCount || '0'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="已完成对岸数量">{d.matchCount || '0'}</Descriptions.Item>
|
<Descriptions.Item label="已完成对岸数量">{d.matchCount || '0'}</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="用户昵称" name="nickname">
|
<Form.Item label="用户昵称" name="nickname">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.nickname}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '180px' }}
|
style={{ width: '180px' }}
|
||||||
allowClear
|
allowClear
|
||||||
@@ -47,7 +46,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="手机号" name="phone">
|
<Form.Item label="手机号" name="phone">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.phone}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '180px' }}
|
style={{ width: '180px' }}
|
||||||
allowClear
|
allowClear
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ export default defineComponent({
|
|||||||
<Form style={{ rowGap: '10px' }} layout="inline" model={filterForm}>
|
<Form style={{ rowGap: '10px' }} layout="inline" model={filterForm}>
|
||||||
<Form.Item label="用户昵称" name="nickname">
|
<Form.Item label="用户昵称" name="nickname">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.nickname}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '180px' }}
|
style={{ width: '180px' }}
|
||||||
allowClear
|
allowClear
|
||||||
@@ -141,7 +140,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="手机号" name="phone">
|
<Form.Item label="手机号" name="phone">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.phone}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '180px' }}
|
style={{ width: '180px' }}
|
||||||
allowClear
|
allowClear
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ export default defineComponent({
|
|||||||
<Form style={{ rowGap: '10px' }} layout="inline" model={filterForm}>
|
<Form style={{ rowGap: '10px' }} layout="inline" model={filterForm}>
|
||||||
<Form.Item label="申请人昵称" name="nickname">
|
<Form.Item label="申请人昵称" name="nickname">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.nickname}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '160px' }}
|
style={{ width: '160px' }}
|
||||||
allowClear
|
allowClear
|
||||||
@@ -103,7 +102,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="手机号" name="phone">
|
<Form.Item label="手机号" name="phone">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.phone}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '160px' }}
|
style={{ width: '160px' }}
|
||||||
allowClear
|
allowClear
|
||||||
@@ -112,7 +110,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="真实姓名" name="realName">
|
<Form.Item label="真实姓名" name="realName">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.realName}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '160px' }}
|
style={{ width: '160px' }}
|
||||||
allowClear
|
allowClear
|
||||||
|
|||||||
@@ -216,7 +216,8 @@ export default defineComponent({
|
|||||||
>
|
>
|
||||||
<FormItem name="phone">
|
<FormItem name="phone">
|
||||||
<Input
|
<Input
|
||||||
v-model={[form.phone, 'value']}
|
value={form.phone}
|
||||||
|
onUpdate:value={(val: string) => (form.phone = val)}
|
||||||
placeholder="请输入用户名"
|
placeholder="请输入用户名"
|
||||||
size="large"
|
size="large"
|
||||||
v-slots={{ prefix: () => <UserOutlined /> }}
|
v-slots={{ prefix: () => <UserOutlined /> }}
|
||||||
@@ -224,7 +225,8 @@ export default defineComponent({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem name="password">
|
<FormItem name="password">
|
||||||
<Input
|
<Input
|
||||||
v-model={[form.password, 'value']}
|
value={form.password}
|
||||||
|
onUpdate:value={(val: string) => (form.password = val)}
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="请输入密码"
|
placeholder="请输入密码"
|
||||||
size="large"
|
size="large"
|
||||||
@@ -234,7 +236,12 @@ export default defineComponent({
|
|||||||
|
|
||||||
{/* 记住密码 */}
|
{/* 记住密码 */}
|
||||||
<div class={styles.rememberRow}>
|
<div class={styles.rememberRow}>
|
||||||
<Checkbox v-model={[rememberMe.value, 'checked']}>记住密码</Checkbox>
|
<Checkbox
|
||||||
|
checked={rememberMe.value}
|
||||||
|
onUpdate:checked={(val: boolean) => setRememberMe(val)}
|
||||||
|
>
|
||||||
|
记住密码
|
||||||
|
</Checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormItem>
|
<FormItem>
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="操作人" name="searchOperator">
|
<Form.Item label="操作人" name="searchOperator">
|
||||||
<Input
|
<Input
|
||||||
v-model:value={filterForm.searchOperator}
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '160px' }}
|
style={{ width: '160px' }}
|
||||||
allowClear
|
allowClear
|
||||||
|
|||||||
@@ -141,12 +141,7 @@ export default defineComponent({
|
|||||||
<Form ref={formRef} layout="vertical" model={formData} class={styles.form} requiredMark>
|
<Form ref={formRef} layout="vertical" model={formData} class={styles.form} requiredMark>
|
||||||
{/* 角色名称 */}
|
{/* 角色名称 */}
|
||||||
<Form.Item label="角色名称" name="roleName" rules={roleNameRules}>
|
<Form.Item label="角色名称" name="roleName" rules={roleNameRules}>
|
||||||
<Input
|
<Input placeholder="请输入" maxlength={20} allowClear />
|
||||||
placeholder="请输入"
|
|
||||||
maxlength={20}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.roleName}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
{/* 菜单权限配置 */}
|
{/* 菜单权限配置 */}
|
||||||
|
|||||||
@@ -234,20 +234,10 @@ export default defineComponent({
|
|||||||
{/* 姓名 / 手机号:同一行 */}
|
{/* 姓名 / 手机号:同一行 */}
|
||||||
<div class={styles.row}>
|
<div class={styles.row}>
|
||||||
<Form.Item label="姓名" name="realName" rules={realNameRules} class={styles.col}>
|
<Form.Item label="姓名" name="realName" rules={realNameRules} class={styles.col}>
|
||||||
<Input
|
<Input placeholder="真实姓名" maxlength={8} allowClear />
|
||||||
placeholder="真实姓名"
|
|
||||||
maxlength={8}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.realName}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="手机号" name="phone" rules={phoneRules} class={styles.col}>
|
<Form.Item label="手机号" name="phone" rules={phoneRules} class={styles.col}>
|
||||||
<Input
|
<Input placeholder="11位手机号" maxlength={11} allowClear />
|
||||||
placeholder="11位手机号"
|
|
||||||
maxlength={11}
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.phone}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -268,7 +258,6 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="角色" name="roleId" rules={roleRules} class={styles.col}>
|
<Form.Item label="角色" name="roleId" rules={roleRules} class={styles.col}>
|
||||||
<Select
|
<Select
|
||||||
v-model:value={formData.roleId}
|
|
||||||
showSearch
|
showSearch
|
||||||
filterOption={false}
|
filterOption={false}
|
||||||
allowClear={!roleSearchLoading.value}
|
allowClear={!roleSearchLoading.value}
|
||||||
@@ -297,7 +286,6 @@ export default defineComponent({
|
|||||||
<Input.Password
|
<Input.Password
|
||||||
placeholder={isEdit ? '请输入新密码' : '至少8位,含字母+数字'}
|
placeholder={isEdit ? '请输入新密码' : '至少8位,含字母+数字'}
|
||||||
allowClear
|
allowClear
|
||||||
v-model:value={formData.password}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -306,17 +294,12 @@ export default defineComponent({
|
|||||||
class={styles.col}
|
class={styles.col}
|
||||||
rules={confirmPasswordRules(() => formData.password)}
|
rules={confirmPasswordRules(() => formData.password)}
|
||||||
>
|
>
|
||||||
<Input.Password
|
<Input.Password placeholder="再次输入密码" allowClear />
|
||||||
placeholder="再次输入密码"
|
|
||||||
allowClear
|
|
||||||
v-model:value={formData.confirmPassword}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
{/* 角色:单独一行 */}
|
{/* 角色:单独一行 */}
|
||||||
<Form.Item label="角色" name="roleId" rules={roleRules}>
|
<Form.Item label="角色" name="roleId" rules={roleRules}>
|
||||||
<Select
|
<Select
|
||||||
v-model:value={formData.roleId}
|
|
||||||
showSearch
|
showSearch
|
||||||
filterOption={false}
|
filterOption={false}
|
||||||
allowClear={!roleSearchLoading.value}
|
allowClear={!roleSearchLoading.value}
|
||||||
|
|||||||
Reference in New Issue
Block a user