This commit is contained in:
朱文强 2023-04-10 15:49:11 +08:00
parent 3161b54cd7
commit f2ca004e6f
81 changed files with 3726 additions and 2344 deletions

5
package-lock.json generated
View File

@ -5682,6 +5682,11 @@
"q": "^1.1.2"
}
},
"code-brick-zj": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.7.tgz",
"integrity": "sha512-ZuhseY/9RUUUweAiTdumq5pJKAKAJxpvD8yjcVluY+cGDEKyoKzN9PjycPh2tUsE/gmwShfgrcIcm5DKcmzqvA=="
},
"code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz",

View File

@ -15,6 +15,7 @@
"axios": "^0.19.2",
"babel-eslint": "^8.0.1",
"babel-plugin-component": "^1.1.1",
"code-brick-zj": "0.0.7",
"core-js": "^3.6.5",
"echarts": "^5.3.3",
"element-theme": "^2.0.1",

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-22 14:57:50
* @LastEditors: zwq
* @LastEditTime: 2023-01-06 14:57:22
* @LastEditTime: 2023-04-10 13:55:02
* @Description:
-->
<!DOCTYPE html>
@ -37,7 +37,9 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.73:8080/ym-spc';
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.44:8080/ym-spc';
//http://demo.open.renren.io/renren-security-server
//http://192.168.1.44:8080/ym-spc
</script>
<% } %>
<!-- 集成测试环境 -->

View File

@ -394,7 +394,7 @@ img {
}
.aui-navbar__icon-menu {
vertical-align: middle;
font-size: 16px;
font-size: 24px;
}
.el-dropdown {
color: $--color-text-secondary;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:49:17
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
import i18n from "@/i18n";
const table = {
status: {
'0': '不可用',
'1': '可用',
},
fType: {
'1': '内部工厂',
'2': '供应商',
},
tType: {
'1': '计量',
'2': '计数',
},
uType: {
'1': '可计数',
'2': '不可计数',
},
}
export default function(dictTable) {
return function(val) {
return table?.[dictTable]?.[val]
}
}

38
src/filters/sys-filter.js Normal file
View File

@ -0,0 +1,38 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:49:17
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
import i18n from "@/i18n";
const table = {
sex: {
'0': i18n.t('user.gender0'),
'1': i18n.t('user.status1')
},
userStatus: {
'0': i18n.t('user.status0'),
'1': i18n.t('user.status1')
},
menuType: {
'0': i18n.t('menu.type0'),
'1': i18n.t('menu.type1')
},
logOperation: {
'0': i18n.t('logLogin.operation0'),
'1': i18n.t('logLogin.operation1')
},
logStatus: {
'0': i18n.t('logLogin.status0'),
'1': i18n.t('logLogin.status1')
},
}
export default function(dictTable) {
return function(val) {
return table?.[dictTable]?.[val]
}
}

267
src/i18n/en.js Normal file
View File

@ -0,0 +1,267 @@
import module from './en'
const t = {}
t.module = module
t.loading = 'loading...'
t.brand = {}
t.brand.lg = 'SPC'
t.brand.mini = 'spc'
t.public = {}
t.public.operation = 'operation'
t.add = 'add'
t.delete = 'delete'
t.deleteBatch = 'deleteBatch'
t.update = 'update'
t.query = 'query'
t.export = 'export'
t.handle = 'handle'
t.confirm = 'confirm'
t.cancel = 'cancel'
t.clear = 'clear'
t.logout = 'logout'
t.manage = 'manage'
t.createDate = 'createDate'
t.keyword = 'keyword:'
t.choose = 'choose'
t.prompt = {}
t.prompt.title = 'Tips'
t.prompt.info = '确定进行[{handle}]操作?'
t.prompt.success = 'Operation succeeded'
t.prompt.failed = 'Operation failed'
t.prompt.deleteBatch = 'Please select delete item'
t.validate = {}
t.validate.required = 'required'
t.validate.format = '{attr}Format error'
t.upload = {}
t.upload.text = '将文件拖到此处,或<em>点击上传</em>'
t.upload.tip = '只支持{format}格式文件!'
t.upload.button = 'upload'
t.datePicker = {}
t.datePicker.range = 'range'
t.datePicker.start = 'start'
t.datePicker.end = 'end'
t.fullscreen = {}
t.fullscreen.prompt = 'Your browser does not support this operation'
t.updatePassword = {}
t.updatePassword.title = 'Change Password'
t.updatePassword.username = 'account number'
t.updatePassword.password = 'Original password'
t.updatePassword.newPassword = 'New password'
t.updatePassword.confirmPassword = 'Confirm Password'
t.updatePassword.validate = {}
t.updatePassword.validate.confirmPassword = 'The confirmed password is inconsistent with the new password'
t.contentTabs = {}
t.contentTabs.closeCurrent = 'close Current Page'
t.contentTabs.closeOther = 'close Other Page'
t.contentTabs.closeAll = 'close All'
/* 页面 */
t.notFound = {}
t.notFound.desc = '抱歉!您访问的页面<em>失联</em>啦...'
t.notFound.back = 'back'
t.notFound.home = 'home'
t.login = {}
t.login.title = 'login'
t.login.username = 'username'
t.login.password = 'password'
t.login.captcha = 'captcha'
t.login.demo = 'demo'
t.login.copyright = '中建材智能自动化研究院'
t.schedule = {}
t.schedule.beanName = 'bean名称'
t.schedule.beanNameTips = 'spring bean名称, 如: testTask'
t.schedule.pauseBatch = 'pause'
t.schedule.resumeBatch = 'resume'
t.schedule.runBatch = 'run'
t.schedule.log = 'log'
t.schedule.params = 'params'
t.schedule.cronExpression = 'cron表达式'
t.schedule.cronExpressionTips = '如: 0 0 12 * * ?'
t.schedule.remark = 'remark'
t.schedule.status = 'status'
t.schedule.status0 = 'pause'
t.schedule.status1 = 'normal'
t.schedule.statusLog0 = 'fail'
t.schedule.statusLog1 = 'success'
t.schedule.pause = 'pause'
t.schedule.resume = 'resume'
t.schedule.run = 'run'
t.schedule.jobId = '任务ID'
t.schedule.times = 'times(单位: 毫秒)'
t.schedule.createDate = 'create Date'
t.oss = {}
t.oss.config = 'Cloud storage configuration'
t.oss.upload = 'upload'
t.oss.url = 'URL'
t.oss.createDate = 'create Date'
t.oss.type = 'type'
t.oss.type1 = '七牛'
t.oss.type2 = '阿里云'
t.oss.type3 = '腾讯云'
t.oss.qiniuDomain = '域名'
t.oss.qiniuDomainTips = '七牛绑定的域名'
t.oss.qiniuPrefix = '路径前缀'
t.oss.qiniuPrefixTips = '不设置默认为空'
t.oss.qiniuAccessKey = 'AccessKey'
t.oss.qiniuAccessKeyTips = '七牛AccessKey'
t.oss.qiniuSecretKey = 'SecretKey'
t.oss.qiniuSecretKeyTips = '七牛SecretKey'
t.oss.qiniuBucketName = '空间名'
t.oss.qiniuBucketNameTips = '七牛存储空间名'
t.oss.aliyunDomain = '域名'
t.oss.aliyunDomainTips = '阿里云绑定的域名http://cdn.renren.io'
t.oss.aliyunPrefix = '路径前缀'
t.oss.aliyunPrefixTips = '不设置默认为空'
t.oss.aliyunEndPoint = 'EndPoint'
t.oss.aliyunEndPointTips = '阿里云EndPoint'
t.oss.aliyunAccessKeyId = 'AccessKeyId'
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId'
t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret'
t.oss.aliyunBucketName = 'BucketName'
t.oss.aliyunBucketNameTips = '阿里云BucketName'
t.oss.qcloudDomain = '域名'
t.oss.qcloudDomainTips = '腾讯云绑定的域名'
t.oss.qcloudPrefix = '路径前缀'
t.oss.qcloudPrefixTips = '不设置默认为空'
t.oss.qcloudAppId = 'AppId'
t.oss.qcloudAppIdTips = '腾讯云AppId'
t.oss.qcloudSecretId = 'SecretId'
t.oss.qcloudSecretIdTips = '腾讯云SecretId'
t.oss.qcloudSecretKey = 'SecretKey'
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey'
t.oss.qcloudBucketName = 'BucketName'
t.oss.qcloudBucketNameTips = '腾讯云BucketName'
t.oss.qcloudRegion = '所属地区'
t.oss.qcloudRegionTips = '请选择'
t.oss.qcloudRegionBeijing1 = '北京一区(华北)'
t.oss.qcloudRegionBeijing = '北京'
t.oss.qcloudRegionShanghai = '上海(华东)'
t.oss.qcloudRegionGuangzhou = '广州(华南)'
t.oss.qcloudRegionChengdu = '成都(西南)'
t.oss.qcloudRegionChongqing = '重庆'
t.oss.qcloudRegionSingapore = '新加坡'
t.oss.qcloudRegionHongkong = '香港'
t.oss.qcloudRegionToronto = '多伦多'
t.oss.qcloudRegionFrankfurt = '法兰克福'
t.dept = {}
t.dept.name = 'name'
t.dept.parentName = 'Superior department'
t.dept.sort = 'sort'
t.dept.parentNameDefault = 'Primary department'
t.dept.chooseerror = 'Please select a department'
t.dept.title = 'Please select a department'
t.dict = {}
t.dict.dictName = 'dictName'
t.dict.dictType = 'dictType'
t.dict.dictLabel = 'dictLabel'
t.dict.dictValue = 'dictValue'
t.dict.sort = 'sort'
t.dict.remark = 'remark'
t.dict.createDate = 'create Date'
t.logError = {}
t.logError.requestUri = 'requestURI'
t.logError.requestMethod = 'requestMethod'
t.logError.requestParams = 'requestParams'
t.logError.ip = 'IP'
t.logError.userAgent = 'userAgent'
t.logError.createDate = 'createDate'
t.logError.errorInfo = 'errorInfo'
t.logLogin = {}
t.logLogin.creatorName = 'creatorName'
t.logLogin.status = 'status'
t.logLogin.status0 = 'fail'
t.logLogin.status1 = 'success'
t.logLogin.status2 = 'Account locked'
t.logLogin.operation = 'operation'
t.logLogin.operation0 = 'login'
t.logLogin.operation1 = 'loginOut'
t.logLogin.ip = 'IP'
t.logLogin.userAgent = 'User-Agent'
t.logLogin.createDate = 'createDate'
t.logOperation = {}
t.logOperation.status = 'status'
t.logOperation.status0 = 'fail'
t.logOperation.status1 = 'success'
t.logOperation.creatorName = 'creatorName'
t.logOperation.operation = 'operation'
t.logOperation.requestUri = 'requestURI'
t.logOperation.requestMethod = 'requestMethod'
t.logOperation.requestParams = 'requestParams'
t.logOperation.requestTime = 'requestTime'
t.logOperation.ip = 'IP'
t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = 'createDate'
t.menu = {}
t.menu.name = 'name'
t.menu.icon = 'icon'
t.menu.type = 'type'
t.menu.type0 = 'menu'
t.menu.type1 = 'button'
t.menu.sort = 'sort'
t.menu.url = 'url'
t.menu.permissions = 'permissions'
t.menu.permissionsTips = '多个用逗号分隔sys:menu:save,sys:menu:update'
t.menu.parentName = 'parentName'
t.menu.parentNameDefault = 'parentNameDefault'
t.menu.resource = 'resource'
t.menu.resourceUrl = 'resourceUrl'
t.menu.resourceMethod = 'resourceMethod'
t.menu.resourceAddItem = 'resourceAddItem'
t.params = {}
t.params.paramCode = 'code'
t.params.paramValue = 'value'
t.params.remark = 'remark'
t.role = {}
t.role.name = 'name'
t.role.remark = 'remark'
t.role.createDate = 'createDate'
t.role.menuList = 'menuList'
t.role.deptList = 'deptList'
t.user = {}
t.user.username = 'username'
t.user.deptName = 'deptName'
t.user.email = 'email'
t.user.mobile = 'mobile'
t.user.status = 'status'
t.user.status0 = 'Deactivate'
t.user.status1 = 'Normal'
t.user.createDate = 'createDate'
t.user.password = 'password'
t.user.confirmPassword = 'confirmPassword'
t.user.realName = 'realName'
t.user.gender = 'gender'
t.user.gender0 = 'male'
t.user.gender1 = 'female'
t.user.gender2 = 'secrecy'
t.user.roleIdList = 'Role configuration'
t.user.validate = {}
t.user.validate.confirmPassword = 'The confirmation password is inconsistent with the password input'
t.user.select = 'Select user'
t.user.selecterror = 'Please select a record'
export default t

12
src/i18n/en/basicData.js Normal file
View File

@ -0,0 +1,12 @@
/*
* @Author: zwq
* @Date: 2023-02-28 14:21:52
* @LastEditors: zwq
* @LastEditTime: 2023-02-28 14:24:19
* @Description:
*/
export default {
status: 'status',
createTime: 'create time',
}

13
src/i18n/en/index.js Normal file
View File

@ -0,0 +1,13 @@
/*
* @Author: gtz
* @Date: 2021-03-04 16:12:46
* @LastEditors: gtz
* @LastEditTime: 2021-12-08 14:29:14
* @Description: file content
*/
import basicData from './basicData'
export default {
basicData,
}

View File

@ -3,6 +3,8 @@ import VueI18n from 'vue-i18n'
import Cookies from 'js-cookie'
import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
import zhCN from './zh-CN'
import EnLocale from 'element-ui/lib/locale/lang/en'
import en from './en'
Vue.use(VueI18n)
@ -10,8 +12,13 @@ export const messages = {
'zh-CN': {
'_lang': '简体中文',
...zhCN,
...zhCNLocale
}
...zhCNLocale,
},
'en': {
'_lang': 'English',
...en,
...EnLocale
},
}
export default new VueI18n({

View File

@ -1,5 +1,8 @@
import module from './zh'
const t = {}
t.module = module
t.loading = '加载中...'
t.brand = {}

12
src/i18n/zh/basicData.js Normal file
View File

@ -0,0 +1,12 @@
/*
* @Author: zwq
* @Date: 2023-02-28 14:21:52
* @LastEditors: zwq
* @LastEditTime: 2023-02-28 14:24:19
* @Description:
*/
export default {
status: '状态',
createTime: '添加时间',
}

13
src/i18n/zh/index.js Normal file
View File

@ -0,0 +1,13 @@
/*
* @Author: gtz
* @Date: 2021-03-04 16:12:46
* @LastEditors: gtz
* @LastEditTime: 2021-12-08 14:29:14
* @Description: file content
*/
import basicData from './basicData'
export default {
basicData,
}

14
src/icons/svg/中英.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-22 14:57:50
* @LastEditors: zwq
* @LastEditTime: 2022-09-13 10:39:56
* @LastEditTime: 2023-02-17 09:28:21
* @Description:
*/
import Vue from 'vue'
@ -21,6 +21,7 @@ import renDeptTree from '@/components/ren-dept-tree'
import renRegionTree from '@/components/ren-region-tree'
import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import myComponents from 'code-brick-zj'
Vue.config.productionTip = false
@ -30,6 +31,7 @@ Vue.use(Element, {
i18n: (key, value) => i18n.t(key, value)
})
Vue.use(myComponents)
Vue.use(renRadioGroup)
Vue.use(renSelect)
Vue.use(renDeptTree)

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2022-09-19 14:12:43
* @LastEditTime: 2023-02-17 11:07:29
* @Description:
*/
export default {
@ -85,12 +85,15 @@ export default {
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
this.$emit("successSubmit");
},
});
})
.catch(() => { });
});
},
formClear() {
this.$refs.dataForm.resetFields()
}
}
}

View File

