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" "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": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz", "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", "axios": "^0.19.2",
"babel-eslint": "^8.0.1", "babel-eslint": "^8.0.1",
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"code-brick-zj": "0.0.7",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-22 14:57:50 * @Date: 2022-08-22 14:57:50
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-01-06 14:57:22 * @LastEditTime: 2023-04-10 13:55:02
* @Description: * @Description:
--> -->
<!DOCTYPE html> <!DOCTYPE html>
@ -37,7 +37,9 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script> <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> </script>
<% } %> <% } %>
<!-- 集成测试环境 --> <!-- 集成测试环境 -->

View File

@ -394,7 +394,7 @@ img {
} }
.aui-navbar__icon-menu { .aui-navbar__icon-menu {
vertical-align: middle; vertical-align: middle;
font-size: 16px; font-size: 24px;
} }
.el-dropdown { .el-dropdown {
color: $--color-text-secondary; 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 Cookies from 'js-cookie'
import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN' import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
import zhCN from './zh-CN' import zhCN from './zh-CN'
import EnLocale from 'element-ui/lib/locale/lang/en'
import en from './en'
Vue.use(VueI18n) Vue.use(VueI18n)
@ -10,8 +12,13 @@ export const messages = {
'zh-CN': { 'zh-CN': {
'_lang': '简体中文', '_lang': '简体中文',
...zhCN, ...zhCN,
...zhCNLocale ...zhCNLocale,
} },
'en': {
'_lang': 'English',
...en,
...EnLocale
},
} }
export default new VueI18n({ export default new VueI18n({

View File

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

View File

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

View File

@ -2,151 +2,197 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-09-16 13:50:19 * @LastEditTime: 2023-02-17 10:59:11
* @Description: * @Description:
*/ */
export default { export default {
data () { data() {
/* eslint-disable */ /* eslint-disable */
return { return {
urlOptions: { urlOptions: {
getDataListURL: '', getDataListURL: '',
deleteURL: '', deleteURL: '',
statusUrl: '', statusUrl: '',
exportUrl: '' exportUrl: ''
}, },
dataList: [], addOrEditTitle: '',
dataForm: {}, tableData: [],
pageIndex: 1, listQuery: {
pageSize: 10, limit: 10,
totalPage: 0, page: 1,
dataListLoading: false, total: 1,
addOrUpdateVisible: false, },
} dataListLoading: false,
}, addOrUpdateVisible: false,
created () { }
}, },
activated() { created() {
this.getDataList(); },
}, activated() {
methods: { this.getDataList();
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.$http this.$http
.get(this.urlOptions.getDataListURL, { .get(this.urlOptions.getDataListURL, {
params: { params: this.listQuery,
page: this.pageIndex,
limit: this.pageSize,
...this.dataForm
},
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
this.totalPage = 0;
return this.$message.error(res.msg);
}
this.dataList = res.data.list;
this.totalPage = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => {});
},
// 删除
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}) })
.then(() => { .then(({ data: res }) => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => { this.dataListLoading = false;
if (data && data.code === 0) { if (res.code !== 0) {
this.$message({ this.tableData = [];
message: "操作成功", this.listQuery.total = 0;
type: "success", return this.$message.error(res.msg);
duration: 1500, }
onClose: () => { this.tableData = res.data.list;
this.getDataList(); this.listQuery.total = res.data.total;
}, })
}); .catch(() => {
} else { this.dataListLoading = false;
this.$message.error(data.msg); });
} },
}); // 每页数
}) sizeChangeHandle(val) {
.catch(() => {}); this.listQuery.limit = val;
}, this.listQuery.page = 1;
// 导出 this.getDataList();
exportHandle(name) { },
this.$http // 当前页
.get(this.urlOptions.exportUrl, { responseType: "blob" }) currentChangeHandle(val) {
.then(({ data: res }) => { this.listQuery.page = val;
var date = new Date(); this.getDataList();
var year = date.getFullYear(); },
var month = date.getMonth() + 1; // 新增 / 修改
var strDate = date.getDate(); addOrUpdateHandle(id) {
if (month >= 1 && month <= 9) { this.addOrUpdateVisible = true;
month = "0" + month; this.addOrEditTitle = "编辑";
} this.$nextTick(() => {
if (strDate >= 0 && strDate <= 9) { this.$refs.addOrUpdate.init(id);
strDate = "0" + strDate; });
} },
var currentdate = year + "-" + month + "-" + strDate; cancel(id) {
const blob = new Blob([res]); this.$refs["popover-" + id].showPopper = false;
const downloadElement = document.createElement("a"); },
const href = window.URL.createObjectURL(blob); // 创建下载的链接 //改变状态
downloadElement.href = href; changeStatus(id) {
downloadElement.download = `${name+currentdate}.xls`; // 下载后文件名 this.$http
document.body.appendChild(downloadElement); .post(this.urlOptions.statusUrl, { id })
downloadElement.click(); // 点击下载 .then(({ data: res }) => {
document.body.removeChild(downloadElement); // 下载完成移除元素 if (res.code !== 0) {
window.URL.revokeObjectURL(href); return this.$message.error(res.msg);
}) }
.catch(() => {}); //this.$refs["popover-" + id].showPopper = false;
} this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.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) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
} else {
this.$message.error(data.msg);
}
});
})
.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) {
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(() => { });
} }
}
} }

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 axios from 'axios'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import router from '@/router' import router from '@/router'
@ -16,7 +23,11 @@ const http = axios.create({
*/ */
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || '' if (config.url === "/login") {
config.headers['token'] = ''
} else {
config.headers['token'] = Cookies.get('token') || ''
}
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存GET请求默认带_t参数 // 防止缓存GET请求默认带_t参数

View File

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

View File

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

View File

@ -65,7 +65,7 @@
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </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> <log v-if="logVisible" ref="log"></log>
</div> </div>

View File

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

View File

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

View File

@ -40,7 +40,7 @@
<!-- 弹窗, 云存储配置 --> <!-- 弹窗, 云存储配置 -->
<config v-if="configVisible" ref="config"></config> <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> </div>
</el-card> </el-card>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <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="dataFormSubmit()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('dept.name')"> <el-form-item prop="name" :label="$t('dept.name')">
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
</el-form-item> </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-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dept.sort')"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dept/',
infoURL: '/sys/dept'
},
visible: false, visible: false,
deptList: [], deptList: [],
deptListVisible: false, deptListVisible: false,
@ -67,7 +67,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -117,7 +118,7 @@ export default {
this.deptListVisible = false this.deptListVisible = false
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmit: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
@ -132,7 +133,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dept"> <div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button v-if="$hasPermission('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> :table-data="tableData"
<el-table-column prop="name" :label="$t('dept.name')" header-align="center" min-width="150"></el-table-column> row-key="id"
<el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
<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"> <method-btn
<template slot-scope="scope"> v-if="tableBtn.length"
<el-button v-if="$hasPermission('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> slot="handleBtn"
<el-button v-if="$hasPermission('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :width="100"
</template> label="操作"
</el-table-column> :method-list="tableBtn"
</el-table> @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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dept-add-or-update' 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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/dept/list', getDataListURL: "/sys/dept/list",
deleteURL: '/sys/dept' deleteURL: "/sys/dept",
} },
} tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { 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> </script>

View File

@ -1,5 +1,4 @@
<template> <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="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictValue" :label="$t('dict.dictValue')"> <el-form-item prop="dictValue" :label="$t('dict.dictValue')">
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input> <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-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dict/data/',
infoURL: '/sys/dict/data'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -53,7 +53,9 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id,dictTypeId) {
this.dataForm.id = id || "";
this.dataForm.dictTypeId = dictTypeId || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -90,7 +92,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).catch(() => {})

View File

@ -1,96 +1,150 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')" clearable></el-input> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button @click="getDataList()">{{ $t('query') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> />
</el-form-item> </base-table>
</el-form> <pagination
<el-table :limit.sync="listQuery.limit"
v-loading="dataListLoading" :page.sync="listQuery.page"
:data="dataList" :total="listQuery.total"
border @pagination="getDataList"
@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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-data-add-or-update' import AddOrUpdate from './dict-data-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictValue",
label: i18n.t("dict.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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
createdIsNeed: false, getDataListURL: "/sys/dict/data/page",
getDataListURL: '/sys/dict/data/page', deleteURL: "/sys/dict/data",
getDataListIsPage: true,
deleteURL: '/sys/dict/data',
deleteIsBatch: true
}, },
dataForm: { tableProps,
dictTypeId: '0', tableBtn,
dictLabel: '', formConfig: [
dictValue: '' {
} 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: { components: {
AddOrUpdate AddOrUpdate,
}, },
created () { created () {
this.dataForm.dictTypeId = this.$route.params.dictTypeId || '0' this.listQuery.dictTypeId = this.$route.params.dictTypeId || '0'
this.getDataList() 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) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id this.$refs.addOrUpdate.init(id,this.listQuery.dictTypeId)
this.$refs.addOrUpdate.dataForm.dictTypeId = this.dataForm.dictTypeId
this.$refs.addOrUpdate.init()
}) })
} }
} }
} };
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <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="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictName" :label="$t('dict.dictName')"> <el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input> <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-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dict/type/',
infoURL: '/sys/dict/type'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -52,7 +52,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -89,7 +90,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')" clearable></el-input> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button @click="getDataList()">{{ $t('query') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> />
</el-form-item> </base-table>
</el-form> <pagination
<el-table :limit.sync="listQuery.limit"
v-loading="dataListLoading" :page.sync="listQuery.page"
:data="dataList" :total="listQuery.total"
border @pagination="getDataList"
@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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-type-add-or-update' import AddOrUpdate from './dict-type-add-or-update'
import { addDynamicRoute } from '@/router' import toDictType from './dict-type-to'
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictName",
label: i18n.t("dict.dictName"),
},
{
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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/dict/type/page', getDataListURL: "/sys/dict/type/page",
getDataListIsPage: true, deleteURL: "/sys/dict/type",
deleteURL: '/sys/dict/type',
deleteIsBatch: true
}, },
dataForm: { tableProps,
id: '0', tableBtn,
dictName: '', formConfig: [
dictType: '' {
} 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: { components: {
AddOrUpdate AddOrUpdate,
}, },
methods: { methods:{
// //search-bar
childHandle (row) { buttonClick(val) {
// switch (val.btnName) {
const routeParams = { case "search":
routeName: `${this.$route.name}__${row.id}`, this.listQuery.dictName = val.dictName;
title: `${this.$route.meta.title} - ${row.dictType}`, this.listQuery.dictType = val.dictType;
path: 'sys/dict-data', this.listQuery.page = 1;
params: { this.getDataList();
dictTypeId: row.id break;
} case "add":
} this.addOrEditTitle = '新增'
// this.addOrUpdateVisible = true;
addDynamicRoute(routeParams, this.$router) this.addOrUpdateHandle()
} break;
default:
console.log(val)
}
},
} }
} };
</script> </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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-error"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;"> :table-data="tableData"
<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> <pagination
<el-table-column prop="requestParams" :label="$t('logError.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> :limit.sync="listQuery.limit"
<el-table-column prop="ip" :label="$t('logError.ip')" header-align="center" align="center"></el-table-column> :page.sync="listQuery.page"
<el-table-column prop="userAgent" :label="$t('logError.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> :total="listQuery.total"
<el-table-column prop="createDate" :label="$t('logError.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> @pagination="getDataList"
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
export default { import i18n from "@/i18n";
mixins: [mixinViewModule], import Cookies from 'js-cookie'
data () { import qs from 'qs'
return { const tableProps = [
mixinViewModuleOptions: { {
getDataListURL: '/sys/log/error/page', prop: "requestUri",
getDataListIsPage: true, label: i18n.t("logError.requestUri"),
exportURL: '/sys/log/error/export'
}
}
}, },
methods: { {
// prop: "requestMethod",
infoHandle (info) { label: i18n.t("logError.requestMethod"),
this.$alert(info, this.$t('logError.errorInfo'), { },
customClass: 'mod-sys__log-error-view-info' {
}) 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: [basicPage],
data() {
return {
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)
}
},
//
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> </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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-login"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.creatorName" :placeholder="$t('logLogin.creatorName')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-select v-model="dataForm.status" :placeholder="$t('logLogin.status')" clearable> :table-data="tableData"
<el-option :label="$t('logLogin.status0')" :value="0"></el-option> />
<el-option :label="$t('logLogin.status1')" :value="1"></el-option> <pagination
<el-option :label="$t('logLogin.status2')" :value="2"></el-option> :limit.sync="listQuery.limit"
</el-select> :page.sync="listQuery.page"
</el-form-item> :total="listQuery.total"
<el-form-item> @pagination="getDataList"
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' 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"),
},
{
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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/log/login/page', getDataListURL: "/sys/log/login/page",
getDataListIsPage: true, deleteURL: "/sys/log/login",
exportURL: '/sys/log/login/export' exportUrl: "/sys/log/login/export",
}, },
dataForm: { tableProps,
creatorName: '', formConfig: [
status: '' {
} 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> </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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-operation"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-select v-model="dataForm.status" :placeholder="$t('logOperation.status')" clearable> :table-props="tableProps"
<el-option :label="$t('logOperation.status0')" :value="0"></el-option> :page="listQuery.page"
<el-option :label="$t('logOperation.status1')" :value="1"></el-option> :limit="listQuery.limit"
</el-select> :table-data="tableData"
</el-form-item> />
<el-form-item> <pagination
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :limit.sync="listQuery.limit"
</el-form-item> :page.sync="listQuery.page"
<el-form-item> :total="listQuery.total"
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> @pagination="getDataList"
</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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' 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"),
},
{
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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/log/operation/page', getDataListURL: "/sys/log/operation/page",
getDataListIsPage: true, exportUrl: "/sys/log/operation/export",
exportURL: '/sys/log/operation/export'
}, },
dataForm: { tableProps,
status: '' 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> </script>

View File

@ -1,5 +1,4 @@
<template> <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="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="type" :label="$t('menu.type')" size="mini"> <el-form-item prop="type" :label="$t('menu.type')" size="mini">
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id"> <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-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { getIconList } from '@/utils' import { getIconList } from '@/utils'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/menu/',
infoURL: '/sys/menu'
},
visible: false, visible: false,
menuList: [], menuList: [],
menuListVisible: false, menuListVisible: false,
@ -102,7 +102,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -172,7 +173,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu"> <div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button v-if="$hasPermission('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> :table-data="tableData"
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> row-key="id"
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
<template slot-scope="scope"> >
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <method-btn
</template> v-if="tableBtn.length"
</el-table-column> slot="handleBtn"
<el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center"> :width="100"
<template slot-scope="scope"> label="操作"
<el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag> :method-list="tableBtn"
<el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag> @clickBtn="handleClick"
</template> />
</el-table-column> </base-table>
<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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './menu-add-or-update' 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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/menu/list', getDataListURL: '/sys/menu/list',
deleteURL: '/sys/menu' deleteURL: '/sys/menu'
} },
} tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { 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> </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> <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="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="paramCode" :label="$t('params.paramCode')"> <el-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input> <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-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/params/',
infoURL: '/sys/params'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -45,7 +52,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -82,7 +90,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).catch(() => {})

