Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing Details

uat_us
caiyiling 2024-09-23 16:48:51 +08:00
commit 0dcee2c84b
7 changed files with 461 additions and 350 deletions

View File

@ -64,13 +64,13 @@
{{ $t('passwordReset:button:verify') }} {{ $t('passwordReset:button:verify') }}
</el-button> </el-button>
</div> </div>
<div class="box-wrapper" v-if="active === 1"> <div class="box-wrapper" v-show="active === 1">
<el-form <el-form
ref="resetForm" ref="resetForm2"
v-loading="formLoading" v-loading="formLoading"
:model="form" :model="form"
:label-width="$i18n.locale === 'en' ? '180px' : '100px'" :label-width="$i18n.locale === 'en' ? '180px' : '100px'"
:rules="rules" :rules="rules2"
class="demo-ruleForm" class="demo-ruleForm"
size="small" size="small"
> >
@ -213,6 +213,7 @@ export default {
EmailOrPhone: '', EmailOrPhone: '',
VerificationCode: '', VerificationCode: '',
NewPwd: '', NewPwd: '',
CheckPass: '',
UserId: '', UserId: '',
UserType: '', UserType: '',
}, },
@ -255,6 +256,29 @@ export default {
}, },
], ],
}, },
rules2: {
NewPwd: [
{
required: true,
validator: this.$validatePassword,
trigger: ['blur', 'change'],
},
],
CheckPass: [
{
required: true,
validator: validatePass2,
trigger: ['blur', 'change'],
},
],
UserId: [
{
required: true,
message: this.$t('common:ruleMessage:select'),
trigger: ['blur', 'change'],
},
],
},
sendDisabled: true, sendDisabled: true,
sendTitle: this.$t('passwordReset:button:send'), sendTitle: this.$t('passwordReset:button:send'),
formLoading: false, formLoading: false,
@ -262,7 +286,7 @@ export default {
}, },
methods: { methods: {
onSubmit() { onSubmit() {
this.$refs['resetForm'].validate((valid) => { this.$refs['resetForm2'].validate((valid) => {
if (valid) { if (valid) {
this.formLoading = true this.formLoading = true
anonymousSetPassword(this.form.UserId, md5(this.form.NewPwd)) anonymousSetPassword(this.form.UserId, md5(this.form.NewPwd))

View File

@ -34,7 +34,7 @@
style="width: 300px; height: 94px" style="width: 300px; height: 94px"
/> />
</div> </div>
<div class="title" v-else>{{ $t("login:title:system") }}</div> <div class="title" v-else>{{ $t('login:title:system') }}</div>
</div> </div>
<el-form <el-form
ref="loginForm" ref="loginForm"
@ -112,7 +112,7 @@
size="medium" size="medium"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
> >
{{ $t("login:button:login") }} {{ $t('login:button:login') }}
</el-button> </el-button>
<div style="text-align: right"> <div style="text-align: right">
<TopLang <TopLang
@ -128,7 +128,7 @@
@click.native.prevent="handleResetPwd" @click.native.prevent="handleResetPwd"
style="color: rgb(0, 147, 221)" style="color: rgb(0, 147, 221)"
> >
{{ $t("login:button:forgetPassword") }} {{ $t('login:button:forgetPassword') }}
</el-button> </el-button>
</div> </div>
</el-form> </el-form>
@ -181,10 +181,12 @@
> >
<h1 style="text-align: center; margin-bottom: 20px">关于</h1> <h1 style="text-align: center; margin-bottom: 20px">关于</h1>
<p style="margin-bottom: 20px" v-if="NODE_ENV === 'usa'"> <p style="margin-bottom: 20px" v-if="NODE_ENV === 'usa'">
{{ $t("login:title:system_title") }} {{ $t('login:title:system_title') }}
</p>
<p style="margin-bottom: 20px" v-else>{{ $t('login:title:system') }}</p>
<p style="margin-bottom: 20px">
V{{ $Version.IsEnv_US ? $version.Version_US : $version.Version }}
</p> </p>
<p style="margin-bottom: 20px" v-else>{{ $t("login:title:system") }}</p>
<p style="margin-bottom: 20px">V{{ $version.Version }}</p>
<p style="margin-bottom: 20px" v-if="language === 'zh'"> <p style="margin-bottom: 20px" v-if="language === 'zh'">
Copyright © {{ new Date().getFullYear() }} 上海展影医疗科技有限公司 Copyright © {{ new Date().getFullYear() }} 上海展影医疗科技有限公司
版权所有 版权所有
@ -208,14 +210,14 @@
</template> </template>
<script> <script>
import { mapGetters, mapMutations } from "vuex"; import { mapGetters, mapMutations } from 'vuex'
import TopLang from "./topLang"; import TopLang from './topLang'
// import NoticeMarquee from '../trials/trials-layout/components/noticeMarquee' // import NoticeMarquee from '../trials/trials-layout/components/noticeMarquee'
import Vcode from "vue-puzzle-vcode"; import Vcode from 'vue-puzzle-vcode'
import browserTip from "@/views/dictionary/template/browser/tip.vue"; import browserTip from '@/views/dictionary/template/browser/tip.vue'
import Img1 from "@/assets/pic-2.png"; import Img1 from '@/assets/pic-2.png'
export default { export default {
name: "Login", name: 'Login',
components: { TopLang, Vcode, browserTip }, components: { TopLang, Vcode, browserTip },
data() { data() {
return { return {
@ -223,18 +225,18 @@ export default {
VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION, VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION,
aboutVisible: false, aboutVisible: false,
loginForm: { loginForm: {
username: "", username: '',
password: "", password: '',
UserId: null, UserId: null,
}, },
loginRules: { loginRules: {
username: [ username: [
{ {
required: true, required: true,
message: this.$t("login:formRule:userName"), message: this.$t('login:formRule:userName'),
trigger: "blur", trigger: 'blur',
}, },
{ max: 20, message: `${this.$t("common:ruleMessage:maxLength")} 20` }, { max: 20, message: `${this.$t('common:ruleMessage:maxLength')} 20` },
], ],
password: [ password: [
// { // {
@ -244,29 +246,29 @@ export default {
// }, // },
{ {
required: true, required: true,
message: this.$t("login:formRule:password"), message: this.$t('login:formRule:password'),
trigger: "blur", trigger: 'blur',
}, },
{ max: 20, message: `${this.$t("common:ruleMessage:maxLength")} 20` }, { max: 20, message: `${this.$t('common:ruleMessage:maxLength')} 20` },
], ],
}, },
loading: false, loading: false,
passwordType: "password", passwordType: 'password',
loginType: null, loginType: null,
location: null, location: null,
isShow: false, isShow: false,
showCode: false, showCode: false,
Img1, Img1,
}; }
}, },
computed: { computed: {
...mapGetters(["asyncRoutes", "routes", "language"]), ...mapGetters(['asyncRoutes', 'routes', 'language']),
}, },
watch: { watch: {
"$i18n.locale": { '$i18n.locale': {
handler() { handler() {
if (this.$refs.browserTip) { if (this.$refs.browserTip) {
this.$refs.browserTip.open(); this.$refs.browserTip.open()
} }
}, },
deep: true, deep: true,
@ -274,88 +276,88 @@ export default {
}, },
}, },
mounted() { mounted() {
this.loginType = this.$route.query.loginType; this.loginType = this.$route.query.loginType
this.location = this.$route.query.location; this.location = this.$route.query.location
zzSessionStorage.setItem("loginType", this.loginType); zzSessionStorage.setItem('loginType', this.loginType)
localStorage.setItem("location", this.location); localStorage.setItem('location', this.location)
if (process.env.VUE_APP_OSS_CONFIG_REGION === "oss-us-west-1") { if (process.env.VUE_APP_OSS_CONFIG_REGION === 'oss-us-west-1') {
this.$i18n.locale = "en"; this.$i18n.locale = 'en'
this.setLanguage("en"); this.setLanguage('en')
this.$updateDictionary(); this.$updateDictionary()
} else { } else {
if (this.location === "USA" || this.NODE_ENV === "usa") { if (this.location === 'USA' || this.NODE_ENV === 'usa') {
this.$i18n.locale = "en"; this.$i18n.locale = 'en'
this.setLanguage("en"); this.setLanguage('en')
this.$updateDictionary(); this.$updateDictionary()
} else { } else {
// this.$i18n.locale = 'zh' // this.$i18n.locale = 'zh'
// this.setLanguage('zh') // this.setLanguage('zh')
// this.$updateDictionary() // this.$updateDictionary()
} }
} }
this.$refs.browserTip.open(); this.$refs.browserTip.open()
}, },
methods: { methods: {
...mapMutations({ setLanguage: "lang/setLanguage" }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
openAbout() { openAbout() {
this.aboutVisible = true; this.aboutVisible = true
}, },
showPwd() { showPwd() {
if (this.passwordType === "password") { if (this.passwordType === 'password') {
this.passwordType = ""; this.passwordType = ''
} else { } else {
this.passwordType = "password"; this.passwordType = 'password'
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.password.focus(); this.$refs.password.focus()
}); })
}, },
handleLogin() { handleLogin() {
this.loginType = this.$route.query.loginType; this.loginType = this.$route.query.loginType
this.$refs.loginForm.validate((valid) => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
if (this.showCode) { if (this.showCode) {
this.isShow = true; this.isShow = true
} else { } else {
this.onSuccess(); this.onSuccess()
} }
} else { } else {
// console.log('error submit!!') // console.log('error submit!!')
return false; return false
} }
}); })
}, },
loginIn(Id) { loginIn(Id) {
this.loading = true; this.loading = true
this.showCode = false; this.showCode = false
if (Id) this.loginForm.UserId = Id; if (Id) this.loginForm.UserId = Id
this.$store this.$store
.dispatch("user/login", this.loginForm) .dispatch('user/login', this.loginForm)
.then((res) => { .then((res) => {
if (res.BasicInfo.IsFirstAdd) { if (res.BasicInfo.IsFirstAdd) {
// , // ,
this.$message.success(this.$t("login:message:login1")); this.$message.success(this.$t('login:message:login1'))
setTimeout(() => { setTimeout(() => {
this.$router.push({ this.$router.push({
path: `/recompose?userName=${this.loginForm.username}`, path: `/recompose?userName=${this.loginForm.username}`,
}); })
}, 500); }, 500)
return; return
} else if (res.BasicInfo.LoginState === 1) { } else if (res.BasicInfo.LoginState === 1) {
// //
this.$alert( this.$alert(
this.$t("login:message:login3"), this.$t('login:message:login3'),
this.$t("common:title:warning"), this.$t('common:title:warning'),
{ {
callback: (action) => { callback: (action) => {
this.$router.push({ this.$router.push({
path: `/recompose?userName=${this.loginForm.username}`, path: `/recompose?userName=${this.loginForm.username}`,
}); })
return; return
}, },
} }
); )
return; return
} else if (res.IsMFA) { } else if (res.IsMFA) {
this.$MFA({ this.$MFA({
UserId: res.BasicInfo.Id, UserId: res.BasicInfo.Id,
@ -363,55 +365,55 @@ export default {
username: this.loginForm.username, username: this.loginForm.username,
callBack: this.loginIn, callBack: this.loginIn,
cancelBack: () => { cancelBack: () => {
this.loading = false; this.loading = false
}, },
}); })
return; return
} else if (res.BasicInfo.LoginState === 2) { } else if (res.BasicInfo.LoginState === 2) {
// IP' // IP'
// this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning')) // this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning'))
this.$message.warning(this.$t("login:message:login4")); this.$message.warning(this.$t('login:message:login4'))
} }
this.$store.dispatch("permission/generateRoutes").then((res) => { this.$store.dispatch('permission/generateRoutes').then((res) => {
this.loading = false; this.loading = false
if (res && res.length > 0) { if (res && res.length > 0) {
this.$store.dispatch("global/getNoticeList"); this.$store.dispatch('global/getNoticeList')
this.$router.addRoutes(res); this.$router.addRoutes(res)
if (this.loginType === "DevOps") { if (this.loginType === 'DevOps') {
this.$router.replace({ path: res[0].path }); this.$router.replace({ path: res[0].path })
return; return
} }
if (this.hasPermi(["role:radmin"])) { if (this.hasPermi(['role:radmin'])) {
this.$router.replace({ path: res[0].path }); this.$router.replace({ path: res[0].path })
return; return
} }
if ( if (
this.hasPermi(["role:air", "role:rpm", "role:rcrc", "role:rir"]) this.hasPermi(['role:air', 'role:rpm', 'role:rcrc', 'role:rir'])
) { ) {
this.$router.replace({ path: "/trials/trials-list" }); this.$router.replace({ path: '/trials/trials-list' })
} else { } else {
this.$router.replace({ path: "/trials" }); this.$router.replace({ path: '/trials' })
} }
} else { } else {
// //
this.$message.warning(this.$t("login:message:login2")); this.$message.warning(this.$t('login:message:login2'))
} }
}); })
}) })
.catch(() => { .catch(() => {
this.showCode = true; this.showCode = true
this.loading = false; this.loading = false
}); })
}, },
onSuccess() { onSuccess() {
this.isShow = false; this.isShow = false
this.loginIn(); this.loginIn()
}, },
handleResetPwd() { handleResetPwd() {
this.$router.push({ name: "Resetpassword" }); this.$router.push({ name: 'Resetpassword' })
}, },
}, },
}; }
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -147,7 +147,7 @@
> >
{{ {{
$fd( $fd(
"InternationalizationType", 'InternationalizationType',
scope.row.InternationalizationType scope.row.InternationalizationType
) )
}} }}
@ -158,7 +158,7 @@
> >
{{ {{
$fd( $fd(
"InternationalizationType", 'InternationalizationType',
scope.row.InternationalizationType scope.row.InternationalizationType
) )
}} }}
@ -166,7 +166,7 @@
<el-tag v-else> <el-tag v-else>
{{ {{
$fd( $fd(
"InternationalizationType", 'InternationalizationType',
scope.row.InternationalizationType scope.row.InternationalizationType
) )
}} }}
@ -176,7 +176,7 @@
<el-table-column <el-table-column
label="功能模块/服务名" label="功能模块/服务名"
prop="Module" prop="Module"
min-width="120" min-width="140"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
@ -210,13 +210,13 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.State === 0" type="danger"> <el-tag v-if="scope.row.State === 0" type="danger">
{{ $fd("InternationalizationKeyState", scope.row.State) }} {{ $fd('InternationalizationKeyState', scope.row.State) }}
</el-tag> </el-tag>
<el-tag v-else-if="scope.row.State === 1" type="primary"> <el-tag v-else-if="scope.row.State === 1" type="primary">
{{ $fd("InternationalizationKeyState", scope.row.State) }} {{ $fd('InternationalizationKeyState', scope.row.State) }}
</el-tag> </el-tag>
<el-tag v-else> <el-tag v-else>
{{ $fd("InternationalizationKeyState", scope.row.State) }} {{ $fd('InternationalizationKeyState', scope.row.State) }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -241,7 +241,13 @@
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column
label="创建时间"
prop="CreateTime"
width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column <el-table-column
label="操作" label="操作"
fixed="right" fixed="right"
@ -289,11 +295,11 @@ import {
deleteInternationalization, deleteInternationalization,
getPublishVersionSelect, getPublishVersionSelect,
batchUpdateInternationalInfo, batchUpdateInternationalInfo,
} from "@/api/admin"; } from '@/api/admin'
import Pagination from "@/components/Pagination"; import Pagination from '@/components/Pagination'
import I18nForm from "./components/I18nForm.vue"; import I18nForm from './components/I18nForm.vue'
import BatchAddForm from "./components/BatchAddForm.vue"; import BatchAddForm from './components/BatchAddForm.vue'
import moment from "moment"; import moment from 'moment'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
Description: null, Description: null,
@ -304,13 +310,13 @@ const searchDataDefault = () => {
Module: null, Module: null,
PublishLogId: null, PublishLogId: null,
Asc: true, Asc: true,
SortField: "", SortField: '',
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
}; }
}; }
export default { export default {
name: "I18n", name: 'I18n',
components: { Pagination, I18nForm, BatchAddForm }, components: { Pagination, I18nForm, BatchAddForm },
data() { data() {
return { return {
@ -321,140 +327,140 @@ export default {
loading: false, loading: false,
PublishVersionList: [], PublishVersionList: [],
selectTableList: [], selectTableList: [],
}; }
}, },
mounted() { mounted() {
this.getList(); this.getList()
this.getPublishVersionSelect(); this.getPublishVersionSelect()
}, },
methods: { methods: {
// //
async getPublishVersionSelect() { async getPublishVersionSelect() {
try { try {
let res = await getPublishVersionSelect(); let res = await getPublishVersionSelect()
if (res.IsSuccess) { if (res.IsSuccess) {
this.PublishVersionList = res.Result; this.PublishVersionList = res.Result
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
getList() { getList() {
this.loading = true; this.loading = true
getInternationalizationList(this.searchData) getInternationalizationList(this.searchData)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
this.list = res.Result.CurrentPageData; this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount; this.total = res.Result.TotalCount
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
// //
handleBatchUpdate() { handleBatchUpdate() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["i18nForm"].openDialog( this.$refs['i18nForm'].openDialog(
"批量更新", '批量更新',
{}, {},
this.PublishVersionList, this.PublishVersionList,
"batch" 'batch'
); )
}); })
}, },
async batch(row) { async batch(row) {
let { PublishLogId, State } = row; let { PublishLogId, State } = row
let data = { let data = {
PublishLogId, PublishLogId,
State, State,
IdList: this.selectTableList.map((item) => item.Id), IdList: this.selectTableList.map((item) => item.Id),
}; }
try { try {
let res = await batchUpdateInternationalInfo(data); let res = await batchUpdateInternationalInfo(data)
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success(this.$t("common:message:updatedSuccessfully")); this.$message.success(this.$t('common:message:updatedSuccessfully'))
this.getList(); this.getList()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["i18nForm"].handleCancle(); this.$refs['i18nForm'].handleCancle()
}); })
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
handleAdd() { handleAdd() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["i18nForm"].openDialog( this.$refs['i18nForm'].openDialog(
"新增", '新增',
{}, {},
this.PublishVersionList, this.PublishVersionList,
"add" 'add'
); )
}); })
}, },
handleBatchAdd() { handleBatchAdd() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["batcnAddForm"].openDialog( this.$refs['batcnAddForm'].openDialog(
"批量新增", '批量新增',
{}, {},
this.PublishVersionList this.PublishVersionList
); )
}); })
}, },
handleEdit(row) { handleEdit(row) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["i18nForm"].openDialog( this.$refs['i18nForm'].openDialog(
"编辑", '编辑',
row, row,
this.PublishVersionList, this.PublishVersionList,
"update" 'update'
); )
}); })
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault(); this.searchData = searchDataDefault()
this.getList(); this.getList()
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm("是否确认删除?", { this.$confirm('是否确认删除?', {
type: "warning", type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}).then(() => { }).then(() => {
this.loading = true; this.loading = true
deleteInternationalization(row.Id) deleteInternationalization(row.Id)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.getList(); this.getList()
this.$message.success( this.$message.success(
this.$t("common:message:deletedSuccessfully") this.$t('common:message:deletedSuccessfully')
); )
} }
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}); })
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === "ascending") { if (column.order === 'ascending') {
this.searchData.Asc = true; this.searchData.Asc = true
} else { } else {
this.searchData.Asc = false; this.searchData.Asc = false
} }
this.searchData.SortField = column.prop; this.searchData.SortField = column.prop
this.searchData.PageIndex = 1; this.searchData.PageIndex = 1
this.getList(); this.getList()
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectTableList = val; this.selectTableList = val
}, },
}, },
}; }
</script> </script>
<style lang="scss"> <style lang="scss">
.log { .log {

View File

@ -9,10 +9,16 @@
label-width="120px" label-width="120px"
size="small" size="small"
> >
<el-form-item label="发布版本" prop="Version"> <el-form-item :label="$t('system:log:form:version')" prop="Version">
<el-input v-model="form.Version" /> <el-input v-model="form.Version" />
</el-form-item> </el-form-item>
<el-form-item label="更新功能" prop="UpdateContent"> <el-form-item :label="$t('system:log:form:versionUS')" prop="Version">
<el-input v-model="form.Version_US" />
</el-form-item>
<el-form-item
:label="$t('system:log:form:updateContent')"
prop="UpdateContent"
>
<el-input <el-input
v-model="form.UpdateContent" v-model="form.UpdateContent"
type="textarea" type="textarea"
@ -20,8 +26,8 @@
:autosize="{ minRows: 4, maxRows: 5 }" :autosize="{ minRows: 4, maxRows: 5 }"
/> />
</el-form-item> </el-form-item>
<el-form-item label="发布状态" prop="State"> <el-form-item :label="$t('system:log:form:State')" prop="State">
<el-select v-model="form.State" placeholder="请选择"> <el-select v-model="form.State" placeholder="">
<el-option <el-option
v-for="item in $d.PublishStatus" v-for="item in $d.PublishStatus"
:key="item.id" :key="item.id"
@ -31,15 +37,18 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发布日期"> <el-form-item :label="$t('system:log:form:PublishTime')">
<el-date-picker <el-date-picker
v-model="form.PublishTime" v-model="form.PublishTime"
type="date" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否当前版本" prop="IsCurrentVersion"> <el-form-item
<el-select v-model="form.IsCurrentVersion" placeholder="请选择"> :label="$t('system:log:form:IsCurrentVersion')"
prop="IsCurrentVersion"
>
<el-select v-model="form.IsCurrentVersion" placeholder="">
<el-option <el-option
v-for="item in $d.YesOrNo" v-for="item in $d.YesOrNo"
:key="item.id" :key="item.id"
@ -52,30 +61,31 @@
</el-form> </el-form>
</template> </template>
<template slot="dialog-footer"> <template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle" <el-button size="small" type="primary" @click="handleCancle">
>取消</el-button {{ $t('common:button:cancel') }}
> </el-button>
<el-button size="small" type="primary" @click="handleSave" <el-button size="small" type="primary" @click="handleSave">
>保存</el-button {{ $t('common:button:save') }}
> </el-button>
</template> </template>
</base-model> </base-model>
</template> </template>
<script> <script>
import { addOrUpdatePublishLog } from "@/api/admin"; import { addOrUpdatePublishLog } from '@/api/admin'
import BaseModel from "@/components/BaseModel"; import BaseModel from '@/components/BaseModel'
const formDataDefault = () => { const formDataDefault = () => {
return { return {
Id: null, Id: null,
Version: null, Version: null,
Version_US: null,
PublishTime: null, PublishTime: null,
UpdateContent: null, UpdateContent: null,
State: null, State: null,
IsCurrentVersion: null, IsCurrentVersion: null,
}; }
}; }
export default { export default {
name: "LogForm", name: 'LogForm',
components: { BaseModel }, components: { BaseModel },
data() { data() {
return { return {
@ -83,69 +93,87 @@ export default {
form: formDataDefault(), form: formDataDefault(),
rules: { rules: {
Version: [ Version: [
{ required: true, message: "请注明", trigger: "blur" }, {
{ max: 50, message: `${this.$t("common:ruleMessage:maxLength")} 50` }, required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` },
], ],
// PublishTime: [ // PublishTime: [
// { required: true, message: '', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
// ], // ],
IsCurrentVersion: [ IsCurrentVersion: [
{ required: true, message: "请选择", trigger: "blur" }, {
required: true,
message: this.$t('common:ruleMessage:select'),
trigger: 'blur',
},
],
State: [
{
required: true,
message: this.$t('common:ruleMessage:select'),
trigger: 'blur',
},
], ],
State: [{ required: true, message: "请选择", trigger: "blur" }],
UpdateContent: [ UpdateContent: [
{ required: true, message: "请注明", trigger: "blur" }, {
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
{ {
max: 1000, max: 1000,
message: `${this.$t("common:ruleMessage:maxLength")} 500`, message: `${this.$t('common:ruleMessage:maxLength')} 500`,
}, },
], ],
}, },
model_cfg: { model_cfg: {
visible: false, visible: false,
showClose: true, showClose: true,
width: "500px", width: '500px',
title: "", title: '',
appendToBody: true, appendToBody: true,
}, },
}; }
}, },
mounted() {}, mounted() {},
methods: { methods: {
openDialog(title, data) { openDialog(title, data) {
this.model_cfg.visible = true; this.model_cfg.visible = true
this.model_cfg.title = title; this.model_cfg.title = title
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
for (const k in this.form) { for (const k in this.form) {
if (data.hasOwnProperty(k)) { if (data.hasOwnProperty(k)) {
this.form[k] = data[k]; this.form[k] = data[k]
} }
} }
} else { } else {
this.form = formDataDefault(); this.form = formDataDefault()
} }
}, },
handleSave() { handleSave() {
this.$refs.LogForm.validate((valid) => { this.$refs.LogForm.validate((valid) => {
if (!valid) return; if (!valid) return
this.loading = true; this.loading = true
addOrUpdatePublishLog(this.form) addOrUpdatePublishLog(this.form)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
this.$message.success(this.$t("common:message:savedSuccessfully")); this.$message.success(this.$t('common:message:savedSuccessfully'))
this.model_cfg.visible = false; this.model_cfg.visible = false
this.$emit("getList"); this.$emit('getList')
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}); })
}, },
handleCancle() { handleCancle() {
this.model_cfg.visible = false; this.model_cfg.visible = false
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-select, ::v-deep .el-select,

View File

@ -2,9 +2,12 @@
<div class="log"> <div class="log">
<div ref="leftContainer" class="left"> <div ref="leftContainer" class="left">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="发布版本" prop="Version"> <el-form-item :label="$t('system:log:table:version')" prop="Version">
<el-input v-model="searchData.Version" size="small" clearable /> <el-input v-model="searchData.Version" size="small" clearable />
</el-form-item> </el-form-item>
<el-form-item :label="$t('system:log:table:versionUS')" prop="Version">
<el-input v-model="searchData.Version_US" size="small" clearable />
</el-form-item>
<el-form-item label="更新功能" prop="UpdateContent"> <el-form-item label="更新功能" prop="UpdateContent">
<el-input v-model="searchData.UpdateContent" size="small" clearable /> <el-input v-model="searchData.UpdateContent" size="small" clearable />
</el-form-item> </el-form-item>
@ -38,30 +41,37 @@
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column <el-table-column
label="发布版本" :label="$t('system:log:table:version')"
prop="Version" prop="Version"
min-width="90" min-width="90"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column <el-table-column
label="更新功能" :label="$t('system:log:table:versionUS')"
prop="Version_US"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:log:table:UpdateContent')"
prop="UpdateContent" prop="UpdateContent"
min-width="150" min-width="150"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
label="发布状态" :label="$t('system:log:table:State')"
prop="State" prop="State"
min-width="150" min-width="150"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ $fd("PublishStatus", scope.row.State) }}</span> <span>{{ $fd('PublishStatus', scope.row.State) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="发布日期" :label="$t('system:log:table:PublishTime')"
prop="PublishTime" prop="PublishTime"
min-width="90" min-width="90"
show-overflow-tooltip show-overflow-tooltip
@ -70,23 +80,23 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
scope.row.PublishTime scope.row.PublishTime
? moment(scope.row.PublishTime).format("YYYY-MM-DD") ? moment(scope.row.PublishTime).format('YYYY-MM-DD')
: "" : ''
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="是否当前版本" :label="$t('system:log:table:IsCurrentVersion')"
prop="IsCurrentVersion" prop="IsCurrentVersion"
min-width="150" min-width="150"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ $fd("YesOrNo", scope.row.IsCurrentVersion) }}</span> <span>{{ $fd('YesOrNo', scope.row.IsCurrentVersion) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" :label="$t('common:action:action')"
fixed="right" fixed="right"
prop="" prop=""
min-width="200" min-width="200"
@ -99,7 +109,7 @@
icon="el-icon-edit-outline" icon="el-icon-edit-outline"
@click="handleEdit(scope.row)" @click="handleEdit(scope.row)"
> >
编辑 {{ $t('common:button:edit') }}
</el-button> </el-button>
<el-button <el-button
size="mini" size="mini"
@ -107,7 +117,7 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
> >
删除 {{ $t('common:button:delete') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -125,20 +135,21 @@
</div> </div>
</template> </template>
<script> <script>
import { getPublishLogList, deletePublishLog } from "@/api/admin"; import { getPublishLogList, deletePublishLog } from '@/api/admin'
import Pagination from "@/components/Pagination"; import Pagination from '@/components/Pagination'
import LogForm from "./components/LogForm.vue"; import LogForm from './components/LogForm.vue'
import moment from "moment"; import moment from 'moment'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
Version: null, Version: null,
Version_US: null,
UpdateContent: null, UpdateContent: null,
Asc: false, Asc: false,
SortField: "PublishTime", SortField: 'PublishTime',
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
}; }
}; }
export default { export default {
components: { Pagination, LogForm }, components: { Pagination, LogForm },
data() { data() {
@ -148,74 +159,74 @@ export default {
list: [], list: [],
total: 0, total: 0,
loading: false, loading: false,
}; }
}, },
mounted() { mounted() {
this.getList(); this.getList()
}, },
methods: { methods: {
getList() { getList() {
this.loading = true; this.loading = true
getPublishLogList(this.searchData) getPublishLogList(this.searchData)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
this.list = res.Result.CurrentPageData; this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount; this.total = res.Result.TotalCount
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
handleAdd() { handleAdd() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["LogForm"].openDialog("新增", {}); this.$refs['LogForm'].openDialog('新增', {})
}); })
}, },
handleEdit(row) { handleEdit(row) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["LogForm"].openDialog("编辑", row); this.$refs['LogForm'].openDialog('编辑', row)
}); })
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault(); this.searchData = searchDataDefault()
this.getList(); this.getList()
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm("是否确认删除?", { this.$confirm('是否确认删除?', {
type: "warning", type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}).then(() => { }).then(() => {
this.loading = true; this.loading = true
deletePublishLog(row.Id) deletePublishLog(row.Id)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.getList(); this.getList()
this.$message.success( this.$message.success(
this.$t("common:message:deletedSuccessfully") this.$t('common:message:deletedSuccessfully')
); )
} }
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}); })
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === "ascending") { if (column.order === 'ascending') {
this.searchData.Asc = true; this.searchData.Asc = true
} else { } else {
this.searchData.Asc = false; this.searchData.Asc = false
} }
this.searchData.SortField = column.prop; this.searchData.SortField = column.prop
this.searchData.PageIndex = 1; this.searchData.PageIndex = 1
this.getList(); this.getList()
}, },
}, },
}; }
</script> </script>
<style lang="scss"> <style lang="scss">
.log { .log {

View File

@ -2,7 +2,7 @@
<div class="trial-myinfo-right-box"> <div class="trial-myinfo-right-box">
<div class="trial-myinfo-head"> <div class="trial-myinfo-head">
<!-- 修改密码 --> <!-- 修改密码 -->
{{ $t("trials:trials-myinfo:title:updatePaasord") }} {{ $t('trials:trials-myinfo:title:updatePaasord') }}
</div> </div>
<el-form <el-form
ref="passwordForm" ref="passwordForm"
@ -52,17 +52,17 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button type="primary" size="small" class="trial-info-btn" @click="save"> <el-button type="primary" size="small" class="trial-info-btn" @click="save">
{{ $t("trials:trials-myinfo:button:save") }} {{ $t('trials:trials-myinfo:button:save') }}
</el-button> </el-button>
</div> </div>
</template> </template>
<script> <script>
import md5 from "js-md5"; import md5 from 'js-md5'
import { mapGetters, mapMutations } from "vuex"; import { mapGetters, mapMutations } from 'vuex'
import { modifyPassword } from "@/api/admin.js"; import { modifyPassword } from '@/api/admin.js'
import { removeToken } from "@/utils/auth"; import { removeToken } from '@/utils/auth'
export default { export default {
name: "password", name: 'password',
data() { data() {
return { return {
password: {}, password: {},
@ -70,91 +70,96 @@ export default {
OldPassWord: [ OldPassWord: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
], ],
NewPassWord: [ NewPassWord: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
required: true, required: true,
trigger: "blur", trigger: 'blur',
validator: this.$validatePassword, validator: this.$validatePassword,
}, },
], ],
ConfirmPassWord: [ ConfirmPassWord: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
required: true, required: true,
trigger: "blur", trigger: 'blur',
validator: this.$validatePassword, validator: this.$validatePassword,
}, },
], ],
}, },
}; }
}, },
computed: { computed: {
...mapGetters(["userId"]), ...mapGetters(['userId']),
}, },
methods: { methods: {
...mapMutations({ setLanguage: "lang/setLanguage" }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
async save() { async save() {
try { try {
let validate = await this.$refs.passwordForm.validate(); let validate = await this.$refs.passwordForm.validate()
if (!validate) return; if (!validate) return
if (this.password.NewPassWord !== this.password.ConfirmPassWord) { if (this.password.NewPassWord !== this.password.ConfirmPassWord) {
this.$alert(this.$t("passwordReset:formRule:passwordsDiffer")); this.$alert(this.$t('passwordReset:formRule:passwordsDiffer'))
return; return
} }
let confirm = await this.$confirm( let confirm = await this.$confirm(
this.$t("trials:trials-myInfo:confirmMessage:updatePassWord"), this.$t('trials:trials-myInfo:confirmMessage:updatePassWord'),
{ {
type: "warning", type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
confirmButtonText: this.$t("common:button:confirm"), confirmButtonText: this.$t('common:button:confirm'),
cancelButtonText: this.$t("common:button:cancel"), cancelButtonText: this.$t('common:button:cancel'),
} }
); )
if (confirm !== "confirm") return; if (confirm !== 'confirm') return
const param = { const param = {
UserId: this.userId, UserId: this.userId,
NewPassWord: md5(this.password.NewPassWord), NewPassWord: md5(this.password.NewPassWord),
OldPassWord: md5(this.password.OldPassWord), OldPassWord: md5(this.password.OldPassWord),
}; }
let res = await modifyPassword(param); let res = await modifyPassword(param)
if (res.IsSuccess) { if (res.IsSuccess) {
// , // ,
this.$message.success( this.$message.success(
this.$t("trials:trials-myinfo:message:modifyPWSuccessfully") this.$t('trials:trials-myinfo:message:modifyPWSuccessfully')
); )
removeToken(); removeToken()
this.logout(); this.logout()
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
async logout() { async logout() {
/* eslint-disable */ /* eslint-disable */
var loginType = zzSessionStorage.getItem("loginType"); var loginType = zzSessionStorage.getItem('loginType')
await this.$store.dispatch("user/logout"); await this.$store.dispatch('user/logout')
if (loginType) { if (loginType) {
this.$router.push(`/login?loginType=${loginType}`); this.$router.push(`/login?loginType=${loginType}`)
} else { } else {
this.$router.push(`/login`); this.$router.push(`/login`)
} }
this.$i18n.locale = "zh"; this.$i18n.locale = 'zh'
this.setLanguage("zh"); this.setLanguage('zh')
this.$updateDictionary(); this.$updateDictionary()
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped>
.el-form-item {
margin-bottom: 30px;
}
</style>

View File

@ -1,19 +1,22 @@
<template> <template>
<div v-loading="loading" class="sign-form-wrapper"> <div v-loading="loading" class="sign-form-wrapper">
<div class="sign-form-body"> <div class="sign-form-body">
<h4 v-if="signText" style="color:red">*{{ signText }}</h4> <h4 v-if="signText" style="color: red">*{{ signText }}</h4>
<el-form <el-form
ref="signForm" ref="signForm"
:model="signForm" :model="signForm"
size="small" size="small"
label-width="100px" label-width="100px"
> >
<el-form-item <el-form-item
:label="$t('common:form:sign:userName')" :label="$t('common:form:sign:userName')"
prop="UserName" prop="UserName"
:rules="[ :rules="[
{ required: true, message: $t('common:ruleMessage:specify'), trigger: 'blur' } {
required: true,
message: $t('common:ruleMessage:specify'),
trigger: 'blur',
},
]" ]"
> >
<el-input v-model="signForm.UserName" /> <el-input v-model="signForm.UserName" />
@ -22,18 +25,36 @@
:label="$t('common:form:sign:password')" :label="$t('common:form:sign:password')"
prop="Password" prop="Password"
:rules="[ :rules="[
{ required: true, message: $t('common:ruleMessage:specify'), trigger: 'blur' } {
required: true,
message: $t('common:ruleMessage:specify'),
trigger: 'blur',
},
]" ]"
> >
<el-input v-model="signForm.Password" show-password auto-complete="new-password" /> <el-input
v-model="signForm.Password"
show-password
auto-complete="new-password"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div slot="footer" class="dialog-footer sign-form-footer"> <div slot="footer" class="dialog-footer sign-form-footer">
<el-button :disabled="btnLoading" size="small" type="primary" @click="handleclose"> <el-button
:disabled="btnLoading"
size="small"
type="primary"
@click="handleclose"
>
{{ $t('common:button:cancel') }} {{ $t('common:button:cancel') }}
</el-button> </el-button>
<el-button :loading="btnLoading" size="small" type="primary" @click="userConfirm"> <el-button
:loading="btnLoading"
size="small"
type="primary"
@click="userConfirm"
>
{{ $t('common:button:sign') }} {{ $t('common:button:sign') }}
</el-button> </el-button>
</div> </div>
@ -49,35 +70,36 @@ export default {
props: { props: {
fileName: { fileName: {
type: String, type: String,
required: true required: true,
}, },
isSystemDoc: { isSystemDoc: {
type: Boolean, type: Boolean,
required: true required: true,
}, },
documentId: { documentId: {
type: String, type: String,
required: true required: true,
}, },
trialId: { trialId: {
type: String, type: String,
default: '' default: '',
} },
}, },
data() { data() {
return { return {
signForm: { signForm: {
UserName: '', UserName: '',
Password: '' Password: '',
}, },
signText: '', signText: '',
btnLoading: false, btnLoading: false,
loading: false loading: false,
} }
}, },
mounted() { mounted() {
this.loading = true this.loading = true
getSystemBasicData(attachmentSignCode).then(res => { getSystemBasicData(attachmentSignCode)
.then((res) => {
var text var text
if (this.$i18n.locale === 'zh') { if (this.$i18n.locale === 'zh') {
text = res.Result.ValueCN text = res.Result.ValueCN
@ -86,11 +108,16 @@ export default {
} }
this.signText = text.replace('xxx', this.fileName) this.signText = text.replace('xxx', this.fileName)
this.loading = false this.loading = false
}).catch(() => { this.loading = false }) })
.catch(() => {
this.loading = false
})
}, },
methods: { methods: {
userConfirm() { userConfirm() {
const currentUser = zzSessionStorage.getItem('userName').toLocaleLowerCase() const currentUser = zzSessionStorage
.getItem('userName')
.toLocaleLowerCase()
this.$refs.signForm.validate((valid) => { this.$refs.signForm.validate((valid) => {
console.log(valid) console.log(valid)
if (!valid) return if (!valid) return
@ -104,42 +131,50 @@ export default {
data: { data: {
// trialId: this.trialId, // trialId: this.trialId,
documentId: this.documentId, documentId: this.documentId,
isSystemDoc: this.isSystemDoc isSystemDoc: this.isSystemDoc,
}, },
signInfo: { signInfo: {
UserName: this.signForm.UserName, UserName: this.signForm.UserName,
PassWord: md5(this.signForm.Password), PassWord: md5(this.signForm.Password),
// TrialId: this.trialId, // c: this.trialId,
SignCode: '', SignCode: '',
SignText: this.signText, SignText: this.signText,
SignCodeId: '', SignCodeId: '',
SubjectVisitId: '' SubjectVisitId: '',
},
} }
if (!this.isSystemDoc) {
params.data.TrialId = this.trialId
params.signInfo.TrialId = this.trialId
} }
userConfirm(params).then(res => { userConfirm(params)
.then((res) => {
if (res.IsSuccess) { if (res.IsSuccess) {
// //
this.$message.success(this.$t('common:message:signSuccessfully')) this.$message.success(this.$t('common:message:signSuccessfully'))
this.$emit('closeDialog', true) this.$emit('closeDialog', true)
} }
}).catch(() => { this.btnLoading = false }) })
.catch(() => {
this.btnLoading = false
})
}) })
}, },
handleclose() { handleclose() {
this.$emit('closeDialog', false) this.$emit('closeDialog', false)
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sign-form-wrapper{ .sign-form-wrapper {
.sign-form-body{ .sign-form-body {
padding:10px; padding: 10px;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
max-height:650px; max-height: 650px;
overflow-y: auto; overflow-y: auto;
} }
.sign-form-footer{ .sign-form-footer {
margin-top: 10px; margin-top: 10px;
text-align: right; text-align: right;
} }