@ -2,11 +2,11 @@
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2022-09-16 13:50:19
* @LastEditTime: 2023-02-17 10:59:11
* @Description:
*/
export default {
data () {
data() {
/* eslint-disable */
return {
urlOptions: {
@ -15,16 +15,18 @@ export default {
statusUrl: '',
exportUrl: ''
},
dataList: [],
dataForm: {},
pageIndex: 1,
pageSize: 10,
totalPage: 0,
addOrEditTitle: '',
tableData: [],
listQuery: {
limit: 10,
page: 1,
total: 1,
},
dataListLoading: false,
addOrUpdateVisible: false,
}
},
created () {
created() {
},
activated() {
this.getDataList();
@ -35,21 +37,17 @@ export default {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: {
page: this.pageIndex,
limit: this.pageSize,
...this.dataForm
},
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
this.totalPage = 0;
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
this.dataList = res.data.list;
this.totalPage = res.data.total;
this.tableData = res.data.list;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
@ -57,18 +55,19 @@ export default {
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.listQuery.limit = val;
this.listQuery.page = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val;
this.listQuery.page = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
@ -76,6 +75,7 @@ export default {
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
@ -83,7 +83,7 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
//this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
@ -93,7 +93,23 @@ export default {
},
});
})
.catch(() => {});
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id, name) {
@ -118,7 +134,37 @@ export default {
}
});
})
.catch(() => {});
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
// 导出
exportHandle(name) {
@ -140,13 +186,13 @@ export default {
const downloadElement = document.createElement("a");
const href = window.URL.createObjectURL(blob); // 创建下载的链接
downloadElement.href = href;
downloadElement.download = `${name+currentdate}.xls`; // 下载后文件名
downloadElement.download = `${name + currentdate}.xls`; // 下载后文件名
document.body.appendChild(downloadElement);
downloadElement.click(); // 点击下载
document.body.removeChild(downloadElement); // 下载完成移除元素
window.URL.revokeObjectURL(href);
})
.catch(() => {});
.catch(() => { });
}
}
}

View File

@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2022-08-22 14:57:51
* @LastEditors: zwq
* @LastEditTime: 2023-02-24 16:58:01
* @Description:
*/
import axios from 'axios'
import Cookies from 'js-cookie'
import router from '@/router'
@ -16,7 +23,11 @@ const http = axios.create({
*/
http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
if (config.url === "/login") {
config.headers['token'] = ''
} else {
config.headers['token'] = Cookies.get('token') || ''
}
// 默认参数
var defaults = {}
// 防止缓存GET请求默认带_t参数

View File

@ -1,8 +1,9 @@
<!--
* @Author: zwq
* @Date: 2022-08-22 14:57:51
* @LastEditors: zwq
* @LastEditTime: 2022-08-22 15:25:14
* @LastEditTime: 2023-02-28 15:15:40
* @Description:
-->
<template>
@ -23,6 +24,23 @@
</el-menu-item>
</el-menu>
<el-menu class="aui-navbar__menu" mode="horizontal">
<el-menu-item index="6">
<el-dropdown trigger="click" class="international" @command="handleSetLanguage">
<div>
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
<use xlink:href="#中英"></use>
</svg>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="language === 'zh-CN'" command="zh-CN">
中文
</el-dropdown-item>
<el-dropdown-item :disabled="language === 'en'" command="en">
English
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-menu-item>
<el-menu-item index="4" @click="fullscreenHandle()">
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-fullscreen"></use></svg>
</el-menu-item>
@ -49,6 +67,8 @@
import screenfull from 'screenfull'
import UpdatePassword from './main-navbar-update-password'
import { clearLoginInfo } from '@/utils'
import { messages } from '@/i18n'
import Cookies from "js-cookie";
export default {
inject: ['refresh'],
data () {
@ -60,7 +80,18 @@ export default {
components: {
UpdatePassword
},
computed: {
language() {
return Cookies.get("language");
},
},
methods: {
handleSetLanguage(val) {
Cookies.set("language", val);
document.querySelector("html").setAttribute("lang", val);
document.title = messages[val].brand.lg;
window.location.reload();
},
//
fullscreenHandle () {
if (!screenfull.enabled) {

View File

@ -95,7 +95,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -65,7 +65,7 @@
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @successSubmit="getDataList"></add-or-update>
<!-- 弹窗, 日志列表 -->
<log v-if="logVisible" ref="log"></log>
</div>

View File

@ -214,7 +214,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -55,7 +55,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}

View File

@ -40,7 +40,7 @@
<!-- 弹窗, 云存储配置 -->
<config v-if="configVisible" ref="config"></config>
<!-- 弹窗, 上传文件 -->
<upload v-if="uploadVisible" ref="upload" @refreshDataList="getDataList"></upload>
<upload v-if="uploadVisible" ref="upload" @successSubmit="getDataList"></upload>
</div>
</el-card>
</template>

View File

@ -1,6 +1,5 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item prop="name" :label="$t('dept.name')">
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
</el-form-item>
@ -30,18 +29,19 @@
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dept.sort')"></el-input-number>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/dept/',
infoURL: '/sys/dept'
},
visible: false,
deptList: [],
deptListVisible: false,
@ -67,7 +67,8 @@ export default {
}
},
methods: {
init () {
init(id) {
this.dataForm.id = id || "";
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -117,7 +118,7 @@ export default {
this.deptListVisible = false
},
//
dataFormSubmitHandle: debounce(function () {
dataFormSubmit: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
@ -132,7 +133,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,43 +1,119 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 14:32:59
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button v-if="$hasPermission('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('dept.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dept.sort')" header-align="center" align="center" width="80"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './dept-add-or-update'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from "./dept-add-or-update";
import i18n from "@/i18n";
const tableProps = [
{
prop: "name",
label: i18n.t("dept.name"),
},
{
prop: "parentName",
label: i18n.t("dept.parentName"),
},
{
prop: "sort",
label: i18n.t("dept.sort"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [mixinViewModule],
data () {
mixins: [basicPage],
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/dept/list',
deleteURL: '/sys/dept'
}
}
urlOptions: {
getDataListURL: "/sys/dept/list",
deleteURL: "/sys/dept",
},
tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
}
this.tableData = res.data;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
}
};
</script>

View File

@ -1,5 +1,4 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictValue" :label="$t('dict.dictValue')">
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
@ -14,18 +13,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/dict/data/',
infoURL: '/sys/dict/data'
},
visible: false,
dataForm: {
id: '',
@ -53,7 +53,9 @@ export default {
}
},
methods: {
init () {
init(id,dictTypeId) {
this.dataForm.id = id || "";
this.dataForm.dictTypeId = dictTypeId || "";
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -90,7 +92,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,96 +1,150 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="dictValue" :label="$t('dict.dictValue')" header-align="center" align="center"></el-table-column>
<el-table-column prop="dictLabel" :label="$t('dict.dictLabel')" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-data-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
createdIsNeed: false,
getDataListURL: '/sys/dict/data/page',
getDataListIsPage: true,
deleteURL: '/sys/dict/data',
deleteIsBatch: true
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictValue",
label: i18n.t("dict.dictValue"),
},
dataForm: {
dictTypeId: '0',
dictLabel: '',
dictValue: ''
}
}
{
prop: "dictLabel",
label: i18n.t("dict.dictLabel"),
},
{
prop: "sort",
label: i18n.t("dict.sort"),
},
{
prop: "remark",
label: i18n.t("dict.remark"),
},
{
prop: "createDate",
label: i18n.t("dict.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/dict/data/page",
deleteURL: "/sys/dict/data",
},
tableProps,
tableBtn,
formConfig: [
{
type: "input",
label: i18n.t("dict.dictValue"),
placeholder: i18n.t("dict.dictValue"),
param: "dictValue",
},
{
type: "input",
label: i18n.t("dict.dictLabel"),
placeholder: i18n.t("dict.dictLabel"),
param: "dictLabel",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
created () {
this.dataForm.dictTypeId = this.$route.params.dictTypeId || '0'
this.listQuery.dictTypeId = this.$route.params.dictTypeId || '0'
this.getDataList()
},
methods: {
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.dictValue = val.dictValue;
this.listQuery.dictLabel = val.dictLabel;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.dataForm.dictTypeId = this.dataForm.dictTypeId
this.$refs.addOrUpdate.init()
this.$refs.addOrUpdate.init(id,this.listQuery.dictTypeId)
})
}
}
}
};
</script>

View File

@ -1,5 +1,4 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
@ -14,18 +13,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/dict/type/',
infoURL: '/sys/dict/type'
},
visible: false,
dataForm: {
id: '',
@ -52,7 +52,8 @@ export default {
}
},
methods: {
init () {
init(id) {
this.dataForm.id = id || "";
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -89,7 +90,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -0,0 +1,33 @@
<template>
<span>
<el-button type="text" size="small" @click="emitClick">{{ injectData.dictType }}</el-button>
</span>
</template>
<script>
import { addDynamicRoute } from '@/router'
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
methods: {
//
emitClick () {
//
const routeParams = {
routeName: `${this.$route.name}__${this.injectData.id}`,
title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
path: 'sys/dict-data',
params: {
dictTypeId: this.injectData.id
}
}
//
addDynamicRoute(routeParams, this.$router)
}
}
}
</script>

View File

@ -1,101 +1,141 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="dictName" :label="$t('dict.dictName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="dictType" :label="$t('dict.dictType')" header-align="center" align="center">
<template slot-scope="scope">
<el-button type="text" @click="childHandle(scope.row)">{{ scope.row.dictType }}</el-button>
</template>
</el-table-column>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-type-add-or-update'
import { addDynamicRoute } from '@/router'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/dict/type/page',
getDataListIsPage: true,
deleteURL: '/sys/dict/type',
deleteIsBatch: true
import toDictType from './dict-type-to'
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictName",
label: i18n.t("dict.dictName"),
},
dataForm: {
id: '0',
dictName: '',
dictType: ''
}
}
{
prop: "dictType",
label: i18n.t("dict.dictType"),
subcomponent: toDictType
},
{
prop: "sort",
label: i18n.t("dict.sort"),
},
{
prop: "remark",
label: i18n.t("dict.remark"),
},
{
prop: "createDate",
label: i18n.t("dict.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/dict/type/page",
deleteURL: "/sys/dict/type",
},
tableProps,
tableBtn,
formConfig: [
{
type: "input",
label: i18n.t("dict.dictName"),
placeholder: i18n.t("dict.dictName"),
param: "dictName",
},
{
type: "input",
label: i18n.t("dict.dictType"),
placeholder: i18n.t("dict.dictType"),
param: "dictType",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods: {
//
childHandle (row) {
//
const routeParams = {
routeName: `${this.$route.name}__${row.id}`,
title: `${this.$route.meta.title} - ${row.dictType}`,
path: 'sys/dict-data',
params: {
dictTypeId: row.id
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.dictName = val.dictName;
this.listQuery.dictType = val.dictType;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
}
//
addDynamicRoute(routeParams, this.$router)
}
}
}
};
</script>

View File

@ -1,65 +1,120 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-02-28 11:01:49
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-error">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="requestUri" :label="$t('logError.requestUri')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestMethod" :label="$t('logError.requestMethod')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestParams" :label="$t('logError.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="ip" :label="$t('logError.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logError.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logError.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="infoHandle(scope.row.errorInfo)">{{ $t('logError.errorInfo') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
/>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import Cookies from 'js-cookie'
import qs from 'qs'
const tableProps = [
{
prop: "requestUri",
label: i18n.t("logError.requestUri"),
},
{
prop: "requestMethod",
label: i18n.t("logError.requestMethod"),
},
{
prop: "requestParams",
label: i18n.t("logError.requestParams"),
},
{
prop: "ip",
label: i18n.t("logError.ip"),
},
{
prop: "userAgent",
label: i18n.t("logError.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logError.createDate"),
},
];
export default {
mixins: [mixinViewModule],
data () {
mixins: [basicPage],
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/log/error/page',
getDataListIsPage: true,
exportURL: '/sys/log/error/export'
}
urlOptions: {
getDataListURL: "/sys/log/error/page",
exportUrl: "/sys/log/error/export",
},
tableProps,
formConfig: [
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "export":
this.exportHandle();
break;
default:
console.log(val)
}
},
methods: {
//
infoHandle (info) {
this.$alert(info, this.$t('logError.errorInfo'), {
customClass: 'mod-sys__log-error-view-info'
//
exportHandle(name) {
this.$http
.get(this.urlOptions.exportUrl, { responseType: "blob" })
.then(({ data: res }) => {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + "-" + month + "-" + strDate;
const blob = new Blob([res]);
const downloadElement = document.createElement("a");
const href = window.URL.createObjectURL(blob); //
downloadElement.href = href;
downloadElement.download = `${name + currentdate}.xls`; //
document.body.appendChild(downloadElement);
downloadElement.click(); //
document.body.removeChild(downloadElement); //
window.URL.revokeObjectURL(href);
})
.catch(() => { });
}
}
}
};
</script>
<style lang="scss">
.mod-sys__log-error {
&-view-info {
width: 80%;
}
}
</style>

View File

@ -1,71 +1,121 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:49:17
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-login">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.creatorName" :placeholder="$t('logLogin.creatorName')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.status" :placeholder="$t('logLogin.status')" clearable>
<el-option :label="$t('logLogin.status0')" :value="0"></el-option>
<el-option :label="$t('logLogin.status1')" :value="1"></el-option>
<el-option :label="$t('logLogin.status2')" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logLogin.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logLogin.operation')" header-align="center" align="center">
<template slot-scope="scope">
{{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('logLogin.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logLogin.status0') }}</el-tag>
<el-tag v-else-if="scope.row.status === 1" size="small" type="success">{{ $t('logLogin.status1') }}</el-tag>
<el-tag v-else size="small" type="warning">{{ $t('logLogin.status2') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="ip" :label="$t('logLogin.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logLogin.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logLogin.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
/>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/log/login/page',
getDataListIsPage: true,
exportURL: '/sys/log/login/export'
import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "creatorName",
label: i18n.t("logLogin.creatorName"),
},
dataForm: {
creatorName: '',
status: ''
{
prop: "operation",
label: i18n.t("logLogin.operation"),
filter: sysFilter('logOperation'),
},
{
prop: "status",
label: i18n.t("logLogin.status"),
filter: sysFilter('logStatus'),
},
{
prop: "ip",
label: i18n.t("logLogin.ip"),
},
{
prop: "userAgent",
label: i18n.t("logLogin.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logLogin.createDate"),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/log/login/page",
deleteURL: "/sys/log/login",
exportUrl: "/sys/log/login/export",
},
tableProps,
formConfig: [
{
type: "input",
label: i18n.t("logLogin.creatorName"),
placeholder: i18n.t("logLogin.creatorName"),
param: "creatorName",
},
{
type: "select",
label: "状态",
selectOptions: [
{ id: "0", name: i18n.t("logLogin.status0") },
{ id: "1", name: i18n.t("logLogin.status1") },
{ id: "2", name: i18n.t("logLogin.status2") },
],
param: "status",
defaultSelect: "",
onchange: true,
width: 200,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.creatorName = val.creatorName;
this.listQuery.status = val.status;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
}
}
}
};
</script>

View File

@ -1,69 +1,127 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:50:27
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-operation">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-select v-model="dataForm.status" :placeholder="$t('logOperation.status')" clearable>
<el-option :label="$t('logOperation.status0')" :value="0"></el-option>
<el-option :label="$t('logOperation.status1')" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logOperation.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logOperation.operation')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestUri" :label="$t('logOperation.requestUri')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestMethod" :label="$t('logOperation.requestMethod')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestParams" :label="$t('logOperation.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="requestTime" :label="$t('logOperation.requestTime')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
{{ `${scope.row.requestTime}ms` }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('logOperation.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logOperation.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('logOperation.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="ip" :label="$t('logOperation.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logOperation.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logOperation.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
/>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/log/operation/page',
getDataListIsPage: true,
exportURL: '/sys/log/operation/export'
import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "creatorName",
label: i18n.t("logOperation.creatorName"),
},
dataForm: {
status: ''
{
prop: "operation",
label: i18n.t("logOperation.operation"),
},
{
prop: "requestUri",
label: i18n.t("logOperation.requestUri"),
},
{
prop: "requestMethod",
label: i18n.t("logOperation.requestMethod"),
},
{
prop: "requestParams",
label: i18n.t("logOperation.requestParams"),
},
{
prop: "requestTime",
label: i18n.t("logOperation.requestTime"),
},
{
prop: "status",
label: i18n.t("logOperation.status"),
filter: sysFilter('logStatus'),
},
{
prop: "ip",
label: i18n.t("logOperation.ip"),
},
{
prop: "userAgent",
label: i18n.t("logOperation.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logOperation.createDate"),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/log/operation/page",
exportUrl: "/sys/log/operation/export",
},
tableProps,
formConfig: [
{
type: "select",
label: "状态",
selectOptions: [
{ id: "0", name: i18n.t("logOperation.status0") },
{ id: "1", name: i18n.t("logOperation.status1") },
],
param: "status",
defaultSelect: "",
onchange: true,
width: 200,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.status = val.status;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
}
}
}
};
</script>

View File

@ -1,5 +1,4 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="type" :label="$t('menu.type')" size="mini">
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
@ -53,19 +52,20 @@
<el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { getIconList } from '@/utils'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/menu/',
infoURL: '/sys/menu'
},
visible: false,
menuList: [],
menuListVisible: false,
@ -102,7 +102,8 @@ export default {
}
},
methods: {
init () {
init(id) {
this.dataForm.id = id || "";
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -172,7 +173,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,55 +1,133 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:47:14
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button v-if="$hasPermission('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
</template>
</el-table-column>
<el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag>
<el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column>
<el-table-column prop="url" :label="$t('menu.url')" header-align="center" align="center" width="150" :show-overflow-tooltip="true" ></el-table-column>
<el-table-column prop="permissions" :label="$t('menu.permissions')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:menu:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:menu:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<div class="mod-sys__dept">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './menu-add-or-update'
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "name",
label: i18n.t("menu.name"),
},
{
prop: "icon",
label: i18n.t("menu.icon"),
},
{
prop: "type",
label: i18n.t("menu.type"),
filter: sysFilter('menuType'),
},
{
prop: "sort",
label: i18n.t("menu.sort"),
},
{
prop: "url",
label: i18n.t("menu.url"),
},
{
prop: "permissions",
label: i18n.t("menu.permissions"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [mixinViewModule],
data () {
mixins: [basicPage],
data() {
return {
mixinViewModuleOptions: {
urlOptions: {
getDataListURL: '/sys/menu/list',
deleteURL: '/sys/menu'
}
}
},
tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
}
this.tableData = res.data;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
}
};
</script>

View File

@ -1,5 +1,11 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 14:40:11
* @Description:
-->
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
@ -11,18 +17,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/params/',
infoURL: '/sys/params'
},
visible: false,
dataForm: {
id: '',
@ -45,7 +52,8 @@ export default {
}
},
methods: {
init () {
init(id) {
this.dataForm.id = id || "";
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -82,7 +90,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,67 +1,124 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__params">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:params:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:params:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="paramCode" :label="$t('params.paramCode')" header-align="center" align="center"></el-table-column>
<el-table-column prop="paramValue" :label="$t('params.paramValue')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('params.remark')" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:params:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:params:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './params-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/params/page',
getDataListIsPage: true,
deleteURL: '/sys/params',
deleteIsBatch: true
import i18n from "@/i18n";
const tableProps = [
{
prop: "paramCode",
label: i18n.t("params.paramCode"),
},
dataForm: {
paramCode: ''
}
}
{
prop: "paramValue",
label: i18n.t("params.paramValue"),
},
{
prop: "remark",
label: i18n.t("params.remark"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/params/page",
deleteURL: "/sys/params",
},
tableProps,
tableBtn,
formConfig: [
{
type: "input",
label: i18n.t("params.paramCode"),
placeholder: i18n.t("params.paramCode"),
param: "paramCode",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.paramCode = val.paramCode;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
}
},
}
};
</script>

View File

@ -1,5 +1,4 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
@ -34,18 +33,19 @@
</el-col>
</el-row>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/role/',
infoURL: '/sys/role'
},
visible: false,
menuList: [],
deptList: [],
@ -68,8 +68,8 @@ export default {
}
},
methods: {
init () {
this.visible = true
init(id) {
this.dataForm.id = id || "";
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
@ -137,7 +137,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,79 +1,124 @@
<!--
* @Author: zwq
* @Date: 2022-08-22 14:57:51
* @LastEditors: zwq
* @LastEditTime: 2022-12-07 14:54:22
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__role">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="name" :label="$t('role.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('role.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('role.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './role-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/role/page',
getDataListIsPage: true,
deleteURL: '/sys/role',
deleteIsBatch: true
import i18n from "@/i18n";
const tableProps = [
{
prop: "name",
label: i18n.t("role.name"),
},
dataForm: {
}
}
{
prop: "remark",
label: i18n.t("role.remark"),
},
{
prop: "createDate",
label: i18n.t("role.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: '/sys/role/page',
deleteURL: '/sys/role',
},
tableProps,
tableBtn,
formConfig: [
{
type: "input",
label: i18n.t("role.name"),
placeholder: i18n.t("role.name"),
param: "name",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
}
},
}
};
</script>

View File

@ -1,6 +1,5 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item prop="username" :label="$t('user.username')">
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
</el-form-item>
@ -37,19 +36,20 @@
</el-radio-group>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { isEmail, isMobile } from '@/utils/validate'
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data () {
return {
urlOptions: {
submitURL: '/sys/user/',
infoURL: '/sys/user'
},
visible: false,
roleList: [],
roleIdListDefault: [],
@ -124,7 +124,8 @@ export default {
}
},
methods: {
init () {
init(id) {
this.dataForm.id = id || "";
this.visible = true
this.dataForm.deptId = ''
this.$nextTick(() => {
@ -170,7 +171,7 @@ export default {
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
dataFormSubmit: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
@ -191,7 +192,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$emit('successSubmit')
}
})
}).catch(() => {})

View File

@ -1,98 +1,144 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input>
</el-form-item>
<el-form-item>
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select>
</el-form-item>
<el-form-item>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
{{ $getDictLabel("gender", scope.row.gender) }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './user-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/user/page',
getDataListIsPage: true,
deleteURL: '/sys/user',
deleteIsBatch: true,
exportURL: '/sys/user/export'
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from "./user-add-or-update";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "username",
label: i18n.t("user.username"),
},
dataForm: {
username: '',
deptId: '',
gender: ''
}
}
{
prop: "deptName",
label: i18n.t("user.deptName"),
},
{
prop: "email",
label: i18n.t("user.email"),
},
{
prop: "mobile",
label: i18n.t("user.mobile"),
},
{
prop: "gender",
label: i18n.t("user.gender"),
filter: sysFilter('sex'),
},
{
prop: "status",
label: i18n.t("user.status"),
filter: sysFilter('userStatus'),
},
{
prop: "createDate",
label: i18n.t("user.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/user/page",
deleteURL: "/sys/user",
exportUrl: "/sys/user/export",
},
tableProps,
tableBtn,
formConfig: [
{
type: "input",
label: i18n.t("user.username"),
placeholder: i18n.t("user.username"),
param: "username",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate
AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.username = val.username;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
}
},
}
};
</script>

View File

@ -97,6 +97,9 @@ export default {
xAxis: {
type: "category",
boundaryGap: false,
data: this.dataList.map((item) => {
return item.name;
}),
},
yAxis: {
type: "value",

View File

@ -426,7 +426,7 @@ export default {
this.inspectionStageArr = [];
this.$set(this.optionArr, "arr4", []);
done();
this.$emit("refreshDataList");
this.$emit("successSubmit");
})
.catch((_) => {});
},

View File

@ -204,7 +204,7 @@
:optionArr="optionArr"
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
@successSubmit="getDataList"
></add-or-update>
</el-card>
</template>

View File

@ -2,15 +2,20 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-09-21 09:22:30
* @LastEditTime: 2023-04-10 15:09:23
* @Description:
-->
<template>
<div class="baseDialog">
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<template #title>
<slot name="title">
<div class="titleStyle">{{ !dataForm.id ? '新增' : '修改' }}</div>
</slot>
</template>
<el-row :gutter="5">
<el-form
:model="dataForm"
@ -66,6 +71,7 @@
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -168,7 +174,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
this.$emit("successSubmit");
},
});
})
@ -178,3 +184,28 @@ export default {
},
};
</script>
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
}
</style>

View File

@ -1,78 +1,53 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<el-form
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
/>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<el-form-item>
<el-select
size="small"
v-model="dataForm.type"
placeholder="请选择类型"
style="width:150px"
clearable
>
<el-option
v-for="(item, index) in typeArr"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询
</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="type" align="center" label="类型">
<template slot-scope="scope">
<span>{{
scope.row.type === '2' ? "计数" : "计量"
}}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import basicPage from '@/mixins/basic-page'
import basicFilter from '@/filters/basic-filter'
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "type",
label: "类型",
filter: basicFilter("tType"),
},
];
export default {
mixins: [basicPage],
data() {
@ -82,21 +57,51 @@ export default {
deleteURL: '/qualityPlanning/controlGraph',
exportUrl: '/qualityPlanning/controlGraph/export'
},
typeArr: [
tableProps,
tableData: [],
formConfig: [
{
label: "计量",
value: "1",
type: "select",
label: "类型",
selectOptions: [
{ id: 1, name: "计量" },
{ id: 2, name: "计数" },
],
param: "type",
defaultSelect: "",
},
{
label: "计数",
value: "2",
}
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
],
};
},
components: {
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.type = val.type;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('控制图形')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -2,23 +2,22 @@
* @Author: zwq
* @Date: 2022-12-01 14:52:41
* @LastEditors: zwq
* @LastEditTime: 2022-12-01 16:34:58
* @LastEditTime: 2023-04-10 15:00:17
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<el-form
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<span class="blue-block"></span>
<el-form-item label="样本大小:">
<el-input size="small" type="number" v-model="dataForm.name" placeholder="请输入样本大小" clearable />
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
<el-button size="small" type="primary" @click="getDataList()">
查询
</el-button>
</el-form-item>
@ -112,6 +111,15 @@ export default {
};
</script>
<style scoped>
.blue-block {
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 12px;
}
.rowClass >>> td {
padding: 2px 0;
}

View File

@ -1,91 +1,62 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'判读方案'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
@successSubmit="getDataList"
></add-or-update>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/interpretationScheme-add'
import queryForm from './query-form'
import basicPage from '@/mixins/basic-page'
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
]
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
@ -95,13 +66,70 @@ export default {
deleteURL: '/qualityPlanning/myInterpretationScheme',
exportUrl: '/qualityPlanning/myInterpretationScheme/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('判读方案')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -2,15 +2,10 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:21
* @LastEditTime: 2023-04-10 14:14:37
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
@ -55,11 +50,6 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>

View File

@ -6,10 +6,6 @@
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -36,11 +32,6 @@
<el-input v-model="dataForm.remark" placeholder="描述"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>

View File

@ -6,10 +6,13 @@
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item>
@ -17,11 +20,7 @@
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item>
<el-form-item label="工序类型" prop="workingProcedureTypeId">
<el-select
v-model="dataForm.workingProcedureTypeId"
filterable
placeholder="请选择工序类型"
>
<el-select v-model="dataForm.workingProcedureTypeId" filterable placeholder="请选择工序类型">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
@ -32,42 +31,32 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import basicAdd from '@/mixins/basic-add'
import basicAdd from "@/mixins/basic-add";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
submitURL: '/basic/workingProcedure/',
infoURL: '/basic/workingProcedure',
submitURL: "/basic/workingProcedure/",
infoURL: "/basic/workingProcedure",
getOption: true,
optionArrUrl: ['/basic/workingProcedureType/page'],
optionArrUrl: ["/basic/workingProcedureType/page"],
},
dataForm: {
id: '',
code: '',
name: '',
workingProcedureTypeId: ''
id: "",
code: "",
name: "",
workingProcedureTypeId: "",
},
dataRule: {
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
]
}
}
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
},
methods: {
}
}
};
},
methods: {},
};
</script>

View File

@ -93,7 +93,7 @@ export default {
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
this.$emit("successSubmit");
},
});
})

View File

@ -2,14 +2,10 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:06
* @LastEditTime: 2023-04-10 14:30:10
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -18,11 +14,6 @@
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>

View File

@ -2,16 +2,21 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-01-06 15:25:05
* @LastEditTime: 2023-04-10 15:25:32
* @Description:
-->
<template>
<div class="baseDialog">
<el-dialog
:title="!productId ? '新增' : '修改'"
:fullscreen="true"
:visible.sync="visible"
:before-close="cancle"
:visible.sync="visible"
>
<template #title>
<slot name="title">
<div class="titleStyle">{{ !productId ? '新增' : '修改' }}</div>
</slot>
</template>
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-steps :active="active" align-center finish-status="success" process-status="finish">
@ -59,6 +64,7 @@
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -111,7 +117,7 @@ export default {
this[this.stepShowObj[2]] = false;
this[this.stepShowObj[3]] = false;
this.visible = false;
this.$emit("refreshDataList");
this.$emit("successSubmit");
} else {
this.$refs[this.stepArr[this.active]].dataFormSubmit();
}
@ -138,7 +144,7 @@ export default {
this[this.stepShowObj[2]] = false;
this[this.stepShowObj[3]] = false;
this.visible = false;
this.$emit("refreshDataList");
this.$emit("successSubmit");
},
setPrductId(id) {
this.productId = id;
@ -155,3 +161,28 @@ export default {
height: 90px;
}
</style>
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
}
</style>

View File

@ -2,11 +2,21 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-01-06 14:16:17
* @LastEditTime: 2023-04-10 15:45:39
* @Description:
-->
<template>
<el-dialog :title="!fourDataForm.id ? '新增' : '修改'" append-to-body :visible.sync="fourVisible">
<el-dialog
:close-on-click-modal="false"
:visible.sync="fourVisible"
append-to-body
class="baseDialog"
>
<template #title>
<slot name="title">
<div class="titleStyle">{{ !fourDataForm.id ? '新增' : '修改' }}</div>
</slot>
</template>
<el-row :gutter="10">
<el-form
:model="fourDataForm"
@ -381,3 +391,28 @@ export default {
},
};
</script>
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
}
</style>

View File

@ -2,11 +2,11 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-01-03 14:06:12
* @LastEditTime: 2023-04-10 15:44:28
* @Description:
-->
<template>
<div>
<div class="baseTable">
<div v-if="workingProcedure.length && productFeaturesOptions.length">
<el-tabs @tab-click="tabClick">
<el-tab-pane
@ -47,11 +47,9 @@
<el-tab-pane label="特性列表" align="center">
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
background: '#F2F4F9',
color: '#606266',
height: '56px',
}"
style="width: 100%;"
>
@ -317,3 +315,13 @@ export default {
},
};
</script>
<style>
.baseTable .el-table__body tr.current-row > td.el-table__cell {
background-color: #eaf1fc;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -2,18 +2,21 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:51:44
* @LastEditTime: 2023-04-10 15:43:27
* @Description:
-->
<template>
<el-dialog title="历史记录" append-to-body :visible.sync="hisVisible">
<el-dialog :visible.sync="hisVisible" append-to-body class="baseDialog">
<template #title>
<slot name="title">
<div class="titleStyle">历史记录</div>
</slot>
</template>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
background: '#F2F4F9',
color: '#606266',
height: '56px',
}"
style="width: 100%;"
>
@ -96,3 +99,32 @@ export default {
},
};
</script>
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before {
content: "";
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
}
.baseDialog .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -2,15 +2,21 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-12-12 15:51:58
* @LastEditTime: 2023-04-10 15:40:38
* @Description:
-->
<template>
<el-dialog
:title="!threeDataForm.id ? '新增' : '修改'"
append-to-body
:close-on-click-modal="false"
:visible.sync="threeVisible"
append-to-body
class="baseDialog"
>
<template #title>
<slot name="title">
<div class="titleStyle">{{ !threeDataForm.id ? '新增' : '修改' }}</div>
</slot>
</template>
<el-row :gutter="10">
<el-form
:model="threeDataForm"
@ -299,3 +305,28 @@ export default {
},
};
</script>
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
}
</style>

View File

@ -2,24 +2,21 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:52:10
* @LastEditTime: 2023-04-10 15:46:38
* @Description:
-->
<template>
<div>
<div class="baseTable">
<div style="float:right;margin-bottom:10px">
<el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增
</el-button>
</div>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
background: '#F2F4F9',
color: '#606266'
}"
v-loading="dataListLoading"
style="width: 100%;"
@ -163,3 +160,13 @@ export default {
},
};
</script>
<style>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -2,11 +2,11 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:52:21
* @LastEditTime: 2023-04-10 15:29:25
* @Description:
-->
<template>
<div>
<div class="baseTable">
<div style="margin-bottom:20px">
<el-tooltip content="选择工序,新增到表格" placement="top">
<el-select
@ -24,11 +24,9 @@
</div>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
background: '#F2F4F9',
color: '#606266'
}"
v-loading="dataListLoading"
style="width: 100%;"
@ -225,3 +223,13 @@ export default {
},
};
</script>
<style>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -2,37 +2,18 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:11
* @LastEditTime: 2023-02-17 11:08:34
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item>
<el-form-item label="描述" prop="descs">
<el-input v-model="dataForm.descs" placeholder="描述"></el-input>
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
@ -42,22 +23,25 @@ export default {
data() {
return {
urlOptions: {
submitURL: '/basic/productType/',
infoURL: '/basic/productType'
submitURL: '/basic/workingProcedureType/',
infoURL: '/basic/workingProcedureType'
},
dataForm: {
id: "",
code: "",
name: "",
descs: "",
id: '',
code: '',
name: ''
},
dataRule: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
},
};
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
]
}
}
},
methods: {
},
};
}
}
</script>

View File

@ -2,14 +2,10 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:16:06
* @LastEditTime: 2023-04-10 14:34:08
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -21,11 +17,6 @@
<el-input v-model="dataForm.platformGroup" placeholder="站点分组"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>

View File

@ -2,14 +2,10 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:59:45
* @LastEditTime: 2023-04-10 14:39:41
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -48,11 +44,6 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
@ -72,6 +63,7 @@ export default {
type: '',
parentType: ''
},
parentTypeArr: [],
typeArr: [
{
name: '计数',

View File

@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 15:07:43
* @LastEditTime: 2023-04-10 14:42:57
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
:visible.sync="visible"
append-to-body>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>

View File

@ -83,7 +83,7 @@
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
@successSubmit="getDataList"
></add-or-update>
</el-dialog>
</template>

View File

@ -6,10 +6,6 @@
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -33,11 +29,6 @@
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>

View File

@ -1,186 +1,146 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<el-form
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-form-item>
<el-input size="small" v-model="dataForm.name" clearable placeholder="请输入名称查询" />
</el-form-item>
<el-form-item>
<el-input size="small" v-model="dataForm.code" clearable placeholder="请输入编码查询" />
</el-form-item>
<el-form-item>
<el-select
size="small"
v-model="dataForm.type"
placeholder="请选择类型"
style="width:150px"
clearable
>
<el-option
v-for="(item, index) in typeArr"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询
</el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增
</el-button>
<el-button size="small" type="primary" @click="exportHandle('工厂管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column
type="type"
header-align="center"
align="center"
label="类型"
>
<template slot-scope="scope">
<el-tag :type="scope.row.type === '1' ? '' : 'success'">{{
scope.row.type === '1' ? "内部工厂" : "供应商"
}}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="supplier" label="供应商"> </el-table-column> -->
<el-table-column prop="address" align="center" label="联系地址"> </el-table-column>
<el-table-column prop="descs" align="center" label="描述"> </el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id, scope.row.name)">
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/factoryManage-add'
import basicPage from '@/mixins/basic-page'
import AddOrUpdate from "./components/factoryManage-add";
import basicPage from "@/mixins/basic-page";
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "type",
label: "类型",
filter: basicFilter("fType"),
},
{
prop: "address",
label: "联系地址",
},
{
prop: "descs",
label: "描述",
},
{
prop: "status",
label: "状态",
filter: basicFilter("status"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: '/basic/factory/page',
deleteURL: '/basic/factory',
statusUrl: '/basic/factory/status',
exportUrl: '/basic/factory/export'
getDataListURL: "/basic/factory/page",
deleteURL: "/basic/factory",
statusUrl: "/basic/factory/status",
exportUrl: "/basic/factory/export",
},
typeArr: [
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
label: "内部工厂",
value: "1",
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
label: "供应商",
value: "2",
}
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "select",
label: "性别",
selectOptions: [
{ id: 1, name: "内部工厂" },
{ id: 2, name: "供应商" },
],
param: "type",
defaultSelect: "",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
@ -188,6 +148,28 @@ export default {
AddOrUpdate,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.type = val.type;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('工厂管理')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -0,0 +1,36 @@
<!--
* @Author: zwq
* @Date: 2023-02-17 10:30:58
* @LastEditors: zwq
* @LastEditTime: 2023-04-10 14:32:10
* @Description:
-->
<template>
<div style="pointer-events: none;">
<el-checkbox-group :value="injectData.inspectionStage.split(',')">
<el-checkbox label="1">进货检验</el-checkbox>
<el-checkbox label="2">过程检验</el-checkbox>
<el-checkbox label="3">成品检验</el-checkbox>
<el-checkbox label="4">出货检验</el-checkbox>
</el-checkbox-group>
</div>
</template>
<script>
export default {
name: "operation",
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {};
},
methods: {},
};
</script>
<style scoped></style>

View File

@ -1,122 +1,85 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'机台管理'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="platformName" align="center" label="站点"> </el-table-column>
<el-table-column prop="remark" align="center" label="描述"> </el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/machineManage-add'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import basicFilter from '@/filters/basic-filter'
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "platformName",
label: "站点",
},
{
prop: "remark",
label: "描述",
},
{
prop: "status",
label: "状态",
filter: basicFilter('status'),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
@ -127,13 +90,70 @@ export default {
statusUrl: '/basic/machine/status',
exportUrl: '/basic/machine/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('机台管理')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -1,138 +1,44 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'工序定义'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="workingProcedureTypeName" align="center" label="类型"> </el-table-column>
<el-table-column prop="machineName" align="center" label="机台">
<template slot-scope="scope">
<span>{{ scope.row.machineName}}</span>
</template>
</el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="200"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="220"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-button
type="text"
size="small"
@click="bindMachine(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="绑定机台"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-进工业炉加工"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
<bind-machine
v-if="bindMachineVisible"
ref="bindMachineRef"
@refreshDataList="getDataList"
@successSubmit="successSubmit"
></bind-machine>
</div>
</el-card>
</template>
@ -140,7 +46,50 @@
import AddOrUpdate from './components/processDefine-add'
import BindMachine from './components/processDefine-machine'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "workingProcedureTypeName",
label: "类型",
},
{
prop: "machineName",
label: "机台",
},
{
prop: "status",
label: "状态",
filter: basicFilter("status"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
{
type: "Machine",
btnName: "绑定机台",
},
];
export default {
mixins: [basicPage],
data() {
@ -151,15 +100,75 @@ export default {
statusUrl: '/basic/workingProcedure/status',
exportUrl: '/basic/workingProcedure/export'
},
bindMachineVisible: false
bindMachineVisible: false,
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
}
},
components: {
AddOrUpdate,
queryForm,
BindMachine
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('工序定义')
break;
default:
console.log(val)
}
},
otherMethods(val){
this.bindMachine(val.data.id)
},
bindMachine (id) {
this.bindMachineVisible = true
this.$nextTick(() => {

View File

@ -3,7 +3,7 @@
* @Date: 2022-09-01 15:42:34
* @LastEditors: zwq
* @LastEditTime: 2022-09-13 11:34:30
* @Description:
* @Description: 页面弃用
-->
<template>
<el-row :gutter="20">

View File

@ -1,115 +1,77 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'工序类型'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id, scope.row.name)">
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/processType-add'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "status",
label: "状态",
filter: basicFilter('status'),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
@ -120,13 +82,70 @@ export default {
statusUrl: '/basic/workingProcedureType/status',
exportUrl: '/basic/workingProcedureType/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('工序类型')
break;
default:
console.log(val)
}
},
},
}
</script>

View File