View File

@ -1,67 +1,124 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__params"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button v-if="$hasPermission('sys:params:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:params:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
</el-form> @clickBtn="handleClick"
<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> </base-table>
<el-table-column prop="paramCode" :label="$t('params.paramCode')" header-align="center" align="center"></el-table-column> <pagination
<el-table-column prop="paramValue" :label="$t('params.paramValue')" header-align="center" align="center"></el-table-column> :limit.sync="listQuery.limit"
<el-table-column prop="remark" :label="$t('params.remark')" header-align="center" align="center"></el-table-column> :page.sync="listQuery.page"
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> :total="listQuery.total"
<template slot-scope="scope"> @pagination="getDataList"
<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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './params-add-or-update' import AddOrUpdate from './params-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "paramCode",
label: i18n.t("params.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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/params/page', getDataListURL: "/sys/params/page",
getDataListIsPage: true, deleteURL: "/sys/params",
deleteURL: '/sys/params',
deleteIsBatch: true
}, },
dataForm: { tableProps,
paramCode: '' 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: { 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> </script>

View File

@ -1,5 +1,4 @@
<template> <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="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('role.name')"> <el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
@ -34,18 +33,19 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/role/',
infoURL: '/sys/role'
},
visible: false, visible: false,
menuList: [], menuList: [],
deptList: [], deptList: [],
@ -68,8 +68,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.visible = true this.dataForm.id = id || "";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([]) this.$refs.menuListTree.setCheckedKeys([])
@ -137,7 +137,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('successSubmit')
} }
}) })
}).catch(() => {}) }).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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__role"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
</el-form> @clickBtn="handleClick"
<el-table />
v-loading="dataListLoading" </base-table>
:data="dataList" <pagination
border :limit.sync="listQuery.limit"
@selection-change="dataListSelectionChangeHandle" :page.sync="listQuery.page"
@sort-change="dataListSortChangeHandle" :total="listQuery.total"
style="width: 100%;"> @pagination="getDataList"
<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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './role-add-or-update' import AddOrUpdate from './role-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "name",
label: i18n.t("role.name"),
},
{
prop: "remark",
label: i18n.t("role.remark"),
},
{
prop: "createDate",
label: i18n.t("role.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/role/page', getDataListURL: '/sys/role/page',
getDataListIsPage: true,
deleteURL: '/sys/role', deleteURL: '/sys/role',
deleteIsBatch: true
}, },
dataForm: { 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: { 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> </script>

View File

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

View File

@ -1,98 +1,144 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> />
</el-form-item> </base-table>
<el-form-item> <pagination
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> :limit.sync="listQuery.limit"
</el-form-item> :page.sync="listQuery.page"
<el-form-item> :total="listQuery.total"
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button> @pagination="getDataList"
</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>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<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> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './user-add-or-update' 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"),
},
{
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 { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/user/page', getDataListURL: "/sys/user/page",
getDataListIsPage: true, deleteURL: "/sys/user",
deleteURL: '/sys/user', exportUrl: "/sys/user/export",
deleteIsBatch: true,
exportURL: '/sys/user/export'
}, },
dataForm: { tableProps,
username: '', tableBtn,
deptId: '', formConfig: [
gender: '' {
} 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: { 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> </script>

View File

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

View File

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

View File

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

View File

@ -2,15 +2,20 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-09-21 09:22:30 * @LastEditTime: 2023-04-10 15:09:23
* @Description: * @Description:
--> -->
<template> <template>
<div class="baseDialog">
<el-dialog <el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible" :visible.sync="visible"
> >
<template #title>
<slot name="title">
<div class="titleStyle">{{ !dataForm.id ? '新增' : '修改' }}</div>
</slot>
</template>
<el-row :gutter="5"> <el-row :gutter="5">
<el-form <el-form
:model="dataForm" :model="dataForm"
@ -66,6 +71,7 @@
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div>
</template> </template>
<script> <script>
@ -168,7 +174,7 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("successSubmit");
}, },
}); });
}) })
@ -178,3 +184,28 @@ export default {
}, },
}; };
</script> </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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<el-form <div class="mod-sys__user">
style="display: flex; align-items: center; justify-content: right;" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:inline="true" <base-table
:model="dataForm" :table-props="tableProps"
@keyup.enter.native="getDataList()" :page="listQuery.page"
> :limit="listQuery.limit"
<el-form-item> :table-data="tableData"
<el-select />
size="small" <pagination
v-model="dataForm.type" :limit.sync="listQuery.limit"
placeholder="请选择类型" :page.sync="listQuery.page"
style="width:150px" :total="listQuery.total"
clearable @pagination="getDataList"
> />
<el-option <!-- 弹窗, 新增 / 修改 -->
v-for="(item, index) in typeArr" <base-dialog
:key="index" :dialogTitle="addOrEditTitle"
:label="item.label" :dialogVisible="addOrUpdateVisible"
:value="item.value" @cancel="handleCancel"
></el-option> @confirm="handleConfirm"
</el-select> :before-close="handleCancel"
</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> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-table-column prop="name" align="center" label="名称"> </el-table-column> </base-dialog>
<el-table-column prop="code" align="center" label="编码"> </el-table-column> </div>
<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>
</el-card> </el-card>
</template> </template>
<script> <script>
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -82,21 +57,51 @@ export default {
deleteURL: '/qualityPlanning/controlGraph', deleteURL: '/qualityPlanning/controlGraph',
exportUrl: '/qualityPlanning/controlGraph/export' exportUrl: '/qualityPlanning/controlGraph/export'
}, },
typeArr: [ tableProps,
tableData: [],
formConfig: [
{ {
label: "计量", type: "select",
value: "1", label: "类型",
selectOptions: [
{ id: 1, name: "计量" },
{ id: 2, name: "计数" },
],
param: "type",
defaultSelect: "",
}, },
{ {
label: "计数", type: "button",
value: "2", btnName: "查询",
} name: "search",
color: "primary",
},
], ],
}; };
}, },
components: { components: {
}, },
methods: { 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> </script>

View File

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

View File

@ -1,91 +1,62 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'判读方案'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column :width="150"
fixed="right" label="操作"
header-align="center" :method-list="tableBtn"
align="center" @clickBtn="handleClick"
width="150" />
label="操作" </base-table>
> <pagination
<template slot-scope="scope"> :limit.sync="listQuery.limit"
<el-button :page.sync="listQuery.page"
type="text" :total="listQuery.total"
size="small" @pagination="getDataList"
@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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update <add-or-update
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getDataList" @successSubmit="getDataList"
></add-or-update> ></add-or-update>
</div>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/interpretationScheme-add' import AddOrUpdate from './components/interpretationScheme-add'
import queryForm from './query-form'
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
const tableProps = [
{
prop: "name",
label: "名称",
},
{
prop: "code",
label: "编码",
},
]
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -95,13 +66,70 @@ export default {
deleteURL: '/qualityPlanning/myInterpretationScheme', deleteURL: '/qualityPlanning/myInterpretationScheme',
exportUrl: '/qualityPlanning/myInterpretationScheme/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
}, },
methods: { 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> </script>

View File

@ -2,15 +2,10 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:21 * @LastEditTime: 2023-04-10 14:14:37
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
>
<el-form <el-form
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
@ -55,11 +50,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>

View File

@ -6,10 +6,6 @@
* @Description: * @Description:
--> -->
<template> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -36,11 +32,6 @@
<el-input v-model="dataForm.remark" placeholder="描述"></el-input> <el-input v-model="dataForm.remark" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>

View File

@ -6,68 +6,57 @@
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-form
:title="!dataForm.id ? '新增' : '修改'" :model="dataForm"
:visible.sync="visible"> :rules="dataRule"
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> ref="dataForm"
<el-form-item label="编码" prop="code"> @keyup.enter.native="dataFormSubmit()"
<el-input v-model="dataForm.code" placeholder="编码"></el-input> label-width="80px"
</el-form-item> >
<el-form-item label="名称" prop="name"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工序类型" prop="workingProcedureTypeId"> <el-form-item label="名称" prop="name">
<el-select <el-input v-model="dataForm.name" placeholder="名称"></el-input>
v-model="dataForm.workingProcedureTypeId" </el-form-item>
filterable <el-form-item label="工序类型" prop="workingProcedureTypeId">
placeholder="请选择工序类型" <el-select v-model="dataForm.workingProcedureTypeId" filterable placeholder="请选择工序类型">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
:label="item.name"
:value="item.id"
> >
<el-option </el-option>
v-for="item in urlOptions.optionArr.arr0" </el-select>
:key="item.id" </el-form-item>
:label="item.name" </el-form>
:value="item.id"
>
</el-option>
</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> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add' import basicAdd from "@/mixins/basic-add";
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
data() { data() {
return { return {
urlOptions: { urlOptions: {
submitURL: '/basic/workingProcedure/', submitURL: "/basic/workingProcedure/",
infoURL: '/basic/workingProcedure', infoURL: "/basic/workingProcedure",
getOption: true, getOption: true,
optionArrUrl: ['/basic/workingProcedureType/page'], optionArrUrl: ["/basic/workingProcedureType/page"],
}, },
dataForm: { dataForm: {
id: '', id: "",
code: '', code: "",
name: '', name: "",
workingProcedureTypeId: '' workingProcedureTypeId: "",
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
], },
name: [ };
{ required: true, message: '名称不能为空', trigger: 'blur' } },
] methods: {},
} };
}
},
methods: {
}
}
</script> </script>

View File

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

View File

@ -2,14 +2,10 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:06 * @LastEditTime: 2023-04-10 14:30:10
* @Description: * @Description:
--> -->
<template> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -18,11 +14,6 @@
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>

View File

@ -2,16 +2,21 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-01-06 15:25:05 * @LastEditTime: 2023-04-10 15:25:32
* @Description: * @Description:
--> -->
<template> <template>
<div class="baseDialog">
<el-dialog <el-dialog
:title="!productId ? '新增' : '修改'"
:fullscreen="true" :fullscreen="true"
:visible.sync="visible"
:before-close="cancle" :before-close="cancle"
:visible.sync="visible"
> >
<template #title>
<slot name="title">
<div class="titleStyle">{{ !productId ? '新增' : '修改' }}</div>
</slot>
</template>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-steps :active="active" align-center finish-status="success" process-status="finish"> <el-steps :active="active" align-center finish-status="success" process-status="finish">
@ -59,6 +64,7 @@
}}</el-button> }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div>
</template> </template>
<script> <script>
@ -111,7 +117,7 @@ export default {
this[this.stepShowObj[2]] = false; this[this.stepShowObj[2]] = false;
this[this.stepShowObj[3]] = false; this[this.stepShowObj[3]] = false;
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("successSubmit");
} else { } else {
this.$refs[this.stepArr[this.active]].dataFormSubmit(); this.$refs[this.stepArr[this.active]].dataFormSubmit();
} }
@ -138,7 +144,7 @@ export default {
this[this.stepShowObj[2]] = false; this[this.stepShowObj[2]] = false;
this[this.stepShowObj[3]] = false; this[this.stepShowObj[3]] = false;
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("successSubmit");
}, },
setPrductId(id) { setPrductId(id) {
this.productId = id; this.productId = id;
@ -155,3 +161,28 @@ export default {
height: 90px; height: 90px;
} }
</style> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-01-06 14:16:17 * @LastEditTime: 2023-04-10 15:45:39
* @Description: * @Description:
--> -->
<template> <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-row :gutter="10">
<el-form <el-form
:model="fourDataForm" :model="fourDataForm"
@ -381,3 +391,28 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-01-03 14:06:12 * @LastEditTime: 2023-04-10 15:44:28
* @Description: * @Description:
--> -->
<template> <template>
<div> <div class="baseTable">
<div v-if="workingProcedure.length && productFeaturesOptions.length"> <div v-if="workingProcedure.length && productFeaturesOptions.length">
<el-tabs @tab-click="tabClick"> <el-tabs @tab-click="tabClick">
<el-tab-pane <el-tab-pane
@ -47,11 +47,9 @@
<el-tab-pane label="特性列表" align="center"> <el-tab-pane label="特性列表" align="center">
<el-table <el-table
:data="dataList" :data="dataList"
:stripe="true"
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#F2F4F9',
color: '#606266', color: '#606266',
height: '56px',
}" }"
style="width: 100%;" style="width: 100%;"
> >
@ -317,3 +315,13 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:51:44 * @LastEditTime: 2023-04-10 15:43:27
* @Description: * @Description:
--> -->
<template> <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 <el-table
:data="dataList" :data="dataList"
:stripe="true"
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#F2F4F9',
color: '#606266', color: '#606266',
height: '56px',
}" }"
style="width: 100%;" style="width: 100%;"
> >
@ -96,3 +99,32 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-12-12 15:51:58 * @LastEditTime: 2023-04-10 15:40:38
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-dialog
:title="!threeDataForm.id ? '新增' : '修改'" :close-on-click-modal="false"
append-to-body
:visible.sync="threeVisible" :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-row :gutter="10">
<el-form <el-form
:model="threeDataForm" :model="threeDataForm"
@ -299,3 +305,28 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:52:10 * @LastEditTime: 2023-04-10 15:46:38
* @Description: * @Description:
--> -->
<template> <template>
<div> <div class="baseTable">
<div style="float:right;margin-bottom:10px"> <div style="float:right;margin-bottom:10px">
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
</div> </div>
<el-table <el-table
:data="dataList" :data="dataList"
:stripe="true"
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#F2F4F9',
color: '#606266', color: '#606266'
height: '56px',
}" }"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;" style="width: 100%;"
@ -163,3 +160,13 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-12-01 15:52:21 * @LastEditTime: 2023-04-10 15:29:25
* @Description: * @Description:
--> -->
<template> <template>
<div> <div class="baseTable">
<div style="margin-bottom:20px"> <div style="margin-bottom:20px">
<el-tooltip content="选择工序,新增到表格" placement="top"> <el-tooltip content="选择工序,新增到表格" placement="top">
<el-select <el-select
@ -24,11 +24,9 @@
</div> </div>
<el-table <el-table
:data="dataList" :data="dataList"
:stripe="true"
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#F2F4F9',
color: '#606266', color: '#606266'
height: '56px',
}" }"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;" style="width: 100%;"
@ -225,3 +223,13 @@ export default {
}, },
}; };
</script> </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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:10:11 * @LastEditTime: 2023-02-17 11:08:34
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
: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-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="descs"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.descs" placeholder="描述"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
@ -42,22 +23,25 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
submitURL: '/basic/productType/', submitURL: '/basic/workingProcedureType/',
infoURL: '/basic/productType' infoURL: '/basic/workingProcedureType'
}, },
dataForm: { dataForm: {
id: "", id: '',
code: "", code: '',
name: "", name: ''
descs: "", },
}, dataRule: {
dataRule: { code: [
code: [{ required: true, message: "编码不能为空", trigger: "blur" }], { required: true, message: '编码不能为空', trigger: 'blur' }
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], ],
}, name: [
}; { required: true, message: '名称不能为空', trigger: 'blur' }
}, ]
methods: { }
}, }
}; },
methods: {
}
}
</script> </script>

View File

@ -2,14 +2,10 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:16:06 * @LastEditTime: 2023-04-10 14:34:08
* @Description: * @Description:
--> -->
<template> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -21,11 +17,6 @@
<el-input v-model="dataForm.platformGroup" placeholder="站点分组"></el-input> <el-input v-model="dataForm.platformGroup" placeholder="站点分组"></el-input>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>

View File

@ -2,14 +2,10 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:59:45 * @LastEditTime: 2023-04-10 14:39:41
* @Description: * @Description:
--> -->
<template> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -48,11 +44,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>
@ -72,6 +63,7 @@ export default {
type: '', type: '',
parentType: '' parentType: ''
}, },
parentTypeArr: [],
typeArr: [ typeArr: [
{ {
name: '计数', name: '计数',

View File

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

View File

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

View File

@ -6,10 +6,6 @@
* @Description: * @Description:
--> -->
<template> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
@ -33,11 +29,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </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> </template>
<script> <script>

View File

@ -1,186 +1,146 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<el-form <div class="mod-sys__user">
style="display: flex; align-items: center; justify-content: right;" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:inline="true" <base-table
:model="dataForm" :table-props="tableProps"
@keyup.enter.native="getDataList()" :page="listQuery.page"
> :limit="listQuery.limit"
<el-form-item> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column :width="150"
type="type" label="操作"
header-align="center" :method-list="tableBtn"
align="center" @clickBtn="handleClick"
label="类型" />
</base-table>
<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"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.type === '1' ? '' : 'success'">{{ </base-dialog>
scope.row.type === '1' ? "内部工厂" : "供应商" </div>
}}</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"
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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/factoryManage-add' import AddOrUpdate from "./components/factoryManage-add";
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: '/basic/factory/page', getDataListURL: "/basic/factory/page",
deleteURL: '/basic/factory', deleteURL: "/basic/factory",
statusUrl: '/basic/factory/status', statusUrl: "/basic/factory/status",
exportUrl: '/basic/factory/export' exportUrl: "/basic/factory/export",
}, },
typeArr: [ tableProps,
tableBtn,
tableData: [],
formConfig: [
{ {
label: "内部工厂", type: "input",
value: "1", label: "名称",
placeholder: "请输入名称",
param: "name",
}, },
{ {
label: "供应商", type: "input",
value: "2", 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, AddOrUpdate,
}, },
methods: { 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> </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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'机台管理'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column prop="platformName" align="center" label="站点"> </el-table-column> :width="150"
<el-table-column prop="remark" align="center" label="描述"> </el-table-column> label="操作"
<el-table-column :method-list="tableBtn"
type="status" @clickBtn="handleClick"
header-align="center" />
align="center" </base-table>
label="状态" <pagination
width="80" :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"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用" </div>
}}</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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/machineManage-add' import AddOrUpdate from './components/machineManage-add'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -127,13 +90,70 @@ export default {
statusUrl: '/basic/machine/status', statusUrl: '/basic/machine/status',
exportUrl: '/basic/machine/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
}, },
methods: { 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> </script>

View File

@ -1,138 +1,44 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'工序定义'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column prop="workingProcedureTypeName" align="center" label="类型"> </el-table-column> :width="220"
<el-table-column prop="machineName" align="center" label="机台"> label="操作"
<template slot-scope="scope"> :method-list="tableBtn"
<span>{{ scope.row.machineName}}</span> @clickBtn="handleClick"
</template> />
</el-table-column> </base-table>
<el-table-column <pagination
type="status" :limit.sync="listQuery.limit"
header-align="center" :page.sync="listQuery.page"
align="center" :total="listQuery.total"
label="状态" @pagination="getDataList"
width="80" />
<!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="200"
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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<bind-machine <bind-machine
v-if="bindMachineVisible" v-if="bindMachineVisible"
ref="bindMachineRef" ref="bindMachineRef"
@refreshDataList="getDataList" @successSubmit="successSubmit"
></bind-machine> ></bind-machine>
</div>
</el-card> </el-card>
</template> </template>
@ -140,7 +46,50 @@
import AddOrUpdate from './components/processDefine-add' import AddOrUpdate from './components/processDefine-add'
import BindMachine from './components/processDefine-machine' import BindMachine from './components/processDefine-machine'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -151,15 +100,75 @@ export default {
statusUrl: '/basic/workingProcedure/status', statusUrl: '/basic/workingProcedure/status',
exportUrl: '/basic/workingProcedure/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
BindMachine BindMachine
}, },
methods: { 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) { bindMachine (id) {
this.bindMachineVisible = true this.bindMachineVisible = true
this.$nextTick(() => { this.$nextTick(() => {

View File

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

View File

@ -1,115 +1,77 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'工序类型'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column :width="150"
type="status" label="操作"
header-align="center" :method-list="tableBtn"
align="center" @clickBtn="handleClick"
label="状态" />
width="80" </base-table>
<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"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用" </div>
}}</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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/processType-add' import AddOrUpdate from './components/processType-add'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -120,13 +82,70 @@ export default {
statusUrl: '/basic/workingProcedureType/status', statusUrl: '/basic/workingProcedureType/status',
exportUrl: '/basic/workingProcedureType/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
}, },
methods: { 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> </script>

View File

@ -1,197 +1,103 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<el-form <div class="mod-sys__user">
style="display: flex; align-items: center; justify-content: right;" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:inline="true" <base-table
:model="dataForm" :table-props="tableProps"
@keyup.enter.native="getDataList()" :page="listQuery.page"
> :limit="listQuery.limit"
<el-form-item> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称" fixed="left"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码" fixed="left"> </el-table-column> slot="handleBtn"
<el-table-column prop="specifications" align="center" label="规格"> </el-table-column> :width="150"
<el-table-column prop="drawing" align="center" label="图纸"> </el-table-column> label="操作"
<el-table-column prop="productType" align="center" label="产品类型"> </el-table-column> :method-list="tableBtn"
<el-table-column prop="descs" align="center" label="描述"> </el-table-column> @clickBtn="handleClick"
<el-table-column prop="remark" align="center" label="备注"> </el-table-column> />
<el-table-column prop="inspectionStandard" align="center" label="检验标准"> </el-table-column> </base-table>
<el-table-column prop="inspectionStage" align="center" label="检验阶段"> <pagination
<template slot-scope="scope"> :limit.sync="listQuery.limit"
<div style="pointer-events: none;"> :page.sync="listQuery.page"
<el-checkbox-group :value="scope.row.inspectionStage.split(',')"> :total="listQuery.total"
<el-checkbox label="1">进货检验</el-checkbox> @pagination="getDataList"
<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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update <add-or-update
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getDataList" @successSubmit="getDataList"
></add-or-update> ></add-or-update>
</div>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from "./components/productList-add"; import AddOrUpdate from "./components/productList-add";
import inspectionStage from "./inspectionStage"
import basicPage from "@/mixins/basic-page"; 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -202,23 +108,61 @@ export default {
statusUrl: "/basic/product/status", statusUrl: "/basic/product/status",
exportUrl: "/basic/product/export", exportUrl: "/basic/product/export",
}, },
productTypeArr: [], tableProps,
inspectionStageOptions: [ tableBtn,
tableData: [],
formConfig: [
{ {
label: "进货检验", type: "input",
value: "1", label: "名称",
placeholder: "请输入名称",
param: "name",
}, },
{ {
label: "过程检验", type: "input",
value: "2", label: "编码",
placeholder: "请输入编码",
param: "code",
}, },
{ {
label: "成品检验", type: "select",
value: "3", label: "产品类型",
selectOptions: [
],
param: "product_type_id",
defaultSelect: "",
}, },
{ {
label: "出货检验", type: "select",
value: "4", 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(); this.getArr();
}, },
methods: { 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() { getArr() {
this.$http this.$http
.get("/basic/productType/page", { .get("/basic/productType/page", {
@ -240,10 +207,10 @@ export default {
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.productTypeArr = []; this.formConfig[2].selectOptions = [];
return this.$message.error(res.msg); return this.$message.error(res.msg);
} }
this.productTypeArr = res.data.list; this.formConfig[2].selectOptions = res.data.list;
}) })
.catch(() => {}); .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> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'产品类型'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<el-table >
:data="dataList" <method-btn
:stripe="true" v-if="tableBtn.length"
:header-cell-style="{ slot="handleBtn"
background: '#eef1f6', :width="150"
color: '#606266', label="操作"
height: '56px', :method-list="tableBtn"
}" @clickBtn="handleClick"
v-loading="dataListLoading" />
style="width: 100%;" </base-table>
> <pagination
<el-table-column type="index" header-align="center" align="center" label="序号" width="50"> :limit.sync="listQuery.limit"
</el-table-column> :page.sync="listQuery.page"
<el-table-column prop="name" align="center" label="名称"> </el-table-column> :total="listQuery.total"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> @pagination="getDataList"
<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"> <base-dialog
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ :dialogTitle="addOrEditTitle"
scope.row.status === 0 ? "不可用" : "可用" :dialogVisible="addOrUpdateVisible"
}}</el-tag> @cancel="handleCancel"
</template> @confirm="handleConfirm"
</el-table-column> :before-close="handleCancel"
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"> </base-dialog>
<el-tooltip class="item" effect="dark" content="修改" placement="top"> </div>
<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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from "./components/productType-add"; import AddOrUpdate from './components/productType-add'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: '/basic/productType/page', getDataListURL: '/basic/workingProcedureType/page',
deleteURL: '/basic/productType', deleteURL: '/basic/workingProcedureType',
statusUrl: '/basic/productType/status', statusUrl: '/basic/workingProcedureType/status',
exportUrl: '/basic/productType/export' 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: { components: {
AddOrUpdate, AddOrUpdate
queryForm,
}, },
methods: { 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> </script>

View File

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

View File

@ -1,121 +1,82 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'站点管理'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column prop="platformGroup" align="center" label="站点分组"> </el-table-column> :width="150"
<el-table-column label="操作"
type="status" :method-list="tableBtn"
header-align="center" @clickBtn="handleClick"
align="center" />
label="状态" </base-table>
width="80" <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"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用" </div>
}}</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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/siteManage-add' import AddOrUpdate from './components/siteManage-add'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -126,13 +87,70 @@ export default {
statusUrl: '/basic/platform/status', statusUrl: '/basic/platform/status',
exportUrl: '/basic/platform/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
}, },
methods: { 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> </script>

View File

@ -1,174 +1,171 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'量具管理'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column prop="type" align="center" label="测量类型"> :width="180"
<template slot-scope="scope"> label="操作"
<span>{{ :method-list="tableBtn"
scope.row.type === '2' ? "计数" : "计量" @clickBtn="handleClick"
}}</span> />
</template> </base-table>
</el-table-column> <pagination
<el-table-column :limit.sync="listQuery.limit"
type="status" :page.sync="listQuery.page"
header-align="center" :total="listQuery.total"
align="center" @pagination="getDataList"
label="状态" />
width="80" <!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用" <detail v-if="detailVisible" ref="detailRef" @successSubmit="getDataList"></detail>
}}</el-tag> </div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="200"
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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
<detail
v-if="detailVisible"
ref="detailRef"
@refreshDataList="getDataList"
></detail>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/toolsType-add' import AddOrUpdate from "./components/toolsType-add";
import Detail from './components/toolsType-detail' import Detail from "./components/toolsType-detail";
import basicPage from '@/mixins/basic-page' 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: "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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: '/basic/measureTool/page', getDataListURL: "/basic/measureTool/page",
deleteURL: '/basic/measureTool', deleteURL: "/basic/measureTool",
statusUrl: '/basic/measureTool/status', statusUrl: "/basic/measureTool/status",
exportUrl: '/basic/measureTool/export' exportUrl: "/basic/measureTool/export",
}, },
detailVisible: false, 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm, Detail,
Detail
}, },
methods: { methods: {
detail (id) { //search-bar
this.detailVisible = true buttonClick(val) {
this.$nextTick(() => { switch (val.btnName) {
this.$refs.detailRef.init(id) 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> </script>

View File

@ -1,127 +1,82 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<query-form <div class="mod-sys__user">
:page-name="'计量单位'" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:data-form="dataForm" <base-table
@getDataList="getDataList" :table-props="tableProps"
@addOrUpdateHandle="addOrUpdateHandle" :page="listQuery.page"
@exportHandle="exportHandle" :limit="listQuery.limit"
/> :table-data="tableData"
<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> <method-btn
<el-table-column prop="name" align="center" label="名称"> </el-table-column> v-if="tableBtn.length"
<el-table-column prop="code" align="center" label="编码"> </el-table-column> slot="handleBtn"
<el-table-column prop="type" align="center" label="类型"> :width="150"
<template slot-scope="scope"> label="操作"
<span>{{ :method-list="tableBtn"
scope.row.type === 2 ? "不可计数" : "可计数" @clickBtn="handleClick"
}}</span> />
</template> </base-table>
</el-table-column> <pagination
<el-table-column :limit.sync="listQuery.limit"
type="status" :page.sync="listQuery.page"
header-align="center" :total="listQuery.total"
align="center" @pagination="getDataList"
label="状态" />
width="80" <!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
> >
<template slot-scope="scope"> <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ </base-dialog>
scope.row.status === 0 ? "不可用" : "可用" </div>
}}</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>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/unitList-add' import AddOrUpdate from './components/unitList-add'
import queryForm from './query-form'
import basicPage from '@/mixins/basic-page' 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 { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
@ -132,13 +87,70 @@ export default {
statusUrl: '/basic/unit/status', statusUrl: '/basic/unit/status',
exportUrl: '/basic/unit/export' 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: { components: {
AddOrUpdate, AddOrUpdate,
queryForm,
}, },
methods: { 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> </script>

View File

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