create-jnrs-vue 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jnrs-vue/components.d.ts +1 -0
- package/jnrs-vue/package.json +3 -3
- package/jnrs-vue/src/api/examples/playground.ts +51 -0
- package/jnrs-vue/src/api/examples/portfolio-management/portfolio.ts +10 -10
- package/jnrs-vue/src/api/examples/portfolio-management/program.ts +5 -5
- package/jnrs-vue/src/api/examples/portfolio-management/project.ts +4 -4
- package/jnrs-vue/src/api/examples/program-management/index.ts +5 -5
- package/jnrs-vue/src/api/examples/program-management/sub-project.ts +4 -4
- package/jnrs-vue/src/api/examples/project-management/index.ts +19 -51
- package/jnrs-vue/src/api/examples/project-management/manager.ts +1 -1
- package/jnrs-vue/src/components/common/DictSelector.vue +70 -0
- package/jnrs-vue/src/components/common/DictTag.vue +8 -2
- package/jnrs-vue/src/utils/index.ts +1 -1
- package/jnrs-vue/src/views/examples/playground/RequestPage.vue +97 -38
- package/jnrs-vue/src/views/examples/playground/index.vue +203 -63
- package/jnrs-vue/src/views/examples/portfolio-management/programList/editDialog.vue +10 -0
- package/jnrs-vue/src/views/examples/portfolio-management/programList/index.vue +1 -1
- package/jnrs-vue/src/views/examples/portfolio-management/projectList/editDialog.vue +12 -9
- package/jnrs-vue/src/views/examples/program-management/mainPage/editDialog.vue +15 -19
- package/jnrs-vue/src/views/examples/program-management/subPage/editDialog.vue +15 -19
- package/jnrs-vue/src/views/examples/project-management/EditDialog.vue +54 -24
- package/jnrs-vue/src/views/examples/project-management/index.vue +4 -18
- package/jnrs-vue/viteMockServe/auth.mock.ts +41 -0
- package/jnrs-vue/viteMockServe/details.mock.ts +12 -0
- package/jnrs-vue/viteMockServe/dict.mock.ts +21 -0
- package/jnrs-vue/viteMockServe/index.ts +22 -370
- package/jnrs-vue/viteMockServe/manager.mock.ts +12 -0
- package/jnrs-vue/viteMockServe/portfolio-program.mock.ts +36 -0
- package/jnrs-vue/viteMockServe/portfolio-project.mock.ts +28 -0
- package/jnrs-vue/viteMockServe/portfolio.mock.ts +109 -0
- package/jnrs-vue/viteMockServe/program.mock.ts +45 -0
- package/jnrs-vue/viteMockServe/project.mock.ts +58 -0
- package/jnrs-vue/viteMockServe/role.mock.ts +12 -0
- package/jnrs-vue/viteMockServe/sub-project.mock.ts +34 -0
- package/package.json +1 -1
- package/jnrs-vue/src/api/business/index.ts +0 -69
- package/jnrs-vue/src/utils/field.ts +0 -73
- package/jnrs-vue/src/views/businessPlayground/EditDialog.vue +0 -137
- package/jnrs-vue/src/views/businessPlayground/index.vue +0 -90
- package/jnrs-vue/viteMockServe/json/tableRes.json +0 -390
- /package/jnrs-vue/viteMockServe/json/{loginResAdmin.json → auth-login-admin.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{loginResUser.json → auth-login-user.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{detailsRes.json → details.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{dictItemRes.json → dict-detail.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{dictRes.json → dict-list.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{managerRes.json → manager-list.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{programListRes.json → program-list.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{projectListRes.json → project-list.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{roleRes.json → role-list.json} +0 -0
- /package/jnrs-vue/viteMockServe/json/{subProjectListRes.json → sub-project-list.json} +0 -0
|
@@ -3,7 +3,7 @@ import { ref } from 'vue'
|
|
|
3
3
|
import { ElMessage } from 'element-plus'
|
|
4
4
|
import { downloadFile } from '@/utils'
|
|
5
5
|
import { LoginApi } from '@/api/system'
|
|
6
|
-
import { NotFoundApi, NoAuthApi, NoNeedAuthApi, FailApi } from '@/api/examples/
|
|
6
|
+
import { NotFoundApi, NoAuthApi, NoNeedAuthApi, FailApi } from '@/api/examples/playground'
|
|
7
7
|
import { getFileUrl } from '@/utils/file'
|
|
8
8
|
|
|
9
9
|
import ImageView from '@/components/common/ImageView.vue'
|
|
@@ -76,47 +76,106 @@ const handleFileView = async () => {
|
|
|
76
76
|
</script>
|
|
77
77
|
|
|
78
78
|
<template>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</el-input>
|
|
92
|
-
<div>
|
|
93
|
-
<el-button-group>
|
|
94
|
-
<el-button type="primary" plain size="small" @click="downloadFile('mock-pdf.pdf')">
|
|
95
|
-
获取后端服务器文件进行下载
|
|
96
|
-
</el-button>
|
|
97
|
-
</el-button-group>
|
|
98
|
-
<div>
|
|
99
|
-
<span>通过 ImageView 组件显示的图片(可支持预览)</span>
|
|
100
|
-
<ImageView
|
|
101
|
-
loadKeys="mock-png-1.png"
|
|
102
|
-
preview
|
|
103
|
-
style="width: 300px; height: 50px; border: 1px solid var(--jnrs-color-primary)"
|
|
104
|
-
/>
|
|
79
|
+
<section class="playground-section">
|
|
80
|
+
<h2 class="section-title">网络请求</h2>
|
|
81
|
+
|
|
82
|
+
<div class="test-group">
|
|
83
|
+
<h3 class="group-title">HTTP 状态码</h3>
|
|
84
|
+
<div class="btn-row">
|
|
85
|
+
<el-button type="primary" size="small" @click="handleNotFound">404</el-button>
|
|
86
|
+
<el-button type="warning" size="small" @click="handleNoAuth()">暂无权限</el-button>
|
|
87
|
+
<el-button type="warning" size="small" @click="handleNoAuth(false)">暂无权限(静默)</el-button>
|
|
88
|
+
<el-button type="success" size="small" @click="handleNoNeedAuth()">无需权限</el-button>
|
|
89
|
+
<el-button type="danger" size="small" @click="handleFail()">请求失败</el-button>
|
|
90
|
+
</div>
|
|
105
91
|
</div>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
92
|
+
|
|
93
|
+
<div class="test-group">
|
|
94
|
+
<h3 class="group-title">登录接口</h3>
|
|
95
|
+
<div class="login-row">
|
|
96
|
+
<el-input v-model="loginParams.account" size="small" style="width: 200px" placeholder="账号">
|
|
97
|
+
<template #append>
|
|
98
|
+
<el-button size="small" @click="handleLogin">验证登录</el-button>
|
|
99
|
+
</template>
|
|
100
|
+
</el-input>
|
|
101
|
+
</div>
|
|
109
102
|
</div>
|
|
110
|
-
|
|
103
|
+
|
|
104
|
+
<div class="test-group">
|
|
105
|
+
<h3 class="group-title">文件操作</h3>
|
|
106
|
+
<div class="file-section">
|
|
107
|
+
<div class="file-row">
|
|
108
|
+
<el-button type="primary" plain size="small" @click="downloadFile('mock-pdf.pdf')">下载文件</el-button>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="file-row">
|
|
111
|
+
<span class="file-label">ImageView 组件(支持预览)</span>
|
|
112
|
+
<ImageView
|
|
113
|
+
loadKeys="mock-png-1.png"
|
|
114
|
+
preview
|
|
115
|
+
style="width: 300px; height: 50px; border: 1px solid var(--jnrs-color-primary)"
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="file-row">
|
|
119
|
+
<el-button type="primary" plain size="small" @click="handleFileView">获取图片</el-button>
|
|
120
|
+
<el-avatar v-if="squareUrl" shape="circle" :src="squareUrl" />
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</section>
|
|
111
125
|
</template>
|
|
112
126
|
|
|
113
127
|
<style scoped lang="scss">
|
|
114
|
-
|
|
115
|
-
|
|
128
|
+
.playground-section {
|
|
129
|
+
margin-bottom: 36px;
|
|
130
|
+
padding-top: 28px;
|
|
131
|
+
border-top: 1px solid var(--jnrs-card-primary-03, #e8e8e8);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.section-title {
|
|
135
|
+
font-size: 16px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: var(--jnrs-font-primary);
|
|
138
|
+
margin: 0 0 16px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.test-group {
|
|
142
|
+
margin-bottom: 20px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.group-title {
|
|
146
|
+
font-size: 13px;
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
color: var(--jnrs-font-primary-03, #999);
|
|
149
|
+
margin: 0 0 10px;
|
|
116
150
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
151
|
+
|
|
152
|
+
.btn-row {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 8px;
|
|
156
|
+
flex-wrap: wrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.login-row {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
gap: 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.file-section {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: 12px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.file-row {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: 12px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.file-label {
|
|
178
|
+
font-size: 13px;
|
|
179
|
+
color: var(--jnrs-font-primary-03, #999);
|
|
121
180
|
}
|
|
122
|
-
</style>
|
|
181
|
+
</style>
|
|
@@ -38,12 +38,6 @@ const handleRouterSystemMine = () => {
|
|
|
38
38
|
id: 1
|
|
39
39
|
}
|
|
40
40
|
})
|
|
41
|
-
// handleRouter({
|
|
42
|
-
// path: '/system/mine/index',
|
|
43
|
-
// query: {
|
|
44
|
-
// id: 1
|
|
45
|
-
// }
|
|
46
|
-
// })
|
|
47
41
|
}
|
|
48
42
|
|
|
49
43
|
const changeI18n = () => {
|
|
@@ -63,69 +57,215 @@ onMounted(() => {
|
|
|
63
57
|
</script>
|
|
64
58
|
|
|
65
59
|
<template>
|
|
66
|
-
<div>
|
|
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
|
-
|
|
60
|
+
<div class="playground">
|
|
61
|
+
<header class="playground-header">
|
|
62
|
+
<h1 class="playground-title">Playground</h1>
|
|
63
|
+
<p class="playground-subtitle">功能测试与验证</p>
|
|
64
|
+
</header>
|
|
65
|
+
|
|
66
|
+
<!-- 国际化 -->
|
|
67
|
+
<section class="playground-section">
|
|
68
|
+
<h2 class="section-title">国际化</h2>
|
|
69
|
+
<div class="test-grid">
|
|
70
|
+
<div class="test-item">
|
|
71
|
+
<span class="test-label">@jnrs/shared</span>
|
|
72
|
+
<span class="test-value">{{ datetime }}</span>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="test-item">
|
|
75
|
+
<span class="test-label">@jnrs/shared/validator</span>
|
|
76
|
+
<span class="test-value">{{ validator }}</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="test-item">
|
|
79
|
+
<span class="test-label">@jnrs/shared/request</span>
|
|
80
|
+
<span class="test-value">{{ testI18nInCore }}</span>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<el-button type="primary" plain size="small" @click="changeI18n">切换语言后点击更新国际化显示</el-button>
|
|
84
|
+
</section>
|
|
85
|
+
|
|
86
|
+
<!-- 权限 -->
|
|
87
|
+
<section class="playground-section">
|
|
88
|
+
<h2 class="section-title">权限指令</h2>
|
|
89
|
+
<p class="section-note">admin 账号拥有全部权限,请用非 admin 账号测试</p>
|
|
90
|
+
<ul class="permission-list">
|
|
91
|
+
<li class="permission-item">
|
|
92
|
+
<span class="permission-label">有权限(v-permissions)</span>
|
|
93
|
+
<el-button type="primary" size="small" v-permissions="['mine:view']">添加</el-button>
|
|
94
|
+
</li>
|
|
95
|
+
<li class="permission-item">
|
|
96
|
+
<span class="permission-label">无权限(:disabled)</span>
|
|
97
|
+
<el-button type="primary" size="small" :disabled="!hasPermission(['test:del'])">删除</el-button>
|
|
98
|
+
</li>
|
|
99
|
+
<li class="permission-item">
|
|
100
|
+
<span class="permission-label">无权限(v-permissions.disabled)</span>
|
|
101
|
+
<button class="native-btn" size="small" v-permissions.disabled="['test:del']">删除</button>
|
|
102
|
+
</li>
|
|
103
|
+
<li class="permission-item">
|
|
104
|
+
<span class="permission-label">无权限(v-permissions.display)</span>
|
|
105
|
+
<button class="native-btn" size="small" v-permissions.display="['test:del']">删除</button>
|
|
106
|
+
</li>
|
|
107
|
+
<li class="permission-item">
|
|
108
|
+
<span class="permission-label">无权限(v-permissions remove)</span>
|
|
109
|
+
<button class="native-btn" size="small" v-permissions="['test:del']">删除</button>
|
|
110
|
+
</li>
|
|
111
|
+
</ul>
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
<!-- 路由 -->
|
|
115
|
+
<section class="playground-section">
|
|
116
|
+
<h2 class="section-title">路由跳转</h2>
|
|
117
|
+
<div class="route-actions">
|
|
118
|
+
<el-button type="success" plain size="small" @click="handleRouterSystemMine">跳转到个人中心</el-button>
|
|
119
|
+
<el-button type="success" plain size="small" @click="handleMenuApi">获取完整菜单数据</el-button>
|
|
120
|
+
<el-cascader
|
|
121
|
+
v-model="currentRoute"
|
|
122
|
+
:options="routeOptions"
|
|
123
|
+
:props="{
|
|
124
|
+
emitPath: false,
|
|
125
|
+
value: 'name',
|
|
126
|
+
label: 'name'
|
|
127
|
+
}"
|
|
128
|
+
size="small"
|
|
129
|
+
:show-all-levels="false"
|
|
130
|
+
@change="handleRouteChange"
|
|
131
|
+
>
|
|
132
|
+
<template #default="{ data }">
|
|
133
|
+
<span>{{ data.meta.title }}</span>
|
|
134
|
+
</template>
|
|
135
|
+
</el-cascader>
|
|
136
|
+
</div>
|
|
137
|
+
</section>
|
|
138
|
+
|
|
139
|
+
<!-- Element 组件 -->
|
|
140
|
+
<section class="playground-section">
|
|
141
|
+
<h2 class="section-title">Element 组件</h2>
|
|
142
|
+
<el-date-picker-panel v-model="datePicker" />
|
|
143
|
+
</section>
|
|
144
|
+
|
|
145
|
+
<!-- 网络请求 -->
|
|
117
146
|
<RequestPage />
|
|
118
147
|
</div>
|
|
119
148
|
<router-view></router-view>
|
|
120
149
|
</template>
|
|
121
150
|
|
|
122
151
|
<style scoped lang="scss">
|
|
123
|
-
|
|
124
|
-
|
|
152
|
+
.playground {
|
|
153
|
+
padding: 32px;
|
|
154
|
+
max-width: 960px;
|
|
155
|
+
margin: 0 auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.playground-header {
|
|
159
|
+
margin-bottom: 40px;
|
|
160
|
+
padding-bottom: 24px;
|
|
161
|
+
border-bottom: 1px solid var(--jnrs-card-primary-03, #e8e8e8);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.playground-title {
|
|
165
|
+
font-size: 28px;
|
|
166
|
+
font-weight: 700;
|
|
167
|
+
color: var(--jnrs-font-primary);
|
|
168
|
+
margin: 0 0 4px;
|
|
169
|
+
letter-spacing: -0.5px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.playground-subtitle {
|
|
173
|
+
font-size: 14px;
|
|
174
|
+
color: var(--jnrs-font-primary-03, #999);
|
|
175
|
+
margin: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.playground-section {
|
|
179
|
+
margin-bottom: 36px;
|
|
180
|
+
|
|
181
|
+
+ .playground-section {
|
|
182
|
+
padding-top: 28px;
|
|
183
|
+
border-top: 1px solid var(--jnrs-card-primary-03, #e8e8e8);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.section-title {
|
|
188
|
+
font-size: 16px;
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
color: var(--jnrs-font-primary);
|
|
191
|
+
margin: 0 0 12px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.section-note {
|
|
195
|
+
font-size: 12px;
|
|
196
|
+
color: var(--jnrs-color-warning, #e6a23c);
|
|
197
|
+
margin: 0 0 12px;
|
|
125
198
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
199
|
+
|
|
200
|
+
.test-grid {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
gap: 8px;
|
|
204
|
+
margin-bottom: 12px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.test-item {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: 12px;
|
|
211
|
+
padding: 6px 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.test-label {
|
|
215
|
+
font-size: 13px;
|
|
216
|
+
color: var(--jnrs-font-primary-03, #999);
|
|
217
|
+
min-width: 160px;
|
|
218
|
+
flex-shrink: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.test-value {
|
|
222
|
+
font-size: 13px;
|
|
223
|
+
color: var(--jnrs-font-primary);
|
|
224
|
+
font-family: 'SF Mono', 'Menlo', monospace;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.permission-list {
|
|
228
|
+
list-style: none;
|
|
229
|
+
padding: 0;
|
|
230
|
+
margin: 0;
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: 8px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.permission-item {
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
gap: 12px;
|
|
240
|
+
padding: 6px 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.permission-label {
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
color: var(--jnrs-font-primary-03, #999);
|
|
246
|
+
min-width: 220px;
|
|
247
|
+
flex-shrink: 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.native-btn {
|
|
251
|
+
padding: 5px 12px;
|
|
252
|
+
font-size: 12px;
|
|
253
|
+
border: 1px solid var(--jnrs-color-primary);
|
|
254
|
+
border-radius: 4px;
|
|
255
|
+
background: var(--jnrs-color-primary);
|
|
256
|
+
color: #fff;
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
|
|
259
|
+
&:disabled {
|
|
260
|
+
opacity: 0.5;
|
|
261
|
+
cursor: not-allowed;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.route-actions {
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: 12px;
|
|
269
|
+
flex-wrap: wrap;
|
|
130
270
|
}
|
|
131
271
|
</style>
|
|
@@ -26,6 +26,7 @@ const emit = defineEmits<{
|
|
|
26
26
|
const loading = ref(false)
|
|
27
27
|
const editDialogRef = ref()
|
|
28
28
|
const ruleFormRef = ref<FormInstance>()
|
|
29
|
+
const editingRow = ref<{ code?: number; name?: string } | null>(null)
|
|
29
30
|
const ruleForm = ref<AddPortfolioProgram | UpdatePortfolioProgram>({
|
|
30
31
|
id: undefined,
|
|
31
32
|
portfolioId: undefined,
|
|
@@ -47,6 +48,7 @@ const rules = ref<FormRules>({
|
|
|
47
48
|
})
|
|
48
49
|
|
|
49
50
|
const open = (row?: PortfolioProgram, portfolioId?: number) => {
|
|
51
|
+
editingRow.value = row ? { code: row.code, name: row.name } : null
|
|
50
52
|
editDialogRef.value.open()
|
|
51
53
|
nextTick(() => {
|
|
52
54
|
handleReset()
|
|
@@ -106,6 +108,14 @@ defineExpose({
|
|
|
106
108
|
|
|
107
109
|
<template>
|
|
108
110
|
<JnDialog ref="editDialogRef" title="项目集管理" width="600px">
|
|
111
|
+
<el-alert v-if="editingRow" type="warning" :closable="false" show-icon>
|
|
112
|
+
<template #title>
|
|
113
|
+
当前编辑:项目集编码
|
|
114
|
+
<strong>{{ editingRow.code }}</strong>
|
|
115
|
+
| 项目集名称
|
|
116
|
+
<strong>{{ editingRow.name }}</strong>
|
|
117
|
+
</template>
|
|
118
|
+
</el-alert>
|
|
109
119
|
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto" v-loading="loading">
|
|
110
120
|
<el-form-item prop="id"></el-form-item>
|
|
111
121
|
<el-form-item label="项目集编码" prop="code">
|
|
@@ -212,7 +212,7 @@ onActivated(() => {
|
|
|
212
212
|
<el-switch v-model="row.enable" @change="handleEnableChange(row)" />
|
|
213
213
|
</template>
|
|
214
214
|
</el-table-column>
|
|
215
|
-
<el-table-column label="操作" width="
|
|
215
|
+
<el-table-column label="操作" width="120" align="center" fixed="right">
|
|
216
216
|
<template #default="{ row }">
|
|
217
217
|
<el-button link type="primary" @click.stop="handleEdit(row)">编辑</el-button>
|
|
218
218
|
<el-button link type="danger" @click.stop="handleDelete(row)">删除</el-button>
|
|
@@ -15,10 +15,10 @@ import { ref, nextTick } from 'vue'
|
|
|
15
15
|
import { ElMessage } from 'element-plus'
|
|
16
16
|
import { objectMatchAssign } from '@jnrs/shared'
|
|
17
17
|
import { extractFieldId } from '@/utils'
|
|
18
|
-
import { getDictList } from '@/utils'
|
|
19
18
|
import { addPortfolioProjectApi, editPortfolioProjectApi } from '@/api/examples/portfolio-management/project'
|
|
20
19
|
import { JnDialog } from '@jnrs/vue-core/components'
|
|
21
20
|
import SelectManager from '@/components/select/SelectManager.vue'
|
|
21
|
+
import DictSelector from '@/components/common/DictSelector.vue'
|
|
22
22
|
|
|
23
23
|
const emit = defineEmits<{
|
|
24
24
|
success: []
|
|
@@ -27,6 +27,7 @@ const emit = defineEmits<{
|
|
|
27
27
|
const loading = ref(false)
|
|
28
28
|
const editDialogRef = ref()
|
|
29
29
|
const ruleFormRef = ref<FormInstance>()
|
|
30
|
+
const editingRow = ref<{ code?: number; name?: string } | null>(null)
|
|
30
31
|
const ruleForm = ref<AddPortfolioProject | UpdatePortfolioProject>({
|
|
31
32
|
id: undefined,
|
|
32
33
|
programId: undefined,
|
|
@@ -48,6 +49,7 @@ const rules = ref<FormRules>({
|
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
const open = (programId?: string, row?: PortfolioProject) => {
|
|
52
|
+
editingRow.value = row ? { code: row.code, name: row.name } : null
|
|
51
53
|
editDialogRef.value.open()
|
|
52
54
|
nextTick(() => {
|
|
53
55
|
handleReset()
|
|
@@ -105,6 +107,14 @@ defineExpose({
|
|
|
105
107
|
|
|
106
108
|
<template>
|
|
107
109
|
<JnDialog ref="editDialogRef" title="项目管理" width="600px">
|
|
110
|
+
<el-alert v-if="editingRow" type="info" :closable="false" show-icon>
|
|
111
|
+
<template #title>
|
|
112
|
+
当前编辑:项目编码
|
|
113
|
+
<strong>{{ editingRow.code }}</strong>
|
|
114
|
+
| 项目名称
|
|
115
|
+
<strong>{{ editingRow.name }}</strong>
|
|
116
|
+
</template>
|
|
117
|
+
</el-alert>
|
|
108
118
|
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto" v-loading="loading">
|
|
109
119
|
<el-form-item prop="id"></el-form-item>
|
|
110
120
|
<el-form-item label="项目编码" prop="code">
|
|
@@ -121,14 +131,7 @@ defineExpose({
|
|
|
121
131
|
<el-input v-model.trim="ruleForm.name" maxlength="20" show-word-limit style="width: 100%" />
|
|
122
132
|
</el-form-item>
|
|
123
133
|
<el-form-item label="项目类型" prop="projectType">
|
|
124
|
-
<
|
|
125
|
-
<el-option
|
|
126
|
-
:label="item.label"
|
|
127
|
-
:value="item.value"
|
|
128
|
-
v-for="item in getDictList('projectType')"
|
|
129
|
-
:key="item.value"
|
|
130
|
-
/>
|
|
131
|
-
</el-select>
|
|
134
|
+
<DictSelector v-model="ruleForm.projectType" dictName="projectType" />
|
|
132
135
|
</el-form-item>
|
|
133
136
|
<el-form-item label="项目经理" prop="managerId">
|
|
134
137
|
<SelectManager
|
|
@@ -9,7 +9,7 @@ import type { FormInstance, FormRules } from 'element-plus'
|
|
|
9
9
|
import { ref, nextTick } from 'vue'
|
|
10
10
|
import { ElMessage } from 'element-plus'
|
|
11
11
|
import { objectMatchAssign, verifyNumberGtZero } from '@jnrs/shared'
|
|
12
|
-
import {
|
|
12
|
+
import { extractFieldId } from '@/utils'
|
|
13
13
|
import {
|
|
14
14
|
type Program,
|
|
15
15
|
type AddProgram,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@/api/examples/program-management'
|
|
20
20
|
import { JnDialog } from '@jnrs/vue-core/components'
|
|
21
21
|
import SelectManager from '@/components/select/SelectManager.vue'
|
|
22
|
+
import DictSelector from '@/components/common/DictSelector.vue'
|
|
22
23
|
|
|
23
24
|
const emit = defineEmits<{
|
|
24
25
|
success: []
|
|
@@ -27,6 +28,7 @@ const emit = defineEmits<{
|
|
|
27
28
|
const loading = ref(false)
|
|
28
29
|
const editDialogRef = ref()
|
|
29
30
|
const ruleFormRef = ref<FormInstance>()
|
|
31
|
+
const editingRow = ref<{ code?: number; name?: string } | null>(null)
|
|
30
32
|
const ruleForm = ref<AddProgram | UpdateProgram>({
|
|
31
33
|
id: '',
|
|
32
34
|
code: 0,
|
|
@@ -54,6 +56,7 @@ const rules = ref<FormRules>({
|
|
|
54
56
|
|
|
55
57
|
// 打开弹窗
|
|
56
58
|
const open = (row?: Program) => {
|
|
59
|
+
editingRow.value = row ? { code: row.code, name: row.name } : null
|
|
57
60
|
editDialogRef.value.open()
|
|
58
61
|
nextTick(() => {
|
|
59
62
|
handleReset()
|
|
@@ -122,6 +125,14 @@ defineExpose({
|
|
|
122
125
|
<template>
|
|
123
126
|
<!-- 编辑弹窗 -->
|
|
124
127
|
<JnDialog ref="editDialogRef" title="项目集管理" width="600px">
|
|
128
|
+
<el-alert v-if="editingRow" type="info" :closable="false" show-icon>
|
|
129
|
+
<template #title>
|
|
130
|
+
当前编辑:项目集编码
|
|
131
|
+
<strong>{{ editingRow.code }}</strong>
|
|
132
|
+
| 项目集名称
|
|
133
|
+
<strong>{{ editingRow.name }}</strong>
|
|
134
|
+
</template>
|
|
135
|
+
</el-alert>
|
|
125
136
|
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto" v-loading="loading">
|
|
126
137
|
<el-form-item prop="id"></el-form-item>
|
|
127
138
|
<el-form-item label="项目集编码" prop="code">
|
|
@@ -161,28 +172,13 @@ defineExpose({
|
|
|
161
172
|
</el-input-number>
|
|
162
173
|
</el-form-item>
|
|
163
174
|
<el-form-item label="状态" prop="status">
|
|
164
|
-
<
|
|
165
|
-
<el-option
|
|
166
|
-
:label="item.label"
|
|
167
|
-
:value="item.value"
|
|
168
|
-
v-for="item in getDictList('programStatus')"
|
|
169
|
-
:key="item.value"
|
|
170
|
-
/>
|
|
171
|
-
</el-select>
|
|
175
|
+
<DictSelector v-model="ruleForm.status" dictName="programStatus" />
|
|
172
176
|
</el-form-item>
|
|
173
177
|
<el-form-item label="开始日期" prop="startDate">
|
|
174
|
-
<el-date-picker
|
|
175
|
-
v-model="ruleForm.startDate"
|
|
176
|
-
value-format="YYYY-MM-DD"
|
|
177
|
-
style="width: 220px"
|
|
178
|
-
/>
|
|
178
|
+
<el-date-picker v-model="ruleForm.startDate" value-format="YYYY-MM-DD" style="width: 220px" />
|
|
179
179
|
</el-form-item>
|
|
180
180
|
<el-form-item label="结束日期" prop="endDate">
|
|
181
|
-
<el-date-picker
|
|
182
|
-
v-model="ruleForm.endDate"
|
|
183
|
-
value-format="YYYY-MM-DD"
|
|
184
|
-
style="width: 220px"
|
|
185
|
-
/>
|
|
181
|
+
<el-date-picker v-model="ruleForm.endDate" value-format="YYYY-MM-DD" style="width: 220px" />
|
|
186
182
|
</el-form-item>
|
|
187
183
|
<el-form-item label="描述" prop="description">
|
|
188
184
|
<el-input
|