Commit 44fcec04 authored by miaojiale's avatar miaojiale

Merge branch 'dev' into dev_Miaojiale

parents 65b211f6 68255f88
......@@ -341,7 +341,7 @@ export function getQualityDetail(patientId) {
// 协作组参数配置新增/修改
export function setParamConfig(data) {
return request({
url: `/disease-data/sys/paramConfig/addOrUpdate`,
url: `/disease-data/param/config`,
method: "post",
data,
})
......@@ -350,7 +350,7 @@ export function setParamConfig(data) {
// 协作组参数配置列表
export function getParamConfigList(params) {
return request({
url: `/disease-data/sys/paramConfig/list`,
url: `/disease-data/param/config/page`,
method: "get",
params,
})
......@@ -359,7 +359,7 @@ export function getParamConfigList(params) {
// 删除配置
export function delParamConfig(id) {
return request({
url: `/disease-data/sys/paramConfig/${id}`,
url: `/disease-data/param/config?id=${id}`,
method: "delete",
})
}
......@@ -12,13 +12,6 @@ export function getFieldPage(params = {}) {
params,
})
}
export function getFieldList(params = {}) {
return request({
url: "/cloud-upms/field/dict/list/table",
method: "get",
params,
})
}
export function delField(id) {
return request({
......@@ -92,7 +85,7 @@ export function copyForm(data = {}) {
// 获取
export function getFormDetail(id) {
return request({
url: `/cloud-upms//org/form/${id}`,
url: `/cloud-upms/org/form/${id}`,
method: "get",
})
}
......
......@@ -44,6 +44,8 @@ module.exports = {
tokenTableName: "agcs",
//token存储位置localStorage sessionStorage cookie
storage: "localStorage",
// 前缀名
storagePrefixName: "agcs",
//是否显示logo
logo: true,
//是否国定头部 固定fixed 不固定noFixed
......
......@@ -58,14 +58,14 @@ export default {
},
},
watch: {
// $route: {
// handler(route) {
// if ("mobile" === this.device) {
// this.$store.dispatch("settings/foldSideBar")
// }
// },
// immediate: true,
// },
$route: {
handler(route) {
if ("mobile" === this.device) {
this.$store.dispatch("settings/foldSideBar")
}
},
immediate: true,
},
},
created() {
//重载所有路由
......
......@@ -3,10 +3,10 @@
* @description 所有全局配置的状态管理,如无必要请勿修改
*/
import defaultSettings from "@/config/settings";
import defaultSettings from "@/config/settings"
const { tagsBar, logo, layout, header, themeBar, skeleton } = defaultSettings;
const theme = JSON.parse(localStorage.getItem("BYUI-VUE-THEME")) || "";
const { tagsBar, logo, layout, header, themeBar, skeleton } = defaultSettings
const theme = JSON.parse(localStorage.getItem("BYUI-VUE-THEME")) || ""
const state = {
tagsBar: theme.tagsBar || tagsBar,
logo,
......@@ -16,7 +16,7 @@ const state = {
skeleton,
device: "desktop",
themeBar,
};
}
const getters = {
collapse: (state) => state.collapse,
device: (state) => state.device,
......@@ -26,51 +26,51 @@ const getters = {
tagsBar: (state) => state.tagsBar,
themeBar: (state) => state.themeBar,
skeleton: (state) => state.skeleton,
};
}
const mutations = {
changeLayout: (state, layout) => {
if (layout) state.layout = layout;
if (layout) state.layout = layout
},
changeHeader: (state, header) => {
if (header) state.header = header;
if (header) state.header = header
},
changeTagsBar: (state, tagsBar) => {
if (tagsBar) state.tagsBar = tagsBar;
if (tagsBar) state.tagsBar = tagsBar
},
changeCollapse: (state) => {
state.collapse = !state.collapse;
state.collapse = !state.collapse
},
foldSideBar: (state) => {
state.collapse = true;
// state.collapse = true;
},
openSideBar: (state) => {
state.collapse = false;
state.collapse = false
},
toggleDevice: (state, device) => {
state.device = device;
state.device = device
},
};
}
const actions = {
changeLayout({ commit }, layout) {
commit("changeLayout", layout);
commit("changeLayout", layout)
},
changeHeader({ commit }, header) {
commit("changeHeader", header);
commit("changeHeader", header)
},
changeTagsBar({ commit }, tagsBar) {
commit("changeTagsBar", tagsBar);
commit("changeTagsBar", tagsBar)
},
changeCollapse({ commit }) {
commit("changeCollapse");
commit("changeCollapse")
},
foldSideBar({ commit }) {
commit("foldSideBar");
commit("foldSideBar")
},
openSideBar({ commit }) {
commit("openSideBar");
commit("openSideBar")
},
toggleDevice({ commit }, device) {
commit("toggleDevice", device);
commit("toggleDevice", device)
},
};
export default { state, getters, mutations, actions };
}
export default { state, getters, mutations, actions }
const ls = window.localStorage
const ss = window.sessionStorage
import { storagePrefixName } from "@/config/settings"
export const Local = {
get(key, def) {
let value = null
try {
value = JSON.parse(ls.getItem(key))
value = JSON.parse(ls.getItem(storagePrefixName + "-" + key))
} catch (e) {
console.log(" ")
}
......@@ -19,14 +20,14 @@ export const Local = {
ls.setItem(i, JSON.stringify(setting[i]))
}
} else {
ls.setItem(key, JSON.stringify(val))
ls.setItem(storagePrefixName + "-" + key, JSON.stringify(val))
}
} catch (e) {
console.log("'")
}
},
remove(key) {
ls.removeItem(key)
ls.removeItem(storagePrefixName + "-" + key)
},
clear() {
ls.clear()
......@@ -36,7 +37,7 @@ export const Local = {
export const Session = {
get(key) {
try {
return JSON.parse(ss.getItem(key))
return JSON.parse(ss.getItem(storagePrefixName + "-" + key))
} catch (e) {
return null
}
......@@ -48,11 +49,11 @@ export const Session = {
ss.setItem(i, JSON.stringify(setting[i]))
}
} else {
ss.setItem(key, JSON.stringify(val))
ss.setItem(storagePrefixName + "-" + key, JSON.stringify(val))
}
},
remove(key) {
ss.removeItem(key)
ss.removeItem(storagePrefixName + "-" + key)
},
clear() {
ss.clear()
......
<template>
<el-row class="page-container dict">
<el-container class="page-main" :gutter="20">
<el-aside width="250px" class="left-content">
<el-col :span="24" class="left-search">
<el-input
v-model.trim="searchVal"
clearable
:placeholder="placeholder"
>
</el-input>
</el-col>
<el-col class="dict-list" ref="dict">
<el-col
v-for="(item, index) in tableList"
:key="item.id"
class="dict-item"
>
<span
@click="handClick(index, item)"
:class="{ active: index == isActive }"
style="cursor: pointer"
>
<strong>
{{ item.label }}
</strong>
- {{ item.value }}
</span>
</el-col>
</el-col>
</el-aside>
<el-main>
<div style="text-align: right">
<el-input
v-model.trim="keyWord"
clearable
placeholder="关键字"
style="width: 220px; margin-right: 5px"
>
</el-input>
<el-button type="primary" @click="handleSave" :loading="loading"
>保存配置</el-button
>
</div>
<el-table-self
style="margin-top: 10px"
ref="table"
:table-data="fields"
:columns="columns"
:list-loading="listLoading"
/>
</el-main>
</el-container>
</el-row>
</template>
<script>
import { setExportFields, getTableFields, getExportConfigFields } from "@/api/coop-group"
export default {
name: "ExportFieldConfig",
props: {
groupId: String,
},
data() {
return {
isActive: -1,
placeholder: "搜索数据库",
name: "",
searchVal: "",
keyWord: "",
typeId: "",
fieldList: [],
configuredFieldList: [],
tableCode: "",
loading: false,
listLoading: false,
columns: [
{
label: "字段名称",
minWidth: 120,
value: "fieldName",
},
{
label: "字段code",
minWidth: 200,
value: "fieldCode",
},
{
operType: "checkbox",
label: "是否导出",
minWidth: 100,
value: "isExport",
tabType: "selection",
},
{
operType: "checkbox",
label: "是否脱敏",
minWidth: 100,
value: "isDesensitized",
tabType: "selection",
},
{
operType: "input",
type: "number",
label: "排序号",
width: 120,
inputWidth: 108,
value: "sort",
showInput: true,
},
],
}
},
watch: {
groupId(groupId) {
if (groupId) {
this.getTableFields()
this.getFields()
}
},
},
computed: {
// 数据库表过滤
tableList() {
const dictTable = this.dictMap["table"] || []
const list = dictTable.filter(
(_) =>
!this.searchVal ||
_.label.includes(this.searchVal) ||
_.value.includes(this.searchVal)
)
this.isActive = this.getListIdx(list, this.typeId)
return list
},
// 全部字段和已配置字段
fieldValue() {
return this.fieldList.map((field) => {
let configuredField = this.configuredFieldList.find(
(_) => _.fieldCode === field.fieldCode
)
return {
...field,
sort: (configuredField && configuredField.sort) || undefined,
isExport: Boolean(configuredField),
isDesensitized: Boolean(
configuredField && configuredField.isDesensitized
),
}
})
},
fields() {
return this.fieldValue.filter(
(_) =>
!this.keyWord ||
_.fieldName.includes(this.keyWord) ||
_.fieldCode.includes(this.keyWord)
)
},
},
methods: {
// 点击左侧列表
handClick(index, { type, label, id, value }) {
if (!this.groupId) {
this.$message.warning("请先选择协作组")
return
}
this.name = label
this.tableCode = value
this.isActive = index
this.typeId = id
this.fieldList = []
this.getTableFields()
this.getFields()
},
// 全部字段
getTableFields() {
getTableFields({ tableCode: this.tableCode, groupId: this.groupId }).then(
(res) => {
this.fieldList = res.data
}
)
},
// 已配置字段
getFields() {
getExportConfigFields({ tableCode: this.tableCode, groupId: this.groupId })
.then((res) => {
this.configuredFieldList = res.data
})
.catch((e) => {
this.configuredFieldList = []
})
},
handleSave() {
if (!this.groupId) {
this.$message.warning("请先选择协作组")
return
}
if (!this.fieldValue.length) {
this.$message.warning("没有可保存的数据")
return
}
const list = this.fieldValue
.filter((_) => _.isExport)
.map((_) => {
delete _.isExport
return {
..._,
isDesensitized: _.isDesensitized ? 1 : 0,
}
})
const table = {
tableCode: this.tableCode,
tableName: this.name,
groupId: this.groupId,
}
this.loading = true
setExportFields(table, list)
.then((res) => {
this.$message.success("配置成功")
})
.finally(() => {
this.loading = false
})
},
getListIdx(list = [], id) {
let listIdx = -1
for (var i = 0; i < list.length; i++) {
if (list[i].id === id) {
listIdx = i
break
}
}
return listIdx
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-main {
padding: 0px 0 0 10px;
}
</style>
......@@ -50,10 +50,13 @@ export default {
// 查询列表
searchList: [
{
label: "参数代码",
type: "input",
prop: "code",
placeholder: "请输入参数代码",
label: "类型",
type: "select",
prop: "type",
placeholder: "请输入类型",
optsFormatter: () => {
return this.dictMap && this.dictMap["sys_param_type"]
},
},
{
label: "参数值",
......@@ -61,12 +64,7 @@ export default {
prop: "value",
placeholder: "请输入参数值",
},
{
label: "类型",
type: "input",
prop: "type",
placeholder: "请输入类型",
},
{
type: "button",
value: "查询",
......@@ -81,10 +79,29 @@ export default {
},
],
columns: [
{
label: "类型",
minWidth: 100,
value: "type",
formatter: (row) => {
return this.$handle.formatDicList(
this.dictMap["sys_param_type"],
row.type
)
},
},
{
label: "参数代码",
minWidth: 120,
value: "code",
formatter: (row) => {
const item =
this.dictMap["sys_param_type"].find(
(_) => _.value === row.type
) || {}
const list = item.children || []
return this.$handle.formatDicList(list, row.code)
},
},
{
......@@ -92,21 +109,7 @@ export default {
minWidth: 120,
value: "value",
},
{
label: "类型",
minWidth: 100,
value: "type",
},
{
label: "目标值名称",
minWidth: 100,
value: "targetName",
},
{
label: "目标值",
minWidth: 100,
value: "targetValue",
},
{
label: "创建时间",
minWidth: 180,
......@@ -151,12 +154,24 @@ export default {
cacheForm: {},
formData: [
{
type: "input",
type: "select",
label: "类型",
placeholder: "请选择类型",
prop: "type",
rules: [{ required: true, message: "请选择类型" }],
func: this.typeChange,
optsFormatter: () => {
return this.dictMap && this.dictMap["sys_param_type"]
},
},
{
type: "select",
label: "参数代码",
placeholder: "请输入参数代码",
prop: "code",
disabled: false,
rules: [{ required: true, message: "参数代码" }],
opts: [],
},
{
type: "input",
......@@ -168,22 +183,9 @@ export default {
{
type: "input",
label: "类型",
placeholder: "请选择类型",
prop: "type",
rules: [{ required: true, message: "请选择类型" }],
},
{
type: "input",
label: "目标值名称",
placeholder: "请选择目标值名称",
prop: "targetName",
},
{
type: "input",
label: "目标值",
placeholder: "请选择目标值",
prop: "targetValue",
label: "默认参数值",
placeholder: "请选择默认参数值",
prop: "defaultValue",
},
],
formEdit: {},
......@@ -200,6 +202,11 @@ export default {
},
methods: {
typeChange(val) {
this.$refs.dialog.initFields({ code: "" })
const opt = this.dictMap["sys_param_type"].find((_) => _.value === val)
this.formData[1].opts = (opt && opt.children) || []
},
handleAdd(row) {
this.formEdit = Object.assign({}, row)
if (!this.groupId) {
......@@ -212,13 +219,17 @@ export default {
const data = Object.assign(form, {
groupId: this.groupId,
})
setParamConfig(data).then((res) => {
setParamConfig(data)
.then((res) => {
if (res.code === 1) {
this.$message.success("添加成功")
this.handleSearch()
this.$refs.dialog.close()
}
})
.finally(() => {
this.$refs.dialog.loading = false
})
},
handleDel(row) {
this.$confirm(`是否删除【${row.code || ""}】?`, "提示", {
......
This diff is collapsed.
......@@ -38,15 +38,6 @@
<el-tab-pane label="表单管理" name="second">
<GroupForm :group-id="groupId"></GroupForm>
</el-tab-pane>
<el-tab-pane label="导出字段配置" name="third">
<ExportFieldConfig :group-id="groupId"></ExportFieldConfig>
</el-tab-pane>
<el-tab-pane label="质控配置" name="fourth">
<QualityControlConfig
:group-id="groupId"
:group-name="groupName"
></QualityControlConfig>
</el-tab-pane>
<el-tab-pane label="参数配置" name="fifth">
<ParameterConfig :group-id="groupId"></ParameterConfig>
</el-tab-pane>
......@@ -65,18 +56,14 @@
</template>
<script>
import ExportFieldConfig from "./ExportFieldConfig.vue"
import GroupUser from "./GroupUser"
import GroupForm from "./GroupForm"
import QualityControlConfig from "./QualityControlConfig.vue"
import ParameterConfig from "./ParameterConfig.vue"
import { translateListToTree } from "@/utils/handleRoutes"
import { getCoopGroupList, addCoopGroup } from "@/api/coop-group.js"
export default {
name: "CollaGroup",
components: {
ExportFieldConfig,
QualityControlConfig,
GroupUser,
GroupForm,
ParameterConfig,
......
......@@ -109,7 +109,7 @@
<script>
import WidgetConfig from "packages/WidgetConfig.vue"
import { getFieldList, addField, delField } from "@/api/field.js"
import { getFieldListByCode, addField, delField } from "@/api/field.js"
// 新增所需字段
const fields = [
"id",
......@@ -264,9 +264,9 @@ export default {
this.widgetVisible = true
},
handleConfirm(form) {
if (!/^[a-z]+([a-z0-9]*([_]?[a-z]+)*)*$/.test(form.prop)) {
if (!/^[a-zA-Z]+([a-zA-Z0-9]*([_-]?[a-zA-Z0-9]+)*)*$/.test(form.prop)) {
this.$message.error(
"只能包含字母、数字、下划线。必须以字母开始,下划线不可连续重复,下划线后不可紧跟着数字,不能以数字、下划线结束"
"只能包含大小字母、数字、下划线。必须以字母开始,下划线不可连续重复,下划线后不可紧跟着数字,不能以数字、下划线结束"
)
return
}
......@@ -325,6 +325,7 @@ export default {
this.handleSearch(form)
},
handleSearch(form) {
if (!this.tableCode) return
this.cacheForm = Object.assign(this.cacheForm, form)
this.listLoading = true
const params = Object.assign(
......@@ -338,7 +339,7 @@ export default {
delete params[key]
}
}
getFieldList(params).then((res) => {
getFieldListByCode(params).then((res) => {
this.listLoading = false
this.tableData = res.data || []
})
......
......@@ -43,7 +43,7 @@
{{ item.name }} | {{ item.code }}
</span>
<span class="item-del">
<i class="el-icon-edit-outline" @click="handleAdd(item)"></i>
<!-- <i class="el-icon-edit-outline" @click="handleAdd(item)"></i> -->
</span>
</el-col>
</el-col>
......
......@@ -18,10 +18,10 @@
@change="tableCodeChange"
>
<el-option
v-for="opt in dictMap['table']"
:key="opt.value"
:label="opt.label"
:value="opt.value"
v-for="opt in tableList"
:key="opt.code"
:label="opt.name"
:value="opt.code"
>
</el-option>
</el-select>
......@@ -50,15 +50,19 @@ import {
getFormDetail,
getHistoryInfo,
} from "@/api/field"
import { getTableList } from "@/api/database"
export default {
name: "FormAdd",
props: {
formEdit: {
type: Object,
},
dbId: {},
},
data() {
return {
tableList: [],
disabled: false,
name: "",
options: {},
......@@ -70,11 +74,17 @@ export default {
},
methods: {
getTableList() {
if (!this.dbId) return
getTableList(this.dbId).then((res) => {
this.tableList = res.data
})
},
// 获取数据表字段
tableCodeChange(tableCode) {
if (!tableCode) return
this.$refs.form.customFieldsLoading = this.disabled = true
const tableList = this.dictMap["table"]
const tableList = this.tableList
this.tableName =
tableList.find((_) => _.value === tableCode) &&
tableList.find((_) => _.value === tableCode).label
......@@ -84,6 +94,7 @@ export default {
const customOldFields = []
const d = res.data
d.forEach((item) => {
if (!item.jsonStr) return
const field = JSON.parse(item.jsonStr)
if (field.id) delete field.id
customOldFields.push({
......@@ -120,6 +131,7 @@ export default {
id: this.formEdit.id,
formJson: "",
name: this.name,
dbId: this.dbId,
}
let fieldList = []
form["formJson"] = await this.$refs.form.getData("string")
......@@ -202,6 +214,7 @@ export default {
},
created() {
this.initForm()
this.getTableList()
},
}
</script>
......
<template>
<div class="container">
<form-add v-if="isAdd" @back="back" :form-edit="formEdit"></form-add>
<form-add
v-if="isAdd"
@back="back"
:form-edit="formEdit"
:dbId="dbId"
></form-add>
<form-history
v-else-if="isHistory"
@back="back"
:source-id="sourceId"
></form-history>
<div v-else>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane
:label="item.name"
:name="'index' + index"
v-for="(item, index) in dbList"
:key="item.id"
>{{
}}</el-tab-pane>
</el-tabs>
<direct-search
ref="form"
:forms="searchList"
......@@ -40,6 +54,7 @@ import paginationMixin from "@/components/TabComponents/mixin"
import FormAdd from "./FormAdd"
import FormHistory from "./FormHistory.vue"
import { getFormPage, delForm, copyForm } from "@/api/field.js"
import { getDbList } from "@/api/database"
export default {
components: {
FormAdd,
......@@ -48,6 +63,9 @@ export default {
name: "FormConfig",
data() {
return {
activeName: "index0",
dbList: [],
dbId: null,
listLoading: false,
isAdd: false,
isHistory: false,
......@@ -174,6 +192,11 @@ export default {
mixins: [paginationMixin],
methods: {
handleTabClick({ index }) {
this.dbId = this.dbList[index].id
this.handleFormSearch()
},
handleHistory({ id, version }) {
this.sourceId = id || ""
this.isHistory = true
......@@ -187,6 +210,7 @@ export default {
const data = {
name,
id: this.formId,
dbId: this.dbId,
}
copyForm(data).then((res) => {
this.$message.success("复制成功")
......@@ -233,7 +257,12 @@ export default {
handleSearch(form) {
this.cacheForm = Object.assign(this.cacheForm, form)
this.listLoading = true
const params = Object.assign({}, this.cacheForm)
const params = Object.assign(
{
dbId: this.dbId,
},
this.cacheForm
)
for (let key in params) {
if (params[key] === "") {
delete params[key]
......@@ -250,9 +279,19 @@ export default {
}
})
},
getDbList() {
getDbList().then((res) => {
this.dbList = res.data
if (this.dbList[0]) {
this.dbId = this.dbList[0].id
}
this.handleFormSearch()
})
},
},
created() {
this.handleFormSearch()
this.getDbList()
},
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment