Commit 8923db80 by liuyong

修改bug

2 parents 465fe550 51a3ef36
Showing with 2908 additions and 239 deletions
/* guo /* guo
架构督查 api 架构督查 api
*/ */
import { EADC_ARRCHITECTURE, EADC_KNOWLEDGE_POOL } from '@/config/micromodule' import { EADC_ARRCHITECTURE, EADC_KNOWLEDGE_POOL, EADC_SHARED_ABILITY } from '@/config/micromodule'
// 收集资料配置 查询 // 收集资料配置 查询
export const collectDataSearch = EADC_ARRCHITECTURE + '/Collect/CollectInformation/' export const collectDataSearch = EADC_ARRCHITECTURE + '/Collect/CollectInformation/'
...@@ -22,4 +22,8 @@ export const artPolicyExamineAdd = EADC_KNOWLEDGE_POOL + '/kl-tech-policy/' ...@@ -22,4 +22,8 @@ export const artPolicyExamineAdd = EADC_KNOWLEDGE_POOL + '/kl-tech-policy/'
// 审查 查询 // 审查 查询
export const examineSearch = EADC_ARRCHITECTURE + '/prj-info/' export const examineSearch = EADC_ARRCHITECTURE + '/prj-info/'
// 字典管理
export const dictionarySearch = EADC_SHARED_ABILITY + '/dict/'
// 维护 查询
export const dictionaryMaintenanceSearch = EADC_SHARED_ABILITY + '/dictDetail/'
...@@ -784,6 +784,21 @@ export function getPrjInfoDetail(params) { ...@@ -784,6 +784,21 @@ export function getPrjInfoDetail(params) {
export function getSystemInfoDetail(params) { export function getSystemInfoDetail(params) {
return post(EADC_ARRCHITECTURE + '/app-info/dApp', params) return post(EADC_ARRCHITECTURE + '/app-info/dApp', params)
} }
// 专家人才库管理-新增人才
export function addKlPerson(params) {
return post(EADC_KNOWLEDGE_POOL + '/kl-talent-pool/adKlPerson', params)
}
// 专家人才库管理-更新人才
export function updKlPerson(params) {
return post(EADC_KNOWLEDGE_POOL + '/kl-talent-pool/upKlPerson', params)
}
// 专家人才库管理-删除
export function delKlPerson(params) {
return post(EADC_KNOWLEDGE_POOL + '/kl-talent-pool/del', params)
}
export function postRequest(url, params) { export function postRequest(url, params) {
return post(EADC_ARRCHITECTURE + url, params) return post(EADC_ARRCHITECTURE + url, params)
} }
export function postRequestShared(url, params){
return post(EADC_SHARED_ABILITY + url, params)
}
\ No newline at end of file
import { EADC_ARRCHITECTURE } from '@/config/micromodule' import { EADC_ARRCHITECTURE, EADC_KNOWLEDGE_POOL } from '@/config/micromodule'
// 列表接口url // 列表接口url
// 批量计划管理分页查询 // 批量计划管理分页查询
export const batchPlanManagement = EADC_ARRCHITECTURE + '/bat-plan-info/' export const batchPlanManagement = EADC_ARRCHITECTURE + '/bat-plan-info/'
...@@ -37,3 +37,8 @@ export const queryConceptualBaseOrg = EADC_ARRCHITECTURE + '/org-info/' ...@@ -37,3 +37,8 @@ export const queryConceptualBaseOrg = EADC_ARRCHITECTURE + '/org-info/'
// 架构遵从检查列表 // 架构遵从检查列表
export const queryArchitectureFollowExamine = export const queryArchitectureFollowExamine =
EADC_ARRCHITECTURE + '/architectureFollows/' EADC_ARRCHITECTURE + '/architectureFollows/'
// 专家人才库管理-查询人才
export const queryqKLPerson = EADC_KNOWLEDGE_POOL + '/kl-talent-pool/qKLPerson/'
export const queryExpert = EADC_KNOWLEDGE_POOL + '/kl-talent-pool/'
...@@ -4,11 +4,8 @@ ...@@ -4,11 +4,8 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:55:59 * @Date: 2024-03-12 14:55:59
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-27 09:47:20 * @LastEditTime: 2024-04-02 09:56:29
--> -->
<!-- /**
* 搜索栏公共组件
*/ -->
<template> <template>
<div class="form-box"> <div class="form-box">
<el-form <el-form
...@@ -25,7 +22,11 @@ ...@@ -25,7 +22,11 @@
<el-form-item :prop="item.prop" :label="item.label" :rules="item.rules"> <el-form-item :prop="item.prop" :label="item.label" :rules="item.rules">
<!-- 自定义插槽,可用于特殊表单块 --> <!-- 自定义插槽,可用于特殊表单块 -->
<template v-if="item.__slotName"> <template v-if="item.__slotName">
<slot :name="item.__slotName" :data="item"></slot> <slot
:name="item.__slotName"
:form-data="formData"
:data="item"
></slot>
</template> </template>
<SearchFormItem <SearchFormItem
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:01:57 * @Date: 2024-03-12 14:01:57
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-29 20:23:32 * @LastEditTime: 2024-04-01 11:52:46
--> -->
<template> <template>
<div class="list-page"> <div class="list-page">
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
.operation-wrap { .operation-wrap {
display: flex; display: flex;
padding: 10px 0; padding: 14px 0;
box-sizing: border-box; box-sizing: border-box;
} }
.table-wrap { .table-wrap {
...@@ -55,5 +55,8 @@ export default { ...@@ -55,5 +55,8 @@ export default {
.formWrap { .formWrap {
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
} }
/deep/ .el-tabs__header {
margin: 0;
}
} }
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:55:59 * @Date: 2024-03-12 14:55:59
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-28 17:01:26 * @LastEditTime: 2024-04-02 13:59:42
--> -->
<!-- /** <!-- /**
* 搜索栏公共组件 * 搜索栏公共组件
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
// console.log('提交成功') // console.log('提交成功')
console.log(this.formData) // console.log(this.formData)
callback() callback()
} }
}) })
...@@ -152,7 +152,9 @@ export default { ...@@ -152,7 +152,9 @@ export default {
}) })
}, },
onReset() { onReset() {
this.$refs.formRef.resetFields() this.$nextTick(() => {
this.$refs.formRef.resetFields()
})
}, },
// 添加初始值 // 添加初始值
addInitValue() { addInitValue() {
...@@ -173,7 +175,8 @@ export default { ...@@ -173,7 +175,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.search-form-box { .search-form-box {
display: flex; display: flex;
margin-top: 10px; margin-top: 25px;
margin-bottom: 15px;
.btn-box { .btn-box {
// padding-top: 5px; // padding-top: 5px;
display: flex; display: flex;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 15:11:47 * @Date: 2024-03-12 15:11:47
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-26 15:30:38 * @LastEditTime: 2024-04-02 12:39:00
--> -->
<template> <template>
<div class="form-item"> <div class="form-item">
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
v-model="currentVal" v-model="currentVal"
v-bind="bindProps" v-bind="bindProps"
v-on="bindEvents" v-on="bindEvents"
clearable
:placeholder="itemOptions.placeholder" :placeholder="itemOptions.placeholder"
></el-input> ></el-input>
...@@ -148,7 +149,15 @@ export default { ...@@ -148,7 +149,15 @@ export default {
// 双向绑定数据值 // 双向绑定数据值
currentVal: { currentVal: {
get() { get() {
return this.value if (this.isSelect) {
if (Array.isArray(this.value)) {
return this.value
} else {
return this.value && this.value + ''
}
} else {
return this.value
}
}, },
set(val) { set(val) {
this.$emit('input', val) this.$emit('input', val)
...@@ -244,7 +253,7 @@ export default { ...@@ -244,7 +253,7 @@ export default {
} else { } else {
const params = { key } const params = { key }
const res = await getDianXingAnLiSelectData(params) const res = await getDianXingAnLiSelectData(params)
if (res.code !== 200) return if (res.code !== 200 || !res.data.length) return
dictTypeOptions = res.data dictTypeOptions = res.data
const jsonStr = JSON.stringify(res.data) const jsonStr = JSON.stringify(res.data)
localStorage.setItem('dic_' + key, jsonStr) localStorage.setItem('dic_' + key, jsonStr)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-11 14:53:40 * @Date: 2024-03-11 14:53:40
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-27 17:22:37 * @LastEditTime: 2024-04-02 09:14:13
--> -->
<!-- 示例 <!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => { columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
...@@ -60,9 +60,17 @@ ...@@ -60,9 +60,17 @@
<span v-html="item.callback && item.callback(scope.row)"></span> <span v-html="item.callback && item.callback(scope.row)"></span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column
v-if="item.type === 'index'"
v-bind="item"
align="center"
:key="item.type"
:index="indexMethod"
>
</el-table-column>
<!-- 操作列 --> <!-- 操作列 -->
<el-table-column <el-table-column
v-if="item.type === 'operation'" v-else-if="item.type === 'operation'"
:key="item.prop" :key="item.prop"
v-bind="item" v-bind="item"
align="center" align="center"
...@@ -218,6 +226,12 @@ export default { ...@@ -218,6 +226,12 @@ export default {
this.queryData() this.queryData()
}, },
methods: { methods: {
indexMethod(index) {
return (
(this.pagination.current - 1) * this.pagination.pageSize + index + 1
)
},
clearSelection() { clearSelection() {
this.$refs.tableConfig.clearSelection() this.$refs.tableConfig.clearSelection()
}, },
...@@ -226,7 +240,7 @@ export default { ...@@ -226,7 +240,7 @@ export default {
if (!val) { if (!val) {
val = item.emptyToNum || 0 val = item.emptyToNum || 0
} }
const obj = item.options.find((v) => v.value == val) || {} const obj = item.options?.find((v) => v.value == val) || {}
return obj['label'] return obj['label']
}, },
/** /**
......
...@@ -6,14 +6,16 @@ import * as echarts from 'echarts' ...@@ -6,14 +6,16 @@ import * as echarts from 'echarts'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import './styles/element-variables.scss' import './styles/element-variables.scss'
import './styles/common.scss'
import initDirective from './directive' import initDirective from './directive'
import { postRequest } from '@/api/index' import { postRequest, postRequestShared } from '@/api/index'
initDirective(Vue) initDirective(Vue)
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$postRequest = postRequest Vue.prototype.$postRequest = postRequest
Vue.prototype.$postRequestShared = postRequestShared
Vue.use(ElementUI) Vue.use(ElementUI)
Date.prototype.format = function (fmt) { Date.prototype.format = function (fmt) {
......
import { getAllBreadcrumbList } from '@/utils'
import { menuOptions } from '@/views/Main/menu'
const getters = {
// 递归处理后的所有面包屑导航列表
breadcrumbListGet: (state) => getAllBreadcrumbList(menuOptions),
// tag 路由标签
cachedViews: state => state.tagsView.cachedViews,
}
export default getters
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import getters from './getters'
Vue.use(Vuex) Vue.use(Vuex)
import { getAllBreadcrumbList } from '@/utils'
import { menuOptions } from '@/views/Main/menu' const modulesFiles = require.context('./modules', true, /\.js$/)
// you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
// set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default new Vuex.Store({ export default new Vuex.Store({
state: {}, state: {},
getters: { getters,
// 递归处理后的所有面包屑导航列表
breadcrumbListGet: (state) => getAllBreadcrumbList(menuOptions),
},
mutations: {}, mutations: {},
actions: {}, actions: {},
modules: {}, modules,
}) })
const state = {
visitedViews: [],
cachedViews: []
}
const mutations = {
ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
if (view.meta.keepAlive) {
state.cachedViews.push(view.name)
}
},
DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
break
}
}
},
DEL_CACHED_VIEW: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
index > -1 && state.cachedViews.splice(index, 1)
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => {
return v.meta.affix || v.path === view.path
})
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
if (index > -1) {
state.cachedViews = state.cachedViews.slice(index, index + 1)
} else {
// if index = -1, there is no cached tags
state.cachedViews = []
}
},
DEL_ALL_VISITED_VIEWS: state => {
// keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
state.visitedViews = affixTags
},
DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = []
},
UPDATE_VISITED_VIEW: (state, view) => {
for (let v of state.visitedViews) {
if (v.path === view.path) {
v = Object.assign(v, view)
break
}
}
}
}
const actions = {
addView({ dispatch }, view) {
dispatch('addVisitedView', view)
dispatch('addCachedView', view)
},
addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view)
},
addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view)
},
delView({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delVisitedView', view)
dispatch('delCachedView', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delVisitedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
delCachedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_CACHED_VIEW', view)
resolve([...state.cachedViews])
})
},
delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delOthersVisitedViews', view)
dispatch('delOthersCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_CACHED_VIEWS', view)
resolve([...state.cachedViews])
})
},
delAllViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delAllVisitedViews', view)
dispatch('delAllCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delAllVisitedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
},
delAllCachedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_CACHED_VIEWS')
resolve([...state.cachedViews])
})
},
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
...@@ -17,3 +17,18 @@ ...@@ -17,3 +17,18 @@
.breadcrumb-leave-active { .breadcrumb-leave-active {
position: absolute; position: absolute;
} }
/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all .5s;
}
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
}
...@@ -30,4 +30,13 @@ export const materialTypeList = [ ...@@ -30,4 +30,13 @@ export const materialTypeList = [
export const superStateCode = [ export const superStateCode = [
{ label: '未发布', value: 0 }, { label: '未发布', value: 0 },
{ label: '已发布', value: 1 }, { label: '已发布', value: 1 },
]
export const flag = [
{ label: '显示', value: '0' },
{ label: '隐藏', value: '1' },
]
export const delFlag = [
{ label: '显示', value: '0' },
{ label: '隐藏', value: '1' },
] ]
\ No newline at end of file
...@@ -43,7 +43,7 @@ export async function getDictTypeOptions(key) { ...@@ -43,7 +43,7 @@ export async function getDictTypeOptions(key) {
} else { } else {
const params = { key } const params = { key }
const res = await getDianXingAnLiSelectData(params) const res = await getDianXingAnLiSelectData(params)
if (res.code !== 200) return if (res.code !== 200 || !res.data.length) return
dictTypeOptions = res.data dictTypeOptions = res.data
const jsonStr = JSON.stringify(res.data) const jsonStr = JSON.stringify(res.data)
localStorage.setItem('dic_' + key, jsonStr) localStorage.setItem('dic_' + key, jsonStr)
...@@ -51,3 +51,13 @@ export async function getDictTypeOptions(key) { ...@@ -51,3 +51,13 @@ export async function getDictTypeOptions(key) {
// console.log('dictTypeOptions', dictTypeOptions) // console.log('dictTypeOptions', dictTypeOptions)
return dictTypeOptions return dictTypeOptions
} }
/**
* @description: svg字符串转base64
* @param {String} svgCode
* @return {String} base64
* @author: pan
*/
export function svgToBase64(svgCode) {
const utf8Bytes = new TextEncoder().encode(svgCode);
return 'data:image/svg+xml;base64,' + btoa(String.fromCharCode.apply(null, utf8Bytes));
}
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view :key="key" />
</keep-alive>
</transition>
</section>
</template>
<script>
export default {
name: 'AppMain',
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews
},
key() {
return this.$route.path
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/transition.scss';
.app-main {
/* 50= navbar 50 */
// min-height: calc(100vh - 50px);
// width: 100%;
// position: relative;
// overflow: hidden;
display: flex;
height: calc(100% - 220px);
width: calc(100% - 40px);
margin: 70px 20px 20px 20px;
border-top: 6px solid #0d867f;
box-shadow: 10px 10px 30px 30px rgba(201, 226, 225, 1);
}
.fixed-header+.app-main {
padding-top: 50px;
}
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
}
.fixed-header+.app-main {
padding-top: 84px;
}
}
</style>
<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
.fixed-header {
padding-right: 15px;
}
}
</style>
<template>
<el-scrollbar ref="scrollContainer" :vertical="false" class="scroll-container" @wheel.native.prevent="handleScroll">
<slot />
</el-scrollbar>
</template>
<script>
const tagAndTagSpacing = 4 // tagAndTagSpacing
export default {
name: 'ScrollPane',
data() {
return {
left: 0
}
},
computed: {
scrollWrapper() {
return this.$refs.scrollContainer.$refs.wrap
}
},
methods: {
handleScroll(e) {
const eventDelta = e.wheelDelta || -e.deltaY * 40
const $scrollWrapper = this.scrollWrapper
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
},
moveToTarget(currentTag) {
const $container = this.$refs.scrollContainer.$el
const $containerWidth = $container.offsetWidth
const $scrollWrapper = this.scrollWrapper
const tagList = this.$parent.$refs.tag
let firstTag = null
let lastTag = null
// find first tag and last tag
if (tagList.length > 0) {
firstTag = tagList[0]
lastTag = tagList[tagList.length - 1]
}
if (firstTag === currentTag) {
$scrollWrapper.scrollLeft = 0
} else if (lastTag === currentTag) {
$scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth
} else {
// find preTag and nextTag
const currentIndex = tagList.findIndex(item => item === currentTag)
const prevTag = tagList[currentIndex - 1]
const nextTag = tagList[currentIndex + 1]
// the tag's offsetLeft after of nextTag
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
// the tag's offsetLeft before of prevTag
const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing
if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
$scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth
} else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {
$scrollWrapper.scrollLeft = beforePrevTagOffsetLeft
}
}
}
}
}
</script>
<style lang="scss" scoped>
.scroll-container {
white-space: nowrap;
position: relative;
overflow: hidden;
width: 100%;
/deep/ {
.el-scrollbar__bar {
bottom: 0px;
}
.el-scrollbar__wrap {
height: 49px;
}
}
}
</style>
<template>
<div id="tags-view-container" class="tags-view-container">
<scroll-pane ref="scrollPane" class="tags-view-wrapper">
<!-- @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" -->
<router-link
v-for="tag in visitedViews"
ref="tag"
:key="tag.path"
:class="isActive(tag) ? 'active' : ''"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
@contextmenu.prevent.native="openMenu(tag, $event)"
>
{{ tag.title }}
<span
v-if="!isAffix(tag) && visitedViews.length > 1"
class="el-icon-close"
@click.prevent.stop="closeSelectedTag(tag)"
/>
</router-link>
</scroll-pane>
<!-- <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<li @click="refreshSelectedTag(selectedTag)">Refresh</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">Close</li>
<li @click="closeOthersTags(selectedTag)">Close Others</li>
<li @click="closeAllTags(selectedTag)">Close All</li>
</ul> -->
</div>
</template>
<script>
import ScrollPane from './ScrollPane'
// import path from 'path'
import { routes } from '@/router'
export default {
components: { ScrollPane },
data() {
return {
visible: false,
top: 0,
left: 0,
selectedTag: {},
affixTags: [],
}
},
computed: {
visitedViews() {
return this.$store.state.tagsView.visitedViews
},
// routes() {
// return this.$store.state.permission.routes
// },
},
watch: {
$route() {
this.addTags()
this.moveToCurrentTag()
},
visible(value) {
if (value) {
document.body.addEventListener('click', this.closeMenu)
} else {
document.body.removeEventListener('click', this.closeMenu)
}
},
},
mounted() {
this.initTags()
this.addTags()
// 页面刷新前缓存和赋值
this.beforeUnload()
},
methods: {
// 刷新前缓存tab
beforeUnload() {
// 监听页面刷新
window.addEventListener('beforeunload', () => {
// visitedViews数据结构太复杂无法直接JSON.stringify处理,先转换需要的数据
let tabViews = this.visitedViews.map((item) => {
return {
fullPath: item.fullPath,
hash: item.hash,
meta: { ...item.meta },
name: item.name,
params: { ...item.params },
path: item.path,
query: { ...item.query },
title: item.title,
}
})
sessionStorage.setItem('tabViews', JSON.stringify(tabViews))
})
// 页面初始化加载判断缓存中是否有数据
let oldViews = JSON.parse(sessionStorage.getItem('tabViews')) || []
if (oldViews.length > 0) {
this.$store.state.tagsView.visitedViews = oldViews
}
},
isActive(route) {
return route.path === this.$route.path
},
isAffix(tag) {
return tag.meta && tag.meta.affix
},
filterAffixTags(routes, basePath = '/') {
let tags = []
routes.forEach((route) => {
if (route.meta && route.meta.affix) {
const tagPath = path.resolve(basePath, route.path)
tags.push({
fullPath: tagPath,
path: tagPath,
name: route.name,
meta: { ...route.meta },
})
}
if (route.children) {
const tempTags = this.filterAffixTags(route.children, route.path)
if (tempTags.length >= 1) {
tags = [...tags, ...tempTags]
}
}
})
return tags
},
initTags() {
const affixTags = (this.affixTags = this.filterAffixTags(routes))
for (const tag of affixTags) {
// Must have tag name
if (tag.name) {
this.$store.dispatch('tagsView/addVisitedView', tag)
}
}
},
addTags() {
const { name } = this.$route
if (name) {
this.$store.dispatch('tagsView/addView', this.$route)
}
return false
},
moveToCurrentTag() {
const tags = this.$refs.tag
this.$nextTick(() => {
for (const tag of tags) {
if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag)
// when query is different then update
if (tag.to.fullPath !== this.$route.fullPath) {
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
}
break
}
}
})
},
refreshSelectedTag(view) {
this.$store.dispatch('tagsView/delCachedView', view).then(() => {
const { fullPath } = view
this.$nextTick(() => {
this.$router.replace({
path: '/redirect' + fullPath,
})
})
})
},
closeSelectedTag(view) {
this.$store
.dispatch('tagsView/delView', view)
.then(({ visitedViews }) => {
if (this.isActive(view)) {
this.toLastView(visitedViews, view)
}
})
},
closeOthersTags() {
this.$router.push(this.selectedTag)
this.$store
.dispatch('tagsView/delOthersViews', this.selectedTag)
.then(() => {
this.moveToCurrentTag()
})
},
closeAllTags(view) {
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
if (this.affixTags.some((tag) => tag.path === view.path)) {
return
}
this.toLastView(visitedViews, view)
})
},
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView.fullPath)
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
this.$router.push('/')
}
},
openMenu(tag, e) {
const menuMinWidth = 105
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - menuMinWidth // left boundary
const left = e.clientX - offsetLeft + 15 // 15: margin right
if (left > maxLeft) {
this.left = maxLeft
} else {
this.left = left
}
this.top = e.clientY
this.visible = true
this.selectedTag = tag
},
closeMenu() {
this.visible = false
},
handleScroll() {
this.closeMenu()
},
},
}
</script>
<style lang="scss" scoped>
@import '@/styles/common.scss';
/deep/ .scroll-container .el-scrollbar__wrap {
scrollbar-width: none;
}
.tags-view-container {
height: 34px;
width: 100%;
background: #fff;
border-bottom: 1px solid #d8dce5;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
text-align: left;
.tags-view-wrapper {
.tags-view-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 26px;
line-height: 26px;
// border: 1px solid #d8dce5;
color: #495060;
background: #fff;
padding: 0 8px;
font-size: 12px;
margin-left: 5px;
margin-top: 4px;
&:first-of-type {
margin-left: 15px;
}
&:last-of-type {
margin-right: 15px;
}
@mixin tagActive() {
color: $color-primary;
background: url('../../../../assets/main/tag_bg.png') no-repeat center;
background-size: cover;
&::before {
content: '';
// background: #fff;
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
position: relative;
margin-right: 2px;
}
}
&:hover {
color: $color-primary;
}
&.active {
// background-color: #409eff;
// color: #fff;
// border-color: #409eff;
@include tagActive;
}
}
}
.contextmenu {
margin: 0;
background: #fff;
z-index: 3000;
position: absolute;
list-style-type: none;
padding: 5px 0;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #333;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
li {
margin: 0;
padding: 7px 16px;
cursor: pointer;
&:hover {
background: #eee;
}
}
}
}
</style>
<style lang="scss">
//reset element css of el-icon-close
.tags-view-wrapper {
.tags-view-item {
.el-icon-close {
width: 16px;
height: 16px;
vertical-align: 2px;
border-radius: 50%;
text-align: center;
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transform-origin: 100% 50%;
&:before {
transform: scale(0.6);
display: inline-block;
vertical-align: -3px;
}
&:hover {
background-color: #b4bccc;
color: #fff;
}
}
}
}
</style>
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
</div> </div>
</el-popover> </el-popover>
</div> </div>
<tags-view />
<div class="flex-b-c"> <div class="flex-b-c">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<!-- <el-breadcrumb-item>{{ breadcrumb1 }}</el-breadcrumb-item> <!-- <el-breadcrumb-item>{{ breadcrumb1 }}</el-breadcrumb-item>
...@@ -141,19 +142,22 @@ ...@@ -141,19 +142,22 @@
</div> </div>
</div> </div>
</div> </div>
<div class="left_menu_and_drawio_container"> <app-main />
<!-- <div class="left_menu_container"> <!-- <div class="left_menu_and_drawio_container">
左边任务栏
</div> -->
<router-view></router-view> <router-view></router-view>
</div> </div> -->
</div> </div>
</template> </template>
<script> <script>
// import $ from 'jquery' // import $ from 'jquery'
import AppMain from './components/AppMain.vue'
import TagsView from './components/TagsView/index.vue'
import { menuOptions } from './menu' import { menuOptions } from './menu'
export default { export default {
components: {}, components: {
AppMain,
TagsView
},
data() { data() {
return { return {
visible1: false, visible1: false,
...@@ -496,3 +500,9 @@ export default { ...@@ -496,3 +500,9 @@ export default {
@import '@/styles/elementui.scss'; @import '@/styles/elementui.scss';
@import './index.scss'; @import './index.scss';
</style> </style>
<style>
.el-tooltip__popper {
max-width: 50%;
}
</style>
>
...@@ -367,4 +367,19 @@ export const menuOptions = [ ...@@ -367,4 +367,19 @@ export const menuOptions = [
}, },
], ],
}, },
{
name: '系统管理',
width: '220',
children: [
{
name: '字典管理',
children: [
{
name: ' 字典管理 ',
path: '/main/dictionaryManagement',
},
],
},
],
},
] ]
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
type="index" type="index"
label="序号" label="序号"
width="80" width="80"
:index="indexMethod"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -252,7 +253,7 @@ ...@@ -252,7 +253,7 @@
</el-form> </el-form>
<div class="dialog_form_item3"> <div class="dialog_form_item3">
<div class="dialog_form_item_title"> <div class="dialog_form_item_title">
<span class="reqIcon">*</span>图标设置 <span class="reqIcon">*</span>元素连线设置
</div> </div>
<div> <div>
<div class="dialog_form_item3_content1"> <div class="dialog_form_item3_content1">
...@@ -295,7 +296,7 @@ ...@@ -295,7 +296,7 @@
</div> </div>
</div> </div>
<div class="dialog_form_item"> <div class="dialog_form_item">
<div class="dialog_form_item_title">约束条件</div> <div class="dialog_form_item_title">元素关系</div>
<div class="formArea"> <div class="formArea">
<div <div
class="formLine" class="formLine"
...@@ -304,7 +305,7 @@ ...@@ -304,7 +305,7 @@
> >
情况{{ index + 1 }} 情况{{ index + 1 }}
<div class="formItem"> <div class="formItem">
<div class="label">对象1</div> <div class="label">起点元素1</div>
<el-select <el-select
filterable filterable
v-model="item.eleGtId" v-model="item.eleGtId"
...@@ -321,7 +322,7 @@ ...@@ -321,7 +322,7 @@
</el-select> </el-select>
</div> </div>
<div class="formItem"> <div class="formItem">
<div class="label">对象2</div> <div class="label">终点元素2</div>
<el-select <el-select
filterable filterable
v-model="item.eleLtId" v-model="item.eleLtId"
...@@ -353,20 +354,20 @@ ...@@ -353,20 +354,20 @@
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<div class="newBtn"> <div class="newBtn" style="display: flex">
<el-button <el-button
class="addItem" class="addItem"
icon="el-icon-plus" icon="el-icon-minus"
circle circle
@click="operateDia('add')" @click="operateDia('del', index)"
v-if="formData.arrList.length == index + 1" v-if="formData.arrList.length > 1"
></el-button> ></el-button>
<el-button <el-button
class="addItem" class="addItem"
icon="el-icon-minus" icon="el-icon-plus"
circle circle
@click="operateDia('del')" @click="operateDia('add')"
v-else v-if="formData.arrList.length - 1 == index"
></el-button> ></el-button>
</div> </div>
</div> </div>
...@@ -374,7 +375,7 @@ ...@@ -374,7 +375,7 @@
</div> </div>
<div <div
style="text-align: right; margin: 20px 0 10px 0" style="text-align: right; margin: 20px 0 10px 0"
v-if="title != '新建关系元素'" v-if="title != '新建元素关系'"
> >
<el-button type="primary" size="mini" @click="openDicyDialog" <el-button type="primary" size="mini" @click="openDicyDialog"
>新增</el-button >新增</el-button
...@@ -385,7 +386,7 @@ ...@@ -385,7 +386,7 @@
:data="tableData2" :data="tableData2"
stripe stripe
border border
v-if="title != '新建关系元素'" v-if="title != '新建元素关系'"
> >
<el-table-column <el-table-column
type="index" type="index"
...@@ -733,6 +734,9 @@ export default { ...@@ -733,6 +734,9 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
indexMethod(index) {
return (this.params.current - 1) * this.params.pageSize + index + 1
},
queryAllKey() { queryAllKey() {
//查询控件右边的下拉框值 //查询控件右边的下拉框值
gAllDictKey().then((res) => { gAllDictKey().then((res) => {
...@@ -942,14 +946,14 @@ export default { ...@@ -942,14 +946,14 @@ export default {
this.openType = type this.openType = type
if (type == 'add') { if (type == 'add') {
this.add_dialog = true this.add_dialog = true
this.title = '新建关系元素' this.title = '新建元素关系'
this.resetForm() this.resetForm()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.relaForm.resetFields() this.$refs.relaForm.resetFields()
}) })
} else if (type == 'edit') { } else if (type == 'edit') {
this.add_dialog = true this.add_dialog = true
this.title = '编辑关系元素' this.title = '编辑元素关系'
this.formData = item this.formData = item
this.getDicyTable() this.getDicyTable()
} else if (type == 'view') { } else if (type == 'view') {
...@@ -1164,7 +1168,7 @@ export default { ...@@ -1164,7 +1168,7 @@ export default {
}, },
// 对话表格操作 // 对话表格操作
operateDia(type) { operateDia(type, index) {
switch (type) { switch (type) {
// 添加 // 添加
case 'add': case 'add':
...@@ -1176,7 +1180,7 @@ export default { ...@@ -1176,7 +1180,7 @@ export default {
break break
// 删除 // 删除
case 'del': case 'del':
this.formData.arrList.splice(this.formData.arrList.length - 1, 1) this.formData.arrList.splice(index, 1)
break break
} }
}, },
...@@ -1323,8 +1327,8 @@ export default { ...@@ -1323,8 +1327,8 @@ export default {
.search_btn { .search_btn {
width: 100%; width: 100%;
display: flex; display: flex;
margin-top: 50px; margin-top: 14px;
margin-bottom: 20px; margin-bottom: 14px;
} }
.add_btn { .add_btn {
display: flex; display: flex;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<script> <script>
import ListPage from '@/components/ListPage.vue' import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue' import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue' import TableConfig from '@/views/collectDataConfiguration/TableConfig.vue'
import AddTabelList from './AddTabelList.vue' import AddTabelList from './AddTabelList.vue'
import { artPolicyExamine, examineSearch } from '@/api/architectureInspection' import { artPolicyExamine, examineSearch } from '@/api/architectureInspection'
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<script> <script>
import Form from './Form.vue' import Form from './Form.vue'
import TableConfig from '@/components/TableConfig.vue' import TableConfig from './TableConfig.vue'
import AddTabelList from './AddTabelList.vue' import AddTabelList from './AddTabelList.vue'
import { materialTypeList } from '@/utils/architectureInspectionDis' import { materialTypeList } from '@/utils/architectureInspectionDis'
...@@ -102,13 +102,13 @@ export default { ...@@ -102,13 +102,13 @@ export default {
prop: 'supervName', // 字段名 prop: 'supervName', // 字段名
element: 'el-input', // 指定elementui组件 element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性 placeholder: '请输入内容', // elementui组件属性
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }], rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
{ {
label: '收集材料类型', // label文字 label: '收集材料类型', // label文字
prop: 'materialType', // 字段名 prop: 'materialType', // 字段名
__slotName: 'materialType', __slotName: 'materialType',
// rules: [{ required: true, trigger: 'change', message: '不能为空' }], // rules: [{ required: true, trigger: 'change', message: '不能为空' }],
}, },
{ {
label: '开始时间', // label文字 label: '开始时间', // label文字
...@@ -118,6 +118,7 @@ export default { ...@@ -118,6 +118,7 @@ export default {
element: 'el-date-picker', // 指定elementui组件 element: 'el-date-picker', // 指定elementui组件
initValue: new Date().format('yyyy-MM-dd'), // 字段初始值 initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
}, },
{ {
label: '截止时间', // label文字 label: '截止时间', // label文字
...@@ -127,12 +128,13 @@ export default { ...@@ -127,12 +128,13 @@ export default {
element: 'el-date-picker', // 指定elementui组件 element: 'el-date-picker', // 指定elementui组件
initValue: new Date().format('yyyy-MM-dd'), // 字段初始值 initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
}, },
{ {
label: '督查清单', // label文字 label: '督查清单', // label文字
prop: 'supervision', // 字段名 prop: 'supervision', // 字段名
__slotName: 'supervision', __slotName: 'supervision',
// rules: [{ required: true, trigger: 'change', message: '不能为空' }], // rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
{ {
label: '备注', // label文字 label: '备注', // label文字
...@@ -221,10 +223,13 @@ export default { ...@@ -221,10 +223,13 @@ export default {
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
this.formOptions.forEach((v) => { this.formOptions.forEach((v) => {
if (v.prop === 'createTime' || v.prop === 'endTime' ) { if (v.prop === 'createTime' || v.prop === 'endTime') {
v.initValue = new Date().format('yyyy-MM-dd') v.initValue = new Date().format('yyyy-MM-dd')
} } else {
v.initValue = ''
}
}) })
this.formInfo.materialType = []
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset() this.$refs['addForm'].onReset()
}, },
...@@ -246,8 +251,8 @@ export default { ...@@ -246,8 +251,8 @@ export default {
}) })
} else { } else {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['addForm'].onReset()
this.$refs['addForm'].addInitValue() this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
this.formInfo.materialType = [] this.formInfo.materialType = []
}) })
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</template> </template>
<script> <script>
import SearchFormItem from '@/components/SearchFormItem.vue' import SearchFormItem from './SearchFormItem.vue'
export default { export default {
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
onValidate(callback) { onValidate(callback) {
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
console.log(this.formData) // console.log(this.formData)
callback() callback()
} }
}) })
......
<!--
* @Description: 表单匹配项
* @Version: 2.0
* @Autor: pan
* @Date: 2024-03-12 15:11:47
* @LastEditors: pan
* @LastEditTime: 2024-04-01 17:08:42
-->
<template>
<div class="form-item">
<el-input
v-if="isInput"
v-no-backslash
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
clearable
:placeholder="itemOptions.placeholder"
></el-input>
<el-input-number
v-if="isInputNumber"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
:controls-position="itemOptions['controls-position'] || 'right'"
></el-input-number>
<el-select
v-if="isSelect"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
clearable
>
<el-option
v-for="item in itemOptions.options"
:key="item[handleSelectValue]"
:label="item[handleSelectLabel]"
:value="item[handleSelectValue]"
></el-option>
</el-select>
<el-radio-group
v-if="isRadio"
v-bind="bindProps"
v-on="bindEvents"
v-model="currentVal"
>
<el-radio
v-for="item in itemOptions.options"
:key="item.value"
:label="item.value"
>{{ item.label }}</el-radio
>
</el-radio-group>
<el-rate
v-if="isRate"
v-bind="bindProps"
v-on="bindEvents"
v-model="currentVal"
></el-rate>
<!-- datetimerange/daterange -->
<!-- <el-date-picker
v-if="isDatePickerDateRange"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
:type="itemOptions.type || 'datetimerange'"
clearable
:picker-options="pickerOptionsRange"
start-placeholder="开始日期"
range-separator="至"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker> -->
<!-- monthrange -->
<!-- <el-date-picker
v-if="isDatePickerMonthRange"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
:type="itemOptions.type"
clearable
:picker-options="pickerOptionsRangeMonth"
start-placeholder="开始日期"
range-separator="至"
end-placeholder="结束日期"
value-format="yyyy-MM"
></el-date-picker> -->
<!-- other -->
<el-date-picker
v-if="isDatePickerOthers"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
:type="itemOptions.type"
clearable
placeholder="请选择日期"
></el-date-picker>
<el-cascader
v-if="isCascader"
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
size="mini"
clearable
></el-cascader>
</div>
</template>
<script>
import { getDianXingAnLiSelectData } from '@/api/index.js'
export default {
inheritAttrs: false,
props: {
value: {},
itemOptions: {
type: Object,
default() {
return {}
},
},
},
data() {
return {
// pickerOptionsRange: tools.pickerOptionsRange,
// pickerOptionsRangeMonth: tools.pickerOptionsRangeMonth,
}
},
computed: {
handleSelectValue() {
if (this.itemOptions.keyOption) {
return this.itemOptions.keyOption['value']
}
return 'value'
},
handleSelectLabel() {
if (this.itemOptions.keyOption) {
return this.itemOptions.keyOption['label']
}
return 'label'
},
// 双向绑定数据值
currentVal: {
get() {
if (this.isSelect) {
if(this.value == 0){
return this.value + ''
}else{
return this.value && this.value + ''
}
} else {
return this.value
}
},
set(val) {
this.$emit('input', val)
},
},
// 绑定属性
bindProps() {
let obj = { ...this.itemOptions }
// 移除冗余属性
delete obj.label
delete obj.prop
delete obj.element
delete obj.initValue
delete obj.rules
delete obj.events
if (obj.element === 'el-select') {
delete obj.options
}
return obj
},
// 绑定方法
bindEvents() {
return this.itemOptions.events || {}
},
// el-input
isInput() {
return this.itemOptions.element === 'el-input'
},
// el-input-number
isInputNumber() {
return this.itemOptions.element === 'el-input-number'
},
// el-select
isSelect() {
return this.itemOptions.element === 'el-select'
},
// el-radio
isRadio() {
return this.itemOptions.element === 'el-radio'
},
// el-rate
isRate() {
return this.itemOptions.element === 'el-rate'
},
// el-date-picker (type: datetimerange/daterange)
isDatePickerDateRange() {
const isDatePicker = this.itemOptions.element === 'el-date-picker'
const isDateRange =
!this.itemOptions.type ||
this.itemOptions.type === 'datetimerange' ||
this.itemOptions.type === 'daterange'
return isDatePicker && isDateRange
},
// el-date-picker (type: monthrange)
isDatePickerMonthRange() {
const isDatePicker = this.itemOptions.element === 'el-date-picker'
const isMonthRange = this.itemOptions.type === 'monthrange'
return isDatePicker && isMonthRange
},
// el-date-picker (type: other)
isDatePickerOthers() {
const isDatePicker = this.itemOptions.element === 'el-date-picker'
return (
isDatePicker &&
!this.isDatePickerDateRange &&
!this.isDatePickerMonthRange
)
},
// el-cascader
isCascader() {
return this.itemOptions.element === 'el-cascader'
},
},
created() {
// 字典下拉框处理
if (this.isSelect && this.itemOptions.dictType) {
this.getDictTypeOptions(this.itemOptions.dictType)
}
},
methods: {
/**
* @description: 获取下拉框字典,并缓存
* @param {String} key 对应字典接口的参数值
* @author: pan
*/
async getDictTypeOptions(key) {
var dictTypeOptions = []
var storedDic = localStorage.getItem('dic_' + key)
if (storedDic) {
dictTypeOptions = JSON.parse(storedDic)
} else {
const params = { key }
const res = await getDianXingAnLiSelectData(params)
if (res.code !== 200) return
dictTypeOptions = res.data
const jsonStr = JSON.stringify(res.data)
localStorage.setItem('dic_' + key, jsonStr)
}
this.itemOptions.options = dictTypeOptions
this.$forceUpdate()
},
},
components: {},
}
</script>
<style lang="scss" scoped></style>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
> >
</el-table-column> --> </el-table-column> -->
<template v-for="item in columns"> <template v-for="(item, index) in columns">
<!-- v-html存在安全问题暂时弃用 --> <!-- v-html存在安全问题暂时弃用 -->
<!-- 如果接口返回的内容需要我们解析出来并渲染到页面中 比如:0 代表 已停用 1 代表 已发布 2 代表 暂存 --> <!-- 如果接口返回的内容需要我们解析出来并渲染到页面中 比如:0 代表 已停用 1 代表 已发布 2 代表 暂存 -->
<!-- <el-table-column <!-- <el-table-column
...@@ -61,9 +61,17 @@ ...@@ -61,9 +61,17 @@
<span v-html="item.callback && item.callback(scope.row)"></span> <span v-html="item.callback && item.callback(scope.row)"></span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column
v-if="item.type === 'index'"
v-bind="item"
align="center"
:key="index"
:index="indexMethod"
>
</el-table-column>
<!-- 操作列 --> <!-- 操作列 -->
<el-table-column <el-table-column
v-if="item.type === 'operation'" v-else-if="item.type === 'operation'"
:key="item.prop" :key="item.prop"
v-bind="item" v-bind="item"
align="center" align="center"
...@@ -79,8 +87,11 @@ ...@@ -79,8 +87,11 @@
? items.disabledCallback(scope.row, items.title) ? items.disabledCallback(scope.row, items.title)
: false : false
" "
@click="item.callback(scope.row, items.title)" @click="item.callback(scope.row, items.title ? items.title : 'titleChange')"
><span v-if="!items.circle">{{ items.title }}</span></el-button >
<span v-if="items.titleChange">{{items.titleChange(scope.row, items.title)}}</span>
<span v-else-if="!items.circle">{{ items.title }}</span>
</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -214,28 +225,33 @@ export default { ...@@ -214,28 +225,33 @@ export default {
this.queryData() this.queryData()
}, },
methods: { methods: {
indexMethod(index) {
return (
(this.pagination.current - 1) * this.pagination.pageSize + index + 1
)
},
clearSelection() { clearSelection() {
this.$refs.tableConfig.clearSelection() this.$refs.tableConfig.clearSelection()
}, },
handleToText(item, state='') { handleToText(item, state='') {
if(!state) return if(!state && typeof state != 'number') return
if(state.indexOf(',') > -1){ if(typeof state != 'number' && state.indexOf(',') > -1){
let stateVal = state.split(',') let stateVal = state.split(',')
let labelValue = '' let labelValue = ''
stateVal.forEach(valItem => { stateVal.forEach(valItem => {
const arr = item.options.find((v) => v.value == valItem) || {} const arr = item.options.find((v) => v.value == valItem) || {}
labelValue += `,${arr.label}` labelValue += `,${arr.label}`
}); });
return labelValue.slice(1, labelValue.length) return labelValue.slice(1, labelValue.length)
}{ }{
let val = state let val = state
// if (!val) { // if (!val) {
// val = item.emptyToNum || 0 // val = item.emptyToNum || 0
// } // }
// let obj = item.options.find(item => item.value == val) // let obj = item.options.find(item => item.value == val)
const obj = item.options.find((v) => v.value == val) || {} const obj = item.options.find((v) => v.value == val) || {}
return obj['label'] return obj['label']
} }
}, },
/** /**
* 切换分页数量 * 切换分页数量
...@@ -288,9 +304,14 @@ export default { ...@@ -288,9 +304,14 @@ export default {
if(result.data){ if(result.data){
const { data } = result const { data } = result
if (result && result.code === 200) { if (result && result.code === 200) {
this.pagination.totalRow = data.total if(data instanceof Array){
this.tableData = data.records // this.pagination.totalRow = data.total
this.$emit('fetchData', data) this.tableData = data
}else{
this.pagination.totalRow = data.total
this.tableData = data.records
}
this.$emit('fetchData', data)
} else { } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
......
...@@ -92,9 +92,9 @@ export default { ...@@ -92,9 +92,9 @@ export default {
size: 'mini', size: 'mini',
plain: true, plain: true,
icon: 'el-icon-edit', icon: 'el-icon-edit',
// disabledCallback: (row, title) => { disabledCallback: (row, title) => {
// return row.state == '1' ? true : false return row.state == '1' ? true : false
// }, },
}, },
{ {
title: '删除', title: '删除',
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
* @author: pan * @author: pan
*/ */
fnOperation(row, title) { fnOperation(row, title) {
console.log('1111');
switch (title) { switch (title) {
case '编辑': case '编辑':
this.fnEdit(row) this.fnEdit(row)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-21 20:58:31 * @Date: 2024-03-21 20:58:31
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-27 11:25:47 * @LastEditTime: 2024-04-01 11:33:12
--> -->
<template> <template>
<div class="searchTable"> <div class="searchTable">
...@@ -71,7 +71,7 @@ import SearchForm from '@/components/SearchForm.vue' ...@@ -71,7 +71,7 @@ import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue' import TableConfig from '@/components/TableConfig.vue'
import { queryQyNeedReviewCount, queryArcAstSys } from '@/api/interface' import { queryQyNeedReviewCount, queryArcAstSys } from '@/api/interface'
import { systemArchiSaveFactor } from '@/api/index' import { systemArchiSaveFactor, archiIntelligenceSearchTree } from '@/api/index'
export default { export default {
name: 'conceptualRelated', name: 'conceptualRelated',
data() { data() {
...@@ -207,16 +207,24 @@ export default { ...@@ -207,16 +207,24 @@ export default {
return arr return arr
}, },
}, },
created() {
this.getElementTreeData()
},
methods: { methods: {
// 同步更新 // 同步更新
fnOperation(row) { fnOperation(row) {
// const extend = [] let extend = []
// extend.push({ this.elementTree.forEach((item) => {
// archiType: item.archiType, if (item.checkedCities.length > 0) {
// assetIdList: item.checkedCities extend.push({
// }) archiType: item.archiType,
assetIdList: item.checkedCities,
})
}
})
const params = { const params = {
// extend, // ...row,
extend,
isExtend: 0, isExtend: 0,
} }
systemArchiSaveFactor(params).then((res) => { systemArchiSaveFactor(params).then((res) => {
...@@ -227,6 +235,19 @@ export default { ...@@ -227,6 +235,19 @@ export default {
} }
}) })
}, },
getElementTreeData(type) {
//查询选择遵从总体架构资产类型数据
archiIntelligenceSearchTree({}).then((res) => {
if (res.code == 200) {
res.data.map((item) => {
item['isIndeterminate'] = false
item['checkAll'] = false
item['checkedCities'] = []
})
this.elementTree = res.data
}
})
},
handlePercent(scope) { handlePercent(scope) {
const item = scope.row const item = scope.row
if (item.reviewPassCount && item.needCount) { if (item.reviewPassCount && item.needCount) {
......
...@@ -136,6 +136,7 @@ export default { ...@@ -136,6 +136,7 @@ export default {
} else { } else {
const params = { key } const params = { key }
const res = await getDianXingAnLiSelectData(params) const res = await getDianXingAnLiSelectData(params)
if (res.code !== 200 || !res.data.length) return
dictTypeOptions = res.data dictTypeOptions = res.data
const jsonStr = JSON.stringify(res.data) const jsonStr = JSON.stringify(res.data)
if (jsonStr) { if (jsonStr) {
......
<template>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="40%"
@close="handleClose()"
@open="handleOpen"
>
<Form
ref="addForm"
:form-options="formOptions"
label-width="120px"
id="addForm"
>
</Form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit" size="mini" >保 存</el-button >
<el-button @click="handleClose()" size="mini">取 消</el-button>
</span>
</el-dialog>
</template>
<script>
import Form from '@/views/collectDataConfiguration/Form.vue'
import { collectDataConfiguration } from '@/api/architectureInspection'
import { delFlag } from '@/utils/architectureInspectionDis'
export default {
components: { Form },
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
data() {
return {
query: {
url: collectDataConfiguration,
method: 'post',
queryParam: {},
},
}
},
computed: {
formOptions() {
return [
{
label: '字典名称', // label文字
prop: 'name', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '字典标识', // label文字
prop: 'typeValue', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '启用状态', // label文字
prop: 'delFlag', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: delFlag,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '排序', // label文字
prop: 'sort', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写排序(默认请填0)', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '描述', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
methods: {
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const formInfo = this.$refs['addForm'].getData()
let params = Object.keys(this.rowData).length ? {
...this.rowData,
...formInfo,
} : {
...formInfo,
}
let url = Object.keys(this.rowData).length ? '/dict/update' : '/dict/create' // 编辑
this.$postRequestShared(url, params).then(res => {
if (res.code === 200) {
loading.close()
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
v.initValue = ''
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop]
})
// console.log(this.rowData);
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
}
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
/deep/ #addForm {
.el-select, .el-input{
width: 60% !important;
>.el-input{
width: 100% !important;
}
}
}
</style>
\ No newline at end of file
<template>
<el-dialog
:title="title"
:visible.sync="showDialog"
width="40%"
@close="handleClose()"
@open="handleOpen"
>
<Form
ref="addForm"
:form-options="formOptions"
label-width="120px"
id="addForm"
>
</Form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit" size="mini" >保 存</el-button >
<el-button @click="handleClose()" size="mini">取 消</el-button>
</span>
</el-dialog>
</template>
<script>
import Form from '@/views/collectDataConfiguration/Form.vue'
import { collectDataConfiguration } from '@/api/architectureInspection'
import { flag } from '@/utils/architectureInspectionDis'
export default {
components: { Form },
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
dictId: {
type: Number,
default: 0,
}
},
data() {
return {
query: {
url: collectDataConfiguration,
method: 'post',
queryParam: {},
},
}
},
computed: {
formOptions() {
return [
{
label: '字典值', // label文字
prop: 'value', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '字典值描述', // label文字
prop: 'label', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '等级', // label文字
prop: 'grade', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '排序', // label文字
prop: 'sort', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写排序(默认请填0)', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '启用状态', // label文字
prop: 'flag', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: flag,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '描述', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
methods: {
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const formInfo = this.$refs['addForm'].getData()
let params = Object.keys(this.rowData).length ? {
...this.rowData,
...formInfo,
dictId: this.dictId
} : {
...formInfo,
dictId: this.dictId
}
let url = Object.keys(this.rowData).length ? '/dictDetail/update' : '/dictDetail/create'
this.$postRequestShared(url, params).then(res => {
if (res.code === 200) {
loading.close()
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
v.initValue = ''
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop]
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
}
}
</script>
<style scoped lang="scss">
// @import '@/styles/elementui.scss';
/deep/ #addForm {
.el-select, .el-input{
width: 60% !important;
>.el-input{
width: 100% !important;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
<el-dialog
:title="'维护'"
:visible.sync="showDialog"
width="90%"
@close="showDialog = false"
@open="handleOpen"
>
<div class="searchTable">
<list-page>
<!-- 查询表单插槽 -->
<template #formWrap>
<SearchForm ref="searchForm" @onSearch="querySearch" :form-options="formOptions" />
</template>
<!-- 中部操作按钮 -->
<template #operationWrap>
<el-button type="primary" icon="el-icon-document-add" size="medium" plain @click="fnAdd">新建</el-button >
</template>
<!-- 表格插槽 -->
<template #tableWrap>
<table-config
ref="searchTable"
:query="query"
:columns="columns"
id-key="elementId"
:hasPagination='false'
>
</table-config>
</template>
</list-page>
</div>
</el-dialog>
<AddMaintenance
@querySearch="querySearch"
:visible.sync="addVisible"
:row-data="addRowData"
:title="dialogTitle"
:dictId='rowData.id'
/>
</div>
</template>
<script>
import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/views/collectDataConfiguration/TableConfig.vue'
import { dictionaryMaintenanceSearch } from '@/api/architectureInspection'
import { flag } from '@/utils/architectureInspectionDis'
import AddMaintenance from './AddMaintenance.vue'
export default {
name: 'Maintenance',
components: { ListPage, SearchForm, TableConfig, AddMaintenance },
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
computed: {
formOptions() {
return [
{
label: '字典描述', // label文字
prop: 'label', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '启用状态', // label文字
prop: 'flag', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: flag,
},
]
},
columns() {
return [
{ label: '序号', type: 'index', width: '80px' },
{ label: '字典描述', prop: 'label'},
{ label: '字典值', prop: 'value', width: '150px',},
{ label: '等级', prop: 'grade', width: '150px' },
{ label: '排序', prop: 'sort', width: '80px' },
{ label: '启用状态', prop: 'flag', width: '120px', collectionType: 'flag',
options: flag, },
{ label: '描述', prop: 'remark' },
{
label: '操作',
type: 'operation',
width: '360px',
actionButtons: [
{
title: '编辑',
type: 'primary',
size: 'mini',
plain: true,
icon: 'el-icon-edit',
// disabledCallback: (row, title) => {
// return row.state == '1' ? true : false
// },
},
{
title: '',
titleChange: (row) => {
return row.flag == 0 ? '禁用' : '启用'
},
size: 'mini',
icon: 'el-icon-chat-dot-round',
type: 'primary',
plain: true,
// disabledCallback: (row, title) => {
// return row.state == '1' ? true : false
// },
},
],
callback: (row, title) => {
this.fnOperation(row, title)
},
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
data(){
return {
query: {
url: dictionaryMaintenanceSearch,
method: 'post',
queryParam: {},
},
addVisible: false,
addRowData: {},
dialogTitle: '',
}
},
methods: {
querySearch(data) {
this.query.queryParam = {
...this.query.queryParam,
...data,
}
this.$refs.searchTable.queryData()
},
fnAdd() {
this.addVisible = true
this.addRowData = {}
this.dialogTitle = '数据字典详情新建'
},
fnOperation(row, title) {
switch (title) {
case '编辑':
this.fnEdit(row)
break
break
case 'titleChange':
this.fnEnable(row)
default:
break
}
},
fnEdit(row) {
this.dialogTitle = '数据字典详情修改'
this.addRowData = row
this.addVisible = true
},
fnEnable(row){
let title = row.flag ? '启用' : '禁用'
this.$confirm('是否确认?' + title, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.$postRequestShared('/dictDetail/delete', {id: row.id}).then(res => {
if (res.code === 200) {
this.$message.success(title + '成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error(title + '失败')
}
})
})
.catch(() => {})
},
handleOpen() {
this.$nextTick(() => {
this.$refs.searchForm.addInitValue()
this.$refs.searchForm.onReset()
})
this.query.queryParam.dictId = this.rowData.id
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/elementui.scss';
::v-deep .searchTable{
.tableConfig{
height: 32vh !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="searchTable">
<list-page>
<!-- 查询表单插槽 -->
<template #formWrap>
<SearchForm @onSearch="querySearch" :form-options="formOptions" />
</template>
<!-- 中部操作按钮 -->
<template #operationWrap>
<el-button type="primary" icon="el-icon-document-add" size="medium" plain @click="fnAdd">新建</el-button >
</template>
<!-- 表格插槽 -->
<template #tableWrap>
<table-config
ref="searchTable"
:query="query"
:columns="columns"
id-key="elementId"
>
</table-config>
</template>
</list-page>
<Add
@querySearch="querySearch"
:visible.sync="visible"
:row-data="rowData"
:title="dialogTitle"
></Add>
<!-- <Detail ref="Detail" :prjCodeDetail='detailPrjCode' :visible.sync="visibleDetail" @selectTabel='selectTabel' :title="detailTitle"/> -->
<Maintenance :row-data="rowData" @querySearch="querySearch" :visible.sync="maintenanceVisible"/>
</div>
</template>
<script>
import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/views/collectDataConfiguration/TableConfig.vue'
import { dictionarySearch } from '@/api/architectureInspection'
import { delFlag } from '@/utils/architectureInspectionDis'
import Add from './Add.vue'
import Maintenance from './Maintenance.vue'
export default {
name: 'dictionaryManagement',
components: { ListPage, SearchForm, TableConfig, Add, Maintenance },
computed: {
formOptions() {
return [
{
label: '字典名称', // label文字
prop: 'name', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '字典标识', // label文字
prop: 'typeValue', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '启用状态', // label文字
prop: 'delFlag', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: delFlag,
},
]
},
columns() {
return [
{ label: '序号', type: 'index', width: '80px' },
{ label: '字典名称', prop: 'name', width: '150px',},
{ label: '字典标识', prop: 'typeValue', width: '150px',},
{ label: '描述', prop: 'remark', width: '150px' },
{ label: '排序', prop: 'sort', width: '80px' },
{ label: '启用状态', prop: 'delFlag', width: '120px', collectionType: 'delFlag',
options: delFlag, },
{ label: '创建日期', prop: 'createTime', width: '120px' },
{ label: '创建人', prop: 'createMan', },
{ label: '最终修改时间', prop: 'lastUpdateTime', },
{ label: '最终修改人', prop: 'lastUpdateMan', },
{
label: '操作',
type: 'operation',
width: '360px',
actionButtons: [
{
title: '编辑',
type: 'primary',
size: 'mini',
plain: true,
icon: 'el-icon-edit',
// disabledCallback: (row, title) => {
// return row.state == '1' ? true : false
// },
},
{
title: '维护',
size: 'mini',
type: 'primary',
plain: true,
icon: 'el-icon-data-analysis',
// disabledCallback: (row, title) => {
// return row.state == '1' ? true : false
// },
},
{
title: '',
titleChange: (row) => {
return row.delFlag == 0 ? '禁用' : '启用'
},
size: 'mini',
icon: 'el-icon-chat-dot-round',
type: 'primary',
plain: true,
},
],
callback: (row, title) => {
this.fnOperation(row, title)
},
},
]
},
},
data(){
return {
query: {
url: dictionarySearch,
method: 'post',
queryParam: { },
},
visible: false, // 新增 修改
rowData: {},
dialogTitle: '',
maintenanceVisible: false, // 维护
}
},
methods: {
querySearch(data) {
this.query.queryParam = {
...this.query.queryParam,
...data,
}
this.$refs.searchTable.queryData()
},
fnAdd() {
this.visible = true
this.rowData = {}
this.dialogTitle = '新建'
},
fnOperation(row, title) {
switch (title) {
case '编辑':
this.fnEdit(row)
break
case '维护':
this.fnMaintenance(row)
break
case 'titleChange':
this.fnDisabled(row)
default:
break
}
},
fnEdit(row) {
this.dialogTitle = '修改'
this.rowData = row
this.visible = true
},
fnMaintenance(row){
this.maintenanceVisible = true
this.rowData = row
},
fnDisabled(row){
let title = row.delFlag == 1 ? '启用' : '禁用'
this.$confirm(`是否确认${title}?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.$postRequestShared('/dict/delete', {id: row.id}).then(res => {
if (res.code === 200) {
this.$message.success( title + '成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error(title + '失败')
}
})
})
.catch(() => {})
},
}
}
</script>
<style>
</style>
\ No newline at end of file
<!--
* @Description: 新增专家弹窗
* @Version: 2.0
* @Autor: pan
* @Date: 2024-04-01 14:39:48
* @LastEditors: pan
* @LastEditTime: 2024-04-02 13:55:25
-->
<template>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@close="handleClose()"
@open="handleOpen()"
>
<div>
<Form ref="addForm" :form-options="formOptions" label-width="120px">
<template #talentPoolName="{ formData }">
<el-select
v-model="formData.talentPoolName"
placeholder="请选择"
clearable
class="w-100"
>
<el-input placeholder="请输入内容" v-model="addTalentPoolName">
<div slot="append" @click="fnAddTalentPoolName()">新增</div>
</el-input>
<el-option
v-for="(item, idnex) in talentPoolNameOptions"
:key="idnex"
:label="item.label"
:value="item.label"
></el-option>
</el-select>
</template>
</Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleSubmit" size="mini"
>确 定</el-button
>
</span></el-dialog
>
</template>
<script>
import Form from '@/components/Form.vue'
import {
getETPManagePoolName,
getETPManageAdd,
getETPManageUpdate,
getETPManagePoolNameAdd,
} from '@/api'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
data() {
return {
talentPoolNameOptions: [],
addTalentPoolName: '',
}
},
components: {
Form,
},
computed: {
formOptions() {
return [
{
label: '单位', // label文字
prop: 'deptId', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
dictType: 'sys_org',
filterable: true,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '所属专家库', // label文字
prop: 'talentPoolName', // 字段名
// element: 'el-select', // 指定elementui组件
// placeholder: '请输入内容', // elementui组件属性
// options: this.talentPoolNameOptions,
// filterable: true,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
__slotName: 'talentPoolName',
},
{
label: '专家姓名', // label文字
prop: 'talentName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '性别', // label文字
prop: 'sex', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_sex',
},
{
label: '出生年月', // label文字
prop: 'birthday', // 字段名
type: 'date',
valueFormat: 'yyyy-MM-dd',
element: 'el-date-picker', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
},
{
label: '学历', // label文字
prop: 'education', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_education',
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '联系方式', // label文字
prop: 'telephone', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '邮箱', // label文字
prop: 'email', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '专家领域', // label文字
prop: 'professionalField', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_professional_field',
multiple: true,
initValue: [],
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '专家级别', // label文字
prop: 'level', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'talent_level',
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '成果简介', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
isEdit() {
if (this.title === '修改专家信息') {
return true
} else {
return false
}
},
},
methods: {
fnAddTalentPoolName() {
//新增专家库名称
const params = {
talentPoolName: this.addTalentPoolName,
}
this.$refs['addForm'].$refs['formRef'].clearValidate('talentPoolName')
getETPManagePoolNameAdd(params).then((res) => {
if (res.code == 200) {
this.$message.success('新增成功!')
this.addTalentPoolName = ''
this.fnGetETPManagePoolName()
}
})
},
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const typeApi = this.isEdit ? getETPManageUpdate : getETPManageAdd
const formInfo = this.$refs['addForm'].getData()
const params = {
...this.rowData,
...formInfo,
professionalField: formInfo.professionalField.join(','),
}
typeApi(params).then((res) => {
loading.close()
if (res.code === 200) {
this.$message.success('保存成功')
this.showDialog = false
// this.handleClose()
this.$emit('querySearch')
} else {
this.$message.error(res.msg)
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if (v.prop === 'professionalField') {
v.initValue = []
} else {
v.initValue = undefined
}
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
fnGetETPManagePoolName() {
getETPManagePoolName().then((res) => {
if (res.code == 200) {
this.talentPoolNameOptions = res.data.map((v) => {
return {
label: v.talentPoolName,
value: v.talentPoolName,
}
})
}
})
},
async handleOpen() {
this.fnGetETPManagePoolName()
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
if (v.prop === 'professionalField') {
v.initValue = this.rowData[v.prop]?.split(',')
} else {
v.initValue = this.rowData[v.prop]
}
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
@import '@/styles/common.scss';
/deep/ .el-input-group__append {
background-color: #0d867f;
color: #fff;
cursor: pointer;
}
</style>
<!--
* @Description: 新增人才弹窗
* @Version: 2.0
* @Autor: pan
* @Date: 2024-04-01 14:38:41
* @LastEditors: pan
* @LastEditTime: 2024-04-02 13:55:40
-->
<template>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@close="handleClose()"
@open="handleOpen()"
>
<div>
<Form ref="addForm" :form-options="formOptions" label-width="120px">
</Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleSubmit" size="mini"
>确 定</el-button
>
</span></el-dialog
>
</template>
<script>
import Form from '@/components/Form.vue'
import { addKlPerson, updKlPerson } from '@/api'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
data() {
return {}
},
components: {
Form,
},
computed: {
formOptions() {
return [
{
label: '单位', // label文字
prop: 'deptId', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
dictType: 'sys_org',
filterable: true,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '姓名', // label文字
prop: 'talentName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '性别', // label文字
prop: 'sex', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_sex',
},
{
label: '出生年月', // label文字
prop: 'birthday', // 字段名
type: 'date',
valueFormat: 'yyyy-MM-dd',
element: 'el-date-picker', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
},
{
label: '学历', // label文字
prop: 'education', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_education',
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '联系方式', // label文字
prop: 'telephone', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '邮箱', // label文字
prop: 'email', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
},
{
label: '专业领域', // label文字
prop: 'professionalField', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
dictType: 'sys_professional_field',
multiple: true,
initValue: [],
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '成果简介', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
isEdit() {
if (this.title === '修改人才信息') {
return true
} else {
return false
}
},
},
methods: {
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const typeApi = this.isEdit ? updKlPerson : addKlPerson
const formInfo = this.$refs['addForm'].getData()
const params = {
...this.rowData,
...formInfo,
type: 1,
professionalField: formInfo.professionalField.join(','),
}
typeApi(params).then((res) => {
loading.close()
if (res.code === 200) {
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
} else {
this.$message.error(res.msg)
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if (v.prop === 'professionalField') {
v.initValue = []
} else {
v.initValue = undefined
}
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
async handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
if (v.prop === 'professionalField') {
v.initValue = this.rowData[v.prop]?.split(',')
} else {
v.initValue = this.rowData[v.prop]
}
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
</style>
<!--
* @Description: 元模型管理详情, 图例
* @Version: 2.0
* @Autor: pan
* @Date: 2024-04-02 17:10:55
* @LastEditors: pan
* @LastEditTime: 2024-04-03 09:28:23
-->
<template>
<div class="legend flex">
<span class="m-r-20">图例:</span>
<div class="flex-c" v-for="(item, idx) in items" :key="idx">
<span
class="icon m-r-6 m-l-10"
:style="{ backgroundColor: item.color }"
></span>
<span class="name">{{ item.name }}</span>
</div>
<div class="flex-c m-r-10">
<svg
t="1712105996408"
viewBox="0 0 3736 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="8364"
width="16"
height="16"
>
<path
d="M0 595.324463h2706.21085l-182.370522 428.675537 1212.65916-511.475947L2523.840328 0l182.370522 428.675537H0v166.648926z"
p-id="8365"
></path>
</svg>
<span class="name">元素间关系</span>
</div>
<div class="flex-c m-r-10">
<svg
t="1712106373997"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="9722"
width="16"
height="16"
>
<path d="M0 0h1024v1024H0z" fill-opacity="0" p-id="9723"></path>
<path
d="M888 318.464l-9.856-17.984a439.424 439.424 0 0 0-385.152-228.416A440.448 440.448 0 0 0 53.056 512a440.32 440.32 0 0 0 439.936 439.936 441.472 441.472 0 0 0 419.264-307.712h-66.112a377.984 377.984 0 0 1-353.152 245.184c-208.064 0-377.408-169.344-377.408-377.408s169.344-377.344 377.408-377.344a375.424 375.424 0 0 1 348.544 235.904l8.384 20.736"
fill="#323333"
p-id="9724"
></path>
<path
d="M603.52 268.288l-19.136 61.056 328.064 102.784 58.496-305.152-62.912-12.032-44.928 234.624z"
fill="#333333"
p-id="9725"
></path>
</svg>
<span class="name">元素自嵌套关系</span>
</div>
<div class="flex-c m-r-10">
<span class="circle"></span>
<span class="name">总体架构元素</span>
</div>
<div class="flex-c m-r-10">
<svg
t="1712107200597"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="15801"
width="18"
height="18"
>
<path
d="M512 70.62069C268.535172 70.62069 70.62069 268.711724 70.62069 512s197.914483 441.37931 441.37931 441.37931 441.37931-197.914483 441.37931-441.37931S755.464828 70.62069 512 70.62069z m361.048276 441.37931c0 65.324138-17.478621 126.411034-47.845517 179.376552l-311.26069-540.248276c198.091034 0.882759 359.106207 162.427586 359.106207 360.871724z m-122.88 183.437241L272.41931 692.082759l236.932414-414.896552 240.816552 418.251034zM504.055172 151.128276L197.208276 688.551724C167.724138 636.292414 150.951724 576.088276 150.951724 512c0-196.325517 157.66069-356.457931 353.103448-360.871724z m7.944828 721.92c-103.635862 0-197.208276-43.961379-263.062069-114.228966l522.769655 3.707587c-65.853793 67.972414-157.837241 110.521379-259.707586 110.521379z"
p-id="15802"
data-spm-anchor-id="a313x.search_index.0.i25.41143a81MFjoUU"
class="selected"
fill="#515151"
></path>
</svg>
<span class="name">同属总体与系统架构的元素</span>
</div>
<div class="flex-c m-r-10">
<svg
t="1712107365396"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="17850"
width="14"
height="14"
>
<path
d="M469.674667 34.816L28.416 956.842667A46.933333 46.933333 0 0 0 70.826667 1024H953.173333a46.933333 46.933333 0 0 0 42.368-67.2L554.325333 34.773333a46.933333 46.933333 0 0 0-84.650666 0zM512 144l380.245333 794.624H131.712L512 144z"
fill="#191919"
p-id="17851"
></path>
</svg>
<span class="name">系统架构元素</span>
</div>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
name: '业务架构元素',
color: '#d2edfd',
},
{
name: '应用架构元素',
color: '#a0ce62',
},
{
name: '数据架构元素',
color: '#fbe8d0',
},
{
name: '技术架构元素',
color: '#e4d3fc',
},
{
name: '安全架构元素',
color: '#fffe55',
},
],
}
},
}
</script>
<style scoped lang="scss">
@import '@/styles/common.scss';
.legend {
border: 1px solid #333;
position: absolute;
left: 240px;
bottom: 10px;
background-color: #f5f5f5;
padding: 20px 16px;
width: calc(100% - 540px);
flex-wrap: wrap;
align-items: center;
font-size: 12px;
.icon {
width: 24px;
height: 20px;
border-radius: 4px;
border: 1px solid #333;
}
.circle {
border: 1px solid #333;
border-radius: 50%;
width: 16px;
height: 16px;
}
}
</style>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<i class="el-icon-picture"></i> <i class="el-icon-picture"></i>
</span> </span>
<Graph></Graph> <Graph></Graph>
<DetailLegend />
</el-tab-pane> </el-tab-pane>
<el-tab-pane> <el-tab-pane>
<span slot="label"> <span slot="label">
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
import Graph from './canvas/index.vue'; import Graph from './canvas/index.vue';
import Tables from './table/index.vue'; import Tables from './table/index.vue';
import Mind from './mind/index.vue'; import Mind from './mind/index.vue';
import DetailLegend from './DetailLegend.vue'
import { MessageBox, Message } from 'element-ui'; import { MessageBox, Message } from 'element-ui';
import { import {
save_drawio_version, save_drawio_version,
...@@ -47,7 +49,8 @@ export default { ...@@ -47,7 +49,8 @@ export default {
components: { components: {
Graph, Graph,
Tables, Tables,
Mind Mind,
DetailLegend
}, },
data() { data() {
return { return {
......
...@@ -306,10 +306,11 @@ export default { ...@@ -306,10 +306,11 @@ export default {
const xmlTitle = res.data.verName; const xmlTitle = res.data.verName;
localStorage.setItem('xmlData', xmlData); localStorage.setItem('xmlData', xmlData);
localStorage.setItem('xmlTitle', xmlTitle); localStorage.setItem('xmlTitle', xmlTitle);
Promise.all([ this.queryDrawioGraph(item.metaModelId), this.queryDrawioGraph2(item.metaModelId) ]).then(res2 => { // this.queryDrawioGraph(item.metaModelId),
localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle })); Promise.all([ this.queryDrawioGraph2(item.metaModelId) ]).then(res2 => {
localStorage.setItem('standardGraph', JSON.stringify({ show: true, graph: res2[1].dataEle })); // localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle }));
localStorage.setItem('joinGraph', JSON.stringify({ state: 1, graph: res2[1].dataEle })); localStorage.setItem('standardGraph', JSON.stringify({ show: true, graph: res2[0].dataEle }));
localStorage.setItem('joinGraph', JSON.stringify({ state: 1, graph: res2[0].dataEle }));
this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}`, () => {}, () => {} ); this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}`, () => {}, () => {} );
}); });
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-28 16:08:56 * @Date: 2024-03-28 16:08:56
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-29 16:06:36 * @LastEditTime: 2024-04-01 15:32:12
--> -->
<template> <template>
<div> <div>
...@@ -25,11 +25,17 @@ ...@@ -25,11 +25,17 @@
<el-row class="m-t-20"> <el-row class="m-t-20">
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">单位</div> <div class="label">单位</div>
<div class="value">{{ detailInfo.manageOrgId }}</div> <div class="value">
{{ codeToName(detailInfo.manageOrgId, 'sysOrgOptions') }}
</div>
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">部门</div> <div class="label">部门</div>
<div class="value">{{ detailInfo.manageDeptId }}</div> <div class="value">
{{
codeToName(detailInfo.manageDeptId, 'sysDeptOptions')
}}
</div>
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">关联系统名称</div> <div class="label">关联系统名称</div>
...@@ -39,7 +45,9 @@ ...@@ -39,7 +45,9 @@
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">建设类型</div> <div class="label">建设类型</div>
<div class="value">{{ detailInfo.buildType }}</div> <div class="value">
{{ codeToName(detailInfo.buildType, 'buildTypeOptins') }}
</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="m-t-20"> <el-row class="m-t-20">
...@@ -106,7 +114,7 @@ ...@@ -106,7 +114,7 @@
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="name2" prop="fileName"
width="500" width="500"
label="资料名称" label="资料名称"
align="center" align="center"
...@@ -181,6 +189,18 @@ export default { ...@@ -181,6 +189,18 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
sysOrgOptions: {
type: Array,
default: () => [],
},
sysDeptOptions: {
type: Array,
default: () => [],
},
buildTypeOptins: {
type: Array,
default: () => [],
},
}, },
data() { data() {
return { return {
...@@ -205,6 +225,10 @@ export default { ...@@ -205,6 +225,10 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
codeToName(code, options) {
const obj = this[options]?.find((v) => v.value == code) || {}
return obj.label
},
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
}, },
......
...@@ -114,12 +114,14 @@ ...@@ -114,12 +114,14 @@
type="index" type="index"
label="序号" label="序号"
width="80" width="80"
:index="indexMethod"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="manageOrgId" prop="manageOrgId"
label="单位" label="单位"
align="center" align="center"
width="160"
:formatter=" :formatter="
(row, column, cellValue, index) => (row, column, cellValue, index) =>
formatterDept(row, column, cellValue, index, 'sysOrgOptions') formatterDept(row, column, cellValue, index, 'sysOrgOptions')
...@@ -184,9 +186,10 @@ ...@@ -184,9 +186,10 @@
<el-table-column <el-table-column
prop="createTime" prop="createTime"
label="创建时间" label="创建时间"
width="120"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column label="操作" width="260" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div <div
style=" style="
...@@ -238,6 +241,7 @@ ...@@ -238,6 +241,7 @@
:center="false" :center="false"
:close-on-click-modal="false" :close-on-click-modal="false"
width="80%" width="80%"
@close="handleClose()"
> >
<el-form <el-form
:model="ruleForm" :model="ruleForm"
...@@ -676,7 +680,13 @@ ...@@ -676,7 +680,13 @@
</el-dialog> </el-dialog>
<!-- 项目信息详情 --> <!-- 项目信息详情 -->
<ProjectDetail :row-data="rowData" :visible.sync="projectDetailVisible" /> <ProjectDetail
:sysOrgOptions="sysOrgOptions"
:sysDeptOptions="sysDeptOptions"
:buildTypeOptins="jianSheLeiXingSelect"
:row-data="rowData"
:visible.sync="projectDetailVisible"
/>
</div> </div>
</template> </template>
...@@ -791,6 +801,9 @@ export default { ...@@ -791,6 +801,9 @@ export default {
this.getDicts() this.getDicts()
}, },
methods: { methods: {
indexMethod(index) {
return (this.pager.current - 1) * this.pager.size + index + 1
},
formatterDept(row, column, cellValue, index, options) { formatterDept(row, column, cellValue, index, options) {
const obj = this[options]?.find((v) => v.value == cellValue) || {} const obj = this[options]?.find((v) => v.value == cellValue) || {}
return obj.label return obj.label
...@@ -963,6 +976,12 @@ export default { ...@@ -963,6 +976,12 @@ export default {
}) })
}) })
}, },
handleClose() {
this.tableData4.forEach((item, index) => {
item.fileList = []
item.fileArray = []
})
},
async editItem(row) { async editItem(row) {
//编辑 //编辑
this.add_dialog = true this.add_dialog = true
...@@ -1006,7 +1025,7 @@ export default { ...@@ -1006,7 +1025,7 @@ export default {
if (item.value == v.busiFileType) { if (item.value == v.busiFileType) {
item.fileList = [ item.fileList = [
{ {
name: v.busiFileName, name: v.fileName,
url: v.fileUrl, url: v.fileUrl,
fileId: v.fileId, fileId: v.fileId,
fileName: v.fileName, fileName: v.fileName,
...@@ -1015,7 +1034,7 @@ export default { ...@@ -1015,7 +1034,7 @@ export default {
] ]
item.fileArray = [ item.fileArray = [
{ {
name: v.busiFileName, name: v.fileName,
url: v.fileUrl, url: v.fileUrl,
fileId: v.fileId, fileId: v.fileId,
fileName: v.fileName, fileName: v.fileName,
...@@ -1443,13 +1462,13 @@ export default { ...@@ -1443,13 +1462,13 @@ export default {
.search_btn { .search_btn {
width: 100%; width: 100%;
display: flex; display: flex;
margin-top: 50px; margin-top: 14px;
margin-bottom: 20px; margin-bottom: 14px;
} }
.search_menu { .search_menu {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 50px; margin-bottom: 14px;
} }
.search_menu_item_container { .search_menu_item_container {
display: flex; display: flex;
......
...@@ -11,54 +11,54 @@ ...@@ -11,54 +11,54 @@
<div> <div>
<div style="text-align: left; margin-left: 10px">资料清单:</div> <div style="text-align: left; margin-left: 10px">资料清单:</div>
<el-table :data="tableData" stripe border> <el-table :data="tableData" stripe border>
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
width="80" width="80"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="busiFileName" prop="label"
label="资料类型" label="资料类型"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column label="资料名称" align="center"> <el-table-column label="资料名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action="/api/file/oss/upload" action="/eadc-shared-ability/oss/upload"
ref="upload" ref="upload"
:on-remove=" :on-remove="
(file, fileList) => handleRemove(file, fileList, scope.row) (file, fileList) => handleRemove(file, fileList, scope.row)
" "
:on-success=" :on-success="
(res, file, fileList) => (res, file, fileList) =>
handleFileUploadSuccess(res, file, fileList, scope.row) handleFileUploadSuccess(res, file, fileList, scope.row)
" "
:limit="1" :limit="1"
:file-list="scope.row.fileUrl ? [scope.row] : []" :file-list="scope.row.fileList"
> >
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="fnOperation('save')" size="mini">保 存</el-button>
<el-button @click="handleClose()" size="mini">取 消</el-button> <el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button @click="fnOperation('save')" size="mini">保 存</el-button> </span>
<el-button type="primary" @click="fnOperation('submit')" size="mini" </el-dialog >
>提 交</el-button
>
</span></el-dialog
>
</div> </div>
</template> </template>
<script> <script>
import { materialTypeList, superStateCode } from '@/utils/architectureInspectionDis'
import { editNeedInfo, queryPrjNeedFile } from '@/api' import {
queryProjectInfoManageTable,
editDeleteProjectInfoManageTable,
} from '@/api/index.js'
export default { export default {
props: { props: {
title: { title: {
...@@ -76,7 +76,14 @@ export default { ...@@ -76,7 +76,14 @@ export default {
}, },
data() { data() {
return { return {
tableData: [], tableData: [
// { id: 1, tableLet1: '技术规范书', fileList: [], fileArray: [] },
// { id: 2, tableLet1: '可行性研究报告', fileList: [], fileArray: [] },
// { id: 3, tableLet1: '需求规格说明书', fileList: [], fileArray: [] },
// { id: 4, tableLet1: '概要设计说明书', fileList: [], fileArray: [] },
// { id: 5, tableLet1: '安全防护方案', fileList: [], fileArray: [] },
// { id: 5, tableLet1: '其他', fileList: [], fileArray: [] },
],
} }
}, },
components: {}, components: {},
...@@ -90,35 +97,56 @@ export default { ...@@ -90,35 +97,56 @@ export default {
}, },
}, },
}, },
mounted() {},
methods: { methods: {
getDicts() {
this.getDictTypeOptions('prj_data').then((res) => {
this.tableData = res.map((v) => {
return {
label: v.label,
value: v.value,
fileList: [],
fileArray: [],
}
})
})
},
fnOperation(type) { fnOperation(type) {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '保存中', text: '保存中',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
}) })
let params = { let filesValue = []
approveState: this.rowData.approveState, this.tableData.forEach((item) => {
needId: this.rowData.needId, if (item.fileArray.length > 0) {
state: this.rowData.state, filesValue.push({
} busiFileName: item.label,
if (type === 'save') { busiFileType: item.value,
params = { fileId: item.fileArray[0].fileId,
...params, fileName: item.fileArray[0].fileName,
state: 2, fileUrl: item.fileArray[0].fileUrl,
} })
} else {
params = {
...params,
approveState: 2,
} }
})
const params = {
appCode : "b17be13e-4915-42ba-9ae0-cee63780f5b3",
appId : 13,
appName : "我的测试系统-勿动",
buildOrg : 1,
buildType : 1,
manageDeptId : 1,
manageOrgId : 1,
prjId : 28,
prjName : "我的测试项目-勿动",
prjPlanClass : 1,
filesValue,
// prjId: this.rowData.prjCode
} }
editNeedInfo(params).then((res) => { editDeleteProjectInfoManageTable(params).then((res) => {
loading.close() if (res.code == 200) {
if (res.code === 200) { loading.close()
this.$message.success('保存成功') this.$message.success('保存成功')
this.showDialog = false
this.handleClose() this.handleClose()
this.$emit('querySearch') this.$emit('querySearch')
} else { } else {
...@@ -136,42 +164,50 @@ export default { ...@@ -136,42 +164,50 @@ export default {
}, },
handleFileUploadSuccess(res, file, fileList, row) { handleFileUploadSuccess(res, file, fileList, row) {
//文件上传 //文件上传
row = { row.fileArray = [
fileName: file.name, {
fileId: file.response.data.fileId, fileName: file.name,
fileUrl: file.response.data.viewUrl, fileId: file.response.data.fileId,
} fileUrl: file.response.data.viewUrl,
console.log('file', row) },
]
}, },
// 打开弹框操作
fnQueryPrjNeedFile() { fnQueryPrjNeedFile() {
console.log('this.rowData', this.rowData) this.getDicts()
let materialTypeArr = this.rowData.materialType.split(',')
// materialTypeList
let busiFileNameList = []
materialTypeArr.forEach(item => {
let obj = materialTypeList.find(type => type.value == item )
console.log(obj);
busiFileNameList.push(obj.label)
})
// let busiFileNameList = this.rowData.fileList?.split(',')
const params = { const params = {
busiFileNameList, prjName: this.rowData.prjName,
busiId: this.rowData.id,
// busiFileNameList: ['技术规范书'],
// busiId: 25,
busiIdType: 1,
} }
queryPrjNeedFile(params).then((res) => { queryProjectInfoManageTable(params).then((res) => {
if (res.code === 200) { let filesValue = []
this.tableData = res.data.map((v) => { if (res.code == 200) {
return { let { records } = res.data
...v, filesValue = records.filesValue || []
name: v.fileName, this.tableData.forEach((item, index) => {
url: v.fileUrl, filesValue.forEach((v) => {
} if (item.value == v.busiFileType) {
}) item.fileList = [
console.log(this.tableData); {
} name: v.busiFileName,
url: v.fileUrl,
fileId: v.fileId,
fileName: v.fileName,
fileUrl: v.fileUrl,
},
]
item.fileArray = [
{
name: v.busiFileName,
url: v.fileUrl,
fileId: v.fileId,
fileName: v.fileName,
fileUrl: v.fileUrl,
},
]
}
})
})
}
}) })
}, },
}, },
......
...@@ -192,18 +192,12 @@ export default { ...@@ -192,18 +192,12 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
// 上传
fnEdit(row) { fnEdit(row) {
// this.dialogTitle = '收集资料配置'
this.rowData = row this.rowData = row
this.demandSubVisible = true this.demandSubVisible = true
// this.visible = true
}, },
} }
} }
</script> </script>
\ No newline at end of file
<style>
</style>
\ No newline at end of file
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-29 11:44:57 * @Date: 2024-03-29 11:44:57
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-29 16:28:15 * @LastEditTime: 2024-04-01 15:34:42
--> -->
<template> <template>
<div> <div>
<el-dialog <el-dialog
...@@ -26,11 +25,25 @@ ...@@ -26,11 +25,25 @@
<el-row class="m-t-20"> <el-row class="m-t-20">
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">单位</div> <div class="label">单位</div>
<div class="value">{{ systemInfoDetail.manageOrgId }}</div> <div class="value">
{{
codeToName(
systemInfoDetail.manageOrgId,
'sysOrgOptions',
)
}}
</div>
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">部门</div> <div class="label">部门</div>
<div class="value">{{ systemInfoDetail.manageDeptId }}</div> <div class="value">
{{
codeToName(
systemInfoDetail.manageDeptId,
'sysDeptOptions',
)
}}
</div>
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">系统名称</div> <div class="label">系统名称</div>
...@@ -40,7 +53,14 @@ ...@@ -40,7 +53,14 @@
</el-col> </el-col>
<el-col :span="6" class="flex"> <el-col :span="6" class="flex">
<div class="label">建设类型</div> <div class="label">建设类型</div>
<div class="value">{{ systemInfoDetail.buildType }}</div> <div class="value">
{{
codeToName(
systemInfoDetail.buildType,
'buildTypeOptins',
)
}}
</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="m-t-20"> <el-row class="m-t-20">
...@@ -124,6 +144,18 @@ export default { ...@@ -124,6 +144,18 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
sysOrgOptions: {
type: Array,
default: () => [],
},
sysDeptOptions: {
type: Array,
default: () => [],
},
buildTypeOptins: {
type: Array,
default: () => [],
},
}, },
data() { data() {
return { return {
...@@ -148,6 +180,10 @@ export default { ...@@ -148,6 +180,10 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
codeToName(code, options) {
const obj = this[options]?.find((v) => v.value == code) || {}
return obj.label
},
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
}, },
......
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
type="index" type="index"
label="序号" label="序号"
width="80" width="80"
:index="indexMethod"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -278,8 +279,8 @@ ...@@ -278,8 +279,8 @@
</el-form-item> </el-form-item>
<el-form-item label="系统类型:" prop="let4"> <el-form-item label="系统类型:" prop="let4">
<el-select clearable v-model="ruleForm.let4"> <el-select clearable v-model="ruleForm.let4">
<el-option label="统推" :value="1"></el-option> <el-option label="统推" value="1"></el-option>
<el-option label="自建" :value="2"></el-option> <el-option label="自建" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="承建单位:" prop="let5"> <el-form-item label="承建单位:" prop="let5">
...@@ -314,7 +315,13 @@ ...@@ -314,7 +315,13 @@
</el-dialog> </el-dialog>
<!-- 系统信息详情 --> <!-- 系统信息详情 -->
<SystemInfoDetail :row-data="rowData" :visible.sync="appDetailVisible" /> <SystemInfoDetail
:sysOrgOptions="sysOrgOptions"
:sysDeptOptions="sysDeptOptions"
:buildTypeOptins="jianSheLeiXingSelect"
:row-data="rowData"
:visible.sync="appDetailVisible"
/>
</div> </div>
</template> </template>
...@@ -390,6 +397,9 @@ export default { ...@@ -390,6 +397,9 @@ export default {
this.getDicts() this.getDicts()
}, },
methods: { methods: {
indexMethod(index) {
return (this.pager.current - 1) * this.pager.size + index + 1
},
openDetail(row) { openDetail(row) {
this.rowData = row this.rowData = row
this.appDetailVisible = true this.appDetailVisible = true
...@@ -432,11 +442,11 @@ export default { ...@@ -432,11 +442,11 @@ export default {
//编辑 //编辑
this.add_dialog = true this.add_dialog = true
this.dialogTitle = '编辑系统' this.dialogTitle = '编辑系统'
this.ruleForm.let1 = row.manageOrgId this.ruleForm.let1 = row.manageOrgId + ''
this.ruleForm.let2 = row.manageDeptId this.ruleForm.let2 = row.manageDeptId + ''
this.ruleForm.let3 = row.appName this.ruleForm.let3 = row.appName
this.ruleForm.let4 = row.buildType this.ruleForm.let4 = row.buildType + ''
this.ruleForm.let5 = row.buildOrg this.ruleForm.let5 = row.buildOrg + ''
this.ruleForm.let6 = row.projectManager this.ruleForm.let6 = row.projectManager
this.appId = row.appId this.appId = row.appId
this.$nextTick(() => { this.$nextTick(() => {
...@@ -512,11 +522,11 @@ export default { ...@@ -512,11 +522,11 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = { const params = {
manageOrgId: this.ruleForm.let1, manageOrgId: +this.ruleForm.let1,
manageDeptId: this.ruleForm.let2, manageDeptId: +this.ruleForm.let2,
appName: this.ruleForm.let3, appName: this.ruleForm.let3,
buildType: this.ruleForm.let4, buildType: this.ruleForm.let4,
buildOrg: this.ruleForm.let5, buildOrg: +this.ruleForm.let5,
projectManager: this.ruleForm.let6, projectManager: this.ruleForm.let6,
} }
const requestParams = const requestParams =
...@@ -718,13 +728,13 @@ export default { ...@@ -718,13 +728,13 @@ export default {
.search_btn { .search_btn {
width: 100%; width: 100%;
display: flex; display: flex;
margin-top: 50px; margin-top: 14px;
margin-bottom: 20px; margin-bottom: 14px;
} }
.search_menu { .search_menu {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 50px; margin-bottom: 14px;
} }
.search_menu_item_container { .search_menu_item_container {
display: flex; display: flex;
......
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
type="index" type="index"
label="序号" label="序号"
width="80" width="80"
:index="indexMethod"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -347,6 +348,9 @@ export default { ...@@ -347,6 +348,9 @@ export default {
}) })
}, },
methods: { methods: {
indexMethod(index) {
return (this.pager.current - 1) * this.pager.size + index + 1
},
search_table() { search_table() {
//搜索 //搜索
this.pager.current = 1 this.pager.current = 1
...@@ -708,8 +712,8 @@ export default { ...@@ -708,8 +712,8 @@ export default {
.search_btn { .search_btn {
width: 100%; width: 100%;
display: flex; display: flex;
margin-top: 50px; margin-top: 14px;
margin-bottom: 20px; margin-bottom: 14px;
} }
.el-button--default { .el-button--default {
border: 0; border: 0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!