update i18n
This commit is contained in:
@@ -1,59 +1,31 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="super-flexible-dialog"
|
||||
:title="isDetail ? '详情' : !dataForm.id ? '新增' : '编辑'"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-dialog class="super-flexible-dialog" :title="isDetail ? '详情' : !dataForm.id ? i18n.t('add') : '编辑'" :visible.sync="visible">
|
||||
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"
|
||||
><el-form-item label="工段名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入工段名称"
|
||||
/> </el-form-item
|
||||
><el-form-item label="工段名称" prop="name"> <el-input v-model="dataForm.name" placeholder="请输入工段名称" /> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12"
|
||||
><el-form-item label="工段编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
placeholder="请输入工段编码"
|
||||
/> </el-form-item
|
||||
><el-form-item label="工段编码" prop="code"> <el-input v-model="dataForm.code" placeholder="请输入工段编码" /> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"
|
||||
><el-form-item label="所属产线" prop="productionLineId">
|
||||
<el-select
|
||||
v-model="dataForm.productionLineId"
|
||||
placeholder="请输入所属产线"
|
||||
>
|
||||
<el-option
|
||||
v-for="line in lineList"
|
||||
:key="line.id"
|
||||
:value="line.id"
|
||||
:label="line.name"
|
||||
/>
|
||||
<el-select v-model="dataForm.productionLineId" placeholder="请输入所属产线">
|
||||
<el-option v-for="line in lineList" :key="line.id" :value="line.id" :label="line.name" />
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="12"
|
||||
><el-form-item label="描述" prop="description">
|
||||
<el-input
|
||||
v-model="dataForm.description"
|
||||
placeholder="请输入描述"
|
||||
/> </el-form-item
|
||||
><el-form-item label=$t('desc') prop="description"> <el-input v-model="dataForm.description" placeholder="请输入描述" /> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"
|
||||
><el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
placeholder="请输入备注"
|
||||
/> </el-form-item
|
||||
><el-form-item label="备注" prop="remark"> <el-input v-model="dataForm.remark" placeholder="请输入备注" /> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -61,18 +33,10 @@
|
||||
<section class="attr-form-section" v-if="dataForm.id">
|
||||
<h3>
|
||||
设备绑定
|
||||
<el-button type="text" v-if="!showAttrForm" @click="addEq"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button type="text" v-if="!showAttrForm" @click="addEq">新增</el-button>
|
||||
</h3>
|
||||
<div class="table" v-if="!showAttrForm">
|
||||
<base-table
|
||||
:data="eqList"
|
||||
:table-head-configs="tableProps"
|
||||
:max-height="calcMaxHeight(8)"
|
||||
@operate-event="handleOperations"
|
||||
@refreshDataList="getDataList"
|
||||
/>
|
||||
<base-table :data="eqList" :table-head-configs="tableProps" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@@ -83,31 +47,19 @@
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
/>
|
||||
</div>
|
||||
<attr-form
|
||||
v-else
|
||||
ref="AttrFrom"
|
||||
:workshop-section-id="dataForm.id"
|
||||
@close-attr-form="showAttrForm = false"
|
||||
@refresh-list="handleRefreshList"
|
||||
/>
|
||||
<attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" />
|
||||
</section>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClick({ name: 'cancel' })">返回</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="dataForm.id"
|
||||
@click="handleClick({ name: 'update' })"
|
||||
>更新</el-button
|
||||
>
|
||||
<el-button type="success" v-else @click="handleClick({ name: 'save' })"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button type="primary" v-if="dataForm.id" @click="handleClick({ name: 'update' })">更新</el-button>
|
||||
<el-button type="success" v-else @click="handleClick({ name: 'save' })">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/i18n'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import SmallTitle from '@/components/small-title'
|
||||
import { pick } from 'lodash/object'
|
||||
@@ -118,7 +70,7 @@ const tableProps = [
|
||||
{ name: '设备名', prop: 'equipmentName' },
|
||||
{ name: '排序', prop: 'sort' },
|
||||
{
|
||||
name: '操作',
|
||||
name: i18n.t('handle'),
|
||||
prop: 'operations',
|
||||
fixed: 'right',
|
||||
width: 180,
|
||||
@@ -178,19 +130,11 @@ export default {
|
||||
if (id) {
|
||||
// 编辑
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
'/monitoring/workshopSection/' + this.dataForm.id
|
||||
),
|
||||
url: this.$http.adornUrl('/monitoring/workshopSection/' + this.dataForm.id),
|
||||
method: 'get'
|
||||
}).then(({ data: res }) => {
|
||||
if (res.data) {
|
||||
const {
|
||||
name,
|
||||
code,
|
||||
productionLineId,
|
||||
description,
|
||||
remark
|
||||
} = res.data
|
||||
const { name, code, productionLineId, description, remark } = res.data
|
||||
this.dataForm.name = name
|
||||
this.dataForm.code = code
|
||||
this.dataForm.productionLineId = productionLineId
|
||||
@@ -276,8 +220,8 @@ export default {
|
||||
handleDeleteEq(id) {
|
||||
this.$confirm(`确定删除这条记录吗?`, '提示', {
|
||||
// this.$confirm(`确定删除 ${id} 吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
|
||||
Reference in New Issue
Block a user