Commit 33fce545 authored by yyh's avatar yyh

代码调整

parent 0f6e4272
import { Component, Vue } from 'vue-property-decorator';
import { State, Action } from 'vuex-class';
import { State, Action, namespace } from 'vuex-class';
const Template = namespace('template')
@Component
export default class Index extends Vue {
@State('sysTemplateList', { namespace: 'template'}) protected systemList!: [];
@Template.State('sysTemplateList') protected systemList!: [];
protected ActionList: any = {
rename: {
key: 'rename',
......@@ -17,7 +18,7 @@ export default class Index extends Vue {
callback: this.delFolder,
},
};
@Action('getSysTemplateList', { namespace: 'template'}) private getSysTemplateList!: () => void;
@Template.Action('getSysTemplateList') private getSysTemplateList!: () => void;
protected mounted() {
this.getSysTemplateList();
}
......
......@@ -67,9 +67,11 @@
<script lang="ts">
import { Component, Prop, Vue, Watch, Inject, Mixins } from 'vue-property-decorator';
import { TEMPLATETYPE } from '@/const/enum';
import { State, Action } from 'vuex-class';
import { State, Action, namespace } from 'vuex-class';
import IndexMixin from '@/mixins/Index';
import AddFolder from '@/views/template/components/AddFolder.vue';
const Proof = namespace('proof');
const Template = namespace('template');
@Component({
components: {
AddFolder,
......@@ -78,10 +80,10 @@ import AddFolder from '@/views/template/components/AddFolder.vue';
export default class IndexSy extends Mixins(IndexMixin) {
@Inject('APP-NAME') private APP_NAME!: string;
@State('isLogin') private isLogin!: boolean;
@State('proofCount', { namespace: 'proof'}) private proofCount!: number;
@Action('getProofCount', { namespace: 'proof'}) private getProofCount!: any;
@Action('getUserFolders', { namespace: 'template'}) private getUserFolders!: () => void;
@State('userFolderList', { namespace: 'template'}) private list!: any[];
@Proof.State('proofCount') private proofCount!: number;
@Proof.Action('getProofCount') private getProofCount!: any;
@Template.Action('getUserFolders') private getUserFolders!: () => void;
@Template.State('userFolderList') private list!: any[];
private currentFolder: object = {};
private show: boolean = false;
private isShowRename: boolean = false;
......
......@@ -117,10 +117,11 @@
</template>
<script lang="ts">
import { Component, Prop, Vue, Emit, Inject, Mixins } from 'vue-property-decorator';
import { State, Action } from 'vuex-class';
import { State, Action, namespace } from 'vuex-class';
import IndexMixin from '@/mixins/Index';
import { TEMPLATETYPE } from '@/const/enum';
import PreviewTemplate from './PreviewTemplate.vue';
const Template = namespace('template');
@Component({
components: {
PreviewTemplate,
......@@ -129,8 +130,8 @@ import PreviewTemplate from './PreviewTemplate.vue';
export default class SelectTemplate extends Mixins(IndexMixin) {
@Inject('isSy') private isSy!: boolean;
@Action('getUserFolders', { namespace: 'template'}) private getUserFolders!: () => void;
@State('userFolderList', { namespace: 'template'}) private userFolderList!: any[];
@Template.Action('getUserFolders') private getUserFolders!: () => void;
@Template.State('userFolderList') private userFolderList!: any[];
private active: number = 0;
private currentFolder: any = {};
private currentTemplate: any = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment