管理后台新增浏览器版本推荐
continuous-integration/drone/push Build is failing Details

uat_us
wangxiaoshuang 2024-07-02 14:40:24 +08:00
parent e265b0c2af
commit 4c241b9acd
4 changed files with 497 additions and 25 deletions

View File

@ -1014,3 +1014,35 @@ export function getTrialSiteList(params) {
data: params
})
}
// 获取版本记录列表
export function getExploreRecommendList(params) {
return request({
url: `/ExploreRecommend/getExploreRecommendList`,
method: 'post',
data: params
})
}
// 新增或修改推荐版本记录
export function addOrUpdateExploreRecommend(params) {
return request({
url: `/ExploreRecommend/addOrUpdateExploreRecommend`,
method: 'post',
data: params
})
}
// 删除推荐版本记录
export function deleteExploreRecommend(id) {
return request({
url: `/ExploreRecommend/deleteExploreRecommend/${id}`,
method: 'delete'
})
}
// 获取推荐版本记录详情
export function getExploreRecommentInfo(params) {
return request({
url: `/ExploreRecommend/getExploreRecommentInfo`,
method: 'get',
params
})
}

View File

@ -0,0 +1,186 @@
<template>
<base-model :config="config">
<div slot="dialog-body">
<el-form
ref="browserForm"
:model="form"
label-width="140px"
size="small"
:rules="rules"
>
<div class="base-dialog-body">
<el-form-item
:label="$t('dictionary:browser:form:title')"
prop="Title"
>
<el-input v-model="form.Title" />
</el-form-item>
<el-form-item
:label="$t('dictionary:browser:form:version')"
prop="Version"
>
<el-input v-model="form.Version" type="textarea" rows="5" />
</el-form-item>
<el-form-item
:label="$t('dictionary:browser:form:downloadUrl')"
prop="DownloadUrl"
>
<el-input v-model="form.DownloadUrl" />
</el-form-item>
<el-form-item :label="$t('dictionary:browser:form:addFile')">
<el-upload
class="upload-demo"
action
:before-upload="beforeUpload"
:http-request="handleUploadFile"
:on-preview="handlePreview"
:on-remove="handleRemoveFile"
:show-file-list="true"
:limit="1"
:file-list="fileList"
>
<el-button
size="small"
type="primary"
:disabled="fileList.length > 0"
>{{ $t("common:button:upload") }}</el-button
>
</el-upload>
</el-form-item>
<el-form-item :label="$t('dictionary:browser:form:isDeleted')">
<el-switch
v-model="form.IsDeleted"
:active-value="false"
:inactive-value="true"
>
</el-switch>
</el-form-item>
</div>
</el-form>
</div>
<div slot="dialog-footer">
<el-button size="small" @click="canel">
{{ $t("dictionary:browser:button:canel") }}
</el-button>
<el-button size="small" type="primary" :loading="loading" @click="save">
{{ $t("dictionary:browser:button:save") }}
</el-button>
</div>
</base-model>
</template>
<script>
import baseModel from "@/components/BaseModel";
import { addOrUpdateExploreRecommend } from "@/api/dictionary";
export default {
props: {
config: {
required: true,
default: () => {
return {};
},
},
data: {
required: true,
default: () => {
return {};
},
},
},
components: {
"base-model": baseModel,
},
data() {
return {
form: {
Version: null,
Title: null,
IsDeleted: true,
DownloadUrl: null,
Path: null,
FileName: null,
},
rules: {
Title: [
{
required: true,
message: this.$t("common:ruleMessage:specify"),
trigger: ["blur", "change"],
},
],
Version: [
{
required: true,
message: this.$t("common:ruleMessage:specify"),
trigger: ["blur", "change"],
},
],
},
fileList: [],
loading: false,
};
},
created() {
if (this.config.status === "edit") {
Object.keys(this.form).forEach((key) => {
this.form[key] = this.data[key];
});
}
},
methods: {
async save() {
try {
let validate = await this.$refs.browserForm.validate();
if (!validate) return false;
this.loading = true;
if (this.config.status === "edit") {
this.form.Id = this.data.Id;
}
let res = await addOrUpdateExploreRecommend(this.form);
if (res.IsSuccess) {
this.$emit("close");
this.$emit("getList");
}
} catch (err) {
console.log(err);
this.loading = false;
}
},
canel() {
this.$emit("close");
},
handleRemoveFile() {
this.form.FileName = null;
this.form.Path = null;
this.fileList = [];
},
beforeUpload() {
if (this.fileList.length > 0) {
this.$alert(this.$t("dictionary:bbrowser:msg:message1"));
return;
}
},
handlePreview(row, r2) {
if (row.fullPath) {
window.open(row.fullPath, "_blank");
}
},
async handleUploadFile(param) {
this.loading = true;
var file = await this.fileToBlob(param.file);
const res = await this.OSSclient.put(
`/System/Browser/${param.file.name}`,
file
);
this.fileList.push({
name: param.file.name,
path: this.$getObjectName(res.url),
fullPath: this.$getObjectName(res.url),
url: this.$getObjectName(res.url),
});
this.form.Path = this.$getObjectName(res.url);
this.form.FileName = param.file.name;
this.loading = false;
},
},
};
</script>

