Commit 2a213f2d authored by ztf's avatar ztf

选择项目名称和选择用户组件

parent 76fb1041
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
:data="tableData" :data="tableData"
style="width: 100%; margin-bottom: 20px" style="width: 100%; margin-bottom: 20px"
row-key="id" row-key="id"
:tree-props="treeProps"
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" :selectable="selectable" />
<el-table-column prop="perIndex" label="序号" sortable /> <el-table-column prop="perIndex" label="序号" sortable />
<el-table-column label="操作"> <el-table-column label="操作">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)"> <el-button type="danger" size="small" @click="handleEdit(scope.$index, scope.row)">
编辑 编辑
</el-button> </el-button>
<img class="self-btn-icon" src="/icons/c-edit.png"> <!-- <img class="self-btn-icon" src="/icons/c-edit.png">
<el-button <el-button
size="small" size="small"
type="danger" type="danger"
@click="handleStatusDLG(scope.$index, scope.row)" @click="handleStatusDLG(scope.$index, scope.row)"
> >
改状态 改状态
</el-button> </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="date" label="项目名称" show-overflow-tooltip /> <el-table-column prop="date" label="项目名称" show-overflow-tooltip />
...@@ -34,18 +34,20 @@ ...@@ -34,18 +34,20 @@
<el-table-column prop="address" label="状态" /> <el-table-column prop="address" label="状态" />
<el-table-column prop="address" label="密级" /> <el-table-column prop="address" label="密级" />
</el-table> </el-table>
<dee-dialog title="修改状态" :dialog-visible="dialogVisible" width="55%" @handleClose="dialogClose" /> <!-- <dee-dialog title="修改状态" :dialog-visible="dialogVisible" width="55%" @handleClose="dialogClose" /> -->
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'ProjectList', name: 'ProjectList',
componentName: '项目列表', componentName: '项目列表333',
data() { data() {
const that = this const that = this
return { return {
treeProps: {
checkStrictly: false
},
BtnTools: [ BtnTools: [
{ {
name: '新增', name: '新增',
...@@ -71,7 +73,55 @@ export default { ...@@ -71,7 +73,55 @@ export default {
} }
} }
], ],
tableData: [], tableData: [
{
id: 1,
date: '2016-05-02',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
},
{
id: 2,
date: '2016-05-04',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
},
{
id: 3,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 31,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 313,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 32,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 4,
date: '2016-05-03',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
],
tableColums: [ tableColums: [
{ {
title: '操作', title: '操作',
...@@ -144,6 +194,9 @@ export default { ...@@ -144,6 +194,9 @@ export default {
selectedData: [] selectedData: []
} }
}, },
mounted() {
this.getTableList()
},
methods: { methods: {
jump(data) { jump(data) {
this.$router.push({ this.$router.push({
...@@ -151,7 +204,7 @@ export default { ...@@ -151,7 +204,7 @@ export default {
query: { title: data.name + '详情', id: data.id } query: { title: data.name + '详情', id: data.id }
}) })
}, },
handleSelectionChange(val) { selectionChange(val) {
this.selectedData = val this.selectedData = val
}, },
remove() { remove() {
...@@ -207,6 +260,78 @@ export default { ...@@ -207,6 +260,78 @@ export default {
}) })
}) })
} }
},
getTableList() {
const tableData = [
{
id: 1,
date: '2016-05-02',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
},
{
id: 2,
date: '2016-05-04',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
},
{
id: 3,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 31,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 313,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 32,
date: '2016-05-01',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 4,
date: '2016-05-03',
name: 'wangxiaohu',
address: 'No. 189, Grove St, Los Angeles'
}
]
this.setParentIndex(tableData)
this.tableData = tableData
console.log('this.tableData', tableData)
},
setParentIndex(list) {
list.forEach((item, index) => {
item.perIndex = index + 1 + ''
if (item.children && item.children.length > 0) {
this._setParentIndex(item, item.perIndex)
}
})
},
_setParentIndex(item, oldIndex) {
if (item.children && item.children.length > 0) {
item.children.forEach((subItem, i) => {
subItem.perIndex = oldIndex + '.' + (i + 1)
this._setParentIndex(subItem, subItem.perIndex)
})
} else {
return
}
} }
} }
} }
......
<template> <template>
<div class="project-list"> <div class="project-list">
项目列表
<dee-table <dee-table
ref="projectTable" ref="projectTable"
:data="tableData" :data="tableData"
...@@ -9,9 +8,53 @@ ...@@ -9,9 +8,53 @@
selection-row selection-row
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<dee-tools slot="header" :tools="BtnTools" mode="normal" :collapse="false" :permissions="permissions" :perm-enable="true" /> <dee-tools slot="header" :tools="BtnTools" mode="normal" :collapse="false" :perm-enable="true" />
</dee-table> </dee-table>
<dee-dialog title="修改状态" :dialog-visible="dialogVisible" width="55%" @handleClose="dialogClose" /> <dee-dialog
title="修改状态"
:dialog-visible="updateStateDLG"
width="55%"
@handleClose="updateStateDLG=false"
>
<dee-as-com
:lay-config="{
typeName: 'ExtProgram',
layKey: 'updateState'
}"
:form="showDetailObj"
@on-cancel="updateStateDLG = false"
/>
<!-- @submitEvent="onSubmit" -->
</dee-dialog>
<dee-drawer
title="新建"
:dialog-visible="addProjectDrawer"
width="55%"
@handleClose="addProjectDrawer=false"
>
<dee-as-com
:lay-config="{
typeName: 'ExtProgram',
layKey: 'defaultCreate'
}"
@on-cancel="handleClickCancel"
/>
<!-- addProjectDrawer = false -->
</dee-drawer>
<dee-drawer
title="编辑"
:dialog-visible="editProjectDrawer"
width="55%"
@handleClose="editProjectDrawer=false"
>
<dee-as-com
:lay-config="{
typeName: 'ExtProgram',
layKey: 'defaultEdit'
}"
@on-cancel="editProjectDrawer = false"
/>
</dee-drawer>
</div> </div>
</template> </template>
...@@ -19,10 +62,19 @@ ...@@ -19,10 +62,19 @@
<script> <script>
export default { export default {
name: 'ProjectList', name: 'ProjectList',
componentName: '项目列表', componentName: '项目列表测试',
data() { data() {
const that = this const that = this
return { return {
updateStateDLG: false,
addProjectDrawer: false,
editProjectDrawer: false,
showDetailObj: {},
emitMethods: [
{ methods: 'searchResult',
methodsName: '搜索结果列表'
}
],
BtnTools: [ BtnTools: [
{ {
name: '新增', name: '新增',
...@@ -30,8 +82,8 @@ export default { ...@@ -30,8 +82,8 @@ export default {
key: 'add', key: 'add',
handler: { handler: {
click: () => { click: () => {
// this.dialogTitle = '新增资源属性' console.log('新增')
// this.dialogVisible = true this.addProjectDrawer = true
} }
} }
}, },
...@@ -41,8 +93,6 @@ export default { ...@@ -41,8 +93,6 @@ export default {
key: 'remove', key: 'remove',
handler: { handler: {
click: () => { click: () => {
// this.dialogTitle = '新增资源属性'
// this.dialogVisible = true
this.remove() this.remove()
} }
} }
...@@ -52,11 +102,24 @@ export default { ...@@ -52,11 +102,24 @@ export default {
tableColums: [ tableColums: [
{ {
title: '序号', title: '序号',
key: 'perIndex' key: 'perIndex',
component: {
show: true,
render: function(h, row) {
let style = null
if (!row.children || !row.children.length) {
style = {
'padding-left': '20px'
}
}
return h('span', { style }, row.perIndex)
}
}
}, },
{ {
title: '操作', title: '操作',
key: 'operate', key: 'operate',
component: {
show: true, show: true,
name: 'EditTableRow', name: 'EditTableRow',
props: { props: {
...@@ -64,72 +127,89 @@ export default { ...@@ -64,72 +127,89 @@ export default {
{ {
operation: '改状态', operation: '改状态',
handleClick: (row, index) => { handleClick: (row, index) => {
this.updateStateDLG = true
this.showDetailObj = row
console.log('row', row)
}, },
icon: '/icons/c-edit.png', icon: '/icons/c-trans.png',
showFun: (row) => { showFun: (row) => {
return true
} }
}, },
{ {
operation: '编辑', operation: '编辑',
handleClick: (row, index) => { handleClick: (row, index) => {
this.editProjectDrawer = true
}, },
icon: '/icons/c-edit.png', icon: '/icons/c-edit.png',
showFun: (row) => { showFun: (row) => {
return true
} }
} }
] ]
} }}
}, },
{ {
title: '项目名称', title: '项目名称',
key: 'name', key: 'name',
component: { component: {
show: true,
render: function(h, data) { render: function(h, data) {
return <span class='link' v-on:click={() => { return (
that.jump(data) <span
}}>{data.name}</span> style={{ color: '#2A75CE', cursor: 'pointer' }}
onClick={() => { that.jump(data) }}
>
{data.name}
</span>
)
} }
} }
}, },
{ {
title: '项目分类', title: '项目分类',
key: '' key: 'projectCategory'
}, },
{ {
title: '项目代号', title: '项目代号',
key: '' key: 'number'
}, },
{ {
title: '项目类型', title: '项目类型',
key: '' key: 'proType'
}, },
{ {
title: '状态', title: '状态',
key: '' key: 'state'
}, },
{ {
title: '密级', title: '密级',
key: '' key: 'secretCode'
} }
], ],
optionsTree: { optionsTree: {
fit: true,
// defaultExpandAll: true,
highlightCurrentRow: true, highlightCurrentRow: true,
rowKey: 'id' rowKey: 'id'
}, },
selectedData: [] selectedData: []
} }
}, },
mounted() {
this.getTableList()
// 真的好无聊啊,都不知道该干什么了
// 怎么这么你难熬啊啊,时间怎么过的这么的慢
},
methods: { methods: {
handleClickCancel() {
this.$emit('cancel')
},
jump(data) { jump(data) {
const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a'
const title = '项目要素'
this.$router.push({ this.$router.push({
path: `/page/${data.pageNumber}/${data.id}/?id=${data.id}&title=${data.name}`, path: `/page/${pageNumber}/${data.id}?title=${title}&id=${data.id}&name=${data.name}`,
query: { title: data.name + '详情', id: data.id } query: { name: data.name, id: data.id }
}) })
}, },
selectionChange(val) { selectionChange(val) {
...@@ -188,6 +268,78 @@ export default { ...@@ -188,6 +268,78 @@ export default {
}) })
}) })
} }
},
getTableList() {
const tableData = [
{
id: 1,
state: '2016-05-02',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles'
},
{
id: 2,
state: '2016-05-04',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles'
},
{
id: 3,
state: '2016-05-01',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 31,
state: '2016-05-01',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles',
children: [
{
id: 313,
state: '2016-05-01',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 32,
state: '2016-05-01',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles'
}
]
},
{
id: 4,
state: '2016-05-03',
name: 'wangxiaohu',
secretCode: 'No. 189, Grove St, Los Angeles'
}
]
this.setParentIndex(tableData)
this.tableData = tableData
console.log('this.tableData', tableData)
},
setParentIndex(list) {
list.forEach((item, index) => {
item.perIndex = index + 1 + ''
if (item.children && item.children.length > 0) {
this._setParentIndex(item, item.perIndex)
}
})
},
_setParentIndex(item, oldIndex) {
if (item.children && item.children.length > 0) {
item.children.forEach((subItem, i) => {
subItem.perIndex = oldIndex + '.' + (i + 1)
this._setParentIndex(subItem, subItem.perIndex)
})
} else {
return
}
} }
} }
} }
......
...@@ -137,6 +137,7 @@ export default { ...@@ -137,6 +137,7 @@ export default {
data: n data: n
} }
}) })
console.log('userListOptions', this.userListOptions)
} else { } else {
this.userListOptions = [] this.userListOptions = []
} }
...@@ -165,6 +166,7 @@ export default { ...@@ -165,6 +166,7 @@ export default {
} }
}, },
change(val) { change(val) {
console.log('this.valueKey', this.valueKey)
if (this.valueKey) { if (this.valueKey) {
this.$emit('getUser', val) this.$emit('getUser', val)
this.$emit('input', val) this.$emit('input', val)
......
<!--
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-08-29 11:42:37
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-10 11:42:34
-->
<template> <template>
<div> <div>
<div class="select-project"> <div class="select-project">
<!-- 这里要判断是项目还是子项,显示的是项目的关联的收入合同里面的 -->
<el-select v-if="showSelect" v-model="project" placeholder="请选择" @change="handleChange">
<el-option
v-for="item in projectList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<!--input输入--> <!--input输入-->
<el-input v-model="project" placeholder="请输入" /> <el-input v-else v-model="project" placeholder="请输入" @input="handleChange" />
<img <img
v-if="show" v-if="showIcon"
class="icon" class="icon"
src="/icons/c-add.png" src="/icons/c-add.png"
title="选择合同" title="选择合同"
...@@ -25,9 +41,13 @@ ...@@ -25,9 +41,13 @@
<script> <script>
export default { export default {
name: 'CreateNewProject', name: 'SelectProjectName',
componentName: '选择项目名称', componentName: '选择项目名称',
props: { props: {
value: {
type: [Object, Array, String],
default: () => null
},
form: { form: {
type: Object, type: Object,
default: () => {} default: () => {}
...@@ -37,31 +57,31 @@ export default { ...@@ -37,31 +57,31 @@ export default {
return { return {
project: '', project: '',
dialogShow: false, dialogShow: false,
show: false showIcon: false,
projectList: [],
showSelect: false
} }
}, },
watch: { watch: {
'form.projectCategory': { 'form.projectCategory': {
immediate: true, immediate: true,
deep: true, deep: true,
handler: function(val) { handler(val) {
// console.log('val', val)
if (val) { if (val) {
if (val === 'program') { this.showIcon = val !== 'program'
this.show = false this.showSelect = val === 'childProject'
} else {
this.show = true
} }
} }
} }
}
}, },
methods: { methods: {
handleClickOpen() { handleClickOpen() {
this.dialogShow = true this.dialogShow = true
console.log('打开合同弹框') console.log('打开合同弹框')
},
handleChange(val) {
this.$emit('input', val)
} }
} }
......
{"host":10810} {"host":10811}
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment