Commit 905a5068 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'master' of...

Merge branch 'master' of http://platform.kuopu.net:9999/gitlab/product/kim3-web-vue/starter-web-vue into feature/chw
parents 0da4bf5b 809b574e
......@@ -35,3 +35,15 @@ export function editPlaceApi(data) {
export function getExemptionsListApi(data) {
return getReq(`/ranger/inspection/api/v1/exemptions/valid`, data);
}
export function addUnitApi(data) {
return postReq('/ranger/inspection/api/v1/units', data);
}
export function editUnitApi(data) {
return putReq('/ranger/inspection/api/v1/units', data);
}
export function getUnitInfoApi(id) {
return getReq(`/ranger/inspection/api/v1/units/${id}`);
}
......@@ -11,6 +11,7 @@
:options="options"
:mode="mode"
v-on="$listeners"
v-bind="$attrs"
/>
</template>
......
//ts 此配置为系统默认设置。
const settingConfig = {
lang: "zh_CN", //语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
fallbackLang: "en_US",
lang: 'zh_CN', //语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
fallbackLang: 'en_US',
theme: {
//主题
color: "#3eaf7c", //主题色
mode: "dark", //主题模式 可选 dark、 light 和 night
success: "#52c41a", //成功色
warning: "#faad14", //警告色
error: "#f5222f", //错误色
color: '#3eaf7c', //主题色
mode: 'dark', //主题模式 可选 dark、 light 和 night
success: '#52c41a', //成功色
warning: '#faad14', //警告色
error: '#f5222f', //错误色
},
layout: "side", //导航布局,可选 side 和 head,分别为侧边导航和顶部导航
layout: 'side', //导航布局,可选 side 和 head,分别为侧边导航和顶部导航
fixedHeader: false, //固定头部状态栏,true:固定,false:不固定
fixedSideBar: true, //固定侧边栏,true:固定,false:不固定
fixedTabs: false, //固定页签头,true:固定,false:不固定
pageWidth: "fixed", //内容区域宽度,fixed:固定宽度,fluid:流式宽度
pageWidth: 'fixed', //内容区域宽度,fixed:固定宽度,fluid:流式宽度
multiPage: true, //多页签模式,true:开启,false:不开启
cachePage: true, //是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
systemCode: "Karot", //系统编码
systemName: "Karot文档管理系统", //系统名称
copyright: "2021~ C.T 工作室出品", //copyright
systemCode: 'Karot', //系统编码
systemName: 'Karot文档管理系统', //系统名称
asyncRoutes: false, //异步加载路由,true:开启,false:不开启
showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
filterMenu: true, //根据权限过滤菜单,true:过滤,false:不过滤
animate: {
//动画设置
disabled: false, //禁用动画,true:禁用,false:启用
name: "lightSpeed", //动画效果,支持的动画效果可参考 ./animate.config.js
direction: "Left", //动画方向,切换页面时动画的方向,参考 ./animate.config.js
name: 'lightSpeed', //动画效果,支持的动画效果可参考 ./animate.config.js
direction: 'Left', //动画方向,切换页面时动画的方向,参考 ./animate.config.js
},
footerLinks: [
//页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
{ link: "https://www.antdv.com/", name: "AntD Vue" },
{ link: "http://platform.kuopu.net:9999/gitlab/product/akina-antd-vue-pro", icon: "gitlab" },
{ link: "https://vuejs.org/", name: "Vue" },
],
};
module.exports = settingConfig;
......@@ -83,8 +83,6 @@ export default {
...mapState('settingModule', [
'theme',
'layout',
'footerLinks',
'copyright',
'fixedHeader',
'fixedSideBar',
'fixedTabs',
......
<template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="单元名称" prop="unitName">
<a-input v-model="form.unitName" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="form.regionId"
labelFiled="regionName"
valueFiled="regionId"
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="所属地点" prop="placeId">
<UrlSelect
v-model="form.placeId"
:url="
form.regionId ? `/ranger/inspection/api/v1/place/regions/${form.regionId}/list` : ''
"
labelFiled="placeName"
valueFiled="placeId"
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="设备编号" prop="equipmentCode">
<SearchSelect
url="oceanus/api/v1/equipments/list"
searchField="searchKey"
v-model="form.equipmentCode"
labelFiled="equipmentCode"
valueFiled="equipmentCode"
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" />
</a-form-model-item>
</a-form-model>
</Wraper>
</template>
<script>
import Wraper from '@/components/table/wraper.vue';
import UrlSelect from '@/components/MySelect/url_select.vue';
import SearchSelect from '@/components/MySelect/search_select.vue';
import { addUnitApi, editUnitApi, getUnitInfoApi } from '@/api';
export default {
components: { Wraper, UrlSelect, SearchSelect },
props: { hidden: Function, row: Object, type: String, refresh: Function },
data: () => ({
form: {},
rules: {
unitName: [{ required: true }],
regionId: [{ required: true }],
placeId: [{ required: true }],
equipmentCode: [{ required: true }],
},
}),
computed: {
isView() {
return this.type === 'view';
},
isEdit() {
return this.type === 'edit';
},
isAdd() {
return this.type === null;
},
},
async mounted() {
if (!this.isAdd) {
this.form = await getUnitInfoApi(this.row.unitId);
}
},
methods: {
async submit() {
await this.$refs.form.validate();
if (this.isAdd) return addUnitApi(this.form);
if (this.isEdit) return editUnitApi(this.form);
},
},
};
</script>
import Index from './index.vue';
export default Index;
<template>
<Table url="/ranger/inspection/api/v1/units" rowKey="unitId" addBtn :buttons="buttons" ref="table">
<template #search="{ query }">
<MoreItem label="地区">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
/>
</MoreItem>
<MoreItem label="地点">
<UrlSelect
v-model="query.placeId"
:url="
query.regionId ? `/ranger/inspection/api/v1/place/regions/${query.regionId}/list` : ''
"
labelFiled="placeName"
valueFiled="placeId"
/>
</MoreItem>
<MoreItem label="关键字">
<a-input v-model="query.inputValue" />
</MoreItem>
</template>
<template #drawer="drawer">
<AddAndEdit v-bind="drawer" />
</template>
<a-table-column title="单元名称" data-index="unitName" />
<a-table-column title="所属地点" data-index="placeName" />
<a-table-column title="设备编号" data-index="equipmentCode" />
<a-table-column title="修改人" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" />
</Table>
</template>
<script>
import Table from '@/components/table/table.vue';
import UrlSelect from '@/components/MySelect/url_select.vue';
import MoreItem from '@/components/table/more_item.vue';
import AddAndEdit from './add_edit.vue';
export default {
components: { Table, UrlSelect, MoreItem, AddAndEdit },
data() {
return {
buttons: [
{ label: '编辑', click: this.edit },
{ label: '详情', click: this.view },
{ label: '免检', click: this.view },
{ label: '文档', click: this.view },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/units/${row.unitId}`,
after: this.refresh,
},
],
};
},
methods: {
refresh() {
this.$refs.table.getData();
},
edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' });
},
view(row) {
this.$refs.table.show({ row, title: '详情', type: 'view' });
},
},
};
</script>
......@@ -75,6 +75,11 @@ const hasAuthorityRoutes = [
name: '地区配置',
component: () => import('@/pages/ranger/basic/place'),
},
{
path: 'unit',
name: '单元配置',
component: () => import('@/pages/ranger/basic/unit'),
},
],
},
{
......
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