提交 72c541ad 编写于 作者: KK's avatar KK

富文本组件参数

上级 5d5560d9
...@@ -105,6 +105,62 @@ export default class AppRichTextEditor extends Vue { ...@@ -105,6 +105,62 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor * @memberof AppRichTextEditor
*/ */
public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh-CN' ; public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh-CN' ;
/**
* 上传params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public upload_params: Array<any> = [];
/**
* 导出params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public export_params: Array<any> = [];
/**
* 上传参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public uploadparams?: any;
/**
* 下载参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public exportparams?: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() public viewparams!: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() public context!: any;
/**
* 表单数据
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public data!: string;
/** /**
* 语言映射文件 * 语言映射文件
...@@ -142,6 +198,7 @@ export default class AppRichTextEditor extends Vue { ...@@ -142,6 +198,7 @@ export default class AppRichTextEditor extends Vue {
if(this.formState) { if(this.formState) {
this.formState.subscribe(({ type, data }) => { this.formState.subscribe(({ type, data }) => {
if (Object.is('load', type)) { if (Object.is('load', type)) {
this.getParams();
if (!this.value) { if (!this.value) {
this.init(); this.init();
} }
...@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue { ...@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue {
if (newval) { if (newval) {
this.init(); this.init();
} }
this.getParams();
} }
/** /**
...@@ -310,6 +368,44 @@ export default class AppRichTextEditor extends Vue { ...@@ -310,6 +368,44 @@ export default class AppRichTextEditor extends Vue {
}); });
return subject; return subject;
} }
/**
*获取上传,导出参数
*
*@memberof AppRichTextEditor
*/
public getParams(){
let uploadparams: any = JSON.parse(JSON.stringify(this.uploadparams));
let exportparams: any = JSON.parse(JSON.stringify(this.exportparams));
let upload_params: Array<string> = [];
let export_params: Array<string> = [];
let param:any = this.viewparams;
let context:any = this.context;
let _data:any = JSON.parse(this.data);
if (this.uploadparams && !Object.is(this.uploadparams, '')) {
upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(this.exportparams, '')) {
export_params = this.$util.computedNavData(_data,param,context,exportparams);
}
this.upload_params = [];
this.export_params = [];
for (const item in upload_params) {
this.upload_params.push({
[item]:upload_params[item]
})
}
for (const item in export_params) {
this.export_params.push({
[item]:export_params[item]
})
}
}
} }
</script> </script>
<style lang="less"> <style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册