|
|
@@ -2,8 +2,8 @@
|
|
|
<div class="app-container">
|
|
|
<div
|
|
|
class="config-card"
|
|
|
- v-loading="reissueLoading"
|
|
|
- element-loading-text="补发中,请稍候..."
|
|
|
+ v-loading="cardLoading"
|
|
|
+ :element-loading-text="loadingText"
|
|
|
>
|
|
|
<div class="config-header">
|
|
|
<h2>补发SOP配置</h2>
|
|
|
@@ -26,7 +26,7 @@
|
|
|
<el-option label="飞书" :value="2" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="form.type == 1" label="小程序" prop="appId">
|
|
|
+ <el-form-item label="小程序" prop="appId">
|
|
|
<el-select
|
|
|
v-model="form.appId"
|
|
|
placeholder="请选择小程序"
|
|
|
@@ -40,6 +40,17 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="答题短链" prop="shortLink">
|
|
|
+ <el-input v-model="form.shortLink" :disabled="true" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="答题进度" prop="rate">
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.rate"
|
|
|
+ :min="1"
|
|
|
+ :max="100"
|
|
|
+ class="form-select"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="可用状态">
|
|
|
<el-radio-group v-model="form.status">
|
|
|
<el-radio :label="1">正常</el-radio>
|
|
|
@@ -49,7 +60,20 @@
|
|
|
</el-form>
|
|
|
<div class="config-footer">
|
|
|
<el-button type="primary" @click="submitForm">提 交</el-button>
|
|
|
- <el-button v-if="form.id" type="success" :loading="reissueLoading" @click="reissueHandle">一键补发</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="form.id"
|
|
|
+ type="success"
|
|
|
+ :loading="reissueLoading"
|
|
|
+ @click="reissueHandle"
|
|
|
+ >一键补发</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="form.id"
|
|
|
+ type="success"
|
|
|
+ :loading="shortLinkLoading"
|
|
|
+ @click="shortLinkHandle"
|
|
|
+ >生成短链</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -61,7 +85,8 @@ import {
|
|
|
getAppIdList,
|
|
|
addReissueConfig,
|
|
|
updateReissueConfig,
|
|
|
- reissueCourseSop
|
|
|
+ reissueCourseSop,
|
|
|
+ generateAnswerShortLink,
|
|
|
} from "@/api/his/reissueConfig";
|
|
|
|
|
|
export default {
|
|
|
@@ -71,6 +96,7 @@ export default {
|
|
|
appList: [],
|
|
|
loading: false,
|
|
|
reissueLoading: false,
|
|
|
+ shortLinkLoading: false,
|
|
|
form: {
|
|
|
type: null,
|
|
|
appId: null,
|
|
|
@@ -78,6 +104,16 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ cardLoading() {
|
|
|
+ return this.reissueLoading || this.shortLinkLoading;
|
|
|
+ },
|
|
|
+ loadingText() {
|
|
|
+ if (this.shortLinkLoading) return "短链生成中,请稍候...";
|
|
|
+ if (this.reissueLoading) return "补发中,请稍候...";
|
|
|
+ return "";
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getInfo();
|
|
|
getAppIdList().then((response) => {
|
|
|
@@ -105,6 +141,17 @@ export default {
|
|
|
this.reissueLoading = false;
|
|
|
});
|
|
|
},
|
|
|
+ shortLinkHandle(){
|
|
|
+ this.shortLinkLoading = true;
|
|
|
+ generateAnswerShortLink(this.form)
|
|
|
+ .then(() => {
|
|
|
+ this.msgSuccess("生成短链成功");
|
|
|
+ this.getInfo();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.shortLinkLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (!valid) return;
|