feima-shortcuts 0.1.1 → 0.1.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/package.json
CHANGED
|
@@ -9,7 +9,7 @@ function toKebabCase(str) {
|
|
|
9
9
|
return str.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const templateStr = ({fileName}) => {
|
|
12
|
+
const templateStr = ({ fileName }) => {
|
|
13
13
|
const className = toKebabCase(fileName);
|
|
14
14
|
|
|
15
15
|
return `<template>
|
|
@@ -19,7 +19,6 @@ const templateStr = ({fileName}) => {
|
|
|
19
19
|
:params="params"
|
|
20
20
|
:columns="columns"
|
|
21
21
|
:request="request"
|
|
22
|
-
style="max-width: 1000px"
|
|
23
22
|
>
|
|
24
23
|
<template #option="scopeData">
|
|
25
24
|
<el-table-column v-bind="scopeData">
|
|
@@ -95,6 +94,7 @@ const request = ({ createTime, ...params }: any) => {
|
|
|
95
94
|
<style lang="scss" scoped>
|
|
96
95
|
.${className} {
|
|
97
96
|
height: 100%;
|
|
97
|
+
overflow-y: auto;
|
|
98
98
|
|
|
99
99
|
:deep(.el-card__body) {
|
|
100
100
|
--el-card-padding: 0;
|
|
@@ -128,15 +128,15 @@ exports.run = function (answers) {
|
|
|
128
128
|
process.chdir(makeDirPath);
|
|
129
129
|
|
|
130
130
|
const template = templateStr({ fileName });
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
const targetFilePath = `./${fileIndex}`;
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
// 新增:判断文件是否存在
|
|
135
135
|
if (fs.existsSync(targetFilePath)) {
|
|
136
136
|
console.log(`❌ 文件已存在:${targetFilePath},未进行覆盖操作。`);
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
fs.writeFileSync(targetFilePath, template);
|
|
141
141
|
console.log(`✅ 文件创建成功`);
|
|
142
142
|
};
|
|
@@ -180,7 +180,7 @@ const onSubmit = async () => {
|
|
|
180
180
|
.${className} {
|
|
181
181
|
height: calc(100% - var(--page-footer-height));
|
|
182
182
|
padding-bottom: var(--page-footer-height);
|
|
183
|
-
overflow-y:
|
|
183
|
+
overflow-y: auto;
|
|
184
184
|
--form-item-content: 250px;
|
|
185
185
|
|
|
186
186
|
:deep(.el-form-item__content) {
|