desc: 修改显示字段,增加loading

This commit is contained in:
zyy 2019-09-02 11:04:23 +08:00
parent 6e60afb4e6
commit 6fa64dd26b
7 changed files with 45 additions and 44 deletions

View File

@ -30,9 +30,9 @@
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<div v-if="hasProduct" class="btn-buy"> <div v-if="hasProduct" class="btn-buy">
<el-button :loading="buttonLoading" type="success" @click="buy">{{ $t('global.buy') }}</el-button> <el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button> <el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button> <el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button> <el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>

View File

@ -16,7 +16,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="show = false"> </el-button> <el-button @click="show = false"> </el-button>
<el-button type="primary" @click="handleSure"> </el-button> <el-button type="primary" :loading="status" @click="handleSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
@ -34,7 +34,8 @@ export default {
loadNum: 1 loadNum: 1
}, },
maxNumber: 1, maxNumber: 1,
pickerOptions: { selectableRange: '00:00:00 - 23:59:59' } pickerOptions: { selectableRange: '00:00:00 - 23:59:59' },
status: false
}; };
}, },
computed: { computed: {
@ -77,6 +78,7 @@ export default {
this.show = true; this.show = true;
}, },
doClose() { doClose() {
this.status = false;
this.show = false; this.show = false;
}, },
handleChange(initTime) { handleChange(initTime) {
@ -96,6 +98,7 @@ export default {
handleSure() { handleSure() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.status = true;
const model = { const model = {
initTime: this.formatTime(this.formModel.initTime) initTime: this.formatTime(this.formModel.initTime)
}; };

View File

@ -35,9 +35,9 @@
</div> </div>
<div class="btn-buy"> <div class="btn-buy">
<el-button type="success" @click="buy">购买</el-button> <el-button type="success" @click="buy">购买</el-button>
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="distribute">权限分发(考试)</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">权限分发(考试)</el-button>
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="transfer">权限转赠</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">权限转赠</el-button>
<el-button v-if="isAddRule" :loading="loading" type="primary" @click="checkCourse">查看课程试卷</el-button> <el-button v-if="isAddRule" type="primary" @click="checkCourse">查看课程试卷</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>

View File

@ -210,7 +210,7 @@ export default {
// }); // });
}, },
formatterDate(row, porpInfo) { formatterDate(row, porpInfo) {
return row[porpInfo.property]; return row[porpInfo.property] ? row[porpInfo.property] : '---';
}, },
queryFunction(params) { queryFunction(params) {
return listPackagePermission(params); return listPackagePermission(params);

View File

@ -166,7 +166,7 @@ export default {
}); });
}, },
formatterDate(row, porpInfo) { formatterDate(row, porpInfo) {
return row[porpInfo.property]; return row[porpInfo.property] ? row[porpInfo.property] : '---';
}, },
queryFunction(params) { queryFunction(params) {
return listPermision(params); return listPermision(params);

View File

@ -20,7 +20,7 @@ export default {
return { return {
param: '', param: '',
WhetherTypeList: [], WhetherTypeList: [],
EffectiveTypeList: [], // EffectiveTypeList: [],
PermissionTypeList: [], PermissionTypeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
@ -37,14 +37,14 @@ export default {
data: [] data: []
} }
}, },
'status': { // 'status': {
type: 'select', // type: 'select',
label: this.$t('permission.permissionStatus'), // label: this.$t('permission.permissionStatus'),
value: '1', // value: '1',
config: { // config: {
data: [] // data: []
} // }
}, // },
'canDistribute': { 'canDistribute': {
type: 'select', type: 'select',
label: this.$t('permission.permissionUseType'), label: this.$t('permission.permissionUseType'),
@ -121,18 +121,18 @@ export default {
prop: 'ownerName', prop: 'ownerName',
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1; } isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1; }
}, },
{ // {
title: this.$t('permission.permissionStatus'), // title: this.$t('permission.permissionStatus'),
prop: 'status', // prop: 'status',
type: 'tag', // type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, // columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => { // tagType: (row) => {
switch (row.status) { // switch (row.status) {
case '1': return 'success'; // case '1': return 'success';
default: return 'danger'; // default: return 'danger';
} // }
} // }
}, // },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
@ -164,28 +164,26 @@ export default {
loadInitData() { loadInitData() {
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList; this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
this.$Dictionary.effectiveType().then(list => { // this.$Dictionary.effectiveType().then(list => {
list.forEach(elem => { // list.forEach(elem => {
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name }); // this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
}); // });
this.$convertList(list, this.EffectiveTypeList, elem => { // this.$convertList(list, this.EffectiveTypeList, elem => {
return true; // return true;
}); // });
}); // });
this.$Dictionary.permissionType().then(list => { this.$Dictionary.permissionType().then(list => {
list.forEach(elem => { list.forEach(elem => {
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
}); });
console.log(list);
this.$convertList(list, this.PermissionTypeList, elem => { this.$convertList(list, this.PermissionTypeList, elem => {
return true; return true;
}); });
console.log(this.PermissionTypeList);
}); });
}, },
formatterDate(row, porpInfo) { formatterDate(row, porpInfo) {
return row[porpInfo.property]; return row[porpInfo.property] ? row[porpInfo.property] : '---';
}, },
queryFunction(params) { queryFunction(params) {
return listUserPermision(params); return listUserPermision(params);

View File

@ -42,8 +42,8 @@
</div> </div>
<div class="btn-buy"> <div class="btn-buy">
<el-button type="success" @click="buy">{{ $t('teach.buy') }}</el-button> <el-button type="success" @click="buy">{{ $t('teach.buy') }}</el-button>
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="distribute">{{ $t('teach.permissionDistribute') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('teach.permissionDistribute') }}</el-button>
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="transfer">{{ $t('teach.authorityTransferred') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('teach.authorityTransferred') }}</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>