UPDATE: 优化;
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import type {ReqPage, ResPage} from '@/api/interface'
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
// 标准设备模块
|
// 标准设备模块
|
||||||
export namespace StandardDevice {
|
export namespace StandardDevice {
|
||||||
@@ -34,6 +34,7 @@ export namespace StandardDevice {
|
|||||||
createTime?: string | null; //创建时间
|
createTime?: string | null; //创建时间
|
||||||
updateBy?: string | null; //更新用户
|
updateBy?: string | null; //更新用户
|
||||||
updateTime?: string | null; //更新时间
|
updateTime?: string | null; //更新时间
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ const handleImportResponse = (res: any) => {
|
|||||||
if (!parameter.value.progressBar) {
|
if (!parameter.value.progressBar) {
|
||||||
if (res.code === 'A0000') {
|
if (res.code === 'A0000') {
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
|
emit('result', true)
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('result', res.data)
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.message)
|
ElMessage.error(res.message)
|
||||||
fileDisabled.value = false
|
fileDisabled.value = false
|
||||||
@@ -195,8 +195,8 @@ const initSSE = () => {
|
|||||||
progressData.value.status = 'success'
|
progressData.value.status = 'success'
|
||||||
eventSource.value!.close()
|
eventSource.value!.close()
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
dialogVisible.value = false
|
|
||||||
emit('result', true)
|
emit('result', true)
|
||||||
|
dialogVisible.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
content="子计划信息"
|
content="子计划信息"
|
||||||
>
|
>
|
||||||
<List
|
<List
|
||||||
v-auth.plan="'add_subplan'"
|
|
||||||
@click.stop="childDetail(node.data)"
|
@click.stop="childDetail(node.data)"
|
||||||
style="
|
style="
|
||||||
width: 16px;
|
width: 16px;
|
||||||
|
|||||||
@@ -37,13 +37,7 @@
|
|||||||
<el-button v-if="!isTabPlanFather" icon="CirclePlus" type="primary" @click="addTab('add')">
|
<el-button v-if="!isTabPlanFather" icon="CirclePlus" type="primary" @click="addTab('add')">
|
||||||
新增子计划
|
新增子计划
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button v-if="isTabPlanFather" icon="Edit" type="primary" @click="addTab('edit')">
|
||||||
v-if="isTabPlanFather && planFormContent?.testState === 0"
|
|
||||||
v-auth.plan="'add_subplan'"
|
|
||||||
icon="Edit"
|
|
||||||
type="primary"
|
|
||||||
@click="addTab('edit')"
|
|
||||||
>
|
|
||||||
编辑子计划
|
编辑子计划
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -375,11 +369,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render: (scope: { row: { checkState: number } }) => {
|
render: (scope: { row: { checkState: number } }) => {
|
||||||
return scope.row.checkState === 0 ? (
|
return scope.row.checkState === 0 ? (
|
||||||
<el-tag type="warning" effect="dark">
|
<el-tag type="primary" effect="dark">
|
||||||
未检
|
未检
|
||||||
</el-tag>
|
</el-tag>
|
||||||
) : scope.row.checkState === 1 ? (
|
) : scope.row.checkState === 1 ? (
|
||||||
<el-tag type="danger" effect="dark">
|
<el-tag type="warning" effect="dark">
|
||||||
检测中
|
检测中
|
||||||
</el-tag>
|
</el-tag>
|
||||||
) : (
|
) : (
|
||||||
@@ -478,6 +472,7 @@ const addTab = (type: string) => {
|
|||||||
//收到子组件回复后新增子计划tab
|
//收到子组件回复后新增子计划tab
|
||||||
const addNewChildTab = async () => {
|
const addNewChildTab = async () => {
|
||||||
await props.refreshTable!() //刷新检测计划列表
|
await props.refreshTable!() //刷新检测计划列表
|
||||||
|
proTable.value?.getTableList() // 刷新当前设备列表
|
||||||
renderTabs()
|
renderTabs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -412,13 +412,13 @@ const convertToTree = (data: Device[], groupBy?: string | undefined) => {
|
|||||||
const groupNode: Tree = {
|
const groupNode: Tree = {
|
||||||
id: `${groupBy}_${groupName}`,
|
id: `${groupBy}_${groupName}`,
|
||||||
label: groupName,
|
label: groupName,
|
||||||
disabled: props.disabled,
|
|
||||||
children: (items as any[]).map((item: any) => ({
|
children: (items as any[]).map((item: any) => ({
|
||||||
|
...item,
|
||||||
label: item.name,
|
label: item.name,
|
||||||
children: [],
|
children: [],
|
||||||
disabled: item.disabled ? item.disabled : props.disabled,
|
disabled: item.disabled ? item.disabled : props.disabled
|
||||||
...item
|
})),
|
||||||
}))
|
disabled: props.disabled
|
||||||
}
|
}
|
||||||
treeData.push(groupNode)
|
treeData.push(groupNode)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-form-item :label-width="110" label="名称" prop="name">
|
<el-form-item :label-width="110" label="名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
|
:disabled="formContent.testState != 0"
|
||||||
v-model="formContent.name"
|
v-model="formContent.name"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
maxlength="32"
|
maxlength="32"
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="option in pqStandardDevArray"
|
v-for="option in pqStandardDevArray"
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
:disabled="subPlanBindStandardDev.includes(option.label)"
|
:disabled="subPlanBindStandardDev.includes(option.label) || option.disabled"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
/>
|
/>
|
||||||
@@ -83,7 +84,7 @@
|
|||||||
<el-form-item :label-width="110" label="数据源" prop="datasourceIds">
|
<el-form-item :label-width="110" label="数据源" prop="datasourceIds">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formContent.datasourceIds"
|
v-model="formContent.datasourceIds"
|
||||||
:disabled="allDisabled"
|
:disabled="allDisabled || formContent.testState != 0"
|
||||||
:max-collapse-tags="1"
|
:max-collapse-tags="1"
|
||||||
collapse-tags-tooltip
|
collapse-tags-tooltip
|
||||||
:multiple="selectByMode"
|
:multiple="selectByMode"
|
||||||
@@ -209,7 +210,7 @@
|
|||||||
<el-form-item v-if="selectByMode" :label-width="110" label="项目成员" prop="memberIds">
|
<el-form-item v-if="selectByMode" :label-width="110" label="项目成员" prop="memberIds">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formContent.memberIds"
|
v-model="formContent.memberIds"
|
||||||
:disabled="allDisabled"
|
:disabled="allDisabled || formContent.testState != 0"
|
||||||
:multiple="planType == 0"
|
:multiple="planType == 0"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
clearable
|
clearable
|
||||||
@@ -460,10 +461,9 @@ const generateData = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
i.checked = boundPqDevIds.includes(i.id)
|
i.checked = boundPqDevIds.includes(i.id)
|
||||||
if (i.assign) {
|
i.disabled = i.checkState != 0
|
||||||
i.disabled = i.checkState != 0 || i.assign == 1 || allDisabled.value
|
if (allDisabled.value) {
|
||||||
} else {
|
i.disabled = true
|
||||||
i.disabled = allDisabled.value
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 排序逻辑
|
// 排序逻辑
|
||||||
@@ -1117,14 +1117,16 @@ function pqToArray() {
|
|||||||
if (planType.value === 0) {
|
if (planType.value === 0) {
|
||||||
pqStandardDevArray.value = sourceArray5.map(item => ({
|
pqStandardDevArray.value = sourceArray5.map(item => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id
|
value: item.id,
|
||||||
|
disabled: item.disabled || false
|
||||||
}))
|
}))
|
||||||
} else if (planType.value === 1) {
|
} else if (planType.value === 1) {
|
||||||
pqStandardDevArray.value = sourceArray5
|
pqStandardDevArray.value = sourceArray5
|
||||||
.filter(item => formContent.standardDevIds.includes(item.id))
|
.filter(item => formContent.standardDevIds.includes(item.id))
|
||||||
.map(item => ({
|
.map(item => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id
|
value: item.id,
|
||||||
|
disabled: item.disabled || false
|
||||||
}))
|
}))
|
||||||
formContent.standardDevIds = []
|
formContent.standardDevIds = []
|
||||||
formContent.standardDevMap = new Map<string, number>()
|
formContent.standardDevMap = new Map<string, number>()
|
||||||
@@ -1134,7 +1136,8 @@ function pqToArray() {
|
|||||||
const boundStandardDevAllList = Array.isArray(result.data) ? result.data : []
|
const boundStandardDevAllList = Array.isArray(result.data) ? result.data : []
|
||||||
pqStandardDevArray.value = boundStandardDevAllList.map(item => ({
|
pqStandardDevArray.value = boundStandardDevAllList.map(item => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id
|
value: item.id,
|
||||||
|
disabled: item.disabled || false
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-auth.plan="'analysis'"
|
v-auth.plan="'analysis'"
|
||||||
:icon="List"
|
icon="DataLine"
|
||||||
:disabled="!scope.isSelected"
|
:disabled="!scope.isSelected"
|
||||||
@click="statisticalAnalysisMore(scope.selectedListIds, scope.selectedList)"
|
@click="statisticalAnalysisMore(scope.selectedListIds, scope.selectedList)"
|
||||||
>
|
>
|
||||||
@@ -342,11 +342,11 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
|||||||
fieldNames: { label: 'label', value: 'id' },
|
fieldNames: { label: 'label', value: 'id' },
|
||||||
render: scope => {
|
render: scope => {
|
||||||
return scope.row.testState === 0 ? (
|
return scope.row.testState === 0 ? (
|
||||||
<el-tag type="warning" effect="dark">
|
<el-tag type="primary" effect="dark">
|
||||||
未检
|
未检
|
||||||
</el-tag>
|
</el-tag>
|
||||||
) : scope.row.testState === 1 ? (
|
) : scope.row.testState === 1 ? (
|
||||||
<el-tag type="danger" effect="dark">
|
<el-tag type="warning" effect="dark">
|
||||||
检测中
|
检测中
|
||||||
</el-tag>
|
</el-tag>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user