|
|
@@ -85,28 +85,26 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { firstCharToLowerCase } from '@/utils/tool'; |
|
|
|
import { queryAllTemplateNodeModelFile } from '@/services/template'; |
|
|
|
export default { |
|
|
|
props: { |
|
|
|
oneOf: Function, |
|
|
|
onButtnClick: Function, |
|
|
|
selectSystemFiles: Function, |
|
|
|
selectSystemFolders: Function, |
|
|
|
listTempFiles: { |
|
|
|
type: Array, |
|
|
|
default() { |
|
|
|
return [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
currentNodeFolder: Object, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
selectedFileIndex: 0,//选择的样板文件的索引值 |
|
|
|
isShowNewFiledialog: false, |
|
|
|
isShowNewTemplateFileDialog: false,//新建样板文件弹窗 |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.loadListTempFiles(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** |
|
|
|
* @description: 新建文件弹框 |
|
|
@@ -129,6 +127,19 @@ export default { |
|
|
|
fileTempClick(item, index) { |
|
|
|
this.$emit('fileTempClick', item); |
|
|
|
this.hideNewFiledialog(); |
|
|
|
}, |
|
|
|
async loadListTempFiles() { |
|
|
|
const currentNodeFolderId = this.currentNodeFolder?.nodeId; |
|
|
|
if(!currentNodeFolderId) { return; } |
|
|
|
|
|
|
|
const res = await queryAllTemplateNodeModelFile(currentNodeFolderId); |
|
|
|
if (res.Code !== 0) return; |
|
|
|
this.listTempFiles = (res.Data || []).map(f => firstCharToLowerCase(f)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
currentNodeFolder() { |
|
|
|
this.loadListTempFiles(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|