Commit 2a213f2d authored by ztf's avatar ztf

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

parent 76fb1041
......@@ -6,25 +6,25 @@
:data="tableData"
style="width: 100%; margin-bottom: 20px"
row-key="id"
:tree-props="treeProps"
border
@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 label="操作">
<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>
<img class="self-btn-icon" src="/icons/c-edit.png">
<!-- <img class="self-btn-icon" src="/icons/c-edit.png">
<el-button
size="small"
type="danger"
@click="handleStatusDLG(scope.$index, scope.row)"
>
改状态
</el-button>
</el-button> -->
</template>
</el-table-column>
<el-table-column prop="date" label="项目名称" show-overflow-tooltip />
......@@ -34,18 +34,20 @@
<el-table-column prop="address" label="状态" />
<el-table-column prop="address" label="密级" />
</el-table>
<dee-dialog title="修改状态" :dialog-visible="dialogVisible" width="55%" @handleClose="dialogClose" />
<!-- <dee-dialog title="修改状态" :dialog-visible="dialogVisible" width="55%" @handleClose="dialogClose" /> -->
</div>
</template>
<script>
export default {
name: 'ProjectList',
componentName: '项目列表',
componentName: '项目列表333',
data() {
const that = this
return {
treeProps: {
checkStrictly: false
},
BtnTools: [
{
name: '新增',
......@@ -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: [
{
title: '操作',
......@@ -144,6 +194,9 @@ export default {
selectedData: []
}
},
mounted() {
this.getTableList()
},
methods: {
jump(data) {
this.$router.push({
......@@ -151,7 +204,7 @@ export default {
query: { title: data.name + '详情', id: data.id }
})
},
handleSelectionChange(val) {
selectionChange(val) {
this.selectedData = val
},
remove() {
......@@ -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>
<div class="project-list">
项目列表
<dee-table
ref="projectTable"
:data="tableData"
......@@ -9,9 +8,53 @@
selection-row
@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-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>
</template>
......@@ -19,10 +62,19 @@
<script>
export default {
name: 'ProjectList',
componentName: '项目列表',
componentName: '项目列表测试',
data() {
const that = this
return {
updateStateDLG: false,
addProjectDrawer: false,
editProjectDrawer: false,
showDetailObj: {},
emitMethods: [
{ methods: 'searchResult',
methodsName: '搜索结果列表'
}
],
BtnTools: [
{
name: '新增',
......@@ -30,8 +82,8 @@ export default {
key: 'add',
handler: {
click: () => {
// this.dialogTitle = '新增资源属性'
// this.dialogVisible = true
console.log('新增')
this.addProjectDrawer = true
}
}
},
......@@ -41,8 +93,6 @@ export default {
key: 'remove',
handler: {
click: () => {
// this.dialogTitle = '新增资源属性'
// this.dialogVisible = true
this.remove()
}
}
......@@ -52,11 +102,24 @@ export default {
tableColums: [
{
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: '操作',
key: 'operate',
component: {
show: true,
name: 'EditTableRow',
props: {
......@@ -64,72 +127,89 @@ export default {
{
operation: '改状态',
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) => {
return true
}
},
{
operation: '编辑',
handleClick: (row, index) => {
this.editProjectDrawer = true
},
icon: '/icons/c-edit.png',
showFun: (row) => {
return true
}
}
]
}
}}
},
{
title: '项目名称',
key: 'name',
component: {
show: true,
render: function(h, data) {
return <span class='link' v-on:click={() => {
that.jump(data)
}}>{data.name}</span>
return (
<span
style={{ color: '#2A75CE', cursor: 'pointer' }}
onClick={() => { that.jump(data) }}
>
{data.name}
</span>
)
}
}
},
{
title: '项目分类',
key: ''
key: 'projectCategory'
},
{
title: '项目代号',
key: ''
key: 'number'
},
{
title: '项目类型',
key: ''
key: 'proType'
},
{
title: '状态',
key: ''
key: 'state'
},
{
title: '密级',
key: ''
key: 'secretCode'
}
],
optionsTree: {
fit: true,
// defaultExpandAll: true,
highlightCurrentRow: true,
rowKey: 'id'
},
selectedData: []
}
},
mounted() {
this.getTableList()
// 真的好无聊啊,都不知道该干什么了
// 怎么这么你难熬啊啊,时间怎么过的这么的慢
},
methods: {
handleClickCancel() {
this.$emit('cancel')
},
jump(data) {
const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a'
const title = '项目要素'
this.$router.push({
path: `/page/${data.pageNumber}/${data.id}/?id=${data.id}&title=${data.name}`,
query: { title: data.name + '详情', id: data.id }
path: `/page/${pageNumber}/${data.id}?title=${title}&id=${data.id}&name=${data.name}`,
query: { name: data.name, id: data.id }
})
},
selectionChange(val) {
......@@ -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 {
data: n
}
})
console.log('userListOptions', this.userListOptions)
} else {
this.userListOptions = []
}
......@@ -165,6 +166,7 @@ export default {
}
},
change(val) {
console.log('this.valueKey', this.valueKey)
if (this.valueKey) {
this.$emit('getUser', 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>
<div>
<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输入-->
<el-input v-model="project" placeholder="请输入" />
<el-input v-else v-model="project" placeholder="请输入" @input="handleChange" />
<img
v-if="show"
v-if="showIcon"
class="icon"
src="/icons/c-add.png"
title="选择合同"
......@@ -25,9 +41,13 @@
<script>
export default {
name: 'CreateNewProject',
name: 'SelectProjectName',
componentName: '选择项目名称',
props: {
value: {
type: [Object, Array, String],
default: () => null
},
form: {
type: Object,
default: () => {}
......@@ -37,31 +57,31 @@ export default {
return {
project: '',
dialogShow: false,
show: false
showIcon: false,
projectList: [],
showSelect: false
}
},
watch: {
'form.projectCategory': {
immediate: true,
deep: true,
handler: function(val) {
// console.log('val', val)
handler(val) {
if (val) {
if (val === 'program') {
this.show = false
} else {
this.show = true
this.showIcon = val !== 'program'
this.showSelect = val === 'childProject'
}
}
}
}
},
methods: {
handleClickOpen() {
this.dialogShow = true
console.log('打开合同弹框')
},
handleChange(val) {
this.$emit('input', val)
}
}
......
{"host":10810}
\ No newline at end of file
{"host":10811}
\ 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