Commit 57b2d28e authored by wanli's avatar wanli

(): 新增一个表单模板

parent 188b6189
...@@ -208,6 +208,7 @@ const router = new Router({ ...@@ -208,6 +208,7 @@ const router = new Router({
}, },
{ {
path: "/device/form", path: "/device/form",
name: "DeviceForm",
component: () => import("@/views/Application/DeviceForm"), component: () => import("@/views/Application/DeviceForm"),
}, },
], ],
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</a-form> </a-form>
</div> </div>
<div class="tableListOperator"> <div class="tableListOperator">
<a-button icon="plus" type="primary"> 新建 </a-button> <a-button icon="plus" type="primary" @click="onAdd"> 新建 </a-button>
<span v-show="selectedRowKeys.length > 0"> <span v-show="selectedRowKeys.length > 0">
<a-button>批量操作</a-button> <a-button>批量操作</a-button>
<!-- <a-dropdown overlay={menu}> <!-- <a-dropdown overlay={menu}>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a href="javascript:;">查看</a> <a href="javascript:;">查看</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a href="javascript:;">配置</a> <a href="javascript:;">编辑</a>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -221,6 +221,9 @@ export default { ...@@ -221,6 +221,9 @@ export default {
ARangePicker: DatePicker.RangePicker, ARangePicker: DatePicker.RangePicker,
}, },
methods: { methods: {
onAdd() {
this.$router.push({ name: "DeviceForm", params: {} });
},
toggleForm() { toggleForm() {
this.expandForm = !this.expandForm; this.expandForm = !this.expandForm;
}, },
......
<template> <template>
<a-card :body-style="{ padding: '24px 32px' }" :bordered="false"> <a-page-header-wrapper :title="title">
<a-form> <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
<a-form-item <a-form>
:label="$t('title')" <a-form-item
:labelCol="{ span: 7 }" label="标题"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
> :wrapperCol="{ span: 10 }"
<a-input :placeholder="$t('titleInput')" /> >
</a-form-item> <a-input placeholder="给目标起个名字" />
<a-form-item </a-form-item>
:label="$t('date')" <a-form-item
:labelCol="{ span: 7 }" label="起止日期"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
> :wrapperCol="{ span: 10 }"
<a-range-picker style="width: 100%" /> >
</a-form-item> <a-range-picker style="width: 100%" />
<a-form-item </a-form-item>
:label="$t('describe')" <a-form-item
:labelCol="{ span: 7 }" label="目标描述"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
> :wrapperCol="{ span: 10 }"
<a-textarea rows="4" :placeholder="$t('describeInput')" /> >
</a-form-item> <a-textarea rows="4" placeholder="请输入你阶段性工作目标" />
<a-form-item </a-form-item>
:label="$t('metrics')" <a-form-item
:labelCol="{ span: 7 }" label="衡量标准"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
> :wrapperCol="{ span: 10 }"
<a-textarea rows="4" :placeholder="$t('metricsInput')" /> >
</a-form-item> <a-textarea rows="4" placeholder="请输入衡量标准" />
<a-form-item </a-form-item>
:label="$t('customer')" <a-form-item
:labelCol="{ span: 7 }" label="客户"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
:required="false" :wrapperCol="{ span: 10 }"
> :required="false"
<a-input :placeholder="$t('customerInput')" /> >
</a-form-item> <a-input placeholder="请描述你服务的客户,内部客户直接 @姓名/工号" />
<a-form-item </a-form-item>
:label="$t('critics')" <a-form-item
:labelCol="{ span: 7 }" label="邀评人"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
:required="false" :wrapperCol="{ span: 10 }"
> :required="false"
<a-input :placeholder="$t('criticsInput')" /> >
</a-form-item> <a-input placeholder="请直接 @姓名/工号,最多可邀请 5 人" />
<a-form-item </a-form-item>
:label="$t('weight')" <a-form-item
:labelCol="{ span: 7 }" label="权重"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
:required="false" :wrapperCol="{ span: 10 }"
> :required="false"
<a-input-number :min="0" :max="100" /> >
<span>%</span> <a-input-number :min="0" :max="100" />
</a-form-item> <span>%</span>
<a-form-item </a-form-item>
:label="$t('disclosure')" <a-form-item
:labelCol="{ span: 7 }" label="目标公开"
:wrapperCol="{ span: 10 }" :labelCol="{ span: 7 }"
:required="false" :wrapperCol="{ span: 10 }"
:help="$t('disclosureDesc')" :required="false"
> help="客户、邀评人默认被分享"
<a-radio-group v-model="value"> >
<a-radio :value="1">{{ $t("public") }}</a-radio> <a-radio-group v-model="value">
<a-radio :value="2">{{ $t("partially") }}</a-radio> <a-radio :value="1">公开</a-radio>
<a-radio :value="3">{{ $t("private") }}</a-radio> <a-radio :value="2">部分公开</a-radio>
</a-radio-group> <a-radio :value="3">不公开</a-radio>
<a-select mode="multiple" v-if="value === 2"> </a-radio-group>
<a-select-option value="4">{{ $t("colleague1") }}</a-select-option> <a-select mode="multiple" v-if="value === 2">
<a-select-option value="5">{{ $t("colleague2") }}</a-select-option> <a-select-option value="4">同事甲</a-select-option>
<a-select-option value="6">{{ $t("colleague3") }}</a-select-option> <a-select-option value="5">同事乙</a-select-option>
</a-select> <a-select-option value="6">同事丙</a-select-option>
</a-form-item> </a-select>
<a-form-item </a-form-item>
style="margin-top: 24px" <a-form-item
:wrapperCol="{ span: 10, offset: 7 }" style="margin-top: 24px"
> :wrapperCol="{ span: 10, offset: 7 }"
<a-button type="primary">{{ $t("submit") }}</a-button> >
<a-button style="margin-left: 8px">{{ $t("save") }}</a-button> <a-button type="primary">提交</a-button>
</a-form-item> <a-button style="margin-left: 8px">保存</a-button>
</a-form> </a-form-item>
</a-card> </a-form>
</a-card>
</a-page-header-wrapper>
</template> </template>
<script> <script>
...@@ -144,11 +146,12 @@ export default { ...@@ -144,11 +146,12 @@ export default {
data() { data() {
return { return {
value: 1, value: 1,
title: "添加",
}; };
}, },
computed: { computed: {
desc() { desc() {
return this.$t("pageDesc"); return "表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。";
}, },
}, },
created() { created() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment