Merge pull request '更新中英文切换部分无效' (#7) from zwq into master

Reviewed-on: #7
This commit is contained in:
朱文强 2023-06-28 15:42:35 +08:00
commit ec00c58c6c
5 changed files with 1 additions and 254 deletions

View File

@ -1,4 +1,4 @@
import module from './en'
import module from './eng'
const t = {}
t.module = module

View File

@ -1,76 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 10:54:13
* @Description:
-->
<template>
<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-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item>
<el-form-item label="单位分类" prop="type">
<el-select
v-model="dataForm.type"
filterable
placeholder="请选择单位分类"
>
<el-option
v-for="item in typeArr"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
submitURL: '/basic/unit/',
infoURL: '/basic/unit'
},
dataForm: {
id: '',
code: '',
name: '',
type: ''
},
typeArr: [
{
name: '不可计数',
value: 2
},
{
name: '可计数',
value: 1
}
],
dataRule: {
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '单位分类不能为空', trigger: 'change' }
]
}
}
},
methods: {
}
}
</script>

View File

@ -1,177 +0,0 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-06 09:54:57
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
</base-dialog>
</el-card>
</template>
<script>
import AddOrUpdate from "./components/unitList-add";
import basicPage from "@/mixins/basic-page";
const tableProps = [
{
prop: "date",
label: "日期",
},
{
prop: "name",
label: "姓名",
},
{
prop: "sex",
label: "性别",
},
{
prop: "age",
label: "年龄",
},
{
prop: "address",
label: "地址",
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/basic/unit/page",
deleteURL: "/basic/unit",
statusUrl: "/basic/unit/status",
exportUrl: "/basic/unit/export",
},
tableProps,
tableBtn,
tableData: [
{
date: "2016-05-02",
name: "王小虎",
sex: "男",
id:111,
age: 18,
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-04",
name: "王小虎",
sex: "男",
age: 18,
address: "上海市普陀区金沙江路 1517 弄",
},
{
date: "2016-05-01",
name: "王小虎",
sex: "男",
age: 18,
address: "上海市普陀区金沙江路 1519 弄",
},
{
date: "2016-05-03",
name: "王小虎",
sex: "男",
age: 18,
address: "上海市普陀区金沙江路 1516 弄",
},
],
formConfig: [
{
type: "input",
label: "名称",
placeholder: "请输入名称",
param: "xm1",
},
{
type: "input",
label: "编码",
placeholder: "请输入编码",
param: "xm2",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
methods: {
//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)
}
},
},
};
</script>