|
@@ -28,12 +28,13 @@
|
|
<template #right>
|
|
<template #right>
|
|
<hc-card>
|
|
<hc-card>
|
|
<template #header>
|
|
<template #header>
|
|
- <el-button color="#567722" size="small" class="text-white">元素匹配</el-button>
|
|
|
|
- <el-button color="#67C23B" size="small" class="text-white">调整表单</el-button>
|
|
|
|
|
|
+ <el-button color="#2550A2" size="small" class="text-white">关联WBS并创建元素</el-button>
|
|
|
|
+ <el-button color="#FF986A" size="small" class="text-white">添加到元素库</el-button>
|
|
|
|
+ <!-- el-button color="#567722" size="small" class="text-white">元素匹配</el-button>
|
|
|
|
+ <el-button color="#67C23B" size="small" class="text-white">调整表单</el-button -->
|
|
</template>
|
|
</template>
|
|
<template #extra>
|
|
<template #extra>
|
|
- <el-button color="#FF986A" size="small" class="text-white">添加到元素库</el-button>
|
|
|
|
- <el-button color="#2550A2" size="small" class="text-white">关联WBS并创建元素</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="addColByTab">新增</el-button>
|
|
</template>
|
|
</template>
|
|
<hc-table ref="tabRef" :column="tableColumn" :datas="tableData" :index-style="{ width: 60 }" @row-click="tableRowClick">
|
|
<hc-table ref="tabRef" :column="tableColumn" :datas="tableData" :index-style="{ width: 60 }" @row-click="tableRowClick">
|
|
<template #textInfo="{ row }">
|
|
<template #textInfo="{ row }">
|
|
@@ -55,13 +56,17 @@
|
|
</hc-card>
|
|
</hc-card>
|
|
</template>
|
|
</template>
|
|
</hc-page-split>
|
|
</hc-page-split>
|
|
|
|
+ <!-- 添加新元素字段 -->
|
|
|
|
+ <HcAddColTab v-model="addColTabShow" />
|
|
</hc-drawer>
|
|
</hc-drawer>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { HcDelMsg } from 'hc-vue3-ui'
|
|
import { ref, watch } from 'vue'
|
|
import { ref, watch } from 'vue'
|
|
import { getArrValue, isNullES, isString } from 'js-fast-way'
|
|
import { getArrValue, isNullES, isString } from 'js-fast-way'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
|
+import HcAddColTab from './add-col-tab.vue'
|
|
import mainApi from '~api/exctab/exceltab'
|
|
import mainApi from '~api/exctab/exceltab'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -215,13 +220,31 @@ const tableRowClick = ({ row }) => {
|
|
}
|
|
}
|
|
|
|
|
|
//保存元素表格
|
|
//保存元素表格
|
|
-const saveRowClick = (row) => {
|
|
|
|
-
|
|
|
|
|
|
+const saveRowClick = async (row) => {
|
|
|
|
+ if (isNullES(row.textInfo)) {
|
|
|
|
+ window?.$message.warning('请填写元素名称')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const { isRes } = await mainApi.saveColByTabId(row)
|
|
|
|
+ if (!isRes) return
|
|
|
|
+ window.$message.success('保存成功')
|
|
}
|
|
}
|
|
|
|
|
|
//删除元素表格
|
|
//删除元素表格
|
|
const delRowClick = (row) => {
|
|
const delRowClick = (row) => {
|
|
|
|
+ HcDelMsg(async (resolve) => {
|
|
|
|
+ const { isRes } = await mainApi.delColByTabId(row.id)
|
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
|
+ if (!isRes) return
|
|
|
|
+ window.$message.success('删除成功')
|
|
|
|
+ getTableData().then()
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
|
|
+//添加新元素字段
|
|
|
|
+const addColTabShow = ref(false)
|
|
|
|
+const addColByTab = () => {
|
|
|
|
+ addColTabShow.value = true
|
|
}
|
|
}
|
|
|
|
|
|
//关闭抽屉
|
|
//关闭抽屉
|
|
@@ -233,9 +256,7 @@ const drawerClose = () => {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-.hc-element-recognition {
|
|
|
|
|
|
|
|
-}
|
|
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|