Commit 9bcfce81 authored by shangtx's avatar shangtx

init: 系统功能

parent 1502b2bb
[*]
charset=utf-8
end_of_line=crlf
insert_final_newline=false
indent_style=space
indent_size=2
[{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}]
indent_style=space
indent_size=2
[{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
indent_style=space
indent_size=2
[{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}]
indent_style=space
indent_size=2
[*.svg]
indent_style=space
indent_size=2
[*.js.map]
indent_style=space
indent_size=2
[*.less]
indent_style=space
indent_size=2
[*.vue]
indent_style=space
indent_size=2
[{.analysis_options,*.yml,*.yaml}]
indent_style=space
indent_size=2
{
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"vueIndentScriptAndStyle": true,
"parser": "babel"
}
\ No newline at end of file
This diff is collapsed.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"lodash.pick": "4.4.0", "lodash.pick": "4.4.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"tinymce": "5.0.8", "tinymce": "5.0.8",
"vue": "2.6.1", "vue": "^2.6.11",
"vue-cropper": "0.4.4", "vue-cropper": "0.4.4",
"vue-ls": "3.2.0", "vue-ls": "3.2.0",
"vue-router": "3.0.1", "vue-router": "3.0.1",
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"eslint-plugin-vue": "6.2.2", "eslint-plugin-vue": "6.2.2",
"less": "3.8.1", "less": "3.8.1",
"less-loader": "4.1.0", "less-loader": "4.1.0",
"vue-template-compiler": "2.6.1" "vue-template-compiler": "^2.6.11"
}, },
"postcss": { "postcss": {
"plugins": { "plugins": {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.png"> <link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>城市服务预约系统</title> <title>房屋线上修缮系统</title>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=8uuOYfYHUCjgSm0uEelyMxaLcaQSRiM0"></script> <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=8uuOYfYHUCjgSm0uEelyMxaLcaQSRiM0"></script>
</head> </head>
<body> <body>
......
import {axios} from '@/util/axios/request' import {axios} from '@/util/axios/request'
const api = { const api = {
getPage: '/sys/code/type/page', getPage: '/sys/dict/type/page',
getDetail: '/sys/code/type/', getDetail: '/sys/dict/type/',
deleteOne: '/sys/code/type/', deleteOne: '/sys/dict/type/',
deleteBatch: '/sys/code/type/batchDelete', deleteBatch: '/sys/dict/type/batchDelete',
save: '/sys/code/type/', save: '/sys/dict/type/',
commCodePath: '/sys/code/type/code' commCodePath: '/dict'
} }
export default api export default api
...@@ -27,9 +27,9 @@ export function getDetail(id) { ...@@ -27,9 +27,9 @@ export function getDetail(id) {
}) })
} }
export function deleteOne(code) { export function deleteOne(id) {
return axios({ return axios({
url: api.deleteOne+code, url: api.deleteOne+id,
method: 'delete' method: 'delete'
}) })
} }
...@@ -51,11 +51,10 @@ export function save(data) { ...@@ -51,11 +51,10 @@ export function save(data) {
}) })
} }
export function getCommonCode(parameter) { export function getCommonCode(codes) {
return axios({ return axios({
url: api.commCodePath, url: `${api.commCodePath}/${codes.join(',')}`,
method: 'post', method: 'get',
data: parameter,
}) })
} }
......
<template>
<a-modal
:title="modalTitle"
v-model="visible"
@ok="handleOk"
:maskClosable="false"
:width="modalWidth"
class="cust-modal"
okText="保存"
>
<a-form :form="form" ref="form">
<a-row>
<a-col :span="12">
<a-form-item v-show="isChildBusiness" label='父业务' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input v-decorator="['parentName', {initialValue: parentName}]" disabled/>
</a-form-item>
<a-form-item v-show="!isChildBusiness" label='业务图标' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input v-decorator="['icon', {initialValue: sysBusiness.icon}]" placeholder="请输入业务图标,例如:setting"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label='业务名称' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
placeholder="请输入业务名称,例如:业务管理"
v-decorator="['name', {initialValue: sysBusiness.name , rules: [{ required: true, message: '请输入业务名称' }]}]"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label='业务编码' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
placeholder="请输入业务编码,例如:SYS000001"
v-decorator="['code', {initialValue: sysBusiness.code , rules: [{ required: true, message: '请输入业务编码' }]}]"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label='组件名称' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
placeholder="请输入组件名称,例如:syscodelist"
v-decorator="['vrName', {initialValue: sysBusiness.vrName , rules: [{ required: true, message: '请输入组件名称' }]}]"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label='访问路由' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
placeholder="请输入访问路由,例如:/system/code"
v-decorator="['vrPath', {initialValue: sysBusiness.vrPath , rules: [{ required: true, message: '请输入访问路由' }]}]"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label='重定向路由' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input v-decorator="['vrRedirect', {initialValue: sysBusiness.vrRedirect}]" placeholder="请输入访问路由,例如:/system/code"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label='页面路径' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input
placeholder="请输入页面路径,例如:views/sysList"
v-decorator="['vrComponentPath', {initialValue: sysBusiness.vrComponentPath , rules: [{ required: true, message: '请输入页面路径' }]}]"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label='排序' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-input v-decorator="['showOrder', {initialValue: sysBusiness.showOrder}]" placeholder="请输入排序数字,数字越大越靠后"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label='菜单显示' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-radio-group v-decorator="['showInMenu', {initialValue: sysBusiness.showInMenu}]" >
<a-radio :value="true"></a-radio>
<a-radio :value="false"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label='保留状态' :labelCol="{ span: 5 }" :wrapperCol="{ span: 17 }">
<a-radio-group v-decorator="['vrKeepAlive', {initialValue: sysBusiness.vrKeepAlive}]" >
<a-radio :value="true"></a-radio>
<a-radio :value="false"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
let initData = {
parentName:'',
icon:'',
name: '',
code: '',
vrName:'',
vrPath:'',
vrRedirect:'',
vrComponentPath:'',
showOrder:'',
showInMenu:true,
vrKeepAlive:true,
}
let propertyList = mapKeyToList(initData);
export default {
name: 'SysBusinessDetailCom',
beforeCreate() {
this.form = this.$form.createForm(this)
for (let property of propertyList) {
this.form.getFieldDecorator(property)
}
},
data() {
return {
parentName:"",//父业务名称
optType: 0,
sysBusiness:{},
isChildBusiness: false,
visible: false,
modalTitle: "新建业务",
modalWidth:950,
}
},
methods: {
show(optType, isChildBusiness, data) {
if (data) {
if(optType == SYS_CONST.OPT_TYPE.MODIFY){
this.modalTitle = "编辑业务"
this.form.setFieldsValue(pick(data, propertyList))
}else{
initData.parentName = data.name;
this.form.setFieldsValue(initData)
}
} else {
this.form.setFieldsValue(initData)
}
this.isChildBusiness = isChildBusiness
this.visible = true
},
handleOk() {
this.form.validateFieldsAndScroll((err, values) => {
if (!err) {
this.visible = false
this.sysBusiness = {}
this.$valueCopy(this.sysBusiness, values)
this.$emit('modifyItem',this.sysBusiness)
}
})
}
}
}
</script>
\ No newline at end of file
<template>
<a-card class="cust-list-cart">
<div>
<a-table
size="middle"
:columns="columns"
:dataSource="businessList"
:pagination="false"
rowKey="id"
bordered
>
<div slot="title" slot-scope="data">
<span class="cust-title">
<a-icon type="hdd"/>业务列表{{data.none}}
</span>
<div class="cust-table-operator">
<a-button-group>
<a-button type='primary' @click="addNew">新建</a-button>
</a-button-group>
</div>
</div>
<span slot="action" slot-scope="text, record">
<a @click="addChild(record)">添加子业务</a>
<a-divider type="vertical"/>
<a @click="editRow(record)">编辑</a>
<a-divider type="vertical"/>
<span v-show="record.children == null">
<a @click="gotoDetail(record)">操作管理</a>
<a-divider type="vertical"/>
</span>
<a @click="onDelete(record)">删除</a>
</span>
</a-table>
</div>
<sys-business-detail @modifyItem="modifyItem" ref="sysBusinessItemDetail"/>
</a-card>
</template>
<script>
import {deleteOne, save, update, getList} from "@/api/system/sysBusiness";
import SysBusinessDetail from './SysBusinessDetailCom'
const columns = [
{title: '业务名称', width: 230, dataIndex: 'name'},
{title: '业务编码', width: 100, dataIndex: 'code'},
{title: '图标', width: 80, dataIndex: 'icon'},
{title: '请求路由', dataIndex: 'vrPath'},
{title: '排序', width: 60, dataIndex: 'showOrder'},
{title: '操作', key: 'operation', width: 250, scopedSlots: {customRender: 'action'}}
];
export default {
name: 'SysBusinessListCom',
components: {SysBusinessDetail},
props: ['pageType'],
data() {
return {
isChildBusiness: false,//是否是子业务
rootId: 0,//根节点id
modalTitle: "新建业务",
modalWidth: 800,
columns: columns,
businessList: [],
selectedRows: [],
needTotalList: [],
businessForm: null,
sysBusiness: {},
}
},
methods: {
loadData() {
getList(this.apiUrl).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
let rootBusiness = response.data[0];
this.rootId = rootBusiness.id;
this.businessList = rootBusiness.children;
this.checkChildren(this.businessList)
}
});
},
checkChildren(list){
list.map(m=>{
if (m.children.length==0) {
m.children = null;
}else {
this.checkChildren(m.children)
}
})
},
modifyItem(item) {
//执行保存操作
this.$valueCopy(this.sysBusiness, item);
if (this.sysBusiness.id) {
update(this.apiUrl, this.sysBusiness).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData();
}
});
} else {
save(this.apiUrl, this.sysBusiness).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData();
}
});
}
},
addChild(row) {
this.sysBusiness = {}
this.isChildBusiness = true;
this.sysBusiness.parentId = row.id;
this.$refs.sysBusinessItemDetail.show(SYS_CONST.OPT_TYPE.ADD, this.isChildBusiness, row)
},
addNew() {
this.sysBusiness = {}
this.isChildBusiness = false;
this.sysBusiness.parentId = this.rootId;
this.$refs.sysBusinessItemDetail.show(SYS_CONST.OPT_TYPE.ADD, this.isChildBusiness)
},
editRow(row) {
if (row.parentId == this.rootId) {
//编辑一级菜单
this.isChildBusiness = false;
} else {
this.isChildBusiness = true;
}
this.sysBusiness = row;
this.$refs.sysBusinessItemDetail.show(SYS_CONST.OPT_TYPE.MODIFY, this.isChildBusiness, row)
},
gotoDetail(row) {
this.$router.push({name: this.detailPathName, query: {id: row.id, name: row.name, pageType: this.pageType}});
},
deleteRow(id) {
deleteOne(this.apiUrl, id).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData();
}
});
},
onDelete(row) {
let _this = this;
if (row.children != null) {
this.$error({
title: '错误提示',
content: '该业务存在子业务,请先删除子业务',
});
return
}
this.$confirm({
title: '提示',
content: '业务下面的操作和资源也会一起删除,确定删除选中的业务吗?',
onOk() {
_this.deleteRow(row.id);
},
onCancel() {
},
});
}
},
computed: {
apiUrl: function () {
if (this.pageType === "company") {
return '/saas/business/';
} else {
return '/sys/business/';
}
},
detailPathName: function () {
if (this.pageType === "company") {
return 'companyBusinessOperateDetail';
} else {
return 'sysBusinessOperateDetail';
}
}
},
mounted() {
this.loadData();
}
}
</script>
...@@ -38,7 +38,6 @@ router.beforeEach((to, from, next) => { ...@@ -38,7 +38,6 @@ router.beforeEach((to, from, next) => {
if (menuList.length > 0) { if (menuList.length > 0) {
store.dispatch('GenerateRoutes', initRouterTree(menuList)) store.dispatch('GenerateRoutes', initRouterTree(menuList))
.then(() => { .then(() => {
console.info('xxxxx', store.getters.addRouters)
router.addRoutes(store.getters.addRouters) router.addRoutes(store.getters.addRouters)
const redirect = decodeURIComponent(from.query.redirect || to.path) const redirect = decodeURIComponent(from.query.redirect || to.path)
if (to.path === redirect) { if (to.path === redirect) {
...@@ -57,7 +56,7 @@ router.beforeEach((to, from, next) => { ...@@ -57,7 +56,7 @@ router.beforeEach((to, from, next) => {
NProgress.done() NProgress.done()
} }
}).catch((e) => { }).catch((e) => {
console.log(e) console.error(e)
notification.error({ message: '错误', description: '请求用户信息失败,请重试' }) notification.error({ message: '错误', description: '请求用户信息失败,请重试' })
store.dispatch('Logout').then(() => { store.dispatch('Logout').then(() => {
next({ path: loginUrl, query: { redirect: to.fullPath } }) next({ path: loginUrl, query: { redirect: to.fullPath } })
......
...@@ -20,8 +20,6 @@ export const constantRouterMap = [ ...@@ -20,8 +20,6 @@ export const constantRouterMap = [
] ]
}, },
{ {
path: '*', path: '*',
component: () => import('@/views/exception/404') component: () => import('@/views/exception/404')
...@@ -36,7 +34,6 @@ export const constantRouterMap = [ ...@@ -36,7 +34,6 @@ export const constantRouterMap = [
* @returns {Array} * @returns {Array}
*/ */
export const initRouterTree = (target, init = []) => { export const initRouterTree = (target, init = []) => {
console.info('init', target, init)
for (let i = 0; i < target.length; i++) { for (let i = 0; i < target.length; i++) {
let item = target[i] let item = target[i]
...@@ -44,7 +41,7 @@ export const initRouterTree = (target, init = []) => { ...@@ -44,7 +41,7 @@ export const initRouterTree = (target, init = []) => {
meta: {} meta: {}
}; };
routerItem.path = item.path routerItem.path = item.path
routerItem.name = item.name routerItem.name = item.vrName
routerItem.meta.title = item.name routerItem.meta.title = item.name
routerItem.hidden = !item.isShow routerItem.hidden = !item.isShow
...@@ -58,8 +55,8 @@ export const initRouterTree = (target, init = []) => { ...@@ -58,8 +55,8 @@ export const initRouterTree = (target, init = []) => {
routerItem.component = RouterNotFound routerItem.component = RouterNotFound
} }
} catch (e) { } catch (e) {
console.info('not found ', item, process.env.NODE_ENV)
routerItem.component = RouterNotFound routerItem.component = RouterNotFound
console.info('not found', item)
} }
} }
if (item.vrRedirect) { if (item.vrRedirect) {
......
<template>
<div>
<sys-param-component :type='type' :listName='listName'></sys-param-component>
</div>
</template>
<script>
import SysParamComponent from './SysParamComponent'
export default {
name: 'SysParamList',
components: {SysParamComponent},
data() {
return {
type: 'system',
listName: '总控系统参数列表',
}
},
methods: {
},
}
</script>
<template>
<keep-alive v-if="keepAlive">
<router-view />
</keep-alive>
<router-view v-else />
</template>
<script>
export default {
name: "SysParamRouteView",
computed: {
keepAlive () {
return this.$route.meta.keepAlive
}
},
}
</script>
\ No newline at end of file
<template> <template>
<div> <a-card class="cust-list-cart">
<sys-business-list-com :pageType="type"></sys-business-list-com> <div>
</div> <a-table
size="middle"
:columns="columns"
:dataSource="businessList"
:pagination="false"
rowKey="id"
bordered
>
<div slot="title" slot-scope="data">
<span class="cust-title">
<a-icon type="hdd" />业务列表{{ data.none }}
</span>
<div class="cust-table-operator">
<a-button-group>
<a-button type="primary" @click="addNew">新建</a-button>
</a-button-group>
</div>
</div>
<template #action="text, record">
<span >
<a @click="addChild(record)">添加子业务</a>
<a-divider type="vertical" />
<a @click="editRow(record)">编辑</a>
<a-divider type="vertical" />
<span
v-show="record.children == null"
>
<a @click="gotoDetail(record)">操作管理</a>
<a-divider type="vertical" />
</span>
<a @click="onDelete(record)">删除</a>
</span>
</template>
</a-table>
</div>
<sys-business-detail @modifyItem="modifyItem" ref="sysBusinessItemDetail" />
</a-card>
</template> </template>
<script> <script>
import { deleteOne, save, update, getList } from '@/api/system/sysBusiness'
import SysBusinessDetail from './SysBusinessDetail'
import SysBusinessListCom from '@/components/business/SysBusinessListCom' const columns = [
{ title: '业务名称', width: 230, dataIndex: 'name' },
export default { { title: '业务编码', width: 100, dataIndex: 'code' },
name: "SysBusinessList", { title: '图标', width: 80, dataIndex: 'icon' },
components: {SysBusinessListCom}, { title: '请求路由', dataIndex: 'vrPath' },
data() { { title: '排序', width: 60, dataIndex: 'showOrder' },
return { {
type: "sys" title: '操作',
} key: 'operation',
}, width: 250,
methods: {}, scopedSlots: { customRender: 'action' }
mounted() { }
]
export default {
name: 'SysBusinessList',
components: { SysBusinessDetail },
data() {
return {
isChildBusiness: false, //是否是子业务
rootId: 0, //根节点id
modalTitle: '新建业务',
modalWidth: 800,
columns: columns,
businessList: [],
selectedRows: [],
needTotalList: [],
businessForm: null,
sysBusiness: {},
apiUrl: '/sys/business/',
detailPathName: 'sysBusinessOperateDetail'
}
},
methods: {
loadData() {
getList(this.apiUrl).then((response) => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
let rootBusiness = response.data[0]
this.rootId = rootBusiness.id
const list = rootBusiness.children
this.checkChildren(list)
this.businessList = list
}
})
},
checkChildren(list) {
list.map((m) => {
if (m.children.length == 0) {
m.children = null
} else {
this.checkChildren(m.children)
} }
})
},
modifyItem(item) {
//执行保存操作
this.$valueCopy(this.sysBusiness, item)
if (this.sysBusiness.id) {
update(this.apiUrl, this.sysBusiness).then((response) => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData()
}
})
} else {
save(this.apiUrl, this.sysBusiness).then((response) => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData()
}
})
}
},
addChild(row) {
console.info('record', row)
this.sysBusiness = {}
this.isChildBusiness = true
this.sysBusiness.parentId = row.id
this.$refs.sysBusinessItemDetail.show(
SYS_CONST.OPT_TYPE.ADD,
this.isChildBusiness,
row
)
},
addNew() {
this.sysBusiness = {}
this.isChildBusiness = false
this.sysBusiness.parentId = this.rootId
this.$refs.sysBusinessItemDetail.show(
SYS_CONST.OPT_TYPE.ADD,
this.isChildBusiness
)
},
editRow(row) {
if (row.parentId == this.rootId) {
//编辑一级菜单
this.isChildBusiness = false
} else {
this.isChildBusiness = true
}
this.sysBusiness = row
this.$refs.sysBusinessItemDetail.show(
SYS_CONST.OPT_TYPE.MODIFY,
this.isChildBusiness,
row
)
},
gotoDetail(row) {
this.$router.push({
name: this.detailPathName,
query: { id: row.id, name: row.name, pageType: 'sys' }
})
},
deleteRow(id) {
deleteOne(this.apiUrl, id).then((response) => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData()
}
})
},
onDelete(row) {
let _this = this
if (row.children != null) {
this.$error({
title: '错误提示',
content: '该业务存在子业务,请先删除子业务'
})
return
}
this.$confirm({
title: '提示',
content: '业务下面的操作和资源也会一起删除,确定删除选中的业务吗?',
onOk() {
_this.deleteRow(row.id)
},
onCancel() {}
})
} }
},
mounted() {
this.loadData()
}
}
</script> </script>
<style scoped>
</style>
\ No newline at end of file
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<a-col :span="6"> <a-col :span="6">
<a-form-item label="代码类型" :labelCol="{span: 8}" :wrapperCol="{span: 16}"> <a-form-item label="代码类型" :labelCol="{span: 8}" :wrapperCol="{span: 16}">
<a-select placeholder="请选择类型" v-model="query.type" :allowClear="true"> <a-select placeholder="请选择类型" v-model="query.type" :allowClear="true">
<a-select-option v-for="type in codeTypeList" v-bind:value="type.valueInt" v-bind:key="type.id"> <a-select-option v-for="type in codeTypeList" v-bind:value="type.code" v-bind:key="type.id">
{{ type.name }} {{ type.value }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
...@@ -92,18 +92,18 @@ ...@@ -92,18 +92,18 @@
import {getCommonCode} from "@/api/system/sysCode"; import {getCommonCode} from "@/api/system/sysCode";
let detailPathName = 'syscodedetail' let detailPathName = 'sysCodeDetail'
let codeMap = null; let codeMap = null;
const dataSource = [] const dataSource = []
const columns = [ const columns = [
{title: '编码', width: 80, sorter: true, dataIndex: 'code'}, {title: '编码', width: 80, sorter: true, dataIndex: 'code'},
{title: '名称', width: 160, dataIndex: 'name'}, {title: '名称', width: 160, dataIndex: 'value'},
{title: '代码类型', width: 100, dataIndex: 'type', customRender: (value) => codeMap ? codeMap[SYS_CONST.CODE.CODE_TYPE][value] : ''}, {title: '代码类型', width: 100, dataIndex: 'type', customRender: (value) => codeMap ? codeMap[SYS_CONST.CODE.CODE_TYPE][value] : ''},
{title: '备注', dataIndex: 'remark'}, {title: '备注', dataIndex: 'remark'},
{title: '创建人', width: 70, dataIndex: 'ctUserName'}, {title: '创建人', width: 70, dataIndex: 'ctUserName'},
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'ctDate', dataIndex: 'createTime',
width: 120, width: 120,
sorter: true, sorter: true,
customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm') customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm')
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
{title: '修改人', width: 70, dataIndex: 'lmUserName'}, {title: '修改人', width: 70, dataIndex: 'lmUserName'},
{ {
title: '修改时间', title: '修改时间',
dataIndex: 'lmDate', dataIndex: 'modifyTime',
width: 140, width: 140,
sorter: true, sorter: true,
customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm') customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm')
...@@ -207,9 +207,9 @@ ...@@ -207,9 +207,9 @@
editRow(row) { editRow(row) {
this.$router.push({name: detailPathName, query: {id: row ? row.id : 0}}) this.$router.push({name: detailPathName, query: {id: row ? row.id : 0}})
}, },
deleteRow(code) { deleteRow(id) {
this.loading = true; this.loading = true;
deleteOne(code).then(response => { deleteOne(id).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData(); this.loadData();
} else { } else {
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
title: '提示', title: '提示',
content: '确定删除这条记录吗?', content: '确定删除这条记录吗?',
onOk() { onOk() {
_this.deleteRow(row.code); _this.deleteRow(row.id);
}, },
onCancel() { onCancel() {
}, },
...@@ -266,8 +266,8 @@ ...@@ -266,8 +266,8 @@
getSysCode() { getSysCode() {
getCommonCode([SYS_CONST.CODE.CODE_TYPE]).then(response => { getCommonCode([SYS_CONST.CODE.CODE_TYPE]).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
let codList = response.data.data; let codList = response.data;
this.codeTypeList = response.data.data[SYS_CONST.CODE.CODE_TYPE]; this.codeTypeList = response.data[SYS_CONST.CODE.CODE_TYPE];
codeMap = this.$codeToMap(codList) codeMap = this.$codeToMap(codList)
} }
}) })
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
v-model="query.available" v-model="query.available"
@change="onChangeStatus" @change="onChangeStatus"
:allowClear="true"> :allowClear="true">
<a-select-option v-for="option in availabStatus" :value="option.valueInt" :key="option.id"> <a-select-option v-for="option in availableStatus" :value="option.code" :key="option.code">
{{ option.name }} {{ option.value }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
import {humpToLine, setOrder} from "@/util/util"; import {humpToLine, setOrder} from "@/util/util";
import {getCommonCode} from "@/api/system/sysCode"; import {getCommonCode} from "@/api/system/sysCode";
let detailPathName = 'sysroledetail' let detailPathName = 'sysRoleDetail'
const dataSource = [] const dataSource = []
const columns = [ const columns = [
{title: '角色编号', width: 100, sorter: true, dataIndex: 'code'}, {title: '角色编号', width: 100, sorter: true, dataIndex: 'code'},
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
dataSource: dataSource, dataSource: dataSource,
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [], selectedRows: [],
availabStatus: {}, availableStatus: [],
} }
}, },
computed: { computed: {
...@@ -187,17 +187,17 @@ ...@@ -187,17 +187,17 @@
onChangeStatus() { onChangeStatus() {
this.loadData(); this.loadData();
}, },
getavailable() { getAvailable() {
getCommonCode([SYS_CONST.CODE.SYS_AVAILABLE_STATUS]).then(response => { getCommonCode([SYS_CONST.CODE.SYS_AVAILABLE_STATUS]).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.availabStatus = response.data.data[SYS_CONST.CODE.SYS_AVAILABLE_STATUS]; this.availableStatus = response.data[SYS_CONST.CODE.SYS_AVAILABLE_STATUS];
} }
}) })
}, },
}, },
mounted() { mounted() {
// 查询状态下拉菜单 // 查询状态下拉菜单
this.getavailable(); this.getAvailable();
}, },
activated() { activated() {
if (this.isFirstLoad == true) { if (this.isFirstLoad == true) {
......
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
getTypes() { getTypes() {
getCommonCode([SYS_CONST.CODE.TEMPLATE_PARAM_TYPE]).then(response => { getCommonCode([SYS_CONST.CODE.TEMPLATE_PARAM_TYPE]).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.types = response.data.data[SYS_CONST.CODE.TEMPLATE_PARAM_TYPE]; this.types = response.data[SYS_CONST.CODE.TEMPLATE_PARAM_TYPE];
} }
}) })
}, },
......
<template>
<div>
<sys-param-component
:type="type"
:listName="listName"
></sys-param-component>
</div>
</template>
<script>
import SysParamComponent from './SysParamComponent'
export default {
name: 'SysParamList',
components: { SysParamComponent },
data() {
return {
type: 'system',
listName: '总控系统参数列表'
}
},
methods: {}
}
</script>
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