View File

@ -0,0 +1,242 @@
<template>
<box-content>
<!-- 搜索框 -->
<div class="search">
<el-form :inline="true" size="mini" class="base-search-form">
<el-form-item :label="$t('dictionary:browser:search:title')">
<el-input v-model="searchData.Title" style="width: 100px" />
</el-form-item>
<el-form-item :label="$t('dictionary:browser:search:version')">
<el-input v-model="searchData.Version" style="width: 100px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleReset">{{
$t("dictionary:browser:button:reset")
}}</el-button>
<el-button type="primary" @click="handleSearch">{{
$t("dictionary:browser:button:search")
}}</el-button>
</el-form-item>
</el-form>
<span style="margin-left: auto">
<el-button type="primary" size="mini" @click="handleAdd">
{{ $t("dictionary:browser:button:add") }}
</el-button>
</span>
</div>
<!-- 浏览器推荐版本列表 -->
<el-table
v-loading="loading"
v-adaptive="{ bottomOffset: 45 }"
:data="list"
stripe
height="100"
style="width: 100%"
@sort-change="handleSortByColumn"
>
<el-table-column type="index" width="40" />
<el-table-column
prop="Title"
:label="$t('dictionary:browser:table:title')"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
prop="Version"
:label="$t('dictionary:browser:table:version')"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
prop="Path"
:label="$t('dictionary:browser:table:path')"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
prop="FileName"
:label="$t('dictionary:browser:table:fileName')"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<a
:href="OSSclientConfig.basePath + scope.row.FullFilePath"
target="_blank"
style="color: #428bca"
>
{{ scope.row.FileName }}
</a>
</template>
</el-table-column>
<el-table-column
prop="IsDeleted"
:label="$t('dictionary:browser:table:IsDeleted')"
show-overflow-tooltip
sortable="custom"
>
<el-tag v-if="scope.row.IsDeleted" type="danger">{{
$fd("IsSiteDisable", scope.row.IsDeleted)
}}</el-tag>
<el-tag v-else>{{ $fd("IsSiteDisable", scope.row.IsDeleted) }}</el-tag>
</el-table-column>
<el-table-column
prop="UpdateTime"
:label="$t('dictionary:browser:table:updateTime')"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('dictionary:browser:table:action')"
width="200"
fixed="right"
>
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">
{{ $t("dictionary:browser:button:edit") }}
</el-button>
<el-button type="text" @click="handleDelete(scope.row)">
{{ $t("dictionary:browser:button:delete") }}
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<browser-form
:config="config"
:data="rowData"
v-if="config.visible"
@close="close"
@getList="getList"
/>
</box-content>
</template>
<script>
import {
getExploreRecommendList,
deleteExploreRecommend,
} from "@/api/dictionary";
import Pagination from "@/components/Pagination";
import BoxContent from "@/components/BoxContent";
import browserForm from "./form.vue";
const searchDataDefault = () => {
return {
Version: null,
Title: null,
DownloadUrl: null,
FileName: null,
IsDeleted: true,
pageIndex: 1,
pageSize: 20,
Asc: false,
SortField: null,
};
};
export default {
name: "browser",
components: { BoxContent, Pagination, browserForm },
data() {
return {
searchData: searchDataDefault(),
loading: false,
list: [],
total: 0,
rowData: {},
config: {
visible: false,
showClose: true,
width: "600px",
title: "",
appendToBody: true,
status: "add",
},
};
},
mounted() {
this.getList();
},
methods: {
async getList() {
try {
this.loading = true;
let res = await getExploreRecommendList(this.searchData);
if (res.IsSuccess) {
this.loading = false;
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
}
} catch (err) {
console.log(err);
this.loading = false;
}
},
//
handleAdd() {
this.rowData = {};
this.config.title = this.$t("dictionary:browser:form:title:add");
this.config.status = "add";
this.config.visible = true;
},
//
handleEdit(row) {
this.rowData = { ...row };
this.config.title = this.$t("dictionary:browser:form:title:edit");
this.config.status = "edit";
this.config.visible = true;
},
//
handleDelete(row) {
this.$confirm(this.$t("dictionary:browser:message:deleteMessage"), {
type: "warning",
distinguishCancelAndClose: true,
}).then(() => {
deleteSystemBasicData(row.Id).then((res) => {
if (res.IsSuccess) {
this.list.splice(
this.list.findIndex((item) => item.Id === row.Id),
1
);
this.$message.success(
this.$t("common:message:deletedSuccessfully")
);
}
});
});
},
//
handleSearch() {
this.searchData.PageIndex = 1;
this.getList();
},
//
handleReset() {
this.searchData = searchDataDefault();
this.getList();
},
//
handleSortByColumn(column) {
if (column.order === "ascending") {
this.searchData.Asc = true;
} else {
this.searchData.Asc = false;
}
this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1;
this.getList();
},
close() {
this.config.visible = false;
},
},
};
</script>

View File

@ -25,41 +25,53 @@
<el-tab-pane label="签名管理" name="sign">
<Sign v-if="activeTab == 'sign'" />
</el-tab-pane>
<el-tab-pane label="浏览器推荐" name="browser">
<Browser v-if="activeTab == 'browser'" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import QcQuestions from './components/QcQuestions.vue'
import CriterionsTmp from './components/CriterionsTmp'
import ClinicalData from './components/ClinicalDataConfig'
import MedicalAudit from './components/MedicalAudit'
import Anonymization from './components/Anonymization'
import IncreaseFields from './components/IncreaseFields'
import Email from './email/index.vue'
import Sign from './sign/index.vue'
import QcQuestions from "./components/QcQuestions.vue";
import CriterionsTmp from "./components/CriterionsTmp";
import ClinicalData from "./components/ClinicalDataConfig";
import MedicalAudit from "./components/MedicalAudit";
import Anonymization from "./components/Anonymization";
import IncreaseFields from "./components/IncreaseFields";
import Email from "./email/index.vue";
import Sign from "./sign/index.vue";
import Browser from "./browser/index.vue";
export default {
name: 'Questions',
name: "Questions",
components: {
QcQuestions, CriterionsTmp, ClinicalData, Anonymization, IncreaseFields, Email, Sign,
MedicalAudit
QcQuestions,
CriterionsTmp,
ClinicalData,
Anonymization,
IncreaseFields,
Email,
Sign,
MedicalAudit,
Browser,
},
data() {
return {
activeTab: 'qc'
}
}, mounted() {
activeTab: "qc",
};
},
mounted() {
if (this.$route.query.tabActive) {
this.activeTab = this.$route.query.tabActive
this.activeTab = this.$route.query.tabActive;
} else {
this.activeTab = 'qc'
this.activeTab = "qc";
}
},
methods: {
clickTab(tab, event) {
this.$router.push({ path: `/dictionary/template?tabActive=${tab.name}` })
}
}
}
this.$router.push({ path: `/dictionary/template?tabActive=${tab.name}` });
},
},
};
</script>
<style lang="scss">
.question-wrapper {