Skip to content

Commit 69baad6

Browse files
author
spt
committed
types
1 parent e86492a commit 69baad6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2565
-36
lines changed

src/components/c8-dialog/c8-dialog.component.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ import Clickoutside from 'element-ui/lib/utils/clickoutside';
22
import { Vue, Prop, Component } from 'vue-property-decorator';
33
import { Dialog } from 'element-ui';
44
@Component({
5-
name: "platform-edit",
5+
name:"c8-dialog"
66
})
77
export default class C8DialogComponent extends Vue {
8-
private dialog:Dialog;
9-
dialogTableVisible:boolean=false;
8+
private dialog: Dialog;
9+
dialogTableVisible: boolean = false;
10+
title:String;
11+
1012
mounted() {
1113
let win: any = this.$refs["dialog"];
12-
this.dialog =win;
14+
this.dialog = win;
1315
}
16+
1417
show() {
15-
this.dialogTableVisible=true;
18+
this.dialogTableVisible = true;
1619
}
1720
close() {
18-
this.dialogTableVisible=false;
21+
this.dialogTableVisible = false;
1922
}
20-
getDialog()
21-
{
23+
getDialog() {
2224
return this.dialog;
2325
}
2426
}

src/components/c8-dialog/c8-dialog.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
2-
<el-dialog ref="dialog" title="平台" :visible.sync="dialogTableVisible">
3-
2+
3+
<el-dialog ref="dialog" v-bind:title="title" :visible.sync="dialogTableVisible">
4+
5+
<slot> </slot>
46
</el-dialog>
7+
58
</template>
69
<script lang="ts">
710
import C8DialogComponent from '@/components/c8-dialog/c8-dialog.component'

src/components/platform/detail/platform-detail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<transition name="fade" mode="out-in">
2+
<transition name="fade" mode="out-in" v-if="detailInfo">
33
<div class="page-main">
44
<div class="main-box">
55
<el-tabs value="first" type="card">
Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
import Clickoutside from 'element-ui/lib/utils/clickoutside';
22
import { Vue, Prop, Component } from 'vue-property-decorator';
3-
import { Message,Dialog } from 'element-ui';
4-
3+
import { Message } from 'element-ui';
4+
import C8Dialog from "@/components/c8-dialog/c8-dialog.vue";
5+
import C8DialogComponent from "@/components/c8-dialog/c8-dialog.component";
6+
import PlatformService from "@/services/platform.service";
57
@Component({
68
name: "platform-edit",
7-
directives: { Clickoutside }
9+
directives: { Clickoutside },
10+
components: { C8Dialog }
811
})
912
export default class PlatformEditComponent extends Vue {
13+
service: PlatformService = new PlatformService();
1014
form: any = {};
11-
private dialog:Dialog;
12-
formLabelWidth:String="100px";
13-
dialogTableVisible:boolean=false;
14-
mounted() {
15+
private dialog: C8DialogComponent;
16+
formLabelWidth: String = "100px";
17+
// dialogTableVisible:boolean=false;
18+
mounted() {
1519
let win: any = this.$refs["dialog"];
16-
this.dialog =win;
20+
this.dialog = win;
1721
}
1822
show() {
19-
// this.showBox = true;
20-
this.dialogTableVisible=true;
23+
this.dialog.title = "平台新增";
24+
this.dialog.show();
2125
}
2226
close() {
23-
this.dialogTableVisible=false;
27+
this.dialog.close();
2428
}
2529
save(num) {
30+
console.log(this.form);
2631
if (!this.form.platformName) {
2732
Message({
2833
showClose: true,
@@ -39,6 +44,11 @@ export default class PlatformEditComponent extends Vue {
3944
});
4045
return;
4146
}
47+
this.service.saveModel(this.form).then(r => {
48+
if (r.data.result) {
49+
this.close();
50+
}
51+
});
4252
}
4353
}
4454

src/components/platform/edit/platform-edit.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
2-
<el-dialog ref="dialog" title="平台" :visible.sync="dialogTableVisible">
2+
<c8-dialog ref="dialog" >
33
<el-form :model="form">
44
<el-form-item label="平台名称" :label-width="formLabelWidth">
55
<el-input v-model="form.platformName" auto-complete="off"></el-input>
66
</el-form-item>
77
<el-form-item label="平台编号" :label-width="formLabelWidth">
8-
<el-input v-model="form.platfplatformCodeormName" auto-complete="off"></el-input>
8+
<el-input v-model="form.platformCode" auto-complete="off"></el-input>
99
</el-form-item>
1010
<el-form-item label="平台备注" :label-width="formLabelWidth">
1111
<el-input v-model="form.platformRemark" auto-complete="off"></el-input>
1212
</el-form-item>
1313
</el-form>
14-
<div slot="footer" class="dialog-footer">
14+
<div class="el-dialog__footer dialog-footer">
1515
<el-button @click="close()">取 消</el-button>
1616
<el-button type="primary" @click="save()">确 定</el-button>
1717
</div>
18-
</el-dialog>
18+
</c8-dialog>
1919
</template>
2020
<script lang="ts">
2121
import PlatformEditComponent from '@/components/platform/edit/platform-edit.component'

src/element-ui.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import ElementUI from './types/index'
2+
export = ElementUI;

src/services/platform.service.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios';
2+
import { CallResult } from "@/business-model/CallResult";
23

34
export default class PlatformService {
45
search(params1, params2) {
@@ -18,7 +19,7 @@ export default class PlatformService {
1819
});
1920

2021
}
21-
newPlatform(params) {
22+
saveModel(params) {
2223
return axios.post(`platform/saveModel`,params);
2324

2425
}
@@ -31,18 +32,14 @@ export default class PlatformService {
3132
getFunList(params1, params2) {
3233
return axios.post('resource-set/search', params1, {params: params2});
3334
}
34-
create(params) {
35-
return axios.post('contract/create', params);
36-
}
35+
3736
edit(id, params) {
3837
return axios.put(`contract/${id}/edit`, params);
3938
}
4039
tenantFuzzy(params){
4140
return axios.get(`tenant/search-by-name`,{params:params});
4241
}
43-
servicePackageFuzzy(params){
44-
return axios.get(`contract/search-by-name-non-tenant`,{params:params});
45-
}
42+
4643
addPlatformTenant(params) {
4744
return axios.post('platform/savePlatformTenant', params);
4845
}
@@ -59,7 +56,5 @@ export default class PlatformService {
5956
headers:{'Content-Type':'application/json;charset=UTF-8'}
6057
})
6158
}
62-
accountDetail(p){
63-
return axios.get('/platform/'+p.id+'/account/search',{params:p.params})
64-
}
59+
6560
};

src/types/alert.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ElementUIComponent } from './component'
2+
3+
export type AlertType = 'success' | 'warning' | 'info' | 'error'
4+
5+
/** Alert Component */
6+
export declare class ElAlert extends ElementUIComponent {
7+
/** Title */
8+
title: string
9+
10+
/** Component type */
11+
type: AlertType
12+
13+
/** Descriptive text. Can also be passed with the default slot */
14+
description: string
15+
16+
/** If closable or not */
17+
closable: boolean
18+
19+
/** Customized close button text */
20+
closeText: string
21+
22+
/** If a type icon is displayed */
23+
showIcon: boolean
24+
}

src/types/autocomplete.d.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { ElementUIComponent } from './component'
2+
import { IconClickEventHandler } from './input'
3+
4+
export interface FetchSuggestionsCallback {
5+
/**
6+
* Callback function used in fetch-suggestions function
7+
*
8+
* @param data Suggestions to use
9+
*/
10+
(data: any[]): void
11+
}
12+
13+
export interface FetchSuggestions {
14+
/**
15+
* The function passed into the fetch-suggestions property
16+
*
17+
* @param queryString Current value of the text input
18+
* @param callback Callback function used to indicate that suggestions have completely fetched
19+
*/
20+
(queryString: string, callback: FetchSuggestionsCallback): void
21+
}
22+
23+
/** Autocomplete Component */
24+
export declare class ElAutocomplete extends ElementUIComponent {
25+
/** The placeholder of Autocomplete */
26+
placeholder: string
27+
28+
/** Whether Autocomplete is disabled */
29+
disabled: boolean
30+
31+
/** Icon name */
32+
icon: string
33+
34+
/** Binding value */
35+
value: string
36+
37+
/** Component name of your customized suggestion list item */
38+
customItem: string
39+
40+
/** A method to fetch input suggestions. When suggestions are ready, invoke callback(data:[]) to return them to Autocomplete */
41+
fetchSuggestions: FetchSuggestions
42+
43+
/** Custom class name for autocomplete's dropdown */
44+
popperClass: string
45+
46+
/** Whether show suggestions when input focus */
47+
triggerOnFocus: boolean
48+
49+
/** Hook function when clicking on the input icon */
50+
onIconClick: IconClickEventHandler
51+
}

src/types/badge.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { ElementUIComponent } from './component'
2+
3+
/** Badge Component */
4+
export declare class ElBadge extends ElementUIComponent {
5+
/** Display value */
6+
value: string | number
7+
8+
/** Maximum value, shows '{max}+' when exceeded. Only works if `value` is a number */
9+
max: number
10+
11+
/** If a little dot is displayed */
12+
isDot: boolean
13+
14+
/** Hidden badge */
15+
hidden: boolean
16+
}

src/types/breadcrumb-item.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Route } from 'vue-router'
2+
import { ElementUIComponent } from './component'
3+
4+
/** Breadcrumb Item Component */
5+
export declare class ElBreadcrumbItem extends ElementUIComponent {
6+
/** Target route of the link, same as to of vue-router */
7+
to: string | Route
8+
9+
/** If true, the navigation will not leave a history record */
10+
replace: boolean
11+
}

