husq
2023-08-30 203626165b02ccbc09c8a4ea70b4edd4d9f35a93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<template>
    <div class="project_add">
        <div class="side-header">
            <div class="side-option flex-display flex-align-center">
                <left-outlined :style="{ fontSize: '18px', marginRight: '8px' }" />
                <h2 class="title">创建项目</h2>
            </div>
            <div class="border-bottom"></div>
        </div>
        <div class="side-form-content">
            <a-form layout="vertical" :model="formState">
                <a-form-item label="项目名称">
                    <a-input v-model:value="formState[FormProject.PROJECT_NAME]" placeholder="项目名称" />
                </a-form-item>
                <a-form-item label="项目简介">
                    <a-textarea :auto-size="{ minRows: 4, maxRows: 8 }" type="textarea"
                        v-model:value="formState[FormProject.PROJCECT_INTRO]" placeholder="项目简介" />
                </a-form-item>
                <a-form-item>
                    <div class="application flex-display flex-align-center flex-justify-between">
                        <p>申请码加入项目</p>
                        <div class="btn dis_opticy">
                            <a-button type="text" disabled>
                                <span class="button_name">未开启</span>
                                <template #icon><right-outlined
                                        :style="{ fontSize: '14px', color: '#fff', marginLeft: '8px' }" /></template>
                            </a-button>
                        </div>
                    </div>
                </a-form-item>
                <a-form-item>
                    <div class="application flex-display flex-align-center flex-justify-between">
                        <p>天气阻飞设置</p>
                        <div class="btn">
                            <a-button type="text" disabled>
                                <span class="button_name">未开启</span>
                                <template #icon><right-outlined
                                        :style="{ fontSize: '14px', color: '#fff', marginLeft: '8px' }" /></template>
                            </a-button>
                        </div>
                    </div>
                </a-form-item>
                <a-form-item>
                    <div class="application flex-display flex-align-center flex-justify-between">
                        <p>项目成员</p>
                        <div>
                            <a-button type="text">
                                <span class="button_add">添加成员</span>
                                <template #icon><plus-outlined :style="{ fontSize: '14px', color: '#2d8cf0' }" /></template>
                            </a-button>
                        </div>
                    </div>
                    <a-table :columns="columns" :data-source="dataSource" bordered>
                        <template v-for="col in ['name', 'age', 'address']" #[col]="{ text, record }" :key="col">
                            <div>
                                <a-input v-if="editableData[record.key]" v-model:value="editableData[record.key][col]"
                                    style="margin: -5px 0" />
                                <template v-else>
                                    {{ text }}
                                </template>
                            </div>
                        </template>
                        <template #operation="{ record }">
                            <div class="editable-row-operations">
                                <span v-if="editableData[record.key]">
                                    <a @click="save(record.key)">Save</a>
                                    <a-popconfirm title="Sure to cancel?" @confirm="cancel(record.key)">
                                        <a>Cancel</a>
                                    </a-popconfirm>
                                </span>
                                <span v-else>
                                    <a @click="edit(record.key)">Edit</a>
                                </span>
                            </div>
                        </template>
                    </a-table>
                </a-form-item>
                <a-form-item>
                    <a-button type="primary">Submit</a-button>
                </a-form-item>
            </a-form>
        </div>
    </div>
</template>
 
<script setup lang="ts">
import { LeftOutlined, RightOutlined, PlusOutlined } from '@ant-design/icons-vue'
import { FormState, FormProject } from './type'
import { UnwrapRef } from 'vue'
const columns = [
  {
    title: '人员项目呼号',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '项目角色',
    dataIndex: 'role',
    key: 'role',
    responsive: ['md'],
  },
  {
    title: '编辑',
    dataIndex: 'edit',
    key: 'edit',
    responsive: ['lg'],
  },
]
interface DataItem {
  key: string;
  name: string;
  role: number;
  edit: string;
}
const dataSource = ref([
  {
    key: '1',
    name: '接口活',
    role: '项目管理员'
  }
])
const editableData: UnwrapRef<Record<string, DataItem>> = reactive({})
const formState = ref<FormState>({
  [FormProject.PROJECT_NAME]: '',
  [FormProject.PROJECT_STATUS]: '',
  [FormProject.PROJCECT_INTRO]: '',
  [FormProject.LONGITUDE]: 0,
  [FormProject.LATITUDE]: 0,
  [FormProject.USERLIST]: []
})
</script>
 
<style scoped lang="scss">
.project_add {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #fff;
    background-color: #232323;
 
    .side-header {
        height: 60px;
        font-size: 16px;
        line-height: 60px;
        box-sizing: border-box;
        background-color: #232323;
        border-bottom: 1px solid #4f4f4f;
 
        .side-option {
            padding: 0 16px;
 
            .title {
                color: $text-white-basic;
                font-size: 18px;
                margin: 0;
                font-weight: 700;
            }
        }
    }
 
    .side-form-content {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
 
        .application {
            color: #fff;
 
            >p {
                margin: 0;
            }
 
            .btn {
                :deep(.ant-btn-text) {
                    display: flex;
                    align-items: center;
                    flex-direction: row-reverse;
                }
 
                .button_name {
                    color: #fff;
                }
            }
 
            .button_add {
                color: $primary;
                margin: 0;
            }
        }
    }
 
    :deep(.ant-form-item-label > label) {
        color: #fff;
    }
 
    :deep(.ant-form-item) {
        margin-bottom: 16px;
    }
 
    :deep(.ant-input) {
        background: #101010;
        border: 1px solid #444;
        color: #fff;
    }
 
    :deep(.ant-input-affix-wrapper) {
        background: #101010;
    }
}
</style>