Browse Source

多语言

master
DOUDOU 3 years ago
parent
commit
2c833fa87d
  1. 137
      src/views/modules/yieldReport/com_produce_tool.vue

137
src/views/modules/yieldReport/com_produce_tool.vue

@ -58,6 +58,7 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addToolInstanceIdFun"> </el-button> <el-button type="primary" @click="addToolInstanceIdFun"> </el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button> <el-button type="primary" @click="closeDialog">关闭</el-button>
<el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">对语言设置</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -69,10 +70,26 @@ import {
addToolInstanceId, addToolInstanceId,
} }
from '@/api/yieldReport/com_produce_tool.js'; from '@/api/yieldReport/com_produce_tool.js';
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne,
searchPageLanguageData,
removerLanguage,
saveSysLanguageList
} from "@/api/sysLanguage.js";
var functionId = 'C10000012';
export default { export default {
data() { data() {
return { return {
titleCon: '刀模板', titleCon: '刀模板',
showDefault: false,
readonlyFlag: true, readonlyFlag: true,
scheduleData: { scheduleData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -123,6 +140,92 @@ export default {
showFlag: false showFlag: false
}, },
dataListLoading: false, dataListLoading: false,
buttons: {
confirmButton: '确定',
closeButton: '关闭',
},
buttonList: [
{
functionId: functionId,
languageValue: '确定',
objectId: 'confirmButton',
objectType: 'button',
tableId: '*'
}, {
functionId: functionId,
languageValue: '关闭',
objectId: 'closeButton',
objectType: 'button',
tableId: '*'
},
],
queryButton: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'button'
},
labels: {
titleCon: '刀模板',
toolInstanceId: '工具实例编号:',
replaceToolTitle: '换刀模',
replaceTool: '换刀模',
oriToolInstanceId: '原工具实例编码:',
currentRollProdQty: '本卷生产数量:',
oriRollProdQty: '之前卷生产数量:',
totalRollProdQty: '累积生产数量:',
},
labelsList: [
{
functionId: functionId,
languageValue: '刀模板',
objectId: 'titleCon',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '换刀模:',
objectId: 'replaceToolTitle',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '换刀模',
objectId: 'replaceTool',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '原工具实例编码:',
objectId: 'oriToolInstanceId',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '本卷生产数量:',
objectId: 'currentRollProdQty',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '之前卷生产数量:',
objectId: 'oriRollProdQty',
objectType: 'label',
tableId: '*'
}, {
functionId: functionId,
languageValue: '累积生产数量:',
objectId: 'totalRollProdQty',
objectType: 'label',
tableId: '*'
},
],
queryLabel: {
functionId: functionId,
table_id: '*',
languageCode: this.$i18n.locale,
objectType: 'label'
},
} }
}, },
methods: { methods: {
@ -161,6 +264,8 @@ export default {
} }
// //
this.pageData.checkFlag = false; this.pageData.checkFlag = false;
//
this.titleCon = this.labels.titleCon;
}, },
/*关闭modal*/ /*关闭modal*/
@ -215,10 +320,42 @@ export default {
}); });
}, },
//
async saveMultiLanguage() {
// button label title
let buttons = this.buttonList;
let labels = this.labelsList;
await saveButtonList(buttons)
await saveButtonList(labels)
this.getMultiLanguageList()
},
getMultiLanguageList() {
//
searchFunctionButtonList(this.queryButton).then(({data}) => {
if (JSON.stringify(data.data) != '{}') {
this.buttons = data.data
} else {
// saveButtonList(this.buttonList).then(({data}) => {
// })
}
});
//
searchFunctionButtonList(this.queryLabel).then(({data}) => {
if (JSON.stringify(data.data) != '{}') {
this.labels = data.data
} else {
// saveButtonList(this.buttonList).then(({data}) => {
// })
}
});
},
}, },
created() { created() {
// this.factoryList() // this.factoryList()
// this.getLanguageList() // this.getLanguageList()
this.getMultiLanguageList();//
} }
} }

Loading…
Cancel
Save