@@ -330,12 +332,12 @@
{{
- $t("trials:researchRecord:message:createLinkSuccessfully")
+ $t('trials:researchRecord:message:createLinkSuccessfully')
}}
- {{ $t("trials:researchRecord:label:link") }}
+ {{ $t('trials:researchRecord:label:link') }}
- {{ $t("trials:researchRecord:button:copyLink") }}
+ {{ $t('trials:researchRecord:button:copyLink') }}
@@ -362,10 +364,10 @@
{{
- $t("trials:researchRecord:button:copyCode")
+ $t('trials:researchRecord:button:copyCode')
}}
{{
- $t("trials:researchRecord:button:savePic")
+ $t('trials:researchRecord:button:savePic')
}}
@@ -379,32 +381,32 @@ import {
getTrialSiteSurveyList,
getTrialSiteSelect,
abandonSiteSurvey,
-} from "@/api/trials";
-import { changeURLStatic } from "@/utils/history.js";
-import BaseContainer from "@/components/BaseContainer";
-import Pagination from "@/components/Pagination";
-import Users from "./components/users";
-import ResearchForm from "@/views/research/form";
-import BaseModel from "@/components/BaseModel";
-import QRCode from "qrcodejs2";
+} from '@/api/trials'
+import { changeURLStatic } from '@/utils/history.js'
+import BaseContainer from '@/components/BaseContainer'
+import Pagination from '@/components/Pagination'
+import Users from './components/users'
+import ResearchForm from '@/views/research/form'
+import BaseModel from '@/components/BaseModel'
+import QRCode from 'qrcodejs2'
const searchDataDefault = () => {
return {
- SortField: "",
+ SortField: '',
Asc: true,
PageIndex: 1,
PageSize: 20,
- TrialSiteId: "",
- UserKeyInfo: "",
+ TrialSiteId: '',
+ UserKeyInfo: '',
State: null,
- IsDeleted: "",
+ IsDeleted: '',
DateRange: [],
PreliminaryUserName: null,
ReviewerUserName: null,
- };
-};
+ }
+}
export default {
- name: "SiteResearchList",
+ name: 'SiteResearchList',
components: { BaseContainer, Pagination, Users, ResearchForm, BaseModel },
data() {
return {
@@ -418,195 +420,195 @@ export default {
researchInfoVisible: false,
share_model: {
visible: false,
- title: this.$t("trials:researchRecord:title:shark"),
- width: "800px",
+ title: this.$t('trials:researchRecord:title:shark'),
+ width: '800px',
},
- shareLink: "",
+ shareLink: '',
researchState: this.$d.ResearchRecord,
qrcode: null,
- };
+ }
},
mounted() {
- this.getList();
- this.getSite();
+ this.getList()
+ this.getSite()
},
methods: {
// 获取系统文件数据
getList() {
- this.loading = true;
- this.searchData.TrialId = this.trialId;
+ this.loading = true
+ this.searchData.TrialId = this.trialId
if (this.searchData.DateRange && this.searchData.DateRange.length === 2) {
- this.searchData.UpdateTimeBegin = this.searchData.DateRange[0];
- this.searchData.updateTimeEnd = this.searchData.DateRange[1];
+ this.searchData.UpdateTimeBegin = this.searchData.DateRange[0]
+ this.searchData.updateTimeEnd = this.searchData.DateRange[1]
} else {
- this.searchData.UpdateTimeBegin = "";
- this.searchData.updateTimeEnd = "";
+ this.searchData.UpdateTimeBegin = ''
+ this.searchData.updateTimeEnd = ''
}
getTrialSiteSurveyList(this.searchData)
.then((res) => {
- this.loading = false;
- this.list = res.Result.CurrentPageData;
- this.total = res.Result.TotalCount;
+ this.loading = false
+ this.list = res.Result.CurrentPageData
+ this.total = res.Result.TotalCount
})
.catch(() => {
- this.loading = false;
- });
+ this.loading = false
+ })
},
// 查看调查表记录详情
handleViewResearchList(row) {
- changeURLStatic("trialSiteSurveyId", row.Id);
- this.researchInfoVisible = true;
+ changeURLStatic('trialSiteSurveyId', row.Id)
+ this.researchInfoVisible = true
},
// 废除待提交的调查表
handleRepealResearch(row) {
// 是否确认废除?
- this.$confirm(this.$t("trials:researchRecord:message:abolish"), {
- type: "warning",
+ this.$confirm(this.$t('trials:researchRecord:message:abolish'), {
+ type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {
abandonSiteSurvey(this.trialId, row.Id).then((res) => {
if (res.IsSuccess) {
- this.getList();
+ this.getList()
// 废除成功
this.$message.success(
- this.$t("trials:researchRecord:message:abolishSuccessfully")
- );
+ this.$t('trials:researchRecord:message:abolishSuccessfully')
+ )
}
- });
- });
+ })
+ })
},
// 展示当前项目下所有调查表需生成账户的用户信息
showResearchUser() {
- this.researchUserVisible = true;
+ this.researchUserVisible = true
},
// 复制链接
copyLink() {
// 中心调研表链接
this.$copyText(
- `${this.$t("trials:researchRecord:message:researchFormLink")}: ${
+ `${this.$t('trials:researchRecord:message:researchFormLink')}: ${
this.shareLink
}`
)
.then((res) => {
// 复制成功
this.$message.success(
- this.$t("trials:researchRecord:message:copySuccessfully")
- );
+ this.$t('trials:researchRecord:message:copySuccessfully')
+ )
})
.catch(() => {
// 复制失败
- this.$alert(this.$t("trials:researchRecord:message:copyFailed"));
- });
+ this.$alert(this.$t('trials:researchRecord:message:copyFailed'))
+ })
},
// 创建二维码
creatQrCode() {
- this.$refs.qrcode.innerHTML = ""; //清除二维码方法一
- let text = this.shareLink;
+ this.$refs.qrcode.innerHTML = '' //清除二维码方法一
+ let text = this.shareLink
this.qrcode = new QRCode(this.$refs.qrcode, {
text: text, //页面地址 ,如果页面需要参数传递请注意哈希模式#
width: 200,
height: 200,
- colorDark: "#000000",
- colorLight: "#ffffff",
+ colorDark: '#000000',
+ colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H,
- });
+ })
// qrcode.clear(); // 清除二维码方法二
},
// 下载二维码
savePic() {
let qrCodeCanvas = document
- .getElementById("qrcode")
- .getElementsByTagName("canvas");
- let a = document.createElement("a");
- a.href = qrCodeCanvas[0].toDataURL("image/url");
- a.download = `${this.$t("trials:researchRecord:title:code")}.png`;
- a.click();
+ .getElementById('qrcode')
+ .getElementsByTagName('canvas')
+ let a = document.createElement('a')
+ a.href = qrCodeCanvas[0].toDataURL('image/url')
+ a.download = `${this.$t('trials:researchRecord:title:code')}.png`
+ a.click()
},
// 复制二维码
handleCopyImg() {
let qrCodeCanvas = document
- .getElementById("qrcode")
- .getElementsByTagName("canvas");
+ .getElementById('qrcode')
+ .getElementsByTagName('canvas')
qrCodeCanvas[0].toBlob(async (blob) => {
- console.log(blob);
+ console.log(blob)
const data = [
new ClipboardItem({
[blob.type]: blob,
}),
- ]; // https://w3c.github.io/clipboard-apis/#dom-clipboard-write
+ ] // https://w3c.github.io/clipboard-apis/#dom-clipboard-write
await navigator.clipboard.write(data).then(
() => {
this.$message.success(
- this.$t("trials:researchRecord:message:copySuccess")
- );
+ this.$t('trials:researchRecord:message:copySuccess')
+ )
},
() => {
this.$message.error(
- this.$t("trials:researchRecord:message:UnableWrite")
- );
+ this.$t('trials:researchRecord:message:UnableWrite')
+ )
}
- );
- });
+ )
+ })
},
// 获取site下拉框数据
getSite() {
getTrialSiteSelect(this.trialId).then((res) => {
- this.siteOptions = res.Result;
- });
+ this.siteOptions = res.Result
+ })
},
// 展示调查表链接
showResearchLink() {
- const trialId = this.trialId;
- this.shareLink = `${location.protocol}//${location.host}/researchLogin?trialId=${trialId}&lang=${this.$i18n.locale}`;
- this.share_model.visible = true;
+ const trialId = this.trialId
+ this.shareLink = `${location.protocol}//${location.host}/researchLogin?trialId=${trialId}&lang=${this.$i18n.locale}`
+ this.share_model.visible = true
this.$nextTick(() => {
- this.creatQrCode();
- });
+ this.creatQrCode()
+ })
},
// 重置
handleReset() {
- this.searchData = searchDataDefault();
- this.searchData.DateRange = [];
+ this.searchData = searchDataDefault()
+ this.searchData.DateRange = []
if (this.searchData.DateRange && this.searchData.DateRange.length === 2) {
- this.searchData.UpdateTimeBegin = this.searchData.DateRange[0];
- this.searchData.updateTimeEnd = this.searchData.DateRange[1];
+ this.searchData.UpdateTimeBegin = this.searchData.DateRange[0]
+ this.searchData.updateTimeEnd = this.searchData.DateRange[1]
} else {
- this.searchData.UpdateTimeBegin = "";
- this.searchData.updateTimeEnd = "";
+ this.searchData.UpdateTimeBegin = ''
+ this.searchData.updateTimeEnd = ''
}
- this.getList();
+ this.getList()
this.$nextTick(() => {
- this.$refs.siteResearchList.clearSort();
- });
+ this.$refs.siteResearchList.clearSort()
+ })
},
// 查询
handleSearch() {
- this.getList();
+ this.getList()
},
// 排序
handleSortByColumn(column) {
- if (column.order === "ascending") {
- this.searchData.Asc = true;
+ if (column.order === 'ascending') {
+ this.searchData.Asc = true
} else {
- this.searchData.Asc = false;
+ this.searchData.Asc = false
}
- this.searchData.SortField = column.prop;
- this.getList();
+ this.searchData.SortField = column.prop
+ this.getList()
},
},
beforeDestroy() {
if (this.qrcode) {
- this.qrcode = null;
+ this.qrcode = null
}
},
-};
+}