|
@@ -0,0 +1,389 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <PageMain class="vh100">
|
|
|
|
|
+ <ElForm :inline="false" :model="formInline" class="demo-form-inline" label-width="100px">
|
|
|
|
|
+ <ElRow :gutter="20">
|
|
|
|
|
+ <ElCol :md="6">
|
|
|
|
|
+ <ElFormItem label="应用名称">
|
|
|
|
|
+ <el-input v-model="formInline.companyName" placeholder="输入应用名称查找" clearable class="el-inputs" />
|
|
|
|
|
+ </ElFormItem>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="4">
|
|
|
|
|
+ <el-button type="primary" v-auth="'paymentCodeConfig.view'" @click="findpage">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <SvgIcon name="i-ep:search" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ 查询</el-button>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ </ElRow>
|
|
|
|
|
+ </ElForm>
|
|
|
|
|
+ <ElDivider border-style="dashed"></ElDivider>
|
|
|
|
|
+ <Table :tableData="tableData" :columns="columns" :showIndex="false" :columnwidth="250" :showSelect="false"
|
|
|
|
|
+ :pageInfo="pageInfo" @getList="getList">
|
|
|
|
|
+ <template v-slot:table-title-btn>
|
|
|
|
|
+ <el-button type="primary" @click="companyAdd" v-auth="'paymentCodeConfig.add'">
|
|
|
|
|
+ 发布新版本
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Plus />
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:operation="scope">
|
|
|
|
|
+ <Auth :value="'paymentCodeConfig.edit'">
|
|
|
|
|
+ <el-button type="primary" link @click="versionEdit(scope.operationData.id)"> 编辑
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </Auth>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:search="scope">
|
|
|
|
|
+ {{ scope.slotData.label }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Table>
|
|
|
|
|
+ </PageMain>
|
|
|
|
|
+ <el-dialog v-model="paynemtAdddialogVisible" :title="dialogTitle" width="50%" @close="close" top="5vh">
|
|
|
|
|
+ <ElRow :gutter="20">
|
|
|
|
|
+ <el-form :model="paymentform" :inline="true" label-width="120px" :rules="memberformRules" label-position="top"
|
|
|
|
|
+ ref="paymentFormRef" style="width: 100%;" :size="fromSize">
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="应用名称" prop="companyName">
|
|
|
|
|
+ <el-select v-model="paymentform.companyName" placeholder="请选择应用" clearable>
|
|
|
|
|
+ <el-option label="dwd" value="wdw" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="更新类型" prop="type">
|
|
|
|
|
+ <el-select v-model="paymentform.companyName" placeholder="请选择更新方式" clearable>
|
|
|
|
|
+ <el-option label="强制更新" value="强制更新"></el-option>
|
|
|
|
|
+ <el-option label="强提示" value="强提示"></el-option>
|
|
|
|
|
+ <el-option label="不提示升级" value="不提示升级"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="更新后的版本号" prop="apiType">
|
|
|
|
|
+ <el-input v-model="paymentform.apiType" style="width: 100%;" placeholder="请输入版本号(x.x.x)" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="安装包类型" prop="apiType">
|
|
|
|
|
+ <el-select v-model="paymentform.companyName" placeholder="请选择安装包类型" clearable>
|
|
|
|
|
+ <el-option label="wgt" value="wgt"></el-option>
|
|
|
|
|
+ <el-option label="apk" value="wgt"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="24">
|
|
|
|
|
+ <el-form-item label="平台" prop="apiType">
|
|
|
|
|
+ <el-select v-model="paymentform.apiType" placeholder="请选择平台" clearable>
|
|
|
|
|
+ <el-option label="安卓" value="wgt"></el-option>
|
|
|
|
|
+ <el-option label="苹果" value="wgt"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="24">
|
|
|
|
|
+ <el-form-item label="安装包" prop="apiType">
|
|
|
|
|
+ <el-upload class="upload-demo" drag action="#" style="width: 100%;" :auto-upload="false"
|
|
|
|
|
+ :on-change="sysIconupload" multiple>
|
|
|
|
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
|
|
+ <div class="el-upload__text flex f-c ">
|
|
|
|
|
+ 点击或将安装包拖拽到这里上传,上传wgt/apk格式
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <span>{{paymentform.url}}</span> -->
|
|
|
|
|
+
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="24">
|
|
|
|
|
+ <el-form-item label="安装包地址" prop="url">
|
|
|
|
|
+ <el-input v-model="paymentform.url" style="width: 100%;" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="24">
|
|
|
|
|
+ <el-form-item label="更新说明" prop="apiType">
|
|
|
|
|
+ <el-input v-model="paymentform.apiType" type="textarea" style="width: 100%;" show-word-limit
|
|
|
|
|
+ maxlength="500" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </ElRow>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button @click="paynemtAdddialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addApplication(paymentFormRef)">
|
|
|
|
|
+ 保存
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <el-dialog v-model="dialogVisible" title="图片预览">
|
|
|
|
|
+ <img w-full :src="appIconUrl" alt="Preview Image" />
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
|
|
+import api from '@/api';
|
|
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
+import { FormRules, FormInstance, ComponentSize, UploadFile } from 'element-plus';
|
|
|
|
|
+interface PageInfo {
|
|
|
|
|
+ pageNum: number;
|
|
|
|
|
+ pageSize: number;
|
|
|
|
|
+ sizes: number[];
|
|
|
|
|
+ total: number;
|
|
|
|
|
+}
|
|
|
|
|
+interface paymentform {
|
|
|
|
|
+ id?: string,
|
|
|
|
|
+ companyId: string,
|
|
|
|
|
+ companyName: string,
|
|
|
|
|
+ type: string,
|
|
|
|
|
+ apiType: string,
|
|
|
|
|
+ url: string,
|
|
|
|
|
+}
|
|
|
|
|
+const appIconUrl = ref()//icon图片
|
|
|
|
|
+const tableData = ref([]);//列表数据
|
|
|
|
|
+const uploadDisabled = ref(false)//上传组件
|
|
|
|
|
+const dialogVisible = ref(false)//图片预览窗口
|
|
|
|
|
+const paymentFormRef = ref<FormInstance>()
|
|
|
|
|
+const fromSize = ref<ComponentSize>('default')//表单大小
|
|
|
|
|
+const paynemtAdddialogVisible = ref(false)//弹窗
|
|
|
|
|
+const dictLists = ref<{ [key: string]: any[] }>({});//字典集合
|
|
|
|
|
+const dialogTitle = ref('发布新版本')//弹窗title
|
|
|
|
|
+const dialogType = ref('add')//弹窗title
|
|
|
|
|
+const companyList = ref();
|
|
|
|
|
+
|
|
|
|
|
+const paymentform = reactive<paymentform>({
|
|
|
|
|
+ id: "",
|
|
|
|
|
+ companyId: "",
|
|
|
|
|
+ companyName: "",
|
|
|
|
|
+ type: "",
|
|
|
|
|
+ apiType: "",
|
|
|
|
|
+ url: "",
|
|
|
|
|
+})
|
|
|
|
|
+const memberformRules = ref<FormRules>({
|
|
|
|
|
+ companyId: [
|
|
|
|
|
+ { required: true, trigger: 'blur', message: '请输入应用名称' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ type: [
|
|
|
|
|
+ { required: true, trigger: 'blur', message: '请输入应用ID' },
|
|
|
|
|
+ ],
|
|
|
|
|
+
|
|
|
|
|
+});
|
|
|
|
|
+//分页
|
|
|
|
|
+const pageInfo = ref({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+ sizes: [10, 20, 30, 40, 50],
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+});
|
|
|
|
|
+//检索条件
|
|
|
|
|
+const formInline = reactive({
|
|
|
|
|
+ companyName: '',//保险公司name
|
|
|
|
|
+})
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ companyQuery();//获取保险公司
|
|
|
|
|
+ dictType('api_type');//qpi类型
|
|
|
|
|
+ dictType('qr_barcode');//请求类型
|
|
|
|
|
+
|
|
|
|
|
+});
|
|
|
|
|
+function findpage() {
|
|
|
|
|
+ api.company.QRcodePage({ pages: pageInfo.value.pageNum, size: pageInfo.value.pageSize, ...formInline }).then((res: any) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ tableData.value = res.data.records;
|
|
|
|
|
+ pageInfo.value.pageNum = res.data.current;
|
|
|
|
|
+ pageInfo.value.pageSize = res.data.size;
|
|
|
|
|
+ pageInfo.value.total = res.data.total;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+const columns = [
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "companyName", label: "应用名称", width: '380'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "更新类型", width: '280'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "更新后的版本号", width: '280',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "安装包类型", width: '280',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "平台", width: '280',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "安装包", width: '280',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: "type", label: "安装包地址", width: '280',
|
|
|
|
|
+ },
|
|
|
|
|
+];
|
|
|
|
|
+//分页事件
|
|
|
|
|
+function getList(item: PageInfo) {
|
|
|
|
|
+ pageInfo.value.pageNum = item.pageNum;
|
|
|
|
|
+ pageInfo.value.pageSize = item.pageSize;
|
|
|
|
|
+ findpage();
|
|
|
|
|
+};
|
|
|
|
|
+//保险公司选择
|
|
|
|
|
+//获取保险公司列表
|
|
|
|
|
+const companyQuery = () => {
|
|
|
|
|
+ api.company.selectLevelList({ name: "" }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ companyList.value = res.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+//上传事件
|
|
|
|
|
+const sysIconupload = (file: any) => {
|
|
|
|
|
+ let files = file.raw;
|
|
|
|
|
+ const params = new FormData(); // 声明formData数据类型
|
|
|
|
|
+ params.append("file", files);
|
|
|
|
|
+ api.toolApi.fileupload(params).then((res: any) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ paymentform.id = res.data.id;
|
|
|
|
|
+ paymentform.url = res.data.downloadUrl;
|
|
|
|
|
+ uploadDisabled.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+//预览图片
|
|
|
|
|
+const handlePictureCardPreview = (file: UploadFile) => {
|
|
|
|
|
+ appIconUrl.value = file.url;
|
|
|
|
|
+ dialogVisible.value = true;
|
|
|
|
|
+}
|
|
|
|
|
+//删除图片
|
|
|
|
|
+const handleRemove = (file: UploadFile) => {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+//添加按钮
|
|
|
|
|
+const companyAdd = () => {
|
|
|
|
|
+ dialogTitle.value = '发布新版本';
|
|
|
|
|
+ dialogType.value = 'add';
|
|
|
|
|
+ paynemtAdddialogVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+//保存
|
|
|
|
|
+const addApplication = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
+ if (!formEl) return
|
|
|
|
|
+ await formEl.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (dialogType.value == 'add') {
|
|
|
|
|
+ api.company.QRBarcodeAdd({ ...paymentform }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ paynemtAdddialogVisible.value = false;
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ api.company.QRBarcodeUpdate({ ...paymentform }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ paynemtAdddialogVisible.value = false;
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '信息不完整',
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+// 编辑
|
|
|
|
|
+const versionEdit = (id: string) => {
|
|
|
|
|
+ dialogTitle.value = '编辑应用';
|
|
|
|
|
+ dialogType.value = 'edit';
|
|
|
|
|
+ api.company.QRcodeById(id).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ Object.keys(paymentform).forEach((key) => {
|
|
|
|
|
+ if (res.data.hasOwnProperty(key)) {
|
|
|
|
|
+ paymentform[key as keyof typeof paymentform] = res.data[key as keyof typeof paymentform];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ paynemtAdddialogVisible.value = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+// 删除
|
|
|
|
|
+const paymentDel = (id: string) => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '确定删除吗?',
|
|
|
|
|
+ '删除二维码配置',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确定删除',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ center: true,
|
|
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ api.company.QRcodeDel(id).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+//字典信息处理
|
|
|
|
|
+const dictType = (type: string) => {
|
|
|
|
|
+ api.toolApi.dictType({ dictCode: type }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ dictLists.value[type + 'List'] = res.data.map((item: any) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ value: item.value,
|
|
|
|
|
+ label: item.label
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+const close = () => {
|
|
|
|
|
+ paymentform.companyId = "";
|
|
|
|
|
+ paymentform.companyName = "";
|
|
|
|
|
+ paymentform.type = "";
|
|
|
|
|
+ paymentform.apiType = "";
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+:deep(.el-divider--horizontal) {
|
|
|
|
|
+ margin: 8px 0 24px;
|
|
|
|
|
+ color: #f2f2f2;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.el-inputs {
|
|
|
|
|
+ width: 100% !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.disabled :deep(.el-upload--picture-card) {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|