update 路径更名

This commit is contained in:
2021-05-26 18:10:13 +08:00
parent a8ecb30cab
commit f1fe13bb6a
33 changed files with 53 additions and 17 deletions

View File

@@ -47,7 +47,9 @@
</span>
<span>
<a-button @click="closeContentWindow()">取消</a-button>
<a-button :loading="saving" @click="onSubmit" type="primary">保存</a-button>
<Auth :auth="{ houseCode: [['add'], ['edit']] }">
<a-button :loading="saving" @click="onSubmit" type="primary">保存</a-button>
</Auth>
</span>
</div>
</container>

View File

@@ -8,25 +8,55 @@
<container>
<br />
<a-card :bordered="false">
<yo-table :columns="columns" :load-data="loadData" @query="onQuery" @resetQuery="onResetQuery" ref="table">
<Auth auth="authCode:page" slot="query">
<yo-table
:columns="columns"
:load-data="loadData"
@query="onQuery"
@resetQuery="onResetQuery"
ref="table"
>
<Auth auth="houseCode:page" slot="query">
<!-- 此处添加查询表单控件 -->
<!-- ... -->
<a-form-model-item>
<a-cascader :display-render="({ labels }) => labels.join(' - ')" :field-names="{ label: 'name', value: 'code', children: 'children' }" :options="options.areaTree" class="w-400" expand-trigger="hover" placeholder="请选择所在区域" v-model="query.areaCode" />
<a-cascader
:display-render="({ labels }) => labels.join(' - ')"
:field-names="{ label: 'name', value: 'code', children: 'children' }"
:options="options.areaTree"
class="w-400"
expand-trigger="hover"
placeholder="请选择所在区域"
v-model="query.areaCode"
/>
</a-form-model-item>
<a-form-model-item label="编号">
<a-input-number :formatter="(number) => number && `000${number}`.slice(-3)" :max="999" :min="1" :precision="0" :step="1" placeholder="请输入房屋序号" v-model="query.no" />
<a-input-number
:formatter="(number) => number && `000${number}`.slice(-3)"
:max="999"
:min="1"
:precision="0"
:step="1"
placeholder="请输入房屋序号"
v-model="query.no"
/>
</a-form-model-item>
<a-form-model-item label="房屋性质">
<a-radio-group @change="onChangeQueryType" button-style="solid" v-model="query.type">
<a-radio-button :value="0">全部</a-radio-button>
<a-radio-button :key="item.code" :value="+item.code" v-for="item in codes.type">{{ item.value }}</a-radio-button>
<a-radio-button
:key="item.code"
:value="+item.code"
v-for="item in codes.type"
>{{item.value}}</a-radio-button>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="行业" v-if="query.type == 2">
<a-select class="w-150" placeholder="请选择行业" v-model="query.industry">
<a-select-option :key="item.code" :value="+item.code" v-for="item in codes.industry">{{ item.value }}</a-select-option>
<a-select-option
:key="item.code"
:value="+item.code"
v-for="item in codes.industry"
>{{item.value}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="地址">
@@ -36,24 +66,24 @@
<a-input placeholder="请输入房屋唯一编码" v-model="query.houseCode" />
</a-form-model-item>
</Auth>
<Auth auth="authCode:add" slot="operator">
<Auth auth="houseCode:add" slot="operator">
<a-button @click="onOpen()" icon="plus">新增房屋编码</a-button>
</Auth>
<!-- 格式化字段内容 -->
<!-- ... -->
<template slot="houseCode" slot-scope="text, record">
<span>{{ `${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${`000${record.no}`.slice(-3)}` }}</span>
<span>{{`${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${`000${record.no}`.slice(-3)}`}}</span>
</template>
<template slot="type" slot-scope="text, record">
<span>{{ bindCodeValue(text, 'type') + (text === 2 ? `(${bindCodeValue(record.industry, 'industry')})` : '') }}</span>
<span>{{bindCodeValue(text, 'type') + (text === 2 ? `(${bindCodeValue(record.industry, 'industry')})` : '')}}</span>
</template>
<!-- 添加操作控件 -->
<span slot="action" slot-scope="text, record">
<yo-table-actions>
<Auth auth="authCode:edit">
<Auth auth="houseCode:edit">
<a @click="onOpen(record)">编辑</a>
</Auth>
<Auth auth="authCode:delete">
<Auth auth="houseCode:delete">
<a-popconfirm @confirm="onDelete(record)" placement="topRight" title="是否确认删除">
<a>删除</a>
</a-popconfirm>
@@ -201,10 +231,12 @@ export default {
* 如果不需要获取相应的字典数据,此方法内容可空
*/
onLoadCodes() {
this.$api.sysDictTypeDropDowns({ code: ['dic_house_type', 'dic_house_industry'] }).then(({ data: { dic_house_type, dic_house_industry } }) => {
this.codes.type = dic_house_type;
this.codes.industry = dic_house_industry;
});
this.$api
.sysDictTypeDropDowns({ code: ['dic_house_type', 'dic_house_industry'] })
.then(({ data: { dic_house_type, dic_house_industry } }) => {
this.codes.type = dic_house_type;
this.codes.industry = dic_house_industry;
});
},
/**
@@ -227,7 +259,9 @@ export default {
this.openContentWindow({
key: record ? record.id : 'business/house/houseCode/form',
title: record ? '修改房屋编码' : '新增房屋编码',
subTitle: record && `${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${`000${record.no}`.slice(-3)}`,
subTitle:
record &&
`${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${`000${record.no}`.slice(-3)}`,
path: 'business/house/houseCode/form',
param: {
record,