src/types/breadcrumb.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ElementUIComponent } from './component'
2+
3+
/** Displays the location of the current page, making it easier to browser back */
4+
export declare class ElBreadcrumb extends ElementUIComponent {
5+
/** Separator character */
6+
separator: string
7+
}

src/types/button-group.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { ElementUIComponent } from './component'
2+
3+
/** Button Group Component */
4+
export declare class ElButtonGroup extends ElementUIComponent {}

src/types/button.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { ElementUIComponent, ElementUIComponentSize } from './component'
2+
3+
/** Button type */
4+
export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
5+
6+
/** Same as native button's type */
7+
export type ButtonNativeType = 'button' | 'submit' | 'reset' | 'menu'
8+
9+
/** Button Component */
10+
export declare class ElButton extends ElementUIComponent {
11+
/** Button size */
12+
size: ElementUIComponentSize
13+
14+
/** Button type */
15+
type: ButtonType
16+
17+
/** Determine whether it's a plain button */
18+
plain: Boolean
19+
20+
/** Determine whether it's loading */
21+
loading: Boolean
22+
23+
/** Disable the button */
24+
disabled: boolean
25+
26+
/** Button icon, accepts an icon name of Element icon component */
27+
icon: string
28+
29+
/** Same as native button's autofocus */
30+
autofocus: boolean
31+
32+
/** Same as native button's type */
33+
nativeType: ButtonNativeType
34+
}

src/types/card.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { VNode, VNodeDirective } from 'vue'
2+
import { ElementUIComponent } from './component'
3+
4+
export interface CardSlots {
5+
/** Content of the card */
6+
default: VNode[],
7+
8+
/** Title of the card */
9+
header: VNode[]
10+
11+
[key: string]: VNode[]
12+
}
13+
14+
/** Integrate information in a card container */
15+
export declare class ElCard extends ElementUIComponent {
16+
/** Title of the card */
17+
header: string
18+
19+
/** CSS style of body */
20+
bodyStyle: object
21+
22+
$slots: CardSlots
23+
}

src/types/carousel-item.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ElementUIComponent } from './component'
2+
3+
/** Carousel Item Component */
4+
export declare class ElCarouselItem extends ElementUIComponent {
5+
/** Name of the item, can be used in setActiveItem */
6+
name: string
7+
}

0 commit comments

Comments
 (0)