提交 1ed325ac 编写于 作者: zhangpingchuan's avatar zhangpingchuan

zpc

上级 e8bf5343
<div style="height:63px;">
<a-button class="app-form-button app-form-button-${item.getName()}" type="primary" style="<#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if>" @click="button_click($event,'${item.getCaption()}')">
<#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)><i className="${img.getCssClass()}"></i></#if></#if>
<#if item.isShowCaption()><span ><#if item.getCaptionItemName()?? && item.getCaptionItemName()?length gt 0>this.data.${item.getCaptionItemName()}<#else>${item.getCaption()}</#if></span></#if>
<#if item.isShowCaption()><span ><#if item.getCaptionItemName()?? && item.getCaptionItemName()?length gt 0>this.data.${item.getCaptionItemName()}<#else>{{$t('${view.name?lower_case}.${ctrl.getCodeName()?lower_case}.${item.getName()}')}}</#if></span></#if>
</a-button>
</div>
\ No newline at end of file
......@@ -34,12 +34,26 @@ TARGET=PSSYSAPP
</a-layout-content>
</a-layout>
</a-layout>
<div class="app-setting">
<a-icon type="setting" @click="showModal" />
</div>
<a-modal :title="$t('moresetting')" v-model="visible" @ok="handleOk">
<div class="current-langue">
<span>{{$t('changelanguage')}}</span>
<a-radio-group v-model="curLangue" @change="handleChange">
<a-radio-button value="zh">{{$t('chinese')}}</a-radio-button>
<a-radio-button value="en">{{$t('english')}}</a-radio-button>
</a-radio-group>
</div>
</a-modal>
</div>
</a-locale-provider>
</template>
<script>
import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
import AppService from "@service/AppService";
<#if app.getAllPSAppViews()??>
<#list app.getAllPSAppViews() as refview>
import ${srfclassname('${refview.name}')} from '@pages/${refview.getPSAppModule().getCodeName()?lower_case}/${srffilepath2('${refview.getCodeName()}')}/${srffilepath2('${refview.getCodeName()}')}.vue';
......@@ -57,13 +71,45 @@ export default {
},
data() {
return {
locale: zhCN,
curSelected:"0"
curSelected: "0",
visible: false,
curLangue: ""
};
},
methods:{
handleClick (e) {
computed: {
locale: function() {
if (Object.is(this.curLangue, "zh")) {
return zhCN;
} else {
return null;
}
this.$forceUpdate();
}
},
created() {
AppService.getInstance().subject.subscribe(res => {
if (Object.is(res, "zh")) {
this.curLangue = "zh";
this.$i18n.locale = 'zh'
} else {
this.curLangue = "en";
this.$i18n.locale = 'en'
}
this.$forceUpdate();
});
},
methods: {
handleClick(e) {
this.curSelected = e.key;
},
handleOk() {
this.visible = false;
},
showModal() {
this.visible = true;
},
handleChange() {
AppService.getInstance().changeLanguage(this.curLangue);
}
}
};
......@@ -90,4 +136,16 @@ export default {
text-align: center;
margin: 16px;
}
.app-setting {
position: fixed;
top: 30%;
right: 8px;
font-size: 24px;
cursor: pointer;
}
.current-langue {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册