@ -1,197 +1,103 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<el-form
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-form-item>
<el-input size="small" v-model="dataForm.name" clearable placeholder="请输入名称查询" />
</el-form-item>
<el-form-item>
<el-input size="small" v-model="dataForm.code" clearable placeholder="请输入编码查询" />
</el-form-item>
<el-form-item>
<el-select
size="small"
v-model="dataForm.product_type_id"
placeholder="请选择产品类型"
style="width:150px"
clearable
>
<el-option
v-for="(item, index) in productTypeArr"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
size="small"
v-model="dataForm.inspection_stage"
placeholder="请选择检验阶段"
style="width:150px"
clearable
>
<el-option
v-for="(item, index) in inspectionStageOptions"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询
</el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增
</el-button>
<el-button size="small" type="primary" @click="exportHandle('产品列表')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
}"
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column
fixed="left"
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称" fixed="left"> </el-table-column>
<el-table-column prop="code" align="center" label="编码" fixed="left"> </el-table-column>
<el-table-column prop="specifications" align="center" label="规格"> </el-table-column>
<el-table-column prop="drawing" align="center" label="图纸"> </el-table-column>
<el-table-column prop="productType" align="center" label="产品类型"> </el-table-column>
<el-table-column prop="descs" align="center" label="描述"> </el-table-column>
<el-table-column prop="remark" align="center" label="备注"> </el-table-column>
<el-table-column prop="inspectionStandard" align="center" label="检验标准"> </el-table-column>
<el-table-column prop="inspectionStage" align="center" label="检验阶段">
<template slot-scope="scope">
<div style="pointer-events: none;">
<el-checkbox-group :value="scope.row.inspectionStage.split(',')">
<el-checkbox label="1">进货检验</el-checkbox>
<el-checkbox label="2">过程检验</el-checkbox>
<el-checkbox label="3">成品检验</el-checkbox>
<el-checkbox label="4">出货检验</el-checkbox>
</el-checkbox-group>
</div>
</template>
</el-table-column>
<el-table-column type="status" header-align="center" align="center" label="状态" width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="检验计划"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="检验计划"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#icon-详情"></use>
</svg>
</el-tooltip>
</el-button>
</template>
</el-table-column> -->
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
@successSubmit="getDataList"
></add-or-update>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from "./components/productList-add";
import inspectionStage from "./inspectionStage"
import basicPage from "@/mixins/basic-page";
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "specifications",
label: "规格",
},
{
prop: "drawing",
label: "图纸",
},
{
prop: "productType",
label: "产品类型",
},
{
prop: "remark",
label: "备注",
},
{
prop: "descs",
label: "描述",
},
{
prop: "inspectionStandard",
label: "检验标准",
},
{
prop: "inspectionStage",
label: "检验阶段",
subcomponent: inspectionStage
},
{
prop: "status",
label: "状态",
filter: basicFilter("status"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
@ -202,23 +108,61 @@ export default {
statusUrl: "/basic/product/status",
exportUrl: "/basic/product/export",
},
productTypeArr: [],
inspectionStageOptions: [
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
label: "进货检验",
value: "1",
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
label: "过程检验",
value: "2",
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
label: "成品检验",
value: "3",
type: "select",
label: "产品类型",
selectOptions: [
],
param: "product_type_id",
defaultSelect: "",
},
{
label: "出货检验",
value: "4",
type: "select",
label: "检验阶段",
selectOptions: [
{ id: 1, name: "进货检验" },
{ id: 2, name: "过程检验" },
{ id: 3, name: "成品检验" },
{ id: 4, name: "出货检验" },
],
param: "inspection_stage",
defaultSelect: "",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
@ -230,6 +174,29 @@ export default {
this.getArr();
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.product_type_id = val.product_type_id;
this.listQuery.inspection_stage = val.inspection_stage;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('产品列表')
break;
default:
console.log(val)
}
},
getArr() {
this.$http
.get("/basic/productType/page", {
@ -240,10 +207,10 @@ export default {
})
.then(({ data: res }) => {
if (res.code !== 0) {
this.productTypeArr = [];
this.formConfig[2].selectOptions = [];
return this.$message.error(res.msg);
}
this.productTypeArr = res.data.list;
this.formConfig[2].selectOptions = res.data.list;
})
.catch(() => {});
},

View File

@ -1,111 +1,158 @@
<!--
* @Author: zwq
* @Date: 2022-08-22 15:53:16
* @LastEditors: zwq
* @LastEditTime: 2023-02-17 11:00:02
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'产品类型'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
}"
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column type="index" header-align="center" align="center" label="序号" width="50">
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="descs" align="center" label="描述"> </el-table-column>
<el-table-column type="status" header-align="center" align="center" label="状态" width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from "./components/productType-add";
import AddOrUpdate from './components/productType-add'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import basicFilter from '@/filters/basic-filter'
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "status",
label: "状态",
filter: basicFilter('status'),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: '/basic/productType/page',
deleteURL: '/basic/productType',
statusUrl: '/basic/productType/status',
exportUrl: '/basic/productType/export'
getDataListURL: '/basic/workingProcedureType/page',
deleteURL: '/basic/workingProcedureType',
statusUrl: '/basic/workingProcedureType/status',
exportUrl: '/basic/workingProcedureType/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
AddOrUpdate
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('产品类型')
break;
default:
console.log(val)
}
},
};
},
}
</script>

View File

@ -3,7 +3,7 @@
* @Date: 2022-09-15 10:44:29
* @LastEditors: zwq
* @LastEditTime: 2022-09-16 13:52:21
* @Description:
* @Description: 页面弃用
-->
<template>
<el-form

View File

@ -1,121 +1,82 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'站点管理'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="platformGroup" align="center" label="站点分组"> </el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/siteManage-add'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "platformGroup",
label: "站点分组",
},
{
prop: "status",
label: "状态",
filter: basicFilter('status'),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
@ -126,13 +87,70 @@ export default {
statusUrl: '/basic/platform/status',
exportUrl: '/basic/platform/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('站点管理')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -1,174 +1,171 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'量具管理'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="type" align="center" label="测量类型">
<template slot-scope="scope">
<span>{{
scope.row.type === '2' ? "计数" : "计量"
}}</span>
</template>
</el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="200"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="180"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-button
type="text"
size="small"
@click="detail(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="台差参数"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#icon-详情"></use>
</svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<detail
v-if="detailVisible"
ref="detailRef"
@refreshDataList="getDataList"
></detail>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
<detail v-if="detailVisible" ref="detailRef" @successSubmit="getDataList"></detail>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/toolsType-add'
import Detail from './components/toolsType-detail'
import basicPage from '@/mixins/basic-page'
import queryForm from './query-form'
import AddOrUpdate from "./components/toolsType-add";
import Detail from "./components/toolsType-detail";
import basicPage from "@/mixins/basic-page";
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "type",
label: "测量类型",
filter: basicFilter("tType"),
},
{
prop: "status",
label: "状态",
filter: basicFilter("status"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "detail",
btnName: "详情",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: '/basic/measureTool/page',
deleteURL: '/basic/measureTool',
statusUrl: '/basic/measureTool/status',
exportUrl: '/basic/measureTool/export'
getDataListURL: "/basic/measureTool/page",
deleteURL: "/basic/measureTool",
statusUrl: "/basic/measureTool/status",
exportUrl: "/basic/measureTool/export",
},
detailVisible: false,
}
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
Detail
Detail,
},
methods: {
detail (id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.detailRef.init(id)
})
},
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = "新增";
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case "export":
this.exportHandle("量具管理");
break;
default:
console.log(val);
}
}
},
otherMethods(val) {
this.detail(val.data.id);
},
detail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.detailRef.init(id);
});
},
},
};
</script>

View File

@ -1,127 +1,82 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'计量单位'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="type" align="center" label="类型">
<template slot-scope="scope">
<span>{{
scope.row.type === 2 ? "不可计数" : "可计数"
}}</span>
</template>
</el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
</el-card>
</template>
<script>
import AddOrUpdate from './components/unitList-add'
import queryForm from './query-form'
import basicPage from '@/mixins/basic-page'
import basicFilter from "@/filters/basic-filter";
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
{
prop: "type",
label: "类型",
filter: basicFilter('uType'),
},
{
prop: "status",
label: "状态",
filter: basicFilter('status'),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
{
type: "change",
btnName: "改变状态",
},
];
export default {
mixins: [basicPage],
data() {
@ -132,13 +87,70 @@ export default {
statusUrl: '/basic/unit/status',
exportUrl: '/basic/unit/export'
},
tableProps,
tableBtn,
tableData: [],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "name",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "code",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
case "export":
this.exportHandle('工序类型')
break;
default:
console.log(val)
}
},
},
};
</script>

View File

@ -1,13 +1,20 @@
/**
* 配置参考: https://cli.vuejs.org/zh/config/
*/
module.exports = {
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
chainWebpack: config => {
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
chainWebpack: (config) => {
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
},
@ -20,4 +27,5 @@ module.exports = {
warnings: true
}
}
}
}